@khorsheed/dsh-local-agent-dsh-headless 0.2.0-rc.1 → 0.2.0-rc.3
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/CHANGELOG.md +7 -0
- package/README.en.md +3 -5
- package/README.i18n.yaml +2 -2
- package/README.md +3 -5
- package/cordis.patch.yml +5 -2
- package/package.json +10 -12
- package/lib/invariant.js +0 -36
- package/lib/types/invariant.d.ts +0 -16
- package/lib/types/invariant.js +0 -41
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# 变更记录
|
|
2
2
|
|
|
3
|
+
## 0.2.0-rc.3(2026-10-22)
|
|
4
|
+
|
|
5
|
+
(版本号说明:本包 0.2.0-rc.2 曾被发布后又撤回,npm 永久烧掉该版本号——发布侧报错「Cannot stage previously published version」——为守住家族「同一版本线」纪律(check:release-groups),本波家族整体上移 rc.3,内容即 rc.2 计划稿。)
|
|
6
|
+
|
|
7
|
+
- **persona 行适配宿主 0.2.1**:子 dsh patch 的 system-prompt 行不再引用 `{{cwd}}`——0.2.1 删除了该 prompt 变量,严格引用直接让模型请求失败(prod 3080 切到 0.2.1-rc.1 后的轮次失败即此);工作目录改由宿主 working-directory 服务作为必需用户上下文提供,该条款随之删除。合并的 `persona` 字段按 0.2.1 的拆分改写为 `personaPrefix`/`personaSuffix`。
|
|
8
|
+
- **适配宿主 0.2.1(host-021)**:`engines.dsh` 声明为 `>=0.1.5-rc.1 <0.3.0-0`(声明即独占兼容裁决,未验证的宿主线安装期 fail-closed);invariant 伴随件随官方删除 invariants 体系退役。运行时与 peer 区间加宽——`@deepseek-ai/dsh-cmdline`、`@deepseek-ai/dsh-ptc-runtime-node` 等补齐 0.2.0 与 0.2.1 分支(semver 预发布只覆盖比较子点名的三元组,原 `^0.1.x-rc.x` 区间在严格 npm/pnpm 解析下不覆盖 0.2.x 宿主)。`dsh.compat.verifiedHost` 前移至 0.2.1-rc.1(host-021 波对 0.2.1-rc.1 树全量构建+测试绿)。
|
|
9
|
+
|
|
3
10
|
## 0.2.0-rc.1(2026-09-30)
|
|
4
11
|
|
|
5
12
|
家族同版联动:家族折叠(委派工具收进各 provider 的 `./tool` 入口,`local-agent-tool-subagent` 退役)随 0.2.0-rc.1 线发布。无功能变更。
|
package/README.en.md
CHANGED
|
@@ -62,12 +62,12 @@ The parent `local-agent-dsh` provider supplies `--model` automatically: the harn
|
|
|
62
62
|
## Compatibility
|
|
63
63
|
|
|
64
64
|
- npm release line (`@deepseek-ai/dsh@0.1.5-rc.1`): ✅ full — the first release line (0.1.0-rc.6) is already based on the 0.1.5-rc.1 API surface, full build+test green; minHost is 0.1.5-rc.1, and older hosts have no earlier release line to fall back to.
|
|
65
|
-
- source line (deepseek-harness master): ✅ (verifiedHost: 0.1.
|
|
65
|
+
- source line (deepseek-harness master): ✅ (verifiedHost: 0.2.1-rc.1) — host-021 wave: full build+test green against the 0.2.1-rc.1 tree; the family delegation migrated to `ctx.subagents.startActivation` (managed activation), and run.id is now unique per execution.
|
|
66
66
|
|
|
67
67
|
## Known Limitations
|
|
68
68
|
|
|
69
69
|
- **Never add this bundle to an interactive profile's `bundles`** — its sub-profile-only patch rows (persona override, `hmr` off, `tools` mode, the `ptc-runtime` insert, the member-bridge MCP) collide with an interactive composition and leak overrides into real user sessions. The package **declares no `dsh.bundle`** (the manifest carries `dsh.composition.component: "sub-profile-patch"`), so a hand-added bundles row fails loud at boot in `loadProfile` — that is the gate.
|
|
70
|
-
- **`dsh plugin add` on this package mounts nothing, and need not** — the package used to declare `dsh.bundle`, and reconcilePlugins auto-mounts every `dsh.bundle`-declaring direct dependency into the composition's layer stack: both the 2026-08-23 P0 (duplicate `code-runtime` in the prod web profile) and its 2026-09-03 G3 recurrence were exactly that mount. The declaration is gone (T6); installing the package directly now earns only a "plain dependency" warning and mounts nothing — a **transitive** install through `@khorsheed/dsh-local-agent-dsh` suffices, and the parent provider auto-provisions.
|
|
70
|
+
- **`dsh plugin add` on this package mounts nothing, and need not** — the package used to declare `dsh.bundle`, and reconcilePlugins auto-mounts every `dsh.bundle`-declaring direct dependency into the composition's layer stack: both the 2026-08-23 P0 (duplicate `code-runtime` in the prod web profile) and its 2026-09-03 G3 recurrence were exactly that mount. The declaration is gone (T6); installing the package directly now earns only a "plain dependency" warning and mounts nothing — a **transitive** install through `@khorsheed/dsh-local-agent-dsh` suffices, and the parent provider auto-provisions.
|
|
71
71
|
- No other `local-agent` family bundles belong in this composition — nothing here spawns another dsh.
|
|
72
72
|
- Patch edits must be boot-verified before landing (`dsh preflight` or one real sub-dsh launch): the `!!js` tag is scalar-only, and a mistagged collection fails at profile boot.
|
|
73
73
|
|
|
@@ -101,11 +101,9 @@ The startup provider parses the task positional plus the mutually exclusive `--s
|
|
|
101
101
|
|
|
102
102
|
**The wire contract (`src/wire.ts`).** A family-internal newline-delimited JSON-RPC 2.0 over stdio, framed exactly like the official `JsonRpcLineTransport` (`@deepseek-ai/dsh-sdk-protocol`), so a future swap to the official SDK server stays mechanical — the official server is not usable today: its wire has no turn-level interrupt (`initialize` / `session/prompt` / `shutdown` only), and graceful interrupt is the live driver's reason to exist (upstream seam registry: the SDK-wire-interrupt entry). Every request is a quick acknowledgement (`turn/start` answers "accepted"), and the round's events and terminal outcome flow back as notifications, so a long turn never holds a request open. `turn/start` carries the parent's round number and echoes it on every `session/event` / `session/idle` of that round, so the parent can drop a cancelled round's late unwind instead of letting it mis-settle the next round; `session/idle` fires only AFTER the session log is flushed, so a file-based reconciliation right after it sees the complete round. The handshake (`initialize`) reports the server name and protocol version (currently 1); `session/prepare` lets the parent validate the resident process's bound model and reasoning effort before starting a round — no session created, nothing generated. One resident process serves one member.
|
|
103
103
|
|
|
104
|
-
**Composition guard.** The `/invariant` subpath registers a composition invariant: detecting the `webStartup` service (the marker of a web composition) fails loud. The loader's duplicate-id failure is loud but cryptic, and only fires when ids collide — if upstream renamed a row id, the persona override would leak into real user sessions silently; the invariant is the CLEAR failure for the non-colliding case.
|
|
105
|
-
|
|
106
104
|
**Preset roster (optional).** When the sub-profile's patch carries an extra `@deepseek-ai/dsh-agent-presets` layer — written by the parent provider when the scope declares a preset — the agent loader joins it inside `setup`, before the agent is published, so the preset's tools and prompt sections exist before the first prompt assembly. Without the layer it does nothing: the model-facing rows stay in the host plane and the agent reads the global layer, byte for byte the behavior before this existed. A roster that REFUSES (unknown preset id, broken composition) is not degraded past: the mount rejects, the agent creation rolls back, and the launch fails naming the preset — a sub-dsh that silently ran the global layer after being told to run preset X would attribute the round to a capability face it never had.
|
|
107
105
|
|
|
108
|
-
**Exports.** `.` exports the runner plugin body (`apply` / `inject` / `Config`); `/startup` exports the command-line provider (the source of the `localAgentDshHeadlessStartup` service); `/wire` exports the wire contract types and protocol constants
|
|
106
|
+
**Exports.** `.` exports the runner plugin body (`apply` / `inject` / `Config`); `/startup` exports the command-line provider (the source of the `localAgentDshHeadlessStartup` service); `/wire` exports the wire contract types and protocol constants.
|
|
109
107
|
|
|
110
108
|
</details>
|
|
111
109
|
|
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# last confirmed-consistent state. Both languages carry equal authority; after
|
|
3
3
|
# editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/local-agent-dsh-headless/README.en.md
|
|
5
|
-
packages/local-agent-dsh-headless/README.en.md:
|
|
6
|
-
packages/local-agent-dsh-headless/README.md:
|
|
5
|
+
packages/local-agent-dsh-headless/README.en.md: 870b188762ff71253b0d1e2e473e8a78c1ed228d
|
|
6
|
+
packages/local-agent-dsh-headless/README.md: 0ae196a948c3d01ea55b63019f53a222d228e446
|
package/README.md
CHANGED
|
@@ -62,12 +62,12 @@ dsh --profile headless-local-agent-dsh --model deepseek-official/deepseek-v4-pro
|
|
|
62
62
|
## Compatibility
|
|
63
63
|
|
|
64
64
|
- npm 发布线(`@deepseek-ai/dsh@0.1.5-rc.1`):✅ 完整——首个发布线(0.1.0-rc.6)即以 0.1.5-rc.1 API 面为基线,全量构建测试通过;minHost 即 0.1.5-rc.1,更旧的宿主没有可回退的旧发布线。
|
|
65
|
-
- 源码线(deepseek-harness master):✅(verifiedHost: 0.1.
|
|
65
|
+
- 源码线(deepseek-harness master):✅(verifiedHost: 0.2.1-rc.1)——host-021 波对 0.2.1-rc.1 树全量 build+test 绿;家族委派迁移到 `ctx.subagents.startActivation`(受管 activation),run.id 改为每次执行唯一。
|
|
66
66
|
|
|
67
67
|
## 已知限制
|
|
68
68
|
|
|
69
69
|
- **绝不要把这个 bundle 加进交互式 profile 的 `bundles`**——它的子 profile 专属 patch 行(persona 覆盖、`hmr` 禁用、`tools` mode、`ptc-runtime` insert、member-bridge MCP)会撞交互式组合,并把覆盖泄漏进真实用户会话。本包**不声明 `dsh.bundle`**(manifest 里标的是 `dsh.composition.component: "sub-profile-patch"`),手工加的 bundles 行在 boot 的 `loadProfile` 处直接 fail loud,这正是一道闸。
|
|
70
|
-
- **`dsh plugin add` 它本身不挂载任何东西,也无需如此**——本包曾声明 `dsh.bundle`,而 reconcilePlugins 会把声明该字段的直接依赖自动挂进组合的 layer 栈:2026-08-23 P0(prod web profile 撞 duplicate `code-runtime`)与 2026-09-03 G3 复发都是这一挂。声明已撤(T6),装成直接依赖只会得到一条 "plain dependency" 警告、不挂载——经 `@khorsheed/dsh-local-agent-dsh` **传递**安装即可,父级 provider 会自动 provision
|
|
70
|
+
- **`dsh plugin add` 它本身不挂载任何东西,也无需如此**——本包曾声明 `dsh.bundle`,而 reconcilePlugins 会把声明该字段的直接依赖自动挂进组合的 layer 栈:2026-08-23 P0(prod web profile 撞 duplicate `code-runtime`)与 2026-09-03 G3 复发都是这一挂。声明已撤(T6),装成直接依赖只会得到一条 "plain dependency" 警告、不挂载——经 `@khorsheed/dsh-local-agent-dsh` **传递**安装即可,父级 provider 会自动 provision。
|
|
71
71
|
- 此 composition 里不装任何其他 `local-agent` 家族 bundle——这里没有任何东西再 spawn 一个 dsh。
|
|
72
72
|
- patch 改动落地前必须做启动级验证(`dsh preflight` 或真实拉起一次子 dsh):`!!js` 标签只支持标量,误标集合会在 profile 启动时直接失败。
|
|
73
73
|
|
|
@@ -101,11 +101,9 @@ startup provider 解析 task 位置参数与互斥的 `--session-id` / `--resume
|
|
|
101
101
|
|
|
102
102
|
**wire 契约(`src/wire.ts`)。** 家族内部的行分隔 JSON-RPC 2.0 over stdio,帧格式与官方 `JsonRpcLineTransport`(`@deepseek-ai/dsh-sdk-protocol`)完全一致,将来换成官方 SDK server 只是机械替换——官方 server 今天用不了:它的 wire 没有轮次级中断(只有 `initialize` / `session/prompt` / `shutdown`),而优雅中断正是 live driver 存在的理由(上游 seam 登记:SDK-wire-interrupt 条目)。所有请求都是快速应答(`turn/start` 应答即「已受理」),轮次的事件与结局全部以通知回流,长轮永远不占着一条请求。`turn/start` 带上父侧的轮次号,并在本轮每个 `session/event` / `session/idle` 通知上回显,父侧借此丢弃被取消轮次的迟到收尾,不让它误 settle 下一轮;`session/idle` 在会话日志落盘**之后**才发出,父侧随即做的文件对账看到的就是完整一轮。握手(`initialize`)回报 server 名与协议版本(当前 1);`session/prepare` 让父侧在起轮之前校验常驻进程绑定的模型与推理强度——不建会话、不生成。一个常驻进程服务一个成员。
|
|
103
103
|
|
|
104
|
-
**组合守卫。** `/invariant` 子路径注册一条组合不变量:检出 `webStartup` 服务(web 组合的标记)即 fail loud。loader 的 duplicate-id 失败虽响但难读,且只在 id 相撞时才触发——若上游改了 row id,persona 覆盖就会静音泄漏进真实用户会话;不变量是不相撞情形的那个清晰失败。
|
|
105
|
-
|
|
106
104
|
**preset roster(可选)。** 如果子 profile 的 patch 多带一层 `@deepseek-ai/dsh-agent-presets`(父级 provider 在这个 scope 声明了 preset 时写进去的),agent loader 会在 `setup` 里 join 它——在 agent 发布之前,因此 preset 的工具与提示词片段在第一次组装提示词之前就在位。没有这一层就什么也不做,模型可见的行留在宿主面、agent 从全局层读,与本行为出现之前逐字节相同。roster **拒绝**(preset id 不存在、composition 坏了)不会被降级绕过:mount 抛错,agent 创建回滚,启动带着 preset 名失败——一个被要求跑 preset X 却悄悄跑了全局层的子 dsh,会把这一轮归到它从没有过的能力面上。
|
|
107
105
|
|
|
108
|
-
**导出。** `.` 导出 runner 插件本体(`apply` / `inject` / `Config`);`/startup` 导出命令行 provider(`localAgentDshHeadlessStartup` 服务的来源);`/wire` 导出 wire
|
|
106
|
+
**导出。** `.` 导出 runner 插件本体(`apply` / `inject` / `Config`);`/startup` 导出命令行 provider(`localAgentDshHeadlessStartup` 服务的来源);`/wire` 导出 wire 契约类型与协议常量。
|
|
109
107
|
|
|
110
108
|
</details>
|
|
111
109
|
|
package/cordis.patch.yml
CHANGED
|
@@ -20,8 +20,11 @@
|
|
|
20
20
|
|
|
21
21
|
- id: system-prompt
|
|
22
22
|
config:
|
|
23
|
-
persona
|
|
24
|
-
|
|
23
|
+
# Host 0.2.1 split `persona` into personaPrefix/personaSuffix and removed the
|
|
24
|
+
# {{cwd}} prompt variable; the working-directory service supplies the directory
|
|
25
|
+
# as required user context instead.
|
|
26
|
+
personaPrefix: >-
|
|
27
|
+
You are a coding agent powered by the {{model}} model.
|
|
25
28
|
|
|
26
29
|
# The shared module-reload HMR row stays off; the launcher's watch-only
|
|
27
30
|
# fallback still keeps the user patch layers live until the run exits.
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"local-agent",
|
|
9
9
|
"headless"
|
|
10
10
|
],
|
|
11
|
-
"version": "0.2.0-rc.
|
|
11
|
+
"version": "0.2.0-rc.3",
|
|
12
12
|
"type": "module",
|
|
13
13
|
"main": "lib/index.js",
|
|
14
14
|
"types": "lib/types/index.d.ts",
|
|
@@ -25,10 +25,6 @@
|
|
|
25
25
|
"types": "./lib/types/wire.d.ts",
|
|
26
26
|
"default": "./lib/wire.js"
|
|
27
27
|
},
|
|
28
|
-
"./invariant": {
|
|
29
|
-
"types": "./lib/types/invariant.d.ts",
|
|
30
|
-
"default": "./lib/invariant.js"
|
|
31
|
-
},
|
|
32
28
|
"./src/*": "./src/*",
|
|
33
29
|
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
34
30
|
"./package.json": "./package.json"
|
|
@@ -39,7 +35,7 @@
|
|
|
39
35
|
},
|
|
40
36
|
"compat": {
|
|
41
37
|
"minHost": "0.1.5-rc.1",
|
|
42
|
-
"verifiedHost": "0.1
|
|
38
|
+
"verifiedHost": "0.2.1-rc.1"
|
|
43
39
|
}
|
|
44
40
|
},
|
|
45
41
|
"files": [
|
|
@@ -48,15 +44,17 @@
|
|
|
48
44
|
"CHANGELOG.md"
|
|
49
45
|
],
|
|
50
46
|
"license": "MIT",
|
|
47
|
+
"engines": {
|
|
48
|
+
"dsh": ">=0.1.5-rc.1 <0.3.0-0"
|
|
49
|
+
},
|
|
51
50
|
"peerDependencies": {
|
|
52
51
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
53
52
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.2",
|
|
54
|
-
"@deepseek-ai/dsh-agent": "^0.1.0-rc.6 || ^0.2.0-rc.1",
|
|
55
|
-
"@deepseek-ai/dsh-agent-default-model": "^0.1.0-rc.6 || ^0.2.0-rc.1",
|
|
56
|
-
"@deepseek-ai/dsh-
|
|
57
|
-
"@deepseek-ai/dsh-
|
|
58
|
-
"@deepseek-ai/dsh-
|
|
59
|
-
"@deepseek-ai/dsh-session": "^0.1.0-rc.6 || ^0.2.0-rc.1"
|
|
53
|
+
"@deepseek-ai/dsh-agent": "^0.1.0-rc.6 || ^0.2.0-rc.1 || ^0.2.1-rc.1",
|
|
54
|
+
"@deepseek-ai/dsh-agent-default-model": "^0.1.0-rc.6 || ^0.2.0-rc.1 || ^0.2.1-rc.1",
|
|
55
|
+
"@deepseek-ai/dsh-llm": "^0.1.0-rc.6 || ^0.2.0-rc.1 || ^0.2.1-rc.1",
|
|
56
|
+
"@deepseek-ai/dsh-mcp-client": "^0.1.0-rc.8 || ^0.2.0-rc.1 || ^0.2.1-rc.1",
|
|
57
|
+
"@deepseek-ai/dsh-session": "^0.1.0-rc.6 || ^0.2.0-rc.1 || ^0.2.1-rc.1"
|
|
60
58
|
},
|
|
61
59
|
"peerDependenciesMeta": {
|
|
62
60
|
"@deepseek-ai/dsh-mcp-client": {
|
package/lib/invariant.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
//#region lib/types/invariant.js
|
|
2
|
-
/**
|
|
3
|
-
* Package-owned invariant companion for `@khorsheed/dsh-local-agent-dsh-headless`.
|
|
4
|
-
* @module @khorsheed/dsh-local-agent-dsh-headless/invariant
|
|
5
|
-
*/
|
|
6
|
-
const PACKAGE_NAME = "@khorsheed/dsh-local-agent-dsh-headless";
|
|
7
|
-
/** Cordis companion plugin name. */
|
|
8
|
-
const name = "local-agent-dsh-headless-invariant";
|
|
9
|
-
/** Service required before the companion can register. */
|
|
10
|
-
const inject = ["invariants"];
|
|
11
|
-
/**
|
|
12
|
-
* Composition guard: this bundle is sub-profile-only. Its patch rows
|
|
13
|
-
* (persona override, `hmr` off, `tools` mode, the `ptc-runtime` insert, the
|
|
14
|
-
* member-bridge MCP row) collide with or leak into any Host/web composition —
|
|
15
|
-
* 2026-08-23 P0: reconciled into the prod web profile as a direct dependency
|
|
16
|
-
* (reconcilePlugins auto-mounts every `dsh.bundle`-declaring direct dep), the
|
|
17
|
-
* `code-runtime` insert (today's `ptc-runtime` row) hit the web-app row's duplicate entry id and the
|
|
18
|
-
* whole instance failed to boot. The loader's duplicate-id failure is loud
|
|
19
|
-
* but cryptic, and only fires when the ids collide; this invariant is the
|
|
20
|
-
* CLEAR failure for the non-colliding case (e.g. an upstream row rename would
|
|
21
|
-
* otherwise leak the persona override into real user sessions). The web
|
|
22
|
-
* layer's `webStartup` service is the marker: in-box bundles mount before
|
|
23
|
-
* dependency-managed ones, so it is already provided when this companion
|
|
24
|
-
* applies.
|
|
25
|
-
*/
|
|
26
|
-
const install = (ctx, fail) => {
|
|
27
|
-
if (ctx.get("webStartup") !== void 0) fail("mounted into a web composition — this bundle is sub-profile-only. Remove it from the profile’s direct dependencies: the parent local-agent-dsh bundle installs it transitively, and the sub-profile symlink resolves from that closure");
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Register this package's invariant companion.
|
|
31
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
32
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
33
|
-
*/
|
|
34
|
-
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
35
|
-
//#endregion
|
|
36
|
-
export { apply, inject, name };
|
package/lib/types/invariant.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Package-owned invariant companion for `@khorsheed/dsh-local-agent-dsh-headless`.
|
|
3
|
-
* @module @khorsheed/dsh-local-agent-dsh-headless/invariant
|
|
4
|
-
*/
|
|
5
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
-
/** Cordis companion plugin name. */
|
|
7
|
-
export declare const name = "local-agent-dsh-headless-invariant";
|
|
8
|
-
/** Service required before the companion can register. */
|
|
9
|
-
export declare const inject: string[];
|
|
10
|
-
/**
|
|
11
|
-
* Register this package's invariant companion.
|
|
12
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
13
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
14
|
-
*/
|
|
15
|
-
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
16
|
-
//# sourceMappingURL=invariant.d.ts.map
|
package/lib/types/invariant.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Package-owned invariant companion for `@khorsheed/dsh-local-agent-dsh-headless`.
|
|
3
|
-
* @module @khorsheed/dsh-local-agent-dsh-headless/invariant
|
|
4
|
-
*/
|
|
5
|
-
const PACKAGE_NAME = '@khorsheed/dsh-local-agent-dsh-headless';
|
|
6
|
-
/** Cordis companion plugin name. */
|
|
7
|
-
export const name = 'local-agent-dsh-headless-invariant';
|
|
8
|
-
/** Service required before the companion can register. */
|
|
9
|
-
export const inject = ['invariants'];
|
|
10
|
-
/**
|
|
11
|
-
* Composition guard: this bundle is sub-profile-only. Its patch rows
|
|
12
|
-
* (persona override, `hmr` off, `tools` mode, the `ptc-runtime` insert, the
|
|
13
|
-
* member-bridge MCP row) collide with or leak into any Host/web composition —
|
|
14
|
-
* 2026-08-23 P0: reconciled into the prod web profile as a direct dependency
|
|
15
|
-
* (reconcilePlugins auto-mounts every `dsh.bundle`-declaring direct dep), the
|
|
16
|
-
* `code-runtime` insert (today's `ptc-runtime` row) hit the web-app row's duplicate entry id and the
|
|
17
|
-
* whole instance failed to boot. The loader's duplicate-id failure is loud
|
|
18
|
-
* but cryptic, and only fires when the ids collide; this invariant is the
|
|
19
|
-
* CLEAR failure for the non-colliding case (e.g. an upstream row rename would
|
|
20
|
-
* otherwise leak the persona override into real user sessions). The web
|
|
21
|
-
* layer's `webStartup` service is the marker: in-box bundles mount before
|
|
22
|
-
* dependency-managed ones, so it is already provided when this companion
|
|
23
|
-
* applies.
|
|
24
|
-
*/
|
|
25
|
-
const install = (ctx, fail) => {
|
|
26
|
-
// Duck-typed global-store read: the web marker is not a dependency of this
|
|
27
|
-
// package, so no typed Context merge exists for it.
|
|
28
|
-
const probe = ctx;
|
|
29
|
-
if (probe.get('webStartup') !== undefined) {
|
|
30
|
-
fail('mounted into a web composition — this bundle is sub-profile-only. '
|
|
31
|
-
+ 'Remove it from the profile’s direct dependencies: the parent '
|
|
32
|
-
+ 'local-agent-dsh bundle installs it transitively, and the '
|
|
33
|
-
+ 'sub-profile symlink resolves from that closure');
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Register this package's invariant companion.
|
|
38
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
39
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
40
|
-
*/
|
|
41
|
-
export const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|