@nanmicoder/dsh-agent-teams 0.1.17 → 0.1.18
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.md +5 -3
- package/README_ZH.md +6 -2
- package/lib/client/AgentTeamsCard.js +1 -1
- package/lib/client.js +1 -1
- package/lib/client.js.map +1 -1
- package/lib/harness-compat.js +22 -0
- package/lib/index.js +4 -4
- package/lib/mailbox.js +154 -0
- package/lib/members.js +90 -18
- package/lib/quality-gates.js +21 -6
- package/lib/scheduler.js +27 -15
- package/lib/snapshot.js +1 -1
- package/lib/state.js +24 -5
- package/lib/tools.js +205 -213
- package/lib/types/harness-compat.d.ts +2 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/mailbox.d.ts +7 -0
- package/lib/types/members.d.ts +6 -4
- package/lib/types/scheduler.d.ts +1 -0
- package/lib/types/state.d.ts +5 -0
- package/lib/types/types.d.ts +9 -0
- package/package.json +2 -2
- package/release-notes/v0.1.18.md +21 -0
|
@@ -18,6 +18,8 @@ export declare function sessionOwnEvents(session: Session): readonly SessionEven
|
|
|
18
18
|
export declare function installContinuableMemberSetup(ctx: Context, setup: Setup): void;
|
|
19
19
|
/** Queue a distinct host-authored turn; never substitute model-message steer. */
|
|
20
20
|
export declare function queueMemberPrompt(runtime: Context['subagents'], parent: Agent, childId: SessionId, content: ContentBlock[], signal: AbortSignal): Promise<MessageId>;
|
|
21
|
+
/** Coordination joins the nearest step, including waking an idle/cold child. */
|
|
22
|
+
export declare function steerMemberPrompt(runtime: Context['subagents'], parent: Agent, childId: SessionId, content: ContentBlock[], signal: AbortSignal, live?: Agent): Promise<MessageId>;
|
|
21
23
|
/** Guard all resumable delivery paths, preserving the native service receiver. */
|
|
22
24
|
export declare function guardSubagentDelivery(ctx: Context, isRetired: (sender: Agent, targetId: SessionId) => Promise<boolean>): void;
|
|
23
25
|
export {};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export interface Config {
|
|
|
38
38
|
executionPrompt?: string;
|
|
39
39
|
/** Plugin-wide fallback route for unavailable member models. */
|
|
40
40
|
fallback?: import('./profiles.ts').TeamModelFallbackConfig;
|
|
41
|
-
/** Member delegation depth cap (default `
|
|
41
|
+
/** Member delegation depth cap (default `0`; `0` forbids delegation entirely). */
|
|
42
42
|
memberMaxDepth?: number;
|
|
43
43
|
/** Team size cap in members (default `8`). */
|
|
44
44
|
maxMembers?: number;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Durable delivery receipts and execution-generation filtering at step admission. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import type { TeamMessage, TeamState } from './types.ts';
|
|
4
|
+
export declare function isCurrentMail(team: TeamState, message: TeamMessage): boolean;
|
|
5
|
+
export declare function mailboxPrompt(teamId: string, recipient: string, messages: readonly TeamMessage[]): string;
|
|
6
|
+
/** Only messages actually admitted to this recipient's step become read. */
|
|
7
|
+
export declare function installMailboxAdmission(ctx: Context, stateDir: string): void;
|
package/lib/types/members.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Member subagent lifecycle: spawn a continuable child per member, deliver
|
|
3
|
-
*
|
|
3
|
+
* task turns and step-boundary messages, and observe its activity.
|
|
4
4
|
*
|
|
5
5
|
* Members are durable continuable subagents of the captain, so a member keeps
|
|
6
6
|
* its conversation across turns and across harness restarts: the captain
|
|
@@ -92,7 +92,7 @@ export declare function selectFallbackRoute(current: {
|
|
|
92
92
|
};
|
|
93
93
|
};
|
|
94
94
|
/** Deliver a durable member report to the live captain at its next model step. */
|
|
95
|
-
export declare function steerCaptainReport(captain: Pick<Agent, 'steer'>, from: string, content: string): boolean;
|
|
95
|
+
export declare function steerCaptainReport(captain: Pick<Agent, 'steer'>, from: string, content: string, receipt?: string): boolean;
|
|
96
96
|
interface FailedMemberAttempt {
|
|
97
97
|
readonly captainSessionId: string;
|
|
98
98
|
readonly memberId: string;
|
|
@@ -151,7 +151,7 @@ export declare function memberWelcome(team: TeamState, memberName: string): stri
|
|
|
151
151
|
* @param stateDir - configured state directory (for the persona).
|
|
152
152
|
* @param signal - caller cancellation, forwarded to the start.
|
|
153
153
|
*/
|
|
154
|
-
export declare function spawnMember(ctx: Context, config: MemberRuntimeConfig, selections: MemberSelectionRuntime, llmSelection: MemberLlmSelection, captain: Agent, team: TeamState, member: TeamMember, stateDir: string, signal: AbortSignal): Promise<void>;
|
|
154
|
+
export declare function spawnMember(ctx: Context, config: MemberRuntimeConfig, selections: MemberSelectionRuntime, llmSelection: MemberLlmSelection, captain: Agent, team: TeamState, member: TeamMember, stateDir: string, signal: AbortSignal, initialPrompt?: string): Promise<void>;
|
|
155
155
|
/**
|
|
156
156
|
* Deliver one message to a member as its next FIFO turn. Best effort: a
|
|
157
157
|
* failure (member gone or not continuable) is logged and reported as `false`
|
|
@@ -169,7 +169,7 @@ export declare function spawnMember(ctx: Context, config: MemberRuntimeConfig, s
|
|
|
169
169
|
* @param signal - caller cancellation, forwarded to the delivery.
|
|
170
170
|
* @returns whether the member inbox accepted the message.
|
|
171
171
|
*/
|
|
172
|
-
export declare function deliverToMember(ctx: Context, captain: Agent, childId: string, text: string, signal: AbortSignal): Promise<boolean>;
|
|
172
|
+
export declare function deliverToMember(ctx: Context, captain: Agent, childId: string, text: string, signal: AbortSignal, mode?: 'queue' | 'steer'): Promise<boolean>;
|
|
173
173
|
/**
|
|
174
174
|
* Request cancellation of one live member's current turn. Best effort, fire
|
|
175
175
|
* and return; the target may keep running until it observes the signal.
|
|
@@ -191,6 +191,8 @@ export declare function interruptMember(ctx: Context, captain: Agent, childId: s
|
|
|
191
191
|
* untouched while the delivery boundary still prevents further model turns.
|
|
192
192
|
*/
|
|
193
193
|
export declare function installRetiredMemberGuard(ctx: Context, stateDir: string): void;
|
|
194
|
+
/** Bound all descendant creation, including renamed tools and code-runtime calls. */
|
|
195
|
+
export declare function installMemberDelegationGuard(ctx: Context, stateDir: string, maxDepth: number): void;
|
|
194
196
|
/**
|
|
195
197
|
* Snapshot the real driver activity for durable member ids.
|
|
196
198
|
*
|
package/lib/types/scheduler.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare const DEPENDENCY_OUTPUTS_TOTAL_MAX_CHARS = 12000;
|
|
|
21
21
|
export interface SchedulerConfig {
|
|
22
22
|
readonly stateDir: string;
|
|
23
23
|
readonly executionPrompt?: string;
|
|
24
|
+
readonly dispatch?: (captain: Agent, teamId: string, memberName: string, text: string, signal: AbortSignal, mode: 'queue' | 'steer', attemptId?: string) => Promise<boolean>;
|
|
24
25
|
}
|
|
25
26
|
export interface TeamScheduler {
|
|
26
27
|
/** Try to give every genuinely idle/ready member one unit of ready work. */
|
package/lib/types/state.d.ts
CHANGED
|
@@ -149,6 +149,8 @@ export declare function appendMailbox(stateRoot: string, teamId: string, agentKe
|
|
|
149
149
|
export declare function readMailbox(stateRoot: string, teamId: string, agentKey: string, onMalformedLine?: (lineNumber: number, error: unknown) => void): Promise<TeamMessage[]>;
|
|
150
150
|
/** Read only messages that have not been acknowledged by their recipient. */
|
|
151
151
|
export declare function readUnreadMailbox(stateRoot: string, teamId: string, agentKey: string, onMalformedLine?: (lineNumber: number, error: unknown) => void): Promise<TeamMessage[]>;
|
|
152
|
+
/** Pending delivery is distinct from delivered-but-not-yet-read input. */
|
|
153
|
+
export declare function readPendingMailbox(stateRoot: string, teamId: string, agentKey: string): Promise<TeamMessage[]>;
|
|
152
154
|
/** Lease selected fallback messages to one delivery path. */
|
|
153
155
|
export declare function claimMailboxDelivery(stateRoot: string, teamId: string, agentKey: string, messageIds: readonly string[]): Promise<void>;
|
|
154
156
|
/** Release a failed delivery lease so the scheduler can retry it later. */
|
|
@@ -158,6 +160,9 @@ export declare function releaseMailboxDelivery(stateRoot: string, teamId: string
|
|
|
158
160
|
* malformed lines for diagnostics. Callers serialize this with the team lock.
|
|
159
161
|
*/
|
|
160
162
|
export declare function acknowledgeMailbox(stateRoot: string, teamId: string, agentKey: string, messageIds: readonly string[]): Promise<void>;
|
|
163
|
+
/** Acceptance by Harness is not evidence that a model step consumed input. */
|
|
164
|
+
export declare function markMailboxDelivered(stateRoot: string, teamId: string, agentKey: string, ids: readonly string[]): Promise<void>;
|
|
165
|
+
export declare function discardMailboxMessages(stateRoot: string, teamId: string, agentKey: string, ids: readonly string[]): Promise<void>;
|
|
161
166
|
/** Filesystem primitives used by {@link replaceFileAtomicOrDirect}; injectable for tests. */
|
|
162
167
|
export interface AtomicReplacePrimitives {
|
|
163
168
|
rename: (from: string, to: string) => Promise<void>;
|
package/lib/types/types.d.ts
CHANGED
|
@@ -75,6 +75,8 @@ export interface TeamTask {
|
|
|
75
75
|
attemptId?: string;
|
|
76
76
|
/** Opaque generation for a revocation/handoff that has not started its next attempt yet. */
|
|
77
77
|
handoffId?: string;
|
|
78
|
+
/** Previous activation retained until a handoff drain succeeds (retryable). */
|
|
79
|
+
handoffFromMemberId?: string;
|
|
78
80
|
/** A handoff is quiescing the old owner; the scheduler must not dispatch it yet. */
|
|
79
81
|
reassigning?: boolean;
|
|
80
82
|
/** Quality-gate kind. Missing values are treated as `work`. */
|
|
@@ -130,6 +132,8 @@ export interface TeamMember {
|
|
|
130
132
|
fallbackActive?: boolean;
|
|
131
133
|
joinedAt: number;
|
|
132
134
|
status: MemberStatus;
|
|
135
|
+
/** Execution admission is closed while a failed/pending handoff is drained. */
|
|
136
|
+
stopping?: boolean;
|
|
133
137
|
}
|
|
134
138
|
/** One mailbox message. */
|
|
135
139
|
export interface TeamMessage {
|
|
@@ -146,6 +150,11 @@ export interface TeamMessage {
|
|
|
146
150
|
deliveredAt?: number;
|
|
147
151
|
/** Set once the recipient has consumed or been shown the durable fallback. */
|
|
148
152
|
readAt?: number;
|
|
153
|
+
/** Guidance is scoped to the recipient's execution generation, when present. */
|
|
154
|
+
taskId?: string;
|
|
155
|
+
attemptId?: string;
|
|
156
|
+
/** Cancelled delivery is retained for audit but must not wake the recipient. */
|
|
157
|
+
discardedAt?: number;
|
|
149
158
|
}
|
|
150
159
|
/** Snapshot of the named profile used to seed a team. */
|
|
151
160
|
export interface TeamModelFallback {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nanmicoder/dsh-agent-teams",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "AgentTeams for DeepSeek Harness: multi-agent team collaboration (captain, members, tasks with dependencies, messaging) driven by natural language, with a tree monitor in the web GUI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
"verify": "node scripts/verify.mjs && node scripts/fallback-tdd.mjs && node scripts/member-failure-tdd.mjs && node scripts/quality-gates-tdd.mjs && node scripts/lifecycle-verify.mjs && node scripts/stress-verify.mjs && pnpm verify:web-routes && pnpm verify:release && pnpm verify:skill && pnpm verify:harness-contract && pnpm verify:http-body && pnpm verify:compatibility && pnpm verify:capabilities",
|
|
229
229
|
"verify:web-routes": "node scripts/web-routes-verify.mjs",
|
|
230
230
|
"verify:release": "node --test scripts/release-metadata.test.mjs",
|
|
231
|
-
"verify:harness-contract": "node scripts/harness-compat-tdd.mjs && node scripts/lifecycle-verify.mjs --modern-harness && node scripts/member-failure-tdd.mjs --modern-harness && node scripts/lifecycle-verify.mjs --delivery-harness && node scripts/member-failure-tdd.mjs --delivery-harness",
|
|
231
|
+
"verify:harness-contract": "node scripts/harness-compat-tdd.mjs && node scripts/stability-tdd.mjs && node scripts/lifecycle-verify.mjs --modern-harness && node scripts/member-failure-tdd.mjs --modern-harness && node scripts/lifecycle-verify.mjs --delivery-harness && node scripts/member-failure-tdd.mjs --delivery-harness",
|
|
232
232
|
"verify:compatibility": "node scripts/compatibility.mjs && node --test scripts/compatibility.test.mjs && node scripts/doctor.mjs",
|
|
233
233
|
"verify:http-body": "node --test scripts/http-body.test.mjs",
|
|
234
234
|
"doctor": "node scripts/doctor.mjs",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# v0.1.18 — Reliable team scheduling and message delivery
|
|
2
|
+
|
|
3
|
+
npm channel: `latest`. Recommended host: DeepSeek Harness `0.1.5-rc.1`.
|
|
4
|
+
|
|
5
|
+
- Create the roster and dependency graph atomically; start members only when their first task is ready, avoiding welcome-only model turns.
|
|
6
|
+
- Deliver coordination at the next model step, preserve tool-result continuations, and discard duplicate or obsolete task messages. Suppress duplicate native success notifications after an accepted team report.
|
|
7
|
+
- Drain member descendants and queued input on archive, removal, and reassignment. Reject retired member identities on cold restore and retry incomplete cleanup.
|
|
8
|
+
- Allow dependency-fenced implementation planning while requirements are in progress, and correct or cancel tasks that have not started.
|
|
9
|
+
- Return the current attempt ID when a member omits it, so it can retry the update without restarting completed work. Keep rejection of genuinely stale attempts.
|
|
10
|
+
- Keep unfinished work from passing delivery gates; make deeper delegation an explicit choice.
|
|
11
|
+
- Preserve existing progressive tool loading, direct workflows, Harness compatibility, and light/dark theme support.
|
|
12
|
+
|
|
13
|
+
Validation includes regression tests and a four-host native runtime matrix: `0.1.5-rc.1`, `0.1.2-rc.1`, `0.1.2-alpha.5`, and `0.1.2-alpha.2`. The release workflow checks the same packaged artifact on every host before npm publication.
|
|
14
|
+
|
|
15
|
+
Pre-release real DeepSeek testing under `/tmp` exercised six members, seventeen tasks, cold continuation, and review/repair loops, finishing with 32 external assertions. This involved interrupted runs and fixes between phases; it is not a claim of a clean single-run benchmark or a measured speedup. See the [full test report](https://github.com/NanmiCoder/dsh-agent-teams/blob/v0.1.18/docs/session-latency-audit-2026-09-12/complex-test-report.md), including test limitations and the disclosed test-scope incident.
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
dsh plugin --profile web add --save-exact @nanmicoder/dsh-agent-teams@0.1.18
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Restart Harness and refresh the browser after upgrading. Updating the plugin does not update a Desktop app's embedded Harness. Before downgrading, finish or archive teams created by this release: older plugins do not understand dormant members with an empty session ID.
|