@wrongstack/core 0.260.0 → 0.265.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-BbskZ7HH.d.ts → agent-bridge-DrkBxszZ.d.ts} +1 -1
- package/dist/{agent-subagent-runner-BNIGZx18.d.ts → agent-subagent-runner-DM2pP-B6.d.ts} +116 -12
- package/dist/{brain-C2yDd7Lw.d.ts → brain-BXd_61kQ.d.ts} +32 -3
- package/dist/{compactor-t0R_AIt_.d.ts → compactor-B8pOf45Y.d.ts} +1 -1
- package/dist/{config-FG6As4H5.d.ts → config-BMCj_XDs.d.ts} +86 -12
- package/dist/{context-JFOVvu6z.d.ts → context-MRk5PhNv.d.ts} +26 -1
- package/dist/coordination/index.d.ts +1737 -15
- package/dist/coordination/index.js +3152 -494
- package/dist/coordination/index.js.map +1 -1
- package/dist/{default-config-CXsDvOmP.d.ts → default-config-B0cj-Hry.d.ts} +11 -1
- package/dist/defaults/index.d.ts +28 -28
- package/dist/defaults/index.js +1804 -1363
- package/dist/defaults/index.js.map +1 -1
- package/dist/dispatcher-types.d-BBeXBQgS.d.ts +66 -0
- package/dist/execution/index.d.ts +16 -16
- package/dist/execution/index.js +933 -672
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/prompt-enhancer.d.ts +1 -1
- package/dist/execution/prompt-enhancer.js +7 -1
- package/dist/execution/prompt-enhancer.js.map +1 -1
- package/dist/extension/index.d.ts +6 -6
- package/dist/extension/index.js.map +1 -1
- package/dist/{goal-preamble-B1IXJtLX.d.ts → goal-preamble-DvHDSKSe.d.ts} +26 -10
- package/dist/{goal-store-CPXz6Mml.d.ts → goal-store-DtLMySNb.d.ts} +1 -1
- package/dist/{index-CebbJB94.d.ts → index-B-ch8K9C.d.ts} +8 -8
- package/dist/{index-BPcg4N3M.d.ts → index-CEDeNodM.d.ts} +5 -5
- package/dist/index.d.ts +189 -104
- package/dist/index.js +24693 -21162
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +6 -6
- package/dist/infrastructure/index.js +12 -8
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +9 -9
- package/dist/kernel/index.js +7 -2
- package/dist/kernel/index.js.map +1 -1
- package/dist/{llm-selector-DXxI2tlu.d.ts → llm-selector-C0tfTCUe.d.ts} +14 -2
- package/dist/{mcp-servers-OwNHo43-.d.ts → mcp-servers-2x4w6Jn9.d.ts} +3 -3
- package/dist/models/index.d.ts +5 -5
- package/dist/models/index.js +80 -31
- package/dist/models/index.js.map +1 -1
- package/dist/{models-registry-Djlmq4uB.d.ts → models-registry-DmJlKuNp.d.ts} +1 -1
- package/dist/{multi-agent-coordinator-CEmrSCMJ.d.ts → multi-agent-coordinator-DyCkCZnU.d.ts} +2 -2
- package/dist/{null-fleet-bus-DT92xqgJ.d.ts → null-fleet-bus-CG9QY2aP.d.ts} +6 -6
- package/dist/observability/index.d.ts +2 -2
- package/dist/observability/index.js +8 -3
- package/dist/observability/index.js.map +1 -1
- package/dist/{parallel-eternal-engine-0SItuq5r.d.ts → parallel-eternal-engine-Jw9uhEoT.d.ts} +9 -9
- package/dist/{path-resolver-DKBh6Jlo.d.ts → path-resolver-Dy2ej-gE.d.ts} +3 -3
- package/dist/{permission-BJ7eO9Vl.d.ts → permission-B9SB45lp.d.ts} +1 -1
- package/dist/{permission-policy-DEXOfnpm.d.ts → permission-policy-CkjSXabK.d.ts} +2 -2
- package/dist/{pipeline-zflkI2dp.d.ts → pipeline-DPDxH_7m.d.ts} +59 -4
- package/dist/{plan-templates-BFXyRkEK.d.ts → plan-templates-CzD9GnAU.d.ts} +32 -8
- package/dist/{provider-runner-BC-uywtT.d.ts → provider-runner-DMa70ODu.d.ts} +3 -3
- package/dist/{retry-policy-Cavrzmtk.d.ts → retry-policy-CN0khdlj.d.ts} +1 -1
- package/dist/sdd/index.d.ts +8 -8
- package/dist/sdd/index.js +313 -122
- package/dist/sdd/index.js.map +1 -1
- package/dist/{secret-vault-CDvDYXWX.d.ts → secret-vault-B2yw84VT.d.ts} +43 -4
- package/dist/secret-vault-BAKpgFw_.d.ts +57 -0
- package/dist/security/index.d.ts +5 -5
- package/dist/security/index.js +411 -225
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-B7AivHsu.d.ts → selector-CzHh_igB.d.ts} +1 -1
- package/dist/{session-event-bridge-BmIDxdJd.d.ts → session-event-bridge-BUI6Jf-4.d.ts} +8 -2
- package/dist/{session-reader-DtofsB-2.d.ts → session-reader-CMgdMSRP.d.ts} +1 -1
- package/dist/skills/index.js +67 -64
- package/dist/skills/index.js.map +1 -1
- package/dist/storage/index.d.ts +132 -16
- package/dist/storage/index.js +851 -432
- package/dist/storage/index.js.map +1 -1
- package/dist/tools/index.d.ts +57 -0
- package/dist/tools/index.js +411 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/types/index.d.ts +21 -21
- package/dist/types/index.js +928 -711
- package/dist/types/index.js.map +1 -1
- package/dist/utils/error.d.ts +7 -0
- package/dist/utils/error.js +8 -0
- package/dist/utils/error.js.map +1 -0
- package/dist/utils/index.d.ts +8 -68
- package/dist/utils/index.js +20 -10
- package/dist/utils/index.js.map +1 -1
- package/dist/{wstack-paths-CJjEwPXn.d.ts → wstack-paths-hOpNLmvf.d.ts} +2 -0
- package/package.json +5 -1
- package/skills/api-design/SKILL.md +1 -1
- package/skills/audit-log/SKILL.md +6 -6
- package/skills/bug-hunter/SKILL.md +5 -5
- package/skills/chimera/SKILL.md +4 -4
- package/skills/docker-deploy/SKILL.md +1 -1
- package/skills/git-flow/SKILL.md +3 -3
- package/skills/multi-agent/SKILL.md +3 -3
- package/skills/node-modern/SKILL.md +1 -0
- package/skills/observability/SKILL.md +2 -2
- package/skills/output-standards/SKILL.md +51 -28
- package/skills/refactor-planner/SKILL.md +3 -3
- package/skills/security-scanner/SKILL.md +4 -3
- package/skills/tech-stack/SKILL.md +1 -2
- package/dist/package-outdated-watcher-C70ag2G9.d.ts +0 -581
- package/dist/secret-vault-BJDY28ev.d.ts +0 -25
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BridgeTransport, a as BridgeMessage, A as AgentBridge, b as AgentBridgeConfig } from './agent-subagent-runner-
|
|
1
|
+
import { B as BridgeTransport, a as BridgeMessage, A as AgentBridge, b as AgentBridgeConfig } from './agent-subagent-runner-DM2pP-B6.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* In-memory pub/sub transport for agent-to-agent messaging.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { c as ToolCallPipelinePayload, d as ToolWrapper, E as ExtensionRegistry, S as SystemPromptContributor, e as ToolRegistry, P as ProviderRegistry, A as AgentPipelines, f as ToolExecutorLike, g as AgentInit, h as AgentInput, R as RunResult } from './index-
|
|
2
|
-
import { C as Container, R as ReadonlyPipeline, a as Renderer } from './pipeline-
|
|
3
|
-
import { E as EventBus, a as EventName, L as Listener } from './brain-
|
|
4
|
-
import { R as RetryPolicy, E as ErrorHandler } from './retry-policy-
|
|
1
|
+
import { c as ToolCallPipelinePayload, d as ToolWrapper, E as ExtensionRegistry, S as SystemPromptContributor, e as ToolRegistry, P as ProviderRegistry, A as AgentPipelines, f as ToolExecutorLike, g as AgentInit, h as AgentInput, R as RunResult } from './index-CEDeNodM.js';
|
|
2
|
+
import { C as Container, R as ReadonlyPipeline, a as Renderer } from './pipeline-DPDxH_7m.js';
|
|
3
|
+
import { E as EventBus, a as EventName, L as Listener } from './brain-BXd_61kQ.js';
|
|
4
|
+
import { R as RetryPolicy, E as ErrorHandler } from './retry-policy-CN0khdlj.js';
|
|
5
5
|
import { L as Logger } from './logger-B63L5bTg.js';
|
|
6
6
|
import { T as Tracer } from './observability-D-HZN_mF.js';
|
|
7
|
-
import { P as PermissionPolicy } from './permission-
|
|
8
|
-
import { U as Usage, C as Context, J as JSONSchema, R as Request, b as Response, g as ContentBlock, n as TextBlock, T as Tool, P as Provider, o as RunOptions } from './context-
|
|
9
|
-
import { W as WireFamily, H as HookEvent, e as HookMatcher, I as InProcessHook, h as Config } from './config-
|
|
7
|
+
import { P as PermissionPolicy } from './permission-B9SB45lp.js';
|
|
8
|
+
import { U as Usage, C as Context, J as JSONSchema, R as Request, b as Response, g as ContentBlock, n as TextBlock, T as Tool, P as Provider, o as RunOptions } from './context-MRk5PhNv.js';
|
|
9
|
+
import { W as WireFamily, H as HookEvent, e as HookMatcher, I as InProcessHook, h as Config } from './config-BMCj_XDs.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Single fleet-wide event with subagent attribution. Whatever a child
|
|
@@ -130,6 +130,23 @@ declare class FleetUsageAggregator {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
type BudgetKind = 'tool_calls' | 'iterations' | 'tokens' | 'timeout' | 'idle_timeout' | 'cost';
|
|
133
|
+
/**
|
|
134
|
+
* Fraction of the wall-clock `timeoutMs` window at which a PROACTIVE extension
|
|
135
|
+
* is negotiated — BEFORE the deadline is actually crossed. The coordinator
|
|
136
|
+
* watchdog (`executeWithTimeout`) arms at `timeoutMs * TIMEOUT_PREEMPT_FRACTION`
|
|
137
|
+
* so a still-progressing subagent gets its ceiling raised while it is below the
|
|
138
|
+
* limit, and never enters a "timed out" state. Reactive enforcement at the real
|
|
139
|
+
* deadline still stands for the no-progress / denied case. Shared so the asking
|
|
140
|
+
* side and any future caller agree on the same lead point.
|
|
141
|
+
*/
|
|
142
|
+
declare const TIMEOUT_PREEMPT_FRACTION = 0.85;
|
|
143
|
+
/**
|
|
144
|
+
* Hard safety net for budget negotiation decisions. If no listener responds to
|
|
145
|
+
* `budget.threshold_reached` within this window the negotiation defaults to
|
|
146
|
+
* `'stop'`. Exported so the coordinator's watchdog can reuse the same ceiling
|
|
147
|
+
* without hardcoding a second copy.
|
|
148
|
+
*/
|
|
149
|
+
declare const DECISION_TIMEOUT_MS = 60000;
|
|
133
150
|
declare class BudgetExceededError extends Error {
|
|
134
151
|
readonly kind: BudgetKind;
|
|
135
152
|
readonly limit: number;
|
|
@@ -215,7 +232,18 @@ type BudgetThresholdHandler = (info: {
|
|
|
215
232
|
used: number;
|
|
216
233
|
limit: number;
|
|
217
234
|
requestDecision: () => Promise<BudgetThresholdDecision>;
|
|
218
|
-
|
|
235
|
+
/**
|
|
236
|
+
* Direct grant/deny hooks for SYNCHRONOUS policy or recording handlers that
|
|
237
|
+
* decide in-process without a wired `budget.threshold_reached` listener
|
|
238
|
+
* (e.g. the coordinator watchdog). `extend` patches the limits in place;
|
|
239
|
+
* `deny` records the intent to stop. Production listener-driven handlers use
|
|
240
|
+
* `requestDecision()` instead and can ignore these.
|
|
241
|
+
*/
|
|
242
|
+
extend?: (extra: Partial<BudgetLimits>) => void;
|
|
243
|
+
deny?: () => void;
|
|
244
|
+
}) => 'throw' | 'continue' | 'stop' | {
|
|
245
|
+
extend: Partial<BudgetLimits>;
|
|
246
|
+
} | Promise<BudgetThresholdDecision>;
|
|
219
247
|
/**
|
|
220
248
|
* Per-subagent budget enforcement. Each subagent gets its own instance so a
|
|
221
249
|
* runaway agent can't drain the cost ceiling of its siblings. All record/check
|
|
@@ -237,6 +265,12 @@ type BudgetThresholdHandler = (info: {
|
|
|
237
265
|
*/
|
|
238
266
|
declare class SubagentBudget {
|
|
239
267
|
readonly limits: Readonly<BudgetLimits>;
|
|
268
|
+
/** Patch one or more budget limits in-place after construction.
|
|
269
|
+
* Used by the coordinator watchdog when granting an extension.
|
|
270
|
+
* All fields are optional — only provided fields are updated.
|
|
271
|
+
* This is the single write path for limit mutations so that future
|
|
272
|
+
* validation or side-effects live in one place (M1). */
|
|
273
|
+
patchLimits(ext: Partial<BudgetLimits>): void;
|
|
240
274
|
private iterations;
|
|
241
275
|
private toolCalls;
|
|
242
276
|
private tokenInput;
|
|
@@ -263,6 +297,32 @@ declare class SubagentBudget {
|
|
|
263
297
|
* Used to emit `budget.threshold_reached` events in `'auto'` mode.
|
|
264
298
|
*/
|
|
265
299
|
_events?: EventBus | undefined;
|
|
300
|
+
/**
|
|
301
|
+
* Guard against dual-path races between the coordinator watchdog
|
|
302
|
+
* (`executeWithTimeout`) and the budget's own `checkTimeout()`.
|
|
303
|
+
* Both paths detect `elapsed >= timeoutMs` and can emit
|
|
304
|
+
* `budget.threshold_reached` for kind `'timeout'` simultaneously.
|
|
305
|
+
* Set to the current `timeoutMs` ceiling by the coordinator BEFORE
|
|
306
|
+
* calling `onThreshold`, and cleared after the negotiation resolves.
|
|
307
|
+
* `checkTimeout()` skips its wall-clock check while this is set so
|
|
308
|
+
* the coordinator's watchdog is the sole source of wall-clock timeout
|
|
309
|
+
* events — `checkTimeout()` focuses exclusively on `idle_timeout`.
|
|
310
|
+
*/
|
|
311
|
+
private _watchdogActive;
|
|
312
|
+
/** Returns the timeout ceiling currently being negotiated by the watchdog,
|
|
313
|
+
* or `undefined` when no wall-clock negotiation is in flight.
|
|
314
|
+
* Used by `executeWithTimeout` to detect a stale lock (M3). */
|
|
315
|
+
get watchdogActive(): number | undefined;
|
|
316
|
+
/** Called by the coordinator watchdog BEFORE calling `onThreshold` so that
|
|
317
|
+
* `checkTimeout()` skips its wall-clock check for this ceiling. Prevents
|
|
318
|
+
* the budget's own `checkTimeout()` from emitting a second
|
|
319
|
+
* `budget.threshold_reached` event while the watchdog is already
|
|
320
|
+
* negotiating the same wall-clock deadline (C1). */
|
|
321
|
+
setWatchdogNegotiation(timeoutMs: number): void;
|
|
322
|
+
/** Clears the watchdog guard after negotiation resolves. Called in the
|
|
323
|
+
* `finally` block of both the pre-empt and deadline branches so it fires
|
|
324
|
+
* on every exit path: grant, deny, throw, or error. */
|
|
325
|
+
clearWatchdogNegotiation(): void;
|
|
266
326
|
/**
|
|
267
327
|
* Negotiation mode — controls whether a threshold hit tries to emit
|
|
268
328
|
* `budget.threshold_reached` and wait for a coordinator decision, or
|
|
@@ -320,6 +380,24 @@ declare class SubagentBudget {
|
|
|
320
380
|
* Returns the kinds that were found to be exceeded (for logging/debugging).
|
|
321
381
|
*/
|
|
322
382
|
private checkLimits;
|
|
383
|
+
/**
|
|
384
|
+
* Invoke `onThreshold` once for `entry` on the NO-LISTENER path and report
|
|
385
|
+
* whether it decided synchronously. Returns `true` when the handler returned
|
|
386
|
+
* a synchronous decision (already honored — an `extend` patched the limits),
|
|
387
|
+
* or `false` when it returned a Promise (async; the caller hard-stops, since
|
|
388
|
+
* there is no listener to resolve the negotiation). The handler is given the
|
|
389
|
+
* full info shape (`requestDecision` plus direct `extend`/`deny`) so both
|
|
390
|
+
* recording handlers and policy handlers work without a wired listener.
|
|
391
|
+
*/
|
|
392
|
+
private _invokeHandlerSync;
|
|
393
|
+
/**
|
|
394
|
+
* Emit `budget.threshold_reached` and resolve to the listener's verdict.
|
|
395
|
+
* Resolves to `'stop'` immediately when there is no listener (or no bus) so
|
|
396
|
+
* no negotiation can hang and no fallback timer leaks. Mirrors the
|
|
397
|
+
* coordinator watchdog's own request path so both agree on the no-listener
|
|
398
|
+
* default.
|
|
399
|
+
*/
|
|
400
|
+
private _busRequestDecision;
|
|
323
401
|
/**
|
|
324
402
|
* Per-kind in-flight negotiation Promises. Each budget kind can have its
|
|
325
403
|
* own concurrent negotiation — e.g. iterations and timeout can both
|
|
@@ -415,6 +493,15 @@ interface SubagentConfig {
|
|
|
415
493
|
* default reaper for delegated subagents (see `applyRosterBudget`).
|
|
416
494
|
*/
|
|
417
495
|
idleTimeoutMs?: number | undefined;
|
|
496
|
+
/**
|
|
497
|
+
* Fraction of `timeoutMs` at which the proactive pre-empt fires (0.0–1.0).
|
|
498
|
+
* At this point the watchdog negotiates a ceiling extension while the
|
|
499
|
+
* agent is still under its limit, so a progressing agent gets its
|
|
500
|
+
* ceiling raised before ever entering a timed-out state.
|
|
501
|
+
* Defaults to `TIMEOUT_PREEMPT_FRACTION` (0.85). Lower values fire earlier;
|
|
502
|
+
* higher values fire closer to the deadline. Ignored when `timeoutMs` is unset.
|
|
503
|
+
*/
|
|
504
|
+
preemptFraction?: number | undefined;
|
|
418
505
|
tools?: string[] | undefined;
|
|
419
506
|
/**
|
|
420
507
|
* Tools to explicitly disable for this subagent. These tools will be
|
|
@@ -966,8 +1053,23 @@ interface Plugin {
|
|
|
966
1053
|
* defaultConfig: { ttl: 3600, maxSize: 100 }
|
|
967
1054
|
*/
|
|
968
1055
|
defaultConfig?: Record<string, unknown>;
|
|
969
|
-
|
|
970
|
-
|
|
1056
|
+
/**
|
|
1057
|
+
* Called by the host to activate the plugin. Receives the `PluginAPI`
|
|
1058
|
+
* and an optional `AbortSignal` the plugin should respect for
|
|
1059
|
+
* cancellation and timeout. `setup` must complete before the plugin is
|
|
1060
|
+
* considered loaded; if it times out the plugin is rejected.
|
|
1061
|
+
*/
|
|
1062
|
+
setup(api: PluginAPI, opts?: {
|
|
1063
|
+
signal?: AbortSignal | undefined;
|
|
1064
|
+
}): void | Promise<void>;
|
|
1065
|
+
/**
|
|
1066
|
+
* Called by the host during unload. Receives the same `PluginAPI` instance
|
|
1067
|
+
* the plugin saw during `setup` and an optional `AbortSignal`. Teardown
|
|
1068
|
+
* is best-effort — a timeout does not prevent other plugins from unloading.
|
|
1069
|
+
*/
|
|
1070
|
+
teardown?(api: PluginAPI, opts?: {
|
|
1071
|
+
signal?: AbortSignal | undefined;
|
|
1072
|
+
}): void | Promise<void>;
|
|
971
1073
|
/**
|
|
972
1074
|
* Optional health check. Called by the host (e.g. `/diag plugins` slash
|
|
973
1075
|
* command or health endpoint) to surface plugin status. Return
|
|
@@ -986,7 +1088,9 @@ declare class Agent {
|
|
|
986
1088
|
readonly events: EventBus;
|
|
987
1089
|
readonly pipelines: AgentPipelines;
|
|
988
1090
|
readonly ctx: Context;
|
|
989
|
-
|
|
1091
|
+
/** Max agent-loop iterations per run. Mutable so the TUI `/settings` picker
|
|
1092
|
+
* can apply a new value to the live session (takes effect next run). */
|
|
1093
|
+
maxIterations: number;
|
|
990
1094
|
readonly executionStrategy: 'parallel' | 'sequential' | 'smart';
|
|
991
1095
|
readonly perIterationOutputCapBytes: number;
|
|
992
1096
|
private readonly plugins;
|
|
@@ -1082,4 +1186,4 @@ interface AgentRunnerOptions {
|
|
|
1082
1186
|
*/
|
|
1083
1187
|
declare function makeAgentSubagentRunner(opts: AgentRunnerOptions): SubagentRunner;
|
|
1084
1188
|
|
|
1085
|
-
export {
|
|
1189
|
+
export { makeAgentSubagentRunner as $, type AgentBridge as A, type BridgeTransport as B, type CoordinatorStatus as C, type DoneCondition as D, type BudgetNegotiationMode as E, FleetBus as F, type BudgetThresholdDecision as G, type BudgetThresholdHandler as H, BudgetThresholdSignal as I, type BudgetUsage as J, type CoordinatorEvents as K, DECISION_TIMEOUT_MS as L, type MultiAgentCoordinator as M, type FleetEvent as N, type FleetHandler as O, type PluginAPI as P, SubagentBudget as Q, type SubagentContext as R, type SubagentConfig as S, type TaskSpec as T, type SubagentError as U, type SubagentErrorKind as V, type SubagentRunContext as W, type SubagentRunOutcome as X, type SubagentUsageSnapshot as Y, TIMEOUT_PREEMPT_FRACTION as Z, type TaskDelegation as _, type BridgeMessage as a, withDisabledToolFiltering as a0, type ProviderFactory as a1, type AgentBridgeConfig as b, type MultiAgentConfig as c, type SubagentRunner as d, type SpawnResult as e, type TaskResult as f, Agent as g, type AgentFactory as h, type FleetUsage as i, FleetUsageAggregator as j, type SlashCommand as k, type PluginPipelines as l, type ToolRegistryView as m, type ProviderRegistryView as n, type MCPRegistryView as o, type SlashCommandRegistryView as p, type SessionWriterView as q, type MetricsSinkView as r, type PluginCapabilities as s, type PluginDependency as t, type Plugin as u, type AgentFactoryResult as v, type AgentRunnerOptions as w, BudgetExceededError as x, type BudgetKind as y, type BudgetLimits as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { U as Usage, C as Context, j as ToolProgressEvent, T as Tool } from './context-
|
|
1
|
+
import { U as Usage, C as Context, j as ToolProgressEvent, T as Tool } from './context-MRk5PhNv.js';
|
|
2
2
|
|
|
3
3
|
type MemoryScope = 'project-agents' | 'project-memory' | 'user-memory';
|
|
4
4
|
type MemoryType = 'fact' | 'decision' | 'convention' | 'preference' | 'reference' | 'anti_pattern';
|
|
@@ -256,8 +256,16 @@ interface EventMap {
|
|
|
256
256
|
id: string;
|
|
257
257
|
event: ToolProgressEvent;
|
|
258
258
|
};
|
|
259
|
+
/** Cache hit on session store load — used by observability layers. */
|
|
260
|
+
'storage.cache_hit': {
|
|
261
|
+
sessionId: string;
|
|
262
|
+
store: string;
|
|
263
|
+
filePath: string;
|
|
264
|
+
operation: string;
|
|
265
|
+
durationMs: number;
|
|
266
|
+
};
|
|
259
267
|
/**
|
|
260
|
-
* Fired when a tool call needs
|
|
268
|
+
* Fired when a tool call needs confirmation
|
|
261
269
|
* is registered on the executor. The TUI renders a confirmation dialog
|
|
262
270
|
* from this event. Resolution is driven by calling the resolve function
|
|
263
271
|
* passed in the payload with a decision string ('yes' | 'no' | 'always' | 'deny').
|
|
@@ -801,6 +809,27 @@ interface EventMap {
|
|
|
801
809
|
durationMs?: number;
|
|
802
810
|
traceId?: string;
|
|
803
811
|
};
|
|
812
|
+
/**
|
|
813
|
+
* Real-time client status event. Emitted by TUI/CLI/WebUI to report current
|
|
814
|
+
* session stats (tool calls, tokens, model, mode, cost). Broadcast immediately
|
|
815
|
+
* to all WebUI clients via setup-events.ts and written to status.json for
|
|
816
|
+
* external watchers.
|
|
817
|
+
*/
|
|
818
|
+
'client.status': {
|
|
819
|
+
clientType: string;
|
|
820
|
+
clientId: string;
|
|
821
|
+
projectHash: string;
|
|
822
|
+
agentCount: number;
|
|
823
|
+
model: string;
|
|
824
|
+
mode: string;
|
|
825
|
+
toolCalls: number;
|
|
826
|
+
inputTokens: number;
|
|
827
|
+
outputTokens: number;
|
|
828
|
+
cacheTokens: number;
|
|
829
|
+
costUsd: number;
|
|
830
|
+
timestamp: number;
|
|
831
|
+
projectSlug: string;
|
|
832
|
+
};
|
|
804
833
|
error: {
|
|
805
834
|
err: Error;
|
|
806
835
|
phase: string;
|
|
@@ -1057,4 +1086,4 @@ declare class DefaultBrainArbiter implements BrainArbiter {
|
|
|
1057
1086
|
}
|
|
1058
1087
|
declare function formatHumanPrompt(request: BrainDecisionRequest): string;
|
|
1059
1088
|
|
|
1060
|
-
export { type BrainArbiter as B, DefaultBrainArbiter as D, EventBus as E, HumanEscalatingBrainArbiter as H, type Listener as L, type MemoryScope as M, ObservableBrainArbiter as O, type ScoredEntry as S, type EventName as a, type
|
|
1089
|
+
export { type BrainArbiter as B, DefaultBrainArbiter as D, EventBus as E, HumanEscalatingBrainArbiter as H, type Listener as L, type MemoryScope as M, ObservableBrainArbiter as O, type ScoredEntry as S, type EventName as a, type MemoryEntry as b, type MemoryStore as c, type MemoryRelevanceContext as d, type BrainDecision as e, type BrainDecisionOption as f, BrainDecisionQueue as g, type BrainDecisionRequest as h, type BrainDecisionSource as i, type BrainFallback as j, type BrainRisk as k, type DefaultBrainArbiterOptions as l, type EventLogger as m, type EventMap as n, MEMORY_TYPE_LABELS as o, type MemoryClearedPayload as p, type MemoryConsolidatedPayload as q, type MemoryForgottenPayload as r, type MemoryPriority as s, type MemoryRememberedPayload as t, type MemoryType as u, ScopedEventBus as v, formatHumanPrompt as w };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as Capabilities, f as Permission } from './context-
|
|
1
|
+
import { k as Capabilities, f as Permission } from './context-MRk5PhNv.js';
|
|
2
2
|
|
|
3
3
|
type ContextWindowModeId = 'balanced' | 'frugal' | 'deep' | 'archival';
|
|
4
4
|
type ContextWindowAggressiveOn = 'hard' | 'soft' | 'warn';
|
|
@@ -224,6 +224,25 @@ interface ModelsRegistry {
|
|
|
224
224
|
ageSeconds(): Promise<number>;
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
+
/**
|
|
228
|
+
* Token-saving mode tier levels. Controls how aggressively the system prompt
|
|
229
|
+
* is compacted to reduce per-request token consumption.
|
|
230
|
+
*
|
|
231
|
+
* - 'off' — Full prompt, all tools, complete guidance (no reduction)
|
|
232
|
+
* - 'minimal' — TIER1 tools only (~10), stripped guidance (~3-4k tokens saved)
|
|
233
|
+
* - 'light' — Core + memory tools (~14), common patterns, minimal guidance
|
|
234
|
+
* - 'medium' — Most development tools (~24), some guidance (default when `true`)
|
|
235
|
+
* - 'aggressive' — Maximum savings before tools become unusable (~4-5k tokens saved)
|
|
236
|
+
*/
|
|
237
|
+
type TokenSavingTier = 'off' | 'minimal' | 'light' | 'medium' | 'aggressive';
|
|
238
|
+
/**
|
|
239
|
+
* Normalize a TokenSavingTier value, handling backward-compatible boolean inputs.
|
|
240
|
+
* - `true` → 'medium' (existing behavior)
|
|
241
|
+
* - `false` → 'off'
|
|
242
|
+
* - string values are returned as-is after validation
|
|
243
|
+
* - `undefined` → 'off'
|
|
244
|
+
*/
|
|
245
|
+
declare function normalizeTokenSavingTier(val?: TokenSavingTier | boolean): TokenSavingTier;
|
|
227
246
|
interface ContextConfig {
|
|
228
247
|
/** Context-window policy mode. Controls compaction thresholds and preservation depth. */
|
|
229
248
|
mode?: ContextWindowModeId | undefined;
|
|
@@ -252,6 +271,30 @@ interface ContextConfig {
|
|
|
252
271
|
/** Enable LLM-driven selective compaction (default: false for backward compat). */
|
|
253
272
|
llmSelector?: boolean | undefined;
|
|
254
273
|
}
|
|
274
|
+
/**
|
|
275
|
+
* Runtime configuration for the process circuit breaker (the one owned by the
|
|
276
|
+
* ProcessRegistry that gates `bash`/`exec`). Toggle via `/settings breaker`.
|
|
277
|
+
*
|
|
278
|
+
* The breaker itself is a low-level primitive (`packages/tools/.../circuit-breaker.ts`)
|
|
279
|
+
* that is on by default; this section controls whether the registry actually
|
|
280
|
+
* participates in it and how it auto-recovers.
|
|
281
|
+
*/
|
|
282
|
+
interface CircuitBreakerRuntimeConfig {
|
|
283
|
+
/**
|
|
284
|
+
* Enable circuit-breaker protection. When false (the default), the breaker
|
|
285
|
+
* is bypassed — `bash`/`exec` calls always proceed regardless of failure
|
|
286
|
+
* history. When true, the breaker trips on repeated failures / slow calls /
|
|
287
|
+
* bursts and blocks further calls until it recovers.
|
|
288
|
+
*/
|
|
289
|
+
enabled?: boolean | undefined;
|
|
290
|
+
/**
|
|
291
|
+
* When the breaker trips, automatically kill all tracked processes AND
|
|
292
|
+
* reset the breaker to closed after this delay (ms). 0 = disabled (manual
|
|
293
|
+
* recovery only via `/kill reset`). Only effective when `enabled` is true.
|
|
294
|
+
* While armed, the statusline shows a live countdown to the kill/reset.
|
|
295
|
+
*/
|
|
296
|
+
autoKillResetMs?: number | undefined;
|
|
297
|
+
}
|
|
255
298
|
interface ToolsConfig {
|
|
256
299
|
defaultExecutionStrategy: 'parallel' | 'sequential' | 'smart';
|
|
257
300
|
maxIterations: number;
|
|
@@ -263,6 +306,14 @@ interface ToolsConfig {
|
|
|
263
306
|
* limit by 100 when hit. Set to false to require user confirmation.
|
|
264
307
|
*/
|
|
265
308
|
autoExtendLimit?: boolean | undefined;
|
|
309
|
+
/**
|
|
310
|
+
* When true, file tools (read/write/edit/grep/glob/install) are confined to
|
|
311
|
+
* the project root and `set_working_dir` may not leave it. Default: false —
|
|
312
|
+
* tools may access paths outside the project root, still subject to each
|
|
313
|
+
* tool's permission tier (writes/edits prompt for confirmation). Toggle via
|
|
314
|
+
* `/settings` ("Filesystem access").
|
|
315
|
+
*/
|
|
316
|
+
restrictToProjectRoot?: boolean | undefined;
|
|
266
317
|
}
|
|
267
318
|
interface ProviderApiKey {
|
|
268
319
|
/** Short human-readable label (e.g. "personal", "work", "rate-limit-backup"). */
|
|
@@ -278,10 +329,12 @@ interface ProviderApiKey {
|
|
|
278
329
|
interface ProviderConfig {
|
|
279
330
|
type: string;
|
|
280
331
|
/**
|
|
281
|
-
* Legacy single-key field. Still honored as a fallback when `apiKeys`
|
|
282
|
-
* is empty
|
|
283
|
-
*
|
|
284
|
-
*
|
|
332
|
+
* Legacy single-key field. Still honored as a read fallback when `apiKeys`
|
|
333
|
+
* is empty (for configs not yet migrated to multi-key format). After key
|
|
334
|
+
* management operations (`writeKeysBack`), this field is **cleared** to
|
|
335
|
+
* prevent accidental serialization of the plaintext key. Consumers that
|
|
336
|
+
* need the active API key should use `resolveActiveApiKey()` (cli) or
|
|
337
|
+
* resolve from `apiKeys[]` directly — never read `cfg.apiKey` in new code.
|
|
285
338
|
*/
|
|
286
339
|
apiKey?: string | undefined;
|
|
287
340
|
/** Multiple keys for the same provider — pick one with `activeKey`. */
|
|
@@ -375,13 +428,29 @@ interface FeaturesConfig {
|
|
|
375
428
|
/** Discover + load skills from disk. */
|
|
376
429
|
skills: boolean;
|
|
377
430
|
/**
|
|
378
|
-
* Token-saving mode
|
|
379
|
-
*
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
*
|
|
431
|
+
* Token-saving mode tier. Controls how aggressively the system prompt
|
|
432
|
+
* is compacted to reduce per-request token consumption.
|
|
433
|
+
*
|
|
434
|
+
* - 'off' — Full prompt, all tools, complete guidance
|
|
435
|
+
* - 'minimal' — TIER1 tools only, stripped guidance (~3-4k tokens saved)
|
|
436
|
+
* - 'light' — Core + memory tools, common patterns, minimal guidance
|
|
437
|
+
* - 'medium' — Most development tools, some guidance
|
|
438
|
+
* - 'aggressive' — Maximum savings before tools become unusable (~4-5k tokens)
|
|
439
|
+
*
|
|
440
|
+
* Boolean values are accepted for backward compatibility:
|
|
441
|
+
* - `true` → 'medium'
|
|
442
|
+
* - `false` → 'off'
|
|
443
|
+
*
|
|
444
|
+
* Enable via CLI: `--token-saving-tier <level>` or `--token-saving-mode` (maps to 'medium').
|
|
445
|
+
* Configure via: `features.tokenSavingMode: "minimal"` in config.
|
|
446
|
+
*/
|
|
447
|
+
tokenSavingMode?: TokenSavingTier | boolean | undefined;
|
|
448
|
+
/**
|
|
449
|
+
* Allow tools to read/write paths outside the project root directory.
|
|
450
|
+
* When true (default), tools can access any path on the filesystem.
|
|
451
|
+
* When false, tools are restricted to the project root directory.
|
|
383
452
|
*/
|
|
384
|
-
|
|
453
|
+
allowOutsideProjectRoot?: boolean | undefined;
|
|
385
454
|
}
|
|
386
455
|
interface AutonomyConfig {
|
|
387
456
|
/** ms to wait before auto-proceeding in 'auto' mode. Default: 45000. */
|
|
@@ -557,6 +626,11 @@ interface Config {
|
|
|
557
626
|
configScope?: 'global' | 'project' | undefined;
|
|
558
627
|
/** Automatic codebase symbol-index maintenance (session-start + live updates). */
|
|
559
628
|
indexing?: IndexingConfig | undefined;
|
|
629
|
+
/**
|
|
630
|
+
* Process circuit-breaker protection (gates `bash`/`exec` on repeated
|
|
631
|
+
* failures). Default off — toggle with `/settings breaker on|off`.
|
|
632
|
+
*/
|
|
633
|
+
circuitBreaker?: CircuitBreakerRuntimeConfig | undefined;
|
|
560
634
|
/** Saved launch preferences — restored on next boot for one-line confirmation. */
|
|
561
635
|
launch?: LaunchConfig | undefined;
|
|
562
636
|
/**
|
|
@@ -625,4 +699,4 @@ interface ConfigStore {
|
|
|
625
699
|
watch(cb: (next: Readonly<Config>, prev: Readonly<Config>) => void): () => void;
|
|
626
700
|
}
|
|
627
701
|
|
|
628
|
-
export { type AutonomyConfig as A, type
|
|
702
|
+
export { type AutonomyConfig as A, type ProviderApiKey as B, type ContextWindowAggressiveOn as C, DEFAULT_CONTEXT_WINDOW_MODE_ID as D, type SessionLoggingConfig as E, type FeaturesConfig as F, type SyncCategory as G, type HookEvent as H, type InProcessHook as I, type ToolsConfig as J, formatContextWindowModeList as K, type LaunchConfig as L, type ModelsRegistry as M, getContextWindowMode as N, isContextWindowModeId as O, type ProviderConfig as P, listContextWindowModes as Q, type ResolvedProvider as R, type ShellHook as S, type TokenSavingTier as T, normalizeTokenSavingTier as U, resolveContextWindowPolicy as V, type WireFamily as W, type ModelsDevPayload as a, type ResolvedModel as b, type MCPServerConfig as c, type ModelMatrixEntry as d, type HookMatcher as e, type HookEntry as f, type ContextWindowPolicy as g, type Config as h, type ConfigStore as i, type ConfigLoader as j, type SyncConfig as k, type HookInput as l, type HookOutcome as m, CONTEXT_WINDOW_MODES as n, type CircuitBreakerRuntimeConfig as o, type ContextConfig as p, type ContextWindowConfigLike as q, type ContextWindowMode as r, type ContextWindowModeId as s, type ContextWindowThresholds as t, type CustomModelDefinition as u, type IndexingConfig as v, type LogConfig as w, type ModelsDevModel as x, type ModelsDevProvider as y, type PluginConfig as z };
|
|
@@ -309,6 +309,11 @@ type Permission = 'auto' | 'confirm' | 'deny';
|
|
|
309
309
|
* - `destructive` — irreversible or broadside effects (recursive deletes, db drops, etc.)
|
|
310
310
|
*/
|
|
311
311
|
type RiskTier = 'safe' | 'standard' | 'destructive';
|
|
312
|
+
/**
|
|
313
|
+
* Icon identifiers for tools — each UI (WebUI/TUI/REPL) maps these to its own icon library.
|
|
314
|
+
* Add the icon directly on each Tool so all UIs consume the same canonical value.
|
|
315
|
+
*/
|
|
316
|
+
type ToolIconId = 'file' | 'edit' | 'search' | 'folder' | 'terminal' | 'web' | 'git' | 'tree' | 'code' | 'test' | 'package' | 'document' | 'scaffold' | 'todo' | 'plan' | 'task' | 'meta' | 'index' | 'json' | 'diff' | 'logs' | 'settings' | 'fallback';
|
|
312
317
|
interface JSONSchema {
|
|
313
318
|
type?: string | undefined;
|
|
314
319
|
properties?: Record<string, JSONSchema>;
|
|
@@ -405,6 +410,12 @@ interface Tool<I = unknown, O = unknown> {
|
|
|
405
410
|
* treated conservatively by guards.
|
|
406
411
|
*/
|
|
407
412
|
capabilities?: readonly string[] | undefined;
|
|
413
|
+
/**
|
|
414
|
+
* Icon identifier for this tool — consumed by all UIs (WebUI/TUI/REPL) to
|
|
415
|
+
* render a tool-specific icon instead of a generic fallback.
|
|
416
|
+
* Each UI maps this id to its own icon library.
|
|
417
|
+
*/
|
|
418
|
+
icon?: ToolIconId | undefined;
|
|
408
419
|
execute(input: I, ctx: Context, opts: {
|
|
409
420
|
signal: AbortSignal;
|
|
410
421
|
}): Promise<O>;
|
|
@@ -1285,6 +1296,13 @@ interface ContextInit {
|
|
|
1285
1296
|
projectRoot: string;
|
|
1286
1297
|
/** Mutable working directory. Defaults to `cwd`. Must stay within `projectRoot`. */
|
|
1287
1298
|
workingDir?: string | undefined;
|
|
1299
|
+
/**
|
|
1300
|
+
* When false, file tools and `setWorkingDir()` are confined to `projectRoot`.
|
|
1301
|
+
* Defaults to `false` (restrictive) when omitted so directly-constructed
|
|
1302
|
+
* contexts (tests, embedded callers) keep the safe behavior; the runtime
|
|
1303
|
+
* passes the config-derived value (default `true` — permissive) explicitly.
|
|
1304
|
+
*/
|
|
1305
|
+
allowOutsideProjectRoot?: boolean | undefined;
|
|
1288
1306
|
model: string;
|
|
1289
1307
|
tools?: Tool[] | undefined;
|
|
1290
1308
|
/** Agent id performing this run (e.g. 'leader', 'executor', 'tech-stack'). */
|
|
@@ -1331,6 +1349,13 @@ declare class Context implements RunEnv {
|
|
|
1331
1349
|
projectRoot: string;
|
|
1332
1350
|
/** Mutable working directory — starts as `cwd`. Change via `setWorkingDir()`. */
|
|
1333
1351
|
workingDir: string;
|
|
1352
|
+
/**
|
|
1353
|
+
* When true, file tools (via `_util.ts`) and `setWorkingDir()` reject paths
|
|
1354
|
+
* outside `projectRoot`. When false, those boundary checks are bypassed so
|
|
1355
|
+
* tools may reach paths outside the project (still gated by permission
|
|
1356
|
+
* tiers). Mutable so `/settings` can toggle it live on the running session.
|
|
1357
|
+
*/
|
|
1358
|
+
allowOutsideProjectRoot: boolean;
|
|
1334
1359
|
model: string;
|
|
1335
1360
|
tools: Tool[];
|
|
1336
1361
|
meta: Record<string, unknown>;
|
|
@@ -1414,4 +1439,4 @@ declare class Context implements RunEnv {
|
|
|
1414
1439
|
usage(): Usage;
|
|
1415
1440
|
}
|
|
1416
1441
|
|
|
1417
|
-
export { ToolError as $, AgentError as A, type MessageRole as B, Context as C, PluginError as D, ERROR_CODES as E, type FileSnapshot as F, type ProviderErrorBody as G, type ReadonlyConversationState as H, type ImageBlock as I, type JSONSchema as J, type RiskTier as K, type RunEnv as L, type Message as M, SddError as N, SessionError as O, type Provider as P, type StateChange as Q, type Request as R, type SessionEvent as S, type Tool as T, type Usage as U, type StateChangeHandler as V, type StopReason as W, type StreamEvent as X, StreamHangError as Y, type ThinkingBlock as Z, type ToolCallContext as _, type SessionWriter as a, type ToolFinalEvent as a0, type
|
|
1442
|
+
export { ToolError as $, AgentError as A, type MessageRole as B, Context as C, PluginError as D, ERROR_CODES as E, type FileSnapshot as F, type ProviderErrorBody as G, type ReadonlyConversationState as H, type ImageBlock as I, type JSONSchema as J, type RiskTier as K, type RunEnv as L, type Message as M, SddError as N, SessionError as O, type Provider as P, type StateChange as Q, type Request as R, type SessionEvent as S, type Tool as T, type Usage as U, type StateChangeHandler as V, type StopReason as W, type StreamEvent as X, StreamHangError as Y, type ThinkingBlock as Z, type ToolCallContext as _, type SessionWriter as a, type ToolFinalEvent as a0, type ToolIconId as a1, type ToolStreamEvent as a2, WrongStackError as a3, asBlocks as a4, asText as a5, extractRunEnv as a6, isAgentError as a7, isConfigError as a8, isFsError as a9, isImageBlock as aa, isPluginError as ab, isSddError as ac, isSessionError as ad, isTextBlock as ae, isThinkingBlock as af, isToolError as ag, isToolResultBlock as ah, isToolUseBlock as ai, isWrongStackError as aj, toWrongStackError as ak, wrapAsState as al, type Response as b, type TokenCounter as c, type CacheStats as d, ProviderError as e, type Permission as f, type ContentBlock as g, type SessionMetadata as h, type SessionStore as i, type ToolProgressEvent as j, type Capabilities as k, type ToolUseBlock as l, type ToolResultBlock as m, type TextBlock as n, type RunOptions as o, type ResumedSession as p, type SessionData as q, type SessionSummary as r, type TodoItem as s, ConversationState as t, ConfigError as u, type ContextInit as v, type ErrorCode as w, type ErrorSeverity as x, type ErrorSubsystem as y, FsError as z };
|