@wrongstack/core 0.77.0 → 0.84.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/dist/{agent-bridge-EWdqs8v6.d.ts → agent-bridge-C9P_HPez.d.ts} +2 -2
- package/dist/{agent-subagent-runner-D8qW8OSC.d.ts → agent-subagent-runner-2Aq0jOSj.d.ts} +107 -102
- package/dist/{compactor-D_ExJajC.d.ts → compactor-CJq7LQev.d.ts} +3 -3
- package/dist/{config-Dy0CK_o6.d.ts → config-_DZ7dN-T.d.ts} +77 -75
- package/dist/{context-y87Jc5ei.d.ts → context-ToHAp4-U.d.ts} +119 -90
- package/dist/coordination/index.d.ts +16 -16
- package/dist/coordination/index.js +318 -37
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +32 -32
- package/dist/defaults/index.js +433 -81
- package/dist/defaults/index.js.map +1 -1
- package/dist/{director-state-BmYi3DGA.d.ts → director-state-CgIc30qi.d.ts} +19 -19
- package/dist/{events-CYaoLN5_.d.ts → events-DnRqXaZ3.d.ts} +43 -42
- package/dist/execution/index.d.ts +53 -53
- package/dist/execution/index.js +72 -29
- package/dist/execution/index.js.map +1 -1
- package/dist/extension/index.d.ts +9 -9
- package/dist/extension/index.js +8 -1
- package/dist/extension/index.js.map +1 -1
- package/dist/{goal-store-C7jcumEh.d.ts → goal-store-DvWLNu52.d.ts} +4 -4
- package/dist/{index-DIxjTOga.d.ts → index-BNOLadHw.d.ts} +28 -28
- package/dist/{index-Dsda0uCn.d.ts → index-N0_c4bHQ.d.ts} +45 -45
- package/dist/index.d.ts +167 -167
- package/dist/index.js +617 -155
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +9 -9
- package/dist/infrastructure/index.js +13 -5
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +14 -14
- package/dist/kernel/index.js +7 -0
- package/dist/kernel/index.js.map +1 -1
- package/dist/logger-B72yyPc6.d.ts +12 -0
- package/dist/{logger-BppKxDqZ.d.ts → logger-C_27pj9i.d.ts} +6 -7
- package/dist/{mcp-servers-T0O6UN_w.d.ts → mcp-servers-Dck3T85_.d.ts} +20 -20
- package/dist/{mode-BO4SEUIv.d.ts → mode-CHo2XtHs.d.ts} +4 -4
- package/dist/models/index.d.ts +10 -10
- package/dist/models/index.js +8 -2
- package/dist/models/index.js.map +1 -1
- package/dist/{models-registry-BcYJDKLm.d.ts → models-registry-Be3osGt5.d.ts} +28 -28
- package/dist/{models-registry-Cuq1C8V9.d.ts → models-registry-Boz639EI.d.ts} +12 -12
- package/dist/{multi-agent-coordinator-DpbG3wiy.d.ts → multi-agent-coordinator-DllpCVkF.d.ts} +12 -12
- package/dist/{null-fleet-bus-u5ys3lW_.d.ts → null-fleet-bus-BY0AN-sr.d.ts} +121 -121
- package/dist/observability/index.d.ts +41 -41
- package/dist/observability/index.js.map +1 -1
- package/dist/{observability-BhnVLBLS.d.ts → observability-CoSNZdhX.d.ts} +4 -4
- package/dist/{parallel-eternal-engine-Dn0P8Pbj.d.ts → parallel-eternal-engine-D402RASp.d.ts} +49 -49
- package/dist/{path-resolver-B32v2JIq.d.ts → path-resolver-UPFTsDyD.d.ts} +6 -6
- package/dist/{permission-V5BLOrY6.d.ts → permission-14CChMmO.d.ts} +10 -8
- package/dist/{permission-policy-CBVx-d-8.d.ts → permission-policy-gW5htOo1.d.ts} +7 -7
- package/dist/{plan-templates-BcUwLlMQ.d.ts → plan-templates-DRvPgkfZ.d.ts} +65 -32
- package/dist/{provider-runner-CSi_7l0h.d.ts → provider-runner-COAJM8tC.d.ts} +6 -6
- package/dist/{retry-policy-CG3qvH_e.d.ts → retry-policy-DSu6O6rD.d.ts} +4 -4
- package/dist/sdd/index.d.ts +47 -47
- package/dist/sdd/index.js +47 -22
- package/dist/sdd/index.js.map +1 -1
- package/dist/{secret-scrubber-7rSC_emZ.d.ts → secret-scrubber-yGBFQYju.d.ts} +10 -2
- package/dist/security/index.d.ts +7 -7
- package/dist/security/index.js +15 -8
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-RvBR_YRW.d.ts → selector-11-fm95U.d.ts} +2 -2
- package/dist/{session-event-bridge-CDHxcmQU.d.ts → session-event-bridge-D0u-x576.d.ts} +7 -7
- package/dist/{session-reader-BIpwM60D.d.ts → session-reader-BQU-toaN.d.ts} +23 -23
- package/dist/{skill-CxuWrsKK.d.ts → skill-BJeF2DwY.d.ts} +1 -1
- package/dist/skills/index.d.ts +9 -9
- package/dist/skills/index.js +15 -3
- package/dist/skills/index.js.map +1 -1
- package/dist/storage/index.d.ts +15 -15
- package/dist/storage/index.js +378 -76
- package/dist/storage/index.js.map +1 -1
- package/dist/{system-prompt-CA11g6Jo.d.ts → system-prompt-C0rLCeyn.d.ts} +16 -11
- package/dist/{task-graph-D1YQbpxF.d.ts → task-graph-CikNdRTG.d.ts} +22 -22
- package/dist/types/index.d.ts +26 -26
- package/dist/types/index.js +53 -17
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +57 -45
- package/dist/utils/index.js +66 -12
- package/dist/utils/index.js.map +1 -1
- package/dist/{wstack-paths-D7evAFWM.d.ts → wstack-paths-BQMvEllz.d.ts} +2 -2
- package/package.json +1 -1
- package/dist/logger-DDd5C--Z.d.ts +0 -12
|
@@ -2,7 +2,7 @@ interface TextBlock {
|
|
|
2
2
|
type: 'text';
|
|
3
3
|
text: string;
|
|
4
4
|
cache_control?: {
|
|
5
|
-
type: 'ephemeral';
|
|
5
|
+
type: 'ephemeral' | undefined;
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
8
|
interface ToolUseBlock {
|
|
@@ -33,17 +33,17 @@ interface ToolResultBlock {
|
|
|
33
33
|
* only a session-local identifier and is not stable across replays.
|
|
34
34
|
* Always set by ToolExecutor; may be absent on manually-constructed blocks.
|
|
35
35
|
*/
|
|
36
|
-
name?: string;
|
|
36
|
+
name?: string | undefined;
|
|
37
37
|
content: string;
|
|
38
|
-
is_error?: boolean;
|
|
38
|
+
is_error?: boolean | undefined;
|
|
39
39
|
}
|
|
40
40
|
interface ImageBlock {
|
|
41
41
|
type: 'image';
|
|
42
42
|
source: {
|
|
43
43
|
type: 'base64' | 'url';
|
|
44
|
-
media_type?: string;
|
|
45
|
-
data?: string;
|
|
46
|
-
url?: string;
|
|
44
|
+
media_type?: string | undefined;
|
|
45
|
+
data?: string | undefined;
|
|
46
|
+
url?: string | undefined;
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
@@ -65,7 +65,7 @@ interface ImageBlock {
|
|
|
65
65
|
interface ThinkingBlock {
|
|
66
66
|
type: 'thinking';
|
|
67
67
|
thinking: string;
|
|
68
|
-
signature?: string;
|
|
68
|
+
signature?: string | undefined;
|
|
69
69
|
providerMeta?: Record<string, unknown>;
|
|
70
70
|
}
|
|
71
71
|
type ContentBlock = TextBlock | ToolUseBlock | ToolResultBlock | ImageBlock | ThinkingBlock;
|
|
@@ -155,15 +155,15 @@ declare class WrongStackError extends Error {
|
|
|
155
155
|
readonly subsystem: ErrorSubsystem;
|
|
156
156
|
readonly severity: ErrorSeverity;
|
|
157
157
|
readonly recoverable: boolean;
|
|
158
|
-
readonly context?: Record<string, unknown
|
|
158
|
+
readonly context?: Record<string, unknown> | undefined;
|
|
159
159
|
constructor(opts: {
|
|
160
160
|
message: string;
|
|
161
161
|
code: ErrorCode;
|
|
162
162
|
subsystem: ErrorSubsystem;
|
|
163
|
-
severity?: ErrorSeverity;
|
|
164
|
-
recoverable?: boolean;
|
|
165
|
-
context?: Record<string, unknown
|
|
166
|
-
cause?: unknown;
|
|
163
|
+
severity?: ErrorSeverity | undefined;
|
|
164
|
+
recoverable?: boolean | undefined;
|
|
165
|
+
context?: Record<string, unknown> | undefined;
|
|
166
|
+
cause?: unknown | undefined;
|
|
167
167
|
});
|
|
168
168
|
/**
|
|
169
169
|
* Render a one-line user-facing description.
|
|
@@ -180,9 +180,9 @@ declare class ToolError extends WrongStackError {
|
|
|
180
180
|
message: string;
|
|
181
181
|
code: Extract<ErrorCode, 'TOOL_NOT_FOUND' | 'TOOL_PERMISSION_DENIED' | 'TOOL_EXECUTION_FAILED' | 'TOOL_TIMEOUT' | 'TOOL_INPUT_INVALID'>;
|
|
182
182
|
toolName: string;
|
|
183
|
-
recoverable?: boolean;
|
|
184
|
-
context?: Record<string, unknown
|
|
185
|
-
cause?: unknown;
|
|
183
|
+
recoverable?: boolean | undefined;
|
|
184
|
+
context?: Record<string, unknown> | undefined;
|
|
185
|
+
cause?: unknown | undefined;
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
@@ -192,8 +192,8 @@ declare class ConfigError extends WrongStackError {
|
|
|
192
192
|
constructor(opts: {
|
|
193
193
|
message: string;
|
|
194
194
|
code: Extract<ErrorCode, 'CONFIG_INVALID' | 'CONFIG_NOT_FOUND' | 'CONFIG_PARSE_FAILED' | 'CONFIG_MIGRATION_NEEDED'>;
|
|
195
|
-
context?: Record<string, unknown
|
|
196
|
-
cause?: unknown;
|
|
195
|
+
context?: Record<string, unknown> | undefined;
|
|
196
|
+
cause?: unknown | undefined;
|
|
197
197
|
});
|
|
198
198
|
}
|
|
199
199
|
/**
|
|
@@ -205,8 +205,8 @@ declare class PluginError extends WrongStackError {
|
|
|
205
205
|
message: string;
|
|
206
206
|
code: Extract<ErrorCode, 'PLUGIN_LOAD_FAILED' | 'PLUGIN_API_MISMATCH' | 'PLUGIN_MISSING_DEPENDENCY'>;
|
|
207
207
|
pluginName: string;
|
|
208
|
-
context?: Record<string, unknown
|
|
209
|
-
cause?: unknown;
|
|
208
|
+
context?: Record<string, unknown> | undefined;
|
|
209
|
+
cause?: unknown | undefined;
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
212
|
/**
|
|
@@ -217,9 +217,9 @@ declare class AgentError extends WrongStackError {
|
|
|
217
217
|
constructor(opts: {
|
|
218
218
|
message: string;
|
|
219
219
|
code: Extract<ErrorCode, 'AGENT_ITERATION_LIMIT' | 'AGENT_CONTEXT_OVERFLOW' | 'AGENT_ABORTED' | 'AGENT_RUN_FAILED'>;
|
|
220
|
-
recoverable?: boolean;
|
|
221
|
-
context?: Record<string, unknown
|
|
222
|
-
cause?: unknown;
|
|
220
|
+
recoverable?: boolean | undefined;
|
|
221
|
+
context?: Record<string, unknown> | undefined;
|
|
222
|
+
cause?: unknown | undefined;
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
/**
|
|
@@ -233,26 +233,26 @@ declare function toWrongStackError(err: unknown, code?: Extract<ErrorCode, 'AGEN
|
|
|
233
233
|
* Session storage errors.
|
|
234
234
|
*/
|
|
235
235
|
declare class SessionError extends WrongStackError {
|
|
236
|
-
readonly sessionId?: string;
|
|
236
|
+
readonly sessionId?: string | undefined;
|
|
237
237
|
constructor(opts: {
|
|
238
238
|
message: string;
|
|
239
239
|
code: Extract<ErrorCode, 'SESSION_NOT_FOUND' | 'SESSION_CORRUPTED' | 'SESSION_WRITE_FAILED'>;
|
|
240
|
-
sessionId?: string;
|
|
241
|
-
context?: Record<string, unknown
|
|
242
|
-
cause?: unknown;
|
|
240
|
+
sessionId?: string | undefined;
|
|
241
|
+
context?: Record<string, unknown> | undefined;
|
|
242
|
+
cause?: unknown | undefined;
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
/**
|
|
246
246
|
* File system operation errors.
|
|
247
247
|
*/
|
|
248
248
|
declare class FsError extends WrongStackError {
|
|
249
|
-
readonly path?: string;
|
|
249
|
+
readonly path?: string | undefined;
|
|
250
250
|
constructor(opts: {
|
|
251
251
|
message: string;
|
|
252
252
|
code: Extract<ErrorCode, 'FS_READ_FAILED' | 'FS_WRITE_FAILED' | 'FS_MKDIR_FAILED' | 'FS_DELETE_FAILED' | 'FS_ATOMIC_WRITE_FAILED'>;
|
|
253
|
-
path?: string;
|
|
254
|
-
context?: Record<string, unknown
|
|
255
|
-
cause?: unknown;
|
|
253
|
+
path?: string | undefined;
|
|
254
|
+
context?: Record<string, unknown> | undefined;
|
|
255
|
+
cause?: unknown | undefined;
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
258
|
declare function isWrongStackError(err: unknown): err is WrongStackError;
|
|
@@ -275,12 +275,12 @@ type Permission = 'auto' | 'confirm' | 'deny';
|
|
|
275
275
|
*/
|
|
276
276
|
type RiskTier = 'safe' | 'standard' | 'destructive';
|
|
277
277
|
interface JSONSchema {
|
|
278
|
-
type?: string;
|
|
278
|
+
type?: string | undefined;
|
|
279
279
|
properties?: Record<string, JSONSchema>;
|
|
280
|
-
required?: string[];
|
|
281
|
-
items?: JSONSchema;
|
|
282
|
-
enum?: unknown[];
|
|
283
|
-
description?: string;
|
|
280
|
+
required?: string[] | undefined;
|
|
281
|
+
items?: JSONSchema | undefined;
|
|
282
|
+
enum?: unknown[] | undefined;
|
|
283
|
+
description?: string | undefined;
|
|
284
284
|
[k: string]: unknown;
|
|
285
285
|
}
|
|
286
286
|
/**
|
|
@@ -301,7 +301,7 @@ interface ToolProgressEvent {
|
|
|
301
301
|
* - `partial_output` — stream of textual output (bash stdout, fetch body)
|
|
302
302
|
*/
|
|
303
303
|
type: 'log' | 'warning' | 'metric' | 'file_changed' | 'partial_output';
|
|
304
|
-
text?: string;
|
|
304
|
+
text?: string | undefined;
|
|
305
305
|
data?: Record<string, unknown>;
|
|
306
306
|
}
|
|
307
307
|
/**
|
|
@@ -317,9 +317,9 @@ type ToolStreamEvent<O = unknown> = ToolProgressEvent | ToolFinalEvent<O>;
|
|
|
317
317
|
interface Tool<I = unknown, O = unknown> {
|
|
318
318
|
name: string;
|
|
319
319
|
description: string;
|
|
320
|
-
usageHint?: string;
|
|
320
|
+
usageHint?: string | undefined;
|
|
321
321
|
/** Optional category for grouping in help lists and system prompts. */
|
|
322
|
-
category?: string;
|
|
322
|
+
category?: string | undefined;
|
|
323
323
|
inputSchema: JSONSchema;
|
|
324
324
|
permission: Permission;
|
|
325
325
|
mutating: boolean;
|
|
@@ -329,7 +329,7 @@ interface Tool<I = unknown, O = unknown> {
|
|
|
329
329
|
* set. Defaults to `standard` when omitted — callers should always check
|
|
330
330
|
* `riskTier` after the basic permission decision.
|
|
331
331
|
*/
|
|
332
|
-
riskTier?: RiskTier;
|
|
332
|
+
riskTier?: RiskTier | undefined;
|
|
333
333
|
/**
|
|
334
334
|
* Input-field name that the permission policy should match trust rules
|
|
335
335
|
* against. Without this, the policy falls back to a heuristic
|
|
@@ -341,15 +341,15 @@ interface Tool<I = unknown, O = unknown> {
|
|
|
341
341
|
* The named field's value must be a string at runtime; non-string values
|
|
342
342
|
* fall back to the heuristic.
|
|
343
343
|
*/
|
|
344
|
-
subjectKey?: string;
|
|
345
|
-
maxOutputBytes?: number;
|
|
346
|
-
timeoutMs?: number;
|
|
344
|
+
subjectKey?: string | undefined;
|
|
345
|
+
maxOutputBytes?: number | undefined;
|
|
346
|
+
timeoutMs?: number | undefined;
|
|
347
347
|
/**
|
|
348
348
|
* Hint for the TUI spinner — does NOT affect actual timeout enforcement.
|
|
349
349
|
* Use `timeoutMs` for hard limits. Leave undefined when duration varies
|
|
350
350
|
* unpredictably.
|
|
351
351
|
*/
|
|
352
|
-
estimatedDurationMs?: number;
|
|
352
|
+
estimatedDurationMs?: number | undefined;
|
|
353
353
|
/**
|
|
354
354
|
* Declarative security capabilities granted by this tool.
|
|
355
355
|
*
|
|
@@ -362,7 +362,7 @@ interface Tool<I = unknown, O = unknown> {
|
|
|
362
362
|
* This field is optional for backward compatibility. Tools without it are
|
|
363
363
|
* treated conservatively by guards.
|
|
364
364
|
*/
|
|
365
|
-
capabilities?: readonly string[];
|
|
365
|
+
capabilities?: readonly string[] | undefined;
|
|
366
366
|
execute(input: I, ctx: Context, opts: {
|
|
367
367
|
signal: AbortSignal;
|
|
368
368
|
}): Promise<O>;
|
|
@@ -452,8 +452,8 @@ interface ToolCallContext {
|
|
|
452
452
|
interface Usage {
|
|
453
453
|
input: number;
|
|
454
454
|
output: number;
|
|
455
|
-
cacheRead?: number;
|
|
456
|
-
cacheWrite?: number;
|
|
455
|
+
cacheRead?: number | undefined;
|
|
456
|
+
cacheWrite?: number | undefined;
|
|
457
457
|
}
|
|
458
458
|
interface Capabilities {
|
|
459
459
|
tools: boolean;
|
|
@@ -469,15 +469,15 @@ interface Capabilities {
|
|
|
469
469
|
}
|
|
470
470
|
interface Request {
|
|
471
471
|
model: string;
|
|
472
|
-
system?: TextBlock[];
|
|
472
|
+
system?: TextBlock[] | undefined;
|
|
473
473
|
messages: Message[];
|
|
474
|
-
tools?: Tool[];
|
|
474
|
+
tools?: Tool[] | undefined;
|
|
475
475
|
maxTokens: number;
|
|
476
|
-
temperature?: number;
|
|
477
|
-
topP?: number;
|
|
478
|
-
stopSequences?: string[];
|
|
476
|
+
temperature?: number | undefined;
|
|
477
|
+
topP?: number | undefined;
|
|
478
|
+
stopSequences?: string[] | undefined;
|
|
479
479
|
toolChoice?: 'auto' | 'required' | 'none' | {
|
|
480
|
-
type: 'tool';
|
|
480
|
+
type: 'tool' | undefined;
|
|
481
481
|
name: string;
|
|
482
482
|
};
|
|
483
483
|
}
|
|
@@ -494,8 +494,8 @@ type StreamEvent = {
|
|
|
494
494
|
} | {
|
|
495
495
|
type: 'content_block_start';
|
|
496
496
|
kind: 'text' | 'tool_use' | 'thinking';
|
|
497
|
-
id?: string;
|
|
498
|
-
name?: string;
|
|
497
|
+
id?: string | undefined;
|
|
498
|
+
name?: string | undefined;
|
|
499
499
|
} | {
|
|
500
500
|
type: 'content_block_stop';
|
|
501
501
|
index: number;
|
|
@@ -552,28 +552,28 @@ interface Provider {
|
|
|
552
552
|
*/
|
|
553
553
|
interface ProviderErrorBody {
|
|
554
554
|
/** Provider-specific kind, e.g. "overloaded_error", "rate_limit_error", "invalid_request_error". */
|
|
555
|
-
type?: string;
|
|
555
|
+
type?: string | undefined;
|
|
556
556
|
/** Human-readable explanation from the provider. */
|
|
557
|
-
message?: string;
|
|
557
|
+
message?: string | undefined;
|
|
558
558
|
/** Provider request id, when present in the body or headers. */
|
|
559
|
-
requestId?: string;
|
|
559
|
+
requestId?: string | undefined;
|
|
560
560
|
/** Parsed Retry-After header (or equivalent body hint) in milliseconds. */
|
|
561
|
-
retryAfterMs?: number;
|
|
561
|
+
retryAfterMs?: number | undefined;
|
|
562
562
|
/** The raw response body (truncated to ~2 KB), kept for debugging. */
|
|
563
|
-
raw?: string;
|
|
563
|
+
raw?: string | undefined;
|
|
564
564
|
/** True when `raw` was truncated; check `rawLength` for the original size. */
|
|
565
|
-
truncated?: boolean;
|
|
565
|
+
truncated?: boolean | undefined;
|
|
566
566
|
/** Original length of the response body in bytes, when `truncated` is true. */
|
|
567
|
-
rawLength?: number;
|
|
567
|
+
rawLength?: number | undefined;
|
|
568
568
|
}
|
|
569
569
|
declare class ProviderError extends WrongStackError {
|
|
570
570
|
readonly status: number;
|
|
571
571
|
readonly retryable: boolean;
|
|
572
572
|
readonly providerId: string;
|
|
573
|
-
readonly body?: ProviderErrorBody;
|
|
573
|
+
readonly body?: ProviderErrorBody | undefined;
|
|
574
574
|
constructor(message: string, status: number, retryable: boolean, providerId: string, opts?: {
|
|
575
|
-
body?: ProviderErrorBody;
|
|
576
|
-
cause?: unknown;
|
|
575
|
+
body?: ProviderErrorBody | undefined;
|
|
576
|
+
cause?: unknown | undefined;
|
|
577
577
|
});
|
|
578
578
|
/**
|
|
579
579
|
* Render a one-line, user-facing description. Designed for the CLI/TUI
|
|
@@ -592,13 +592,13 @@ declare class ProviderError extends WrongStackError {
|
|
|
592
592
|
|
|
593
593
|
interface SessionMetadata {
|
|
594
594
|
id: string;
|
|
595
|
-
title?: string;
|
|
596
|
-
model?: string;
|
|
597
|
-
provider?: string;
|
|
595
|
+
title?: string | undefined;
|
|
596
|
+
model?: string | undefined;
|
|
597
|
+
provider?: string | undefined;
|
|
598
598
|
startedAt: string;
|
|
599
|
-
endedAt?: string;
|
|
599
|
+
endedAt?: string | undefined;
|
|
600
600
|
/** Set when a session is closed with open tool calls — used to restore pending state on resume. */
|
|
601
|
-
pendingToolUses?: string[];
|
|
601
|
+
pendingToolUses?: string[] | undefined;
|
|
602
602
|
}
|
|
603
603
|
/**
|
|
604
604
|
* SessionEvent — per-session persistent JSONL audit + reconstruct log.
|
|
@@ -658,9 +658,9 @@ type SessionEvent = {
|
|
|
658
658
|
model: string;
|
|
659
659
|
messageCount: number;
|
|
660
660
|
/** Estimated total input tokens for this request (messages + tools + system). */
|
|
661
|
-
estimatedInputTokens?: number;
|
|
661
|
+
estimatedInputTokens?: number | undefined;
|
|
662
662
|
/** Number of tools offered to the model in this request. */
|
|
663
|
-
toolCount?: number;
|
|
663
|
+
toolCount?: number | undefined;
|
|
664
664
|
} | {
|
|
665
665
|
type: 'llm_response';
|
|
666
666
|
ts: string;
|
|
@@ -685,8 +685,8 @@ type SessionEvent = {
|
|
|
685
685
|
before: number;
|
|
686
686
|
after: number;
|
|
687
687
|
/** Pressure level that triggered the compaction. */
|
|
688
|
-
level?: 'warn' | 'soft' | 'hard';
|
|
689
|
-
aggressive?: boolean;
|
|
688
|
+
level?: 'warn' | 'soft' | 'hard' | undefined;
|
|
689
|
+
aggressive?: boolean | undefined;
|
|
690
690
|
/** Summary of token savings per phase (elision, summary, selective). */
|
|
691
691
|
reductions?: Array<{
|
|
692
692
|
phase: string;
|
|
@@ -701,7 +701,7 @@ type SessionEvent = {
|
|
|
701
701
|
type: 'session_end';
|
|
702
702
|
ts: string;
|
|
703
703
|
usage: Usage;
|
|
704
|
-
pendingToolUses?: string[];
|
|
704
|
+
pendingToolUses?: string[] | undefined;
|
|
705
705
|
} | {
|
|
706
706
|
type: 'mode_changed';
|
|
707
707
|
ts: string;
|
|
@@ -775,10 +775,10 @@ type SessionEvent = {
|
|
|
775
775
|
durationMs: number;
|
|
776
776
|
/** Legacy field kept for backward compatibility. Prefer outputBytes. */
|
|
777
777
|
outputSize: number;
|
|
778
|
-
ok?: boolean;
|
|
779
|
-
outputBytes?: number;
|
|
780
|
-
outputTokens?: number;
|
|
781
|
-
outputLines?: number;
|
|
778
|
+
ok?: boolean | undefined;
|
|
779
|
+
outputBytes?: number | undefined;
|
|
780
|
+
outputTokens?: number | undefined;
|
|
781
|
+
outputLines?: number | undefined;
|
|
782
782
|
} | {
|
|
783
783
|
/** Lightweight sampled progress from Tool.executeStream (only at auditLevel 'full'). */
|
|
784
784
|
type: 'tool_progress';
|
|
@@ -787,7 +787,7 @@ type SessionEvent = {
|
|
|
787
787
|
id: string;
|
|
788
788
|
event: {
|
|
789
789
|
type: 'log' | 'warning' | 'metric' | 'file_changed' | 'partial_output';
|
|
790
|
-
text?: string;
|
|
790
|
+
text?: string | undefined;
|
|
791
791
|
data?: Record<string, unknown>;
|
|
792
792
|
};
|
|
793
793
|
} | {
|
|
@@ -801,13 +801,13 @@ type SessionEvent = {
|
|
|
801
801
|
providerId: string;
|
|
802
802
|
attempt: number;
|
|
803
803
|
delayMs: number;
|
|
804
|
-
status?: number;
|
|
804
|
+
status?: number | undefined;
|
|
805
805
|
description: string;
|
|
806
806
|
} | {
|
|
807
807
|
type: 'provider_error';
|
|
808
808
|
ts: string;
|
|
809
809
|
providerId: string;
|
|
810
|
-
status?: number;
|
|
810
|
+
status?: number | undefined;
|
|
811
811
|
description: string;
|
|
812
812
|
retryable: boolean;
|
|
813
813
|
} | {
|
|
@@ -859,9 +859,25 @@ interface SessionSummary {
|
|
|
859
859
|
id: string;
|
|
860
860
|
title: string;
|
|
861
861
|
startedAt: string;
|
|
862
|
+
/** When the session finished (null if still running / crashed). */
|
|
863
|
+
endedAt?: string | undefined;
|
|
862
864
|
model: string;
|
|
863
865
|
provider: string;
|
|
864
866
|
tokenTotal: number;
|
|
867
|
+
/** Number of LLM iterations (turn cycles). */
|
|
868
|
+
iterationCount?: number | undefined;
|
|
869
|
+
/** Number of tool calls executed. */
|
|
870
|
+
toolCallCount?: number | undefined;
|
|
871
|
+
/** Number of tool calls that returned an error. */
|
|
872
|
+
toolErrorCount?: number | undefined;
|
|
873
|
+
/** Number of files changed (created + modified + deleted). */
|
|
874
|
+
fileChangeCount?: number | undefined;
|
|
875
|
+
/** Per-tool breakdown: tool name → call count. */
|
|
876
|
+
toolBreakdown?: Record<string, number>;
|
|
877
|
+
/** Number of compaction events. */
|
|
878
|
+
compactionCount?: number | undefined;
|
|
879
|
+
/** Session outcome: 'completed', 'error', 'timeout', 'aborted', or undefined. */
|
|
880
|
+
outcome?: 'completed' | 'error' | 'timeout' | 'aborted' | undefined;
|
|
865
881
|
}
|
|
866
882
|
interface SessionData {
|
|
867
883
|
metadata: SessionMetadata;
|
|
@@ -891,6 +907,19 @@ interface SessionStore {
|
|
|
891
907
|
* Called by /clear to wipe persistent chat history.
|
|
892
908
|
*/
|
|
893
909
|
clearHistory(id: string): Promise<void>;
|
|
910
|
+
/**
|
|
911
|
+
* Delete sessions whose JSONL file mtime is older than maxAgeDays.
|
|
912
|
+
* Also removes associated summary files, plan/todos sidecars, and
|
|
913
|
+
* session directories. Returns the count of deleted sessions.
|
|
914
|
+
* Sessions referenced by active.json are never pruned.
|
|
915
|
+
*/
|
|
916
|
+
prune(maxAgeDays?: number): Promise<number>;
|
|
917
|
+
/**
|
|
918
|
+
* Rebuild the session index from disk. Scans all session directories,
|
|
919
|
+
* computes summaries, and writes a fresh _index.jsonl. Returns the
|
|
920
|
+
* number of sessions indexed.
|
|
921
|
+
*/
|
|
922
|
+
rebuildIndex?(): Promise<number>;
|
|
894
923
|
}
|
|
895
924
|
interface SessionWriter {
|
|
896
925
|
readonly id: string;
|
|
@@ -901,7 +930,7 @@ interface SessionWriter {
|
|
|
901
930
|
* this to tell the user *where* the transcript lives without
|
|
902
931
|
* having to recompute the path from session metadata.
|
|
903
932
|
*/
|
|
904
|
-
readonly transcriptPath?: string;
|
|
933
|
+
readonly transcriptPath?: string | undefined;
|
|
905
934
|
/** IDs of tool_use blocks that have been sent but not yet received a tool_result.
|
|
906
935
|
* Used by the REPL to serialize pending state into `session_end` for proper resume. */
|
|
907
936
|
readonly pendingToolUses: string[];
|
|
@@ -973,7 +1002,7 @@ interface CacheStats {
|
|
|
973
1002
|
hitRatio: number;
|
|
974
1003
|
}
|
|
975
1004
|
interface TokenCounter {
|
|
976
|
-
account(usage: Usage, model?: string): void;
|
|
1005
|
+
account(usage: Usage, model?: string): void | undefined;
|
|
977
1006
|
/**
|
|
978
1007
|
* Tokens from the most recently-accounted request (input + cacheRead).
|
|
979
1008
|
* Use this for per-request context pressure tracking (e.g. status bar
|
|
@@ -1106,20 +1135,20 @@ interface TodoItem {
|
|
|
1106
1135
|
id: string;
|
|
1107
1136
|
content: string;
|
|
1108
1137
|
status: 'pending' | 'in_progress' | 'completed';
|
|
1109
|
-
activeForm?: string;
|
|
1138
|
+
activeForm?: string | undefined;
|
|
1110
1139
|
}
|
|
1111
1140
|
interface RunOptions {
|
|
1112
|
-
signal?: AbortSignal;
|
|
1113
|
-
model?: string;
|
|
1114
|
-
executionStrategy?: 'parallel' | 'sequential' | 'smart';
|
|
1115
|
-
maxIterations?: number;
|
|
1141
|
+
signal?: AbortSignal | undefined;
|
|
1142
|
+
model?: string | undefined;
|
|
1143
|
+
executionStrategy?: 'parallel' | 'sequential' | 'smart' | undefined;
|
|
1144
|
+
maxIterations?: number | undefined;
|
|
1116
1145
|
/**
|
|
1117
1146
|
* Enable autonomous continue for this specific run. When true, the agent
|
|
1118
1147
|
* loop re-runs on `[continue]`/`[next step]`/`[proceed]` markers or
|
|
1119
1148
|
* `continue_to_next_iteration()` tool calls instead of returning.
|
|
1120
1149
|
* Overrides `AgentInit.autonomousContinue` for this call only.
|
|
1121
1150
|
*/
|
|
1122
|
-
autonomousContinue?: boolean;
|
|
1151
|
+
autonomousContinue?: boolean | undefined;
|
|
1123
1152
|
}
|
|
1124
1153
|
interface ContextInit {
|
|
1125
1154
|
systemPrompt: TextBlock[];
|
|
@@ -1130,7 +1159,7 @@ interface ContextInit {
|
|
|
1130
1159
|
cwd: string;
|
|
1131
1160
|
projectRoot: string;
|
|
1132
1161
|
model: string;
|
|
1133
|
-
tools?: Tool[];
|
|
1162
|
+
tools?: Tool[] | undefined;
|
|
1134
1163
|
}
|
|
1135
1164
|
/**
|
|
1136
1165
|
* L1-A: `Context` is the live agent-run object. Its read-only environment
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export { B as BrainArbiter, a as BrainDecision, b as BrainDecisionOption, c as BrainDecisionQueue, d as BrainDecisionRequest, e as BrainDecisionSource, f as BrainFallback, g as BrainRisk, D as DefaultBrainArbiter, h as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, l as formatHumanPrompt } from '../events-
|
|
2
|
-
export { A as ACP_AGENTS, a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, s as Director, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, H as FleetManager, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as LargeAnswerStore, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, P as RefactorPhase, Q as RefactorPlan, S as SECURITY_SCANNER_AGENT, T as SharedFileEntry, U as SharedFileSnapshot, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a0 as makeAskResultTool, a1 as makeAskTool, a2 as makeAssignTool, a3 as makeAwaitTasksTool, a4 as makeCollabDebugTool, a5 as makeDirectorSessionFactory, a6 as makeFleetEmitTool, a7 as makeFleetHealthTool, a8 as makeFleetSessionTool, a9 as makeFleetStatusTool, aa as makeFleetUsageTool, ab as makeRollUpTool, ac as makeSpawnTool, ad as makeTerminateTool, ae as makeWorkCompleteTool, af as rosterSummaryFromConfigs } from '../null-fleet-bus-
|
|
3
|
-
import { b as AgentDefinition } from '../multi-agent-coordinator-
|
|
4
|
-
export { T as AGENT_TOOL_PRESETS, A as AgentBudgetTier, a as AgentCapability, c as AgentPhase, D as DEFAULT_DISPATCH_ROLE, d as DefaultMultiAgentCoordinator, e as DispatchCandidate, f as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-
|
|
5
|
-
export { c as AgentFactory, d as AgentFactoryResult, e as AgentRunnerOptions, g as BudgetExceededError, h as BudgetKind, i as BudgetLimits, j as BudgetNegotiationMode, k as BudgetThresholdDecision, l as BudgetThresholdHandler, m as BudgetThresholdSignal, n as BudgetUsage, F as FleetBus, p as FleetEvent, q as FleetHandler, r as FleetUsage, s as FleetUsageAggregator, K as SubagentBudget, V as SubagentUsageSnapshot, _ as makeAgentSubagentRunner } from '../agent-subagent-runner-
|
|
6
|
-
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-
|
|
7
|
-
import '../context-
|
|
1
|
+
export { B as BrainArbiter, a as BrainDecision, b as BrainDecisionOption, c as BrainDecisionQueue, d as BrainDecisionRequest, e as BrainDecisionSource, f as BrainFallback, g as BrainRisk, D as DefaultBrainArbiter, h as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, l as formatHumanPrompt } from '../events-DnRqXaZ3.js';
|
|
2
|
+
export { A as ACP_AGENTS, a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, s as Director, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, H as FleetManager, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as LargeAnswerStore, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, P as RefactorPhase, Q as RefactorPlan, S as SECURITY_SCANNER_AGENT, T as SharedFileEntry, U as SharedFileSnapshot, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a0 as makeAskResultTool, a1 as makeAskTool, a2 as makeAssignTool, a3 as makeAwaitTasksTool, a4 as makeCollabDebugTool, a5 as makeDirectorSessionFactory, a6 as makeFleetEmitTool, a7 as makeFleetHealthTool, a8 as makeFleetSessionTool, a9 as makeFleetStatusTool, aa as makeFleetUsageTool, ab as makeRollUpTool, ac as makeSpawnTool, ad as makeTerminateTool, ae as makeWorkCompleteTool, af as rosterSummaryFromConfigs } from '../null-fleet-bus-BY0AN-sr.js';
|
|
3
|
+
import { b as AgentDefinition } from '../multi-agent-coordinator-DllpCVkF.js';
|
|
4
|
+
export { T as AGENT_TOOL_PRESETS, A as AgentBudgetTier, a as AgentCapability, c as AgentPhase, D as DEFAULT_DISPATCH_ROLE, d as DefaultMultiAgentCoordinator, e as DispatchCandidate, f as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-DllpCVkF.js';
|
|
5
|
+
export { c as AgentFactory, d as AgentFactoryResult, e as AgentRunnerOptions, g as BudgetExceededError, h as BudgetKind, i as BudgetLimits, j as BudgetNegotiationMode, k as BudgetThresholdDecision, l as BudgetThresholdHandler, m as BudgetThresholdSignal, n as BudgetUsage, F as FleetBus, p as FleetEvent, q as FleetHandler, r as FleetUsage, s as FleetUsageAggregator, K as SubagentBudget, V as SubagentUsageSnapshot, _ as makeAgentSubagentRunner } from '../agent-subagent-runner-2Aq0jOSj.js';
|
|
6
|
+
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-C9P_HPez.js';
|
|
7
|
+
import '../context-ToHAp4-U.js';
|
|
8
8
|
import 'node:events';
|
|
9
|
-
import '../director-state-
|
|
10
|
-
import '../config-
|
|
11
|
-
import '../models-registry-
|
|
12
|
-
import '../index-
|
|
13
|
-
import '../logger-
|
|
14
|
-
import '../system-prompt-
|
|
15
|
-
import '../observability-
|
|
9
|
+
import '../director-state-CgIc30qi.js';
|
|
10
|
+
import '../config-_DZ7dN-T.js';
|
|
11
|
+
import '../models-registry-Be3osGt5.js';
|
|
12
|
+
import '../index-N0_c4bHQ.js';
|
|
13
|
+
import '../logger-B72yyPc6.js';
|
|
14
|
+
import '../system-prompt-C0rLCeyn.js';
|
|
15
|
+
import '../observability-CoSNZdhX.js';
|
|
16
16
|
import '../secret-scrubber-3MHDDAtm.js';
|
|
17
|
-
import '../permission-
|
|
18
|
-
import '../retry-policy-
|
|
17
|
+
import '../permission-14CChMmO.js';
|
|
18
|
+
import '../retry-policy-DSu6O6rD.js';
|
|
19
19
|
|
|
20
20
|
/** Phase 1 · Discovery — map the territory before any work begins. */
|
|
21
21
|
declare const DISCOVERY_AGENTS: AgentDefinition[];
|