@toddzheng024/dscode-bundle 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +15 -0
- package/cordis.patch.yml +3 -3
- package/package.json +7 -1
- package/plugins/clipboard-image/clipboard-image.swift +56 -0
- package/plugins/clipboard-image/index.mjs +70 -0
- package/plugins/code-review/git.mjs +95 -0
- package/plugins/code-review/index.mjs +88 -0
- package/plugins/dscode/index.mjs +57 -5
- package/plugins/email-tools/index.mjs +2 -2
- package/plugins/exec/index.mjs +107 -0
- package/plugins/session-metrics/index.mjs +6 -2
- package/plugins/session-metrics/rate.mjs +62 -0
- package/plugins/session-metrics/view.mjs +15 -9
- package/plugins/tui-tools/doctor-cli.mjs +22 -0
- package/plugins/tui-tools/doctor.mjs +141 -0
- package/plugins/tui-tools/index.mjs +14 -6
- package/plugins/ultra/policy.mjs +13 -2
- package/plugins/worktree-subagent/worktree.mjs +50 -0
- package/presets/dscode/agent.cordis.yml +14 -3
- package/vendor/deepseek/index.js +12 -2
- package/vendor/subagent/index.js +39 -12
- package/vendor/subagent-core/LICENSE +21 -0
- package/vendor/subagent-core/index.js +3232 -0
- package/vendor/subagent-core/invariant.js +76 -0
- package/vendor/subagent-core/typert.host.d.ts +3 -0
- package/vendor/subagent-core/typert.host.js +964 -0
- package/vendor/subagent-core/typert.remote-client.d.ts +27 -0
- package/vendor/subagent-core/typert.remote-client.js +160 -0
- package/vendor/subagent-core/types/assistant-output.d.ts +48 -0
- package/vendor/subagent-core/types/assistant-output.js +73 -0
- package/vendor/subagent-core/types/catalog.d.ts +77 -0
- package/vendor/subagent-core/types/catalog.js +103 -0
- package/vendor/subagent-core/types/child-agent.d.ts +150 -0
- package/vendor/subagent-core/types/child-agent.js +207 -0
- package/vendor/subagent-core/types/client.d.ts +8 -0
- package/vendor/subagent-core/types/client.js +7 -0
- package/vendor/subagent-core/types/continuation-activation.d.ts +251 -0
- package/vendor/subagent-core/types/continuation-activation.js +663 -0
- package/vendor/subagent-core/types/continuation-messages.d.ts +62 -0
- package/vendor/subagent-core/types/continuation-messages.js +102 -0
- package/vendor/subagent-core/types/continuation.d.ts +124 -0
- package/vendor/subagent-core/types/continuation.js +455 -0
- package/vendor/subagent-core/types/control-types.d.ts +146 -0
- package/vendor/subagent-core/types/control-types.js +9 -0
- package/vendor/subagent-core/types/control.d.ts +71 -0
- package/vendor/subagent-core/types/control.js +116 -0
- package/vendor/subagent-core/types/depth.d.ts +31 -0
- package/vendor/subagent-core/types/depth.js +39 -0
- package/vendor/subagent-core/types/descriptor.d.ts +144 -0
- package/vendor/subagent-core/types/descriptor.js +193 -0
- package/vendor/subagent-core/types/error.d.ts +11 -0
- package/vendor/subagent-core/types/error.js +14 -0
- package/vendor/subagent-core/types/inbox.d.ts +43 -0
- package/vendor/subagent-core/types/inbox.js +61 -0
- package/vendor/subagent-core/types/index.d.ts +316 -0
- package/vendor/subagent-core/types/index.js +511 -0
- package/vendor/subagent-core/types/internal.d.ts +58 -0
- package/vendor/subagent-core/types/internal.js +58 -0
- package/vendor/subagent-core/types/invariant.d.ts +13 -0
- package/vendor/subagent-core/types/invariant.js +91 -0
- package/vendor/subagent-core/types/lifecycle.d.ts +113 -0
- package/vendor/subagent-core/types/lifecycle.js +178 -0
- package/vendor/subagent-core/types/list-children.d.ts +65 -0
- package/vendor/subagent-core/types/list-children.js +381 -0
- package/vendor/subagent-core/types/out-of-process.d.ts +118 -0
- package/vendor/subagent-core/types/out-of-process.js +219 -0
- package/vendor/subagent-core/types/projection-types.d.ts +74 -0
- package/vendor/subagent-core/types/projection-types.js +7 -0
- package/vendor/subagent-core/types/projection.d.ts +95 -0
- package/vendor/subagent-core/types/projection.js +151 -0
- package/vendor/subagent-core/types/run-settlement.d.ts +17 -0
- package/vendor/subagent-core/types/run-settlement.js +70 -0
- package/vendor/subagent-core/types/types.d.ts +377 -0
- package/vendor/subagent-core/types/types.js +19 -0
- package/vendor/subagent-driver/LICENSE +21 -0
- package/vendor/subagent-driver/index.js +255 -0
- package/vendor/subagent-driver/types/index.d.ts +33 -0
- package/vendor/subagent-driver/types/structured.d.ts +42 -0
- package/vendor/subagent-fork/LICENSE +21 -0
- package/vendor/subagent-fork/index.js +61 -0
- package/vendor/subagent-fork/types/index.d.ts +20 -0
- package/vendor/subagent-spawn/LICENSE +21 -0
- package/vendor/subagent-spawn/index.js +45 -0
- package/vendor/subagent-spawn/types/index.d.ts +19 -0
- package/vendor/terminal/LICENSE +21 -0
- package/vendor/terminal/index.js +1013 -0
- package/vendor/terminal/types/config.d.ts +71 -0
- package/vendor/terminal/types/index.d.ts +36 -0
- package/vendor/terminal/types/sanitize.d.ts +47 -0
- package/vendor/terminal/types/session.d.ts +87 -0
- package/vendor/tui/dscode-clipboard-image/clipboard-image.swift +56 -0
- package/vendor/tui/dscode-clipboard-image/index.mjs +70 -0
- package/vendor/tui/index.mjs +341 -93
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service Definition for the subagent capability seam (`ctx.subagents`): a named-provider registry plus a
|
|
3
|
+
* capability-validating asynchronous start API. Providers establish a
|
|
4
|
+
* child before returning its run, so fulfillment is the single publication and
|
|
5
|
+
* ownership-transfer boundary.
|
|
6
|
+
*
|
|
7
|
+
* Multiple providers coexist: each registers under a unique name and callers
|
|
8
|
+
* select one by name.
|
|
9
|
+
*
|
|
10
|
+
* This package owns the Service Definition role of the capability seam. Service Providers
|
|
11
|
+
* (`@deepseek-ai/dsh-subagent-spawn-in-process`, `-fork`, `-acp`) and the model-facing
|
|
12
|
+
* consumer (`@deepseek-ai/dsh-tool-subagent`) are separate packages.
|
|
13
|
+
*
|
|
14
|
+
* Public operations express caller intent: `start` returns one published owned
|
|
15
|
+
* one-shot run, `startContinuable` establishes a durable continuable child, and
|
|
16
|
+
* `sendMessage` steers between adjacent Agents without exposing whether a child
|
|
17
|
+
* is resident. Continuable children never become a {@link SubagentRun}: the
|
|
18
|
+
* continuation manager holds their `AgentHandle` directly and orders every turn
|
|
19
|
+
* through the child's own inbox, so providers contribute only the detached
|
|
20
|
+
* creation spec and see no handle, turn, or teardown. Child and descendant
|
|
21
|
+
* discovery read the live session store and optional session persistence
|
|
22
|
+
* directly and do not require that continuation runtime.
|
|
23
|
+
*
|
|
24
|
+
* Same-process providers are trusted typed collaborators. Requests, provider
|
|
25
|
+
* descriptors, results, and lifecycle payloads are borrowed immutable values;
|
|
26
|
+
* serialization and hostile-input validation belong at real process, worker,
|
|
27
|
+
* persistence, and model boundaries.
|
|
28
|
+
*
|
|
29
|
+
* @module @deepseek-ai/dsh-subagent
|
|
30
|
+
*/
|
|
31
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
32
|
+
var useValue = arguments.length > 2;
|
|
33
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
34
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
35
|
+
}
|
|
36
|
+
return useValue ? value : void 0;
|
|
37
|
+
};
|
|
38
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
39
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
40
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
41
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
42
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
43
|
+
var _, done = false;
|
|
44
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
45
|
+
var context = {};
|
|
46
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
47
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
48
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
49
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
50
|
+
if (kind === "accessor") {
|
|
51
|
+
if (result === void 0) continue;
|
|
52
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
53
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
54
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
55
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
56
|
+
}
|
|
57
|
+
else if (_ = accept(result)) {
|
|
58
|
+
if (kind === "field") initializers.unshift(_);
|
|
59
|
+
else descriptor[key] = _;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
63
|
+
done = true;
|
|
64
|
+
};
|
|
65
|
+
import { scopeTarget } from '@deepseek-ai/dsh-scope';
|
|
66
|
+
import { assertObjectJsonSchema } from '@deepseek-ai/dsh-tools';
|
|
67
|
+
import { canonicalClientTimeZone } from '@deepseek-ai/dsh-util-time';
|
|
68
|
+
import { Remote, RemoteError, TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
69
|
+
import { catalogView, rejectCatalogRead, rejectPrompt, validateControlRequest, } from "./control.js";
|
|
70
|
+
import { SubagentError } from "./error.js";
|
|
71
|
+
import { assertSubagentMaxDepth } from "./depth.js";
|
|
72
|
+
import { createActivationObserver, createLifecycleEmitter, observeRun } from "./lifecycle.js";
|
|
73
|
+
import SubagentContinuationManager from "./continuation.js";
|
|
74
|
+
import { listChildren as listSubagentChildren, listDescendants as listSubagentDescendants } from "./list-children.js";
|
|
75
|
+
import { snapshotSubagentDescriptor } from "./descriptor.js";
|
|
76
|
+
import { subagentIdentityProjectionDefinition, subagentTimingProjectionDefinition } from "./projection.js";
|
|
77
|
+
import { establishCatalogChild, subagentCatalogProjectionDefinition } from "./catalog.js";
|
|
78
|
+
import { deliverSubagentPrompt } from "./internal.js";
|
|
79
|
+
export * from "./out-of-process.js";
|
|
80
|
+
export { AssistantOutputFold, finalAssistantOutput } from "./assistant-output.js";
|
|
81
|
+
export { SubagentRunId } from "./types.js";
|
|
82
|
+
export { foldSubagentDescriptor, snapshotSubagentDescriptor, SUBAGENT_DESCRIPTOR_VERSION, } from "./descriptor.js";
|
|
83
|
+
export { SubagentError } from "./error.js";
|
|
84
|
+
export { settleRun } from "./run-settlement.js";
|
|
85
|
+
export { assertSubagentMaxDepth, delegationDepthOf } from "./depth.js";
|
|
86
|
+
export { appendDelegatedPolicyOverrides, applyChildComposition, captureDelegatedPolicyOverrides, childSessionMeta, parentAgentOptionsForDelegation, resolveChildAgentOptions, resolveChildDepth, SubagentDepthError, } from "./child-agent.js";
|
|
87
|
+
/** Named provider registry with one-shot runs, durable discovery, and continuable-child operations. */
|
|
88
|
+
let SubagentRuntime = (() => {
|
|
89
|
+
let _classSuper = TypertRemoteService;
|
|
90
|
+
let _instanceExtraInitializers = [];
|
|
91
|
+
let _remoteExportList_decorators;
|
|
92
|
+
let _prompt_decorators;
|
|
93
|
+
let _interruptByParent_decorators;
|
|
94
|
+
return class SubagentRuntime extends _classSuper {
|
|
95
|
+
static {
|
|
96
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
97
|
+
_remoteExportList_decorators = [Remote('list')];
|
|
98
|
+
_prompt_decorators = [Remote('prompt')];
|
|
99
|
+
_interruptByParent_decorators = [Remote('interruptByParent')];
|
|
100
|
+
__esDecorate(this, null, _remoteExportList_decorators, { kind: "method", name: "remoteExportList", static: false, private: false, access: { has: obj => "remoteExportList" in obj, get: obj => obj.remoteExportList }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
101
|
+
__esDecorate(this, null, _prompt_decorators, { kind: "method", name: "prompt", static: false, private: false, access: { has: obj => "prompt" in obj, get: obj => obj.prompt }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
102
|
+
__esDecorate(this, null, _interruptByParent_decorators, { kind: "method", name: "interruptByParent", static: false, private: false, access: { has: obj => "interruptByParent" in obj, get: obj => obj.interruptByParent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
103
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
104
|
+
}
|
|
105
|
+
providers = (__runInitializers(this, _instanceExtraInitializers), new Map());
|
|
106
|
+
continuations;
|
|
107
|
+
/**
|
|
108
|
+
* The contained lifecycle-edge publisher. Built here because scoped dispatch
|
|
109
|
+
* keys its carrier by this exact service instance, whose own context filter
|
|
110
|
+
* composes into the carrier.
|
|
111
|
+
*/
|
|
112
|
+
emitLifecycle;
|
|
113
|
+
constructor(ctx) {
|
|
114
|
+
super(ctx, 'subagents');
|
|
115
|
+
this.emitLifecycle = createLifecycleEmitter(this.ctx, parent => scopeTarget(this, parent));
|
|
116
|
+
ctx.inject(['agents'], (childCtx) => {
|
|
117
|
+
const manager = new SubagentContinuationManager(childCtx, {
|
|
118
|
+
prepareContinuable: (name, request) => this.prepareContinuable(name, request),
|
|
119
|
+
observeActivation: (provider, childId, parent) => this.observeActivation(provider, childId, parent),
|
|
120
|
+
});
|
|
121
|
+
this.continuations = manager;
|
|
122
|
+
childCtx.effect(() => () => {
|
|
123
|
+
/* v8 ignore else -- one injected binding owns the slot until its fiber disposes. */
|
|
124
|
+
if (this.continuations === manager)
|
|
125
|
+
this.continuations = undefined;
|
|
126
|
+
}, 'subagents.continuationBinding()');
|
|
127
|
+
});
|
|
128
|
+
ctx.inject(['sessionProjections'], (projectionCtx) => {
|
|
129
|
+
projectionCtx.sessionProjections.register(subagentCatalogProjectionDefinition);
|
|
130
|
+
projectionCtx.sessionProjections.register(subagentTimingProjectionDefinition);
|
|
131
|
+
projectionCtx.sessionProjections.register(subagentIdentityProjectionDefinition);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Establish one durable continuable child and deliver its initial prompt.
|
|
136
|
+
* Resolves when the child's inbox accepts that prompt, without waiting for the
|
|
137
|
+
* turn to start or for the message to reach the Session log; any earlier
|
|
138
|
+
* failure rejects with no ids and rolls back the child entirely.
|
|
139
|
+
* @param spec - provider, delegation request, and caller cancellation.
|
|
140
|
+
* @returns the durable child id and the accepted prompt's message id.
|
|
141
|
+
* @throws when continuation services are unavailable or materialization fails.
|
|
142
|
+
*/
|
|
143
|
+
async startContinuable(spec) {
|
|
144
|
+
return this.requireContinuations().startContinuable(spec);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Steer one model-authored message to the sender's direct parent or direct
|
|
148
|
+
* continuable child. A running target admits it at the nearest step boundary;
|
|
149
|
+
* an idle target starts a turn, and an absent direct child cold-resumes from
|
|
150
|
+
* persistence. The service derives durable sender attribution from the exact
|
|
151
|
+
* live sender. Caller cancellation stops only pre-acceptance work.
|
|
152
|
+
* @param sender - exact live Agent authorizing and originating the message.
|
|
153
|
+
* @param targetId - durable direct-parent or direct-child session id.
|
|
154
|
+
* @param content - model-authored content to deliver.
|
|
155
|
+
* @param options - caller cancellation before inbox acceptance.
|
|
156
|
+
* @returns the accepted message's inbox id.
|
|
157
|
+
* @throws when continuation services are unavailable, adjacency is rejected,
|
|
158
|
+
* or the message was not admitted.
|
|
159
|
+
*/
|
|
160
|
+
async sendMessage(sender, targetId, content, options) {
|
|
161
|
+
return this.requireContinuations().sendMessage(sender, targetId, content, options);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Deliver one host-protocol message to a direct continuable child.
|
|
165
|
+
* Symbol-keyed so host adapters can preserve their own provenance without
|
|
166
|
+
* widening the public Service Definition or impersonating an Agent sender.
|
|
167
|
+
* @param parent - exact live direct parent authorizing delivery.
|
|
168
|
+
* @param childId - durable direct-child session id.
|
|
169
|
+
* @param content - host-authored content to deliver.
|
|
170
|
+
* @param source - durable host-protocol provenance.
|
|
171
|
+
* @param signal - caller cancellation before inbox acceptance.
|
|
172
|
+
* @param delivery - Queue as a distinct turn or Steer at the nearest step.
|
|
173
|
+
* @returns the accepted message's inbox id.
|
|
174
|
+
*/
|
|
175
|
+
[deliverSubagentPrompt](parent, childId, content, source, signal, delivery) {
|
|
176
|
+
return delivery === 'steer'
|
|
177
|
+
? this.requireContinuations().steerPrompt(parent, childId, content, source, signal)
|
|
178
|
+
: this.requireContinuations().queuePrompt(parent, childId, content, source, signal);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Interrupt one live continuable child's current turn under a human parent
|
|
182
|
+
* address or an exact live ancestor Agent. Fire-and-return: the cancel
|
|
183
|
+
* signal is issued before this returns, but the target may keep running
|
|
184
|
+
* until it observes the signal. Unclaimed pending inbox work, the Activation,
|
|
185
|
+
* and published descendants are preserved; claimed work is not requeued.
|
|
186
|
+
* Once the interrupted driver is idle, a waking send resumes the parked FIFO
|
|
187
|
+
* queue. An absent target — including a one-shot or unknown id —
|
|
188
|
+
* is an accepted no-op, as is a manager-less composition, which cannot own a
|
|
189
|
+
* live Activation.
|
|
190
|
+
* @param targetSessionId - the durable child session id to interrupt.
|
|
191
|
+
* @param authority - the human parent address or exact live ancestor Agent.
|
|
192
|
+
* @throws {SubagentError} `UNAUTHORIZED` when the authority does not own the
|
|
193
|
+
* live target.
|
|
194
|
+
*/
|
|
195
|
+
interrupt(targetSessionId, authority) {
|
|
196
|
+
this.continuations?.interrupt(targetSessionId, authority);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Close continuable admission below exact live parent Agents, stop only their
|
|
200
|
+
* visible descendant Activations synchronously, then await admitted scoped
|
|
201
|
+
* materializations and release those forests child-first. The scoped cutoff
|
|
202
|
+
* lasts until each exact parent leaves the registry; unrelated parent trees
|
|
203
|
+
* remain live.
|
|
204
|
+
* @param parents - exact host-owned parent Agents entering teardown.
|
|
205
|
+
* @returns once every retained descendant Activation released its `AgentHandle`.
|
|
206
|
+
* @throws an aggregate error after all branches settle when any failed.
|
|
207
|
+
*/
|
|
208
|
+
async drainContinuableDescendants(parents) {
|
|
209
|
+
const manager = this.continuations;
|
|
210
|
+
// Absent continuation services means nothing was ever materialized.
|
|
211
|
+
if (manager === undefined)
|
|
212
|
+
return;
|
|
213
|
+
await manager.drainDescendants(parents);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Release selected resident continuable direct children of one exact live
|
|
217
|
+
* parent. Other children of the same parent remain admitted and resident.
|
|
218
|
+
* Absent targets and a manager-less composition are accepted no-ops.
|
|
219
|
+
* @param parent - exact live direct parent authorizing the selected release.
|
|
220
|
+
* @param childIds - durable direct-child ids to release when resident.
|
|
221
|
+
* @returns once every selected Activation released its `AgentHandle`.
|
|
222
|
+
* @throws {SubagentError} `UNAUTHORIZED` when a resident target belongs to a
|
|
223
|
+
* different parent or the supplied parent identity is stale.
|
|
224
|
+
*/
|
|
225
|
+
async drainContinuableChildren(parent, childIds) {
|
|
226
|
+
const manager = this.continuations;
|
|
227
|
+
if (manager === undefined)
|
|
228
|
+
return;
|
|
229
|
+
await manager.drainChildren(parent, childIds);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Enumerate the parent's direct session-backed subagents without loading or
|
|
233
|
+
* resuming an Agent. The Session query service supplies one live-preferred
|
|
234
|
+
* corpus and shared point observations; the projection cache supplies
|
|
235
|
+
* immutable descriptor hits without opening cold logs. The registered
|
|
236
|
+
* `subagent` projection remains the sole mode/label classifier.
|
|
237
|
+
*
|
|
238
|
+
* Every query receives `signal`, and the listing rechecks cancellation
|
|
239
|
+
* around each await. Read rejections that settle
|
|
240
|
+
* after an abort become a stable `SubagentError` with code `CANCELLED`.
|
|
241
|
+
* @param parentSessionId - parent session whose direct children are listed.
|
|
242
|
+
* @param signal - caller-owned cancellation forwarded to Session queries
|
|
243
|
+
* and observed around every read await.
|
|
244
|
+
* @returns children and per-child diagnostics ordered by `createdAt`, then id.
|
|
245
|
+
* @throws {@link SubagentError} when the projection registry or the session
|
|
246
|
+
* store is not mounted, or the caller cancels the listing.
|
|
247
|
+
*/
|
|
248
|
+
listChildren(parentSessionId, signal) {
|
|
249
|
+
return listSubagentChildren(this.ctx, parentSessionId, signal);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Enumerate the root's complete session-backed subagent tree in stable
|
|
253
|
+
* pre-order from one live-preferred corpus, without loading or resuming an
|
|
254
|
+
* Agent. Ordinary sessions and one-shot children remain traversal nodes so
|
|
255
|
+
* continuable descendants below them are discovered; each returned entry
|
|
256
|
+
* adds its durable `parentId` and root-relative `depth`. Identity resolution,
|
|
257
|
+
* diagnostics, optional persistence, and cancellation follow the same
|
|
258
|
+
* projection-backed contract as {@link listChildren}.
|
|
259
|
+
* @param rootSessionId - session whose complete descendant tree is listed.
|
|
260
|
+
* @param signal - caller-owned cancellation forwarded to persistence reads
|
|
261
|
+
* and observed around every read await.
|
|
262
|
+
* @returns children and per-candidate diagnostics with tree position, in
|
|
263
|
+
* stable pre-order.
|
|
264
|
+
* @throws {@link SubagentError} under the same conditions as {@link listChildren}.
|
|
265
|
+
*/
|
|
266
|
+
listDescendants(rootSessionId, signal) {
|
|
267
|
+
return listSubagentDescendants(this.ctx, rootSessionId, signal);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Remote face of {@link listChildren} for one browser: the durable listing
|
|
271
|
+
* plus live Agent activity and the delivery-time parent availability hint.
|
|
272
|
+
* Parent availability is a hint; {@link prompt} performs the authoritative
|
|
273
|
+
* check. Named apart from the provider-name {@link list}, which owns the
|
|
274
|
+
* member.
|
|
275
|
+
* @param parentSessionId - parent session whose direct children are listed.
|
|
276
|
+
* @param signal - carrier cancellation forwarded to Session queries.
|
|
277
|
+
* @returns the catalog view for that parent.
|
|
278
|
+
* @throws {RemoteError} `gateway/bad-request` for an empty parent id,
|
|
279
|
+
* `gateway/cancelled` for an aborted read, `subagent/projections-unavailable` when
|
|
280
|
+
* the deployment has no projection registry, otherwise `gateway/internal`.
|
|
281
|
+
*/
|
|
282
|
+
async remoteExportList(parentSessionId, signal) {
|
|
283
|
+
validateControlRequest('subagent.list', { parentSessionId });
|
|
284
|
+
try {
|
|
285
|
+
return catalogView(this.ctx, parentSessionId, await this.listChildren(parentSessionId, signal));
|
|
286
|
+
}
|
|
287
|
+
catch (error) {
|
|
288
|
+
return rejectCatalogRead(error, signal);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Deliver one browser-authored message to a continuable child through the
|
|
293
|
+
* exact live direct parent, retaining the caller-minted request identity and
|
|
294
|
+
* validated browser zone on the accepted message. Success identifies the
|
|
295
|
+
* message the child's inbox accepted; later execution is independent of this
|
|
296
|
+
* call. Queue delivery targets a later turn; steer delivery targets the
|
|
297
|
+
* nearest step and retains the Agent loop's best-effort fallback semantics.
|
|
298
|
+
* Image parts are admitted and persisted through the attachment store
|
|
299
|
+
* before delivery, and the child's model must accept image input.
|
|
300
|
+
* @param request - durable address, delivery, minted identity, content, and optional browser zone.
|
|
301
|
+
* @param signal - carrier cancellation, owning the call until inbox acceptance.
|
|
302
|
+
* @returns the accepted message's inbox identity.
|
|
303
|
+
* @throws {RemoteError} `gateway/bad-request`, `subagent/attachment-invalid`,
|
|
304
|
+
* `subagent/invalid-time-zone`, `subagent/parent-unavailable`,
|
|
305
|
+
* `subagent/not-resumable`, `subagent/unauthorized`,
|
|
306
|
+
* `subagent/delivery-unavailable`, `gateway/cancelled`, or `gateway/internal`.
|
|
307
|
+
*/
|
|
308
|
+
async prompt(request, signal) {
|
|
309
|
+
const { parentSessionId, childSessionId, clientTimeZone, delivery } = request;
|
|
310
|
+
validateControlRequest('subagent.prompt', request);
|
|
311
|
+
const canonicalTimeZone = clientTimeZone === undefined
|
|
312
|
+
? undefined
|
|
313
|
+
: canonicalClientTimeZone(clientTimeZone);
|
|
314
|
+
if (clientTimeZone !== undefined && canonicalTimeZone === undefined) {
|
|
315
|
+
throw new RemoteError('subagent/invalid-time-zone', 'clientTimeZone must be UTC or a valid IANA Area/Location name', { value: clientTimeZone });
|
|
316
|
+
}
|
|
317
|
+
const parent = this.ctx.get('agents')?.get(parentSessionId);
|
|
318
|
+
if (parent === undefined) {
|
|
319
|
+
throw new RemoteError('subagent/parent-unavailable', `parent session "${parentSessionId}" is not live`, { parentSessionId });
|
|
320
|
+
}
|
|
321
|
+
const source = {
|
|
322
|
+
kind: 'user',
|
|
323
|
+
rpcId: request.requestId,
|
|
324
|
+
...(canonicalTimeZone === undefined ? {} : { clientTimeZone: canonicalTimeZone }),
|
|
325
|
+
};
|
|
326
|
+
try {
|
|
327
|
+
// Admission precedes delivery: image parts become durable references
|
|
328
|
+
// here, so the child inbox only ever accepts Host-persisted attachments.
|
|
329
|
+
let content;
|
|
330
|
+
if (request.content.every((part) => part.type === 'text')) {
|
|
331
|
+
content = request.content.map(part => ({ type: 'text', text: part.text }));
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
const attachments = this.ctx.get('attachments');
|
|
335
|
+
if (attachments === undefined)
|
|
336
|
+
throw new Error('subagent image prompt requires an attachment store');
|
|
337
|
+
content = await attachments.admitPromptContent(request.content);
|
|
338
|
+
}
|
|
339
|
+
return {
|
|
340
|
+
messageId: await this[deliverSubagentPrompt](parent, childSessionId, content, source, signal, delivery),
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
catch (error) {
|
|
344
|
+
return rejectPrompt(error, childSessionId, signal);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Remote face of {@link interrupt} under one durable parent address. No
|
|
349
|
+
* catalog, history, persistence, or parent Agent lookup runs: the core
|
|
350
|
+
* primitive alone authorizes the address against the live Activation, which
|
|
351
|
+
* is what keeps a live child interruptible while its parent Agent is offline.
|
|
352
|
+
* Absent, idle, and already-completed targets are accepted no-ops there.
|
|
353
|
+
* @param childSessionId - durable child session id to interrupt.
|
|
354
|
+
* @param parentSessionId - durable direct parent whose authority is claimed.
|
|
355
|
+
* @param mode - required continuable-address discriminator.
|
|
356
|
+
* @returns acknowledgement that the cancel signal was admitted, not that the target is quiescent.
|
|
357
|
+
* @throws {RemoteError} `gateway/bad-request` for an empty id,
|
|
358
|
+
* `subagent/unauthorized` when the address does not own the live target,
|
|
359
|
+
* otherwise `gateway/internal`.
|
|
360
|
+
*/
|
|
361
|
+
interruptByParent(childSessionId, parentSessionId, mode) {
|
|
362
|
+
validateControlRequest('subagent.interrupt', { childSessionId, parentSessionId, mode });
|
|
363
|
+
try {
|
|
364
|
+
this.interrupt(childSessionId, { kind: 'user', parentSessionId });
|
|
365
|
+
}
|
|
366
|
+
catch (error) {
|
|
367
|
+
if (error instanceof SubagentError && error.code === 'UNAUTHORIZED') {
|
|
368
|
+
throw new RemoteError('subagent/unauthorized', 'subagent does not belong to this parent', { childSessionId }, { cause: error });
|
|
369
|
+
}
|
|
370
|
+
throw new RemoteError('gateway/internal', 'subagent interrupt failed', {}, { cause: error });
|
|
371
|
+
}
|
|
372
|
+
return { accepted: true };
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Register a provider under its name. Registration is effect-scoped and HMR
|
|
376
|
+
* safe; removing a provider blocks new starts but does not revoke runs that
|
|
377
|
+
* were already returned to their holders.
|
|
378
|
+
* @param provider - the trusted provider implementation.
|
|
379
|
+
* @returns the exact Cordis effect disposer.
|
|
380
|
+
*/
|
|
381
|
+
registerProvider(provider) {
|
|
382
|
+
const name = provider.name;
|
|
383
|
+
// oxlint-disable-next-line typescript/no-misused-promises -- synchronous disposer
|
|
384
|
+
return this.ctx.effect(function* () {
|
|
385
|
+
if (this.providers.has(name)) {
|
|
386
|
+
throw new SubagentError(`a subagent provider named "${name}" is already registered`, 'DUPLICATE_PROVIDER');
|
|
387
|
+
}
|
|
388
|
+
this.providers.set(name, provider);
|
|
389
|
+
yield () => {
|
|
390
|
+
this.providers.delete(name);
|
|
391
|
+
this.emitLifecycle('subagent/provider-removed', name);
|
|
392
|
+
};
|
|
393
|
+
// A throwing added-listener unwinds the yielded rollback, matching the
|
|
394
|
+
// repository's fail-loud registration semantics.
|
|
395
|
+
this.ctx.emit('subagent/provider-added', provider);
|
|
396
|
+
}.bind(this), 'subagents.registerProvider()');
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Look up a provider by name.
|
|
400
|
+
* @param name - the provider name.
|
|
401
|
+
* @returns the provider, or undefined when absent.
|
|
402
|
+
*/
|
|
403
|
+
getProvider(name) {
|
|
404
|
+
return this.providers.get(name);
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* List registered provider names in insertion order.
|
|
408
|
+
* @returns the registered names.
|
|
409
|
+
*/
|
|
410
|
+
list() {
|
|
411
|
+
return [...this.providers.keys()];
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Establish a published child on the named provider. Capability and semantic
|
|
415
|
+
* checks run before delegation. Provider ownership lasts until its promise
|
|
416
|
+
* fulfills; a rejection therefore has no run for the caller to dispose and
|
|
417
|
+
* emits no run lifecycle events. Post-publication turn and infrastructure
|
|
418
|
+
* failures settle through the returned run.
|
|
419
|
+
* A catalog append failure disposes the run and handles its result rejection;
|
|
420
|
+
* the caller receives the catalog error even if disposal also fails.
|
|
421
|
+
* @param name - the provider to use.
|
|
422
|
+
* @param request - child label, prompt, parent, signal, and optional capabilities.
|
|
423
|
+
* @returns the published holder-owned run.
|
|
424
|
+
*/
|
|
425
|
+
async start(name, request) {
|
|
426
|
+
const provider = this.expectProvider(name);
|
|
427
|
+
this.assertCapabilities(provider, request);
|
|
428
|
+
assertSubagentMaxDepth(request.maxDepth);
|
|
429
|
+
if (request.outputSchema !== undefined)
|
|
430
|
+
assertObjectJsonSchema(request.outputSchema);
|
|
431
|
+
const descriptor = snapshotSubagentDescriptor({
|
|
432
|
+
mode: 'one-shot',
|
|
433
|
+
provider: name,
|
|
434
|
+
...request.label !== undefined ? { label: request.label } : {},
|
|
435
|
+
});
|
|
436
|
+
const resolved = { ...request, descriptor };
|
|
437
|
+
const run = await provider.start(resolved);
|
|
438
|
+
const child = run.localAgent?.session;
|
|
439
|
+
if (child !== undefined) {
|
|
440
|
+
try {
|
|
441
|
+
establishCatalogChild(request.parent.session, child.header, descriptor);
|
|
442
|
+
}
|
|
443
|
+
catch (error) {
|
|
444
|
+
// No caller receives this run; the catalog error owns the failed start.
|
|
445
|
+
void run.result.catch(() => undefined);
|
|
446
|
+
try {
|
|
447
|
+
await run.dispose();
|
|
448
|
+
}
|
|
449
|
+
catch (cleanupError) {
|
|
450
|
+
this.ctx.logger.warn(`subagent: disposal after catalog append failure also failed: ${String(cleanupError)}`);
|
|
451
|
+
}
|
|
452
|
+
throw error;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
return observeRun(this.emitLifecycle, name, request.parent, run);
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Resolve one provider's detached continuable-creation contribution. Method
|
|
459
|
+
* presence on the provider IS the capability, so a provider without it is
|
|
460
|
+
* rejected before the manager reserves any child resources.
|
|
461
|
+
*/
|
|
462
|
+
async prepareContinuable(name, request) {
|
|
463
|
+
const provider = this.expectProvider(name);
|
|
464
|
+
if (provider.prepareContinuable === undefined) {
|
|
465
|
+
throw new SubagentError(`subagent provider "${provider.name}" does not support continuable children `
|
|
466
|
+
+ '(no prepareContinuable capability)', 'UNSUPPORTED_CAPABILITY');
|
|
467
|
+
}
|
|
468
|
+
return provider.prepareContinuable(request);
|
|
469
|
+
}
|
|
470
|
+
/** Look up a provider for dispatch or fail loud. */
|
|
471
|
+
expectProvider(name) {
|
|
472
|
+
const provider = this.providers.get(name);
|
|
473
|
+
if (provider === undefined) {
|
|
474
|
+
throw new SubagentError(`no subagent provider registered for "${name}"`, 'NO_PROVIDER');
|
|
475
|
+
}
|
|
476
|
+
return provider;
|
|
477
|
+
}
|
|
478
|
+
/** Resolve the optional continuable-subagent manager or fail loud. */
|
|
479
|
+
requireContinuations() {
|
|
480
|
+
if (this.continuations === undefined) {
|
|
481
|
+
throw new SubagentError('continuable subagents require the agents service', 'CONTINUATION_UNAVAILABLE');
|
|
482
|
+
}
|
|
483
|
+
return this.continuations;
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Build the lifecycle observer for one continuable Activation's residency
|
|
487
|
+
* epoch, so the manager publishes its edges without owning event dispatch.
|
|
488
|
+
*/
|
|
489
|
+
observeActivation(provider, childId, parent) {
|
|
490
|
+
return createActivationObserver(this.emitLifecycle, provider, childId, parent);
|
|
491
|
+
}
|
|
492
|
+
/** Reject the first requested capability that the provider lacks. */
|
|
493
|
+
assertCapabilities(provider, request) {
|
|
494
|
+
const needs = [
|
|
495
|
+
{ when: request.agentOptions !== undefined, cap: 'agentOptions' },
|
|
496
|
+
{ when: request.outputSchema !== undefined, cap: 'outputSchema' },
|
|
497
|
+
{ when: request.maxDepth !== undefined, cap: 'depthLimit' },
|
|
498
|
+
{ when: request.toolFilter !== undefined, cap: 'toolFilter' },
|
|
499
|
+
{ when: request.persona !== undefined, cap: 'persona' },
|
|
500
|
+
];
|
|
501
|
+
for (const { when, cap } of needs) {
|
|
502
|
+
if (when && !provider.capabilities[cap]) {
|
|
503
|
+
throw new SubagentError(`subagent provider "${provider.name}" does not support the "${cap}" capability`, 'UNSUPPORTED_CAPABILITY');
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
})();
|
|
509
|
+
export { SubagentRuntime };
|
|
510
|
+
export default SubagentRuntime;
|
|
511
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Continuation integration markers and host adapters outside the public
|
|
3
|
+
* Service Definition and model-facing Agent messaging contract.
|
|
4
|
+
* @module @deepseek-ai/dsh-subagent/internal
|
|
5
|
+
*/
|
|
6
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
7
|
+
import type { ContentBlock, MessageId, MessageSource } from '@deepseek-ai/dsh-llm';
|
|
8
|
+
import type { SessionId } from '@deepseek-ai/dsh-session';
|
|
9
|
+
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
10
|
+
import type SubagentRuntime from './index.ts';
|
|
11
|
+
import type { SubagentDelivery } from './inbox.ts';
|
|
12
|
+
/** Process-stable identity carried only by the standard adjacent-Agent messaging tool. */
|
|
13
|
+
export declare const adjacentAgentSendMessageTool: unique symbol;
|
|
14
|
+
/**
|
|
15
|
+
* Mark the standard adjacent-Agent messaging tool without changing its model-visible schema.
|
|
16
|
+
* @param definition - the standard `send_message` definition.
|
|
17
|
+
* @returns the same definition with its internal identity installed.
|
|
18
|
+
*/
|
|
19
|
+
export declare function markAdjacentAgentSendMessageTool(definition: ToolDefinition): ToolDefinition;
|
|
20
|
+
/**
|
|
21
|
+
* Test whether one visible definition is the standard adjacent-Agent messaging tool.
|
|
22
|
+
* @param definition - the scope-resolved `send_message` candidate.
|
|
23
|
+
* @returns whether the definition carries the internal standard-tool identity.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isAdjacentAgentSendMessageTool(definition: ToolDefinition | undefined): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Process-stable symbol-keyed host delivery shared by the bundled runtime
|
|
28
|
+
* entry and this unbundled internal subpath.
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export declare const deliverSubagentPrompt: unique symbol;
|
|
32
|
+
/** Runtime face required by the host-only prompt adapters. */
|
|
33
|
+
export interface HostPromptDeliverer {
|
|
34
|
+
[deliverSubagentPrompt](parent: Agent, childId: SessionId, content: ContentBlock[], source: MessageSource, signal: AbortSignal, delivery: SubagentDelivery): Promise<MessageId>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Queue one host-protocol message without exposing another Service operation.
|
|
38
|
+
* @param runtime - subagent runtime owning continuation residency.
|
|
39
|
+
* @param parent - exact live direct parent authorizing delivery.
|
|
40
|
+
* @param childId - durable direct-child session id.
|
|
41
|
+
* @param content - host-authored content to deliver.
|
|
42
|
+
* @param source - durable host-protocol provenance.
|
|
43
|
+
* @param signal - caller cancellation before inbox acceptance.
|
|
44
|
+
* @returns the accepted message's inbox id.
|
|
45
|
+
*/
|
|
46
|
+
export declare function queueHostSubagentPrompt(runtime: SubagentRuntime, parent: Agent, childId: SessionId, content: ContentBlock[], source: MessageSource, signal: AbortSignal): Promise<MessageId>;
|
|
47
|
+
/**
|
|
48
|
+
* Steer one host-protocol message without exposing another Service operation.
|
|
49
|
+
* @param runtime - subagent runtime owning continuation residency.
|
|
50
|
+
* @param parent - exact live direct parent authorizing delivery.
|
|
51
|
+
* @param childId - durable direct-child session id.
|
|
52
|
+
* @param content - host-authored content to deliver.
|
|
53
|
+
* @param source - durable host-protocol provenance.
|
|
54
|
+
* @param signal - caller cancellation before inbox acceptance.
|
|
55
|
+
* @returns the accepted message's inbox id.
|
|
56
|
+
*/
|
|
57
|
+
export declare function steerHostSubagentPrompt(runtime: SubagentRuntime, parent: Agent, childId: SessionId, content: ContentBlock[], source: MessageSource, signal: AbortSignal): Promise<MessageId>;
|
|
58
|
+
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Continuation integration markers and host adapters outside the public
|
|
3
|
+
* Service Definition and model-facing Agent messaging contract.
|
|
4
|
+
* @module @deepseek-ai/dsh-subagent/internal
|
|
5
|
+
*/
|
|
6
|
+
/** Process-stable identity carried only by the standard adjacent-Agent messaging tool. */
|
|
7
|
+
export const adjacentAgentSendMessageTool = Symbol.for('dsh.subagent.adjacentAgentSendMessageTool');
|
|
8
|
+
/**
|
|
9
|
+
* Mark the standard adjacent-Agent messaging tool without changing its model-visible schema.
|
|
10
|
+
* @param definition - the standard `send_message` definition.
|
|
11
|
+
* @returns the same definition with its internal identity installed.
|
|
12
|
+
*/
|
|
13
|
+
export function markAdjacentAgentSendMessageTool(definition) {
|
|
14
|
+
Object.defineProperty(definition, adjacentAgentSendMessageTool, { value: true });
|
|
15
|
+
return definition;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Test whether one visible definition is the standard adjacent-Agent messaging tool.
|
|
19
|
+
* @param definition - the scope-resolved `send_message` candidate.
|
|
20
|
+
* @returns whether the definition carries the internal standard-tool identity.
|
|
21
|
+
*/
|
|
22
|
+
export function isAdjacentAgentSendMessageTool(definition) {
|
|
23
|
+
return definition !== undefined
|
|
24
|
+
&& definition[adjacentAgentSendMessageTool] === true;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Process-stable symbol-keyed host delivery shared by the bundled runtime
|
|
28
|
+
* entry and this unbundled internal subpath.
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export const deliverSubagentPrompt = Symbol.for('dsh.subagent.deliverPrompt');
|
|
32
|
+
/**
|
|
33
|
+
* Queue one host-protocol message without exposing another Service operation.
|
|
34
|
+
* @param runtime - subagent runtime owning continuation residency.
|
|
35
|
+
* @param parent - exact live direct parent authorizing delivery.
|
|
36
|
+
* @param childId - durable direct-child session id.
|
|
37
|
+
* @param content - host-authored content to deliver.
|
|
38
|
+
* @param source - durable host-protocol provenance.
|
|
39
|
+
* @param signal - caller cancellation before inbox acceptance.
|
|
40
|
+
* @returns the accepted message's inbox id.
|
|
41
|
+
*/
|
|
42
|
+
export function queueHostSubagentPrompt(runtime, parent, childId, content, source, signal) {
|
|
43
|
+
return runtime[deliverSubagentPrompt](parent, childId, content, source, signal, 'queue');
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Steer one host-protocol message without exposing another Service operation.
|
|
47
|
+
* @param runtime - subagent runtime owning continuation residency.
|
|
48
|
+
* @param parent - exact live direct parent authorizing delivery.
|
|
49
|
+
* @param childId - durable direct-child session id.
|
|
50
|
+
* @param content - host-authored content to deliver.
|
|
51
|
+
* @param source - durable host-protocol provenance.
|
|
52
|
+
* @param signal - caller cancellation before inbox acceptance.
|
|
53
|
+
* @returns the accepted message's inbox id.
|
|
54
|
+
*/
|
|
55
|
+
export function steerHostSubagentPrompt(runtime, parent, childId, content, source, signal) {
|
|
56
|
+
return runtime[deliverSubagentPrompt](parent, childId, content, source, signal, 'steer');
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Package-owned subagent registry and lifecycle invariants. @module @deepseek-ai/dsh-subagent/invariant */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
/** Cordis companion plugin name. */
|
|
4
|
+
export declare const name = "subagent-invariant";
|
|
5
|
+
/** Service required before the companion can reserve package ownership. */
|
|
6
|
+
export declare const inject: string[];
|
|
7
|
+
/**
|
|
8
|
+
* Register the subagent invariant companion.
|
|
9
|
+
* @param ctx - Cordis context carrying the invariant service.
|
|
10
|
+
* @returns the installed registration's disposer after setup succeeds.
|
|
11
|
+
*/
|
|
12
|
+
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
13
|
+
//# sourceMappingURL=invariant.d.ts.map
|