@namzu/cli 25.0.1 → 26.0.0
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/CHANGELOG.md +265 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +9 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/acp.d.ts.map +1 -1
- package/dist/commands/acp.js +5 -0
- package/dist/commands/acp.js.map +1 -1
- package/dist/commands/drain.d.ts.map +1 -1
- package/dist/commands/drain.js +5 -0
- package/dist/commands/drain.js.map +1 -1
- package/dist/commands/run-stream.d.ts.map +1 -1
- package/dist/commands/run-stream.js +5 -0
- package/dist/commands/run-stream.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +5 -0
- package/dist/commands/run.js.map +1 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +47 -0
- package/dist/config/load.js.map +1 -1
- package/dist/config/schema.d.ts +24 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/config/tool-result-screens.d.ts +103 -0
- package/dist/config/tool-result-screens.d.ts.map +1 -0
- package/dist/config/tool-result-screens.js +104 -0
- package/dist/config/tool-result-screens.js.map +1 -0
- package/dist/context/doctrine.d.ts +4 -2
- package/dist/context/doctrine.d.ts.map +1 -1
- package/dist/context/doctrine.js +4 -2
- package/dist/context/doctrine.js.map +1 -1
- package/dist/integrations/mcp/servers.d.ts +30 -0
- package/dist/integrations/mcp/servers.d.ts.map +1 -1
- package/dist/integrations/mcp/servers.js +32 -1
- package/dist/integrations/mcp/servers.js.map +1 -1
- package/dist/integrations/resident/session-step.d.ts.map +1 -1
- package/dist/integrations/resident/session-step.js +5 -0
- package/dist/integrations/resident/session-step.js.map +1 -1
- package/dist/integrations/subagents/activity.d.ts +285 -11
- package/dist/integrations/subagents/activity.d.ts.map +1 -1
- package/dist/integrations/subagents/activity.js +334 -31
- package/dist/integrations/subagents/activity.js.map +1 -1
- package/dist/integrations/subagents/replay.d.ts +46 -0
- package/dist/integrations/subagents/replay.d.ts.map +1 -0
- package/dist/integrations/subagents/replay.js +193 -0
- package/dist/integrations/subagents/replay.js.map +1 -0
- package/dist/integrations/subagents/runs.d.ts +72 -0
- package/dist/integrations/subagents/runs.d.ts.map +1 -0
- package/dist/integrations/subagents/runs.js +155 -0
- package/dist/integrations/subagents/runs.js.map +1 -0
- package/dist/integrations/subagents/runtime.d.ts +21 -0
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/subagents/runtime.js +134 -2
- package/dist/integrations/subagents/runtime.js.map +1 -1
- package/dist/tui/AgentExplorer.d.ts +46 -2
- package/dist/tui/AgentExplorer.d.ts.map +1 -1
- package/dist/tui/AgentExplorer.js +261 -22
- package/dist/tui/AgentExplorer.js.map +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +456 -28
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/ChoicePicker.d.ts +2 -0
- package/dist/tui/ChoicePicker.d.ts.map +1 -1
- package/dist/tui/ChoicePicker.js +3 -1
- package/dist/tui/ChoicePicker.js.map +1 -1
- package/dist/tui/Composer.d.ts +10 -7
- package/dist/tui/Composer.d.ts.map +1 -1
- package/dist/tui/Composer.js +2 -7
- package/dist/tui/Composer.js.map +1 -1
- package/dist/tui/StatusBar.d.ts +56 -10
- package/dist/tui/StatusBar.d.ts.map +1 -1
- package/dist/tui/StatusBar.js +106 -35
- package/dist/tui/StatusBar.js.map +1 -1
- package/dist/tui/agent.d.ts +46 -1
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/agent.js +55 -5
- package/dist/tui/agent.js.map +1 -1
- package/dist/tui/choice-selection.d.ts +3 -1
- package/dist/tui/choice-selection.d.ts.map +1 -1
- package/dist/tui/choice-selection.js +2 -2
- package/dist/tui/choice-selection.js.map +1 -1
- package/dist/tui/permission-review.d.ts.map +1 -1
- package/dist/tui/permission-review.js +14 -2
- package/dist/tui/permission-review.js.map +1 -1
- package/dist/tui/slashCommands.d.ts +40 -0
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/slashCommands.js +62 -3
- package/dist/tui/slashCommands.js.map +1 -1
- package/dist/tui/types.d.ts +12 -0
- package/dist/tui/types.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,9 +1,38 @@
|
|
|
1
1
|
import { type RunEvent, type TaskHandle } from '@namzu/sdk';
|
|
2
2
|
export declare const MAX_AGENT_ACTIVITY_LABEL_CODE_UNITS = 240;
|
|
3
3
|
export declare const MAX_AGENT_PHASE_ORDER = 10000;
|
|
4
|
+
/**
|
|
5
|
+
* Longest narration line kept. One line of commentary, not a message: a
|
|
6
|
+
* parent that writes a paragraph gets it clipped with the same marker every
|
|
7
|
+
* other retained label here carries.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MAX_NARRATION_CODE_UNITS = 200;
|
|
10
|
+
/**
|
|
11
|
+
* Narration lines retained at once, oldest dropped first.
|
|
12
|
+
*
|
|
13
|
+
* Small deliberately. The lines render in the most valuable rows on the
|
|
14
|
+
* screen — between the composer footer and the agent rail — so a parent that
|
|
15
|
+
* keeps talking must cost the operator a FIXED number of rows rather than a
|
|
16
|
+
* growing one. Raising this trades conversation for commentary.
|
|
17
|
+
*/
|
|
18
|
+
export declare const MAX_RETAINED_NARRATION = 3;
|
|
19
|
+
/**
|
|
20
|
+
* Appended to a replayed transcript whose saved records could not all be
|
|
21
|
+
* read, so a short transcript is never mistaken for a short run. Said in the
|
|
22
|
+
* transcript itself rather than only in a header, because the rows are what
|
|
23
|
+
* an operator reads as the whole of what happened.
|
|
24
|
+
*/
|
|
25
|
+
export declare const PARTIAL_EVIDENCE_NOTICE = "Saved transcript is damaged or truncated; this replay shows only the records that could be read.";
|
|
4
26
|
export declare const DEFAULT_AGENT_WORKFLOW = "Delegated work";
|
|
5
27
|
export declare const DEFAULT_AGENT_PHASE = "Work";
|
|
6
28
|
export type SubagentActivityStatus = 'starting' | 'queued' | 'working' | 'completed' | 'failed' | 'cancelled';
|
|
29
|
+
/**
|
|
30
|
+
* Only value produced today: a correction or context queued with
|
|
31
|
+
* `send_message`, delivered into a running child. Named for the receiving
|
|
32
|
+
* surface's point of view — the child received it — so the glyph each
|
|
33
|
+
* renderer picks stays unambiguous without re-reading the row's text.
|
|
34
|
+
*/
|
|
35
|
+
export type SubagentMessageDirection = 'to-child';
|
|
7
36
|
export type SubagentTranscriptRow = {
|
|
8
37
|
readonly id: string;
|
|
9
38
|
readonly kind: 'assistant';
|
|
@@ -18,6 +47,12 @@ export type SubagentTranscriptRow = {
|
|
|
18
47
|
readonly id: string;
|
|
19
48
|
readonly kind: 'system';
|
|
20
49
|
readonly text: string;
|
|
50
|
+
/**
|
|
51
|
+
* Set only for a delivered `send_message`; absent for every other
|
|
52
|
+
* system row (agent_failed, run_failed, the settle fallback), which
|
|
53
|
+
* render as before.
|
|
54
|
+
*/
|
|
55
|
+
readonly direction?: SubagentMessageDirection;
|
|
21
56
|
};
|
|
22
57
|
export interface SubagentActivity {
|
|
23
58
|
/** Stable for this screen even before the scheduler returns a task id. */
|
|
@@ -25,6 +60,17 @@ export interface SubagentActivity {
|
|
|
25
60
|
readonly taskId?: string;
|
|
26
61
|
readonly runId?: string;
|
|
27
62
|
readonly agentId: string;
|
|
63
|
+
/** The resolved child model, when a host supplied one at launch. */
|
|
64
|
+
readonly model?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Cumulative spend from the child's latest `token_usage_updated` event —
|
|
67
|
+
* never `contextTokens`, which shrinks on compaction and answers a
|
|
68
|
+
* different question. Absent means this child has not reported usage
|
|
69
|
+
* yet, which is a distinct fact from having spent zero.
|
|
70
|
+
*/
|
|
71
|
+
readonly tokens?: number;
|
|
72
|
+
/** Tool executions started so far, counted once per execution. */
|
|
73
|
+
readonly toolCalls?: number;
|
|
28
74
|
readonly description: string;
|
|
29
75
|
readonly prompt: string;
|
|
30
76
|
/** Direct tool batch that launched this concurrent sibling cohort. */
|
|
@@ -40,19 +86,146 @@ export interface SubagentActivity {
|
|
|
40
86
|
readonly workflow: string;
|
|
41
87
|
readonly phase: string;
|
|
42
88
|
readonly phaseOrder?: number;
|
|
89
|
+
/** Detail text the first agent to declare this phase supplied; later siblings never change it. */
|
|
90
|
+
readonly phaseDetail?: string;
|
|
43
91
|
readonly phaseSequence: number;
|
|
44
92
|
readonly status: SubagentActivityStatus;
|
|
45
93
|
readonly startedAt: number;
|
|
46
94
|
readonly completedAt?: number;
|
|
47
95
|
readonly latestActivity?: string;
|
|
48
96
|
readonly transcript: readonly SubagentTranscriptRow[];
|
|
97
|
+
/**
|
|
98
|
+
* This row was rebuilt from evidence a finished child left on disk, not
|
|
99
|
+
* projected from a child running in this process.
|
|
100
|
+
*
|
|
101
|
+
* Absent means live. It is on the record rather than inferred from
|
|
102
|
+
* `status` because the two answer different questions: a terminal status
|
|
103
|
+
* says the work ended, while this says nothing is attached to it any
|
|
104
|
+
* more — no task id the scheduler still knows, no stream, nothing a
|
|
105
|
+
* message or a cancellation could reach. Every surface that offers to act
|
|
106
|
+
* on a child reads this first, and the transcript says so on screen.
|
|
107
|
+
*/
|
|
108
|
+
readonly replayed?: boolean;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* One line of commentary the PARENT wrote about the work it is coordinating.
|
|
112
|
+
*
|
|
113
|
+
* Parent-authored is the whole design, not an implementation detail. A line a
|
|
114
|
+
* child emitted and this host rendered as the run's own voice would be
|
|
115
|
+
* untrusted text presented as trusted narration — the injection shape the
|
|
116
|
+
* coordinator's untrusted-output wrapping exists to prevent. Nothing here
|
|
117
|
+
* takes a line from a child: the tool that writes these is registered on the
|
|
118
|
+
* parent's registry only, exactly like `send_message`, and a child's roster is
|
|
119
|
+
* built from the host's own `buildTools()` which never carries it. If child
|
|
120
|
+
* narration is ever wanted it goes through that same wrapping and is
|
|
121
|
+
* attributed to the child by name.
|
|
122
|
+
*
|
|
123
|
+
* Commentary carries no status meaning. Nothing reads it back, no surface
|
|
124
|
+
* derives state from it, and a run with none looks exactly as it did before
|
|
125
|
+
* this existed.
|
|
126
|
+
*/
|
|
127
|
+
export interface SubagentNarrationLine {
|
|
128
|
+
/** Stable key for a renderer; unique for the life of this monitor. */
|
|
129
|
+
readonly id: string;
|
|
130
|
+
readonly text: string;
|
|
131
|
+
readonly at: number;
|
|
49
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* What {@link SubagentActivityMonitor.narrate} did with a line.
|
|
135
|
+
*
|
|
136
|
+
* Three cases rather than a line-or-nothing answer, because the two ways
|
|
137
|
+
* nothing is kept are not the same thing to whoever wrote the line: `empty`
|
|
138
|
+
* is a line with nothing in it, which the writer can fix by writing another
|
|
139
|
+
* one, and `closed` is a monitor that has stopped showing anything at all,
|
|
140
|
+
* which no further line will reach. Reporting the second as the first tells
|
|
141
|
+
* the writer to correct text that was never the problem.
|
|
142
|
+
*/
|
|
143
|
+
export type SubagentNarrationOutcome = {
|
|
144
|
+
readonly kind: 'shown';
|
|
145
|
+
readonly line: SubagentNarrationLine;
|
|
146
|
+
} | {
|
|
147
|
+
readonly kind: 'empty';
|
|
148
|
+
} | {
|
|
149
|
+
readonly kind: 'closed';
|
|
150
|
+
};
|
|
50
151
|
/** Read-only side of the current CLI session's child-run monitor. */
|
|
51
152
|
export interface SubagentActivitySource {
|
|
52
153
|
getSnapshot(): readonly SubagentActivity[];
|
|
53
154
|
subscribe(listener: () => void): () => void;
|
|
54
155
|
/** Start a new conversation scope; late events from the old one are ignored. */
|
|
55
156
|
reset(): void;
|
|
157
|
+
/**
|
|
158
|
+
* Bounded parent-authored commentary, oldest first.
|
|
159
|
+
*
|
|
160
|
+
* Optional because this is an ADDITIONAL projection over the same monitor,
|
|
161
|
+
* not part of what makes a source one: a host that publishes child rows and
|
|
162
|
+
* writes no commentary is complete without it, and absent reads as "no
|
|
163
|
+
* narration" at every call site.
|
|
164
|
+
*/
|
|
165
|
+
getNarration?(): readonly SubagentNarrationLine[];
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* The display grouping one delegation carries. Supplied at `begin()` and
|
|
169
|
+
* again on the child's `agent_pending` event, which is the copy that leaves
|
|
170
|
+
* this process; both name the same thing, and the monitor keeps the `begin()`
|
|
171
|
+
* values as the seed so a child that fails before the event ever arrives still
|
|
172
|
+
* groups where the operator saw it launch.
|
|
173
|
+
*
|
|
174
|
+
* Display-only, exactly as the `Agent` tool's schema says: these create no
|
|
175
|
+
* dependencies, barriers or serial execution. Phase IDENTITY stays
|
|
176
|
+
* monitor-owned (`phaseId`) and is never one of these labels.
|
|
177
|
+
*/
|
|
178
|
+
export interface SubagentDisplayLabels {
|
|
179
|
+
readonly workflow?: string;
|
|
180
|
+
readonly phase?: string;
|
|
181
|
+
readonly phaseOrder?: number;
|
|
182
|
+
readonly phaseDetail?: string;
|
|
183
|
+
}
|
|
184
|
+
/** What a host knows about a child at launch, before any event has arrived. */
|
|
185
|
+
export interface BeginSubagentInput {
|
|
186
|
+
readonly agentId: string;
|
|
187
|
+
readonly model?: string;
|
|
188
|
+
readonly description: string;
|
|
189
|
+
readonly prompt: string;
|
|
190
|
+
readonly batchId?: string;
|
|
191
|
+
readonly toolUseId?: string;
|
|
192
|
+
readonly workflowId?: string;
|
|
193
|
+
readonly workflow?: string;
|
|
194
|
+
readonly phase?: string;
|
|
195
|
+
readonly phaseOrder?: number;
|
|
196
|
+
readonly phaseDetail?: string;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* What a child's saved `run.json` supplies to
|
|
200
|
+
* {@link SubagentActivityMonitor.replay}, beside its transcript.
|
|
201
|
+
*
|
|
202
|
+
* Every field except `agentId` and `description` is optional, because
|
|
203
|
+
* `run.json` is written on a run's terminal path: a child killed before it
|
|
204
|
+
* got there leaves a transcript worth opening and a record that never
|
|
205
|
+
* recorded an ending. Absent is "the file did not say", and the projection
|
|
206
|
+
* keeps whatever the events established rather than substituting a zero.
|
|
207
|
+
*/
|
|
208
|
+
export interface ReplaySubagentInput {
|
|
209
|
+
readonly agentId: string;
|
|
210
|
+
readonly model?: string;
|
|
211
|
+
readonly description: string;
|
|
212
|
+
/**
|
|
213
|
+
* The child's instructions, when the caller has them.
|
|
214
|
+
*
|
|
215
|
+
* Defaults to empty rather than to invented text. A child's prompt is in
|
|
216
|
+
* its message snapshot, not in its durable event log, and reading a whole
|
|
217
|
+
* `messages.json` to recover one line is a cost this view does not pay.
|
|
218
|
+
*/
|
|
219
|
+
readonly prompt?: string;
|
|
220
|
+
readonly runId?: string;
|
|
221
|
+
readonly batchId?: string;
|
|
222
|
+
readonly workflowId?: string;
|
|
223
|
+
readonly status?: SubagentActivityStatus;
|
|
224
|
+
readonly tokens?: number;
|
|
225
|
+
readonly startedAt?: number;
|
|
226
|
+
readonly completedAt?: number;
|
|
227
|
+
/** Some records in the saved transcript could not be read. */
|
|
228
|
+
readonly partial?: boolean;
|
|
56
229
|
}
|
|
57
230
|
export interface SubagentActivityTracker {
|
|
58
231
|
readonly onEvent: (event: RunEvent) => void;
|
|
@@ -65,30 +238,131 @@ export interface SubagentActivityTracker {
|
|
|
65
238
|
* deltas can be arbitrarily large and the parent TUI must not inherit them.
|
|
66
239
|
*/
|
|
67
240
|
export declare class SubagentActivityMonitor implements SubagentActivitySource {
|
|
241
|
+
private readonly options;
|
|
68
242
|
private readonly records;
|
|
69
243
|
private readonly listeners;
|
|
244
|
+
/** Bounded parent commentary, oldest first. See {@link SubagentNarrationLine}. */
|
|
245
|
+
private readonly narration;
|
|
246
|
+
private narrationCounter;
|
|
70
247
|
private epoch;
|
|
71
248
|
private counter;
|
|
72
249
|
private fallbackBatchCounter;
|
|
73
250
|
private phaseCounter;
|
|
251
|
+
private messageCounter;
|
|
74
252
|
private readonly phases;
|
|
75
253
|
private notifyTimer;
|
|
76
254
|
private closed;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
readonly
|
|
87
|
-
})
|
|
255
|
+
/**
|
|
256
|
+
* `replay: true` seeds this monitor from saved evidence instead of a live
|
|
257
|
+
* child stream. Two things change and nothing else: notifications stop
|
|
258
|
+
* coalescing on a timer (there is no stream to coalesce, and a replay
|
|
259
|
+
* monitor is read once by whoever built it), and every row it publishes is
|
|
260
|
+
* marked {@link SubagentActivity.replayed}. The projection, the grouping
|
|
261
|
+
* and every bound are the ones the live path uses.
|
|
262
|
+
*/
|
|
263
|
+
constructor(options?: {
|
|
264
|
+
readonly replay?: boolean;
|
|
265
|
+
});
|
|
266
|
+
begin(input: BeginSubagentInput): SubagentActivityTracker;
|
|
267
|
+
/**
|
|
268
|
+
* `begin()`, plus the record it opened.
|
|
269
|
+
*
|
|
270
|
+
* Split out for {@link SubagentActivityMonitor.replay}, which has to reach
|
|
271
|
+
* the record after the events are in to write the facts `run.json` holds
|
|
272
|
+
* and the transcript does not. Nothing else needs it, and nothing outside
|
|
273
|
+
* this class gets it: a caller holding a `MutableActivity` could edit
|
|
274
|
+
* around every bound this file enforces.
|
|
275
|
+
*/
|
|
276
|
+
private open;
|
|
277
|
+
/**
|
|
278
|
+
* Rebuilds one finished child from the evidence it left on disk, and
|
|
279
|
+
* retains it here like any other row.
|
|
280
|
+
*
|
|
281
|
+
* The load-bearing line is the `tracker.onEvent` loop: saved events go
|
|
282
|
+
* through the SAME entry point a live child's events do, so the cockpit
|
|
283
|
+
* cannot drift from a replay. There is no second projection to keep in
|
|
284
|
+
* step, and a field added to the live path appears here for free.
|
|
285
|
+
*
|
|
286
|
+
* What the events cannot supply, the caller passes from `run.json`, and it
|
|
287
|
+
* is written AFTER the loop because the file is the authority on the two
|
|
288
|
+
* facts a child's own transcript never records: a child's delegation
|
|
289
|
+
* outcome and its final totals are reported on the PARENT's event stream,
|
|
290
|
+
* which does not enter the child's log. Without this the replay would end
|
|
291
|
+
* on whatever the last durable event said and show a finished child as
|
|
292
|
+
* still working.
|
|
293
|
+
*
|
|
294
|
+
* Only meaningful on a monitor constructed with `replay: true`; on a live
|
|
295
|
+
* one it would publish a saved row as though a child were attached to it.
|
|
296
|
+
*/
|
|
297
|
+
replay(input: ReplaySubagentInput, events: Iterable<RunEvent>): SubagentActivity;
|
|
298
|
+
/**
|
|
299
|
+
* Pushes a bounded system row recording a message delivered into a
|
|
300
|
+
* running child, through the same `pushRow` path every other transcript
|
|
301
|
+
* row uses. Callers own delivery: this only records that it happened, so
|
|
302
|
+
* it must run after the send it announces has actually succeeded — a
|
|
303
|
+
* refused or unowned send must never call this. A `taskId` with no
|
|
304
|
+
* matching record (already pruned, or never tracked) is a silent no-op:
|
|
305
|
+
* there is no row left to explain what was sent.
|
|
306
|
+
*/
|
|
307
|
+
recordMessage(taskId: string, text: string, direction: SubagentMessageDirection): void;
|
|
308
|
+
/**
|
|
309
|
+
* Retains one line of PARENT-authored commentary for the rail to show.
|
|
310
|
+
*
|
|
311
|
+
* Callers are the parent's own tool call and nothing else — see
|
|
312
|
+
* {@link SubagentNarrationLine} for why that boundary is the design rather
|
|
313
|
+
* than a detail. Blank or control-only text is dropped instead of retained,
|
|
314
|
+
* so a row is never spent on a line with nothing in it, and the answer
|
|
315
|
+
* names which of the two things happened — see
|
|
316
|
+
* {@link SubagentNarrationOutcome}.
|
|
317
|
+
*
|
|
318
|
+
* Independent of the child records: narration is commentary, so it neither
|
|
319
|
+
* needs a child to attach to nor disappears when the last one settles —
|
|
320
|
+
* which is exactly when a line explaining what happens next is worth most.
|
|
321
|
+
*/
|
|
322
|
+
narrate(text: string): SubagentNarrationOutcome;
|
|
323
|
+
getNarration(): readonly SubagentNarrationLine[];
|
|
88
324
|
getSnapshot(): readonly SubagentActivity[];
|
|
325
|
+
/** One record as the frozen, bounded shape every surface reads. */
|
|
326
|
+
private project;
|
|
89
327
|
subscribe(listener: () => void): () => void;
|
|
90
328
|
reset(): void;
|
|
91
329
|
close(): void;
|
|
330
|
+
/**
|
|
331
|
+
* Resolves display labels to this monitor's grouping identities.
|
|
332
|
+
*
|
|
333
|
+
* Phase identity is allocated here and only here, first-writer-wins per
|
|
334
|
+
* `[workflowGroupId, phase]`: the first agent to name a phase fixes its
|
|
335
|
+
* id, its display order and its detail text, and a later sibling that
|
|
336
|
+
* disagrees joins the phase rather than changing it. That is what keeps a
|
|
337
|
+
* pane from flickering between two wordings of the same stage, and it is
|
|
338
|
+
* also why calling this twice for one agent with the same labels is
|
|
339
|
+
* exactly a no-op — the second call finds the definition the first made.
|
|
340
|
+
*
|
|
341
|
+
* Definitions live for the conversation: `reset()` and `dispose()` clear
|
|
342
|
+
* them and nothing prunes them in between, so the map holds one entry per
|
|
343
|
+
* distinct `[workflowGroupId, phase]` anything has named. A host that
|
|
344
|
+
* labels one child differently at `begin()` and on its event defines two of
|
|
345
|
+
* them; the size follows how many wordings a host invents, not how long the
|
|
346
|
+
* session runs.
|
|
347
|
+
*/
|
|
348
|
+
private group;
|
|
349
|
+
/**
|
|
350
|
+
* Re-reads the grouping from the labels the child's own `agent_pending`
|
|
351
|
+
* carried.
|
|
352
|
+
*
|
|
353
|
+
* The event is the copy that leaves this process, so a host that supplies
|
|
354
|
+
* labels there and nowhere else still gets grouped. The `begin()` values
|
|
355
|
+
* stay the seed and are merged under the event's, which is what keeps an
|
|
356
|
+
* agent that fails before `agent_pending`
|
|
357
|
+
* ever arrives grouped where the operator saw it launch, and what stops a
|
|
358
|
+
* partially labelled event from erasing a label it never mentioned.
|
|
359
|
+
*
|
|
360
|
+
* An event naming none of the four changes nothing at all: the common case
|
|
361
|
+
* is the same labels arriving twice, where `group()` returns the definition
|
|
362
|
+
* `begin()` already made and every field is rewritten to the value it
|
|
363
|
+
* already held.
|
|
364
|
+
*/
|
|
365
|
+
private relabel;
|
|
92
366
|
private fallbackBatchId;
|
|
93
367
|
private prune;
|
|
94
368
|
private scheduleNotify;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../../src/integrations/subagents/activity.ts"],"names":[],"mappings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