@wrongstack/core 0.280.1 → 0.281.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-subagent-runner-PoqNKiR4.d.ts → agent-subagent-runner-DyOSK2Wy.d.ts} +39 -8
- package/dist/{compactor-U3agvUIG.d.ts → compactor-BxddyCFu.d.ts} +1 -1
- package/dist/{config-Cr3312zc.d.ts → config-CN-vdDEI.d.ts} +82 -2
- package/dist/coordination/index.d.ts +203 -20
- package/dist/coordination/index.js +981 -52
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +26 -30
- package/dist/defaults/index.js +382 -30
- package/dist/defaults/index.js.map +1 -1
- package/dist/{events-Bs2fmldo.d.ts → events-C5hLU0AT.d.ts} +38 -2
- package/dist/execution/index.d.ts +16 -16
- package/dist/execution/index.js +161 -18
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/prompt-enhancer.d.ts +1 -1
- package/dist/execution/prompt-enhancer.js +12 -3
- package/dist/execution/prompt-enhancer.js.map +1 -1
- package/dist/extension/index.d.ts +6 -6
- package/dist/{global-mailbox-Ct7IorLJ.d.ts → global-mailbox-CHM1QkCi.d.ts} +5 -2
- package/dist/{goal-store-C4F6DjC0.d.ts → goal-store-BLGZq16t.d.ts} +1 -1
- package/dist/hq/index.d.ts +6 -6
- package/dist/hq/index.js +35 -13
- package/dist/hq/index.js.map +1 -1
- package/dist/{index-nP09-oP2.d.ts → index-BEFWNZYs.d.ts} +1 -2
- package/dist/{index-kidebiDh.d.ts → index-C1E-_71T.d.ts} +6 -6
- package/dist/index.d.ts +44 -48
- package/dist/index.js +14855 -13944
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +60 -8
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +11 -11
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mcp-servers-D910X5_r.d.ts → mcp-servers-EKRAcJDi.d.ts} +97 -4
- package/dist/models/index.d.ts +4 -5
- package/dist/models/index.js +22 -5
- package/dist/models/index.js.map +1 -1
- package/dist/{multi-agent-coordinator-CieyUoEL.d.ts → multi-agent-coordinator-IpHCuHUa.d.ts} +29 -1
- package/dist/{null-fleet-bus-DkdmZJ_W.d.ts → null-fleet-bus-ZBkKGR9j.d.ts} +105 -7
- package/dist/observability/index.d.ts +3 -3
- package/dist/{tool-executor-SiE1wlZo.d.ts → parallel-eternal-engine-Cc2CNgmv.d.ts} +6 -202
- package/dist/path-resolver-CMS5307d.d.ts +13 -0
- package/dist/{permission-Dx6dIqS2.d.ts → permission-B6YAtNFz.d.ts} +1 -1
- package/dist/{pipeline-BwAP21_4.d.ts → pipeline-E7_jqGyV.d.ts} +2 -2
- package/dist/{provider-model-resolve-CwQNZWt_.d.ts → provider-model-resolve-KgIdiEQ6.d.ts} +118 -5
- package/dist/{provider-runner-CYHFImzV.d.ts → provider-runner-DxWXNHL1.d.ts} +3 -3
- package/dist/{retry-policy-D4feSLk3.d.ts → retry-policy-V67lBOJz.d.ts} +2 -2
- package/dist/sdd/index.d.ts +9 -9
- package/dist/sdd/index.js +94 -10
- package/dist/sdd/index.js.map +1 -1
- package/dist/{permission-policy-C8vJcnX5.d.ts → secret-vault-D7jeyXUQ.d.ts} +119 -3
- package/dist/security/index.d.ts +5 -6
- package/dist/security/index.js +4 -1
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-Dy-MzKp1.d.ts → selector-Bx2HgUkU.d.ts} +1 -1
- package/dist/{session-event-bridge-CqdiGnfU.d.ts → session-event-bridge-vA2fLV58.d.ts} +1 -1
- package/dist/{session-reader-Hk0WbNm9.d.ts → session-reader-B-Fi9L6I.d.ts} +1 -1
- package/dist/session-registry-Dvg7i_IA.d.ts +129 -0
- package/dist/storage/index.d.ts +71 -142
- package/dist/storage/index.js +161 -13
- package/dist/storage/index.js.map +1 -1
- package/dist/{todos-checkpoint-Bk2uP7Ex.d.ts → todos-checkpoint-B1QVkoa8.d.ts} +23 -5
- package/dist/{tool-BkOgs_KL.d.ts → tool-LVSLiE1s.d.ts} +18 -4
- package/dist/{strategy-compactor-CQwhbErd.d.ts → tool-executor-BWtYwuPI.d.ts} +210 -12
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/types/index.d.ts +17 -41
- package/dist/types/index.js +182 -5085
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js +6 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/{worktree-manager-BjOFF6bt.d.ts → worktree-manager-C6CIilTT.d.ts} +1 -1
- package/dist/{wstack-paths-CMl_cYgq.d.ts → wstack-paths-C3K40Qst.d.ts} +2 -0
- package/instructions/agents/shadow-agent.md +23 -84
- package/instructions/coordination/director-preamble.md +12 -3
- package/instructions/coordination/subagent-baseline.md +39 -46
- package/instructions/leader-after-task.md +10 -28
- package/instructions/llm/llm-selector.md +1 -2
- package/instructions/modes/brief-system.md +7 -33
- package/instructions/modes/brief.md +5 -20
- package/instructions/modes/teach-system.md +12 -72
- package/instructions/modes/teach.md +12 -49
- package/instructions/sections/tool/commit-hygiene.md +5 -5
- package/instructions/sections/tool/context-management-full.md +6 -6
- package/instructions/sections/tool/delegation-compact.md +1 -1
- package/instructions/sections/tool/delegation-full.md +19 -23
- package/instructions/sections/tool/mailbox-full.md +11 -31
- package/instructions/sections/tool/mcp-full-control.md +5 -7
- package/instructions/sections/tool/mcp-full-use.md +7 -7
- package/instructions/system.md +22 -38
- package/package.json +1 -29
- package/dist/agent-bridge-DXC6QDJ4.d.ts +0 -35
- package/dist/logger-D3lV0cUZ.d.ts +0 -101
- package/dist/models-registry-CLkoOcHk.d.ts +0 -108
- package/dist/path-resolver-XfZ9eLxG.d.ts +0 -67
- package/dist/secret-vault-CImt2XrR.d.ts +0 -118
package/dist/{multi-agent-coordinator-CieyUoEL.d.ts → multi-agent-coordinator-IpHCuHUa.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SubagentConfig, M as MultiAgentCoordinator,
|
|
1
|
+
import { S as SubagentConfig, M as MultiAgentCoordinator, b as MultiAgentConfig, c as SubagentRunner, B as BudgetSessionIdSource, F as FleetBus, d as SpawnResult, T as TaskSpec, e as BridgeMessage, f as AgentBridge, C as CoordinatorStatus, g as TaskResult, h as AwaitAnyResult } from './agent-subagent-runner-DyOSK2Wy.js';
|
|
2
2
|
import { EventEmitter } from 'node:events';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -266,12 +266,40 @@ declare class DefaultMultiAgentCoordinator extends EventEmitter implements Multi
|
|
|
266
266
|
getStatus(): CoordinatorStatus;
|
|
267
267
|
/** Expose snapshot of completed results — useful for callers awaiting all done. */
|
|
268
268
|
results(): readonly TaskResult[];
|
|
269
|
+
/** Defensive snapshot of the still-queued (not yet dispatched) tasks. */
|
|
270
|
+
listPendingTasks(): readonly TaskSpec[];
|
|
271
|
+
/**
|
|
272
|
+
* Re-pin a still-PENDING task to a different subagent (`undefined` =
|
|
273
|
+
* unpin, any idle worker may take it), then try to dispatch. Returns
|
|
274
|
+
* `false` when the task is not in the pending queue — already
|
|
275
|
+
* dispatched, completed, or unknown. Running tasks can never be pulled;
|
|
276
|
+
* they can only be steered or terminated. The mutation is synchronous
|
|
277
|
+
* (same tick as the check), so it cannot race a concurrent dispatch:
|
|
278
|
+
* `tryDispatchNext` runs on this same call stack or a later one.
|
|
279
|
+
*
|
|
280
|
+
* The task keeps its id, so waiters, the report-back notifier, and
|
|
281
|
+
* checkpoint bookkeeping resolve unchanged when it eventually completes.
|
|
282
|
+
*/
|
|
283
|
+
retargetPendingTask(taskId: string, subagentId: string | undefined): boolean;
|
|
269
284
|
/**
|
|
270
285
|
* Wait for one or more tasks to complete and return their results.
|
|
271
286
|
* If a task is already done when called, returns immediately.
|
|
272
287
|
* Resolves to an array in the same order as `taskIds`.
|
|
273
288
|
*/
|
|
274
289
|
awaitTasks(taskIds: string[]): Promise<TaskResult[]>;
|
|
290
|
+
/**
|
|
291
|
+
* Wait until AT LEAST ONE of the named tasks completes. Returns every
|
|
292
|
+
* requested result already available at that moment (drain-what's-done)
|
|
293
|
+
* plus the ids still outstanding, so callers can loop "handle finishers,
|
|
294
|
+
* re-await the remainder" instead of blocking on the whole batch.
|
|
295
|
+
*
|
|
296
|
+
* Unlike `awaitTasks`, this never rejects and deliberately does NOT
|
|
297
|
+
* inherit `config.timeoutMs` — a "return whatever is done" call has no
|
|
298
|
+
* business timing out unless the caller asks for a window explicitly.
|
|
299
|
+
*/
|
|
300
|
+
awaitTasksAny(taskIds: string[], opts?: {
|
|
301
|
+
timeoutMs?: number;
|
|
302
|
+
}): Promise<AwaitAnyResult>;
|
|
275
303
|
/**
|
|
276
304
|
* Manual completion — for callers that drive subagents without a runner
|
|
277
305
|
* (e.g. external orchestrators). When a runner is configured the coordinator
|
|
@@ -1,12 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { b as SessionWriter,
|
|
1
|
+
import { i as BridgeTransport, e as BridgeMessage, f as AgentBridge, j as AgentBridgeConfig, F as FleetBus, k as FleetUsage, S as SubagentConfig, l as FleetUsageAggregator, g as TaskResult, C as CoordinatorStatus, T as TaskSpec, b as MultiAgentConfig, c as SubagentRunner, h as AwaitAnyResult } from './agent-subagent-runner-DyOSK2Wy.js';
|
|
2
|
+
import { A as AgentPhase, b as AgentDefinition, a as DefaultMultiAgentCoordinator, D as DispatchClassifier } from './multi-agent-coordinator-IpHCuHUa.js';
|
|
3
|
+
import { E as EventBus, B as BrainArbiter } from './events-C5hLU0AT.js';
|
|
4
|
+
import { b as SessionWriter, g as Tool, k as SessionStore } from './tool-LVSLiE1s.js';
|
|
5
5
|
import { EventEmitter } from 'node:events';
|
|
6
6
|
import { L as Logger } from './logger-B63L5bTg.js';
|
|
7
7
|
import { D as DirectorStateSnapshot } from './director-state-BfeCUbmk.js';
|
|
8
|
-
import {
|
|
9
|
-
|
|
8
|
+
import { a as ModelMatrixEntry } from './config-CN-vdDEI.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* In-memory pub/sub transport for agent-to-agent messaging.
|
|
12
|
+
* Subscribers register by agentId and receive messages via callback.
|
|
13
|
+
*/
|
|
14
|
+
declare class InMemoryBridgeTransport implements BridgeTransport {
|
|
15
|
+
private readonly subs;
|
|
16
|
+
send(msg: BridgeMessage, to: string): Promise<void>;
|
|
17
|
+
subscribe(agentId: string, handler: (msg: BridgeMessage) => void): () => void;
|
|
18
|
+
close(agentId: string): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare class InMemoryAgentBridge implements AgentBridge {
|
|
22
|
+
readonly agentId: string;
|
|
23
|
+
readonly coordinatorId: string;
|
|
24
|
+
private readonly transport;
|
|
25
|
+
private readonly subscriptions;
|
|
26
|
+
private readonly pendingRequests;
|
|
27
|
+
private stopped;
|
|
28
|
+
private timeoutMs;
|
|
29
|
+
/** Guards request() so concurrent calls on the same id can't silently overwrite. */
|
|
30
|
+
private readonly inflightGuards;
|
|
31
|
+
/** Stores the transport unsubscribe function so it can be called on stop(). */
|
|
32
|
+
private _transportUnsubscribe?;
|
|
33
|
+
constructor(config: AgentBridgeConfig, transport: BridgeTransport);
|
|
34
|
+
send(msg: BridgeMessage): Promise<void>;
|
|
35
|
+
broadcast(msg: BridgeMessage): Promise<void>;
|
|
36
|
+
subscribe(handler: (msg: BridgeMessage) => void | Promise<void>): () => void;
|
|
37
|
+
request<T>(msg: BridgeMessage, timeoutMs?: number): Promise<BridgeMessage<T>>;
|
|
38
|
+
stop(): Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
declare function createMessage<T = unknown>(type: BridgeMessage['type'], from: string, payload: T, to?: string | undefined): BridgeMessage<T>;
|
|
10
41
|
|
|
11
42
|
/**
|
|
12
43
|
* Agent catalog aggregator.
|
|
@@ -609,11 +640,40 @@ declare class FleetCostCapError extends Error {
|
|
|
609
640
|
* symmetric with how other agents are built and avoids smuggling a
|
|
610
641
|
* heavy LLM dependency into core just for the director path.
|
|
611
642
|
*/
|
|
643
|
+
/**
|
|
644
|
+
* Payload handed to {@link DirectorOptions.taskResultNotifier} when a
|
|
645
|
+
* fire-and-forget task completes (no `awaitTasks` waiter was pending).
|
|
646
|
+
*/
|
|
647
|
+
interface TaskResultNotification {
|
|
648
|
+
taskId: string;
|
|
649
|
+
/** Task description (or task id when no description was recorded). */
|
|
650
|
+
title: string;
|
|
651
|
+
status: TaskResult['status'];
|
|
652
|
+
subagentId: string;
|
|
653
|
+
/** Human-readable subagent name from the fleet manifest, when known. */
|
|
654
|
+
subagentName?: string | undefined;
|
|
655
|
+
/** The subagent's textual result (stringified when structured). */
|
|
656
|
+
resultText?: string | undefined;
|
|
657
|
+
/** Flattened `kind: message` error string for non-success statuses. */
|
|
658
|
+
errorText?: string | undefined;
|
|
659
|
+
iterations: number;
|
|
660
|
+
toolCalls: number;
|
|
661
|
+
durationMs: number;
|
|
662
|
+
}
|
|
612
663
|
interface DirectorOptions {
|
|
613
664
|
config: MultiAgentConfig;
|
|
614
665
|
runner?: SubagentRunner | undefined;
|
|
615
666
|
/** Optional Brain arbiter above the director for policy/decision escalation. */
|
|
616
667
|
brain?: BrainArbiter | undefined;
|
|
668
|
+
/**
|
|
669
|
+
* Called when a task completes with NO pending `awaitTasks` waiter —
|
|
670
|
+
* i.e. a fire-and-forget `assign_task`. Wire this to the project
|
|
671
|
+
* mailbox so the result reaches the leader's conversation automatically
|
|
672
|
+
* instead of waiting for a poll. Synchronous `delegate` calls attach a
|
|
673
|
+
* waiter up front, so they never double-report through this hook.
|
|
674
|
+
* Internal tasks (shadow passes) are excluded. Errors are swallowed.
|
|
675
|
+
*/
|
|
676
|
+
taskResultNotifier?: ((n: TaskResultNotification) => void | Promise<void>) | undefined;
|
|
617
677
|
/** Optional logger for structured debug/error logging. Falls back to console if omitted. */
|
|
618
678
|
logger?: Logger | undefined;
|
|
619
679
|
/**
|
|
@@ -862,6 +922,13 @@ declare class Director implements ICoordinator {
|
|
|
862
922
|
* coordinator emits `task.completed` for a given task id. Each entry
|
|
863
923
|
* is created lazily on first poll/await and cleared once consumed. */
|
|
864
924
|
private readonly taskWaiters;
|
|
925
|
+
/** First-completion waiters registered by `awaitTasksAny`. Kept separate
|
|
926
|
+
* from `taskWaiters` on purpose: a `taskWaiters` entry marks a result as
|
|
927
|
+
* "will be delivered in-band" and suppresses the fire-and-forget
|
|
928
|
+
* report-back — but an any-await only consumes ONE of its ids, so the
|
|
929
|
+
* losers must stay eligible for the mailbox notifier. Entries carry an
|
|
930
|
+
* optional timeout timer so `shutdown()` can clear them. */
|
|
931
|
+
private readonly anyWaiters;
|
|
865
932
|
/** Cache of completed results in case the consumer asks AFTER the
|
|
866
933
|
* coordinator already fired the event — `awaitTasks(['t-1'])` after
|
|
867
934
|
* t-1 finished should resolve immediately, not hang. */
|
|
@@ -883,6 +950,8 @@ declare class Director implements ICoordinator {
|
|
|
883
950
|
private readonly roster?;
|
|
884
951
|
private readonly directorPreamble;
|
|
885
952
|
private readonly subagentBaseline;
|
|
953
|
+
/** See {@link DirectorOptions.taskResultNotifier}. */
|
|
954
|
+
private readonly taskResultNotifier?;
|
|
886
955
|
/** Absolute path to the fleet's shared scratchpad directory, or null
|
|
887
956
|
* when none was configured. Exposed as a readonly getter for callers
|
|
888
957
|
* that need to surface the path to the user (e.g. the CLI logging
|
|
@@ -1145,6 +1214,35 @@ declare class Director implements ICoordinator {
|
|
|
1145
1214
|
* whose results were already cached.
|
|
1146
1215
|
*/
|
|
1147
1216
|
awaitTasks(taskIds: string[]): Promise<TaskResult[]>;
|
|
1217
|
+
/**
|
|
1218
|
+
* Wait until AT LEAST ONE of the named tasks completes, then return every
|
|
1219
|
+
* requested result already cached plus the still-pending ids. This is the
|
|
1220
|
+
* leader's "handle whichever finishes next" primitive — unlike
|
|
1221
|
+
* `awaitTasks` it never blocks on the slowest sibling, and the siblings
|
|
1222
|
+
* that complete later still reach the leader through the fire-and-forget
|
|
1223
|
+
* report-back (see the consumed-in-band rule in `taskCompletedListener`).
|
|
1224
|
+
*
|
|
1225
|
+
* Deliberately does NOT register `taskWaiters` entries for the pending
|
|
1226
|
+
* ids: a `taskWaiters` entry would mark those results as in-band-consumed
|
|
1227
|
+
* and silence the mailbox notifier for results this caller never receives.
|
|
1228
|
+
*
|
|
1229
|
+
* With `timeoutMs`, resolves (never rejects) `{timedOut: true}` and zero
|
|
1230
|
+
* completions when the window elapses first.
|
|
1231
|
+
*/
|
|
1232
|
+
awaitTasksAny(taskIds: string[], opts?: {
|
|
1233
|
+
timeoutMs?: number;
|
|
1234
|
+
}): Promise<AwaitAnyResult>;
|
|
1235
|
+
/** Defensive snapshot of tasks still queued (not yet dispatched). */
|
|
1236
|
+
listPendingTasks(): readonly TaskSpec[];
|
|
1237
|
+
/**
|
|
1238
|
+
* Re-pin a still-pending task to a different subagent (`undefined` =
|
|
1239
|
+
* unpin) — the rebalancing primitive used by the FleetSupervisor and
|
|
1240
|
+
* available to hosts. Only queued tasks can move; a dispatched task
|
|
1241
|
+
* returns `false` (steer or terminate its worker instead). Keeps
|
|
1242
|
+
* ownership bookkeeping (taskOwners, checkpoint, fleet manifest) in
|
|
1243
|
+
* sync with the coordinator's queue.
|
|
1244
|
+
*/
|
|
1245
|
+
retargetPendingTask(taskId: string, subagentId: string | undefined): boolean;
|
|
1148
1246
|
terminate(subagentId: string): Promise<void>;
|
|
1149
1247
|
terminateAll(): Promise<void>;
|
|
1150
1248
|
remove(subagentId: string): Promise<void>;
|
|
@@ -1911,4 +2009,4 @@ declare const FLEET_ROSTER_WITHACP: Record<string, SubagentConfig>;
|
|
|
1911
2009
|
*/
|
|
1912
2010
|
declare const NULL_FLEET_BUS: FleetBus;
|
|
1913
2011
|
|
|
1914
|
-
export {
|
|
2012
|
+
export { composeDirectorPrompt as $, ACP_AGENTS as A, BUG_HUNTER_AGENT as B, type CollabBudgetConfig as C, DEFAULT_DIRECTOR_PREAMBLE as D, FLEET_ROSTER_WITHACP as E, FLEET_ROSTER as F, FleetCostCapError as G, FleetManager as H, type FleetManagerOptions as I, type FleetRosterBudget as J, FleetSpawnBudgetError as K, type ICoordinator as L, type IFleetManager as M, InMemoryAgentBridge as N, InMemoryBridgeTransport as O, LargeAnswerStore as P, NULL_FLEET_BUS as Q, REFACTOR_PLANNER_AGENT as R, type RefactorPhase as S, type RefactorPlan as T, SECURITY_SCANNER_AGENT as U, type SharedFileEntry as V, type SharedFileSnapshot as W, type SubagentPromptParts as X, type TaskResultNotification as Y, applyRosterBudget as Z, attachAutoExtend as _, AGENTS_BY_PHASE as a, composeSubagentPrompt as a0, createDelegateTool as a1, createMessage as a2, getAgentDefinition as a3, makeAskResultTool as a4, makeAskTool as a5, makeAssignTool as a6, makeAwaitTasksTool as a7, makeCollabDebugTool as a8, makeDirectorSessionFactory as a9, makeFleetEmitTool as aa, makeFleetTool as ab, makeRollUpTool as ac, makeSpawnTool as ad, makeTerminateAllTool as ae, makeTerminateTool as af, makeWorkCompleteTool as ag, rosterSummaryFromConfigs as ah, AGENT_CATALOG as b, ALL_AGENT_DEFINITIONS as c, ALL_FLEET_AGENTS as d, AUDIT_LOG_AGENT as e, type AutoExtendCeiling as f, type AutoExtendPolicy as g, type BugFinding as h, type CollabBudgetOverrides as i, type CollabBudgetWarningPayload as j, type CollabDebugReport as k, CollabSession as l, type CollabSessionOptions as m, type CreateDelegateToolOptions as n, type CriticConcern as o, type CriticEvaluation as p, DEFAULT_SUBAGENT_BASELINE as q, type DelegateHost as r, Director as s, type DirectorAlert as t, DirectorAlertLevel as u, type DirectorCancelCollabPayload as v, type DirectorPromptParts as w, type DirectorSessionFactory as x, type DirectorSessionFactoryOptions as y, FLEET_ROSTER_BUDGETS as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { M as MetricsSink, d as MetricLabels, f as MetricsSnapshot, H as HealthRegistry, a as HealthCheck, A as AggregateHealth, T as Tracer, S as Span } from '../observability-D-HZN_mF.js';
|
|
2
|
-
import { E as EventBus } from '../events-
|
|
3
|
-
import '../tool-
|
|
4
|
-
import '../permission-
|
|
2
|
+
import { E as EventBus } from '../events-C5hLU0AT.js';
|
|
3
|
+
import '../tool-LVSLiE1s.js';
|
|
4
|
+
import '../permission-B6YAtNFz.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* In-memory metrics sink. Suitable for embedded use, tests, and /metrics
|
|
@@ -1,58 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { B as BrainArbiter, E as EventBus } from './events-Bs2fmldo.js';
|
|
7
|
-
import { J as JournalEntry } from './goal-store-C4F6DjC0.js';
|
|
8
|
-
import { D as DispatchClassifier, a as DefaultMultiAgentCoordinator } from './multi-agent-coordinator-CieyUoEL.js';
|
|
9
|
-
import { T as ToolExecutorOptions, a as ToolExecutorStrategy, b as ToolBatchResult } from './index-kidebiDh.js';
|
|
10
|
-
|
|
11
|
-
interface CompactorOptions {
|
|
12
|
-
preserveK?: number | undefined;
|
|
13
|
-
eliseThreshold?: number | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* Enable content-aware digest mode. When true, `collapseAncientTurns` uses
|
|
16
|
-
* `buildSmartDigest` which scores messages by importance: critical content
|
|
17
|
-
* (errors, corrections, decisions) is kept verbatim; normal exchanges get
|
|
18
|
-
* first-sentence summaries; large tool outputs and repeated failures are
|
|
19
|
-
* aggressively compressed. Defaults to false (lossless digest).
|
|
20
|
-
*/
|
|
21
|
-
smart?: boolean | undefined;
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated Ignored. Token estimation is centralized in
|
|
24
|
-
* `compaction-core`/`token-estimate` so all compactors and the context-pressure
|
|
25
|
-
* monitor agree on one number. Kept only for backward-compatible call sites.
|
|
26
|
-
*/
|
|
27
|
-
estimator?: (((text: string) => number)) | undefined;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
declare class HybridCompactor implements Compactor {
|
|
31
|
-
private readonly preserveK;
|
|
32
|
-
private readonly eliseThreshold;
|
|
33
|
-
private readonly smart;
|
|
34
|
-
constructor(opts?: CompactorOptions);
|
|
35
|
-
compact(ctx: Context, opts?: {
|
|
36
|
-
aggressive?: boolean | undefined;
|
|
37
|
-
}): Promise<CompactReport>;
|
|
38
|
-
/**
|
|
39
|
-
* Estimate the full API request token count: messages + systemPrompt + toolDefs.
|
|
40
|
-
* This is the accurate figure for context-window pressure monitoring.
|
|
41
|
-
*/
|
|
42
|
-
private estimateFullRequest;
|
|
43
|
-
/**
|
|
44
|
-
* Lossless rule-based collapse of ancient turns into a single digest message.
|
|
45
|
-
*
|
|
46
|
-
* Preserves ALL textual content of the collapsed range — user instructions,
|
|
47
|
-
* assistant decisions/conclusions, and any prior digests (chained forward so
|
|
48
|
-
* the digest stays lossless across repeated compactions). Only `tool_use` /
|
|
49
|
-
* `tool_result` protocol blocks are dropped and replaced with a count marker;
|
|
50
|
-
* their full payload already lives in the session log. No sub-LLM call.
|
|
51
|
-
*
|
|
52
|
-
* Returns the token savings and the digest text (for audit logging).
|
|
53
|
-
*/
|
|
54
|
-
private collapseAncientTurns;
|
|
55
|
-
}
|
|
1
|
+
import { A as Agent, a as AgentFactory } from './agent-subagent-runner-DyOSK2Wy.js';
|
|
2
|
+
import { B as BrainArbiter, E as EventBus } from './events-C5hLU0AT.js';
|
|
3
|
+
import { C as Compactor } from './compactor-BxddyCFu.js';
|
|
4
|
+
import { J as JournalEntry } from './goal-store-BLGZq16t.js';
|
|
5
|
+
import { D as DispatchClassifier, a as DefaultMultiAgentCoordinator } from './multi-agent-coordinator-IpHCuHUa.js';
|
|
56
6
|
|
|
57
7
|
/**
|
|
58
8
|
* Design Studio — curated frontend/mobile UI design kits.
|
|
@@ -145,38 +95,6 @@ interface DesignKitLoader {
|
|
|
145
95
|
invalidateCache(): void;
|
|
146
96
|
}
|
|
147
97
|
|
|
148
|
-
/**
|
|
149
|
-
* Tiered error recovery strategies.
|
|
150
|
-
* Each strategy is attempted in order until one returns a decision.
|
|
151
|
-
*/
|
|
152
|
-
interface RecoveryStrategy {
|
|
153
|
-
/** Human-readable label for logs. */
|
|
154
|
-
label: string;
|
|
155
|
-
/** Optional compactor for context_overflow recovery. */
|
|
156
|
-
compactor?: Compactor | undefined;
|
|
157
|
-
/** Returns an explicit recovery decision, or null to fall through. */
|
|
158
|
-
attempt: (err: unknown, ctx: Context) => Promise<RecoveryDecision | null>;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Builds the ordered list of recovery strategies used by DefaultErrorHandler.
|
|
162
|
-
* Exported so callers can customise or extend the strategy chain.
|
|
163
|
-
*/
|
|
164
|
-
declare function buildRecoveryStrategies(opts?: {
|
|
165
|
-
compactor?: Compactor | undefined;
|
|
166
|
-
modelsRegistry?: ModelsRegistry | undefined;
|
|
167
|
-
getConfig?: (() => Config) | undefined;
|
|
168
|
-
}): RecoveryStrategy[];
|
|
169
|
-
declare const DEFAULT_RECOVERY_STRATEGIES: RecoveryStrategy[];
|
|
170
|
-
declare class DefaultErrorHandler implements ErrorHandler {
|
|
171
|
-
private readonly strategies;
|
|
172
|
-
constructor(strategies?: RecoveryStrategy[]);
|
|
173
|
-
classify(err: unknown): {
|
|
174
|
-
kind: 'rate_limit' | 'overloaded' | 'server' | 'client' | 'network' | 'abort' | 'context_overflow' | 'unknown';
|
|
175
|
-
retryable: boolean;
|
|
176
|
-
};
|
|
177
|
-
recover(err: unknown, ctx: Context): Promise<RecoveryDecision | null>;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
98
|
/**
|
|
181
99
|
* Sense-decide-execute-reflect loop on top of a long-running Goal.
|
|
182
100
|
*
|
|
@@ -569,118 +487,4 @@ declare class ParallelEternalEngine {
|
|
|
569
487
|
private persistState;
|
|
570
488
|
}
|
|
571
489
|
|
|
572
|
-
|
|
573
|
-
shouldRetry(err: Error | ProviderError, attempt: number): boolean;
|
|
574
|
-
maxAttempts(err: Error | ProviderError): number;
|
|
575
|
-
delayMs(attempt: number): number;
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
declare class ToolExecutor {
|
|
579
|
-
private readonly registry;
|
|
580
|
-
private opts;
|
|
581
|
-
/** Minimum gap between coalesced `partial_output` tool.progress emits. */
|
|
582
|
-
static readonly PROGRESS_EMIT_INTERVAL_MS = 100;
|
|
583
|
-
/** Max chars of accumulated stream text carried per coalesced emit (tail). */
|
|
584
|
-
static readonly PROGRESS_TAIL_CHARS = 16384;
|
|
585
|
-
/** Max chars of the head (beginning of output) kept alongside the tail. */
|
|
586
|
-
static readonly PROGRESS_HEAD_CHARS = 16384;
|
|
587
|
-
private readonly serializer;
|
|
588
|
-
private readonly iterationTimeoutMs;
|
|
589
|
-
private readonly maxToolTimeoutMs;
|
|
590
|
-
constructor(registry: {
|
|
591
|
-
get(name: string): Tool | undefined;
|
|
592
|
-
list(): Tool[];
|
|
593
|
-
}, opts: ToolExecutorOptions);
|
|
594
|
-
/**
|
|
595
|
-
* Clear the interactive confirm awaiter so the executor returns
|
|
596
|
-
* `ToolConfirmPendingResult` instead of blocking on stdin. Used by
|
|
597
|
-
* the CLI to switch from inline prompts (REPL) to event-driven
|
|
598
|
-
* confirmation (TUI) at runtime.
|
|
599
|
-
*/
|
|
600
|
-
clearConfirmAwaiter(): void;
|
|
601
|
-
/**
|
|
602
|
-
* Push the tool's per-tool result-render mode into the renderer as the
|
|
603
|
-
* next-result render mode. The config key is `tools.resultRenderMode[name]`
|
|
604
|
-
* — independent of the LLM-side `descriptionMode` so the two can be
|
|
605
|
-
* toggled separately (`/tool read desc simple` vs `/tool read result
|
|
606
|
-
* simple`). Defaults to `extend` when no entry is set.
|
|
607
|
-
*
|
|
608
|
-
* The hint is one-shot: the renderer consumes it on the next
|
|
609
|
-
* `writeToolResult` call so an unset follow-up doesn't inherit a
|
|
610
|
-
* previous tool's mode. Safe no-op when the renderer doesn't implement
|
|
611
|
-
* `setResultRenderMode` (e.g. headless/test renderers).
|
|
612
|
-
*/
|
|
613
|
-
private hintRenderMode;
|
|
614
|
-
private toolLogBase;
|
|
615
|
-
private logToolSuccess;
|
|
616
|
-
private logToolFailure;
|
|
617
|
-
/**
|
|
618
|
-
* Execute a batch of tool uses using the configured strategy.
|
|
619
|
-
* Returns the execution results and the remaining output budget.
|
|
620
|
-
*/
|
|
621
|
-
executeBatch(toolUses: ToolUseBlock[], ctx: Context, strategy: ToolExecutorStrategy): Promise<ToolBatchResult>;
|
|
622
|
-
/**
|
|
623
|
-
* Execute a single tool with timeout, permission check, and output capping.
|
|
624
|
-
* Emits `tool.started` via the injected EventBus (if any) right before
|
|
625
|
-
* invoking the tool — closes the observability gap between "model decided
|
|
626
|
-
* to call a tool" and "tool.executed".
|
|
627
|
-
*/
|
|
628
|
-
executeTool(tool: Tool, use: ToolUseBlock, ctx: Context, budget: number): Promise<{
|
|
629
|
-
block: ToolResultBlock;
|
|
630
|
-
bytes: number;
|
|
631
|
-
}>;
|
|
632
|
-
/**
|
|
633
|
-
* Async "produce" phase: run the tool, serialize, scrub, and spill an
|
|
634
|
-
* oversized output to a disk artifact. Returns the pre-cap text. This is
|
|
635
|
-
* the long-running, concurrency-safe part — it touches NO shared budget
|
|
636
|
-
* state, so multiple invocations can run in parallel without racing.
|
|
637
|
-
*
|
|
638
|
-
* The `budgetHint` only gates the disk-spill threshold (a heuristic for
|
|
639
|
-
* "is this output large enough to persist"); it is NOT the output cap.
|
|
640
|
-
* The authoritative cap is applied synchronously in settleToolOutput()
|
|
641
|
-
* against the live budget.
|
|
642
|
-
*/
|
|
643
|
-
private produceToolOutput;
|
|
644
|
-
/**
|
|
645
|
-
* Synchronous "settle" phase: enforce the output cap against the CURRENT
|
|
646
|
-
* budget, render, and build the result block. This MUST stay synchronous
|
|
647
|
-
* (no awaits) so that, in the parallel/smart strategies, two tools settling
|
|
648
|
-
* one after another against the shared closure budget can't interleave a
|
|
649
|
-
* stale read with a write. The first to settle consumes its bytes; the next
|
|
650
|
-
* settles against the reduced budget; once the budget hits 0, enforceCap
|
|
651
|
-
* truncates — making the per-iteration cap genuinely CUMULATIVE across
|
|
652
|
-
* parallel tools instead of degrading into a per-tool cap.
|
|
653
|
-
*/
|
|
654
|
-
private settleToolOutput;
|
|
655
|
-
private runWithTimeout;
|
|
656
|
-
/** Best-effort tool cleanup; never let it mask the original error. */
|
|
657
|
-
private runToolCleanup;
|
|
658
|
-
private runStreamedTool;
|
|
659
|
-
private unknownToolResult;
|
|
660
|
-
private malformedInputResult;
|
|
661
|
-
private deniedResult;
|
|
662
|
-
private blockedByHookResult;
|
|
663
|
-
/**
|
|
664
|
-
* Subtract a string-content result's UTF-8 byte length from the
|
|
665
|
-
* iteration output budget. Used for synthesized results (unknown tool,
|
|
666
|
-
* validation error, blocked, threw) where the content is a small
|
|
667
|
-
* string built in the executor. The success path no longer goes
|
|
668
|
-
* through here — `executeTool` carries the exact byte count it spent
|
|
669
|
-
* in its return value, derived from `enforceCap`'s `newBudget`.
|
|
670
|
-
*
|
|
671
|
-
* Floors the result at 0 to match the pre-fix `decrementBudget`
|
|
672
|
-
* semantics (over-budget spends don't underflow the running total).
|
|
673
|
-
*/
|
|
674
|
-
private budgetForString;
|
|
675
|
-
}
|
|
676
|
-
/**
|
|
677
|
-
* Classify a tool execution error into a structured ToolErrorCategory.
|
|
678
|
-
* Used for observability (span attributes) and retry strategy decisions.
|
|
679
|
-
*/
|
|
680
|
-
declare function classifyToolError(err: unknown): {
|
|
681
|
-
category: ToolErrorCategory;
|
|
682
|
-
retryable: boolean;
|
|
683
|
-
detail?: string;
|
|
684
|
-
};
|
|
685
|
-
|
|
686
|
-
export { type CompactorOptions as C, type DesignStack as D, EternalAutonomyEngine as E, HybridCompactor as H, type IterationStage as I, type ParallelEngineState as P, type RecoveryStrategy as R, ToolExecutor as T, type DesignStudioState as a, type DesignKitLoader as b, type DesignKitManifest as c, type DesignKitEntry as d, type DesignKitTokens as e, DEFAULT_RECOVERY_STRATEGIES as f, DESIGN_STACKS as g, DefaultErrorHandler as h, DefaultRetryPolicy as i, type DesignTokenSet as j, type EternalAutonomyOptions as k, type EternalEngineState as l, ParallelEternalEngine as m, type ParallelEternalOptions as n, type ParallelIterationStage as o, buildRecoveryStrategies as p, classifyToolError as q, isDesignStack as r };
|
|
490
|
+
export { type DesignStack as D, EternalAutonomyEngine as E, type IterationStage as I, type ParallelEngineState as P, type DesignStudioState as a, type DesignKitLoader as b, type DesignKitManifest as c, type DesignKitEntry as d, type DesignKitTokens as e, DESIGN_STACKS as f, type DesignTokenSet as g, type EternalAutonomyOptions as h, type EternalEngineState as i, ParallelEternalEngine as j, type ParallelEternalOptions as k, type ParallelIterationStage as l, isDesignStack as m };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { P as PathResolver } from './path-resolver-CPRj4bFY.js';
|
|
2
|
+
|
|
3
|
+
declare class DefaultPathResolver implements PathResolver {
|
|
4
|
+
readonly projectRoot: string;
|
|
5
|
+
readonly cwd: string;
|
|
6
|
+
constructor(cwd?: string);
|
|
7
|
+
detectProjectRoot(start: string): string;
|
|
8
|
+
resolve(input: string): string;
|
|
9
|
+
isInsideRoot(absPath: string): boolean;
|
|
10
|
+
ensureInsideRoot(absPath: string): string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { DefaultPathResolver as D };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as Tool, s as TextBlock, i as ContentBlock } from './tool-LVSLiE1s.js';
|
|
2
2
|
import { a as MailboxAgentStatus } from './mailbox-types-BGZWrYTJ.js';
|
|
3
|
-
import { H as HookEvent, f as HookMatcher, I as InProcessHook, S as ShellHook, g as HookEntry, T as ToolResultRenderMode } from './config-
|
|
3
|
+
import { H as HookEvent, f as HookMatcher, I as InProcessHook, S as ShellHook, g as HookEntry, T as ToolResultRenderMode } from './config-CN-vdDEI.js';
|
|
4
4
|
|
|
5
5
|
/** Model capabilities relevant to prompt composition. */
|
|
6
6
|
interface ModelCapabilities {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as Provider, M as Message } from './tool-
|
|
2
|
-
import { M as MessageSelector, S as SelectorResult } from './selector-
|
|
1
|
+
import { P as Provider, M as Message } from './tool-LVSLiE1s.js';
|
|
2
|
+
import { M as MessageSelector, S as SelectorResult } from './selector-Bx2HgUkU.js';
|
|
3
3
|
import { M as ModeStore, a as ModeConfig, b as Mode } from './mode-CZlO9iU1.js';
|
|
4
|
-
import {
|
|
4
|
+
import { M as ModelsRegistry, c as ModelsDevPayload, d as ResolvedProvider, R as ResolvedModel, W as WireFamily, e as ModelsDevModel } from './config-CN-vdDEI.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Offline **floor** for the ChatGPT "Sign in with ChatGPT" (`openai-codex`)
|
|
@@ -109,6 +109,111 @@ interface ModeLoaderOptions {
|
|
|
109
109
|
declare function loadProjectModes(modesDir: string): Promise<Mode[]>;
|
|
110
110
|
declare function loadUserModes(modesDir: string): Promise<Mode[]>;
|
|
111
111
|
|
|
112
|
+
interface DefaultModelsRegistryOptions {
|
|
113
|
+
cacheFile: string;
|
|
114
|
+
url?: string | undefined;
|
|
115
|
+
ttlSeconds?: number | undefined;
|
|
116
|
+
fetchImpl?: typeof fetch | undefined;
|
|
117
|
+
/** Pre-seeded payload — useful for offline scenarios and tests. */
|
|
118
|
+
seed?: ModelsDevPayload | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* Maximum age in seconds for stale cache fallback when network fails.
|
|
121
|
+
* Defaults to 7 days. Set to `Infinity` for full offline resilience
|
|
122
|
+
* (risk: deprecated models, wrong pricing). Set to `0` to disable
|
|
123
|
+
* stale fallback entirely.
|
|
124
|
+
*/
|
|
125
|
+
maxStaleAgeSeconds?: number | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Timeout in milliseconds for the models.dev network fetch. When exceeded,
|
|
128
|
+
* the fetch is aborted and cache/stale fallback is used instead.
|
|
129
|
+
* Defaults to 15 seconds. Set to `0` to disable (infinite wait).
|
|
130
|
+
*/
|
|
131
|
+
refreshTimeoutMs?: number | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* Curated override payload deep-merged ON TOP of the models.dev base via
|
|
134
|
+
* `mergeModelsPayload` — adds providers/models the base lacks and overrides
|
|
135
|
+
* fields it gets wrong. Resolution order (first non-empty wins): this
|
|
136
|
+
* in-memory `overlay` → `overlayUrl` (fetched, cached) → `overlayFile`
|
|
137
|
+
* (bundled, read from disk). A missing/broken overlay degrades to `{}` and
|
|
138
|
+
* never throws, so the base alone still works.
|
|
139
|
+
*/
|
|
140
|
+
overlay?: ModelsDevPayload | undefined;
|
|
141
|
+
/** GitHub-raw (or any) URL serving the curated overlay `providers.json`. */
|
|
142
|
+
overlayUrl?: string | undefined;
|
|
143
|
+
/** Path to the bundled overlay `providers.json` (offline floor). */
|
|
144
|
+
overlayFile?: string | undefined;
|
|
145
|
+
/** Cache file for the fetched `overlayUrl`. Defaults next to `cacheFile`. */
|
|
146
|
+
overlayCacheFile?: string | undefined;
|
|
147
|
+
}
|
|
148
|
+
declare function classifyFamily(npm: string | undefined): WireFamily;
|
|
149
|
+
declare class DefaultModelsRegistry implements ModelsRegistry {
|
|
150
|
+
/** Merged (base + overlay) payload — what every reader sees. */
|
|
151
|
+
private payload?;
|
|
152
|
+
/** Memoised overlay payload (in-memory / fetched / file). */
|
|
153
|
+
private overlayPayload?;
|
|
154
|
+
/**
|
|
155
|
+
* Extra providers injected at runtime via `mergeOverlay()` — e.g. an
|
|
156
|
+
* openai-compatible server (omniroute, LiteLLM, …) auto-discovered from its
|
|
157
|
+
* `/v1/models` endpoint at boot. Applied LAST (on top of base + curated
|
|
158
|
+
* overlay) and re-applied across `refresh()` so the discovered catalog
|
|
159
|
+
* survives a models.dev refetch.
|
|
160
|
+
*/
|
|
161
|
+
private extraOverlay?;
|
|
162
|
+
private fetchedAt?;
|
|
163
|
+
private readonly cacheFile;
|
|
164
|
+
private readonly url;
|
|
165
|
+
private readonly ttlMs;
|
|
166
|
+
private readonly fetchImpl;
|
|
167
|
+
private readonly seed?;
|
|
168
|
+
private readonly maxStaleAgeMs;
|
|
169
|
+
private readonly refreshTimeoutMs;
|
|
170
|
+
private readonly overlay?;
|
|
171
|
+
private readonly overlayUrl?;
|
|
172
|
+
private readonly overlayFile?;
|
|
173
|
+
private readonly overlayCacheFile?;
|
|
174
|
+
constructor(opts: DefaultModelsRegistryOptions);
|
|
175
|
+
load(opts?: {
|
|
176
|
+
force?: boolean | undefined;
|
|
177
|
+
}): Promise<ModelsDevPayload>;
|
|
178
|
+
/**
|
|
179
|
+
* Merge an additional provider payload on top of the resolved catalog. Used
|
|
180
|
+
* for runtime-discovered openai-compatible providers. Remembered so it is
|
|
181
|
+
* re-applied across `refresh()`. A no-op for an empty payload.
|
|
182
|
+
*/
|
|
183
|
+
mergeOverlay(payload: ModelsDevPayload): void;
|
|
184
|
+
private withExtraOverlay;
|
|
185
|
+
/**
|
|
186
|
+
* Load the models.dev base payload: fresh cache → network → stale cache.
|
|
187
|
+
* On total failure, degrade to `{}` (so a non-empty overlay still drives
|
|
188
|
+
* the catalog) rather than throwing — unless there's no curated overlay to
|
|
189
|
+
* fall back on, in which case the original error propagates so pure-
|
|
190
|
+
* models.dev setups still surface the problem.
|
|
191
|
+
*/
|
|
192
|
+
private loadBase;
|
|
193
|
+
/** Fetch + cache the models.dev base. Throws on failure (used by `refresh`). */
|
|
194
|
+
private refreshBase;
|
|
195
|
+
/**
|
|
196
|
+
* Resolve the curated overlay, memoised. Order: in-memory `overlay` →
|
|
197
|
+
* fetched `overlayUrl` (cached, same TTL/stale rules) → `overlayFile` on
|
|
198
|
+
* disk. Never throws — a missing/broken overlay yields `{}`.
|
|
199
|
+
*/
|
|
200
|
+
private loadOverlay;
|
|
201
|
+
private loadOverlayFromUrl;
|
|
202
|
+
private readOverlayFile;
|
|
203
|
+
refresh(): Promise<ModelsDevPayload>;
|
|
204
|
+
listProviders(): Promise<ResolvedProvider[]>;
|
|
205
|
+
getProvider(id: string): Promise<ResolvedProvider | undefined>;
|
|
206
|
+
getModel(providerId: string, modelId: string): Promise<ResolvedModel | undefined>;
|
|
207
|
+
suggestModel(providerId: string): Promise<string | undefined>;
|
|
208
|
+
ageSeconds(): Promise<number>;
|
|
209
|
+
private resolveProvider;
|
|
210
|
+
private isFresh;
|
|
211
|
+
private isWithinMaxStaleAge;
|
|
212
|
+
private readCacheAt;
|
|
213
|
+
/** Used by `wstack models refresh` to expose where the cache lives. */
|
|
214
|
+
cacheLocation(): string;
|
|
215
|
+
}
|
|
216
|
+
|
|
112
217
|
/**
|
|
113
218
|
* A model descriptor shaped for the WebUI `provider.models` message. All
|
|
114
219
|
* metadata fields are optional because OAuth / subscription providers that
|
|
@@ -145,6 +250,14 @@ declare function describeCatalogModel(m: ModelsDevModel): ProviderModelDescripto
|
|
|
145
250
|
* produced the "not found in catalog" notification flood when the WebUI
|
|
146
251
|
* model switcher lazy-loaded every saved provider).
|
|
147
252
|
*/
|
|
148
|
-
declare function resolveProviderModelList(savedModels: string[] | undefined, catalog: ResolvedProvider | undefined
|
|
253
|
+
declare function resolveProviderModelList(savedModels: string[] | undefined, catalog: ResolvedProvider | undefined,
|
|
254
|
+
/**
|
|
255
|
+
* Provider id / wire family the list is being resolved for. Lets the
|
|
256
|
+
* resolver fall back to a known offline catalog (currently the ChatGPT
|
|
257
|
+
* `openai-codex` models) when the saved allowlist is empty AND the
|
|
258
|
+
* models.dev catalog is unavailable — so deleting the models from config
|
|
259
|
+
* never leaves the provider showing zero models.
|
|
260
|
+
*/
|
|
261
|
+
providerHint?: string | undefined): ProviderModelDescriptor[];
|
|
149
262
|
|
|
150
|
-
export { CODEX_MODELS as C, DefaultModeStore as D, LLMSelector as L, type ModeLoaderOptions as M, type ProviderModelDescriptor as P, type CodexModelMeta as a, type LLMSelectorOptions as
|
|
263
|
+
export { CODEX_MODELS as C, DefaultModeStore as D, LLMSelector as L, type ModeLoaderOptions as M, type ProviderModelDescriptor as P, type CodexModelMeta as a, DefaultModelsRegistry as b, type DefaultModelsRegistryOptions as c, type LLMSelectorOptions as d, classifyFamily as e, codexModelMeta as f, describeCatalogModel as g, loadUserModes as h, loadProjectModes as l, resolveProviderModelList as r };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { E as EventBus } from './events-
|
|
1
|
+
import { E as EventBus } from './events-C5hLU0AT.js';
|
|
2
2
|
import { L as Logger } from './logger-B63L5bTg.js';
|
|
3
3
|
import { T as Tracer } from './observability-D-HZN_mF.js';
|
|
4
|
-
import { P as Provider, c as Request,
|
|
5
|
-
import { R as RetryPolicy } from './retry-policy-
|
|
4
|
+
import { P as Provider, c as Request, d as Context, e as Response } from './tool-LVSLiE1s.js';
|
|
5
|
+
import { R as RetryPolicy } from './retry-policy-V67lBOJz.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Options passed to a ProviderRunner when calling the provider.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as Context, e as Response, h as ProviderError } from './tool-LVSLiE1s.js';
|
|
2
2
|
|
|
3
3
|
type RecoveryDecision = {
|
|
4
4
|
/**
|
|
@@ -39,7 +39,7 @@ interface ErrorHandler {
|
|
|
39
39
|
|
|
40
40
|
interface RetryPolicy {
|
|
41
41
|
shouldRetry(err: ProviderError | Error, attempt: number): boolean;
|
|
42
|
-
delayMs(attempt: number): number;
|
|
42
|
+
delayMs(attempt: number, err?: ProviderError | Error): number;
|
|
43
43
|
maxAttempts(err: ProviderError | Error): number;
|
|
44
44
|
}
|
|
45
45
|
|