@dsmm/dsmm 0.3.29 → 0.3.31

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.
Files changed (46) hide show
  1. package/docs/compatibility.md +4 -2
  2. package/docs/testing.md +2 -0
  3. package/docs/web-fetch-fakeip.md +2 -2
  4. package/dsh-plugin.json +1 -1
  5. package/lib/agent-prompt-scope.d.ts +3 -2
  6. package/lib/agent-prompt-scope.js +11 -16
  7. package/lib/client/children-locales.d.ts +4 -4
  8. package/lib/client/role-call-observations.js +2 -2
  9. package/lib/client.js +414 -1288
  10. package/lib/core-permission-authority.js +4 -0
  11. package/lib/host-llm.d.ts +5 -0
  12. package/lib/host-llm.js +9 -0
  13. package/lib/index.js +13 -16
  14. package/lib/live-pi-ai-owner.d.ts +1 -0
  15. package/lib/live-pi-ai-owner.js +2 -1
  16. package/lib/mode.d.ts +3 -2
  17. package/lib/mode.js +8 -12
  18. package/lib/model-routing.js +2 -2
  19. package/lib/native-admission.d.ts +2 -0
  20. package/lib/native-admission.js +80 -24
  21. package/lib/native-pi-ai-wire.js +2 -2
  22. package/lib/native-scope.d.ts +3 -3
  23. package/lib/native-scope.js +5 -6
  24. package/lib/permission-schema.d.ts +40 -0
  25. package/lib/permission-schema.js +13 -0
  26. package/lib/permission-settings.d.ts +0 -38
  27. package/lib/permission-settings.js +23 -18
  28. package/lib/preset-skills.d.ts +3 -2
  29. package/lib/preset-skills.js +12 -14
  30. package/lib/profile-diagnostics.js +1 -11
  31. package/lib/resident-root.d.ts +10 -0
  32. package/lib/resident-root.js +151 -0
  33. package/lib/role-identity.d.ts +2 -2
  34. package/lib/role-identity.js +1 -5
  35. package/lib/role-llm-runtime.d.ts +12 -2
  36. package/lib/role-llm-runtime.js +28 -18
  37. package/lib/role-llm.d.ts +2 -0
  38. package/lib/role-llm.js +1 -0
  39. package/lib/role-policy.d.ts +2 -0
  40. package/lib/role-policy.js +10 -10
  41. package/lib/role-routing.d.ts +1 -1
  42. package/lib/role-routing.js +4 -3
  43. package/lib/role-subagents.d.ts +2 -2
  44. package/lib/role-subagents.js +43 -63
  45. package/lib/settings.js +2 -1
  46. package/package.json +6 -51
@@ -1,6 +1,8 @@
1
1
  # DSMM compatibility and upgrade boundaries
2
2
 
3
- **DSMM 0.3.28 supports DSH `>=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0`** and Node.js 22 or later. The dual branch admits the 0.2.2 RC series (from `0.2.2-rc.1` on) while keeping every supported 0.2.1 release in range; `0.2.2-alpha.*` is deliberately excluded. Official DSH rc.3+ gives `engines.dsh` precedence over peer ranges (peers are ignored when `engines.dsh` is present) and evaluates ranges with prereleases included; strict npm semantics additionally need the explicit second branch, so the declaration is accurate under both readings. The `<0.3.0` upper bound lets future `0.3.0-rc.x` pass the Host gate under its includePrerelease reading; strict consumers exclude it. DSH dependencies, peerDependencies and devDependencies use the same non-exact range as `engines.dsh`, so a Host profile resolves them to its in-range version instead of being shadowed by a pinned `0.2.1-rc.2` copy; the lockfile keeps `0.2.1-rc.2` as the development baseline; versions outside the declared Host range aren't supported.
3
+ **DSMM supports DSH `>=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0` and Node.js 22 or later.** Install DSMM into a DSH profile. The CLI's profile resolver supplies DSH, Cordis, Schemastery and Pi SDK modules from the running DSH installation. The release tarball declares no host SDK dependencies or peers, so package managers neither install them for DSMM nor keep the previous version's SDKs to satisfy DSMM peer references. A linked development checkout retains its host peer declarations.
4
+
5
+ When upgrading from DSMM 0.3.30 or earlier, let the profile package manager update the lockfile, restart DSH once and reopen the original conversation. Subsequent replacements between Cores that support resident root handoff can continue the same open root conversation without a Host restart; changes to other startup-only Host services may still require one. An explicitly installed or independently required profile-local DSH package can still shadow the host; review its owner before removing it. Do not force-enable an incompatible provider or change the native HTTP selection to work around a version mismatch.
4
6
 
5
7
  ## Supported integration
6
8
 
@@ -46,7 +48,7 @@ DSMM runs identically on 0.2.1 and 0.2.2 Hosts except where 0.2.2 changed public
46
48
 
47
49
  DSMM runs against the unpatched native DSH packages: it installs no Host-side patches and injects no bootstrap flags. Historical support is limited to the existing native reader and validated continuation paths, with no blanket guarantee for historical package versions or additional behavior repair or migration. Native-readable records remain available through history surfaces. Supported persisted DSMM sessions resume with a fresh admission built from the current deployment; persisted mode choices remain user intent, while old delegation authority never survives.
48
50
 
49
- Root and native continuable-child activations load current DSMM prompts/skills/roles and the selected profile ID's latest valid content. Explicit baseline and global-default sources remain distinct. Old immutable revisions and runtime captures are not required for a valid native DSMM descriptor. Missing identity or conflicting/unsafe selection metadata refuses; missing or invalid current named content does not fall back. Parent ownership, catalog/own descriptor, provider, independent composition, readonly/filter/depth and cancellation boundaries are validated before publication. Resident Agents do not hot-switch. Settled one-shot children stay non-resumable.
51
+ Root and native continuable-child activations load current DSMM prompts/skills/roles and the selected profile ID's latest valid content. Explicit baseline and global-default sources remain distinct. Old immutable revisions and runtime captures are not required for a valid native DSMM descriptor. Missing identity or conflicting/unsafe selection metadata refuses; missing or invalid current named content does not fall back. Parent ownership, catalog/own descriptor, provider, independent composition, readonly/filter/depth and cancellation boundaries are validated before publication. Saving a profile does not hot-switch resident Agents. When the Core itself is replaced, a participating root retains its native history and receives a fresh admission for its next turn. Old tool calls and approvals do not transfer. Resident children are not adopted by the replacement Core; settled one-shot children stay non-resumable.
50
52
 
51
53
  DSH `0.2.1-rc.2` still checks image capabilities against historical `agent.options` before request routing in affected root model-switch and cold-child flows. Text requests can use a current available route while images fail because the historical model is missing or lacks image support. DSH exposes no public atomic route/options update for that preflight; DSMM leaves the refusal intact and does not modify readonly options or fake capabilities. Resolution requires a public route-aware preflight or supported pre-activation options hook. Recheck both root and child scenarios during each authorized DSH upgrade.
52
54
 
package/docs/testing.md CHANGED
@@ -70,6 +70,8 @@ when `agent.model.select` is unavailable. The resolver-free Fake-IP case skips o
70
70
  a resolver-capable Host; the existing address-policy/transport tests cover that
71
71
  implementation.
72
72
 
73
+ To test an installed tarball, use a disposable DSH home whose profile contains the base, headless and DSMM bundles. Install the tarball into that profile with normal peer resolution, separately from the Host installation. With `DSMM_TEST_DSH_ENTRY` set to the Host CLI entry, run `node test/installed-profile-web-probe.mjs <isolated-home> <profile-name>`. This checks native `http` through `web_fetch`, the selected Fake-IP provider's loopback refusal, and the modules resolved by the installed plugin. It uses a local model fixture and fetches public npm metadata without credentials.
74
+
73
75
  Missing anchors produce explicit skips. A skipped integration case is unavailable
74
76
  coverage, not a pass, and must be reported as such. The wrapper files remain the
75
77
  entry points for their `.mjs` fixtures so the underlying Host, CLI, approval and
@@ -6,8 +6,8 @@
6
6
 
7
7
  DSMM 包必须具备以下依赖和发布入口,才能使用此插件:
8
8
 
9
- - 运行依赖 `@deepseek-ai/dsh-web-fetch-http: >=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0`(与 `engines.dsh` 兼容窗口一致,非精确版本,避免在宿主 profile 中遮蔽更高版本的同类副本)和 `ipaddr.js: ^2.5.0`。
10
- - Host seam `@deepseek-ai/dsh-web: 0.2.1-rc.2`、`@deepseek-ai/dsh-http-proxy: 0.2.1-rc.2` 作为 peer 和开发依赖。保留现有 Cordis/timeout peers;不要另装一套 Host service。DSMM 与原生 HTTP provider 必须解析到 Host 实际使用的同一个 `dsh-http-proxy` 实例,否则预检读不到已安装的进程路由。
9
+ - `@deepseek-ai/dsh-web-fetch-http`、`@deepseek-ai/dsh-web`、`@deepseek-ai/dsh-http-proxy` 和 Cordis 均由运行中的 DSH 提供。DSMM 发布包不将这些宿主库声明为依赖或 peer;只有显式加载此入口才需要宿主的 HTTP provider 实现。
10
+ - `ipaddr.js` 是 DSMM 自有的地址处理依赖。DSMM 和原生 HTTP provider 使用宿主的同一份 `dsh-http-proxy`,从而读取相同的进程路由。
11
11
  - 包 export `./web-fetch-fakeip`,types 指向 `./lib/web-fetch-fakeip.d.ts`,default 指向 `./lib/web-fetch-fakeip.js`。构建也需包含其内部 `web-fetch-address-policy.js`。包的 `files` 应包含本说明和来源许可证。
12
12
 
13
13
  在用户所选原生 profile 的 patch 中显式挂载该入口,并修改原有 web service 的 `fetchProvider`(保留其真实 entry ID 和其他配置):
package/dsh-plugin.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "manifestVersion": "0.15",
4
4
  "id": "com.hugefiver.dsmm",
5
5
  "name": "DSMM",
6
- "version": "0.3.28",
6
+ "version": "0.3.31",
7
7
  "facets": {
8
8
  "host": {
9
9
  "entry": "lib/index.js",
@@ -1,6 +1,7 @@
1
- import type { DshAgent, DshContext } from "./dsh-types.js";
1
+ import { type Context } from "@deepseek-ai/cordis";
2
+ import type { DshAgent } from "./dsh-types.js";
2
3
  import type { DsmmSettingsGetter } from "./settings.js";
3
4
  import type { DsmmRolePolicy } from "./role-policy.js";
4
5
  import type { DeepworkModeController } from "./state.js";
5
- export declare function registerAgentPromptScope(ctx: DshContext, controller: DeepworkModeController, getSettings: DsmmSettingsGetter, policy: DsmmRolePolicy, agent: DshAgent, signal: AbortSignal): void;
6
+ export declare function registerAgentPromptScope(ctx: Context, controller: DeepworkModeController, getSettings: DsmmSettingsGetter, policy: DsmmRolePolicy, agent: DshAgent): void;
6
7
  //# sourceMappingURL=agent-prompt-scope.d.ts.map
@@ -1,21 +1,19 @@
1
- import { getTraceable, symbols } from "@deepseek-ai/cordis";
1
+ import { symbols } from "@deepseek-ai/cordis";
2
2
  import { buildDsmmLocaleGuidance } from "./locale-guidance.js";
3
- import { agentForScope, nativeAgentContext } from "./native-scope.js";
3
+ import { agentScopeService } from "./native-scope.js";
4
4
  import { registerRoleHarnessIdentity } from "./role-identity.js";
5
5
  const agentPrompts = new WeakMap();
6
- export function registerAgentPromptScope(ctx, controller, getSettings, policy, agent, signal) {
7
- signal.throwIfAborted();
8
- const existing = agentPrompts.get(agent);
6
+ export function registerAgentPromptScope(ctx, controller, getSettings, policy, agent) {
7
+ const existing = agentPrompts.get(ctx);
9
8
  if (existing !== undefined) {
10
9
  existing.reconcile();
11
10
  return;
12
11
  }
13
- const agentCtx = nativeAgentContext(agent);
14
12
  let retired = false;
15
13
  const state = { reconcile() {
16
14
  if (retired)
17
15
  return;
18
- const prompt = agentCtx.get("agentPresets")?.serviceFor({ ctx: agentCtx }, "systemPrompt") ?? agentCtx.get("systemPrompt");
16
+ const prompt = agentScopeService(ctx, "systemPrompt");
19
17
  const realm = Reflect.get(prompt, symbols.original) ?? prompt;
20
18
  if (state.promptRealm !== realm) {
21
19
  state.identity?.();
@@ -23,8 +21,8 @@ export function registerAgentPromptScope(ctx, controller, getSettings, policy, a
23
21
  state.identity = undefined;
24
22
  state.role = undefined;
25
23
  state.child = undefined;
26
- state.locale = getTraceable(agentCtx, prompt).section({ name: "dsmm:locale", order: 49, text(context) {
27
- if (context.scope !== agent && agentForScope(ctx, context.scope) !== agent)
24
+ state.locale = prompt.section({ name: "dsmm:locale", order: 49, text(context) {
25
+ if (context.scope !== agent)
28
26
  return "";
29
27
  const settings = getSettings(agent);
30
28
  return settings.locale === undefined ? "" : buildDsmmLocaleGuidance(settings);
@@ -35,7 +33,7 @@ export function registerAgentPromptScope(ctx, controller, getSettings, policy, a
35
33
  if (state.role === identity.role && state.child === identity.child)
36
34
  return;
37
35
  state.identity?.();
38
- state.identity = identity.role === undefined ? undefined : registerRoleHarnessIdentity(agent, identity.role, identity.child);
36
+ state.identity = identity.role === undefined ? undefined : registerRoleHarnessIdentity(prompt, identity.role, identity.child);
39
37
  state.role = identity.role;
40
38
  state.child = identity.child;
41
39
  } };
@@ -43,18 +41,15 @@ export function registerAgentPromptScope(ctx, controller, getSettings, policy, a
43
41
  if (retired)
44
42
  return;
45
43
  retired = true;
46
- signal.removeEventListener("abort", retire);
47
44
  state.stopMode?.();
48
45
  state.identity?.();
49
46
  state.locale?.();
50
- if (agentPrompts.get(agent) === state)
51
- agentPrompts.delete(agent);
47
+ agentPrompts.delete(ctx);
52
48
  };
53
49
  state.stopMode = controller.watch(changed => { if (changed === agent)
54
50
  state.reconcile(); });
55
- agentPrompts.set(agent, state);
56
- signal.addEventListener("abort", retire, { once: true });
57
- agentCtx.effect(() => retire);
51
+ agentPrompts.set(ctx, state);
52
+ ctx.effect(() => retire);
58
53
  try {
59
54
  state.reconcile();
60
55
  }
@@ -110,9 +110,9 @@ export declare const childDisabledCopy: Record<RoleControlDisabledReason, readon
110
110
  export type ChildrenLocaleKey = keyof typeof childrenEn | `reason:${RoleControlDisabledReason}`;
111
111
  export declare const childrenLocaleEn: {
112
112
  "reason:unavailable": string;
113
- "reason:read-only": string;
114
113
  "reason:one-shot": string;
115
114
  "reason:module-off": string;
115
+ "reason:read-only": string;
116
116
  "reason:role-disabled": string;
117
117
  "reason:unknown-mode": string;
118
118
  "reason:not-direct-child": string;
@@ -223,9 +223,9 @@ export declare const childrenLocaleEn: {
223
223
  };
224
224
  export declare const childrenLocaleZh: {
225
225
  "reason:unavailable": string;
226
- "reason:read-only": string;
227
226
  "reason:one-shot": string;
228
227
  "reason:module-off": string;
228
+ "reason:read-only": string;
229
229
  "reason:role-disabled": string;
230
230
  "reason:unknown-mode": string;
231
231
  "reason:not-direct-child": string;
@@ -240,12 +240,12 @@ export declare const childrenLocaleZh: {
240
240
  session: string;
241
241
  field: string;
242
242
  unknown: string;
243
- stale: string;
244
- mode: string;
245
243
  prompt: string;
244
+ mode: string;
246
245
  captured: string;
247
246
  level: string;
248
247
  legacy: string;
248
+ stale: string;
249
249
  unverified: string;
250
250
  limitations: string;
251
251
  depth: string;
@@ -1,4 +1,4 @@
1
- import { remoteErrorOf } from "@deepseek-ai/dsh-typert-protocol";
1
+ import { isRemoteFailure } from "@deepseek-ai/dsh-api-gateway/client";
2
2
  import { parseRoleControlErrorInfo } from "../role-control-remote.js";
3
3
  class ObservationProtocolError extends Error {
4
4
  code;
@@ -10,7 +10,7 @@ class ObservationProtocolError extends Error {
10
10
  function observationIssue(error) {
11
11
  if (error instanceof ObservationProtocolError)
12
12
  return { kind: "protocol", code: error.code };
13
- const remote = remoteErrorOf(error);
13
+ const remote = isRemoteFailure(error) ? error : undefined;
14
14
  if (remote?.code === "dsmm-children/refused") {
15
15
  try {
16
16
  return { kind: "domain", ...parseRoleControlErrorInfo(remote.details) };