Vendored package rescope

The Cordis framework and its foundation libraries are vendored under vendor/ and published under the @deepseek-ai scope, because every harness package declares the framework as a peer dependency: publishing the harness publishes this layer with it, and under the upstream names that publication would squat them on the registry. This page is the name mapping; the decision and its consequences live in the rescope Agent Note, and the upstream commits in vendor/README.md.

Name mapping

Directory Upstream name Published name Version Role
vendor/cordis/ cordis @deepseek-ai/cordis 4.0.0-rc.7 Framework core: Context, Service, Fiber, events
vendor/cosmokit/ cosmokit @deepseek-ai/cosmokit 1.8.1 Shared utilities the framework and Schemastery build on
vendor/schemastery/ schemastery @deepseek-ai/schemastery 3.18.0 Config schemas (Schema) behind every plugin's Config
vendor/loader/ @cordisjs/plugin-loader @deepseek-ai/cordis-plugin-loader 1.0.0-rc.5 cordis.yml loading, plugin resolution, repository cache
vendor/include/ @cordisjs/plugin-include @deepseek-ai/cordis-plugin-include 1.0.4 Config includes and patch overlays
vendor/group/ @cordisjs/plugin-group @deepseek-ai/cordis-plugin-group 1.0.0 Nested plugin groups
vendor/timer/ @cordisjs/plugin-timer @deepseek-ai/cordis-plugin-timer 1.1.2 Disposal-aware timers on ctx
vendor/hmr/ @cordisjs/plugin-hmr @deepseek-ai/cordis-plugin-hmr 1.0.15 Hot module replacement for plugins and config
vendor/logger-console/ @cordisjs/plugin-logger-console @deepseek-ai/cordis-plugin-logger-console 1.0.0 Console logger exporter

Subpath exports keep their path: @cordisjs/plugin-loader/repository becomes @deepseek-ai/cordis-plugin-loader/repository.

What the rename does not touch

  • Directory names and versions. vendor/hmr/ stays vendor/hmr/, and every package keeps the upstream version its manifest table row records, so the vendored tree still reads as an upstream snapshot.
  • Dependency ranges. A dependency entry changes its key, never its range: "cordis": "^4.0.0-rc.7" becomes "@deepseek-ai/cordis": "^4.0.0-rc.7". linkWorkspacePackages resolves those preserved ranges to the pinned workspaces.
  • The Loader's cordis: builtin prefix. cordis:include and cordis:group are a protocol prefix, not a package name.
  • The cordis.yml configuration family, including *.cordis.yml, *.cordis.snapshot.yml, and cordis.patch.yml.
  • Harness packages whose own names contain the word, such as @deepseek-ai/dsh-tool-cordis.
  • Upstream runtime identifiers, such as Schemastery's Symbol.for('schemastery') and its vendor: metadata field.
  • Prose outside docs/. vendor/*/README.md, package READMEs, and Agent Notes keep the names they were written with; a bare cordis there can also be the Python SDK's option name or an agent-preset id. Inside docs/, prose and every Markdown fence follow the rename.

What your code has to change

Site Before After
Module import import { Context } from 'cordis' import { Context } from '@deepseek-ai/cordis'
Typed-event merge declare module 'cordis' declare module '@deepseek-ai/cordis'
package.json dependency key "@cordisjs/plugin-hmr": "^1.0.15" "@deepseek-ai/cordis-plugin-hmr": "^1.0.15"
cordis.yml plugin entry name: '@cordisjs/plugin-include' name: '@deepseek-ai/cordis-plugin-include'

Applying, verifying, and reverting

scripts/rescope-vendor.ts owns the mapping above and performs the rename, so no reference is renamed by hand:

pnpm run rescope-vendor            # report what would change
pnpm run rescope-vendor --apply    # rewrite every reference
pnpm run rescope-vendor:check      # assert the post-state; runs in the hygiene gate
pnpm run rescope-vendor --apply --reverse   # return to the upstream names

Re-apply it after an upstream sync (procedure), and follow it with the regeneration it prints: pnpm install for the lockfile, pnpm run gen-third-party-notices, and pnpm run verify-translation-pairing --write for the bilingual pairs it touched.

Vendored 包改名

Cordis 框架及其基础库以源码形式 vendored 在 vendor/ 下,并以 @deepseek-ai scope 发布:每个 harness 包都把框架声明为 peer dependency,发布 harness 就会连带发布这一层,用上游名发布等于在 registry 上占用别人的名字。本页是名字映射表;决策与影响见 改名 Agent Note,上游 commit 见 vendor/README.md

名字映射

目录 上游名 发布名 版本 角色
vendor/cordis/ cordis @deepseek-ai/cordis 4.0.0-rc.7 框架核心:ContextServiceFiber、事件
vendor/cosmokit/ cosmokit @deepseek-ai/cosmokit 1.8.1 框架与 Schemastery 共用的基础工具
vendor/schemastery/ schemastery @deepseek-ai/schemastery 3.18.0 配置 schema(Schema),每个插件的 Config 都基于它
vendor/loader/ @cordisjs/plugin-loader @deepseek-ai/cordis-plugin-loader 1.0.0-rc.5 cordis.yml 装载、插件解析、repository 缓存
vendor/include/ @cordisjs/plugin-include @deepseek-ai/cordis-plugin-include 1.0.4 配置包含与 patch 叠加
vendor/group/ @cordisjs/plugin-group @deepseek-ai/cordis-plugin-group 1.0.0 嵌套插件分组
vendor/timer/ @cordisjs/plugin-timer @deepseek-ai/cordis-plugin-timer 1.1.2 ctx 上随 disposal 回收的定时器
vendor/hmr/ @cordisjs/plugin-hmr @deepseek-ai/cordis-plugin-hmr 1.0.15 插件与配置的热替换
vendor/logger-console/ @cordisjs/plugin-logger-console @deepseek-ai/cordis-plugin-logger-console 1.0.0 控制台日志导出

子路径导出保持原路径:@cordisjs/plugin-loader/repository 变成 @deepseek-ai/cordis-plugin-loader/repository

改名不碰什么

  • 目录名与版本号。 vendor/hmr/ 仍是 vendor/hmr/,每个包保留清单表那行记录的上游版本,所以 vendored 树依旧读作一份上游快照。
  • 依赖 range。 依赖条目只换键、不换范围:"cordis": "^4.0.0-rc.7" 变成 "@deepseek-ai/cordis": "^4.0.0-rc.7"linkWorkspacePackages 靠这些保留下来的范围把它们解析到固定的 workspace。
  • Loader 的 cordis: 内建前缀。 cordis:includecordis:group 是协议前缀,不是包名。
  • cordis.yml 配置文件家族,包括 *.cordis.yml*.cordis.snapshot.ymlcordis.patch.yml
  • 名字里带这个词的 harness 包,例如 @deepseek-ai/dsh-tool-cordis
  • 上游运行时标识符,例如 Schemastery 的 Symbol.for('schemastery') 及其 vendor: 元数据字段。
  • docs/ 之外的散文。 vendor/*/README.md、各包 README 与 Agent Note 保留写作当时的名字;那里的裸 cordis 也可能是 Python SDK 的选项名或某个 agent-preset 的 id。docs/ 之内,散文与所有 Markdown 围栏都跟着改。

你的代码要改什么

位置 改前 改后
模块 import import { Context } from 'cordis' import { Context } from '@deepseek-ai/cordis'
类型事件声明合并 declare module 'cordis' declare module '@deepseek-ai/cordis'
package.json 依赖键 "@cordisjs/plugin-hmr": "^1.0.15" "@deepseek-ai/cordis-plugin-hmr": "^1.0.15"
cordis.yml 插件条目 name: '@cordisjs/plugin-include' name: '@deepseek-ai/cordis-plugin-include'

施加、核验与回退

上面这份映射由 scripts/rescope-vendor.ts 承载并执行改名,任何引用都不靠手改:

pnpm run rescope-vendor            # report what would change
pnpm run rescope-vendor --apply    # rewrite every reference
pnpm run rescope-vendor:check      # assert the post-state; runs in the hygiene gate
pnpm run rescope-vendor --apply --reverse   # return to the upstream names

上游 sync 之后重跑它(流程),并接上它打印的重生成:pnpm install 重生成 lockfile、pnpm run gen-third-party-notices、以及对它触及的双语对跑 pnpm run verify-translation-pairing --write