@dsh-cc/command-agents 0.8.2-rc.1 → 0.8.3-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/README.i18n.yaml +2 -2
- package/README.md +21 -1
- package/README.zh.md +17 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +36 -5
- package/lib/index.js.map +1 -1
- package/lib/release.d.ts +98 -0
- package/lib/release.d.ts.map +1 -0
- package/lib/release.js +357 -0
- package/lib/release.js.map +1 -0
- package/lib/snapshot.d.ts +18 -0
- package/lib/snapshot.d.ts.map +1 -1
- package/lib/snapshot.js +26 -2
- package/lib/snapshot.js.map +1 -1
- package/package.json +12 -8
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 check:readme --write
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 08355d935658595df6455ff34f3d51d51837662f
|
|
6
|
+
README.zh.md: 0d66e875a65958d7a18a063e3f566ad0e01c9ec4
|
package/README.md
CHANGED
|
@@ -12,9 +12,29 @@ Human-facing `/agents` command for continuable background agents (plan
|
|
|
12
12
|
- `/agents <id>` — thin detail: pin provenance (path, definition, model
|
|
13
13
|
selector, workspace, gate evaluation), residency, ids.
|
|
14
14
|
- `/agents stop <id>` — one interrupt request on a running child (the child
|
|
15
|
-
stays continuable/resumable); short no-op explanation otherwise.
|
|
15
|
+
stays continuable/resumable); short no-op explanation otherwise. A released
|
|
16
|
+
(or mid-release) child refuses with an explicit "cannot be continued here"
|
|
17
|
+
copy instead of the resumable wording.
|
|
18
|
+
- `/agents release <id>` — evict the child's resident activation (and its
|
|
19
|
+
resident descendants') through the harness drain seam; frees its capacity
|
|
20
|
+
slot when it was running; cooperative (a cancel-resistant turn keeps its
|
|
21
|
+
slot and the command reports the release as in flight); one-way in this
|
|
22
|
+
session (same-session continuation is unavailable — the upstream
|
|
23
|
+
cold-resume-after-drain gap); the persisted session survives on disk.
|
|
24
|
+
Released rows render a process-local `[released]` tag in the list and a
|
|
25
|
+
release line in the detail.
|
|
16
26
|
- `/agents attach <id>` — namespace reserved, not implemented (P1).
|
|
17
27
|
|
|
28
|
+
## Shared release core
|
|
29
|
+
|
|
30
|
+
`src/release.ts` is the single release operation shared by `/agents release`
|
|
31
|
+
and the model-facing `release_agent` tool (`@dsh-cc/subagent-task`): one
|
|
32
|
+
gate/drain/resolve/reject/timeout flow, one copy set, and one process-local
|
|
33
|
+
two-set marker (`releasing` / `released`), exported via the
|
|
34
|
+
`@dsh-cc/command-agents/release` entry. The `[released]` tag renders only
|
|
35
|
+
when a marker exists AND the row's residency is `ready` (registry-absent at
|
|
36
|
+
snapshot time) — never from the marker alone.
|
|
37
|
+
|
|
18
38
|
## Shared snapshot
|
|
19
39
|
|
|
20
40
|
`src/snapshot.ts` is a pure snapshot provider over injected services
|
package/README.zh.md
CHANGED
|
@@ -12,9 +12,25 @@
|
|
|
12
12
|
- `/agents <id>` — 轻量详情:pin 来源(路径、定义、模型选择器、工作区、
|
|
13
13
|
gate 评估结果)、驻留状态、ids。
|
|
14
14
|
- `/agents stop <id>` — 对运行中的子代理发送一次中断请求(子代理仍可
|
|
15
|
-
|
|
15
|
+
延续/恢复);否则给出简短的无操作说明。已释放(或释放进行中)的子代理
|
|
16
|
+
会以明确的"本会话内不可延续"文案拒绝,而不是可恢复的说法。
|
|
17
|
+
- `/agents release <id>` — 通过 harness 的 drain 缝隙逐出该子代理的常驻
|
|
18
|
+
activation(连同其常驻后代);当其为 running 时释放其容量槽位;驱逐是
|
|
19
|
+
协作式的(一个拒绝取消的 turn 会保留其槽位,此时命令报告释放仍在进行);
|
|
20
|
+
本会话内单向不可逆(同会话延续不可用——上游 cold-resume-after-drain 缺口);
|
|
21
|
+
持久化的 session 保留在磁盘上。已释放的行在列表中渲染进程本地的
|
|
22
|
+
`[released]` 标签,在详情中渲染一行 release 说明。
|
|
16
23
|
- `/agents attach <id>` — 命名空间已保留,尚未实现(P1)。
|
|
17
24
|
|
|
25
|
+
## Shared release core
|
|
26
|
+
|
|
27
|
+
`src/release.ts` 是由 `/agents release` 与面向模型的 `release_agent` 工具
|
|
28
|
+
(`@dsh-cc/subagent-task`)共享的唯一释放操作:一套 gate/drain/resolve/
|
|
29
|
+
reject/timeout 流程、一套文案,以及一个进程本地的双集合标记
|
|
30
|
+
(`releasing` / `released`),经 `@dsh-cc/command-agents/release` 入口导出。
|
|
31
|
+
只有当标记存在且该行的驻留状态为 `ready`(快照时刻注册表缺席)时,
|
|
32
|
+
`[released]` 标签才会渲染——绝不只凭标记。
|
|
33
|
+
|
|
18
34
|
## Shared snapshot
|
|
19
35
|
|
|
20
36
|
`src/snapshot.ts` 是一个基于注入服务的纯快照提供者
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AA2BlD,eAAO,MAAM,IAAI,mBAAmB,CAAA;AACpC,eAAO,MAAM,MAAM,UAAwD,CAAA;AAsG3E;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAsCxC"}
|
package/lib/index.js
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { SessionId } from '@deepseek-ai/dsh-session';
|
|
12
12
|
import { helpable } from '@dsh-cc/command-usage';
|
|
13
|
-
import { buildAgentsSnapshot, parseAgentsInput, renderAgentDetail, renderAgentsList, stopNotRunningCopy, stopRunningCopy, unknownAgentCopy, } from "./snapshot.js";
|
|
13
|
+
import { buildAgentsSnapshot, parseAgentsInput, renderAgentDetail, renderAgentsList, stopNotRunningCopy, stopReleasedCopy, stopRunningCopy, unknownAgentCopy, } from "./snapshot.js";
|
|
14
|
+
import { ReleaseFailure, renderReleaseOutcome, runRelease, isReleased, isReleasing, } from "./release.js";
|
|
14
15
|
export const name = 'command-agents';
|
|
15
16
|
export const inject = ['commands', 'subagents', 'agents', 'resumePinStore'];
|
|
16
17
|
/** Adapt the injected services to the pure snapshot seam. */
|
|
@@ -27,22 +28,51 @@ function toSnapshotServices(subagents, agents, pinStore) {
|
|
|
27
28
|
getAgent: id => agents.get(id),
|
|
28
29
|
readPin: childId => pinStore.read(childId),
|
|
29
30
|
pinPath: childId => pinStore.pathFor(childId),
|
|
31
|
+
isReleased: id => isReleased(id),
|
|
32
|
+
isReleasing: id => isReleasing(id),
|
|
30
33
|
};
|
|
31
34
|
}
|
|
32
35
|
/** Execute one parsed `/agents` invocation against the snapshot. */
|
|
33
|
-
async function executeAgents(snapshotServices, subagents, caller, rawInput) {
|
|
36
|
+
async function executeAgents(snapshotServices, subagents, agents, caller, rawInput, signal) {
|
|
34
37
|
const parsed = parseAgentsInput(rawInput);
|
|
35
38
|
if (parsed.kind === 'error')
|
|
36
39
|
return { kind: 'error', text: parsed.text };
|
|
37
40
|
const parentSessionId = String(caller.session.id);
|
|
41
|
+
// The release branch runs BEFORE rows.find / any snapshot fast path: the
|
|
42
|
+
// authoritative drain seam, not the snapshot, decides.
|
|
43
|
+
if (parsed.kind === 'release') {
|
|
44
|
+
try {
|
|
45
|
+
const outcome = await runRelease({
|
|
46
|
+
parent: caller,
|
|
47
|
+
id: parsed.id,
|
|
48
|
+
subagents,
|
|
49
|
+
agents: agents,
|
|
50
|
+
signal,
|
|
51
|
+
});
|
|
52
|
+
return { kind: 'success', text: renderReleaseOutcome(outcome) };
|
|
53
|
+
}
|
|
54
|
+
catch (failure) {
|
|
55
|
+
if (failure instanceof ReleaseFailure)
|
|
56
|
+
return { kind: 'error', text: failure.message };
|
|
57
|
+
throw failure;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
38
60
|
if (parsed.kind === 'stop') {
|
|
39
61
|
const rows = await buildAgentsSnapshot(snapshotServices, parentSessionId);
|
|
40
62
|
const row = rows.find(candidate => candidate.id === parsed.id);
|
|
41
63
|
if (row === undefined)
|
|
42
64
|
return { kind: 'error', text: unknownAgentCopy(parsed.id) };
|
|
65
|
+
// Symmetric stop-copy gates (D3): a released Ready row and a mid-drain
|
|
66
|
+
// (releasing) row must never read "stays resumable".
|
|
43
67
|
if (row.residency !== 'running') {
|
|
68
|
+
if (row.released === true) {
|
|
69
|
+
return { kind: 'success', text: stopReleasedCopy(parsed.id) };
|
|
70
|
+
}
|
|
44
71
|
return { kind: 'success', text: stopNotRunningCopy(parsed.id, row.residency) };
|
|
45
72
|
}
|
|
73
|
+
if (snapshotServices.isReleasing?.(parsed.id) === true) {
|
|
74
|
+
return { kind: 'success', text: stopReleasedCopy(parsed.id) };
|
|
75
|
+
}
|
|
46
76
|
subagents.interrupt(SessionId(parsed.id), { kind: 'ancestor', agent: caller });
|
|
47
77
|
return { kind: 'success', text: stopRunningCopy(parsed.id) };
|
|
48
78
|
}
|
|
@@ -90,13 +120,14 @@ export function apply(ctx) {
|
|
|
90
120
|
}, 'command-agents: clear host-realm ccAgents publication on unload');
|
|
91
121
|
ctx.commands.register(helpable({
|
|
92
122
|
name: 'agents',
|
|
93
|
-
description: 'list, inspect, or
|
|
94
|
-
handler: (invocation) => executeAgents(snapshotServices, subagents, invocation.agent, invocation.rawInput),
|
|
123
|
+
description: 'list, inspect, stop, or release continuable background agents',
|
|
124
|
+
handler: (invocation) => executeAgents(snapshotServices, subagents, agents, invocation.agent, invocation.rawInput, invocation.signal),
|
|
95
125
|
}, {
|
|
96
126
|
usage: ['[<id>]'],
|
|
97
127
|
subcommands: [
|
|
98
128
|
{ word: 'detail', args: '<id>', summary: 'Show one background agent by id (the bare form lists all)' },
|
|
99
|
-
{ word: 'stop', args: '<id>', summary: '
|
|
129
|
+
{ word: 'stop', args: '<id>', summary: 'Interrupt a running agent\'s current turn (the activation stays resident; "/agents release <id>" evicts it)' },
|
|
130
|
+
{ word: 'release', args: '<id>', summary: 'Evict an agent\'s resident activation (and resident descendants\'), freeing its capacity slot when it was running; cooperative; one-way in this session' },
|
|
100
131
|
],
|
|
101
132
|
}));
|
|
102
133
|
}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAGpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GAGjB,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAGpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GAGjB,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,WAAW,GAEZ,MAAM,cAAc,CAAA;AAErB,MAAM,CAAC,MAAM,IAAI,GAAG,gBAAgB,CAAA;AACpC,MAAM,CAAC,MAAM,MAAM,GAAG,CAA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QACd,WAAW,EAAE,+DAA+D;QAC5E,OAAO,EAAE,CAAC,UAA6B,EAAE,EAAE,CAAC,aAAa,CAAC,gBAAgB,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC;KACzJ,EAAE;QACD,KAAK,EAAE,CAAC,QAAQ,CAAC;QACjB,WAAW,EAAE;YACX,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,2DAA2D,EAAE;YACtG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,6GAA6G,EAAE;YACtJ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,yJAAyJ,EAAE;SACtM;KACF,CAAC,CAAC,CAAA;AACL,CAAC"}
|
package/lib/release.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared release operation: the single source of truth for evicting a direct
|
|
3
|
+
* continuable child's resident activation via the harness
|
|
4
|
+
* `drainContinuableChildren` seam (plan
|
|
5
|
+
* docs/plans/2026-09-30-subagent-release-valve.md §4 D1). Consumed by the
|
|
6
|
+
* model-facing `release_agent` tool and the human-facing
|
|
7
|
+
* `/agents release <id>` command, so both surfaces render ONE copy set (§5)
|
|
8
|
+
* and share ONE process-local marker state (F14: released rows are not
|
|
9
|
+
* representable upstream — the durable catalog survives a drain and reads
|
|
10
|
+
* `ready`).
|
|
11
|
+
*
|
|
12
|
+
* Residency derivation cross-reference: this module's registry reads derive
|
|
13
|
+
* residency exactly like the sibling sites `snapshot.ts residencyOf` (live
|
|
14
|
+
* `status === 'running'` → running, live-not-running → idle, absent →
|
|
15
|
+
* settled/ready) and `background-start.ts assertLiveCapacity` (a slot is held
|
|
16
|
+
* only while the registry reports `status === 'running'`).
|
|
17
|
+
* @module @dsh-cc/command-agents/release
|
|
18
|
+
*/
|
|
19
|
+
import { SessionId } from '@deepseek-ai/dsh-session';
|
|
20
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
21
|
+
/** The duck-typed subagents seam release needs (host duck compat). */
|
|
22
|
+
export interface ReleaseSubagentsLike {
|
|
23
|
+
listChildren?(parentSessionId: SessionId, signal?: AbortSignal): Promise<readonly {
|
|
24
|
+
id: string;
|
|
25
|
+
mode?: string;
|
|
26
|
+
}[]>;
|
|
27
|
+
drainContinuableChildren?(parent: Agent, ids: SessionId[]): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
/** The duck-typed live-agents registry slice release reads. */
|
|
30
|
+
export interface ReleaseRegistryLike {
|
|
31
|
+
get(id: string): {
|
|
32
|
+
status?: 'idle' | 'running' | string;
|
|
33
|
+
} | undefined;
|
|
34
|
+
}
|
|
35
|
+
type PreStatus = 'running' | 'idle' | 'unknown';
|
|
36
|
+
type CatalogNote = 'catalog' | 'registry-only' | 'catalog-unreadable';
|
|
37
|
+
export type ReleaseOutcome = {
|
|
38
|
+
kind: 'released';
|
|
39
|
+
id: string;
|
|
40
|
+
preStatus: PreStatus;
|
|
41
|
+
catalogNote: CatalogNote;
|
|
42
|
+
cause?: string;
|
|
43
|
+
} | {
|
|
44
|
+
kind: 'issued-unobservable';
|
|
45
|
+
id: string;
|
|
46
|
+
catalogNote: 'catalog';
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'evicted-degraded';
|
|
49
|
+
id: string;
|
|
50
|
+
failure: string;
|
|
51
|
+
catalogNote: CatalogNote;
|
|
52
|
+
cause?: string;
|
|
53
|
+
} | {
|
|
54
|
+
kind: 'not-resident';
|
|
55
|
+
id: string;
|
|
56
|
+
releasedEarlier: boolean;
|
|
57
|
+
} | {
|
|
58
|
+
kind: 'still-resident';
|
|
59
|
+
id: string;
|
|
60
|
+
drainPending: boolean;
|
|
61
|
+
};
|
|
62
|
+
export type ReleaseFailureReason = 'unknown-id' | 'not-continuable' | 'no-drain-seam' | 'catalog-unreadable' | 'not-direct-child' | 'stale-parent';
|
|
63
|
+
/** A release gate error whose `message` IS the final §5 copy. */
|
|
64
|
+
export declare class ReleaseFailure extends Error {
|
|
65
|
+
readonly reason: ReleaseFailureReason;
|
|
66
|
+
constructor(reason: ReleaseFailureReason, message: string);
|
|
67
|
+
}
|
|
68
|
+
/** How long a drain may run before the caller reports still-resident (F4). */
|
|
69
|
+
export declare const DRAIN_OBSERVE_TIMEOUT_MS = 10000;
|
|
70
|
+
/** Enter the releasing state (pre-issuance; F12a). */
|
|
71
|
+
export declare function markReleasing(id: string): void;
|
|
72
|
+
/** Terminal success: move the id releasing → released. */
|
|
73
|
+
export declare function markReleased(id: string): void;
|
|
74
|
+
/** Withdraw a releasing mark; refused (no-op) while the id is released. */
|
|
75
|
+
export declare function clearReleasing(id: string): void;
|
|
76
|
+
export declare function isReleased(id: string): boolean;
|
|
77
|
+
export declare function isReleasing(id: string): boolean;
|
|
78
|
+
/** Test-only: clears BOTH sets. */
|
|
79
|
+
export declare function resetReleasedMarkers(): void;
|
|
80
|
+
/**
|
|
81
|
+
* Run one release against the authoritative drain seam. Gate errors precede
|
|
82
|
+
* any marking/drain; every transition is test-pinned (plan §4 D1 step list).
|
|
83
|
+
*/
|
|
84
|
+
export declare function runRelease(deps: {
|
|
85
|
+
parent: Agent;
|
|
86
|
+
id: string;
|
|
87
|
+
subagents: ReleaseSubagentsLike | undefined;
|
|
88
|
+
agents: ReleaseRegistryLike | undefined;
|
|
89
|
+
signal?: AbortSignal;
|
|
90
|
+
}): Promise<ReleaseOutcome>;
|
|
91
|
+
/**
|
|
92
|
+
* Render a release outcome as the final user-facing text. Every §5 variant
|
|
93
|
+
* is a verbatim contract; the descendant clause rides on every
|
|
94
|
+
* eviction-claiming string.
|
|
95
|
+
*/
|
|
96
|
+
export declare function renderReleaseOutcome(outcome: ReleaseOutcome): string;
|
|
97
|
+
export {};
|
|
98
|
+
//# sourceMappingURL=release.d.ts.map
|
|
@@ -0,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AAmB,GAAG,SAAS,CAAA;IACvC,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB,GAAG,OAAO,CAAC,cAAc,CAAC,CAoM1B;AAkBD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CA4BpE"}
|
package/lib/release.js
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared release operation: the single source of truth for evicting a direct
|
|
3
|
+
* continuable child's resident activation via the harness
|
|
4
|
+
* `drainContinuableChildren` seam (plan
|
|
5
|
+
* docs/plans/2026-09-30-subagent-release-valve.md §4 D1). Consumed by the
|
|
6
|
+
* model-facing `release_agent` tool and the human-facing
|
|
7
|
+
* `/agents release <id>` command, so both surfaces render ONE copy set (§5)
|
|
8
|
+
* and share ONE process-local marker state (F14: released rows are not
|
|
9
|
+
* representable upstream — the durable catalog survives a drain and reads
|
|
10
|
+
* `ready`).
|
|
11
|
+
*
|
|
12
|
+
* Residency derivation cross-reference: this module's registry reads derive
|
|
13
|
+
* residency exactly like the sibling sites `snapshot.ts residencyOf` (live
|
|
14
|
+
* `status === 'running'` → running, live-not-running → idle, absent →
|
|
15
|
+
* settled/ready) and `background-start.ts assertLiveCapacity` (a slot is held
|
|
16
|
+
* only while the registry reports `status === 'running'`).
|
|
17
|
+
* @module @dsh-cc/command-agents/release
|
|
18
|
+
*/
|
|
19
|
+
import { SessionId } from '@deepseek-ai/dsh-session';
|
|
20
|
+
/** A release gate error whose `message` IS the final §5 copy. */
|
|
21
|
+
export class ReleaseFailure extends Error {
|
|
22
|
+
reason;
|
|
23
|
+
constructor(reason, message) {
|
|
24
|
+
super(message);
|
|
25
|
+
this.reason = reason;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** How long a drain may run before the caller reports still-resident (F4). */
|
|
29
|
+
export const DRAIN_OBSERVE_TIMEOUT_MS = 10_000;
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
// Process-local markers (F14) — TWO sets: `releasing` and `released`.
|
|
32
|
+
// markReleasing(id) adds releasing-membership AFTER the final throwIfAborted
|
|
33
|
+
// and BEFORE drain issuance (F12a: an armed first-epoch collect resolves
|
|
34
|
+
// DURING the drain, so the releasing mark must already be visible then).
|
|
35
|
+
// markReleased(id) moves the id releasing → released (removes releasing
|
|
36
|
+
// membership).
|
|
37
|
+
// clearReleasing(id) removes releasing membership ONLY and is refused while
|
|
38
|
+
// the id is released (a no-op then) — the invariant that makes a concurrent
|
|
39
|
+
// retry's mark clobber-proof against a stale attempt's late handlers
|
|
40
|
+
// (critic r5 #3). The timeout arm KEEPS the releasing mark and attaches a
|
|
41
|
+
// late completion continuation (step 5). Snapshot tagging rule:
|
|
42
|
+
// (isReleased(id) || isReleasing(id)) && registry-absent-at-snapshot-time —
|
|
43
|
+
// never from the marker alone.
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
const releasing = new Set();
|
|
46
|
+
const released = new Set();
|
|
47
|
+
/** Enter the releasing state (pre-issuance; F12a). */
|
|
48
|
+
export function markReleasing(id) {
|
|
49
|
+
releasing.add(id);
|
|
50
|
+
}
|
|
51
|
+
/** Terminal success: move the id releasing → released. */
|
|
52
|
+
export function markReleased(id) {
|
|
53
|
+
releasing.delete(id);
|
|
54
|
+
released.add(id);
|
|
55
|
+
}
|
|
56
|
+
/** Withdraw a releasing mark; refused (no-op) while the id is released. */
|
|
57
|
+
export function clearReleasing(id) {
|
|
58
|
+
if (released.has(id))
|
|
59
|
+
return;
|
|
60
|
+
releasing.delete(id);
|
|
61
|
+
}
|
|
62
|
+
export function isReleased(id) {
|
|
63
|
+
return released.has(id);
|
|
64
|
+
}
|
|
65
|
+
export function isReleasing(id) {
|
|
66
|
+
return releasing.has(id);
|
|
67
|
+
}
|
|
68
|
+
/** Test-only: clears BOTH sets. */
|
|
69
|
+
export function resetReleasedMarkers() {
|
|
70
|
+
releasing.clear();
|
|
71
|
+
released.clear();
|
|
72
|
+
}
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
// Copy helpers (F15 normalization).
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
function errorText(error) {
|
|
77
|
+
return error instanceof Error ? error.message : String(error);
|
|
78
|
+
}
|
|
79
|
+
function catalogUnreadableCopy(id, cause) {
|
|
80
|
+
return `Cannot verify ${id} against this session's child catalog (${cause}); refusing to release blind. Retry, or restart the session if listing stays broken.`;
|
|
81
|
+
}
|
|
82
|
+
function failureMessage(reason, id, detail) {
|
|
83
|
+
switch (reason) {
|
|
84
|
+
case 'unknown-id':
|
|
85
|
+
return `No agent ${id} among this session's continuable children; use list_agents or /agents for current ids.`;
|
|
86
|
+
case 'not-continuable':
|
|
87
|
+
return `Agent ${id} is not a continuable child (mode: ${detail ?? 'unknown'}); release only covers continuable children.`;
|
|
88
|
+
case 'no-drain-seam':
|
|
89
|
+
return `Cannot release ${id}: this composition's subagents seam exposes no drainContinuableChildren; free capacity by letting children settle or by restarting the session.`;
|
|
90
|
+
case 'catalog-unreadable':
|
|
91
|
+
return catalogUnreadableCopy(id, detail ?? '');
|
|
92
|
+
case 'not-direct-child':
|
|
93
|
+
return `Agent ${id} is not a direct child of this session (the drain seam refused with UNAUTHORIZED); release its direct parent instead — if that parent is one of this session's children. Releasing a parent evicts its whole resident subtree.`;
|
|
94
|
+
case 'stale-parent':
|
|
95
|
+
return `This session's agent handle is stale (the drain seam refused with UNAUTHORIZED against the parent identity); retry the release, or restart the turn if it persists.`;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const NO_LIST_CHILDREN_CAUSE = 'the subagents seam exposes no listChildren';
|
|
99
|
+
function sleep(ms) {
|
|
100
|
+
return new Promise(resolve => { setTimeout(resolve, ms); });
|
|
101
|
+
}
|
|
102
|
+
function guardedRegistryRead(agents, id) {
|
|
103
|
+
if (agents === undefined || typeof agents.get !== 'function')
|
|
104
|
+
return { kind: 'unobservable' };
|
|
105
|
+
try {
|
|
106
|
+
const row = agents.get(id);
|
|
107
|
+
return row === undefined ? { kind: 'absent' } : { kind: 'present', status: row.status };
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
return { kind: 'unobservable' };
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function preStatusOf(status) {
|
|
114
|
+
if (status === 'running' || status === 'idle')
|
|
115
|
+
return status;
|
|
116
|
+
return 'unknown';
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Run one release against the authoritative drain seam. Gate errors precede
|
|
120
|
+
* any marking/drain; every transition is test-pinned (plan §4 D1 step list).
|
|
121
|
+
*/
|
|
122
|
+
export async function runRelease(deps) {
|
|
123
|
+
const { parent, id } = deps;
|
|
124
|
+
const subagents = deps.subagents;
|
|
125
|
+
const agents = deps.agents;
|
|
126
|
+
const signal = deps.signal ?? new AbortController().signal;
|
|
127
|
+
// Step 0: seam gates before any marking or drain.
|
|
128
|
+
if (subagents === undefined || typeof subagents.drainContinuableChildren !== 'function') {
|
|
129
|
+
throw new ReleaseFailure('no-drain-seam', failureMessage('no-drain-seam', id, undefined));
|
|
130
|
+
}
|
|
131
|
+
signal.throwIfAborted();
|
|
132
|
+
// Step 1: catalog read (guarded).
|
|
133
|
+
let catalog;
|
|
134
|
+
let catalogMode;
|
|
135
|
+
let catalogCause;
|
|
136
|
+
if (typeof subagents.listChildren !== 'function') {
|
|
137
|
+
catalog = 'unreadable';
|
|
138
|
+
catalogCause = NO_LIST_CHILDREN_CAUSE;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
try {
|
|
142
|
+
const rows = await subagents.listChildren(SessionId(parent.id), signal);
|
|
143
|
+
const row = rows.find(entry => String(entry.id) === id);
|
|
144
|
+
if (row === undefined) {
|
|
145
|
+
catalog = 'clean-miss';
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
catalog = 'clean-hit';
|
|
149
|
+
catalogMode = row.mode;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
if (signal.aborted)
|
|
154
|
+
throw error; // cancellation is never catalog failure
|
|
155
|
+
catalog = 'unreadable';
|
|
156
|
+
catalogCause = errorText(error);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
// Step 2: registry pre-read (guarded). `preStatus` is captured only on a hit.
|
|
160
|
+
const preRead = guardedRegistryRead(agents, id);
|
|
161
|
+
const preStatus = preRead.kind === 'present' ? preStatusOf(preRead.status) : undefined;
|
|
162
|
+
// Step 3: mode gate (clean catalog hit only).
|
|
163
|
+
if (catalog === 'clean-hit' && catalogMode !== 'continuable') {
|
|
164
|
+
throw new ReleaseFailure('not-continuable', failureMessage('not-continuable', id, catalogMode ?? 'unknown'));
|
|
165
|
+
}
|
|
166
|
+
// Step 4: the catalog × registry matrix.
|
|
167
|
+
if (catalog === 'clean-miss' && preRead.kind !== 'present') {
|
|
168
|
+
// miss × miss and miss × unobservable both refuse without a drain.
|
|
169
|
+
throw new ReleaseFailure('unknown-id', failureMessage('unknown-id', id, undefined));
|
|
170
|
+
}
|
|
171
|
+
if (catalog === 'unreadable' && preRead.kind !== 'present') {
|
|
172
|
+
// unreadable × miss and unreadable × unobservable refuse blind.
|
|
173
|
+
throw new ReleaseFailure('catalog-unreadable', catalogUnreadableCopy(id, catalogCause ?? ''));
|
|
174
|
+
}
|
|
175
|
+
if (catalog === 'clean-hit' && preRead.kind === 'absent') {
|
|
176
|
+
return { kind: 'not-resident', id, releasedEarlier: isReleased(id) };
|
|
177
|
+
}
|
|
178
|
+
// A drain row: catalogNote from the matrix.
|
|
179
|
+
const catalogNote = catalog === 'clean-hit' ? 'catalog'
|
|
180
|
+
: catalog === 'clean-miss' ? 'registry-only'
|
|
181
|
+
: 'catalog-unreadable';
|
|
182
|
+
// Step 5: the honored-cancellation checkpoint comes FIRST, then the mark,
|
|
183
|
+
// then issuance (critic r5 #1: an abort must never orphan a releasing mark
|
|
184
|
+
// on an unissued drain).
|
|
185
|
+
signal.throwIfAborted();
|
|
186
|
+
markReleasing(id);
|
|
187
|
+
const drain = subagents.drainContinuableChildren(parent, [SessionId(id)]);
|
|
188
|
+
const withCause = () => catalogNote === 'catalog-unreadable' && catalogCause !== undefined
|
|
189
|
+
? { cause: catalogCause }
|
|
190
|
+
: {};
|
|
191
|
+
// Race the drain against the observe timeout; the timer is cleared on BOTH
|
|
192
|
+
// settle arms (grok r5 #6: a leftover rejecting timer is an unhandled
|
|
193
|
+
// rejection on the happy path).
|
|
194
|
+
let timer;
|
|
195
|
+
const timedOut = new Promise(resolve => {
|
|
196
|
+
timer = setTimeout(() => resolve('timeout'), DRAIN_OBSERVE_TIMEOUT_MS);
|
|
197
|
+
});
|
|
198
|
+
const settled = await Promise.race([
|
|
199
|
+
drain.then(() => 'resolved', error => ({ kind: 'rejected', error })),
|
|
200
|
+
timedOut,
|
|
201
|
+
]).finally(() => { clearTimeout(timer); });
|
|
202
|
+
if (settled === 'timeout') {
|
|
203
|
+
// KEEP the releasing mark and attach a fully-total late continuation.
|
|
204
|
+
void drain.then(() => {
|
|
205
|
+
// Late resolve: absent ⇒ released (tag becomes visible); present ⇒
|
|
206
|
+
// clearReleasing (refused while released); unobservable ⇒ KEEP the
|
|
207
|
+
// releasing mark — a pure no-op, never a re-insert into releasing
|
|
208
|
+
// after markReleased (critic r6 #4 / grok r6 #6). Never throws.
|
|
209
|
+
try {
|
|
210
|
+
const read = guardedRegistryRead(agents, id);
|
|
211
|
+
if (read.kind === 'absent')
|
|
212
|
+
markReleased(id);
|
|
213
|
+
else if (read.kind === 'present')
|
|
214
|
+
clearReleasing(id);
|
|
215
|
+
// unobservable: keep the releasing mark (fail-open).
|
|
216
|
+
}
|
|
217
|
+
catch { /* total: swallow */ }
|
|
218
|
+
}, error => {
|
|
219
|
+
try {
|
|
220
|
+
const code = error?.code;
|
|
221
|
+
if (code === 'ACTIVATION_TEARDOWN_FAILED') {
|
|
222
|
+
// The seam's disposal order deletes the resident entry before
|
|
223
|
+
// throwing (F4) — the same evidence as the sync arm.
|
|
224
|
+
const read = guardedRegistryRead(agents, id);
|
|
225
|
+
if (read.kind !== 'present')
|
|
226
|
+
markReleased(id);
|
|
227
|
+
else
|
|
228
|
+
clearReleasing(id);
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
clearReleasing(id);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
catch { /* total: swallow */ }
|
|
235
|
+
});
|
|
236
|
+
return { kind: 'still-resident', id, drainPending: true };
|
|
237
|
+
}
|
|
238
|
+
if (typeof settled === 'object' && settled !== null && 'kind' in settled && settled.kind === 'rejected') {
|
|
239
|
+
const error = settled.error;
|
|
240
|
+
const message = errorText(error);
|
|
241
|
+
if (message.includes('not a direct child')) {
|
|
242
|
+
clearReleasing(id);
|
|
243
|
+
throw new ReleaseFailure('not-direct-child', failureMessage('not-direct-child', id, undefined));
|
|
244
|
+
}
|
|
245
|
+
if (message.includes('exact live parent')) {
|
|
246
|
+
clearReleasing(id);
|
|
247
|
+
throw new ReleaseFailure('stale-parent', failureMessage('stale-parent', id, undefined));
|
|
248
|
+
}
|
|
249
|
+
if (error?.code === 'ACTIVATION_TEARDOWN_FAILED') {
|
|
250
|
+
// F4's code-order pin: the resident entry is deleted BEFORE the throw,
|
|
251
|
+
// so absent-or-unobservable after this rejection is degraded success.
|
|
252
|
+
const read = guardedRegistryRead(agents, id);
|
|
253
|
+
if (read.kind !== 'present') {
|
|
254
|
+
markReleased(id);
|
|
255
|
+
return {
|
|
256
|
+
kind: 'evicted-degraded', id, failure: message, catalogNote, ...withCause(),
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
clearReleasing(id);
|
|
260
|
+
throw error;
|
|
261
|
+
}
|
|
262
|
+
clearReleasing(id);
|
|
263
|
+
throw error;
|
|
264
|
+
}
|
|
265
|
+
const preReadWasHit = preRead.kind === 'present';
|
|
266
|
+
if (!preReadWasHit) {
|
|
267
|
+
// Pre-read never observed residency — possible only on the catalog-hit
|
|
268
|
+
// row. Zero residency evidence means the released label is never
|
|
269
|
+
// claimable (orchestrator ruling on the unnamed cell, matching the r2/r3
|
|
270
|
+
// adultery guard class): post absent OR unobservable ⇒ issued (no mark,
|
|
271
|
+
// no slot claim); only a still-present read is evidence something was
|
|
272
|
+
// there, and then the bounded poll applies.
|
|
273
|
+
let post = guardedRegistryRead(agents, id);
|
|
274
|
+
for (let attempt = 1; attempt <= 10 && post.kind === 'present'; attempt++) {
|
|
275
|
+
await sleep(200);
|
|
276
|
+
post = guardedRegistryRead(agents, id);
|
|
277
|
+
}
|
|
278
|
+
clearReleasing(id);
|
|
279
|
+
return post.kind === 'present'
|
|
280
|
+
? { kind: 'still-resident', id, drainPending: false }
|
|
281
|
+
: { kind: 'issued-unobservable', id, catalogNote: 'catalog' };
|
|
282
|
+
}
|
|
283
|
+
let read = guardedRegistryRead(agents, id);
|
|
284
|
+
if (read.kind === 'absent') {
|
|
285
|
+
markReleased(id);
|
|
286
|
+
return { kind: 'released', id, preStatus: preStatus ?? 'unknown', catalogNote, ...withCause() };
|
|
287
|
+
}
|
|
288
|
+
if (read.kind === 'unobservable') {
|
|
289
|
+
// Observability died between pre- and post-read (grok r6 #3): the drain's
|
|
290
|
+
// resolution plus the pre-read hit is the eviction evidence; the tag's
|
|
291
|
+
// render degrades per §5's contradictions entry.
|
|
292
|
+
markReleased(id);
|
|
293
|
+
return { kind: 'released', id, preStatus: preStatus ?? 'unknown', catalogNote, ...withCause() };
|
|
294
|
+
}
|
|
295
|
+
for (let attempt = 1; attempt <= 10; attempt++) {
|
|
296
|
+
await sleep(200);
|
|
297
|
+
read = guardedRegistryRead(agents, id);
|
|
298
|
+
if (read.kind !== 'present') {
|
|
299
|
+
// absent: the F4 causation rule (pre-hit + resolved + post-absent ⇒
|
|
300
|
+
// released). unobservable after a pre-read HIT: observability died
|
|
301
|
+
// mid-flight (grok r6 #3) — the drain resolution is still eviction
|
|
302
|
+
// evidence; the tag's render degrades per §5's contradictions entry.
|
|
303
|
+
markReleased(id);
|
|
304
|
+
return { kind: 'released', id, preStatus: preStatus ?? 'unknown', catalogNote, ...withCause() };
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
clearReleasing(id);
|
|
308
|
+
return { kind: 'still-resident', id, drainPending: false };
|
|
309
|
+
}
|
|
310
|
+
// ---------------------------------------------------------------------------
|
|
311
|
+
// §5 copy renderer — ONE renderer keyed by (kind, preStatus, catalogNote).
|
|
312
|
+
// Every string here is a full-equality-pinned contract (plan §5).
|
|
313
|
+
// ---------------------------------------------------------------------------
|
|
314
|
+
/** Provenance prepends for the eviction-claiming kinds. */
|
|
315
|
+
function provenancePrepend(outcome, id) {
|
|
316
|
+
if (outcome.catalogNote === 'registry-only') {
|
|
317
|
+
return `(Note: ${id} was absent from the readable child catalog — released via the live registry only.) `;
|
|
318
|
+
}
|
|
319
|
+
if (outcome.catalogNote === 'catalog-unreadable') {
|
|
320
|
+
return `(Note: the child catalog was unreadable (${outcome.cause}) — released via the live registry only.) `;
|
|
321
|
+
}
|
|
322
|
+
return '';
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Render a release outcome as the final user-facing text. Every §5 variant
|
|
326
|
+
* is a verbatim contract; the descendant clause rides on every
|
|
327
|
+
* eviction-claiming string.
|
|
328
|
+
*/
|
|
329
|
+
export function renderReleaseOutcome(outcome) {
|
|
330
|
+
const { id } = outcome;
|
|
331
|
+
switch (outcome.kind) {
|
|
332
|
+
case 'released': {
|
|
333
|
+
const prepend = provenancePrepend(outcome, id);
|
|
334
|
+
const body = outcome.preStatus === 'running'
|
|
335
|
+
? `Released agent ${id}: its in-flight turn was aborted and its resident activation evicted — the capacity slot it held is free. Its resident descendants (if any) were evicted with it. The persisted session survives on disk. Within this session it cannot be continued (send_message resolves but runs no turn — upstream cold-resume-after-drain gap); /agents marks it [released] for the rest of this process.`
|
|
336
|
+
: outcome.preStatus === 'idle'
|
|
337
|
+
? `Released agent ${id}: its resident (idle) activation was evicted; it held no capacity slot (only running children count toward the 25-child guard). Its resident descendants (if any) were evicted with it. The persisted session survives on disk; within this session it cannot be continued (upstream cold-resume-after-drain gap); /agents marks it [released] for the rest of this process.`
|
|
338
|
+
: `Released agent ${id}: its resident activation was evicted; any capacity slot it held is free (its running state could not be observed). Its resident descendants (if any) were evicted with it. The persisted session survives on disk; within this session it cannot be continued (upstream cold-resume-after-drain gap); /agents marks it [released] for the rest of this process.`;
|
|
339
|
+
return prepend + body;
|
|
340
|
+
}
|
|
341
|
+
case 'issued-unobservable':
|
|
342
|
+
return `Release of agent ${id} was issued against the authoritative drain seam; this composition cannot observe the registry, so residency after the drain could not be confirmed and the child is NOT marked released. Eviction, when it applies, also covers resident descendants. If it was resident, the drain evicts it by the seam's own contract; its continuation state here is unknown.`;
|
|
343
|
+
case 'evicted-degraded': {
|
|
344
|
+
const prepend = provenancePrepend(outcome, id);
|
|
345
|
+
return prepend + `Release of agent ${id} reported a teardown failure (${outcome.failure}), but the activation entry is removed before that failure surfaces per the seam's disposal order — any capacity slot is free. Its resident descendants (if any) were evicted with it. The persisted session survives on disk; within this session it cannot be continued; /agents marks it [released] for the rest of this process.`;
|
|
346
|
+
}
|
|
347
|
+
case 'not-resident':
|
|
348
|
+
return outcome.releasedEarlier
|
|
349
|
+
? `Agent ${id} was released earlier in this process and has no resident activation; nothing was evicted.`
|
|
350
|
+
: `Agent ${id} has no resident activation (settled or released); nothing was evicted and no capacity slot is held by it.`;
|
|
351
|
+
case 'still-resident':
|
|
352
|
+
return outcome.drainPending
|
|
353
|
+
? `Release of agent ${id} is in flight: its turn did not reach idle within 10s (a cancel-resistant turn). The release still completes by itself if the turn ever becomes idle — /agents then marks it [released] — but nothing locally force-evicts a cancel-resistant turn; a process restart is the only hard boundary.`
|
|
354
|
+
: `Release of agent ${id} was issued, but the registry still reports it resident after the drain; check /agents detail ${id} and retry if it persists.`;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
//# sourceMappingURL=release.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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B,OAAO,OAAO,CAAC,eAAe;gBAC5B,CAAC,CAAC,SAAS,EAAE,4FAA4F;gBACzG,CAAC,CAAC,SAAS,EAAE,4GAA4G,CAAA;QAC7H,KAAK,gBAAgB;YACnB,OAAO,OAAO,CAAC,YAAY;gBACzB,CAAC,CAAC,oBAAoB,EAAE,kSAAkS;gBAC1T,CAAC,CAAC,oBAAoB,EAAE,iGAAiG,EAAE,4BAA4B,CAAA;IAC7J,CAAC;AACH,CAAC"}
|
package/lib/snapshot.d.ts
CHANGED
|
@@ -27,6 +27,12 @@ export interface AgentRow {
|
|
|
27
27
|
readonly hasChildren: boolean;
|
|
28
28
|
/** Pin state; `undefined` when the child has no resume pin. */
|
|
29
29
|
readonly pin?: AgentPinView;
|
|
30
|
+
/**
|
|
31
|
+
* Release-valve tag: the id sits in this process's released/releasing
|
|
32
|
+
* marker sets AND the row is `ready` (registry-absent at snapshot time) —
|
|
33
|
+
* per the D1 tagging rule, never from the marker alone.
|
|
34
|
+
*/
|
|
35
|
+
readonly released?: boolean;
|
|
30
36
|
/** The parent session id the listing was rooted at. */
|
|
31
37
|
readonly parentId: string;
|
|
32
38
|
}
|
|
@@ -94,6 +100,13 @@ export interface SnapshotServices {
|
|
|
94
100
|
id: string;
|
|
95
101
|
hasChildren?: boolean;
|
|
96
102
|
}[]>;
|
|
103
|
+
/**
|
|
104
|
+
* Release-valve markers (process-local, F14): optional so compositions
|
|
105
|
+
* without the release module still snapshot; when present they gate the
|
|
106
|
+
* `[released]` tag and the stop-copy overrides.
|
|
107
|
+
*/
|
|
108
|
+
isReleased?(id: string): boolean;
|
|
109
|
+
isReleasing?(id: string): boolean;
|
|
97
110
|
}
|
|
98
111
|
/**
|
|
99
112
|
* Extract the stable bracketed gate deny code from a persisted deny reason
|
|
@@ -130,6 +143,9 @@ export type ParsedAgentsInput = {
|
|
|
130
143
|
} | {
|
|
131
144
|
readonly kind: 'stop';
|
|
132
145
|
readonly id: string;
|
|
146
|
+
} | {
|
|
147
|
+
readonly kind: 'release';
|
|
148
|
+
readonly id: string;
|
|
133
149
|
} | {
|
|
134
150
|
readonly kind: 'error';
|
|
135
151
|
readonly text: string;
|
|
@@ -138,6 +154,8 @@ export type ParsedAgentsInput = {
|
|
|
138
154
|
export declare function stopRunningCopy(id: string): string;
|
|
139
155
|
/** Copy for a stop request on an idle/ready child (shared no-op explanation). */
|
|
140
156
|
export declare function stopNotRunningCopy(id: string, residency: string): string;
|
|
157
|
+
/** Copy for a stop request on a released (or releasing) child. */
|
|
158
|
+
export declare function stopReleasedCopy(id: string): string;
|
|
141
159
|
/** Copy for a stop/detail on an id the snapshot does not know. */
|
|
142
160
|
export declare function unknownAgentCopy(id: string): string;
|
|
143
161
|
/** Copy for the reserved `attach` namespace (P1). */
|
package/lib/snapshot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../src/snapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,gFAAgF;AAChF,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAA;AAEpD,iFAAiF;AACjF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAA;IAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED,+DAA+D;AAC/D,MAAM,WAAW,QAAQ;IACvB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,wEAAwE;IACxE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,iDAAiD;IACjD,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,0DAA0D;IAC1D,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAC7B,+DAA+D;IAC/D,QAAQ,CAAC,GAAG,CAAC,EAAE,YAAY,CAAA;IAC3B,uDAAuD;IACv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AQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC9C;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAErD,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,kEAAkE;AAClE,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,kEAAkE;AAClE,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,qDAAqD;AACrD,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAoB/D"}
|
package/lib/snapshot.js
CHANGED
|
@@ -62,11 +62,18 @@ export async function buildAgentsSnapshot(services, parentSessionId) {
|
|
|
62
62
|
if (entry.mode === 'one-shot')
|
|
63
63
|
continue;
|
|
64
64
|
const live = services.getAgent(String(entry.id));
|
|
65
|
+
const residency = residencyOf(live);
|
|
66
|
+
// Release-valve tagging rule (D1): the marker is process-local and the
|
|
67
|
+
// row must read registry-absent (`ready`) at snapshot time — never the
|
|
68
|
+
// marker alone (a live activation is not a released row).
|
|
69
|
+
const released = (services.isReleased?.(String(entry.id)) === true ||
|
|
70
|
+
services.isReleasing?.(String(entry.id)) === true) && residency === 'ready';
|
|
65
71
|
list.push({
|
|
66
72
|
id: String(entry.id),
|
|
67
73
|
...(entry.label !== undefined && entry.label.length > 0 ? { label: entry.label } : {}),
|
|
68
|
-
residency
|
|
74
|
+
residency,
|
|
69
75
|
hasChildren: childHasChildren.has(String(entry.id)),
|
|
76
|
+
...(released ? { released: true } : {}),
|
|
70
77
|
...(() => {
|
|
71
78
|
const pin = pinViewOf(services.readPin(String(entry.id)));
|
|
72
79
|
return pin === undefined ? {} : { pin };
|
|
@@ -117,7 +124,8 @@ export function renderAgentsList(rows) {
|
|
|
117
124
|
? ' [pin unreadable]'
|
|
118
125
|
: ' [pinned]';
|
|
119
126
|
const childrenTag = row.hasChildren ? ' [has children]' : '';
|
|
120
|
-
|
|
127
|
+
const releasedTag = row.released === true ? ' [released]' : '';
|
|
128
|
+
lines.push(` ${MARKERS[row.residency]} ${name} · ${shortIdOf(row.id)}${tag}${childrenTag}${releasedTag}`);
|
|
121
129
|
}
|
|
122
130
|
}
|
|
123
131
|
return lines.join('\n');
|
|
@@ -134,6 +142,12 @@ export function renderAgentDetail(row, pin, pinPath, parentSessionId) {
|
|
|
134
142
|
lines.push(` residency: ${row.residency}`);
|
|
135
143
|
lines.push(` children: ${row.hasChildren ? 'present' : 'none'}`);
|
|
136
144
|
lines.push(` parent session: ${parentSessionId}`);
|
|
145
|
+
// Release-valve detail line: BEFORE the pin early-return, so an unpinned
|
|
146
|
+
// released row still discloses its process-local state.
|
|
147
|
+
if (row.released === true) {
|
|
148
|
+
lines.push(' released: this process — resident activation evicted or release in flight; '
|
|
149
|
+
+ 'same-session continuation unavailable (upstream gap)');
|
|
150
|
+
}
|
|
137
151
|
if (pin === undefined) {
|
|
138
152
|
lines.push(' pin: none (not pinnable or not background-spawned)');
|
|
139
153
|
return lines.join('\n');
|
|
@@ -172,6 +186,10 @@ export function stopRunningCopy(id) {
|
|
|
172
186
|
export function stopNotRunningCopy(id, residency) {
|
|
173
187
|
return `Agent ${id} is not running (residency: ${residency}); nothing to stop — it is resumable.`;
|
|
174
188
|
}
|
|
189
|
+
/** Copy for a stop request on a released (or releasing) child. */
|
|
190
|
+
export function stopReleasedCopy(id) {
|
|
191
|
+
return `Agent ${id} was released (or its release is in flight) in this process; it cannot be continued here — nothing to stop.`;
|
|
192
|
+
}
|
|
175
193
|
/** Copy for a stop/detail on an id the snapshot does not know. */
|
|
176
194
|
export function unknownAgentCopy(id) {
|
|
177
195
|
return `No agent ${id} among this session's background agents; /agents lists current ids.`;
|
|
@@ -196,6 +214,12 @@ export function parseAgentsInput(raw) {
|
|
|
196
214
|
}
|
|
197
215
|
return { kind: 'stop', id: parts[1] };
|
|
198
216
|
}
|
|
217
|
+
if (parts[0] === 'release') {
|
|
218
|
+
if (parts.length < 2 || parts[1].length === 0) {
|
|
219
|
+
return { kind: 'error', text: 'Usage: /agents release <id>' };
|
|
220
|
+
}
|
|
221
|
+
return { kind: 'release', id: parts[1] };
|
|
222
|
+
}
|
|
199
223
|
if (parts[0] === 'attach') {
|
|
200
224
|
return { kind: 'error', text: attachReservedCopy() };
|
|
201
225
|
}
|
package/lib/snapshot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../src/snapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../src/snapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA4FH;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,MAAc;IACvC,MAAM,KAAK,GAAG,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACnD,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAC9C,CAAC;AAED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
|
"name": "@dsh-cc/command-agents",
|
|
3
3
|
"description": "Human-facing slash command to list, inspect, and stop continuable background agents",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.3-rc.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/dsh-cc/dsh-cc.git",
|
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
"types": "./lib/snapshot.d.ts",
|
|
18
18
|
"default": "./lib/snapshot.js"
|
|
19
19
|
},
|
|
20
|
+
"./release": {
|
|
21
|
+
"types": "./lib/release.d.ts",
|
|
22
|
+
"default": "./lib/release.js"
|
|
23
|
+
},
|
|
20
24
|
"./invariant": {
|
|
21
25
|
"types": "./lib/invariant.d.ts",
|
|
22
26
|
"default": "./lib/invariant.js"
|
|
@@ -29,11 +33,11 @@
|
|
|
29
33
|
],
|
|
30
34
|
"license": "Apache-2.0",
|
|
31
35
|
"peerDependencies": {
|
|
32
|
-
"@deepseek-ai/dsh-commands": ">=0.
|
|
33
|
-
"@deepseek-ai/dsh-invariants": ">=0.
|
|
34
|
-
"@deepseek-ai/dsh-session": ">=0.
|
|
35
|
-
"@deepseek-ai/cordis": ">=0.
|
|
36
|
-
"@dsh-cc/subagent-resume-pins": "^0.8.
|
|
36
|
+
"@deepseek-ai/dsh-commands": ">=0.2.0-rc.2",
|
|
37
|
+
"@deepseek-ai/dsh-invariants": ">=0.2.0-rc.2",
|
|
38
|
+
"@deepseek-ai/dsh-session": ">=0.2.0-rc.2",
|
|
39
|
+
"@deepseek-ai/cordis": ">=0.2.0-rc.2",
|
|
40
|
+
"@dsh-cc/subagent-resume-pins": "^0.8.3-rc.1"
|
|
37
41
|
},
|
|
38
42
|
"devDependencies": {
|
|
39
43
|
"@deepseek-ai/cordis-plugin-loader": "link:../../../../deepseek-harness/vendor/loader",
|
|
@@ -42,12 +46,12 @@
|
|
|
42
46
|
"@deepseek-ai/dsh-invariants": "link:../../../../deepseek-harness/packages/runtime-diagnostics/invariants",
|
|
43
47
|
"@deepseek-ai/dsh-session": "link:../../../../deepseek-harness/packages/core/session",
|
|
44
48
|
"@deepseek-ai/cordis": "link:../../../../deepseek-harness/vendor/cordis",
|
|
45
|
-
"@dsh-cc/subagent-resume-pins": "^0.8.
|
|
49
|
+
"@dsh-cc/subagent-resume-pins": "^0.8.3-rc.1"
|
|
46
50
|
},
|
|
47
51
|
"publishConfig": {
|
|
48
52
|
"access": "public"
|
|
49
53
|
},
|
|
50
54
|
"dependencies": {
|
|
51
|
-
"@dsh-cc/command-usage": "^0.8.
|
|
55
|
+
"@dsh-cc/command-usage": "^0.8.3-rc.1"
|
|
52
56
|
}
|
|
53
57
|
}
|