From 4459751fdbaf681b69f389029d210848d99f2bd5 Mon Sep 17 00:00:00 2001 From: gengruilin Date: Wed, 18 Nov 2026 16:54:44 +0800 Subject: [PATCH] refactor(notion): rename src/copy.ts to src/locales.ts The repository names a package's localized text module locales.ts, as dsh-mcp-account and the four CLI connector apps do. The export COPY keeps its name, which matches the registration's copy field. --- packages/connector/notion/README.i18n.yaml | 4 ++-- packages/connector/notion/README.md | 2 +- packages/connector/notion/README.zh.md | 2 +- packages/connector/notion/src/index.ts | 2 +- packages/connector/notion/src/{copy.ts => locales.ts} | 0 packages/connector/notion/tests/plugin.spec.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) rename packages/connector/notion/src/{copy.ts => locales.ts} (100%) diff --git a/packages/connector/notion/README.i18n.yaml b/packages/connector/notion/README.i18n.yaml index 3282fa8a16..e87f0f6156 100644 --- a/packages/connector/notion/README.i18n.yaml +++ b/packages/connector/notion/README.i18n.yaml @@ -30,8 +30,8 @@ en: 74b045a61a3fec72 zh: 69d64b33e8d1812e /deepseek-ai-dsh-notion/understand-the-implementation: - en: e77a86f91f35dd9e - zh: d25c4a96b49d80b2 + en: 5a12bb3e000c4cc9 + zh: 6431dcb502c1d7af /deepseek-ai-dsh-notion/further-exploration: en: ed7d1edadf2feef5 zh: 6746823e51e4f4f3 diff --git a/packages/connector/notion/README.md b/packages/connector/notion/README.md index b0a6ad53c3..589feba39a 100644 --- a/packages/connector/notion/README.md +++ b/packages/connector/notion/README.md @@ -75,7 +75,7 @@ The generated [config catalog](../../../docs/config-catalog.md#deepseek-aidsh-no [`cordis.patch.yml`](cordis.patch.yml) inserts one row with id `notion` naming this package, so the package is both the bundle and its only row; `config` overrides target that id. The Host half, [`src/index.ts`](src/index.ts), makes two registrations, both effects of the plugin's fiber: `ctx.mcpManager.register('notion', …)` adds a Streamable HTTP entry with the configured `url` and OAuth credential key, and `ctx.systemPrompt.section()` adds the naming guidance at the `MCP_SERVERS` order. The server name fixes the `mcp__notion__` tool namespace, and the credential key fixes the grant address, so a reloaded or reinstalled plugin reaches the same tools and grant. The manager validates the entry when it is registered; a configured or registered server that already uses the name or key makes the plugin fail to load before the guidance is added. -While the account registry runs, the plugin also calls `ctx.mcpAccounts.register({ server: 'notion', packageName: '@deepseek-ai/dsh-notion', copy })`, where [`src/copy.ts`](src/copy.ts) holds the text that names Notion in every shipped language; [`dsh-mcp-account`](../../mcp/mcp-account/README.md) then registers the account with the connector account registry, which renders the section, guidance, tag, and toast described above. A composition without the registry, such as a headless profile, loads the plugin without the account section. +While the account registry runs, the plugin also calls `ctx.mcpAccounts.register({ server: 'notion', packageName: '@deepseek-ai/dsh-notion', copy })`, where [`src/locales.ts`](src/locales.ts) holds the text that names Notion in every shipped language; [`dsh-mcp-account`](../../mcp/mcp-account/README.md) then registers the account with the connector account registry, which renders the section, guidance, tag, and toast described above. A composition without the registry, such as a headless profile, loads the plugin without the account section. diff --git a/packages/connector/notion/README.zh.md b/packages/connector/notion/README.zh.md index 739398e3fa..3dca05834d 100644 --- a/packages/connector/notion/README.zh.md +++ b/packages/connector/notion/README.zh.md @@ -75,7 +75,7 @@ bundle patch 在 profile 其他层之后插入 `notion` 行。插件需要 `mcpM [`cordis.patch.yml`](cordis.patch.yml) 插入一行 id 为 `notion` 的条目,指向本包,因此本包既是 bundle,也是其唯一的一行;`config` 覆盖以该 id 为目标。Host 侧的 [`src/index.ts`](src/index.ts) 进行两项注册,二者都是插件 fiber 的 effect:`ctx.mcpManager.register('notion', …)` 以配置的 `url` 和 OAuth 凭据 key 添加一个 Streamable HTTP 条目,`ctx.systemPrompt.section()` 在 `MCP_SERVERS` 排序位置添加称呼指引。服务器名固定了 `mcp__notion__` 工具命名空间,凭据 key 固定了 grant 地址,因此重新加载或重新安装的插件会得到同样的工具和 grant。管理器在注册时校验条目;如果已配置或已注册的服务器占用了该名称或 key,插件会在添加指引之前加载失败。 -账号注册表运行时,插件还调用 `ctx.mcpAccounts.register({ server: 'notion', packageName: '@deepseek-ai/dsh-notion', copy })`,其中 [`src/copy.ts`](src/copy.ts) 以每种已发布语言保存指明 Notion 的文案;随后由 [`dsh-mcp-account`](../../mcp/mcp-account/README.zh.md) 把账号登记到连接器账号注册表,由注册表渲染上文所述的区块、引导、标签与 toast。没有注册表的组合(如 headless profile)加载插件时不带账号区块。 +账号注册表运行时,插件还调用 `ctx.mcpAccounts.register({ server: 'notion', packageName: '@deepseek-ai/dsh-notion', copy })`,其中 [`src/locales.ts`](src/locales.ts) 以每种已发布语言保存指明 Notion 的文案;随后由 [`dsh-mcp-account`](../../mcp/mcp-account/README.zh.md) 把账号登记到连接器账号注册表,由注册表渲染上文所述的区块、引导、标签与 toast。没有注册表的组合(如 headless profile)加载插件时不带账号区块。 diff --git a/packages/connector/notion/src/index.ts b/packages/connector/notion/src/index.ts index e61c49ac2e..bb042c97d0 100644 --- a/packages/connector/notion/src/index.ts +++ b/packages/connector/notion/src/index.ts @@ -13,7 +13,7 @@ import z from '@deepseek-ai/schemastery' import type {} from '@deepseek-ai/dsh-mcp-account' import type {} from '@deepseek-ai/dsh-mcp-manager' import type {} from '@deepseek-ai/dsh-system-prompt' -import { COPY } from './copy.ts' +import { COPY } from './locales.ts' export const name = 'notion' export const inject = ['mcpManager', 'systemPrompt'] diff --git a/packages/connector/notion/src/copy.ts b/packages/connector/notion/src/locales.ts similarity index 100% rename from packages/connector/notion/src/copy.ts rename to packages/connector/notion/src/locales.ts diff --git a/packages/connector/notion/tests/plugin.spec.ts b/packages/connector/notion/tests/plugin.spec.ts index f878c100c6..849185fa87 100644 --- a/packages/connector/notion/tests/plugin.spec.ts +++ b/packages/connector/notion/tests/plugin.spec.ts @@ -15,7 +15,7 @@ import { createScope } from '@deepseek-ai/dsh-scope' import { renderPrompt } from '@deepseek-ai/dsh-system-prompt' import { callback, oauthWorld, phase } from '../../../mcp/mcp-client/tests/oauth-fixture.ts' import { managerProfile } from '../../../mcp/mcp-manager/tests/profile-fixture.ts' -import { COPY } from '../src/copy.ts' +import { COPY } from '../src/locales.ts' import * as Notion from '../src/index.ts' // Verbatim pin of the model-visible guidance in src/index.ts.