@dsh-cc/bundle-shell 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +2 -2
- package/README.zh.md +2 -2
- package/cordis.patch.yml +18 -11
- package/lib/ccPluginManager.d.ts +42 -0
- package/lib/ccPluginManager.d.ts.map +1 -0
- package/lib/ccPluginManager.js +60 -0
- package/lib/ccPluginManager.js.map +1 -0
- package/lib/ccPlugins.d.ts +6 -1
- package/lib/ccPlugins.d.ts.map +1 -1
- package/lib/ccPlugins.js +1 -0
- package/lib/ccPlugins.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +30 -1
- package/lib/index.js.map +1 -1
- package/lib/mcpSeam.d.ts +35 -0
- package/lib/mcpSeam.d.ts.map +1 -0
- package/lib/mcpSeam.js +97 -0
- package/lib/mcpSeam.js.map +1 -0
- package/package.json +22 -19
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/bundle/cc-shell/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: d294e87a8ced00fc4599da7bf6ea218048e11df1
|
|
6
|
+
README.zh.md: e49c6bb0cf9d8e7dd5ec5bfe470b15f4ad131eb9
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ The CC shell **host-plane infra** bundle. This package carries the pieces that a
|
|
|
8
8
|
|
|
9
9
|
- **Tools registry swap.** Disables the in-box `tools` row and remounts `@dsh-cc/tools`. `reserve()`/`isAdmitted()` join the restrictable-name universe, so permission gates can name deferred tools before they load; the shipped behavior otherwise matches upstream. The base row's `DSH_TOOLS_MODE` toggle is carried forward ($DSH_HOME / process.cwd() semantics unchanged).
|
|
10
10
|
- **Settings migrations.** Mounts `@dsh-cc/settings-migrations` to apply version-gated `settings.json` migrations at startup (equivalent to CC's `runMigrations`). Empty registry — mechanism only — for now.
|
|
11
|
-
- **Glue plugin code (mounted by the CC preset).** `cc-shell-glue` mounts what a cordis patch row cannot express statically: on-disk Claude Code plugins
|
|
11
|
+
- **Glue plugin code (mounted by the CC preset).** `cc-shell-glue` mounts what a cordis patch row cannot express statically: on-disk Claude Code plugins, `.mcp.json` server wiring, and a built-in plugin `mcp` seam (`cc-mcp-seam`, so plugin `mcpServers` mount via mcp-client). Default plugin discovery is the dual-home merged view: `enabledPlugins` (claude-user → dsh-user → project → local cascade) ∩ the merged `installed_plugins.json` of both homes (exact `name@marketplace` keys, `installPath` as the plugin root). The **write root is the dsh home** (`$DSH_HOME` / `~/.dsh`); the Claude home (`$CLAUDE_CONFIG_DIR` / `~/.claude`) stays read-visible for compatibility, with dsh entries winning per key. Explicit `pluginDirs` still flattens those dirs; `[]`/`null` disables. Discovery is best-effort — missing paths and unreadable JSON mount nothing. It also exposes the `ccPlugins` service for live enumeration/rescan of mounted plugins (`/reload-plugins` re-reads the cascade) and the `ccPluginManager` service bound to both homes (so `/plugin` mutations land in `~/.dsh`). The glue threads the spawn-time `resolveModel` into `AgentProvider` as a
|
|
12
12
|
**lazy trampoline** over the `ccModelRoutes` service:
|
|
13
13
|
`(model) => ctx.get('ccModelRoutes')?.resolve(model)` — queried on every spawn, degrading to
|
|
14
14
|
inherit the parent route when the service is unmounted.
|
|
@@ -29,4 +29,4 @@ Two pieces that used to live in `cc-shell-glue` moved to their owning packages:
|
|
|
29
29
|
|
|
30
30
|
- This bundle no longer globally mounts any agent-facing surface. Only the host-plane infra rows (tools registry swap + settings-migrations) are mounted by this bundle's `cordis.patch.yml`; the glue plugin and all agent surfaces are mounted by `@dsh-cc/preset-cc` so they stay scoped to that preset.
|
|
31
31
|
- Because the tool-web executor row is unshipped by the CLI dependency tree through rc.6, fetch-based web tooling is mounted by the preset, not here; see the preset's "Known limits" for the current fetch status.
|
|
32
|
-
- Project/local `enabledPlugins` are boot-cwd-biased (the glue is a host-plane singleton, same as `.mcp.json`). `/reload-plugins` is the live escape hatch. `$CLAUDE_CONFIG_DIR`
|
|
32
|
+
- Project/local `enabledPlugins` are boot-cwd-biased (the glue is a host-plane singleton, same as `.mcp.json`). `/reload-plugins` is the live escape hatch. Plugin state is dual-home: `$CLAUDE_CONFIG_DIR` stays read-visible for discovery, while plugin-management writes go to `$DSH_HOME` (`~/.dsh`) — setting `CLAUDE_CONFIG_DIR` no longer relocates plugin writes; `.mcp.json` still hardcodes `~/.claude`.
|
package/README.zh.md
CHANGED
|
@@ -8,7 +8,7 @@ CC 壳层的 **host-plane infra** 组合包。本包承载真正属于宿主层
|
|
|
8
8
|
|
|
9
9
|
- **tools 注册表替换。** 禁用 in-box 的 `tools` 行,重挂 `@dsh-cc/tools`。`reserve()`/`isAdmitted()` 加入可限制名 universe,权限门可在 deferred 工具加载前按名门控;其余行为与上游一致。基础行的 `DSH_TOOLS_MODE` 开关被延续($DSH_HOME / process.cwd() 语义不变)。
|
|
10
10
|
- **settings 迁移。** 挂载 `@dsh-cc/settings-migrations`,在启动时应用版本门控的 `settings.json` 迁移(等价于 CC 的 `runMigrations`)。当前为空注册表——仅机制。
|
|
11
|
-
- **glue 插件代码(由 CC preset 挂载)。** `cc-shell-glue` 挂载 cordis patch 行无法静态表达的部件:磁盘上的 Claude Code
|
|
11
|
+
- **glue 插件代码(由 CC preset 挂载)。** `cc-shell-glue` 挂载 cordis patch 行无法静态表达的部件:磁盘上的 Claude Code 插件、`.mcp.json` server 接线,以及内置的插件 `mcp` seam(`cc-mcp-seam`,使插件的 `mcpServers` 通过 mcp-client 真正挂载)。默认插件发现是双 home 合并视图:`enabledPlugins`(claude-user → dsh-user → project → local 级联)∩ 两个 home 合并后的 `installed_plugins.json`(精确 `name@marketplace` key,`installPath` 作为插件根)。**写入根是 dsh home**(`$DSH_HOME` / `~/.dsh`);Claude home(`$CLAUDE_CONFIG_DIR` / `~/.claude`)保持可读以兼容,dsh 条目按 key 优先。显式 `pluginDirs` 仍 flatten 这些目录;`[]`/`null` 关闭。发现为尽力而为——缺失路径与无法读取的 JSON 都不挂载。它还暴露 `ccPlugins` 服务,用于对已挂载插件做实时枚举/重扫(`/reload-plugins` 会重读级联),以及绑定两个 home 的 `ccPluginManager` 服务(`/plugin` 变更落在 `~/.dsh`)。glue 以 **惰性 trampoline** 基于 `ccModelRoutes` 服务把派发时的 `resolveModel` 接入 `AgentProvider`:`(model) => ctx.get('ccModelRoutes')?.resolve(model)`——每次派发查询,服务未挂载时降级为继承父路由。
|
|
12
12
|
|
|
13
13
|
### 从 glue 迁出的部分
|
|
14
14
|
|
|
@@ -21,4 +21,4 @@ CC 壳层的 **host-plane infra** 组合包。本包承载真正属于宿主层
|
|
|
21
21
|
|
|
22
22
|
- 本包不再全局挂载任何 agent-face 表面。只有 host-plane infra 行(tools 注册表替换 + settings-migrations)由本包的 `cordis.patch.yml` 挂载;glue 插件与所有 agent 表面由 `@dsh-cc/preset-cc` 挂载,从而限定在该 preset 内。
|
|
23
23
|
- 由于 tool-web executor 行在 rc.6 之前未被 CLI 依赖树携带,基于 fetch 的 web 工具由 preset 挂载而非此处;当前 fetch 状态见 preset 的「已知限制」。
|
|
24
|
-
- 项目/local `enabledPlugins` 偏向 boot cwd(glue 是 host-plane 单例,与 `.mcp.json` 相同)。`/reload-plugins`
|
|
24
|
+
- 项目/local `enabledPlugins` 偏向 boot cwd(glue 是 host-plane 单例,与 `.mcp.json` 相同)。`/reload-plugins` 是热更新出口。插件状态是双 home 的:`$CLAUDE_CONFIG_DIR` 保持可读供发现使用,而插件管理写入落在 `$DSH_HOME`(`~/.dsh`)——设置 `CLAUDE_CONFIG_DIR` 不再决定插件写入位置;`.mcp.json` 仍写死 `~/.claude`。
|
package/cordis.patch.yml
CHANGED
|
@@ -19,6 +19,24 @@
|
|
|
19
19
|
- id: session-title-llm
|
|
20
20
|
disabled: true
|
|
21
21
|
|
|
22
|
+
# Web fetch executor: restate dsh-base's stock provider row at top level.
|
|
23
|
+
# Same-id restatement replaces the base row's config wholesale (last writer
|
|
24
|
+
# wins per row), so the CC egress caps live here. Upstream rc.1 already does
|
|
25
|
+
# DNS-pinned public-only fetching, subsuming the retired literal-gate wrapper
|
|
26
|
+
# that once held this seam (web/…/fetch-http in git history). The http→https
|
|
27
|
+
# upgrade moved to the tool layer (@dsh-cc/tool-web-fetch) — this stays live
|
|
28
|
+
# only as long as every tool-web mount keeps fetch: false.
|
|
29
|
+
# WARNING: this row MUST stay top-level. Inside `- insert:` it would compose a
|
|
30
|
+
# SECOND loader entry with the same id as dsh-base's and boot hard-fails on
|
|
31
|
+
# the duplicate loader entry id.
|
|
32
|
+
- id: web-fetch-http
|
|
33
|
+
name: '@deepseek-ai/dsh-web-fetch-http'
|
|
34
|
+
config:
|
|
35
|
+
timeoutMs: 20000
|
|
36
|
+
maxResponseBytes: 2000000
|
|
37
|
+
maxRedirects: 3
|
|
38
|
+
userAgent: 'dsh-cc/0.4.1 (+https://github.com/dsh-cc/dsh-cc)'
|
|
39
|
+
|
|
22
40
|
- insert:
|
|
23
41
|
# Remount below (in the insert list) with fetch enabled and the fetch provider.
|
|
24
42
|
- id: tools-cc
|
|
@@ -44,14 +62,3 @@
|
|
|
44
62
|
maxInputBytes: 4096
|
|
45
63
|
maxOutputTokens: 64
|
|
46
64
|
timeoutMs: 60000
|
|
47
|
-
|
|
48
|
-
# CC fetch provider: SSRF-gated wrapper around the harness HttpFetchProvider.
|
|
49
|
-
# Do NOT also mount the stock web-fetch-http plugin — duplicate id 'http'.
|
|
50
|
-
- id: web-fetch-http-cc
|
|
51
|
-
name: '@dsh-cc/web-fetch-http'
|
|
52
|
-
config:
|
|
53
|
-
timeoutMs: 20000
|
|
54
|
-
maxResponseBytes: 2000000
|
|
55
|
-
maxRedirects: 3
|
|
56
|
-
upgradeInsecure: true
|
|
57
|
-
blockPrivateNetwork: true
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code plugin-state manager service for the cc-shell glue plugin.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the pure `@dsh-cc/plugin-manager` core (install/uninstall/enable/
|
|
5
|
+
* disable/update + marketplaces, all byte-shape parity with the real CLI)
|
|
6
|
+
* bound to the session's Claude home and cwd, and publishes it as the
|
|
7
|
+
* `ccPluginManager` service so slash commands (`/plugin` subcommands) can
|
|
8
|
+
* consume it structurally. State mutations land in the same on-disk files
|
|
9
|
+
* the loader's discovery reads, so a `ccPlugins.rescan()` after any mutation
|
|
10
|
+
* reflects the change live.
|
|
11
|
+
*
|
|
12
|
+
* Publication follows the same host-realm pattern as `CcPluginsService`: the
|
|
13
|
+
* instance is provided from the ROOT fiber via `ctx.root.provide`, making it
|
|
14
|
+
* resolvable by every context (`ctx.get` and property access alike); an
|
|
15
|
+
* effect on the glue fiber clears the publication when cc-shell-glue unloads.
|
|
16
|
+
*
|
|
17
|
+
* @module
|
|
18
|
+
*/
|
|
19
|
+
import { Context } from '@deepseek-ai/cordis';
|
|
20
|
+
import { type CcPluginManager } from '@dsh-cc/plugin-manager';
|
|
21
|
+
declare module '@deepseek-ai/cordis' {
|
|
22
|
+
interface Context {
|
|
23
|
+
/** The Claude Code plugin-state manager, when cc-shell-glue is composed. */
|
|
24
|
+
ccPluginManager: CcPluginManager | undefined;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Build the session-bound manager: dual-home plugin state (writes to
|
|
29
|
+
* `$DSH_HOME` / `~/.dsh`, compat-reads `$CLAUDE_CONFIG_DIR` / `~/.claude`),
|
|
30
|
+
* the session cwd (the same `process.cwd()` source `CcPluginsService` uses
|
|
31
|
+
* for project/local `enabledPlugins` scope resolution), and the host git
|
|
32
|
+
* runner for marketplace clones/updates.
|
|
33
|
+
*/
|
|
34
|
+
export declare function createSessionCcPluginManager(): CcPluginManager;
|
|
35
|
+
/**
|
|
36
|
+
* Publish the `ccPluginManager` service from the root realm (see the
|
|
37
|
+
* `CcPluginsService` publication notes in `ccPlugins.ts` for why).
|
|
38
|
+
*/
|
|
39
|
+
export declare class CcPluginManagerService {
|
|
40
|
+
constructor(ctx: Context);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=ccPluginManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ccPluginManager.d.ts","sourceRoot":"","sources":["../src/ccPluginManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAgD,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAI3G,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,4EAA4E;QAC5E,eAAe,EAAE,eAAe,GAAG,SAAS,CAAA;KAC7C;CACF;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,IAAI,eAAe,CAO9D;AAED;;;GAGG;AACH,qBAAa,sBAAsB;gBACrB,GAAG,EAAE,OAAO;CAczB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code plugin-state manager service for the cc-shell glue plugin.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the pure `@dsh-cc/plugin-manager` core (install/uninstall/enable/
|
|
5
|
+
* disable/update + marketplaces, all byte-shape parity with the real CLI)
|
|
6
|
+
* bound to the session's Claude home and cwd, and publishes it as the
|
|
7
|
+
* `ccPluginManager` service so slash commands (`/plugin` subcommands) can
|
|
8
|
+
* consume it structurally. State mutations land in the same on-disk files
|
|
9
|
+
* the loader's discovery reads, so a `ccPlugins.rescan()` after any mutation
|
|
10
|
+
* reflects the change live.
|
|
11
|
+
*
|
|
12
|
+
* Publication follows the same host-realm pattern as `CcPluginsService`: the
|
|
13
|
+
* instance is provided from the ROOT fiber via `ctx.root.provide`, making it
|
|
14
|
+
* resolvable by every context (`ctx.get` and property access alike); an
|
|
15
|
+
* effect on the glue fiber clears the publication when cc-shell-glue unloads.
|
|
16
|
+
*
|
|
17
|
+
* @module
|
|
18
|
+
*/
|
|
19
|
+
import { Context } from '@deepseek-ai/cordis';
|
|
20
|
+
import { createCcPluginManager, createSystemGitRunner } from '@dsh-cc/plugin-manager';
|
|
21
|
+
import { resolveClaudeHome } from '@dsh-cc/plugin-loader';
|
|
22
|
+
import { resolveDshHome } from '@deepseek-ai/dsh-home-paths';
|
|
23
|
+
/**
|
|
24
|
+
* Build the session-bound manager: dual-home plugin state (writes to
|
|
25
|
+
* `$DSH_HOME` / `~/.dsh`, compat-reads `$CLAUDE_CONFIG_DIR` / `~/.claude`),
|
|
26
|
+
* the session cwd (the same `process.cwd()` source `CcPluginsService` uses
|
|
27
|
+
* for project/local `enabledPlugins` scope resolution), and the host git
|
|
28
|
+
* runner for marketplace clones/updates.
|
|
29
|
+
*/
|
|
30
|
+
export function createSessionCcPluginManager() {
|
|
31
|
+
return createCcPluginManager({
|
|
32
|
+
claudeHome: resolveClaudeHome(),
|
|
33
|
+
dshHome: resolveDshHome(),
|
|
34
|
+
cwd: process.cwd(),
|
|
35
|
+
runGit: createSystemGitRunner(),
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Publish the `ccPluginManager` service from the root realm (see the
|
|
40
|
+
* `CcPluginsService` publication notes in `ccPlugins.ts` for why).
|
|
41
|
+
*/
|
|
42
|
+
export class CcPluginManagerService {
|
|
43
|
+
constructor(ctx) {
|
|
44
|
+
const value = createSessionCcPluginManager();
|
|
45
|
+
const root = ctx.root;
|
|
46
|
+
const rootKey = root[Context.isolate]['ccPluginManager'];
|
|
47
|
+
const existing = rootKey === undefined ? undefined : root.reflect.store[rootKey];
|
|
48
|
+
if (existing === undefined) {
|
|
49
|
+
root.provide('ccPluginManager', value);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
root.set('ccPluginManager', value);
|
|
53
|
+
}
|
|
54
|
+
ctx.fiber.effect(() => () => {
|
|
55
|
+
if (root.get('ccPluginManager', false) === value)
|
|
56
|
+
root.set('ccPluginManager', undefined);
|
|
57
|
+
}, 'ccPluginManager: clear host-realm publication on unload');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=ccPluginManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ccPluginManager.js","sourceRoot":"","sources":["../src/ccPluginManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAwB,MAAM,wBAAwB,CAAA;AAC3G,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAS5D;;;;;;GAMG;AACH,MAAM,UAAU,4BAA4B;IAC1C,OAAO,qBAAqB,CAAC;QAC3B,UAAU,EAAE,iBAAiB,EAAE;QAC/B,OAAO,EAAE,cAAc,EAAE;QACzB,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,MAAM,EAAE,qBAAqB,EAAE;KAChC,CAAC,CAAA;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IACjC,YAAY,GAAY;QACtB,MAAM,KAAK,GAAG,4BAA4B,EAAE,CAAA;QAC5C,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAA;QACrB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,CAAA;QACxD,MAAM,QAAQ,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAChF,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAA;QACxC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAA;QACpC,CAAC;QACD,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE;YAC1B,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,KAAK,CAAC,KAAK,KAAK;gBAAE,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAA;QAC1F,CAAC,EAAE,yDAAyD,CAAC,CAAA;IAC/D,CAAC;CACF"}
|
package/lib/ccPlugins.d.ts
CHANGED
|
@@ -33,8 +33,13 @@ export interface CcPluginsServiceOptions {
|
|
|
33
33
|
readonly pluginDirs?: readonly string[] | null;
|
|
34
34
|
/** Spawn-time model resolver threaded into every mounted agent. */
|
|
35
35
|
readonly resolveModel?: ResolveModel;
|
|
36
|
-
/** Claude config home; defaults to `$CLAUDE_CONFIG_DIR` / `~/.claude`.
|
|
36
|
+
/** Claude config home; defaults to `$CLAUDE_CONFIG_DIR` / `~/.claude`. When
|
|
37
|
+
* only `claudeHome` is set (no `dshHome`), the loader keeps legacy
|
|
38
|
+
* single-root behavior: that directory is both the read and the write root. */
|
|
37
39
|
readonly claudeHome?: string;
|
|
40
|
+
/** dsh state home (`$DSH_HOME` / `~/.dsh`): the write root for dsh-managed
|
|
41
|
+
* plugin state, merged per key over the Claude home (dsh wins). */
|
|
42
|
+
readonly dshHome?: string;
|
|
38
43
|
/** Workspace used for project/local `enabledPlugins`; defaults to `process.cwd()`. */
|
|
39
44
|
readonly cwd?: string;
|
|
40
45
|
}
|
package/lib/ccPlugins.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ccPlugins.d.ts","sourceRoot":"","sources":["../src/ccPlugins.ts"],"names":[],"mappings":"AAAA;;;;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,CAAC,mBAAmB,EAAE,CAAC;IAUhD,+CAA+C;IAC/C,IAAI,IAAI,eAAe,EAAE;IAQzB;;;;;OAKG;IACG,MAAM,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAoB9C,mEAAmE;IACnE,kBAAkB,IAAI,SAAS,mBAAmB,EAAE;IAIpD;;;;;OAKG;IACG,gBAAgB,CACpB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAC1C,OAAO,CAAC,wBAAwB,CAAC;CAOrC"}
|
package/lib/ccPlugins.js
CHANGED
|
@@ -63,6 +63,7 @@ export class CcPluginsService {
|
|
|
63
63
|
return discoverCcPluginRoots({
|
|
64
64
|
...this.options.pluginDirs !== undefined ? { pluginDirs: this.options.pluginDirs } : {},
|
|
65
65
|
...this.options.claudeHome !== undefined ? { claudeHome: this.options.claudeHome } : {},
|
|
66
|
+
...this.options.dshHome !== undefined ? { dshHome: this.options.dshHome } : {},
|
|
66
67
|
...this.options.cwd !== undefined ? { cwd: this.options.cwd } : {},
|
|
67
68
|
log: this.ctx.logger,
|
|
68
69
|
});
|
package/lib/ccPlugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ccPlugins.js","sourceRoot":"","sources":["../src/ccPlugins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EACL,qBAAqB,EACrB,aAAa,GAMd,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"ccPlugins.js","sourceRoot":"","sources":["../src/ccPlugins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EACL,qBAAqB,EACrB,aAAa,GAMd,MAAM,uBAAuB,CAAA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AAE,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACxE,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,gBAAgB,CACpB,IAAY,EACZ,KAA2C;QAE3C,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC3C,IAAI,OAAO,KAAK,SAAS;YAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,2BAA2B,IAAI,GAAG,EAAE,CAAA;QAC3F,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,KAA6E,CAAC,CAAA;QAC/G,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;QAClD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,CAAA;IAC3C,CAAC;CACF"}
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,CAAC,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAiBxC,yDAAyD;AACzD,MAAM,WAAW,MAAM;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAC5B,2IAA2I;IAC3I,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAChC;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;CACpC;AAED,qFAAqF;AACrF,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,MAAM,CAM3B,CAAA;AAEF,wBAAwB;AACxB,eAAO,MAAM,IAAI,kBAAkB,CAAA;AAEnC;;;;;GAKG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA+JvE"}
|
package/lib/index.js
CHANGED
|
@@ -23,7 +23,9 @@ import z from '@deepseek-ai/schemastery';
|
|
|
23
23
|
import { createUserMessage } from '@deepseek-ai/dsh-llm';
|
|
24
24
|
import { buildRegistrations, claudeOnlyServers, readMcpServerNames, resolveDefaultMcpPaths, } from '@dsh-cc/mcp-config';
|
|
25
25
|
import * as CcMcpClient from '@dsh-cc/mcp-client';
|
|
26
|
+
import { CcPluginManagerService } from "./ccPluginManager.js";
|
|
26
27
|
import { CcPluginsService } from "./ccPlugins.js";
|
|
28
|
+
import { createPluginMcpSeam } from "./mcpSeam.js";
|
|
27
29
|
/** Runtime config schema (all fields optional; discovery prefers explicit lists). */
|
|
28
30
|
export const Config = z.object({
|
|
29
31
|
// union with null: bare z.array() gets an implicit [] default from schemastery,
|
|
@@ -62,6 +64,34 @@ export async function apply(ctx, config) {
|
|
|
62
64
|
const resolveModel = (model) => ctx.get('ccModelRoutes')?.resolve(model);
|
|
63
65
|
// 1. Claude Code plugins. Absent pluginDirs uses installed ∩ enabled;
|
|
64
66
|
// explicit []/null disables; a non-empty list flattens those dirs.
|
|
67
|
+
// The plugin-state manager (install/uninstall/enable/disable/update,
|
|
68
|
+
// marketplaces) publishes alongside the registry so `/plugin` manage
|
|
69
|
+
// subcommands can reach it; mutations land in the same on-disk state
|
|
70
|
+
// the registry's discovery reads.
|
|
71
|
+
if (ctx.get('ccPluginManager') === undefined) {
|
|
72
|
+
await ctx.plugin({
|
|
73
|
+
name: 'cc-plugin-manager',
|
|
74
|
+
apply(c) {
|
|
75
|
+
new CcPluginManagerService(c);
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
// The plugin MCP seam must exist BEFORE CcPluginsService's mountAll runs:
|
|
80
|
+
// CC plugins mount first (below) and consult `ctx.get('mcp')` for their
|
|
81
|
+
// inline `mcpServers`. A direct provide here would be invisible (this fiber
|
|
82
|
+
// is LOADING and ctx.get is strict) — use the same child-plugin idiom as
|
|
83
|
+
// the registry above. onRegistered feeds deferredNames so the boot one-shot
|
|
84
|
+
// pending notice (section 3 below) covers plugin-declared servers too.
|
|
85
|
+
const deferredNames = [];
|
|
86
|
+
if (ctx.get('mcp') === undefined) {
|
|
87
|
+
const seam = createPluginMcpSeam(ctx, { onRegistered: n => deferredNames.push(n) });
|
|
88
|
+
await ctx.plugin({
|
|
89
|
+
name: 'cc-mcp-seam',
|
|
90
|
+
apply(c) {
|
|
91
|
+
c.provide('mcp', seam);
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
}
|
|
65
95
|
const plugins = new CcPluginsService(ctx, {
|
|
66
96
|
...config.pluginDirs !== undefined ? { pluginDirs: config.pluginDirs } : {},
|
|
67
97
|
resolveModel,
|
|
@@ -84,7 +114,6 @@ export async function apply(ctx, config) {
|
|
|
84
114
|
// activates without awaiting its MCP handshake, so the first frame is
|
|
85
115
|
// not blocked on spawned servers; the handshakes still overlap because
|
|
86
116
|
// the serial mounts each spawn their child synchronously.
|
|
87
|
-
const deferredNames = [];
|
|
88
117
|
let files;
|
|
89
118
|
let gatedPaths;
|
|
90
119
|
let noticeSources = [];
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,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EAAsE,OAAO,0CAA0C,UAAU,CAAC,MAAM,6BAA6B,CAAA;QAClL,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAA;QACzC,IAAI,KAAK,GAAG,KAAK,CAAA;QACjB,GAAG,CAAC,EAAE,CAAC,qBAAqB,EAAE,CAAC,EAAE,KAAK,EAAiD,EAAE,EAAE;YACzF,IAAI,KAAK;gBAAE,OAAM;YACjB,KAAK,GAAG,IAAI,CAAA;YACZ,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAA;QAC5J,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,4BAA4B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC3F,CAAC"}
|
package/lib/mcpSeam.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plugin MCP seam host: bridges CC plugin `mcpServers` entries into
|
|
3
|
+
* `@dsh-cc/mcp-client` instances through the loader's `McpSeam` guest
|
|
4
|
+
* contract. Provided by the cc-shell-glue composition via a child plugin
|
|
5
|
+
* (a direct provide on the LOADING glue fiber is invisible to strict
|
|
6
|
+
* `ctx.get`), so the loader's `mountMcpServers` finds it under the `mcp` key.
|
|
7
|
+
*
|
|
8
|
+
* Registration behavior (docs/plans/2026-09-07-plugin-mcp-seam.md §3.1):
|
|
9
|
+
* - config errors SKIP the server with a warn (D1) — never throw;
|
|
10
|
+
* - `deferStartupConnect: true` so plugin servers never block boot (D5);
|
|
11
|
+
* - a pending-release ledger keyed on dispose-settle promises serializes
|
|
12
|
+
* same-name (re)registrations (D8), and a deferred attach carries a
|
|
13
|
+
* cancellation flag so dispose-before-attach never leaks a zombie fiber.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
18
|
+
import type { McpSeam } from '@dsh-cc/plugin-loader';
|
|
19
|
+
declare module '@deepseek-ai/cordis' {
|
|
20
|
+
interface Context {
|
|
21
|
+
/** The plugin MCP seam, when cc-shell-glue is composed. */
|
|
22
|
+
mcp: McpSeam;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** Options for `createPluginMcpSeam`. */
|
|
26
|
+
export interface PluginMcpSeamOptions {
|
|
27
|
+
/** Injectable plugin reference for tests; default: CcMcpClient. */
|
|
28
|
+
plugin?: unknown;
|
|
29
|
+
/** Injectable env lookup for expansion tests; default: process.env. */
|
|
30
|
+
env?: Record<string, string | undefined>;
|
|
31
|
+
/** Boot pending-notice feed: called with the normalized serverName. */
|
|
32
|
+
onRegistered?: (serverName: string) => void;
|
|
33
|
+
}
|
|
34
|
+
export declare function createPluginMcpSeam(ctx: Context, opts?: PluginMcpSeamOptions): McpSeam;
|
|
35
|
+
//# sourceMappingURL=mcpSeam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpSeam.d.ts","sourceRoot":"","sources":["../src/mcpSeam.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAEpD,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,2DAA2D;QAC3D,GAAG,EAAE,OAAO,CAAA;KACb;CACF;AAED,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC,mEAAmE;IACnE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,uEAAuE;IACvE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IACxC,uEAAuE;IACvE,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAA;CAC5C;AAOD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,GAAE,oBAAyB,GAAG,OAAO,CAwF1F"}
|
package/lib/mcpSeam.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plugin MCP seam host: bridges CC plugin `mcpServers` entries into
|
|
3
|
+
* `@dsh-cc/mcp-client` instances through the loader's `McpSeam` guest
|
|
4
|
+
* contract. Provided by the cc-shell-glue composition via a child plugin
|
|
5
|
+
* (a direct provide on the LOADING glue fiber is invisible to strict
|
|
6
|
+
* `ctx.get`), so the loader's `mountMcpServers` finds it under the `mcp` key.
|
|
7
|
+
*
|
|
8
|
+
* Registration behavior (docs/plans/2026-09-07-plugin-mcp-seam.md §3.1):
|
|
9
|
+
* - config errors SKIP the server with a warn (D1) — never throw;
|
|
10
|
+
* - `deferStartupConnect: true` so plugin servers never block boot (D5);
|
|
11
|
+
* - a pending-release ledger keyed on dispose-settle promises serializes
|
|
12
|
+
* same-name (re)registrations (D8), and a deferred attach carries a
|
|
13
|
+
* cancellation flag so dispose-before-attach never leaks a zombie fiber.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
import * as CcMcpClient from '@dsh-cc/mcp-client';
|
|
18
|
+
import { buildRegistrations } from '@dsh-cc/mcp-config';
|
|
19
|
+
export function createPluginMcpSeam(ctx, opts = {}) {
|
|
20
|
+
const plugin = opts.plugin ?? CcMcpClient;
|
|
21
|
+
// Pending-release ledger (D8): serverName → the promise whose settle makes
|
|
22
|
+
// the name free again. Attach writes the activation-settle entry; the
|
|
23
|
+
// DISPOSER overwrites it with the dispose-settle promise BEFORE disposing
|
|
24
|
+
// (that side is the one that guards the async `_unload` namespace release a
|
|
25
|
+
// remount would otherwise race). Entries are deleted on every settle branch
|
|
26
|
+
// — the map holds pending-only.
|
|
27
|
+
const ledger = new Map();
|
|
28
|
+
const release = (serverName, pending) => {
|
|
29
|
+
ledger.set(serverName, pending);
|
|
30
|
+
void pending.then(() => {
|
|
31
|
+
if (ledger.get(serverName) === pending)
|
|
32
|
+
ledger.delete(serverName);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
const mount = (p, config) => ctx.plugin(p, config);
|
|
36
|
+
return {
|
|
37
|
+
registerServer(name, rawConfig) {
|
|
38
|
+
let registrations;
|
|
39
|
+
try {
|
|
40
|
+
registrations = buildRegistrations({ mcpServers: { [name]: rawConfig } }, { env: opts.env ?? process.env, deferStartupConnect: true });
|
|
41
|
+
}
|
|
42
|
+
catch (cause) {
|
|
43
|
+
ctx.logger.warn(`cc-shell-glue: skipped plugin MCP server "${name}": ${String(cause)}`);
|
|
44
|
+
return () => { };
|
|
45
|
+
}
|
|
46
|
+
if (registrations.length !== 1) {
|
|
47
|
+
ctx.logger.warn(`cc-shell-glue: skipped plugin MCP server "${name}": dropped by config policy`);
|
|
48
|
+
return () => { };
|
|
49
|
+
}
|
|
50
|
+
const config = registrations[0];
|
|
51
|
+
const serverName = config.serverName;
|
|
52
|
+
const attach = () => {
|
|
53
|
+
const fiber = mount(plugin, config);
|
|
54
|
+
// The activation thenable is always consumed: settle on success, warn
|
|
55
|
+
// on rejection (e.g. a duplicate-namespace reservation), so no
|
|
56
|
+
// unhandled rejection ever escapes the seam.
|
|
57
|
+
const active = Promise.resolve(fiber).then(() => { }, error => {
|
|
58
|
+
ctx.logger.warn(`cc-shell-glue: MCP server ${serverName} failed to activate: ${String(error)}`);
|
|
59
|
+
});
|
|
60
|
+
release(serverName, active);
|
|
61
|
+
opts.onRegistered?.(serverName);
|
|
62
|
+
return () => {
|
|
63
|
+
const disposed = Promise.resolve(fiber.dispose()).then(() => { }, error => {
|
|
64
|
+
ctx.logger.warn(`cc-shell-glue: MCP server ${serverName} teardown failed: ${String(error)}`);
|
|
65
|
+
});
|
|
66
|
+
// Written BEFORE disposing: a same-name remount chains behind this
|
|
67
|
+
// dispose-settle promise, not behind the (long-settled) activation.
|
|
68
|
+
release(serverName, disposed);
|
|
69
|
+
void fiber.dispose();
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
const pending = ledger.get(serverName);
|
|
73
|
+
if (pending === undefined)
|
|
74
|
+
return attach();
|
|
75
|
+
// Same-name attach while a previous release is pending: defer behind it,
|
|
76
|
+
// carrying a cancellation flag their disposer sets — dispose-before-attach
|
|
77
|
+
// disposes the freshly created fiber immediately instead of leaking it.
|
|
78
|
+
let cancelled = false;
|
|
79
|
+
let attached;
|
|
80
|
+
void pending.then(() => {
|
|
81
|
+
if (cancelled) {
|
|
82
|
+
attach()();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
attached = attach();
|
|
86
|
+
});
|
|
87
|
+
return () => {
|
|
88
|
+
if (attached !== undefined) {
|
|
89
|
+
attached();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
cancelled = true;
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=mcpSeam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpSeam.js","sourceRoot":"","sources":["../src/mcpSeam.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,kBAAkB,EAAe,MAAM,oBAAoB,CAAA;AAyBpE,MAAM,UAAU,mBAAmB,CAAC,GAAY,EAAE,OAA6B,EAAE;IAC/E,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,WAAW,CAAA;IACzC,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AAO,MAAM,EAAE,CAAA;YAE1C,yEAAyE;YACzE,2EAA2E;YAC3E,wEAAwE;YACxE,IAAI,SAAS,GAAG,KAAK,CAAA;YACrB,IAAI,QAAkC,CAAA;YACtC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE;gBACrB,IAAI,SAAS,EAAE,CAAC;oBACd,MAAM,EAAE,EAAE,CAAA;oBACV,OAAM;gBACR,CAAC;gBACD,QAAQ,GAAG,MAAM,EAAE,CAAA;YACrB,CAAC,CAAC,CAAA;YACF,OAAO,GAAG,EAAE;gBACV,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;oBAC3B,QAAQ,EAAE,CAAA;oBACV,OAAM;gBACR,CAAC;gBACD,SAAS,GAAG,IAAI,CAAA;YAClB,CAAC,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-cc/bundle-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "CC shell host-plane infra: tools registry swap (deferred-name support) + settings migrations; the glue plugin code lives here but is mounted by the CC preset (packages/preset/cc)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -30,18 +30,19 @@
|
|
|
30
30
|
},
|
|
31
31
|
"license": "Apache-2.0",
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@deepseek-ai/cordis": ">=0.1.
|
|
34
|
-
"@deepseek-ai/dsh-
|
|
35
|
-
"@deepseek-ai/dsh-
|
|
33
|
+
"@deepseek-ai/cordis": ">=0.1.2-rc.1",
|
|
34
|
+
"@deepseek-ai/dsh-home-paths": ">=0.1.2-rc.1",
|
|
35
|
+
"@deepseek-ai/dsh-llm": ">=0.1.2-rc.1",
|
|
36
|
+
"@deepseek-ai/dsh-settings": ">=0.1.2-rc.1"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@dsh-cc/claude-code-agents": "^0.
|
|
39
|
-
"@dsh-cc/plugin-loader": "^0.
|
|
40
|
-
"@dsh-cc/
|
|
41
|
-
"@dsh-cc/
|
|
42
|
-
"@dsh-cc/model-aliases": "^0.
|
|
43
|
-
"@dsh-cc/
|
|
44
|
-
"@dsh-cc/
|
|
39
|
+
"@dsh-cc/claude-code-agents": "^0.6.0",
|
|
40
|
+
"@dsh-cc/plugin-loader": "^0.6.0",
|
|
41
|
+
"@dsh-cc/plugin-manager": "^0.6.0",
|
|
42
|
+
"@dsh-cc/mcp-config": "^0.6.0",
|
|
43
|
+
"@dsh-cc/model-aliases": "^0.6.0",
|
|
44
|
+
"@dsh-cc/session-title-provider": "^0.6.0",
|
|
45
|
+
"@dsh-cc/mcp-client": "^0.6.0"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@deepseek-ai/dsh-settings": "link:../../../../deepseek-harness/packages/settings/settings",
|
|
@@ -51,15 +52,16 @@
|
|
|
51
52
|
"@deepseek-ai/dsh-agent": "link:../../../../deepseek-harness/packages/core/agent",
|
|
52
53
|
"@deepseek-ai/dsh-agent-loop": "link:../../../../deepseek-harness/packages/core/agent-loop",
|
|
53
54
|
"@deepseek-ai/dsh-agent-loop-testkit": "link:../../../../deepseek-harness/packages/test-support/agent-loop-testkit",
|
|
55
|
+
"@deepseek-ai/dsh-home-paths": "link:../../../../deepseek-harness/packages/util/home-paths",
|
|
54
56
|
"@deepseek-ai/dsh-llm": "link:../../../../deepseek-harness/packages/llm/llm",
|
|
55
57
|
"@deepseek-ai/dsh-schedule": "link:../../../../deepseek-harness/packages/schedule/schedule",
|
|
56
58
|
"@deepseek-ai/dsh-session": "link:../../../../deepseek-harness/packages/core/session",
|
|
59
|
+
"@deepseek-ai/dsh-session-persistence": "link:../../../../deepseek-harness/packages/session/session-persistence",
|
|
57
60
|
"@deepseek-ai/dsh-session-persistence-jsonl": "link:../../../../deepseek-harness/packages/session/session-persistence-jsonl",
|
|
58
61
|
"@deepseek-ai/dsh-session-projection": "link:../../../../deepseek-harness/packages/session/session-projection",
|
|
59
62
|
"@deepseek-ai/dsh-subagent": "link:../../../../deepseek-harness/packages/subagent/subagent",
|
|
60
63
|
"@deepseek-ai/dsh-subagent-spawn-in-process": "link:../../../../deepseek-harness/packages/subagent/subagent-spawn-in-process",
|
|
61
64
|
"@deepseek-ai/dsh-tool-subagent-control": "link:../../../../deepseek-harness/packages/subagent/tool-subagent-control",
|
|
62
|
-
"@deepseek-ai/dsh-tool-subagent-report": "link:../../../../deepseek-harness/packages/subagent/tool-subagent-report",
|
|
63
65
|
"@deepseek-ai/dsh-system-prompt": "link:../../../../deepseek-harness/packages/core/system-prompt",
|
|
64
66
|
"@deepseek-ai/dsh-tool-web": "link:../../../../deepseek-harness/packages/web/tool-web",
|
|
65
67
|
"@deepseek-ai/dsh-tools": "link:../../../../deepseek-harness/packages/core/tools",
|
|
@@ -72,13 +74,14 @@
|
|
|
72
74
|
"@deepseek-ai/dsh-web-fetch-http": "link:../../../../deepseek-harness/packages/web/web-fetch-http",
|
|
73
75
|
"typescript": "6.0.3",
|
|
74
76
|
"@deepseek-ai/dsh-fs-local": "link:../../../../deepseek-harness/packages/fs/fs-local",
|
|
75
|
-
"@dsh-cc/
|
|
76
|
-
"@dsh-cc/tools": "^0.
|
|
77
|
-
"@dsh-cc/
|
|
78
|
-
"@dsh-cc/
|
|
79
|
-
"@dsh-cc/
|
|
80
|
-
"@dsh-cc/
|
|
81
|
-
"@dsh-cc/subagent-
|
|
77
|
+
"@dsh-cc/hooks-claude-code": "^0.6.0",
|
|
78
|
+
"@dsh-cc/tools": "^0.6.0",
|
|
79
|
+
"@dsh-cc/tool-sleep": "^0.6.0",
|
|
80
|
+
"@dsh-cc/tool-structured-output": "^0.6.0",
|
|
81
|
+
"@dsh-cc/settings-migrations": "^0.6.0",
|
|
82
|
+
"@dsh-cc/subagent-task": "^0.6.0",
|
|
83
|
+
"@dsh-cc/subagent-resume-pins": "^0.6.0",
|
|
84
|
+
"@dsh-cc/tool-notebook-edit": "^0.6.0"
|
|
82
85
|
},
|
|
83
86
|
"publishConfig": {
|
|
84
87
|
"access": "public"
|