@hy-sde-org/dsh-tool-subagent-report 0.1.2-rc.1

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/LICENSE ADDED
@@ -0,0 +1,31 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 hy-sde
4
+
5
+ This repository contains a standalone port of the DeepSeek Harness
6
+ `@deepseek-ai/dsh-tool-subagent-report` package (the child-scoped `report`
7
+ tool for continuable in-process subagents) onto its published peer
8
+ dependencies. The ported portions are distributed under the same MIT license
9
+ with their original copyright held by their respective authors:
10
+
11
+ Copyright (c) 2026 DeepSeek
12
+
13
+ See THIRD-PARTY-NOTICES.md for full provenance per module.
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ of this software and associated documentation files (the "Software"), to deal
17
+ in the Software without restriction, including without limitation the rights
18
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ copies of the Software, and to permit persons to whom the Software is
20
+ furnished to do so, subject to the following conditions:
21
+
22
+ The above copyright notice and this permission notice shall be included in all
23
+ copies or substantial portions of the Software.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # @hy-sde-org/dsh-tool-subagent-report
2
+
3
+ The child-scoped `report` tool for continuable in-process subagents on
4
+ DeepSeek Harness: it installs a child-scoped `report` tool plus the prompt
5
+ guidance that tells the child to use it. The tool and its guidance exist only
6
+ inside continuable children — roots, one-shot subagents, remote providers, and
7
+ sibling scopes never see them. Accepted reports reach the parent as ordinary
8
+ parent messages, framed as `Background subagent <child-id> reported:`.
9
+
10
+ ## Requirements
11
+
12
+ The package is a thin presentation layer over the subagent service's
13
+ **report channel**. The published `@deepseek-ai/dsh-subagent@0.1.2-rc.1`
14
+ predates that channel, so the host service must be built from the DeepSeek
15
+ Harness fork (or a standalone port carrying `registerContinuableSetup`,
16
+ `reportFrom`, and the keyed open-decisions ledger):
17
+
18
+ - `@deepseek-ai/cordis` `^4.0.2`
19
+ - `@deepseek-ai/dsh-agent` `^0.1.2-rc.1`
20
+ - `@deepseek-ai/dsh-llm` `^0.1.2-rc.1`
21
+ - `@deepseek-ai/dsh-subagent` `^0.1.2-rc.1`
22
+ - `@deepseek-ai/dsh-system-prompt` `^0.1.2-rc.1`
23
+ - `@deepseek-ai/dsh-tools` `^0.1.2-rc.1`
24
+
25
+ ## Install
26
+
27
+ ```bash
28
+ dsh plugin --profile web add @hy-sde-org/dsh-tool-subagent-report
29
+ ```
30
+
31
+ The plugin's `cordis.patch.yml` exporter mounts one host row
32
+ (`hy-sde-subagent-tool-subagent-report`); `dsh plugin add` reconciles the
33
+ profile's bundle list after installation. You can also depend on the package
34
+ directly: `npm install @hy-sde-org/dsh-tool-subagent-report`.
35
+
36
+ ## What the row does
37
+
38
+ - `hy-sde-subagent-tool-subagent-report` — `@hy-sde-org/dsh-tool-subagent-report`,
39
+ registering the child-scoped `report` tool and `tool:report` prompt section
40
+ into every continuable child's unpublished creation context. Default
41
+ delivery is `next-step` (wakes the parent to its nearest step boundary);
42
+ override per deployment with `config.reportDelivery: quiet`.
43
+
44
+ ## Config
45
+
46
+ | field | values | default |
47
+ |---|---|---|
48
+ | `reportDelivery` | `quiet` \| `next-step` | `next-step` |
49
+
50
+ `quiet` adds the framed context without waking a parked parent; `next-step`
51
+ wakes it (decision-shaped reports deliver content quietly and coalesce the
52
+ wake).
53
+
54
+ ## Development
55
+
56
+ ```bash
57
+ pnpm install
58
+ pnpm -r check # strict typecheck (tsc --noEmit)
59
+ pnpm -r test # child-scope registration + delivery suite
60
+ pnpm -r build # tsc -> dist
61
+ bash scripts/release-public.sh --check # pre-publish validation
62
+ ```
63
+
64
+ The test suite runs against the published agent-loop stack plus a local seam
65
+ implementing the fork report channel; every assertion from the upstream fork
66
+ spec is preserved.
@@ -0,0 +1,30 @@
1
+ # @hy-sde-org/dsh-tool-subagent-report — the child-scoped `report` tool for
2
+ # continuable in-process subagents.
3
+ #
4
+ # The plugin mounts as ONE plain host row. It consumes the deployment's host
5
+ # services — `subagents` (a continuable subagent service carrying the fork's
6
+ # report channel: `registerContinuableSetup` + `reportFrom` + the keyed
7
+ # open-decisions ledger), `tools`, and `systemPrompt` — so it needs no
8
+ # filesystem realm of its own.
9
+ #
10
+ # IMPORTANT: the published @deepseek-ai/dsh-subagent@0.1.2-rc.1 predates the
11
+ # fork's report channel. Mounting this row requires a subagent service built
12
+ # from the DeepSeek Harness fork (or a standalone port carrying the same
13
+ # channel). On a stock published stack the row fails at boot with a missing
14
+ # `registerContinuableSetup` service method; that is the documented
15
+ # contract, not a misconfiguration of this plugin.
16
+ #
17
+ # The row id carries the `hy-sde-` prefix to avoid clashing with any shipped
18
+ # row of the same name (a duplicate loader id fails the boot); if the
19
+ # deployment already mounts a `tool-subagent-report` row of its own, disable
20
+ # this one or drop the insert and keep the stock row.
21
+ #
22
+ # Override per deployment (e.g. quiet delivery for a parked-parent model) by
23
+ # patching the row by id:
24
+ #
25
+ # - id: hy-sde-subagent-tool-subagent-report
26
+ # config:
27
+ # reportDelivery: quiet
28
+ - insert:
29
+ - id: hy-sde-subagent-tool-subagent-report
30
+ name: '@hy-sde-org/dsh-tool-subagent-report'
@@ -0,0 +1,49 @@
1
+ /**
2
+ * The child-scoped `report` tool and its usage guidance, installed into every
3
+ * continuable in-process child's unpublished context. Roots, one-shot children,
4
+ * remote providers, and agentless executions never see the registration.
5
+ *
6
+ * Ported from `@deepseek-ai/dsh-tool-subagent-report`
7
+ * (`packages/subagent/tool-subagent-report/src/index.ts`) — MIT, see
8
+ * THIRD-PARTY-NOTICES.md. Conceptually inspired by firstmate
9
+ * (https://github.com/kunchenguid/firstmate), MIT © 2026 Kun Chen, whose
10
+ * parent-status contract drives the keyed open-decisions ledger. The
11
+ * fork-only subagent report channel is declared
12
+ * in {@link module:@hy-sde-org/dsh-tool-subagent-report/report-contract} so
13
+ * this package builds against the published `@deepseek-ai/dsh-subagent`.
14
+ *
15
+ * @module @hy-sde-org/dsh-tool-subagent-report
16
+ */
17
+ import type { Context } from '@deepseek-ai/cordis';
18
+ import z from '@deepseek-ai/schemastery';
19
+ import type { SubagentReportDelivery } from './report-contract.ts';
20
+ export declare const name = "tool-subagent-report";
21
+ export declare const inject: string[];
22
+ /** Guidance order after every per-tool section a continuable child can carry. */
23
+ /** Config: how accepted reports are scheduled on the parent. */
24
+ export interface Config {
25
+ /**
26
+ * Parent scheduling (default `next-step`). `next-step` wakes the parent and
27
+ * enters at its nearest step boundary; `quiet` adds the same context without
28
+ * waking, so a parked parent waits for another waking input.
29
+ */
30
+ reportDelivery?: SubagentReportDelivery;
31
+ }
32
+ export declare const Config: z<Config>;
33
+ /**
34
+ * Install `report` and its usage guidance into one continuable child's scope.
35
+ * Both registrations are owned by that scope and are therefore invisible to the
36
+ * child's parent and siblings.
37
+ * @param childCtx - child-scoped context receiving the tool and the guidance.
38
+ * @param ctx - service context used for delivery.
39
+ * @param delivery - resolved deployment scheduling policy.
40
+ * @returns disposer that attempts both child registrations before reporting cleanup failures.
41
+ */
42
+ export declare function installReportTool(childCtx: Context, ctx: Context, delivery: SubagentReportDelivery): () => void;
43
+ /**
44
+ * Register the continuable-child contribution.
45
+ * @param ctx - context carrying tools, the system prompt, and the subagent service.
46
+ * @param config - deployment scheduling policy.
47
+ */
48
+ export declare function apply(ctx: Context, config?: Config): void;
49
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAKxC,OAAO,KAAK,EAAyB,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAEzF,eAAO,MAAM,IAAI,yBAAyB,CAAA;AAI1C,eAAO,MAAM,MAAM,UAAyC,CAAA;AAE5D,iFAAiF;AACjF,gEAAgE;AAChE,MAAM,WAAW,MAAM;IACrB;;;;OAIG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAA;CACxC;AAED,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,MAAM,CAE3B,CAAA;AAEF;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,OAAO,EACjB,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,sBAAsB,GAC/B,MAAM,IAAI,CAwHZ;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,MAAW,GAAG,IAAI,CAM7D"}
package/dist/index.js ADDED
@@ -0,0 +1,215 @@
1
+ /**
2
+ * The child-scoped `report` tool and its usage guidance, installed into every
3
+ * continuable in-process child's unpublished context. Roots, one-shot children,
4
+ * remote providers, and agentless executions never see the registration.
5
+ *
6
+ * Ported from `@deepseek-ai/dsh-tool-subagent-report`
7
+ * (`packages/subagent/tool-subagent-report/src/index.ts`) — MIT, see
8
+ * THIRD-PARTY-NOTICES.md. Conceptually inspired by firstmate
9
+ * (https://github.com/kunchenguid/firstmate), MIT © 2026 Kun Chen, whose
10
+ * parent-status contract drives the keyed open-decisions ledger. The
11
+ * fork-only subagent report channel is declared
12
+ * in {@link module:@hy-sde-org/dsh-tool-subagent-report/report-contract} so
13
+ * this package builds against the published `@deepseek-ai/dsh-subagent`.
14
+ *
15
+ * @module @hy-sde-org/dsh-tool-subagent-report
16
+ */
17
+ import z from '@deepseek-ai/schemastery';
18
+ import { defineTool } from '@deepseek-ai/dsh-tools';
19
+ import { subagentsReport } from "./report-contract.js";
20
+ export const name = 'tool-subagent-report';
21
+ // The contribution registers only through childCtx.tools and
22
+ // childCtx.systemPrompt, but declaring both services makes Loader ordering fail
23
+ // at load instead of at the next child materialization.
24
+ export const inject = ['subagents', 'tools', 'systemPrompt'];
25
+ export const Config = z.object({
26
+ reportDelivery: z.union(['quiet', 'next-step']).default('next-step'),
27
+ });
28
+ /**
29
+ * Install `report` and its usage guidance into one continuable child's scope.
30
+ * Both registrations are owned by that scope and are therefore invisible to the
31
+ * child's parent and siblings.
32
+ * @param childCtx - child-scoped context receiving the tool and the guidance.
33
+ * @param ctx - service context used for delivery.
34
+ * @param delivery - resolved deployment scheduling policy.
35
+ * @returns disposer that attempts both child registrations before reporting cleanup failures.
36
+ */
37
+ export function installReportTool(childCtx, ctx, delivery) {
38
+ const disposeSection = childCtx.systemPrompt.section({
39
+ name: 'tool:report',
40
+ order: childCtx.systemPrompt.getSectionOrder('TOOL_REPORT'),
41
+ text: 'Deliver your result with the report tool before you finish: call it once with a self-contained '
42
+ + 'answer. The agent that started you shares your workspace but does not automatically receive your '
43
+ + 'transcript, tool output, or reasoning, so a closing remark such as "done" leaves it nothing it can '
44
+ + 'use. Report earlier as well whenever a partial finding changes what that agent should do next; '
45
+ + 'reporting never ends your turn. When you genuinely need that agent to decide something before you '
46
+ + 'continue, send status "needs-decision" (or "blocked" when you cannot proceed) together with a '
47
+ + 'short, stable `decisionKey` and an actionable `summary`; do not reopen the same key with the same '
48
+ + 'summary, and answer questions only with a later keyed report.',
49
+ });
50
+ let disposeTool;
51
+ try {
52
+ disposeTool = childCtx.tools.register(defineTool({
53
+ name: 'report',
54
+ description: 'Report selected content to the agent that started you. Call this once before you finish, with a '
55
+ + 'self-contained final result, and earlier for progress or findings that change what that agent does '
56
+ + 'next. That agent shares your workspace but does not automatically receive your transcript, tool '
57
+ + 'output, or reasoning, so finishing your work is not itself a result. Reporting does not end your '
58
+ + 'turn or finish your work, and only your direct parent receives it. A failed call may still have '
59
+ + 'arrived, so do not blindly repeat it. Use `output` alone for free-form notes; add `status` with a '
60
+ + '`decisionKey` + `summary` only when the parent must decide something before you continue '
61
+ + '(`needs-decision` = you keep working meanwhile, `blocked` = you cannot).',
62
+ parameters: {
63
+ output: {
64
+ type: 'string',
65
+ description: 'Actionable content for your parent; summarize conclusions and reference relevant shared paths.',
66
+ },
67
+ status: {
68
+ type: 'string',
69
+ enum: ['done', 'progress', 'needs-decision', 'blocked'],
70
+ description: 'Structured status of this report. `needs-decision` and `blocked` open a keyed decision for your parent.',
71
+ },
72
+ summary: {
73
+ type: 'string',
74
+ description: 'One-line actionable summary. Required together with `decisionKey` for a decision-shaped report.',
75
+ },
76
+ evidence: {
77
+ type: 'array',
78
+ items: { type: 'string' },
79
+ description: 'Optional evidence lines backing the summary.',
80
+ },
81
+ nextSteps: {
82
+ type: 'array',
83
+ items: { type: 'string' },
84
+ description: 'Optional next steps you have planned or that await the parent\'s answer.',
85
+ },
86
+ blocker: {
87
+ type: 'string',
88
+ description: 'Required (and only meaningful) when `status` is `blocked`: what stops you.',
89
+ },
90
+ decisionKey: {
91
+ type: 'string',
92
+ description: 'Stable, short key making this report an open decision; unique within your reports. The parent answers with the same key.',
93
+ },
94
+ },
95
+ output: {
96
+ schema: {
97
+ type: 'object',
98
+ additionalProperties: false,
99
+ properties: {
100
+ messageId: { type: 'string', required: true },
101
+ },
102
+ },
103
+ render: (_args, value) => [{
104
+ type: 'text',
105
+ text: `report accepted by the agent that started you as message ${value.messageId}`,
106
+ }],
107
+ },
108
+ async execute(args, exec) {
109
+ const structured = collectStructured(args);
110
+ const { report } = structured;
111
+ if ((report.status === 'needs-decision' || report.status === 'blocked')
112
+ && (report.decisionKey === undefined || report.summary === undefined)) {
113
+ throw new Error('a needs-decision or blocked report must carry both a decisionKey and a summary to be answerable');
114
+ }
115
+ const text = renderReportText(args.output, structured);
116
+ if (text.length === 0) {
117
+ throw new Error('report needs output, summary, or another structured field to say something');
118
+ }
119
+ const content = [{ type: 'text', text }];
120
+ // Scope-local resolution guarantees an Agent. The service still verifies
121
+ // its exact live Activation identity at the authority boundary.
122
+ const messageId = await subagentsReport(ctx).reportFrom(exec.agent, content, {
123
+ delivery,
124
+ signal: exec.signal,
125
+ ...(structured.hasAny ? { report: structured.report } : {}),
126
+ });
127
+ return { messageId };
128
+ },
129
+ }));
130
+ }
131
+ catch (error) {
132
+ try {
133
+ disposeSection();
134
+ }
135
+ catch (rollbackError) {
136
+ throw new AggregateError([error, rollbackError], 'failed to register the report tool and roll back its prompt guidance');
137
+ }
138
+ throw error;
139
+ }
140
+ return () => {
141
+ const failures = [];
142
+ for (const dispose of [disposeTool, disposeSection]) {
143
+ try {
144
+ dispose();
145
+ }
146
+ catch (error) {
147
+ failures.push(error);
148
+ }
149
+ }
150
+ if (failures.length > 0) {
151
+ throw new AggregateError(failures, 'failed to revoke report tool and prompt registrations');
152
+ }
153
+ };
154
+ }
155
+ /**
156
+ * Register the continuable-child contribution.
157
+ * @param ctx - context carrying tools, the system prompt, and the subagent service.
158
+ * @param config - deployment scheduling policy.
159
+ */
160
+ export function apply(ctx, config = {}) {
161
+ // Config() applies the schema default at runtime; the schemastery return
162
+ // type keeps the input's optional shape, so assert the resolved one.
163
+ const { reportDelivery } = Config(config);
164
+ subagentsReport(ctx).registerContinuableSetup(childCtx => installReportTool(childCtx, ctx, reportDelivery));
165
+ }
166
+ function collectStructured(args) {
167
+ const report = {
168
+ ...(args.status !== undefined ? { status: args.status } : {}),
169
+ ...(args.summary !== undefined ? { summary: args.summary } : {}),
170
+ ...(args.evidence !== undefined && args.evidence.length > 0 ? { evidence: args.evidence } : {}),
171
+ ...(args.nextSteps !== undefined && args.nextSteps.length > 0 ? { nextSteps: args.nextSteps } : {}),
172
+ ...(args.blocker !== undefined ? { blocker: args.blocker } : {}),
173
+ ...(args.decisionKey !== undefined ? { decisionKey: args.decisionKey } : {}),
174
+ };
175
+ const hasAny = Object.keys(report).length > 0;
176
+ return { hasAny, report };
177
+ }
178
+ const REPORT_STATUS_LABELS = {
179
+ done: 'DONE',
180
+ progress: 'PROGRESS',
181
+ 'needs-decision': 'NEEDS DECISION',
182
+ blocked: 'BLOCKED',
183
+ };
184
+ /**
185
+ * Canonical parent-facing text for one report. A plain `output`-only report is
186
+ * passed through verbatim (back-compat); structured fields render as a compact
187
+ * status block, with `output` (when also supplied) folded in as a final note.
188
+ */
189
+ function renderReportText(output, structured) {
190
+ const { report } = structured;
191
+ if (!structured.hasAny)
192
+ return output ?? '';
193
+ const parts = [];
194
+ if (report.status !== undefined) {
195
+ let line = `[${REPORT_STATUS_LABELS[report.status]}]`;
196
+ if (report.summary !== undefined)
197
+ line += ` ${report.summary}`;
198
+ parts.push(line);
199
+ }
200
+ else if (report.summary !== undefined) {
201
+ parts.push(report.summary);
202
+ }
203
+ if (report.evidence !== undefined && report.evidence.length > 0) {
204
+ parts.push(`Evidence:\n${report.evidence.map(item => `- ${item}`).join('\n')}`);
205
+ }
206
+ if (report.nextSteps !== undefined && report.nextSteps.length > 0) {
207
+ parts.push(`Next steps:\n${report.nextSteps.map((step, index) => `${index + 1}. ${step}`).join('\n')}`);
208
+ }
209
+ if (report.blocker !== undefined)
210
+ parts.push(`Blocker: ${report.blocker}`);
211
+ if (output !== undefined && output.length > 0)
212
+ parts.push(`Note: ${output}`);
213
+ return parts.join('\n\n');
214
+ }
215
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAGxC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,eAAe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AK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAC5B,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChE,KAAK,CAAC,IAAI,CAAC,cAAc,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACjF,CAAC;IACD,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,KAAK,CAAC,IAAI,CAAC,gBAAgB,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACzG,CAAC;IACD,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,YAAY,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;IAC1E,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,SAAS,MAAM,EAAE,CAAC,CAAA;IAC5E,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAC3B,CAAC"}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * The fork-only subagent report channel contract, declared locally so this
3
+ * package typechecks and builds against the PUBLISHED
4
+ * `@deepseek-ai/dsh-subagent` (0.1.2-rc.1). That published version predates
5
+ * the DeepSeek Harness fork's report channel — `registerContinuableSetup`,
6
+ * `reportFrom`, the `subagent-report` message source, and the keyed
7
+ * open-decisions ledger are fork-side extensions — so the package declares
8
+ * exactly the surface it consumes here and reads it back off `ctx.subagents`
9
+ * at runtime. A host built from the fork (or a standalone port carrying the
10
+ * same channel) provides the implementation; this package only formats and
11
+ * validates the report.
12
+ *
13
+ * Ported from `@deepseek-ai/dsh-subagent` types (`continuation.ts`,
14
+ * `types.ts`) — MIT, see THIRD-PARTY-NOTICES.md.
15
+ *
16
+ * @module @hy-sde-org/dsh-tool-subagent-report/report-contract
17
+ */
18
+ import type { Context } from '@deepseek-ai/cordis';
19
+ import type { Agent } from '@deepseek-ai/dsh-agent';
20
+ import type { ContentBlock, MessageId } from '@deepseek-ai/dsh-llm';
21
+ /** Report status vocabulary; `needs-decision`/`blocked` open a keyed record. */
22
+ export type DecisionStatus = 'done' | 'progress' | 'needs-decision' | 'blocked';
23
+ /**
24
+ * A child-reported decision that still awaits the parent's answer.
25
+ * @see SubagentReportService.listOpenDecisions
26
+ */
27
+ export interface OpenDecision {
28
+ /** Durable session id of the reporting child. */
29
+ readonly childId: string;
30
+ /** Stable, normalized decision key (unique within one child). */
31
+ readonly key: string;
32
+ /** One-line label naming the decision (currently the child's label). */
33
+ readonly label: string;
34
+ /** `needs-decision` = waiting while staying productive; `blocked` = cannot proceed. */
35
+ readonly status: 'needs-decision' | 'blocked';
36
+ /** Actionable summary of what the parent must decide. */
37
+ readonly summary: string;
38
+ /** Epoch milliseconds when the decision was opened (or last re-opened). */
39
+ readonly openedAt: number;
40
+ /** Set when wedge supervision raised the record rather than the child. */
41
+ readonly wedge?: true;
42
+ }
43
+ /**
44
+ * The structured arm of one child report, delivered alongside the free-text
45
+ * content. `status` without a `decisionKey` is advisory only; a key turns the
46
+ * report into a durable open-decision record.
47
+ */
48
+ export interface SubagentReportContent {
49
+ /** Structured report status (advisory when no `decisionKey`). */
50
+ readonly status?: DecisionStatus;
51
+ /** One-line actionable summary shown to the parent. */
52
+ readonly summary?: string;
53
+ /** Optional evidence lines backing the summary. */
54
+ readonly evidence?: readonly string[];
55
+ /** Optional next steps the child has planned or awaits. */
56
+ readonly nextSteps?: readonly string[];
57
+ /** Required (and only meaningful) when `status` is `blocked`. */
58
+ readonly blocker?: string;
59
+ /** Stable key making this report an open decision. */
60
+ readonly decisionKey?: string;
61
+ }
62
+ /**
63
+ * Parent scheduling for one accepted report. `quiet` adds the framed context
64
+ * without waking a parked parent; `next-step` wakes the parent to its nearest
65
+ * step boundary (decision-shaped reports deliver their content quietly and
66
+ * coalesce the wake).
67
+ */
68
+ export type SubagentReportDelivery = 'quiet' | 'next-step';
69
+ /** Options for one child-to-parent report delivery. */
70
+ export interface SubagentReportOptions {
71
+ /** Caller cancellation; owns the operation only until inbox acceptance. */
72
+ readonly signal: AbortSignal;
73
+ /** Resolved deployment scheduling policy. */
74
+ readonly delivery: SubagentReportDelivery;
75
+ /** The structured arm when the report carried one. */
76
+ readonly report?: SubagentReportContent;
77
+ }
78
+ /**
79
+ * The fork-only subagent report surface consumed by this package. A host
80
+ * implementing `ctx.subagents` (fork build or ported standalone service)
81
+ * supplies it; this service also owns sender authorization, parent
82
+ * resolution, send acceptance, and the durable open-decisions ledger.
83
+ */
84
+ export interface SubagentReportService {
85
+ /**
86
+ * Install one scoped contribution into every future continuable child's
87
+ * unpublished creation context.
88
+ * @param contribution - synchronous child-scope installer; returns its disposer.
89
+ * @returns an idempotent registration undo.
90
+ */
91
+ registerContinuableSetup(contribution: (childCtx: Context) => () => void): () => void;
92
+ /**
93
+ * Local seam binding: like {@link registerContinuableSetup}, but ties the
94
+ * registration's lifetime to the calling fiber through an explicit owner
95
+ * context. A traced fork service does this implicitly via caller tracing; a
96
+ * standalone seam has no tracing channel, so the binder supplies it.
97
+ * @param owner - the context (fiber) that owns this registration.
98
+ * @param contribution - synchronous child-scope installer.
99
+ * @returns an idempotent registration undo tied to the owner's lifetime.
100
+ */
101
+ registerContinuableSetupWith(owner: Context, contribution: (childCtx: Context) => () => void): () => void;
102
+ /**
103
+ * Deliver selected content from one exact live continuable child to its
104
+ * durable direct parent.
105
+ * @param child - exact live reporting child; this is the authority credential.
106
+ * @param content - selected model-facing content.
107
+ * @param options - scheduling policy and pre-acceptance cancellation.
108
+ * @returns the stable identity of the message accepted by the parent.
109
+ */
110
+ reportFrom(child: Agent, content: ContentBlock[], options: SubagentReportOptions): Promise<MessageId>;
111
+ /** The parent's currently open keyed decisions, in open order. */
112
+ listOpenDecisions(parent: Agent): OpenDecision[];
113
+ /**
114
+ * Close one open record for the exact child.
115
+ * @returns whether a record was closed.
116
+ */
117
+ resolveOpenDecision(parent: Agent, childId: string, key: string): boolean;
118
+ }
119
+ /**
120
+ * Resolve the report-channel service off a context typed by the published
121
+ * `@deepseek-ai/dsh-subagent`. The cast documents the fork-only extension
122
+ * point: the same surface name, verified by the host at the authority
123
+ * boundary. The returned facade binds registration lifetime to `ctx` so a
124
+ * plugin mounting the tool and then disposing revokes every resident
125
+ * installation immediately (the fork's traced-service equivalent).
126
+ * @param ctx - context carrying the subagent service.
127
+ * @returns the report channel implementation.
128
+ */
129
+ export declare function subagentsReport(ctx: Context): SubagentReportService;
130
+ /**
131
+ * Normalize a caller-supplied decision key: trim and collapse whitespace.
132
+ * Mirrors the host's normalization so a parent answering with the same key
133
+ * always matches.
134
+ * @param key - the raw decision key.
135
+ * @returns the normalized key.
136
+ */
137
+ export declare function normalizeDecisionKey(key: string): string;
138
+ //# sourceMappingURL=report-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-contract.d.ts","sourceRoot":"","sources":["../src/report-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEnE,gFAAgF;AAChF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,gBAAgB,GAAG,SAAS,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,CAAA;CACxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,wBAAwB,CAAC,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;IACrF;;;;;;;;OAQG;IACH,4BAA4B,CAC1B,KAAK,EAAE,OAAO,EACd,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,MAAM,IAAI,GAC9C,MAAM,IAAI,CAAA;IACb;;;;;;;OAOG;IACH,UAAU,CACR,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,YAAY,EAAE,EACvB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,SAAS,CAAC,CAAA;IACrB,kEAAkE;IAClE,iBAAiB,CAAC,MAAM,EAAE,KAAK,GAAG,YAAY,EAAE,CAAA;IAChD;;;OAGG;IACH,mBAAmB,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAC1E;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,qBAAqB,CAYnE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExD"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * The fork-only subagent report channel contract, declared locally so this
3
+ * package typechecks and builds against the PUBLISHED
4
+ * `@deepseek-ai/dsh-subagent` (0.1.2-rc.1). That published version predates
5
+ * the DeepSeek Harness fork's report channel — `registerContinuableSetup`,
6
+ * `reportFrom`, the `subagent-report` message source, and the keyed
7
+ * open-decisions ledger are fork-side extensions — so the package declares
8
+ * exactly the surface it consumes here and reads it back off `ctx.subagents`
9
+ * at runtime. A host built from the fork (or a standalone port carrying the
10
+ * same channel) provides the implementation; this package only formats and
11
+ * validates the report.
12
+ *
13
+ * Ported from `@deepseek-ai/dsh-subagent` types (`continuation.ts`,
14
+ * `types.ts`) — MIT, see THIRD-PARTY-NOTICES.md.
15
+ *
16
+ * @module @hy-sde-org/dsh-tool-subagent-report/report-contract
17
+ */
18
+ /**
19
+ * Resolve the report-channel service off a context typed by the published
20
+ * `@deepseek-ai/dsh-subagent`. The cast documents the fork-only extension
21
+ * point: the same surface name, verified by the host at the authority
22
+ * boundary. The returned facade binds registration lifetime to `ctx` so a
23
+ * plugin mounting the tool and then disposing revokes every resident
24
+ * installation immediately (the fork's traced-service equivalent).
25
+ * @param ctx - context carrying the subagent service.
26
+ * @returns the report channel implementation.
27
+ */
28
+ export function subagentsReport(ctx) {
29
+ // Read the channel back off `ctx.subagents` without depending on the
30
+ // published dsh-subagent Context augmentation (which lacks the channel);
31
+ // the intersection documents the fork-only extension point.
32
+ const service = ctx.subagents;
33
+ return {
34
+ registerContinuableSetup: (contribution) => service.registerContinuableSetupWith(ctx, contribution),
35
+ registerContinuableSetupWith: (owner, contribution) => service.registerContinuableSetupWith(owner, contribution),
36
+ reportFrom: (child, content, options) => service.reportFrom(child, content, options),
37
+ listOpenDecisions: (parent) => service.listOpenDecisions(parent),
38
+ resolveOpenDecision: (parent, childId, key) => service.resolveOpenDecision(parent, childId, key),
39
+ };
40
+ }
41
+ /**
42
+ * Normalize a caller-supplied decision key: trim and collapse whitespace.
43
+ * Mirrors the host's normalization so a parent answering with the same key
44
+ * always matches.
45
+ * @param key - the raw decision key.
46
+ * @returns the normalized key.
47
+ */
48
+ export function normalizeDecisionKey(key) {
49
+ return key.trim().replace(/\s+/g, ' ');
50
+ }
51
+ //# sourceMappingURL=report-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-contract.js","sourceRoot":"","sources":["../src/report-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAqHH;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,GAAY;IAC1C,qEAAqE;IACrE,yEAAyE;IACzE,4DAA4D;IAC5D,MAAM,OAAO,GAAI,GAA+D,CAAC,SAAS,CAAA;IAC1F,OAAO;QACL,wBAAwB,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,OAAO,CAAC,4BAA4B,CAAC,GAAG,EAAE,YAAY,CAAC;QACnG,4BAA4B,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,CAAC,OAAO,CAAC,4BAA4B,CAAC,KAAK,EAAE,YAAY,CAAC;QAChH,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC;QACpF,iBAAiB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC;QAChE,mBAAmB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC;KACjG,CAAA;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AACxC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "@hy-sde-org/dsh-tool-subagent-report",
3
+ "version": "0.1.2-rc.1",
4
+ "description": "The child-scoped report tool for continuable in-process subagents on DeepSeek Harness: installs `report` plus its usage guidance into every continuable child scope, so findings reach the parent before the child finishes.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ },
13
+ "./cordis.patch.yml": "./cordis.patch.yml",
14
+ "./package.json": "./package.json"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "cordis.patch.yml",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "engines": {
23
+ "node": ">=22.19.0"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/hy-sde/dsh-tool-subagent-report.git"
31
+ },
32
+ "license": "MIT",
33
+ "dsh": {
34
+ "bundle": {
35
+ "patch": "./cordis.patch.yml"
36
+ }
37
+ },
38
+ "dependencies": {
39
+ "@deepseek-ai/schemastery": "3.18.2"
40
+ },
41
+ "peerDependencies": {
42
+ "@deepseek-ai/cordis": "^4.0.2",
43
+ "@deepseek-ai/dsh-agent": "^0.1.2-rc.1",
44
+ "@deepseek-ai/dsh-llm": "^0.1.2-rc.1",
45
+ "@deepseek-ai/dsh-subagent": "^0.1.2-rc.1",
46
+ "@deepseek-ai/dsh-system-prompt": "^0.1.2-rc.1",
47
+ "@deepseek-ai/dsh-tools": "^0.1.2-rc.1"
48
+ },
49
+ "devDependencies": {
50
+ "@deepseek-ai/cordis": "^4.0.2",
51
+ "@deepseek-ai/dsh-agent": "^0.1.2-rc.1",
52
+ "@deepseek-ai/dsh-agent-loop": "^0.1.2-rc.1",
53
+ "@deepseek-ai/dsh-agent-loop-testkit": "^0.1.2-rc.1",
54
+ "@deepseek-ai/dsh-llm": "^0.1.2-rc.1",
55
+ "@deepseek-ai/dsh-session": "^0.1.2-rc.1",
56
+ "@deepseek-ai/dsh-session-persistence": "^0.1.2-rc.1",
57
+ "@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.2-rc.1",
58
+ "@deepseek-ai/dsh-session-projection": "^0.1.2-rc.1",
59
+ "@deepseek-ai/dsh-subagent": "^0.1.2-rc.1",
60
+ "@deepseek-ai/dsh-system-prompt": "^0.1.2-rc.1",
61
+ "@deepseek-ai/dsh-tool-subagent-control": "^0.1.2-rc.1",
62
+ "@deepseek-ai/dsh-tools": "^0.1.2-rc.1",
63
+ "@deepseek-ai/schemastery": "3.18.2",
64
+ "@types/node": "^24.13.3",
65
+ "typescript": "^5.9.3",
66
+ "vitest": "^3.2.7"
67
+ },
68
+ "keywords": [
69
+ "deepseek",
70
+ "agent",
71
+ "harness",
72
+ "dsh-plugin",
73
+ "subagent",
74
+ "report",
75
+ "continuable",
76
+ "decision"
77
+ ],
78
+ "scripts": {
79
+ "clean": "rm -rf dist",
80
+ "build": "tsc -p tsconfig.build.json",
81
+ "check": "tsc -p tsconfig.json --noEmit",
82
+ "test": "vitest run"
83
+ }
84
+ }