@deepseek-ai/dsh-subagent-in-process-driver 0.1.2-alpha.2 → 0.1.2-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/lib/index.js +5 -3
- package/lib/types/index.d.ts +1 -1
- package/package.json +23 -29
- package/lib/invariant.js +0 -23
- package/lib/types/invariant.d.ts +0 -16
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/subagent/subagent-in-process-driver/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 7c8e0b896637d6b5afd1de628db56d1f5224486d
|
|
6
|
+
README.zh.md: f37cfe3e3a15697f4286a40ab203fa8ac87746f0
|
package/README.md
CHANGED
|
@@ -73,7 +73,7 @@ The required request signal covers both startup and the live run. Before publica
|
|
|
73
73
|
|---|---|
|
|
74
74
|
| [`src/index.ts`](src/index.ts) | Run driver: creation, one-turn drive, result reading, disposal |
|
|
75
75
|
| [`src/structured.ts`](src/structured.ts) | Structured-output runtime: capture tool, prompt section, guard, commit |
|
|
76
|
-
|
|
|
76
|
+
| — | No runtime invariant companion is published; this package exposes no independent event sequence or mutable data relation beyond contracts enforced at its owning seam. |
|
|
77
77
|
|
|
78
78
|
</details>
|
|
79
79
|
|
package/README.zh.md
CHANGED
|
@@ -73,7 +73,7 @@ kind: "package-library"
|
|
|
73
73
|
|---|---|
|
|
74
74
|
| [`src/index.ts`](src/index.ts) | 运行驱动器:创建、单轮驱动、结果读取、dispose |
|
|
75
75
|
| [`src/structured.ts`](src/structured.ts) | 结构化输出运行时:捕获工具、提示词段、防护、提交 |
|
|
76
|
-
|
|
|
76
|
+
| — | 不发布运行时不变式伴生入口;本包没有独立事件序列或可变数据关系,相关约定在所属 seam 强制执行。 |
|
|
77
77
|
|
|
78
78
|
</details>
|
|
79
79
|
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { brandString } from "@deepseek-ai/dsh-brand";
|
|
3
3
|
import { foldConsumedWork } from "@deepseek-ai/dsh-agent";
|
|
4
|
+
import { SessionLogOffset } from "@deepseek-ai/dsh-session";
|
|
4
5
|
import { createUserMessage } from "@deepseek-ai/dsh-llm";
|
|
5
6
|
import { appendDelegatedPolicyOverrides, applyChildComposition, assertSubagentMaxDepth, captureDelegatedPolicyOverrides, childSessionMeta, finalAssistantOutput, resolveChildAgentOptions, resolveChildDepth } from "@deepseek-ai/dsh-subagent";
|
|
6
7
|
import { ToolArgsError, validateJsonSchemaValue } from "@deepseek-ai/dsh-tools";
|
|
@@ -164,7 +165,7 @@ async function startInProcessRun(request, options) {
|
|
|
164
165
|
const childDepth = resolveChildDepth(parent, request.maxDepth);
|
|
165
166
|
const childId = brandString(randomUUID());
|
|
166
167
|
const seed = options.seed;
|
|
167
|
-
const activationBoundary = seed?.length ?? 0;
|
|
168
|
+
const activationBoundary = SessionLogOffset(seed?.length ?? 0);
|
|
168
169
|
const inherited = captureDelegatedPolicyOverrides(parent);
|
|
169
170
|
let structured;
|
|
170
171
|
const setup = (childCtx) => {
|
|
@@ -178,8 +179,9 @@ async function startInProcessRun(request, options) {
|
|
|
178
179
|
};
|
|
179
180
|
return drivePublishedRun(await parent.ctx.agents.create({
|
|
180
181
|
sessionId: childId,
|
|
181
|
-
meta: childSessionMeta(parent, childDepth,
|
|
182
|
+
meta: childSessionMeta(parent, childDepth, seed !== void 0),
|
|
182
183
|
...seed !== void 0 ? { seed } : {},
|
|
184
|
+
...seed === void 0 ? {} : { inheritedEventCount: activationBoundary },
|
|
183
185
|
agentOptions: resolveChildAgentOptions(parent, request.agentOptions, childDepth),
|
|
184
186
|
signal: request.signal,
|
|
185
187
|
setup
|
|
@@ -226,7 +228,7 @@ function drivePublishedRun(handle, signal, prompt, childId, boundary, structured
|
|
|
226
228
|
}
|
|
227
229
|
/** Read one settled child's result from events after its activation boundary. */
|
|
228
230
|
function readResult(child, boundary, cancelled, structured) {
|
|
229
|
-
const own = child.session.
|
|
231
|
+
const own = child.session.snapshotEvents(boundary);
|
|
230
232
|
const lastEnd = foldConsumedWork(own).end;
|
|
231
233
|
const output = finalAssistantOutput(own) ?? [];
|
|
232
234
|
const recorded = toStopReason(lastEnd?.data.reason);
|
package/lib/types/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export { STRUCTURED_OUTPUT_TOOL, STRUCTURED_OUTPUT_INSTRUCTION, } from './struct
|
|
|
16
16
|
/** Extra inputs the spawn and fork providers supply to the shared driver. */
|
|
17
17
|
export interface InProcessRunOptions {
|
|
18
18
|
/** Completed-turn seed for fork, or undefined for a fresh spawn. */
|
|
19
|
-
readonly seed?: SessionEvent[];
|
|
19
|
+
readonly seed?: readonly SessionEvent[];
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Establish and drive one in-process one-shot child. Fulfillment means the agent
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-subagent-in-process-driver",
|
|
3
3
|
"description": "Shared in-process subagent run driver: drives a child agent on ctx.agents (used by the spawn and fork backends)",
|
|
4
|
-
"version": "0.1.2-alpha.
|
|
4
|
+
"version": "0.1.2-alpha.4",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -18,50 +18,44 @@
|
|
|
18
18
|
"types": "./lib/types/index.d.ts",
|
|
19
19
|
"default": "./lib/index.js"
|
|
20
20
|
},
|
|
21
|
-
"./invariant": {
|
|
22
|
-
"types": "./lib/types/invariant.d.ts",
|
|
23
|
-
"default": "./lib/invariant.js"
|
|
24
|
-
},
|
|
25
21
|
"./src/*": "./src/*",
|
|
26
22
|
"./package.json": "./package.json"
|
|
27
23
|
},
|
|
28
24
|
"files": [
|
|
29
25
|
"lib/index.js",
|
|
30
|
-
"lib/invariant.js",
|
|
31
26
|
"lib/types/**/*.d.ts"
|
|
32
27
|
],
|
|
33
28
|
"license": "MIT",
|
|
34
29
|
"peerDependencies": {
|
|
35
|
-
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.2",
|
|
36
|
-
"@deepseek-ai/dsh-llm": "^0.1.2-alpha.2",
|
|
37
|
-
"@deepseek-ai/dsh-session": "^0.1.2-alpha.2",
|
|
38
|
-
"@deepseek-ai/dsh-agent": "^0.1.2-alpha.2",
|
|
39
|
-
"@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.2",
|
|
40
|
-
"@deepseek-ai/dsh-tools": "^0.1.2-alpha.2",
|
|
41
30
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
42
|
-
"@deepseek-ai/dsh-
|
|
31
|
+
"@deepseek-ai/dsh-llm": "^0.1.2-alpha.4",
|
|
32
|
+
"@deepseek-ai/dsh-agent": "^0.1.2-alpha.4",
|
|
33
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.4",
|
|
34
|
+
"@deepseek-ai/dsh-subagent": "^0.1.2-alpha.4",
|
|
35
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.4",
|
|
36
|
+
"@deepseek-ai/dsh-tools": "^0.1.2-alpha.4"
|
|
43
37
|
},
|
|
44
38
|
"devDependencies": {
|
|
45
39
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
46
40
|
"@deepseek-ai/cordis-plugin-include": "^1.0.7",
|
|
47
41
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
48
|
-
"@deepseek-ai/dsh-agent": "^0.1.2-alpha.
|
|
49
|
-
"@deepseek-ai/dsh-agent-loop": "^0.1.2-alpha.
|
|
50
|
-
"@deepseek-ai/dsh-agent-
|
|
51
|
-
"@deepseek-ai/dsh-
|
|
52
|
-
"@deepseek-ai/dsh-
|
|
53
|
-
"@deepseek-ai/dsh-llm": "^0.1.2-alpha.
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
"@deepseek-ai/dsh-
|
|
57
|
-
"@deepseek-ai/dsh-
|
|
58
|
-
"@deepseek-ai/dsh-
|
|
59
|
-
"@deepseek-ai/dsh-
|
|
60
|
-
"@deepseek-ai/dsh-user-approval": "^0.1.2-alpha.
|
|
61
|
-
"@deepseek-ai/dsh-
|
|
62
|
-
"@deepseek-ai/dsh-
|
|
42
|
+
"@deepseek-ai/dsh-agent": "^0.1.2-alpha.4",
|
|
43
|
+
"@deepseek-ai/dsh-agent-loop": "^0.1.2-alpha.4",
|
|
44
|
+
"@deepseek-ai/dsh-agent-presets": "^0.1.2-alpha.4",
|
|
45
|
+
"@deepseek-ai/dsh-fs-sandbox": "^0.1.2-alpha.4",
|
|
46
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.4",
|
|
47
|
+
"@deepseek-ai/dsh-llm": "^0.1.2-alpha.4",
|
|
48
|
+
"@deepseek-ai/dsh-sandbox-policy": "^0.1.2-alpha.4",
|
|
49
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.4",
|
|
50
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.2-alpha.4",
|
|
51
|
+
"@deepseek-ai/dsh-subagent": "^0.1.2-alpha.4",
|
|
52
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.2-alpha.4",
|
|
53
|
+
"@deepseek-ai/dsh-tools": "^0.1.2-alpha.4",
|
|
54
|
+
"@deepseek-ai/dsh-user-approval": "^0.1.2-alpha.4",
|
|
55
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.4",
|
|
56
|
+
"@deepseek-ai/dsh-tool-fs": "^0.1.2-alpha.4"
|
|
63
57
|
},
|
|
64
58
|
"dependencies": {
|
|
65
|
-
"@deepseek-ai/dsh-brand": "^0.1.2-alpha.
|
|
59
|
+
"@deepseek-ai/dsh-brand": "^0.1.2-alpha.4"
|
|
66
60
|
}
|
|
67
61
|
}
|
package/lib/invariant.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//#region lib/types/invariant.js
|
|
2
|
-
/**
|
|
3
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-subagent-in-process-driver`.
|
|
4
|
-
* @module @deepseek-ai/dsh-subagent-in-process-driver/invariant
|
|
5
|
-
*/
|
|
6
|
-
const PACKAGE_NAME = "@deepseek-ai/dsh-subagent-in-process-driver";
|
|
7
|
-
/** Cordis companion plugin name. */
|
|
8
|
-
const name = "subagent-in-process-driver-invariant";
|
|
9
|
-
/** Service required before the companion can reserve package ownership. */
|
|
10
|
-
const inject = ["invariants"];
|
|
11
|
-
/**
|
|
12
|
-
* No runtime invariant: this package exposes no independent event sequence or mutable data relation
|
|
13
|
-
* beyond contracts enforced at its owning seam.
|
|
14
|
-
*/
|
|
15
|
-
const install = () => {};
|
|
16
|
-
/**
|
|
17
|
-
* Register this package's invariant companion.
|
|
18
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
19
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
20
|
-
*/
|
|
21
|
-
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
22
|
-
//#endregion
|
|
23
|
-
export { apply, inject, name };
|
package/lib/types/invariant.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-subagent-in-process-driver`.
|
|
3
|
-
* @module @deepseek-ai/dsh-subagent-in-process-driver/invariant
|
|
4
|
-
*/
|
|
5
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
-
/** Cordis companion plugin name. */
|
|
7
|
-
export declare const name = "subagent-in-process-driver-invariant";
|
|
8
|
-
/** Service required before the companion can reserve package ownership. */
|
|
9
|
-
export declare const inject: string[];
|
|
10
|
-
/**
|
|
11
|
-
* Register this package's invariant companion.
|
|
12
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
13
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
14
|
-
*/
|
|
15
|
-
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
16
|
-
//# sourceMappingURL=invariant.d.ts.map
|