From e5f2f6c1913ca73329be93c78b6342d3665d4282 Mon Sep 17 00:00:00 2001 From: gengruilin Date: Sun, 8 Nov 2026 21:29:18 +0800 Subject: [PATCH] refactor(feishu): show the account through the connector account registry The Host row registers its account runtime with `ctx.connectorAccounts`, keyed by the bundle package, and the presenter and tests use the connector account types; the Web connection test reads the shared section's `data-connector-account` attributes. The package manifests follow the root's version and published files. --- apps/web/tests/feishu-connection.e2e.ts | 10 +++++----- .../connector/feishu-cli/README.i18n.yaml | 12 ++++++------ packages/connector/feishu-cli/README.md | 6 +++--- packages/connector/feishu-cli/README.zh.md | 6 +++--- packages/connector/feishu-cli/package.json | 9 ++++++--- packages/connector/feishu-cli/src/index.ts | 12 ++++++------ .../connector/feishu-cli/src/presentation.ts | 19 ++++++++++--------- .../feishu-cli/tests/account.spec.ts | 15 ++++++++------- .../connector/feishu-cli/tests/plugin.spec.ts | 8 ++++---- .../feishu-cli/tests/presentation.spec.ts | 6 +++--- packages/connector/feishu-cli/tsconfig.json | 2 +- packages/connector/feishu/README.i18n.yaml | 8 ++++---- packages/connector/feishu/README.md | 4 ++-- packages/connector/feishu/README.zh.md | 4 ++-- packages/connector/feishu/package.json | 7 +++++-- pnpm-lock.yaml | 6 +++--- 16 files changed, 71 insertions(+), 63 deletions(-) diff --git a/apps/web/tests/feishu-connection.e2e.ts b/apps/web/tests/feishu-connection.e2e.ts index 62335509a4..ac6957904b 100644 --- a/apps/web/tests/feishu-connection.e2e.ts +++ b/apps/web/tests/feishu-connection.e2e.ts @@ -109,8 +109,8 @@ describe.skipIf(process.platform === 'win32')('web e2e: Feishu plugin connection await page.getByRole('navigation', { name: '全局面板' }).getByRole('button', { name: '插件', exact: true }).click() const panel = page.locator('[data-plugin-panel]') await panel.getByRole('button', { name: '查看 飞书插件', exact: true }).click({ timeout: 20_000 }) - const section = panel.locator('[data-cli-account-package="@deepseek-ai/dsh-feishu"]') - await expect.poll(() => section.getAttribute('data-cli-account'), { timeout: 20_000 }).toBe('disconnected') + const section = panel.locator('[data-connector-account-key="@deepseek-ai/dsh-feishu"]') + await expect.poll(() => section.getAttribute('data-connector-account'), { timeout: 20_000 }).toBe('disconnected') expect(await panel.locator('[data-plugin-detail]').getByText('未连接', { exact: true }).count()).toBe(2) const opened: Page[] = [] @@ -118,7 +118,7 @@ describe.skipIf(process.platform === 'win32')('web e2e: Feishu plugin connection await writeFile(join(binDir, 'setup-fails'), '') await section.getByRole('button', { name: '关联飞书应用', exact: true }).click() await section.getByRole('alert').waitFor({ timeout: 20_000 }) - expect(await section.getAttribute('data-cli-account')).toBe('disconnected') + expect(await section.getAttribute('data-connector-account')).toBe('disconnected') expect(await section.getByRole('alert').innerText()).toContain('internal · sdk_error') expect(await section.getByRole('alert').innerText()).toContain('已有应用') expect(await section.innerText()).not.toContain('fixture-secret') @@ -131,14 +131,14 @@ describe.skipIf(process.platform === 'win32')('web e2e: Feishu plugin connection await page.getByText('飞书应用已关联,下一步登录飞书账号', { exact: true }).waitFor({ timeout: 20_000 }) expect(opened.map(popup => popup.url())).toEqual([SETUP_URL, SETUP_RETRY_URL]) await section.getByRole('button', { name: '登录飞书账号', exact: true }).click() - await expect.poll(() => section.getAttribute('data-cli-account'), { timeout: 20_000 }).toBe('connected') + await expect.poll(() => section.getAttribute('data-connector-account'), { timeout: 20_000 }).toBe('connected') expect(opened.map(popup => popup.url())).toEqual([SETUP_URL, SETUP_RETRY_URL, SIGN_IN_URL]) await section.getByText('已登录为 测试用户。可以在对话中直接请 Agent 使用飞书。', { exact: true }).waitFor({ timeout: 10_000 }) await page.getByText('飞书已连接', { exact: true }).waitFor({ timeout: 10_000 }) await section.getByRole('button', { name: '退出登录', exact: true }).click() await page.getByRole('dialog', { name: '退出飞书登录?' }).getByRole('button', { name: '退出登录', exact: true }).click() - await expect.poll(() => section.getAttribute('data-cli-account'), { timeout: 20_000 }).toBe('disconnected') + await expect.poll(() => section.getAttribute('data-connector-account'), { timeout: 20_000 }).toBe('disconnected') await page.getByText('已退出飞书登录', { exact: true }).waitFor({ timeout: 10_000 }) expect(tripwire.pageErrors).toEqual([]) }) diff --git a/packages/connector/feishu-cli/README.i18n.yaml b/packages/connector/feishu-cli/README.i18n.yaml index acd0d5b61e..c54a65930f 100644 --- a/packages/connector/feishu-cli/README.i18n.yaml +++ b/packages/connector/feishu-cli/README.i18n.yaml @@ -9,8 +9,8 @@ en: f2f13a80da6d47d4 zh: 11d81fb7e8536625 /deepseek-ai-dsh-feishu-cli/summary: - en: c6c3d037f2ed0349 - zh: 05eac0e12c42bd11 + en: 6f7e1fce73c126e2 + zh: a08f9c1206cac64d /deepseek-ai-dsh-feishu-cli/table-of-contents: en: d152484eb41ac6b4 zh: 09388d293f9be9cb @@ -24,8 +24,8 @@ en: 9d569e4985f0cb50 zh: 8b4d403d63ae7616 /deepseek-ai-dsh-feishu-cli/use-this-package/account-operations: - en: c29407455b7e57d8 - zh: 94ba1b3a7c1344d9 + en: 0c5e7c20700696c0 + zh: a6ac0c5e80ad248d /deepseek-ai-dsh-feishu-cli/use-this-package/configure: en: d4458b73049501cd zh: f929f9aada46111b @@ -33,8 +33,8 @@ en: e9381ea7fb625689 zh: e2da467be5fcef8a /deepseek-ai-dsh-feishu-cli/further-exploration: - en: c52b65c48041edfb - zh: bbe89108cfa694f5 + en: bcc5c966152ec53b + zh: 798690dc155a0022 /deepseek-ai-dsh-feishu-cli/model-experience: en: 215e7ba838619b7b zh: a311da3843709f90 diff --git a/packages/connector/feishu-cli/README.md b/packages/connector/feishu-cli/README.md index f15590d75d..c812686905 100644 --- a/packages/connector/feishu-cli/README.md +++ b/packages/connector/feishu-cli/README.md @@ -9,7 +9,7 @@ English | [中文](README.zh.md) ## Summary -This package is the Host row of the [Feishu plugin](../feishu/README.md). It installs a pinned `@larksuite/cli`, gives the model the absolute path of its `lark-cli` executable in runtime context, and registers one `feishu` skill that indexes the guides embedded in that CLI. It registers the account with the [CLI account registry](../../client/ui-cli-account/README.md), whose Plugins page section checks the default account, links an app and signs in through the CLI's browser flows, signs out, and cancels. The CLI keeps credentials in its default configuration, which the user's own terminal shares. Only macOS is supported. +This package is the Host row of the [Feishu plugin](../feishu/README.md). It installs a pinned `@larksuite/cli`, gives the model the absolute path of its `lark-cli` executable in runtime context, and registers one `feishu` skill that indexes the guides embedded in that CLI. It registers the account with the [connector account registry](../../client/ui-connector-account/README.md), whose Plugins page section checks the default account, links an app and signs in through the CLI's browser flows, signs out, and cancels. The CLI keeps credentials in its default configuration, which the user's own terminal shares. Only macOS is supported. ## Table of Contents @@ -38,7 +38,7 @@ Turning the row off in Plugin Manager withdraws the `feishu` skill and the path ### Account operations -The Plugins page drives these operations through the CLI account registry, which the Web app loads; a headless profile loads the plugin without it. The Host runs at most one account operation at a time and owns it, so leaving the page does not cancel it. Linking an app and signing in are separate operations, so the page starts each one from its own click. +The Plugins page drives these operations through the connector account registry, which the Web app loads; a headless profile loads the plugin without it. The Host runs at most one account operation at a time and owns it, so leaving the page does not cancel it. Linking an app and signing in are separate operations, so the page starts each one from its own click. | Operation | Effect | |---|---| @@ -84,7 +84,7 @@ The generated [config catalog](../../../docs/config-catalog.md#deepseek-aidsh-fe - [CLI account library](../cli-account/README.md) — command execution, the CLI path context, and account operations shared by CLI app plugins. - [Skills](../../../docs/subsystems/skills.md) — catalog publication, loading, and precedence. - [Feishu plugin](../feishu/README.md) — the bundle that inserts this row and the page row. -- [CLI account surfaces](../../client/ui-cli-account/README.md) — the registry and the Plugins page section that drive the account operations. +- [Connector account surfaces](../../client/ui-connector-account/README.md) — the registry and the Plugins page section that drive the account operations. - [Plugin Manager](../../boot/plugin-manager/README.md) — installation, build-script approval, and enablement. ----- diff --git a/packages/connector/feishu-cli/README.zh.md b/packages/connector/feishu-cli/README.zh.md index c509bc96ce..fd8feabd51 100644 --- a/packages/connector/feishu-cli/README.zh.md +++ b/packages/connector/feishu-cli/README.zh.md @@ -9,7 +9,7 @@ kind: "package-reference" ## 概述 -本包是[飞书插件](../feishu/README.zh.md)的 Host 行。它安装固定版本的 `@larksuite/cli`,在运行时上下文中把其 `lark-cli` 可执行文件的绝对路径告诉模型,并注册一个 `feishu` skill,为该 CLI 内嵌的子指南提供索引。它把账号注册到 [CLI 账号注册表](../../client/ui-cli-account/README.zh.md),其插件页区块负责检查默认账号、通过 CLI 的浏览器流程关联应用并登录、退出登录以及取消操作。CLI 把凭据保存在默认配置中,用户自己的终端也共用这份配置。仅支持 macOS。 +本包是[飞书插件](../feishu/README.zh.md)的 Host 行。它安装固定版本的 `@larksuite/cli`,在运行时上下文中把其 `lark-cli` 可执行文件的绝对路径告诉模型,并注册一个 `feishu` skill,为该 CLI 内嵌的子指南提供索引。它把账号注册到 [连接器账号注册表](../../client/ui-connector-account/README.zh.md),其插件页区块负责检查默认账号、通过 CLI 的浏览器流程关联应用并登录、退出登录以及取消操作。CLI 把凭据保存在默认配置中,用户自己的终端也共用这份配置。仅支持 macOS。 ## 目录 @@ -38,7 +38,7 @@ kind: "package-reference" ### 账号操作 -插件页通过 CLI 账号注册表发起这些操作,注册表由 Web 应用加载;headless profile 加载插件时没有它。Host 同一时间最多运行一个账号操作并持有它,因此离开页面不会取消操作。关联应用和登录是两个独立操作,页面分别由各自的一次点击发起。 +插件页通过 连接器账号注册表发起这些操作,注册表由 Web 应用加载;headless profile 加载插件时没有它。Host 同一时间最多运行一个账号操作并持有它,因此离开页面不会取消操作。关联应用和登录是两个独立操作,页面分别由各自的一次点击发起。 | 操作 | 作用 | |---|---| @@ -84,7 +84,7 @@ kind: "package-reference" - [CLI 账号库](../cli-account/README.zh.md)——CLI 应用插件共用的命令执行、CLI 路径上下文与账号操作。 - [Skills](../../../docs/subsystems/skills.zh.md)——目录发布、加载与优先级。 - [飞书插件](../feishu/README.zh.md)——插入本行与页面行的 bundle。 -- [CLI 账号界面](../../client/ui-cli-account/README.zh.md)——发起账号操作的注册表和插件页区块。 +- [连接器账号界面](../../client/ui-connector-account/README.zh.md)——发起账号操作的注册表和插件页区块。 - [Plugin Manager](../../boot/plugin-manager/README.zh.md)——安装、构建脚本审批与启用。 ----- diff --git a/packages/connector/feishu-cli/package.json b/packages/connector/feishu-cli/package.json index dffd9a6975..7763f00f71 100644 --- a/packages/connector/feishu-cli/package.json +++ b/packages/connector/feishu-cli/package.json @@ -1,7 +1,7 @@ { "name": "@deepseek-ai/dsh-feishu-cli", "description": "Feishu through the official lark-cli: the CLI by its absolute path, its embedded skills, and account operations over Remote", - "version": "0.2.2-alpha.2", + "version": "0.2.2-rc.1", "icon": "./icon.svg", "publishConfig": { "access": "public" @@ -27,7 +27,10 @@ "icon.svg", "locale/*.json", "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", + "src" ], "license": "MIT", "dependencies": { @@ -46,7 +49,7 @@ }, "devDependencies": { "@deepseek-ai/cordis": "workspace:~", - "@deepseek-ai/dsh-client-ui-cli-account": "workspace:*", + "@deepseek-ai/dsh-client-ui-connector-account": "workspace:*", "@deepseek-ai/dsh-skill": "workspace:*", "@deepseek-ai/dsh-subprocess": "workspace:*", "@deepseek-ai/dsh-system-prompt": "workspace:*" diff --git a/packages/connector/feishu-cli/src/index.ts b/packages/connector/feishu-cli/src/index.ts index 83960b54f5..72a5e7c331 100644 --- a/packages/connector/feishu-cli/src/index.ts +++ b/packages/connector/feishu-cli/src/index.ts @@ -1,6 +1,6 @@ /** * Feishu plugin: tells the model the managed lark-cli's absolute path, registers - * its embedded skills, and shows the account on the Plugins page through the CLI + * its embedded skills, and shows the account on the Plugins page through the connector * account registry. The CLI's default account is shared with the user's own terminal. * @module @deepseek-ai/dsh-feishu */ @@ -8,7 +8,7 @@ import type { Context } from '@deepseek-ai/cordis' import type z from '@deepseek-ai/schemastery' import { CliAccountConfig, CliCommandExecutor, registerCliPathContext } from '@deepseek-ai/dsh-cli-account' -import type {} from '@deepseek-ai/dsh-client-ui-cli-account' +import type {} from '@deepseek-ai/dsh-client-ui-connector-account' import type {} from '@deepseek-ai/dsh-skill' import type {} from '@deepseek-ai/dsh-subprocess' import type {} from '@deepseek-ai/dsh-system-prompt' @@ -32,7 +32,7 @@ export type Config = CliAccountConfig export const Config: z = CliAccountConfig /** - * Register the CLI and its skills, and show the account on the Plugins page while the CLI account registry runs. + * Register the CLI and its skills, and show the account on the Plugins page while the connector account registry runs. * @param ctx - Context carrying the skill registry, subprocess runtime, and system prompt. * @param config - CLI location and command deadline. * @throws when `lark-cli` is not executable. @@ -44,9 +44,9 @@ export function apply(ctx: Context, config: Config): void { const account = new FeishuAccount(cli, ctx.logger) ctx.effect(() => () => account.dispose(), 'feishu: account') ctx.skills.registerProvider(control => new FeishuSkillProvider(cli, control)) - ctx.inject(['cliAccounts'], (scope) => { - scope.effect(() => scope.cliAccounts.register({ - packageName: FEISHU_PACKAGE, source: account, operations: OPERATIONS, copy: COPY, present: presentAccount, + ctx.inject(['connectorAccounts'], (scope) => { + scope.effect(() => scope.connectorAccounts.register({ + key: FEISHU_PACKAGE, packageName: FEISHU_PACKAGE, source: account, operations: OPERATIONS, copy: COPY, present: presentAccount, }), 'feishu: Plugins page account') }) } diff --git a/packages/connector/feishu-cli/src/presentation.ts b/packages/connector/feishu-cli/src/presentation.ts index 7002cae5e1..f857d3246a 100644 --- a/packages/connector/feishu-cli/src/presentation.ts +++ b/packages/connector/feishu-cli/src/presentation.ts @@ -1,8 +1,9 @@ /** The Feishu account section the Plugins page shows for each Host view. */ import { failureDetails } from '@deepseek-ai/dsh-cli-account' import type { - CliAccountButton, CliAccountCopy, CliAccountDisplay, CliAccountFailure, CliAccountNote, CliAccountOperation, -} from '@deepseek-ai/dsh-cli-account/types' + ConnectorAccountButton, ConnectorAccountCopy, ConnectorAccountDisplay, ConnectorAccountFailure, ConnectorAccountNote, + ConnectorAccountOperation, +} from '@deepseek-ai/dsh-client-ui-connector-account/types' import { assertNever } from '@deepseek-ai/dsh-util-values' import { text } from './locales.ts' import type { FeishuAppId, FeishuOperationKind, FeishuState } from './types.ts' @@ -12,7 +13,7 @@ export const FEISHU_PACKAGE = '@deepseek-ai/dsh-feishu' /* jscpd:ignore-start -- CLI app plugins declare page operations, copy, and commands alike, each with its own text. */ /** The operations the section's buttons start; each but a check reports a notice in the browser that started it. */ -export const OPERATIONS: readonly CliAccountOperation[] = [ +export const OPERATIONS: readonly ConnectorAccountOperation[] = [ { kind: 'check' }, { kind: 'link-app', notice: text('notice.app-linked') }, { kind: 'sign-in', notice: text('notice.connected') }, @@ -20,7 +21,7 @@ export const OPERATIONS: readonly CliAccountOperation[] = [ ] /** The section's title and hint, and the prompt after the bundle is switched on while disconnected. */ -export const COPY: CliAccountCopy = { +export const COPY: ConnectorAccountCopy = { title: text('section.title'), hint: text('hint'), activation: { title: text('activation.title'), body: text('activation.body'), connect: text('action.connect') }, @@ -50,9 +51,9 @@ function step(operation: Operation): Step { } /** The section while an operation runs: its step, the Feishu page and its guidance while waiting there, and cancel. */ -function presentOperation(operation: Operation): CliAccountDisplay { +function presentOperation(operation: Operation): ConnectorAccountDisplay { const current = step(operation) - const buttons: CliAccountButton[] = [] + const buttons: ConnectorAccountButton[] = [] if (operation.authorizationUrl !== undefined) buttons.push({ label: text('action.open'), command: { kind: 'open' }, variant: 'primary' }) if (operation.cancellable) buttons.push({ label: text('action.cancel'), command: { kind: 'cancel' }, variant: 'ghost' }) const guidance = operation.authorizationUrl === undefined ? undefined @@ -65,7 +66,7 @@ function presentOperation(operation: Operation): CliAccountDisplay { } /** The row that names the linked app and replaces it after a confirmation. */ -function appNotes(appId: FeishuAppId): CliAccountNote[] { +function appNotes(appId: FeishuAppId): ConnectorAccountNote[] { return [{ text: text('app.linked', { id: appId }), button: { @@ -76,7 +77,7 @@ function appNotes(appId: FeishuAppId): CliAccountNote[] { } /** The last failed operation's guidance, with its command, exit code, and the CLI's classified error. */ -function failureOf(result: FeishuState['result']): { failure?: CliAccountFailure } { +function failureOf(result: FeishuState['result']): { failure?: ConnectorAccountFailure } { if (result?.outcome !== 'failed') return {} const failure = result.failure const classified = failure === undefined ? [] : [failure.type, failure.subtype].filter(item => item !== undefined) @@ -89,7 +90,7 @@ function failureOf(result: FeishuState['result']): { failure?: CliAccountFailure * @param view - the CLI's default account, the operation in progress, and the last result. * @returns the phase, status, tag, buttons, detail, linked-app row, and failure. */ -export function presentAccount(view: FeishuState): CliAccountDisplay { +export function presentAccount(view: FeishuState): ConnectorAccountDisplay { const { account, operation } = view if (operation?.kind === 'check') return { phase: 'checking', status: text('status.checking'), buttons: [], notes: [] } if (operation !== undefined) return presentOperation(operation) diff --git a/packages/connector/feishu-cli/tests/account.spec.ts b/packages/connector/feishu-cli/tests/account.spec.ts index 874c85a261..b2774625f4 100644 --- a/packages/connector/feishu-cli/tests/account.spec.ts +++ b/packages/connector/feishu-cli/tests/account.spec.ts @@ -2,8 +2,8 @@ import { rm } from 'node:fs/promises' import { join } from 'node:path' import { Context } from '@deepseek-ai/cordis' -import { CliCommandExecutor, type CliOperationId } from '@deepseek-ai/dsh-cli-account' -import type { CliAccountRegistration, CliAccountSource } from '@deepseek-ai/dsh-cli-account/types' +import { CliCommandExecutor } from '@deepseek-ai/dsh-cli-account' +import type { ConnectorAccountRegistration, ConnectorOperationId } from '@deepseek-ai/dsh-client-ui-connector-account/types' import SkillRegistry from '@deepseek-ai/dsh-skill' import SystemPrompt from '@deepseek-ai/dsh-system-prompt' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' @@ -63,7 +63,7 @@ describe('FeishuAccount', () => { afterEach(() => account.dispose()) - const settled = async (id: CliOperationId): Promise => { + const settled = async (id: ConnectorOperationId): Promise => { await vi.waitFor(() => { expect(account.snapshot().result?.id).toBe(id) }) return account.snapshot() } @@ -190,11 +190,12 @@ describe('FeishuAccount', () => { }) describe('Feishu on the Plugins page', () => { - let account!: CliAccountSource + let account!: FeishuAccount beforeEach(async () => { - ctx.provide('cliAccounts', { - register: (registration: CliAccountRegistration) => { + ctx.provide('connectorAccounts', { + register: (registration: ConnectorAccountRegistration) => { + if (!(registration.source instanceof FeishuAccount)) throw new Error('the plugin registers its account runtime') account = registration.source return () => {} }, @@ -202,7 +203,7 @@ describe('Feishu on the Plugins page', () => { await ctx.plugin(Feishu, { commandTimeoutMs: 5_000, binDir }) }) - const finished = async (id: CliOperationId): Promise => { + const finished = async (id: ConnectorOperationId): Promise => { await vi.waitFor(() => { expect(account.snapshot().result?.id).toBe(id) }) return account.snapshot().result } diff --git a/packages/connector/feishu-cli/tests/plugin.spec.ts b/packages/connector/feishu-cli/tests/plugin.spec.ts index ca4b425312..751e9a80ea 100644 --- a/packages/connector/feishu-cli/tests/plugin.spec.ts +++ b/packages/connector/feishu-cli/tests/plugin.spec.ts @@ -5,7 +5,7 @@ import SkillRegistry, { renderSkillContent } from '@deepseek-ai/dsh-skill' import SystemPrompt, { renderContextSections } from '@deepseek-ai/dsh-system-prompt' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { executableFileName } from '@deepseek-ai/dsh-cli-account' -import type { CliAccountRegistration } from '@deepseek-ai/dsh-cli-account/types' +import type { ConnectorAccountRegistration } from '@deepseek-ai/dsh-client-ui-connector-account/types' import { cliPathContextText } from '@deepseek-ai/dsh-cli-account/src/context.ts' import * as Feishu from '../src/index.ts' import { COPY, FEISHU_PACKAGE, OPERATIONS, presentAccount } from '../src/presentation.ts' @@ -141,10 +141,10 @@ describe('Feishu plugin', () => { }) it('shows the account on the Plugins page while the registry runs, and withdraws it with the plugin', async () => { - const registered: CliAccountRegistration[] = [] + const registered: ConnectorAccountRegistration[] = [] const withdrawn = vi.fn() - ctx.provide('cliAccounts', { - register: (registration: CliAccountRegistration) => { + ctx.provide('connectorAccounts', { + register: (registration: ConnectorAccountRegistration) => { registered.push(registration) return withdrawn }, diff --git a/packages/connector/feishu-cli/tests/presentation.spec.ts b/packages/connector/feishu-cli/tests/presentation.spec.ts index 7464af1c5f..a1c0039e25 100644 --- a/packages/connector/feishu-cli/tests/presentation.spec.ts +++ b/packages/connector/feishu-cli/tests/presentation.spec.ts @@ -1,12 +1,12 @@ /** The Feishu section offers each state's next step, the linked app, confirmations, and failure guidance, in every shipped language. */ -import type { CliAccountDisplay, CliOperationId } from '@deepseek-ai/dsh-cli-account/types' import type { LocalizedText } from '@deepseek-ai/dsh-package-manifest' +import type { ConnectorAccountDisplay, ConnectorOperationId } from '@deepseek-ai/dsh-client-ui-connector-account/types' import { expect, it } from 'vitest' import { en, zh, type FeishuTextKey } from '../src/locales.ts' import { COPY, OPERATIONS, presentAccount } from '../src/presentation.ts' import type { FeishuAppId, FeishuState } from '../src/types.ts' -const OP = 'op' as CliOperationId +const OP = 'op' as ConnectorOperationId const APP = 'cli_a' as FeishuAppId const LINK = 'https://x.feishu.cn' const CHECK = { kind: 'start', operation: 'check' } as const @@ -17,7 +17,7 @@ const SIGN_OUT = { kind: 'start', operation: 'sign-out' } as const /** The key's text as the Chinese and English browsers resolve it. */ const say = (key: FeishuTextKey): Partial> => ({ zh: zh[key], en: en[key] }) const zhOf = (text: LocalizedText | undefined): string | undefined => typeof text === 'object' ? text.zh : text -const labels = (display: CliAccountDisplay): (string | undefined)[] => display.buttons.map(button => zhOf(button.label)) +const labels = (display: ConnectorAccountDisplay): (string | undefined)[] => display.buttons.map(button => zhOf(button.label)) const UNCONFIGURED: FeishuState = { account: { state: 'unconfigured' } } const SIGNED_OUT: FeishuState = { account: { state: 'signed-out', appId: APP } } diff --git a/packages/connector/feishu-cli/tsconfig.json b/packages/connector/feishu-cli/tsconfig.json index 0c20d5f875..4824bf3e50 100644 --- a/packages/connector/feishu-cli/tsconfig.json +++ b/packages/connector/feishu-cli/tsconfig.json @@ -33,7 +33,7 @@ "path": "../../core/system-prompt" }, { - "path": "../../client/ui-cli-account/tsconfig.host.json" + "path": "../../client/ui-connector-account/tsconfig.host.json" } ] } diff --git a/packages/connector/feishu/README.i18n.yaml b/packages/connector/feishu/README.i18n.yaml index c7b181c0cb..cb2a920efb 100644 --- a/packages/connector/feishu/README.i18n.yaml +++ b/packages/connector/feishu/README.i18n.yaml @@ -21,14 +21,14 @@ en: c9bfd7982e7187c1 zh: 7f6a3fcfef92c6b8 /deepseek-ai-dsh-feishu/use-this-package/what-you-get: - en: f08b0274f2a32660 - zh: 6d294d6b8a2efa7b + en: 7f6b6c28adbc2d62 + zh: 988ca4442cd06dc0 /deepseek-ai-dsh-feishu/understand-the-implementation: en: 9be3d826760927e8 zh: 0d4a8ef14e5e1212 /deepseek-ai-dsh-feishu/further-exploration: - en: 15648c4d2fc0b4dc - zh: 94260567a431a39d + en: e02f9701579b4ac4 + zh: 43ce75bef4880efe /deepseek-ai-dsh-feishu/model-experience: en: ba24b5d478d2dee0 zh: e313437787a4dede diff --git a/packages/connector/feishu/README.md b/packages/connector/feishu/README.md index 819d931f0f..35f1b6f2f3 100644 --- a/packages/connector/feishu/README.md +++ b/packages/connector/feishu/README.md @@ -40,7 +40,7 @@ pnpm blocks the `@larksuite/cli` install script, which downloads and verifies th | Row | Package | Behavior | |---|---|---| -| `feishu` | [`@deepseek-ai/dsh-feishu-cli`](../feishu-cli/README.md) | Gives the model the absolute path of `lark-cli`, registers its embedded skills, runs account checks, connection, and sign-out on the Host, and shows the account section, a connection tag, guidance after the bundle is switched on, and connection notices on the Plugins page through the [CLI account registry](../../client/ui-cli-account/README.md) | +| `feishu` | [`@deepseek-ai/dsh-feishu-cli`](../feishu-cli/README.md) | Gives the model the absolute path of `lark-cli`, registers its embedded skills, runs account checks, connection, and sign-out on the Host, and shows the account section, a connection tag, guidance after the bundle is switched on, and connection notices on the Plugins page through the [connector account registry](../../client/ui-connector-account/README.md) | Switching the bundle off withdraws the skills, the path in runtime context, and the page. The CLI configuration and sign-in stay in place. @@ -63,7 +63,7 @@ Switching the bundle off withdraws the skills, the path in runtime context, and - [Connector packages](../README.md) — the group this application plugin belongs to. - [Feishu CLI and skills](../feishu-cli/README.md) — the Host row, its account operations, and its model guidance. -- [CLI account surfaces](../../client/ui-cli-account/README.md) — the registry that shows the account on the Plugins page. +- [Connector account surfaces](../../client/ui-connector-account/README.md) — the registry that shows the account on the Plugins page. - [Plugin Manager](../../boot/plugin-manager/README.md) — installation, build-script approval, and enablement. ----- diff --git a/packages/connector/feishu/README.zh.md b/packages/connector/feishu/README.zh.md index 62a9b39919..59481a0c3b 100644 --- a/packages/connector/feishu/README.zh.md +++ b/packages/connector/feishu/README.zh.md @@ -40,7 +40,7 @@ pnpm 会拦截 `@larksuite/cli` 的安装脚本,该脚本负责下载并校验 | 行 | 包 | 行为 | |---|---|---| -| `feishu` | [`@deepseek-ai/dsh-feishu-cli`](../feishu-cli/README.zh.md) | 把 `lark-cli` 的绝对路径告诉模型,注册其内嵌技能,在 Host 上执行账号检查、连接和退出登录,并通过 [CLI 账号注册表](../../client/ui-cli-account/README.zh.md)在插件页显示账号区块、连接标签、开启后的连接引导和连接提示 | +| `feishu` | [`@deepseek-ai/dsh-feishu-cli`](../feishu-cli/README.zh.md) | 把 `lark-cli` 的绝对路径告诉模型,注册其内嵌技能,在 Host 上执行账号检查、连接和退出登录,并通过 [连接器账号注册表](../../client/ui-connector-account/README.zh.md)在插件页显示账号区块、连接标签、开启后的连接引导和连接提示 | 关闭 bundle 会撤下技能、运行时上下文中的路径和页面。CLI 的配置与登录保持不变。 @@ -63,7 +63,7 @@ pnpm 会拦截 `@larksuite/cli` 的安装脚本,该脚本负责下载并校验 - [Connector 包](../README.zh.md)——这个应用插件所属的分组。 - [飞书 CLI 与技能](../feishu-cli/README.zh.md)——Host 行、账号操作与模型指引。 -- [CLI 账号界面](../../client/ui-cli-account/README.zh.md)——在插件页显示账号的注册表。 +- [连接器账号界面](../../client/ui-connector-account/README.zh.md)——在插件页显示账号的注册表。 - [Plugin Manager](../../boot/plugin-manager/README.zh.md)——安装、构建脚本批准与启用。 ----- diff --git a/packages/connector/feishu/package.json b/packages/connector/feishu/package.json index e0f2811e54..0688272379 100644 --- a/packages/connector/feishu/package.json +++ b/packages/connector/feishu/package.json @@ -1,7 +1,7 @@ { "name": "@deepseek-ai/dsh-feishu", "description": "Feishu plugin: the official lark-cli with its embedded skills, and account connection from the Plugins page", - "version": "0.2.2-alpha.2", + "version": "0.2.2-rc.1", "icon": "./icon.svg", "publishConfig": { "access": "public" @@ -30,7 +30,10 @@ "docs", "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9878b56dbb..7dc4ee4e14 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7636,14 +7636,14 @@ importers: version: 1.0.97 zod: specifier: ^4.4.3 - version: 4.4.3 + version: 4.6.6 devDependencies: '@deepseek-ai/cordis': specifier: workspace:~ version: link:../../../vendor/cordis - '@deepseek-ai/dsh-client-ui-cli-account': + '@deepseek-ai/dsh-client-ui-connector-account': specifier: workspace:* - version: link:../../client/ui-cli-account + version: link:../../client/ui-connector-account '@deepseek-ai/dsh-skill': specifier: workspace:* version: link:../../skill/skill