@dsmm/dsmm 0.3.25 → 0.3.26

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.
@@ -1,6 +1,6 @@
1
1
  # DSMM compatibility and upgrade boundaries
2
2
 
3
- **DSMM 0.3.22 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 remain pinned to 0.2.1-rc.2 as the development baseline; versions outside the declared Host range aren't supported.
3
+ **DSMM 0.3.22 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.
4
4
 
5
5
  ## Supported integration
6
6
 
@@ -34,6 +34,8 @@ DSMM runs identically on 0.2.1 and 0.2.2 Hosts except where 0.2.2 changed public
34
34
 
35
35
  - **Model selection is fixed before step preparation.** DSMM prepares the selection and request proposal together during admission and maintenance, keeping adapter defaults separate from explicit effort. Configured roots with an explicit primary reassert their admitted selection at public running/inbox boundaries; native roots retain native selection authority. A request that conflicts with its step's fixed provider/model/effort is rejected before dispatch, without scheduling another selection or dropping parameters. A picker change racing a running step can therefore produce a refusal; change models while idle for the next-turn boundary. Plugin metadata associates DSMM-written selections and child setup selections observed between native Session and Agent announcements with their exact events. These remain distinguishable on cold activation without treating setup as new manual intent. The records convey no authority, and same-value selections create no synthetic intent.
36
36
  - **Cross-route model fallback is unavailable on 0.2.2** (blocked): the request-error contract only allows same-selection retries, so `rate-limit-fallback` route switching degrades to a bounded same-route retry with a one-time diagnostic, and unavailable-route switching refuses outright. 0.2.1 behavior is unchanged. The native `dsh-llm-retry` extension coexists with DSMM's retry ownership.
37
+ - **Session configuration switching requires provider enumeration.** Hosts without `subagents.list()` still load DSMM and execute normal sessions and role delegations. Applying a profile or deployment baseline to a resident session is unavailable because DSMM cannot establish that external subagent work is absent. Independent Deepwork mode controls remain available. Saving configuration and selecting defaults for new sessions remain available.
38
+ - **Native tree publication precedes child admission on newer Hosts.** Child requests and tools wait for the native activation's published creator and root to be verified. DSMM retains the exact live creator for permission inheritance and direct-child controls; sharing a tree root or a persisted parent ID alone grants no authority. A missing or retired creator refuses admission, including cold continuation.
37
39
  - **Pending selection is visible at admission.** A DSMM-configured route becomes the client-visible pending model selection as soon as admission completes, and cross-step route changes surface the Host's `[model changed: ...]` notice. This is native 0.2.2 behavior and is not suppressed.
38
40
  - **fs overwrite observation is restored by the DSMM bundle patch.** 0.2.2 compositions disable `@deepseek-ai/dsh-fs-observation-policy` by default; DSMM's bundle patch re-enables it by id, restoring read-before-write and external-modification rejection (`FS_STALE_VERSION`). The user's profile layer still wins and can explicitly disable it.
39
41
  - **Adapter capacity defaults changed.** 0.2.2 assumes 1M context / 128K output for models that declare no capacity. Routes served by small endpoints must declare real limits; DSMM's raw seam keeps its explicit-capacity validation.
@@ -6,7 +6,7 @@
6
6
 
7
7
  DSMM 包必须具备以下依赖和发布入口,才能使用此插件:
8
8
 
9
- - 运行依赖 `@deepseek-ai/dsh-web-fetch-http: 0.2.1-rc.2` 和 `ipaddr.js: ^2.5.0`。
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
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` 实例,否则预检读不到已安装的进程路由。
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
 
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.25",
6
+ "version": "0.3.26",
7
7
  "facets": {
8
8
  "host": {
9
9
  "entry": "lib/index.js",
@@ -260,6 +260,8 @@ export declare const childrenLocaleZh: {
260
260
  epoch: string;
261
261
  yes: string;
262
262
  no: string;
263
+ queue: string;
264
+ steer: string;
263
265
  liveRoute: string;
264
266
  runtime: string;
265
267
  activity: string;
@@ -271,8 +273,6 @@ export declare const childrenLocaleZh: {
271
273
  interrupt: string;
272
274
  readonly: string;
273
275
  children: string;
274
- queue: string;
275
- steer: string;
276
276
  foreign: string;
277
277
  reading: string;
278
278
  noSession: string;
@@ -1,3 +1,4 @@
1
+ import { nativeRoots, nativeIsOwnedBy } from "./native-ownership.js";
1
2
  import { randomUUID } from "node:crypto";
2
3
  import { scopeLifetime } from "./lifetime.js";
3
4
  import { PermissionRefusal, permissionOriginal } from "./permission-control.js";
@@ -37,9 +38,9 @@ export function createCorePermissionAuthority(ctx, options) {
37
38
  throw new PermissionRefusal("not-owned");
38
39
  seen.add(current);
39
40
  chain.push(current);
40
- const owners = residents.filter(candidate => candidate !== current && agents.isOwnedBy(current.id, candidate));
41
+ const owners = residents.filter(candidate => candidate !== current && nativeIsOwnedBy(agents, current.id, candidate));
41
42
  if (owners.length === 0) {
42
- if (!agents.roots().includes(current) || current.session.header.origin === "subagent")
43
+ if (!nativeRoots(agents).includes(current) || current.session.header.origin === "subagent")
43
44
  throw new PermissionRefusal("not-owned");
44
45
  return chain;
45
46
  }
@@ -181,7 +182,7 @@ export function createCorePermissionAuthority(ctx, options) {
181
182
  rootCurrent(root, exec) {
182
183
  const host = integration(), chain = ancestry(exec);
183
184
  const agents = ctx.get("agents");
184
- if (chain.at(-1) !== root || agents?.get(root.id) !== root || !agents.roots().includes(root))
185
+ if (chain.at(-1) !== root || agents?.get(root.id) !== root || !nativeRoots(agents).includes(root))
185
186
  throw new PermissionRefusal("not-owned");
186
187
  const generation = local(host, root, root);
187
188
  if (root.ctx.get("approval") === undefined)
@@ -208,8 +209,8 @@ export function createCorePermissionAuthority(ctx, options) {
208
209
  throw new PermissionRefusal("cancelled");
209
210
  const agents = ctx.get("agents"), realmAgents = root.ctx.get("agents");
210
211
  if (agents === undefined || realmAgents === undefined || permissionOriginal(agents) !== permissionOriginal(realmAgents)
211
- || agents.get(root.id) !== root || root.session.id !== root.id || !agents.roots().includes(root)
212
- || root.session.header.origin === "subagent" || agents.list().some(agent => agent !== root && agents.isOwnedBy(root.id, agent)))
212
+ || agents.get(root.id) !== root || root.session.id !== root.id || !nativeRoots(agents).includes(root)
213
+ || root.session.header.origin === "subagent" || agents.list().some(agent => agent !== root && nativeIsOwnedBy(agents, root.id, agent)))
213
214
  throw new PermissionRefusal("not-owned");
214
215
  const seen = new Set();
215
216
  for (let fiber = root.ctx.fiber; !seen.has(fiber.ctx); fiber = fiber.parent.fiber) {
@@ -1,3 +1,4 @@
1
+ import { nativeRoots, nativeIsOwnedBy } from "./native-ownership.js";
1
2
  import { PermissionRefusal, permissionOriginal } from "./permission-control.js";
2
3
  import { applyPermissionRulesSave, importPermissionRules, operatorPermissionRulesSource, parsePermissionRules, parsePermissionRulesSave, PermissionRulesRuntimeSync } from "./permission-rules.js";
3
4
  import { copyJson, validateSparseConfig, validateNativeConfig } from "./settings.js";
@@ -119,7 +120,7 @@ export class DeploymentPermissionRules {
119
120
  this.lifetime.signal.throwIfAborted();
120
121
  const registry = this.ctx.agents;
121
122
  if (permissionOriginal(registry) !== this.registry || registry.get(root.id) !== root || root.session.id !== root.id || root.session.header.origin === "subagent"
122
- || !registry.roots().includes(root) || registry.list().some(owner => owner !== root && registry.isOwnedBy(root.id, owner)))
123
+ || !nativeRoots(registry).includes(root) || registry.list().some(owner => owner !== root && nativeIsOwnedBy(registry, root.id, owner)))
123
124
  throw new PermissionRefusal("not-owned");
124
125
  this.options.assertWritable(root);
125
126
  }
@@ -55,8 +55,8 @@ export interface DshAgentModel {
55
55
  export interface DshAgentsRegistry {
56
56
  get(id: string): DshAgent | undefined;
57
57
  list(): DshAgent[];
58
- roots(): DshAgent[];
59
- isOwnedBy(id: string, owner: DshAgent): boolean;
58
+ roots?(): DshAgent[];
59
+ isOwnedBy?(id: string, owner: DshAgent): boolean;
60
60
  }
61
61
  export interface DshAgentCreatedFrame {
62
62
  agent: DshAgent;
@@ -33,6 +33,7 @@ export declare class NativeAdmission {
33
33
  private readonly activities;
34
34
  private readonly calls;
35
35
  private readonly rebindings;
36
+ private readonly awaitingPublication;
36
37
  private readonly guardedTools;
37
38
  private readonly agentLifetimes;
38
39
  private readonly retirements;
@@ -68,6 +69,8 @@ export declare class NativeAdmission {
68
69
  private publishObservedCall;
69
70
  private publishObservedRemoval;
70
71
  private observedInvocation;
72
+ private awaitChildPublication;
73
+ private admitPublishedChild;
71
74
  private startObservedActivation;
72
75
  private endObservedActivation;
73
76
  private settleObservedActivation;
@@ -9,6 +9,8 @@ import { invocationView } from "./role-invocation.js";
9
9
  import { scopeLifetime } from "./lifetime.js";
10
10
  import { sessionEvents, childOwnedSessionEvents } from "./session-scope.js";
11
11
  import { scopeParentOf, scopeOf } from "./native-scope.js";
12
+ import { bindNativeParent, nativeIsOwnedBy, nativeRoots } from "./native-ownership.js";
13
+ import { listNativeChildren } from "./native-subagents.js";
12
14
  import { DsmmProfileError } from "./profiles.js";
13
15
  import { roleProviderName } from "./roles.js";
14
16
  import { resolveRoleInvocation } from "./role-invocation.js";
@@ -72,6 +74,7 @@ export class NativeAdmission {
72
74
  activities = new Map();
73
75
  calls = new Map();
74
76
  rebindings = new WeakMap();
77
+ awaitingPublication = new WeakMap();
75
78
  guardedTools = new WeakMap();
76
79
  agentLifetimes = new WeakMap();
77
80
  retirements = new WeakMap();
@@ -134,13 +137,19 @@ export class NativeAdmission {
134
137
  for (const agent of ctx.agents.list())
135
138
  this.opaqueAgents.add(agent);
136
139
  observeProviders();
137
- ctx.on("subagent/start", info => { this.startObservedActivation(info); }, { global: true });
140
+ ctx.on("subagent/start", info => { this.admitPublishedChild(info); this.startObservedActivation(info); }, { global: true });
138
141
  ctx.on("subagent/end", info => { this.endObservedActivation(info); }, { global: true });
139
142
  ctx.on("session/created", session => {
140
143
  this.setupSelectionCursors.set(session, latestModelSelectionSeq({ session }));
141
144
  }, { global: true });
142
145
  ctx.on("session/disposed", session => { this.setupSelectionCursors.delete(session); }, { global: true });
143
- ctx.on("agent/created", async (frame) => { await this.created(frame.agent, frame.source, frame.signal); }, { global: true, prepend: true });
146
+ ctx.on("agent/created", async (frame) => {
147
+ if (typeof ctx.agents.isOwnedBy !== "function" && frame.agent.session.header.origin === "subagent") {
148
+ this.awaitChildPublication(frame.agent, frame.source, frame.signal);
149
+ }
150
+ else
151
+ await this.created(frame.agent, frame.source, frame.signal);
152
+ }, { global: true, prepend: true });
144
153
  ctx.on("agent/status", ({ agent, status }) => { if (status === "running")
145
154
  this.installCachedAdmissionRouteSafely(agent); }, { global: true });
146
155
  ctx.on("agent/inbox/claimed", ({ agent }) => { this.installCachedAdmissionRouteSafely(agent); }, { global: true });
@@ -270,6 +279,55 @@ export class NativeAdmission {
270
279
  routeComparison: { childId: record.childId, initialRoute: call.initialRoute, liveRoute: call.actualRoute },
271
280
  delivery: record.delivery, phase: record.phase, ...(record.stopReason === undefined ? {} : { stopReason: record.stopReason }) };
272
281
  }
282
+ awaitChildPublication(agent, source, signal) {
283
+ if (this.awaitingPublication.has(agent))
284
+ throw new SubagentError("Child publication is already pending", "UNAUTHORIZED");
285
+ let resolve, rejectAdmission;
286
+ const promise = new Promise((done, reject) => { resolve = done; rejectAdmission = reject; });
287
+ const waiting = { source, signal, promise, resolve, reject: rejectAdmission, started: false };
288
+ this.awaitingPublication.set(agent, waiting);
289
+ void waiting.promise.catch(() => { });
290
+ const closed = AbortSignal.any([this.lifetime.signal, ...signal ? [signal] : []]);
291
+ const reject = () => waiting.reject(new SubagentError("Child admission was cancelled", "UNAUTHORIZED"));
292
+ closed.addEventListener("abort", reject, { once: true });
293
+ if (closed.aborted)
294
+ reject();
295
+ scopeLifetime(agent.ctx, "dsmm: reject unpublished child admission", reject);
296
+ void waiting.promise.finally(() => closed.removeEventListener("abort", reject)).catch(() => { });
297
+ // The native manager publishes ancestry after agent/created returns. No
298
+ // model request or tool can cross that interval, including after owner unload.
299
+ agent.ctx.on("agent/pre-step", async (frame, next) => { if (frame.agent === agent)
300
+ await waiting.promise; return next(); }, { prepend: true });
301
+ agent.ctx.on("agent/request", async (frame, next) => { if (frame.agent === agent)
302
+ await waiting.promise; return next(); }, { prepend: true });
303
+ agent.ctx.on("tools/pre-execute", async (exec, next) => { if (exec.agent === agent)
304
+ await waiting.promise; return next(); }, { prepend: true });
305
+ }
306
+ admitPublishedChild(info) {
307
+ if (!info.local)
308
+ return;
309
+ const child = this.ctx.agents.get(info.id), waiting = child && this.awaitingPublication.get(child);
310
+ if (!child || !waiting || waiting.started)
311
+ return;
312
+ waiting.started = true;
313
+ const admission = async () => {
314
+ this.lifetime.signal.throwIfAborted();
315
+ waiting.signal?.throwIfAborted();
316
+ const parent = info.parentSessionId === undefined ? undefined : this.ctx.agents.get(info.parentSessionId);
317
+ if (parent === undefined)
318
+ throw new SubagentError("Child requires its exact live creator", "UNAUTHORIZED");
319
+ const pending = this.pending.get(child.id);
320
+ if (pending && (pending.parent !== parent || pending.provider.name !== info.provider))
321
+ throw new SubagentError("Published child differs from its pending invocation", "UNAUTHORIZED");
322
+ bindNativeParent(this.ctx.agents, child, parent);
323
+ await this.created(child, waiting.source, waiting.signal);
324
+ };
325
+ void admission().then(waiting.resolve, error => {
326
+ this.failedInstallations.add(child);
327
+ waiting.reject(error);
328
+ child.cancel({ kind: "disposed" });
329
+ });
330
+ }
273
331
  startObservedActivation(info) {
274
332
  const record = this.observedCallChildren.get(info.id);
275
333
  if (record === undefined || info.provider !== record.provider || !info.local || record.phase === "settled")
@@ -419,10 +477,11 @@ export class NativeAdmission {
419
477
  /** Exact process-local capture, retained after retirement so stale objects never become native. */
420
478
  owns(agent) { return this.agentLifetimes.has(agent); }
421
479
  async guardExecution(agent) {
480
+ await this.awaitingPublication.get(agent)?.promise;
422
481
  if (!this.owns(agent)) {
423
482
  const registry = agent.ctx.get("agents");
424
483
  if (registry && original(registry) === original(this.ctx.agents) && scopeOf(agent.ctx) === agent && registry.get(agent.id) !== agent
425
- || this.ctx.agents.list().some(parent => this.owns(parent) && this.ctx.agents.isOwnedBy(agent.id, parent))) {
484
+ || this.ctx.agents.list().some(parent => this.owns(parent) && nativeIsOwnedBy(this.ctx.agents, agent.id, parent))) {
426
485
  throw new SubagentError("Native child admission is incomplete", "UNAUTHORIZED");
427
486
  }
428
487
  return "native";
@@ -456,7 +515,7 @@ export class NativeAdmission {
456
515
  presets?.serviceFor(agent, "skills") ?? agent.ctx.get("skills")].map(service => service === undefined ? undefined : original(service));
457
516
  }
458
517
  invocation(agent) { return this.live.get(agent)?.invocation; }
459
- async ensure(agent) { await this.rebindings.get(agent); return this.assert(agent); }
518
+ async ensure(agent) { await this.awaitingPublication.get(agent)?.promise; await this.rebindings.get(agent); return this.assert(agent); }
460
519
  assert(agent) {
461
520
  return this.assertBinding(agent);
462
521
  }
@@ -481,7 +540,7 @@ export class NativeAdmission {
481
540
  throw new SubagentError("Native admission dependencies changed", "UNAUTHORIZED");
482
541
  if (live.preset !== agent.ctx.get("agentPresets")?.composedPreset(agent.ctx) || live.scopeParent !== scopeParentOf(agent))
483
542
  throw new SubagentError("Preset composition changed; create a new session", "UNAUTHORIZED");
484
- if (live.parent && (this.ctx.agents.get(live.parent.id) !== live.parent || !this.ctx.agents.isOwnedBy(agent.id, live.parent)))
543
+ if (live.parent && (this.ctx.agents.get(live.parent.id) !== live.parent || !nativeIsOwnedBy(this.ctx.agents, agent.id, live.parent)))
485
544
  throw new SubagentError("Parent residency changed", "UNAUTHORIZED");
486
545
  if (live.parent)
487
546
  this.assertBinding(live.parent, maintenanceRoot);
@@ -491,7 +550,7 @@ export class NativeAdmission {
491
550
  residentTree(agent) {
492
551
  const tree = [agent], residents = this.ctx.agents.list();
493
552
  for (let index = 0; index < tree.length; index++) {
494
- for (const child of residents.filter(child => this.ctx.agents.isOwnedBy(child.id, tree[index])).sort((a, b) => a.id.localeCompare(b.id))) {
553
+ for (const child of residents.filter(child => nativeIsOwnedBy(this.ctx.agents, child.id, tree[index])).sort((a, b) => a.id.localeCompare(b.id))) {
495
554
  if (tree.includes(child))
496
555
  throw new SubagentError("Invalid native ownership tree", "UNAUTHORIZED");
497
556
  tree.push(child);
@@ -509,7 +568,9 @@ export class NativeAdmission {
509
568
  const agents = scope.get("agents", false), runtime = scope.get("subagents", false);
510
569
  if (agents === undefined || original(agents) !== registry || runtime === undefined || current.has(original(runtime)))
511
570
  continue;
512
- current.set(original(runtime), runtime.list().some(name => runtime.getProvider(name)?.prepareContinuable === undefined));
571
+ // Hosts without provider enumeration cannot prove that external starts are absent.
572
+ current.set(original(runtime), typeof runtime.list !== "function"
573
+ || runtime.list().some(name => runtime.getProvider(name)?.prepareContinuable === undefined));
513
574
  }
514
575
  // Any native service sharing this registry may accept these exact parents,
515
576
  // including isolated services the Agent's own context does not resolve.
@@ -523,7 +584,7 @@ export class NativeAdmission {
523
584
  this.providerScopes.set(runtime, opaque);
524
585
  }
525
586
  blankReason(agent, allowQueued = false) {
526
- if (!this.isReady || this.failedInstallations.has(agent) || this.ctx.agents.get(agent.id) !== agent || !this.ctx.agents.roots().includes(agent) || this.dependencies(agent).some(value => value === undefined))
587
+ if (!this.isReady || this.failedInstallations.has(agent) || this.ctx.agents.get(agent.id) !== agent || !nativeRoots(this.ctx.agents).includes(agent) || this.dependencies(agent).some(value => value === undefined))
527
588
  return "runtime-unavailable";
528
589
  const live = this.live.get(agent);
529
590
  if (!live || live.parent || agent.session.header.origin === "subagent")
@@ -615,18 +676,6 @@ export class NativeAdmission {
615
676
  throw new DsmmProfileError("activation", "An enabled role has no admitted native provider.");
616
677
  return [name, provider];
617
678
  }));
618
- for (const role of targets) {
619
- const routing = admission.settings.roleRouting[role];
620
- if (routing?.primary !== undefined || routing?.fallbackRoutes !== undefined) {
621
- await resolveRoleInvocation(agent, role, admission.settings, preparationSignal, {}, undefined, resolvedModelParameterPolicy(admission));
622
- assertCurrent();
623
- }
624
- for (const level of ["low", "high", "max"])
625
- if (routing?.levels?.[level] !== undefined) {
626
- await resolveRoleInvocation(agent, role, admission.settings, preparationSignal, { level }, undefined, resolvedModelParameterPolicy(admission));
627
- assertCurrent();
628
- }
629
- }
630
679
  });
631
680
  assertCurrent();
632
681
  const candidate = await this.admissionModelSelection?.(agent, { settings: admission.settings, epoch: admission.epoch,
@@ -858,7 +907,7 @@ export class NativeAdmission {
858
907
  if (this.selecting.has(agent))
859
908
  throw new SubagentError("Session configuration maintenance owns the blank composition", "UNAUTHORIZED");
860
909
  if (previous.parent || (this.calls.get(agent) ?? 0) !== 0 || [...this.pending.values()].some(row => row.parent === agent)
861
- || this.ctx.agents.list().some(child => this.ctx.agents.isOwnedBy(child.id, agent)) || sessionEvents(agent.session).some(event => event.type === "turn/start"))
910
+ || this.ctx.agents.list().some(child => nativeIsOwnedBy(this.ctx.agents, child.id, agent)) || sessionEvents(agent.session).some(event => event.type === "turn/start"))
862
911
  throw new SubagentError("Preset change requires a new session", "UNAUTHORIZED");
863
912
  this.policy.validateRootRole(agent, previous.admission);
864
913
  const preset = agent.ctx.get("agentPresets")?.composedPreset(agent.ctx), scopeParent = scopeParentOf(agent);
@@ -883,7 +932,7 @@ export class NativeAdmission {
883
932
  this.observeProviders();
884
933
  let signal = AbortSignal.any([...creationSignal ? [creationSignal] : [], this.lifetime.signal]);
885
934
  signal.throwIfAborted();
886
- const parents = this.ctx.agents.list().filter(parent => parent !== agent && this.ctx.agents.isOwnedBy(agent.id, parent));
935
+ const parents = this.ctx.agents.list().filter(parent => parent !== agent && nativeIsOwnedBy(this.ctx.agents, agent.id, parent));
887
936
  const parent = parents[0], preset = agent.ctx.get("agentPresets")?.composedPreset(agent.ctx), presetScope = scopeParentOf(agent);
888
937
  if (parents.length > 1 || this.ctx.agents.get(agent.id) !== agent || this.ctx.get("sessions")?.get(agent.id) !== agent.session
889
938
  || agent.session.id !== agent.id || agent.session.header.id !== agent.id || scopeOf(agent.ctx) !== agent
@@ -901,7 +950,7 @@ export class NativeAdmission {
901
950
  throw new SubagentError("Role continuation requires an admitted parent", "UNAUTHORIZED");
902
951
  return;
903
952
  }
904
- if (!parent && (!this.ctx.agents.roots().includes(agent) || agent.session.header.origin === "subagent" || descriptor !== undefined))
953
+ if (!parent && (!nativeRoots(this.ctx.agents).includes(agent) || agent.session.header.origin === "subagent" || descriptor !== undefined))
905
954
  throw new SubagentError("Child requires its native parent", "UNAUTHORIZED");
906
955
  this.agentLifetimes.set(agent, new AbortController());
907
956
  signal = AbortSignal.any([signal, this.agentLifetimes.get(agent).signal, ...parent ? [this.agentLifetimes.get(parent).signal] : []]);
@@ -928,7 +977,7 @@ export class NativeAdmission {
928
977
  if (!this.isReady || this.ctx.agents.get(agent.id) !== agent || this.ctx.get("sessions")?.get(agent.id) !== agent.session
929
978
  || scopeOf(agent.ctx) !== agent || original(agent.ctx.get("agents")) !== original(this.ctx.agents)
930
979
  || this.dependencies(agent).some((value, index) => value !== dependencies[index]) || scopeParentOf(agent) !== presetScope || preset !== agent.ctx.get("agentPresets")?.composedPreset(agent.ctx)
931
- || parent && (this.assert(parent) !== parentAdmission || !this.ctx.agents.isOwnedBy(agent.id, parent)))
980
+ || parent && (this.assert(parent) !== parentAdmission || !nativeIsOwnedBy(this.ctx.agents, agent.id, parent)))
932
981
  throw new SubagentError("Activation owner changed", "UNAUTHORIZED");
933
982
  };
934
983
  let continuation, independent = false, continuationProvider;
@@ -950,7 +999,7 @@ export class NativeAdmission {
950
999
  if (descriptor?.mode !== "continuable")
951
1000
  throw new SubagentError("Native child is not continuable", "NOT_RESUMABLE");
952
1001
  const subagents = this.ctx.get("subagents");
953
- const rows = await subagents.listChildren(parent.id, signal);
1002
+ const rows = await listNativeChildren(subagents, parent.id, signal);
954
1003
  check();
955
1004
  const row = rows.find(row => row.id === agent.id);
956
1005
  if (!row || row.mode !== "continuable")
@@ -0,0 +1,17 @@
1
+ interface OwnershipAgent {
2
+ readonly id?: string;
3
+ }
4
+ export interface NativeOwnershipRegistry<A extends OwnershipAgent> {
5
+ get(id: string): A | undefined;
6
+ list(): A[];
7
+ roots?(): A[];
8
+ isOwnedBy?(id: string, parent: A): boolean;
9
+ }
10
+ /** Root membership is native runtime evidence, never durable session lineage. */
11
+ export declare function nativeRoots<A extends OwnershipAgent>(registry: NativeOwnershipRegistry<A>): A[];
12
+ /** New runtimes require an authenticated creation edge in addition to native tree residency. */
13
+ export declare function nativeIsOwnedBy<A extends OwnershipAgent>(registry: NativeOwnershipRegistry<A> | undefined, childId: string, parent: A): boolean;
14
+ /** Call only after authenticating the native start's direct creator, not from a session header. */
15
+ export declare function bindNativeParent<A extends OwnershipAgent>(registry: NativeOwnershipRegistry<A>, child: A, parent: A): void;
16
+ export {};
17
+ //# sourceMappingURL=native-ownership.d.ts.map
@@ -0,0 +1,73 @@
1
+ import { symbols } from "@deepseek-ai/cordis";
2
+ import { SubagentError } from "@deepseek-ai/dsh-subagent";
3
+ const edges = new WeakMap();
4
+ const original = (value) => Reflect.get(value, symbols.original) ?? value;
5
+ function runtimeOf(agent) {
6
+ const ctx = agent.ctx;
7
+ const runtime = ctx?.get?.("subagents");
8
+ return typeof runtime?.rootOf === "function" ? runtime : undefined;
9
+ }
10
+ /** Root membership is native runtime evidence, never durable session lineage. */
11
+ export function nativeRoots(registry) {
12
+ if (typeof registry.roots === "function")
13
+ return registry.roots();
14
+ return registry.list().filter(agent => {
15
+ if (agent.id === undefined || registry.get(agent.id) !== agent)
16
+ return false;
17
+ try {
18
+ return runtimeOf(agent)?.rootOf(agent) === agent;
19
+ }
20
+ catch {
21
+ return false;
22
+ }
23
+ });
24
+ }
25
+ /** New runtimes require an authenticated creation edge in addition to native tree residency. */
26
+ export function nativeIsOwnedBy(registry, childId, parent) {
27
+ if (registry === undefined)
28
+ return false;
29
+ if (typeof registry.isOwnedBy === "function")
30
+ return registry.isOwnedBy(childId, parent);
31
+ const child = registry.get(childId);
32
+ if (child === undefined || parent.id === undefined || registry.get(parent.id) !== parent)
33
+ return false;
34
+ const edge = edges.get(original(registry))?.get(child);
35
+ if (edge?.parent !== parent || original(runtimeOf(child) ?? {}) !== original(edge.runtime))
36
+ return false;
37
+ try {
38
+ return edge.root.id !== undefined && registry.get(edge.root.id) === edge.root
39
+ && edge.runtime.rootOf(child) === edge.root && edge.runtime.rootOf(parent) === edge.root;
40
+ }
41
+ catch {
42
+ return false;
43
+ }
44
+ }
45
+ /** Call only after authenticating the native start's direct creator, not from a session header. */
46
+ export function bindNativeParent(registry, child, parent) {
47
+ const deny = () => { throw new SubagentError("Exact native parent binding is unavailable", "UNAUTHORIZED"); };
48
+ if (child === parent || child.id === undefined || parent.id === undefined
49
+ || registry.get(child.id) !== child || registry.get(parent.id) !== parent)
50
+ deny();
51
+ if (typeof registry.isOwnedBy === "function") {
52
+ if (!registry.isOwnedBy(child.id, parent))
53
+ deny();
54
+ return;
55
+ }
56
+ const runtime = runtimeOf(child);
57
+ if (runtime === undefined)
58
+ deny();
59
+ const owner = runtime;
60
+ const root = owner.rootOf(child);
61
+ if (root === child || owner.rootOf(parent) !== root || root.id === undefined || registry.get(root.id) !== root)
62
+ deny();
63
+ let bindings = edges.get(original(registry));
64
+ if (bindings === undefined) {
65
+ bindings = new WeakMap();
66
+ edges.set(original(registry), bindings);
67
+ }
68
+ const previous = bindings.get(child);
69
+ if (previous !== undefined && (previous.parent !== parent || original(previous.runtime) !== original(owner) || previous.root !== root))
70
+ deny();
71
+ bindings.set(child, { parent, runtime: owner, root });
72
+ }
73
+ //# sourceMappingURL=native-ownership.js.map
@@ -0,0 +1,20 @@
1
+ import type { SessionId } from "@deepseek-ai/dsh-session";
2
+ import type { SubagentActivation, SubagentCatalogEntry, SubagentDescendantListEntry, SubagentInterruptReceipt, SubagentPromptReceipt, SubagentPromptRequest, SubagentRuntime } from "@deepseek-ai/dsh-subagent";
3
+ type ActivationSpec = Parameters<SubagentRuntime["startActivation"]>[0];
4
+ /** Native tree runtimes accept task fields directly on the activation specification. */
5
+ export declare function startNativeActivation(runtime: SubagentRuntime, spec: ActivationSpec): Promise<SubagentActivation>;
6
+ export type NativeChildEntry = Pick<SubagentCatalogEntry, "id" | "mode"> & {
7
+ readonly label?: string;
8
+ };
9
+ type ChildDiscovery = {
10
+ listChildren?(parentId: SessionId, signal?: AbortSignal): Promise<NativeChildEntry[]>;
11
+ listDescendants(parentId: SessionId, signal?: AbortSignal): Promise<SubagentDescendantListEntry[]>;
12
+ };
13
+ /** Discover direct catalog membership without loading or resuming a child. */
14
+ export declare function listNativeChildren(runtime: ChildDiscovery, parentId: SessionId, signal?: AbortSignal): Promise<NativeChildEntry[]>;
15
+ /** Transport an already-authorized direct-child prompt through the Host's control contract. */
16
+ export declare function promptNativeChild(runtime: SubagentRuntime, request: SubagentPromptRequest, signal: AbortSignal): Promise<SubagentPromptReceipt>;
17
+ /** Caller-side catalog and exact-parent checks remain authoritative for this interrupt. */
18
+ export declare function interruptNativeChild(runtime: SubagentRuntime, childId: SessionId, parentId: SessionId): SubagentInterruptReceipt;
19
+ export {};
20
+ //# sourceMappingURL=native-subagents.d.ts.map
@@ -0,0 +1,30 @@
1
+ /** Native tree runtimes accept task fields directly on the activation specification. */
2
+ export function startNativeActivation(runtime, spec) {
3
+ if (typeof runtime.rootOf !== "function")
4
+ return runtime.startActivation(spec);
5
+ const { request, ...activation } = spec;
6
+ return runtime.startActivation({ ...request, ...activation });
7
+ }
8
+ /** Discover direct catalog membership without loading or resuming a child. */
9
+ export async function listNativeChildren(runtime, parentId, signal) {
10
+ if (typeof runtime.listChildren === "function")
11
+ return runtime.listChildren(parentId, signal);
12
+ const descendants = await runtime.listDescendants(parentId, signal);
13
+ return descendants.filter(row => row.parentId === parentId).map(row => row.kind === "diagnostic"
14
+ ? { id: row.id, mode: "unknown" }
15
+ : { id: row.id, mode: row.mode, ...row.label === undefined ? {} : { label: row.label } });
16
+ }
17
+ /** Transport an already-authorized direct-child prompt through the Host's control contract. */
18
+ export function promptNativeChild(runtime, request, signal) {
19
+ if (typeof runtime.rootOf !== "function")
20
+ return runtime.prompt(request, signal);
21
+ const { parentSessionId: _parent, mode: _mode, ...prompt } = request;
22
+ return runtime.prompt(prompt, signal);
23
+ }
24
+ /** Caller-side catalog and exact-parent checks remain authoritative for this interrupt. */
25
+ export function interruptNativeChild(runtime, childId, parentId) {
26
+ if (typeof runtime.rootOf !== "function")
27
+ return runtime.interruptByParent(childId, parentId, "continuable");
28
+ return runtime.interruptByUser(childId);
29
+ }
30
+ //# sourceMappingURL=native-subagents.js.map
@@ -32,6 +32,7 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
32
32
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
33
33
  done = true;
34
34
  };
35
+ import { nativeRoots, nativeIsOwnedBy } from "./native-ownership.js";
35
36
  import { SessionId } from "@deepseek-ai/dsh-session";
36
37
  import { Remote, RemoteError, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
37
38
  import { PermissionRefusal, permissionOriginal } from "./permission-control.js";
@@ -74,8 +75,8 @@ let DsmmPermissionsHost = (() => {
74
75
  if (signal.aborted)
75
76
  throw new PermissionRefusal("cancelled");
76
77
  if (current === undefined || permissionOriginal(current) !== owner || current.browserPeer !== peer || registry?.get(id) !== root
77
- || root.id !== sessionId || root.session.id !== sessionId || root.session.header.origin === "subagent" || !registry.roots().includes(root)
78
- || registry.list().some(agent => agent !== root && registry.isOwnedBy(id, agent)))
78
+ || root.id !== sessionId || root.session.id !== sessionId || root.session.header.origin === "subagent" || !nativeRoots(registry).includes(root)
79
+ || registry.list().some(agent => agent !== root && nativeIsOwnedBy(registry, id, agent)))
79
80
  throw new PermissionRefusal("not-owned");
80
81
  };
81
82
  check();
@@ -1,3 +1,4 @@
1
+ import { nativeIsOwnedBy } from "./native-ownership.js";
1
2
  import { Context as NativeContext, getTraceable } from "@deepseek-ai/cordis";
2
3
  import { DSMM_ROLES, DSMM_ROLE_IDS, rolePluginRows } from "./roles.js";
3
4
  import { enabledSkillNames } from "./skills.js";
@@ -64,7 +65,7 @@ export function registerRolePresets(ctx, getSettings, roleIdentity) {
64
65
  // reconcile. A parented agent with no bound identity stays pending
65
66
  // instead of concluding "not read-only" from a not-yet-bound role.
66
67
  const agentId = agent.id;
67
- const parented = agentId !== undefined && agents.list().some(other => other !== agent && agents.isOwnedBy(agentId, other));
68
+ const parented = agentId !== undefined && agents.list().some(other => other !== agent && nativeIsOwnedBy(agents, agentId, other));
68
69
  const pendingIdentity = roleIdentity !== undefined && identityRole === undefined && parented;
69
70
  const selected = pendingIdentity ? undefined : identityRole ?? registry.composedPreset(agent.ctx);
70
71
  const previous = states.get(agent);
@@ -32,6 +32,7 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
32
32
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
33
33
  done = true;
34
34
  };
35
+ import { nativeRoots, nativeIsOwnedBy } from "./native-ownership.js";
35
36
  import { symbols } from "@deepseek-ai/cordis";
36
37
  import { Remote, RemoteError, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
37
38
  import { parseProfileErrorInfo, TYPERT_HOST } from "./profile-remote.js";
@@ -140,7 +141,7 @@ let DsmmProfilesHost = (() => {
140
141
  throw new DsmmProfileError("not-owned", "The native Host operator connection is no longer active.");
141
142
  }
142
143
  const agents = this.ctx.get("agents");
143
- if (agents === undefined || typeof agents.get !== "function" || typeof agents.roots !== "function" || typeof agents.list !== "function" || typeof agents.isOwnedBy !== "function") {
144
+ if (agents === undefined || typeof agents.get !== "function" || typeof agents.list !== "function") {
144
145
  throw new DsmmProfileError("unavailable", "Native session authority is unavailable.");
145
146
  }
146
147
  return agents;
@@ -153,8 +154,8 @@ let DsmmProfilesHost = (() => {
153
154
  const checkCaptured = () => {
154
155
  const current = checkAuthority();
155
156
  if (agent.id !== sessionId || agent.session.id !== sessionId || current.get(sessionId) !== agent
156
- || agent.session.header?.origin === "subagent" || !current.roots().includes(agent)
157
- || current.list().some((owner) => owner !== agent && current.isOwnedBy(sessionId, owner))) {
157
+ || agent.session.header?.origin === "subagent" || !nativeRoots(current).includes(agent)
158
+ || current.list().some((owner) => owner !== agent && nativeIsOwnedBy(current, sessionId, owner))) {
158
159
  throw new DsmmProfileError("not-owned", "Only an exact live ordinary root session can select a profile.", "sessionId");
159
160
  }
160
161
  };
@@ -1,3 +1,4 @@
1
+ import { nativeRoots } from "./native-ownership.js";
1
2
  import { join } from "node:path";
2
3
  import { randomBytes } from "node:crypto";
3
4
  import { lstatSync, realpathSync } from "node:fs";
@@ -320,7 +321,7 @@ export class DsmmProfileRuntime {
320
321
  this.assertCurrent();
321
322
  validateSessionProfileId(agent.id);
322
323
  const agents = this.ctx.get?.("agents");
323
- if (agents?.get(agent.id) !== agent || !agents.roots().includes(agent) || agent.session.header?.origin === "subagent")
324
+ if (agents?.get(agent.id) !== agent || !nativeRoots(agents).includes(agent) || agent.session.header?.origin === "subagent")
324
325
  throw new DsmmProfileError("not-owned", "The exact live root Agent is required.");
325
326
  }
326
327
  async describe() {
@@ -32,6 +32,8 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
32
32
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
33
33
  done = true;
34
34
  };
35
+ import { nativeRoots, nativeIsOwnedBy } from "./native-ownership.js";
36
+ import { listNativeChildren, promptNativeChild, interruptNativeChild } from "./native-subagents.js";
35
37
  import { symbols } from "@deepseek-ai/cordis";
36
38
  import { SessionId } from "@deepseek-ai/dsh-session";
37
39
  import { SubagentError } from "@deepseek-ai/dsh-subagent";
@@ -102,7 +104,7 @@ let DsmmChildrenHost = (() => {
102
104
  const parent = agents.get(SessionId(sessionId));
103
105
  if (!parent)
104
106
  throw new ControlRefusal("not-found", "sessionId");
105
- if (!agents.roots().includes(parent) || parent.session.header.origin === "subagent" || parent.session.id !== parent.id)
107
+ if (!nativeRoots(agents).includes(parent) || parent.session.header.origin === "subagent" || parent.session.id !== parent.id)
106
108
  throw new ControlRefusal("not-owned", "sessionId");
107
109
  const captured = this.admission.assert(parent);
108
110
  const signal = AbortSignal.any([invocation.signal, invocation.peer.signal, this.lifetime.signal, this.admission.lifetime.signal,
@@ -118,13 +120,13 @@ let DsmmChildrenHost = (() => {
118
120
  return { parent, admission: captured, epoch: captured.epoch, signal, check };
119
121
  }
120
122
  observationRoot(target, agents) {
121
- const roots = agents.roots(), residents = agents.list(), seen = new Set();
123
+ const roots = nativeRoots(agents), residents = agents.list(), seen = new Set();
122
124
  let current = target;
123
125
  while (!roots.includes(current)) {
124
126
  if (seen.has(current))
125
127
  throw new ControlRefusal("not-owned", "sessionId");
126
128
  seen.add(current);
127
- const parents = residents.filter(candidate => candidate !== current && agents.isOwnedBy(current.id, candidate));
129
+ const parents = residents.filter(candidate => candidate !== current && nativeIsOwnedBy(agents, current.id, candidate));
128
130
  if (parents.length !== 1)
129
131
  throw new ControlRefusal("not-owned", "sessionId");
130
132
  current = parents[0];
@@ -206,7 +208,7 @@ let DsmmChildrenHost = (() => {
206
208
  const live = child && this.admission.get(child), invocation = child && this.admission.invocation(child);
207
209
  const available = this.capabilities(scope);
208
210
  const reason = !direct ? "not-direct-child" : entry.mode !== "continuable" ? entry.mode === "one-shot" ? "one-shot" : "unknown-mode" : child && !live ? "evidence-unavailable" : undefined;
209
- const control = reason !== undefined ? disabled(reason) : child && !this.ctx.get("agents")?.isOwnedBy(child.id, scope.parent) ? disabled("not-direct-child") : available.prompt;
211
+ const control = reason !== undefined ? disabled(reason) : child && !nativeIsOwnedBy(this.ctx.get("agents"), child.id, scope.parent) ? disabled("not-direct-child") : available.prompt;
210
212
  return { id: entry.id, parentSessionId: parentId, mode: entry.mode === "external" ? "unknown" : entry.mode, activity: child?.status === "running" ? "running" : "inactive",
211
213
  readonly: !control.enabled, controls: { prompt: control, interrupt: child ? control : disabled("evidence-unavailable") }, ...(entry.label === undefined ? {} : { label: boundedLabel(entry.label) }),
212
214
  ...(invocation === undefined ? {} : { invocation: invocationView(invocation, boundedLabel(entry.label ?? invocation.target), "continuable", { childId: entry.id }) }),
@@ -235,7 +237,7 @@ let DsmmChildrenHost = (() => {
235
237
  }
236
238
  describe(sessionId) {
237
239
  return this.scoped(sessionId, async (scope) => {
238
- const rows = await this.ctx.get("subagents").listChildren(scope.parent.id, scope.signal);
240
+ const rows = await listNativeChildren(this.ctx.get("subagents"), scope.parent.id, scope.signal);
239
241
  scope.check();
240
242
  return parseChildSessionSnapshot({ sessionId, admissionEpoch: scope.epoch, children: rows.map(row => this.child(scope, row)), capabilities: this.capabilities(scope) });
241
243
  });
@@ -254,7 +256,7 @@ let DsmmChildrenHost = (() => {
254
256
  const child = this.ctx.get("agents")?.get(SessionId(childId));
255
257
  if (!child)
256
258
  throw new ControlRefusal("not-resumable", "childSessionId", "evidence-unavailable");
257
- if (!this.ctx.get("agents")?.isOwnedBy(child.id, scope.parent))
259
+ if (!nativeIsOwnedBy(this.ctx.get("agents"), child.id, scope.parent))
258
260
  throw new ControlRefusal("not-owned", "childSessionId");
259
261
  this.admission.assert(child);
260
262
  return child;
@@ -269,7 +271,7 @@ let DsmmChildrenHost = (() => {
269
271
  throw new ControlRefusal("disabled", undefined, capabilities.prompt.reason);
270
272
  if (request.content.some(part => part.type === "image") && !capabilities.images.enabled)
271
273
  throw new ControlRefusal("disabled", "content", capabilities.images.reason);
272
- const rows = await this.ctx.get("subagents").listChildren(scope.parent.id, scope.signal);
274
+ const rows = await listNativeChildren(this.ctx.get("subagents"), scope.parent.id, scope.signal);
273
275
  scope.check();
274
276
  const row = rows.find(row => row.id === request.childSessionId);
275
277
  if (!row)
@@ -280,7 +282,7 @@ let DsmmChildrenHost = (() => {
280
282
  this.direct(scope, request.childSessionId);
281
283
  return this.admission.duringCall(scope.parent, scope.signal, async (signal) => {
282
284
  scope.check();
283
- const receipt = await this.ctx.get("subagents").prompt(request, signal);
285
+ const receipt = await promptNativeChild(this.ctx.get("subagents"), request, signal);
284
286
  scope.check();
285
287
  return receipt;
286
288
  });
@@ -295,7 +297,7 @@ let DsmmChildrenHost = (() => {
295
297
  if (!capabilities.interrupt.enabled)
296
298
  throw new ControlRefusal("disabled", undefined, capabilities.interrupt.reason);
297
299
  this.direct(scope, request.childSessionId);
298
- return this.ctx.get("subagents").interruptByParent(SessionId(request.childSessionId), scope.parent.id, "continuable");
300
+ return interruptNativeChild(this.ctx.get("subagents"), SessionId(request.childSessionId), scope.parent.id);
299
301
  });
300
302
  }
301
303
  };
@@ -1,3 +1,4 @@
1
+ import { nativeIsOwnedBy } from "./native-ownership.js";
1
2
  import { AsyncLocalStorage } from "node:async_hooks";
2
3
  import { SubagentError, delegationDepthOf } from "@deepseek-ai/dsh-subagent";
3
4
  import { Context, symbols } from "@deepseek-ai/cordis";
@@ -65,7 +66,7 @@ export class DsmmRolePolicy {
65
66
  this.assertLive(agent);
66
67
  this.assertLive(parent);
67
68
  this.assertDelegation(parent, invocation.target);
68
- if (!this.agents().isOwnedBy(agent.id, parent) || agent.session.header?.parentSession !== parent.id || !independentComposition && this.selected(agent) !== this.selected(parent))
69
+ if (!nativeIsOwnedBy(this.agents(), agent.id, parent) || agent.session.header?.parentSession !== parent.id || !independentComposition && this.selected(agent) !== this.selected(parent))
69
70
  throw new SubagentError("Child lineage or composition mismatch", "UNAUTHORIZED");
70
71
  if (maximum !== undefined && delegationDepthOf(agent) > maximum)
71
72
  throw new SubagentError("Delegation depth exceeded", "UNAUTHORIZED");
@@ -81,7 +82,7 @@ export class DsmmRolePolicy {
81
82
  this.assertLive(agent);
82
83
  this.assertModuleAdmission(parent);
83
84
  const upstream = this.identity(parent), preset = this.selected(agent);
84
- if (!continuation && (upstream.role !== undefined || preset?.startsWith("dsmm-")) || !this.agents().isOwnedBy(agent.id, parent)
85
+ if (!continuation && (upstream.role !== undefined || preset?.startsWith("dsmm-")) || !nativeIsOwnedBy(this.agents(), agent.id, parent)
85
86
  || agent.session.header?.origin !== "subagent" || agent.session.header.parentSession !== parent.id)
86
87
  throw new SubagentError("Ordinary inheritance requires its exact non-controlled parent", "UNAUTHORIZED");
87
88
  liveIdentities.set(agent, Object.freeze({ child: true, parent, preset, epoch: admission.epoch,
@@ -93,7 +94,7 @@ export class DsmmRolePolicy {
93
94
  const settings = this.getSettings(agent), identity = liveIdentities.get(agent), selected = this.selected(agent);
94
95
  if (identity?.child) {
95
96
  this.assertLive(identity.parent);
96
- if (!this.agents().isOwnedBy(agent.id, identity.parent) || selected !== identity.preset
97
+ if (!nativeIsOwnedBy(this.agents(), agent.id, identity.parent) || selected !== identity.preset
97
98
  || identity.role !== undefined && !identity.independentComposition && selected !== this.selected(identity.parent))
98
99
  throw new SubagentError("Child admission no longer matches composition", "UNAUTHORIZED");
99
100
  }
@@ -109,7 +110,7 @@ export class DsmmRolePolicy {
109
110
  if (existing)
110
111
  return existing;
111
112
  const settings = this.getSettings(agent), selected = this.selected(agent);
112
- const parent = this.agents().list().find(row => row !== agent && this.agents().isOwnedBy(agent.id, row));
113
+ const parent = this.agents().list().find(row => row !== agent && nativeIsOwnedBy(this.agents(), agent.id, row));
113
114
  if (!parent)
114
115
  this.validateRootRole(agent, this.getSettings.admission(agent));
115
116
  const role = parent ? undefined : isDsmmRoleId(selected) ? selected : settings.modules.deepwork.enabled && this.mode.active(agent, settings.defaultActive) ? "dsmm-orchestrator" : undefined;
@@ -154,7 +155,7 @@ export class DsmmRolePolicy {
154
155
  const agents = agent.ctx.get("agents"), tools = agent.ctx.get("agentPresets")?.serviceFor(agent, "tools") ?? agent.ctx.get("tools"), definition = tools?.get(execution.name, agent);
155
156
  this.toolCalls.set(execution, { agent, context: agent.ctx, registry: Reflect.get(agents, symbols.original) ?? agents,
156
157
  realm: tools === undefined ? undefined : Reflect.get(tools, symbols.original) ?? tools, scopeParent: scopeParentOf(agent),
157
- parents: agents.list().filter(parent => parent !== agent && agents.isOwnedBy(agent.id, parent)), parentSession: agent.session.header.parentSession,
158
+ parents: agents.list().filter(parent => parent !== agent && nativeIsOwnedBy(agents, agent.id, parent)), parentSession: agent.session.header.parentSession,
158
159
  name: execution.name, args: execution.arguments, callId: execution.callId, signal: execution.signal,
159
160
  toolFilter: this.visibleToolCeiling(agent),
160
161
  ...(definition === undefined || !controlledDefinitions.has(definition) ? {} : { definition, body: definition.execute, argumentsJson: JSON.stringify(execution.arguments) }) });
@@ -184,7 +185,7 @@ export class DsmmRolePolicy {
184
185
  return;
185
186
  call.signal.throwIfAborted();
186
187
  const agents = agent.ctx.get("agents"), tools = agent.ctx.get("agentPresets")?.serviceFor(agent, "tools") ?? agent.ctx.get("tools");
187
- const parents = agents.list().filter(parent => parent !== agent && agents.isOwnedBy(agent.id, parent));
188
+ const parents = agents.list().filter(parent => parent !== agent && nativeIsOwnedBy(agents, agent.id, parent));
188
189
  if (agent !== call.agent || agent.ctx !== call.context || (Reflect.get(agents, symbols.original) ?? agents) !== call.registry
189
190
  || (tools === undefined ? undefined : Reflect.get(tools, symbols.original) ?? tools) !== call.realm || scopeParentOf(agent) !== call.scopeParent
190
191
  || agent.session.header.parentSession !== call.parentSession || parents.length !== call.parents.length || parents.some(parent => !call.parents.includes(parent)))
@@ -13,6 +13,7 @@ import { agentForScope, nativeAgentContext, scopeParentOf } from "./native-scope
13
13
  import { roleRouteRuntimeState } from "./role-routing.js";
14
14
  import { modelRouteFromCall } from "./role-llm.js";
15
15
  import { buildDsmmDelegationGuidance } from "./prompts.js";
16
+ import { startNativeActivation } from "./native-subagents.js";
16
17
  const hostControls = ["send_message", "interrupt_agent", "exit_plan_mode", "ask_user_question", "todo_write", "job_output", "job_list", "job_kill"];
17
18
  // Agent-owned policy realms survive a bundle reinstall; do not register another
18
19
  // delegation/tools layer on the same retained live Agent.
@@ -209,7 +210,7 @@ function registerRoleTool(agent, agentCtx, tools, entry, getSettings, policy, ad
209
210
  void cancellation.catch(() => { });
210
211
  } };
211
212
  try {
212
- activation = await subagents.startActivation({ childId: pending.childId, provider: provider.name, label, request, signal: pending.signal, delivery: requestedBackground ? "parent" : "caller" });
213
+ activation = await startNativeActivation(subagents, { childId: pending.childId, provider: provider.name, label, request, signal: pending.signal, delivery: requestedBackground ? "parent" : "caller" });
213
214
  admission.track(activation);
214
215
  pending.signal.addEventListener("abort", cancel, { once: true });
215
216
  if (pending.signal.aborted) {
@@ -217,6 +218,18 @@ function registerRoleTool(agent, agentCtx, tools, entry, getSettings, policy, ad
217
218
  await cancellation;
218
219
  pending.signal.throwIfAborted();
219
220
  }
221
+ try {
222
+ const child = agentCtx.agents.get(activation.childId);
223
+ if (child === undefined)
224
+ throw new SubagentError("Native role activation has no live child", "UNAUTHORIZED");
225
+ await admission.ensure(child);
226
+ }
227
+ catch (error) {
228
+ cancel();
229
+ await cancellation;
230
+ throw error;
231
+ }
232
+ pending.signal.throwIfAborted();
220
233
  if (requestedBackground)
221
234
  return { kind: "continuable", subagentId: activation.childId, messageId: activation.messageId ?? null, invocation: { ...pending.view() } };
222
235
  const result = await activation.result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsmm/dsmm",
3
- "version": "0.3.25",
3
+ "version": "0.3.26",
4
4
  "description": "Native Deepwork roles, routing, profiles, and permission controls for DeepSeek Harness.",
5
5
  "author": "Hugefiver",
6
6
  "license": "LicenseRef-AAAPL",
@@ -117,130 +117,130 @@
117
117
  "dsh": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0"
118
118
  },
119
119
  "dependencies": {
120
- "@deepseek-ai/dsh-web-fetch-http": "0.2.1-rc.2",
120
+ "@deepseek-ai/dsh-web-fetch-http": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
121
121
  "@deepseek-ai/schemastery": "~3.18.5",
122
122
  "ipaddr.js": "^2.5.0",
123
123
  "jsonc-parser": "^3.3.1"
124
124
  },
125
125
  "peerDependencies": {
126
- "@deepseek-ai/cordis": "~4.0.5",
127
- "@deepseek-ai/dsh-agent": "0.2.1-rc.2",
128
- "@deepseek-ai/dsh-agent-instructions": "0.2.1-rc.2",
129
- "@deepseek-ai/dsh-agent-loop": "0.2.1-rc.2",
130
- "@deepseek-ai/dsh-agent-preset-registry": "0.2.1-rc.2",
131
- "@deepseek-ai/dsh-api-remote-access": "0.2.1-rc.2",
132
- "@deepseek-ai/dsh-attachment": "0.2.1-rc.2",
133
- "@deepseek-ai/dsh-brand": "0.2.1-rc.2",
134
- "@deepseek-ai/dsh-client-connection": "0.2.1-rc.2",
135
- "@deepseek-ai/dsh-client-store": "0.2.1-rc.2",
136
- "@deepseek-ai/dsh-client-ui-approval": "0.2.1-rc.2",
137
- "@deepseek-ai/dsh-command-compact": "0.2.1-rc.2",
138
- "@deepseek-ai/dsh-compaction-basic": "0.2.1-rc.2",
139
- "@deepseek-ai/dsh-compaction-tool-result-pruner": "0.2.1-rc.2",
140
- "@deepseek-ai/dsh-fs-local": "0.2.1-rc.2",
141
- "@deepseek-ai/dsh-http-proxy": "0.2.1-rc.2",
142
- "@deepseek-ai/dsh-jobs": "0.2.1-rc.2",
143
- "@deepseek-ai/dsh-llm": "0.2.1-rc.2",
144
- "@deepseek-ai/dsh-llm-pi-ai": "0.2.1-rc.2",
145
- "@deepseek-ai/dsh-persona": "0.2.1-rc.2",
146
- "@deepseek-ai/dsh-plan-mode": "0.2.1-rc.2",
147
- "@deepseek-ai/dsh-sandbox-policy": "0.2.1-rc.2",
148
- "@deepseek-ai/dsh-session": "0.2.1-rc.2",
149
- "@deepseek-ai/dsh-session-persistence": "0.2.1-rc.2",
150
- "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.1-rc.2",
151
- "@deepseek-ai/dsh-settings": "0.2.1-rc.2",
152
- "@deepseek-ai/dsh-skill-filesystem": "0.2.1-rc.2",
153
- "@deepseek-ai/dsh-subagent": "0.2.1-rc.2",
154
- "@deepseek-ai/dsh-subprocess-local": "0.2.1-rc.2",
155
- "@deepseek-ai/dsh-timeout": "0.2.1-rc.2",
156
- "@deepseek-ai/dsh-tool-ask-user": "0.2.1-rc.2",
157
- "@deepseek-ai/dsh-tool-bash": "0.2.1-rc.2",
158
- "@deepseek-ai/dsh-tool-fs": "0.2.1-rc.2",
159
- "@deepseek-ai/dsh-tool-fs-search": "0.2.1-rc.2",
160
- "@deepseek-ai/dsh-tool-jobs": "0.2.1-rc.2",
161
- "@deepseek-ai/dsh-tool-pwsh": "0.2.1-rc.2",
162
- "@deepseek-ai/dsh-tool-skill": "0.2.1-rc.2",
163
- "@deepseek-ai/dsh-tool-subagent": "0.2.1-rc.2",
164
- "@deepseek-ai/dsh-tool-todo": "0.2.1-rc.2",
165
- "@deepseek-ai/dsh-tool-web": "0.2.1-rc.2",
166
- "@deepseek-ai/dsh-tools": "0.2.1-rc.2",
167
- "@deepseek-ai/dsh-typert-protocol": "0.2.1-rc.2",
168
- "@deepseek-ai/dsh-user-approval": "0.2.1-rc.2",
169
- "@deepseek-ai/dsh-web": "0.2.1-rc.2",
126
+ "@deepseek-ai/cordis": "~4.0.5 || ~4.1.0",
127
+ "@deepseek-ai/dsh-agent": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
128
+ "@deepseek-ai/dsh-agent-instructions": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
129
+ "@deepseek-ai/dsh-agent-loop": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
130
+ "@deepseek-ai/dsh-agent-preset-registry": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
131
+ "@deepseek-ai/dsh-api-remote-access": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
132
+ "@deepseek-ai/dsh-attachment": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
133
+ "@deepseek-ai/dsh-brand": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
134
+ "@deepseek-ai/dsh-client-connection": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
135
+ "@deepseek-ai/dsh-client-store": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
136
+ "@deepseek-ai/dsh-client-ui-approval": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
137
+ "@deepseek-ai/dsh-command-compact": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
138
+ "@deepseek-ai/dsh-compaction-basic": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
139
+ "@deepseek-ai/dsh-compaction-tool-result-pruner": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
140
+ "@deepseek-ai/dsh-fs-local": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
141
+ "@deepseek-ai/dsh-http-proxy": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
142
+ "@deepseek-ai/dsh-jobs": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
143
+ "@deepseek-ai/dsh-llm": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
144
+ "@deepseek-ai/dsh-llm-pi-ai": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
145
+ "@deepseek-ai/dsh-persona": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
146
+ "@deepseek-ai/dsh-plan-mode": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
147
+ "@deepseek-ai/dsh-sandbox-policy": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
148
+ "@deepseek-ai/dsh-session": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
149
+ "@deepseek-ai/dsh-session-persistence": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
150
+ "@deepseek-ai/dsh-session-persistence-jsonl": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
151
+ "@deepseek-ai/dsh-settings": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
152
+ "@deepseek-ai/dsh-skill-filesystem": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
153
+ "@deepseek-ai/dsh-subagent": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
154
+ "@deepseek-ai/dsh-subprocess-local": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
155
+ "@deepseek-ai/dsh-timeout": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
156
+ "@deepseek-ai/dsh-tool-ask-user": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
157
+ "@deepseek-ai/dsh-tool-bash": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
158
+ "@deepseek-ai/dsh-tool-fs": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
159
+ "@deepseek-ai/dsh-tool-fs-search": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
160
+ "@deepseek-ai/dsh-tool-jobs": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
161
+ "@deepseek-ai/dsh-tool-pwsh": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
162
+ "@deepseek-ai/dsh-tool-skill": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
163
+ "@deepseek-ai/dsh-tool-subagent": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
164
+ "@deepseek-ai/dsh-tool-todo": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
165
+ "@deepseek-ai/dsh-tool-web": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
166
+ "@deepseek-ai/dsh-tools": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
167
+ "@deepseek-ai/dsh-typert-protocol": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
168
+ "@deepseek-ai/dsh-user-approval": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
169
+ "@deepseek-ai/dsh-web": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
170
170
  "@earendil-works/pi-ai": "^1.1.0"
171
171
  },
172
172
  "devDependencies": {
173
173
  "@deepseek-ai/cordis": "~4.0.5",
174
174
  "@deepseek-ai/cordis-plugin-group": "1.0.5",
175
175
  "@deepseek-ai/cordis-plugin-include": "1.0.10",
176
- "@deepseek-ai/dsh-agent": "0.2.1-rc.2",
177
- "@deepseek-ai/dsh-agent-instructions": "0.2.1-rc.2",
178
- "@deepseek-ai/dsh-agent-loop": "0.2.1-rc.2",
179
- "@deepseek-ai/dsh-agent-preset-registry": "0.2.1-rc.2",
180
- "@deepseek-ai/dsh-api-gateway": "0.2.1-rc.2",
181
- "@deepseek-ai/dsh-api-remote-access": "0.2.1-rc.2",
182
- "@deepseek-ai/dsh-fs-local": "0.2.1-rc.2",
183
- "@deepseek-ai/dsh-fs-observation-policy": "0.2.1-rc.2",
184
- "@deepseek-ai/dsh-user-approval": "0.2.1-rc.2",
185
- "@deepseek-ai/dsh-sandbox-policy": "0.2.1-rc.2",
186
- "@deepseek-ai/dsh-sandbox-local": "0.2.1-rc.2",
187
- "@deepseek-ai/dsh-shell-env": "0.2.1-rc.2",
188
- "@deepseek-ai/dsh-bash-sandbox": "0.2.1-rc.2",
189
- "@deepseek-ai/dsh-pwsh-sandbox": "0.2.1-rc.2",
190
- "@deepseek-ai/dsh-subprocess-local": "0.2.1-rc.2",
191
- "@deepseek-ai/dsh-web-app": "0.2.1-rc.2",
192
- "@deepseek-ai/dsh-jobs-local": "0.2.1-rc.2",
193
- "@deepseek-ai/dsh-working-directory": "0.2.1-rc.2",
194
- "@deepseek-ai/dsh-api-session-controller": "0.2.1-rc.2",
195
- "@deepseek-ai/dsh-attachment": "0.2.1-rc.2",
196
- "@deepseek-ai/dsh-brand": "0.2.1-rc.2",
197
- "@deepseek-ai/dsh-client-connection": "0.2.1-rc.2",
198
- "@deepseek-ai/dsh-command-compact": "0.2.1-rc.2",
199
- "@deepseek-ai/dsh-compaction-basic": "0.2.1-rc.2",
200
- "@deepseek-ai/dsh-compaction-tool-result-pruner": "0.2.1-rc.2",
201
- "@deepseek-ai/dsh-http-proxy": "0.2.1-rc.2",
202
- "@deepseek-ai/dsh-jobs": "0.2.1-rc.2",
203
- "@deepseek-ai/dsh-llm": "0.2.1-rc.2",
204
- "@deepseek-ai/dsh-llm-pi-ai": "0.2.1-rc.2",
205
- "@deepseek-ai/dsh-persona": "0.2.1-rc.2",
206
- "@deepseek-ai/dsh-plan-mode": "0.2.1-rc.2",
207
- "@deepseek-ai/dsh-session": "0.2.1-rc.2",
208
- "@deepseek-ai/dsh-session-persistence": "0.2.1-rc.2",
209
- "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.1-rc.2",
210
- "@deepseek-ai/dsh-settings": "0.2.1-rc.2",
211
- "@deepseek-ai/dsh-skill-filesystem": "0.2.1-rc.2",
212
- "@deepseek-ai/dsh-subagent": "0.2.1-rc.2",
213
- "@deepseek-ai/dsh-timeout": "0.2.1-rc.2",
214
- "@deepseek-ai/dsh-tool-ask-user": "0.2.1-rc.2",
215
- "@deepseek-ai/dsh-tool-bash": "0.2.1-rc.2",
216
- "@deepseek-ai/dsh-tool-fs": "0.2.1-rc.2",
217
- "@deepseek-ai/dsh-tool-fs-search": "0.2.1-rc.2",
218
- "@deepseek-ai/dsh-tool-jobs": "0.2.1-rc.2",
219
- "@deepseek-ai/dsh-tool-pwsh": "0.2.1-rc.2",
220
- "@deepseek-ai/dsh-tool-skill": "0.2.1-rc.2",
221
- "@deepseek-ai/dsh-tool-subagent": "0.2.1-rc.2",
222
- "@deepseek-ai/dsh-tool-todo": "0.2.1-rc.2",
223
- "@deepseek-ai/dsh-tool-web": "0.2.1-rc.2",
224
- "@deepseek-ai/dsh-tools": "0.2.1-rc.2",
225
- "@deepseek-ai/dsh-typert-protocol": "0.2.1-rc.2",
226
- "@deepseek-ai/dsh-client-locale": "0.2.1-rc.2",
227
- "@deepseek-ai/dsh-client-store": "0.2.1-rc.2",
228
- "@deepseek-ai/dsh-client-ui-approval": "0.2.1-rc.2",
229
- "@deepseek-ai/dsh-client-ui-conversation": "0.2.1-rc.2",
230
- "@deepseek-ai/dsh-client-ui-model-selection": "0.2.1-rc.2",
231
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.2",
232
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.2",
233
- "@deepseek-ai/dsh-client-ui-session": "0.2.1-rc.2",
234
- "@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.2",
235
- "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.2",
236
- "@deepseek-ai/dsh-client-ui-tool": "0.2.1-rc.2",
237
- "@deepseek-ai/dsh-scope": "0.2.1-rc.2",
238
- "@deepseek-ai/dsh-session-projection": "0.2.1-rc.2",
239
- "@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.1-rc.2",
240
- "@deepseek-ai/dsh-tool-subagent-control": "0.2.1-rc.2",
241
- "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.2",
242
- "@deepseek-ai/dsh-typert-registry": "0.2.1-rc.2",
243
- "@deepseek-ai/dsh-web": "0.2.1-rc.2",
176
+ "@deepseek-ai/dsh-agent": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
177
+ "@deepseek-ai/dsh-agent-instructions": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
178
+ "@deepseek-ai/dsh-agent-loop": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
179
+ "@deepseek-ai/dsh-agent-preset-registry": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
180
+ "@deepseek-ai/dsh-api-gateway": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
181
+ "@deepseek-ai/dsh-api-remote-access": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
182
+ "@deepseek-ai/dsh-fs-local": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
183
+ "@deepseek-ai/dsh-fs-observation-policy": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
184
+ "@deepseek-ai/dsh-user-approval": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
185
+ "@deepseek-ai/dsh-sandbox-policy": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
186
+ "@deepseek-ai/dsh-sandbox-local": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
187
+ "@deepseek-ai/dsh-shell-env": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
188
+ "@deepseek-ai/dsh-bash-sandbox": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
189
+ "@deepseek-ai/dsh-pwsh-sandbox": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
190
+ "@deepseek-ai/dsh-subprocess-local": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
191
+ "@deepseek-ai/dsh-web-app": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
192
+ "@deepseek-ai/dsh-jobs-local": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
193
+ "@deepseek-ai/dsh-working-directory": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
194
+ "@deepseek-ai/dsh-api-session-controller": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
195
+ "@deepseek-ai/dsh-attachment": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
196
+ "@deepseek-ai/dsh-brand": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
197
+ "@deepseek-ai/dsh-client-connection": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
198
+ "@deepseek-ai/dsh-command-compact": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
199
+ "@deepseek-ai/dsh-compaction-basic": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
200
+ "@deepseek-ai/dsh-compaction-tool-result-pruner": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
201
+ "@deepseek-ai/dsh-http-proxy": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
202
+ "@deepseek-ai/dsh-jobs": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
203
+ "@deepseek-ai/dsh-llm": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
204
+ "@deepseek-ai/dsh-llm-pi-ai": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
205
+ "@deepseek-ai/dsh-persona": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
206
+ "@deepseek-ai/dsh-plan-mode": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
207
+ "@deepseek-ai/dsh-session": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
208
+ "@deepseek-ai/dsh-session-persistence": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
209
+ "@deepseek-ai/dsh-session-persistence-jsonl": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
210
+ "@deepseek-ai/dsh-settings": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
211
+ "@deepseek-ai/dsh-skill-filesystem": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
212
+ "@deepseek-ai/dsh-subagent": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
213
+ "@deepseek-ai/dsh-timeout": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
214
+ "@deepseek-ai/dsh-tool-ask-user": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
215
+ "@deepseek-ai/dsh-tool-bash": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
216
+ "@deepseek-ai/dsh-tool-fs": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
217
+ "@deepseek-ai/dsh-tool-fs-search": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
218
+ "@deepseek-ai/dsh-tool-jobs": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
219
+ "@deepseek-ai/dsh-tool-pwsh": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
220
+ "@deepseek-ai/dsh-tool-skill": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
221
+ "@deepseek-ai/dsh-tool-subagent": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
222
+ "@deepseek-ai/dsh-tool-todo": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
223
+ "@deepseek-ai/dsh-tool-web": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
224
+ "@deepseek-ai/dsh-tools": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
225
+ "@deepseek-ai/dsh-typert-protocol": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
226
+ "@deepseek-ai/dsh-client-locale": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
227
+ "@deepseek-ai/dsh-client-store": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
228
+ "@deepseek-ai/dsh-client-ui-approval": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
229
+ "@deepseek-ai/dsh-client-ui-conversation": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
230
+ "@deepseek-ai/dsh-client-ui-model-selection": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
231
+ "@deepseek-ai/dsh-client-ui-primitives": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
232
+ "@deepseek-ai/dsh-client-ui-renderer": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
233
+ "@deepseek-ai/dsh-client-ui-session": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
234
+ "@deepseek-ai/dsh-client-ui-settings": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
235
+ "@deepseek-ai/dsh-client-ui-slots": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
236
+ "@deepseek-ai/dsh-client-ui-tool": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
237
+ "@deepseek-ai/dsh-scope": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
238
+ "@deepseek-ai/dsh-session-projection": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
239
+ "@deepseek-ai/dsh-subagent-spawn-in-process": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
240
+ "@deepseek-ai/dsh-tool-subagent-control": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
241
+ "@deepseek-ai/dsh-system-prompt": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
242
+ "@deepseek-ai/dsh-typert-registry": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
243
+ "@deepseek-ai/dsh-web": ">=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0",
244
244
  "@earendil-works/pi-ai": "1.3.0",
245
245
  "@types/node": "^26.0.0",
246
246
  "@types/react": "^18.3.27",