@dsh-cc/subagent-task 0.6.1 → 0.6.2
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 +3 -3
- package/lib/one-shot-ledger.d.ts +5 -0
- package/lib/one-shot-ledger.d.ts.map +1 -1
- package/lib/one-shot-ledger.js +40 -1
- package/lib/one-shot-ledger.js.map +1 -1
- package/lib/one-shot-notice.d.ts +13 -10
- package/lib/one-shot-notice.d.ts.map +1 -1
- package/lib/one-shot-notice.js +31 -16
- package/lib/one-shot-notice.js.map +1 -1
- package/package.json +13 -13
package/README.i18n.yaml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
|
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
|
-
# pnpm
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
4
|
+
# pnpm check:readme --write
|
|
5
|
+
README.md: d141a9d39756bd366011bb44f00436931504b194
|
|
6
|
+
README.zh.md: 5592ec30d340dc25f2c158f36fb1782c0da4b9c4
|
package/lib/one-shot-ledger.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ export interface LedgerChildSnapshot {
|
|
|
55
55
|
header?: {
|
|
56
56
|
parentSession?: unknown;
|
|
57
57
|
};
|
|
58
|
+
/** Legacy event array (removed at the harness 0.1.2-rc.1 line — probed last). */
|
|
58
59
|
events?: readonly {
|
|
59
60
|
type?: string;
|
|
60
61
|
data?: {
|
|
@@ -62,6 +63,10 @@ export interface LedgerChildSnapshot {
|
|
|
62
63
|
mode?: unknown;
|
|
63
64
|
};
|
|
64
65
|
}[];
|
|
66
|
+
/** Preferred probe: the session's own (non-inherited) event log. */
|
|
67
|
+
ownEvents?: () => readonly unknown[];
|
|
68
|
+
/** Fallback probe: the full snapshot event log. */
|
|
69
|
+
snapshotEvents?: () => readonly unknown[];
|
|
65
70
|
};
|
|
66
71
|
}
|
|
67
72
|
/** Duck-typed `ctx.agents` accessor for child-session parentage probes. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"one-shot-ledger.d.ts","sourceRoot":"","sources":["../src/one-shot-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAS5C,CAAA;AAED,iCAAiC;AACjC,MAAM,WAAW,gBAAgB;IAC/B,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAA;IACb,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAA;IACV,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAA;IAChB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAA;IACjB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,0GAA0G;IAC1G,QAAQ,EAAE,OAAO,CAAA;IACjB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,+EAA+E;AAC/E,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE;QACR,EAAE,CAAC,EAAE,OAAO,CAAA;QACZ,MAAM,CAAC,EAAE;YAAE,aAAa,CAAC,EAAE,OAAO,CAAA;SAAE,CAAA;QACpC,MAAM,CAAC,EAAE,SAAS;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE;gBAAE,KAAK,CAAC,EAAE,OAAO,CAAC;gBAAC,IAAI,CAAC,EAAE,OAAO,CAAA;aAAE,CAAA;SAAE,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"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AAA;CACF;AAED,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAAA;CAClD;AAED,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAA;CAC1F;AAED,MAAM,WAAW,iBAAiB;IAChC,sDAAsD;IACtD,GAAG,EAAE,cAAc,CAAA;IACnB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACjC,0CAA0C;IAC1C,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;IAClB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,eAAO,MAAM,oBAAoB,QAAa,CAAA;AAC9C,eAAO,MAAM,qBAAqB,QAAc,CAAA;AAkChD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG;IAC5D,IAAI,IAAI,SAAS,gBAAgB,EAAE,CAAA;IACnC,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,gBAAgB,EAAE,CAAA;IACxD,OAAO,IAAI,IAAI,CAAA;CAChB,CA4EA"}
|
package/lib/one-shot-ledger.js
CHANGED
|
@@ -36,8 +36,22 @@ export const INTERNAL_LABELS = [
|
|
|
36
36
|
];
|
|
37
37
|
export const DEFAULT_ENDED_TTL_MS = 5 * 60_000;
|
|
38
38
|
export const DEFAULT_ACTIVE_TTL_MS = 60 * 60_000;
|
|
39
|
+
/**
|
|
40
|
+
* Read the child session's event log through the live harness API:
|
|
41
|
+
* prefer `ownEvents()`, fall back to `snapshotEvents()`, then to the legacy
|
|
42
|
+
* `events` array (removed at the harness 0.1.2-rc.1 line — the old probe
|
|
43
|
+
* read only that dead field, so descriptors NEVER resolved).
|
|
44
|
+
*/
|
|
45
|
+
function sessionEvents(session) {
|
|
46
|
+
if (typeof session?.ownEvents === 'function')
|
|
47
|
+
return session.ownEvents();
|
|
48
|
+
if (typeof session?.snapshotEvents === 'function')
|
|
49
|
+
return session.snapshotEvents();
|
|
50
|
+
return session?.events ?? [];
|
|
51
|
+
}
|
|
39
52
|
function resolveDescriptor(child) {
|
|
40
|
-
const event = child?.session
|
|
53
|
+
const event = sessionEvents(child?.session)
|
|
54
|
+
.find(e => e.type === 'subagent/descriptor');
|
|
41
55
|
if (event === undefined)
|
|
42
56
|
return {};
|
|
43
57
|
return {
|
|
@@ -93,13 +107,38 @@ export function createOneShotLedger(deps) {
|
|
|
93
107
|
}
|
|
94
108
|
}
|
|
95
109
|
};
|
|
110
|
+
/**
|
|
111
|
+
* Lazy per-row re-resolution: the in-process driver appends the
|
|
112
|
+
* `subagent/descriptor` inside the child's FIRST pre-step — after
|
|
113
|
+
* `subagent/start` fires — so an insert-time probe legitimately sees
|
|
114
|
+
* nothing. For any row still label-less, re-probe once via `agents.get`;
|
|
115
|
+
* resolved rows are cached (never probed again). A gone child stays
|
|
116
|
+
* unlabeled without error.
|
|
117
|
+
*/
|
|
118
|
+
const reResolve = () => {
|
|
119
|
+
if (deps.agents?.get === undefined)
|
|
120
|
+
return;
|
|
121
|
+
for (const row of rowsByRunId.values()) {
|
|
122
|
+
if (row.label !== undefined)
|
|
123
|
+
continue;
|
|
124
|
+
const descriptor = resolveDescriptor(deps.agents.get(row.id));
|
|
125
|
+
if (descriptor.label === undefined)
|
|
126
|
+
continue;
|
|
127
|
+
row.label = descriptor.label;
|
|
128
|
+
if (descriptor.mode !== undefined)
|
|
129
|
+
row.mode = descriptor.mode;
|
|
130
|
+
row.internal = INTERNAL_LABELS.includes(descriptor.label);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
96
133
|
return {
|
|
97
134
|
rows() {
|
|
98
135
|
prune();
|
|
136
|
+
reResolve();
|
|
99
137
|
return [...rowsByRunId.values()];
|
|
100
138
|
},
|
|
101
139
|
activeFor(parentId) {
|
|
102
140
|
prune();
|
|
141
|
+
reResolve();
|
|
103
142
|
return [...rowsByRunId.values()].filter(row => row.parentId === parentId && row.endedAt === undefined
|
|
104
143
|
// Unresolvable parentage is never scoped to any session.
|
|
105
144
|
&& row.parentId !== undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"one-shot-ledger.js","sourceRoot":"","sources":["../src/one-shot-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,6DAA6D;IAC7D,eAAe;IACf,gFAAgF;IAChF,kBAAkB;IAClB,sBAAsB;IACtB,0EAA0E;IAC1E,aAAa;IACb,YAAY;CACb,CAAA;
|
|
1
|
+
{"version":3,"file":"one-shot-ledger.js","sourceRoot":"","sources":["../src/one-shot-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,6DAA6D;IAC7D,eAAe;IACf,gFAAgF;IAChF,kBAAkB;IAClB,sBAAsB;IACtB,0EAA0E;IAC1E,aAAa;IACb,YAAY;CACb,CAAA;AA+DD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAG,MAAM,CAAA;AAC9C,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,GAAG,MAAM,CAAA;AAIhD;;;;;GAKG;AACH,SAAS,aAAa,CAAC,OAAuC;IAC5D,IAAI,OAAO,OAAO,EAAE,SAAS,KAAK,UAAU;QAAE,OAAO,OAAO,CAAC,SAAS,EAAE,CAAA;IACxE,IAAI,OAAO,OAAO,EAAE,cAAc,KAA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U,CAAC,IAAI,KAAK,SAAS;gBAAE,GAAG,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;YAC7D,GAAG,CAAC,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QAC3D,CAAC;IACH,CAAC,CAAA;IACD,OAAO;QACL,IAAI;YACF,KAAK,EAAE,CAAA;YACP,SAAS,EAAE,CAAA;YACX,OAAO,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAAA;QAClC,CAAC;QACD,SAAS,CAAC,QAAgB;YACxB,KAAK,EAAE,CAAA;YACP,SAAS,EAAE,CAAA;YACX,OAAO,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAC5C,GAAG,CAAC,QAAQ,KAAK,QAAQ,IAAI,GAAG,CAAC,OAAO,KAAK,SAAS;gBACtD,yDAAyD;mBACtD,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAA;QAClC,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,EAAE,CAAA;YACZ,MAAM,EAAE,EAAE,CAAA;QACZ,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/lib/one-shot-notice.d.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Parent-scoped subagent-child notice (memory-recall hardening follow-ups
|
|
3
|
-
* W2c): on `agent/pre-step`, ONLY the agent whose
|
|
4
|
-
* ledger row's `parentId` gets one folded
|
|
5
|
-
*
|
|
6
|
-
* `
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
3
|
+
* W2c; addendum 2026-09-10): on `agent/pre-step`, ONLY the agent whose
|
|
4
|
+
* `session.id` matches a ledger row's `parentId` gets one folded
|
|
5
|
+
* observe-only line, contributed by REWRITING the enter decision's message
|
|
6
|
+
* batch (`{...decision, messages: [...decision.messages, notice]}`). The
|
|
7
|
+
* previous `agent.inject()` delivery was wrong twice over: inject queues a
|
|
8
|
+
* DURABLE pending inbox message, and the harness loop re-opens a turn
|
|
9
|
+
* whenever the inbox has pending work at turn end — an idle session woke
|
|
10
|
+
* forever with nothing to do (the phantom-loop bug). A batch append enriches
|
|
11
|
+
* only the current step (pinned by tests/mechanism-pins.spec.ts T1).
|
|
12
|
+
*
|
|
13
|
+
* Dedupe is per agent OBJECT: a WeakMap stores the last appended fold text;
|
|
14
|
+
* an identical fold appends nothing, a changed fold appends again.
|
|
11
15
|
*
|
|
12
16
|
* Registration follows `strip-instructions.ts` / `suppress-settled.ts`: a
|
|
13
17
|
* plain `agent/pre-step` waterfall listener that delegates to `next()`
|
|
14
|
-
* unchanged (observe-only).
|
|
15
|
-
* reads only the ledger and its own agent, so ordering is irrelevant.
|
|
18
|
+
* unchanged (observe-only).
|
|
16
19
|
*
|
|
17
20
|
* @module @dsh-cc/subagent-task/one-shot-notice
|
|
18
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"one-shot-notice.d.ts","sourceRoot":"","sources":["../src/one-shot-notice.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"one-shot-notice.d.ts","sourceRoot":"","sources":["../src/one-shot-notice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAE5D,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,gBAAgB;QACxB,eAAe,EAAE;YAAE,IAAI,EAAE,sBAAsB,CAAA;SAAE,CAAA;KAClD;CACF;AAED,+DAA+D;AAC/D,eAAO,MAAM,wBAAwB,yBAAyB,CAAA;AAE9D;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,EAAE,GAAG,MAAM,CAW9F;AAED,oDAAoD;AACpD,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,gBAAgB,EAAE,CAAA;CACzD;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,iBAAiB,GAAG,MAAM,IAAI,CA8B5F"}
|
package/lib/one-shot-notice.js
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Parent-scoped subagent-child notice (memory-recall hardening follow-ups
|
|
3
|
-
* W2c): on `agent/pre-step`, ONLY the agent whose
|
|
4
|
-
* ledger row's `parentId` gets one folded
|
|
5
|
-
*
|
|
6
|
-
* `
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
3
|
+
* W2c; addendum 2026-09-10): on `agent/pre-step`, ONLY the agent whose
|
|
4
|
+
* `session.id` matches a ledger row's `parentId` gets one folded
|
|
5
|
+
* observe-only line, contributed by REWRITING the enter decision's message
|
|
6
|
+
* batch (`{...decision, messages: [...decision.messages, notice]}`). The
|
|
7
|
+
* previous `agent.inject()` delivery was wrong twice over: inject queues a
|
|
8
|
+
* DURABLE pending inbox message, and the harness loop re-opens a turn
|
|
9
|
+
* whenever the inbox has pending work at turn end — an idle session woke
|
|
10
|
+
* forever with nothing to do (the phantom-loop bug). A batch append enriches
|
|
11
|
+
* only the current step (pinned by tests/mechanism-pins.spec.ts T1).
|
|
12
|
+
*
|
|
13
|
+
* Dedupe is per agent OBJECT: a WeakMap stores the last appended fold text;
|
|
14
|
+
* an identical fold appends nothing, a changed fold appends again.
|
|
11
15
|
*
|
|
12
16
|
* Registration follows `strip-instructions.ts` / `suppress-settled.ts`: a
|
|
13
17
|
* plain `agent/pre-step` waterfall listener that delegates to `next()`
|
|
14
|
-
* unchanged (observe-only).
|
|
15
|
-
* reads only the ledger and its own agent, so ordering is irrelevant.
|
|
18
|
+
* unchanged (observe-only).
|
|
16
19
|
*
|
|
17
20
|
* @module @dsh-cc/subagent-task/one-shot-notice
|
|
18
21
|
*/
|
|
@@ -46,6 +49,8 @@ export function foldChildNotice(rows) {
|
|
|
46
49
|
* @returns an unmount callback.
|
|
47
50
|
*/
|
|
48
51
|
export function mountSubagentChildNotice(ctx, ledger) {
|
|
52
|
+
// Last appended fold text per agent object (dedupe across pre-steps).
|
|
53
|
+
const lastNotice = new WeakMap();
|
|
49
54
|
return ctx.on('agent/pre-step', async ({ agent }, next) => {
|
|
50
55
|
const decision = await next();
|
|
51
56
|
// Fire-and-forget: the notice is model-visible enrichment, never worth
|
|
@@ -55,15 +60,25 @@ export function mountSubagentChildNotice(ctx, ledger) {
|
|
|
55
60
|
if (sid === undefined)
|
|
56
61
|
return decision;
|
|
57
62
|
const active = ledger.activeFor(String(sid));
|
|
58
|
-
|
|
63
|
+
const text = foldChildNotice(active);
|
|
64
|
+
// Never append an empty fold; never re-append an unchanged fold. The
|
|
65
|
+
// memo updates only on an actual append, so a fold skipped by a
|
|
66
|
+
// non-enter decision is retried on the next enter.
|
|
67
|
+
if (text === '' || lastNotice.get(agent) === text)
|
|
68
|
+
return decision;
|
|
69
|
+
if (decision.kind !== 'enter')
|
|
59
70
|
return decision;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
71
|
+
lastNotice.set(agent, text);
|
|
72
|
+
return {
|
|
73
|
+
...decision,
|
|
74
|
+
messages: [...decision.messages, createUserMessage({
|
|
75
|
+
content: [{ type: 'text', text }],
|
|
76
|
+
source: { kind: 'cc-subagent-children' },
|
|
77
|
+
})],
|
|
78
|
+
};
|
|
64
79
|
}
|
|
65
80
|
catch {
|
|
66
|
-
// Absent llm seam or
|
|
81
|
+
// Absent llm seam or decision surface: skip quietly.
|
|
67
82
|
}
|
|
68
83
|
return decision;
|
|
69
84
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"one-shot-notice.js","sourceRoot":"","sources":["../src/one-shot-notice.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"one-shot-notice.js","sourceRoot":"","sources":["../src/one-shot-notice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AASxD,+DAA+D;AAC/D,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAA;AAE9D;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,IAAsD;IACpF,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IACjD,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAClD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAC1D,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,WAAW,CAAC,CAAA;QAC3D,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,yBAAyB,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACjH,CAAC;IACD,IAAI,aAAa,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,aAAa,WAAW,CAAC,CAAA;IAC/D,OAAO,aAAa,KAAK,CAAC,IAAI,CAAC,GAAG,C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QACvD,CAAC;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-cc/subagent-task",
|
|
3
3
|
"description": "Claude Code-compatible Task tool: subagent_type dispatch over per-workspace .claude/agents definitions for the DeepSeek Harness",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.2",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/dsh-cc/dsh-cc.git",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"@deepseek-ai/schemastery": "^3.18.1"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@dsh-cc/
|
|
45
|
-
"@dsh-cc/
|
|
46
|
-
"@dsh-cc/
|
|
47
|
-
"@dsh-cc/
|
|
48
|
-
"@dsh-cc/
|
|
44
|
+
"@dsh-cc/claude-code-agents": "^0.6.2",
|
|
45
|
+
"@dsh-cc/memory": "^0.6.2",
|
|
46
|
+
"@dsh-cc/model-aliases": "^0.6.2",
|
|
47
|
+
"@dsh-cc/subagent-resume-pins": "^0.6.2",
|
|
48
|
+
"@dsh-cc/tools": "^0.6.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@deepseek-ai/dsh-agent-loop": "link:../../../../deepseek-harness/packages/core/agent-loop",
|
|
@@ -64,14 +64,14 @@
|
|
|
64
64
|
"@deepseek-ai/dsh-scope": "link:../../../../deepseek-harness/packages/core/scope",
|
|
65
65
|
"@deepseek-ai/dsh-subagent": "link:../../../../deepseek-harness/packages/subagent/subagent",
|
|
66
66
|
"@deepseek-ai/dsh-system-prompt": "link:../../../../deepseek-harness/packages/core/system-prompt",
|
|
67
|
-
"@dsh-cc/claude-code-agents": "^0.6.1",
|
|
68
|
-
"@dsh-cc/memory": "^0.6.1",
|
|
69
|
-
"@dsh-cc/model-aliases": "^0.6.1",
|
|
70
|
-
"@dsh-cc/subagent-resume-pins": "^0.6.1",
|
|
71
|
-
"@dsh-cc/plugin-loader": "^0.6.1",
|
|
72
|
-
"@dsh-cc/tools": "^0.6.1",
|
|
73
67
|
"@dsh-cc/agent-loop-mock": "^0.1.0",
|
|
74
|
-
"@dsh-cc/
|
|
68
|
+
"@dsh-cc/memory": "^0.6.2",
|
|
69
|
+
"@dsh-cc/model-aliases": "^0.6.2",
|
|
70
|
+
"@dsh-cc/claude-code-agents": "^0.6.2",
|
|
71
|
+
"@dsh-cc/subagent-resume-pins": "^0.6.2",
|
|
72
|
+
"@dsh-cc/tools": "^0.6.2",
|
|
73
|
+
"@dsh-cc/plugin-loader": "^0.6.2",
|
|
74
|
+
"@dsh-cc/tool-search": "0.6.2"
|
|
75
75
|
},
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|