cascade-ai 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -2
- package/dist/cli.cjs +2318 -1019
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +2316 -1016
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +1426 -329
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +177 -74
- package/dist/index.d.ts +177 -74
- package/dist/index.js +1422 -325
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/web/dist/assets/index-BFrwdYDg.js +225 -0
- package/web/dist/assets/index-C6Nd1mOj.css +1 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-BvxaBI9b.js +0 -216
- package/web/dist/assets/index-DO_ICahS.css +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,10 @@ interface ModelInfo {
|
|
|
14
14
|
supportsStreaming: boolean;
|
|
15
15
|
isLocal: boolean;
|
|
16
16
|
minSizeB?: number;
|
|
17
|
+
/** Tool-use capability. False for Ollama; true for all cloud providers. */
|
|
18
|
+
supportsToolUse?: boolean;
|
|
19
|
+
/** Self-declared or API-sourced specialization categories. */
|
|
20
|
+
specializations?: string[];
|
|
17
21
|
}
|
|
18
22
|
interface ProviderConfig {
|
|
19
23
|
type: ProviderType;
|
|
@@ -225,6 +229,14 @@ interface PeerMessage {
|
|
|
225
229
|
payload: unknown;
|
|
226
230
|
timestamp: string;
|
|
227
231
|
}
|
|
232
|
+
interface PeerMessageEvent {
|
|
233
|
+
fromId: string;
|
|
234
|
+
toId?: string;
|
|
235
|
+
syncType: PeerSyncType;
|
|
236
|
+
payload?: string;
|
|
237
|
+
timestamp: string;
|
|
238
|
+
sessionId: string;
|
|
239
|
+
}
|
|
228
240
|
interface Session {
|
|
229
241
|
id: string;
|
|
230
242
|
title: string;
|
|
@@ -337,6 +349,11 @@ interface CascadeConfig {
|
|
|
337
349
|
budget: BudgetConfig;
|
|
338
350
|
theme: string;
|
|
339
351
|
workspace: WorkspaceConfig;
|
|
352
|
+
cascadeAuto?: boolean;
|
|
353
|
+
enableToolCreation?: boolean;
|
|
354
|
+
plugins?: string[];
|
|
355
|
+
localConcurrency?: number;
|
|
356
|
+
localInferenceTimeoutMs?: number;
|
|
340
357
|
}
|
|
341
358
|
interface ModelOverrides {
|
|
342
359
|
t1?: string;
|
|
@@ -423,6 +440,23 @@ interface ThemeColors {
|
|
|
423
440
|
t2Color: string;
|
|
424
441
|
t3Color: string;
|
|
425
442
|
}
|
|
443
|
+
interface ToolCallBlock {
|
|
444
|
+
id: string;
|
|
445
|
+
toolName: string;
|
|
446
|
+
input: Record<string, unknown>;
|
|
447
|
+
output?: string;
|
|
448
|
+
error?: string;
|
|
449
|
+
status: 'pending' | 'running' | 'done' | 'error';
|
|
450
|
+
tierId: string;
|
|
451
|
+
durationMs?: number;
|
|
452
|
+
}
|
|
453
|
+
interface ReplMessage {
|
|
454
|
+
id: string;
|
|
455
|
+
role: 'user' | 'assistant' | 'system' | 'error';
|
|
456
|
+
content: string;
|
|
457
|
+
timestamp: string;
|
|
458
|
+
toolBlocks?: ToolCallBlock[];
|
|
459
|
+
}
|
|
426
460
|
type CascadeEventType = 'task:start' | 'task:complete' | 'task:error' | 'tier:status' | 'tier:result' | 'stream:token' | 'stream:done' | 'tool:approval-request' | 'tool:approval-response' | 'tool:execute' | 'tool:result' | 'cost:update' | 'session:save' | 'escalation' | 'peer:sync';
|
|
427
461
|
interface CascadeEvent<T = unknown> {
|
|
428
462
|
type: CascadeEventType;
|
|
@@ -563,6 +597,12 @@ declare class ModelSelector {
|
|
|
563
597
|
selectVisionModel(): ModelInfo | null;
|
|
564
598
|
getNextFallback(currentModelId: string, tier: TierRole): ModelInfo | null;
|
|
565
599
|
private getPriorityList;
|
|
600
|
+
getAllAvailableModels(): ModelInfo[];
|
|
601
|
+
/**
|
|
602
|
+
* Returns all available models eligible for the given tier, ordered by the
|
|
603
|
+
* tier's priority chain. Use this as the candidate set for scored selection.
|
|
604
|
+
*/
|
|
605
|
+
getCandidatesForTier(tier: TierRole): ModelInfo[];
|
|
566
606
|
isProviderAvailable(provider: ProviderType): boolean;
|
|
567
607
|
markProviderUnavailable(provider: ProviderType): void;
|
|
568
608
|
/**
|
|
@@ -575,6 +615,76 @@ declare class ModelSelector {
|
|
|
575
615
|
private resolveDynamicModel;
|
|
576
616
|
}
|
|
577
617
|
|
|
618
|
+
declare class MemoryStore {
|
|
619
|
+
private db;
|
|
620
|
+
constructor(dbPath: string);
|
|
621
|
+
private writeQueue;
|
|
622
|
+
private isProcessingQueue;
|
|
623
|
+
private processQueue;
|
|
624
|
+
private enqueueWrite;
|
|
625
|
+
createSession(session: Session): void;
|
|
626
|
+
updateSession(id: string, updates: Partial<Session>): void;
|
|
627
|
+
getSession(id: string): Session | null;
|
|
628
|
+
listSessions(identityId?: string, limit?: number): Session[];
|
|
629
|
+
deleteSession(id: string): void;
|
|
630
|
+
deleteAllSessions(): void;
|
|
631
|
+
deleteRuntimeSession(sessionId: string): void;
|
|
632
|
+
deleteAllRuntimeNodes(): void;
|
|
633
|
+
branchSession(originalId: string, newId: string): void;
|
|
634
|
+
upsertRuntimeSession(session: RuntimeSession): void;
|
|
635
|
+
listRuntimeSessions(limit?: number): RuntimeSession[];
|
|
636
|
+
upsertRuntimeNode(node: RuntimeNode): void;
|
|
637
|
+
listRuntimeNodes(sessionId?: string, limit?: number): RuntimeNode[];
|
|
638
|
+
addRuntimeNodeLog(log: RuntimeNodeLog): void;
|
|
639
|
+
listRuntimeNodeLogs(sessionId?: string, tierId?: string, limit?: number): RuntimeNodeLog[];
|
|
640
|
+
addMessage(message: StoredMessage): void;
|
|
641
|
+
getSessionMessages(sessionId: string): StoredMessage[];
|
|
642
|
+
searchMessages(query: string, limit?: number): StoredMessage[];
|
|
643
|
+
createIdentity(identity: Identity): void;
|
|
644
|
+
updateIdentity(id: string, updates: Partial<Identity>): void;
|
|
645
|
+
getIdentity(id: string): Identity | null;
|
|
646
|
+
getDefaultIdentity(): Identity | null;
|
|
647
|
+
listIdentities(): Identity[];
|
|
648
|
+
deleteIdentity(id: string): void;
|
|
649
|
+
saveScheduledTask(task: ScheduledTask): void;
|
|
650
|
+
listScheduledTasks(): ScheduledTask[];
|
|
651
|
+
deleteScheduledTask(id: string): void;
|
|
652
|
+
addAuditEntry(entry: AuditEntry): void;
|
|
653
|
+
getAuditLog(sessionId: string, limit?: number): AuditEntry[];
|
|
654
|
+
addFileSnapshot(sessionId: string, filePath: string, content: string): void;
|
|
655
|
+
getLatestFileSnapshots(sessionId: string): Array<{
|
|
656
|
+
filePath: string;
|
|
657
|
+
content: string;
|
|
658
|
+
}>;
|
|
659
|
+
upsertCachedModel(model: ModelInfo): void;
|
|
660
|
+
getCachedModels(provider?: ProviderType): ModelInfo[];
|
|
661
|
+
clearModelCache(provider?: ProviderType): void;
|
|
662
|
+
getCacheAge(): number;
|
|
663
|
+
saveModelProfile(modelId: string, provider: ProviderType, specializations: string[]): void;
|
|
664
|
+
getModelProfile(modelId: string, provider: ProviderType): ModelInfo | undefined;
|
|
665
|
+
getProfiledModelIds(): string[];
|
|
666
|
+
private toolResultCache;
|
|
667
|
+
private static CACHEABLE_TOOLS;
|
|
668
|
+
private static TOOL_TTL_MS;
|
|
669
|
+
/**
|
|
670
|
+
* Returns a cached tool result, or null if not cached / expired.
|
|
671
|
+
*/
|
|
672
|
+
getToolResult(toolName: string, input: Record<string, unknown>): string | null;
|
|
673
|
+
/**
|
|
674
|
+
* Stores a tool result in the in-memory cache.
|
|
675
|
+
* Only caches read-only/safe tools (see CACHEABLE_TOOLS).
|
|
676
|
+
*/
|
|
677
|
+
setToolResult(toolName: string, input: Record<string, unknown>, result: string): void;
|
|
678
|
+
/** Invalidate tool cache for a specific tool name, or all tools if omitted. */
|
|
679
|
+
invalidateToolCache(toolName?: string): void;
|
|
680
|
+
close(): void;
|
|
681
|
+
private migrate;
|
|
682
|
+
private deserializeSession;
|
|
683
|
+
private deserializeMessage;
|
|
684
|
+
private deserializeIdentity;
|
|
685
|
+
private deserializeScheduledTask;
|
|
686
|
+
}
|
|
687
|
+
|
|
578
688
|
interface RouterStats {
|
|
579
689
|
totalTokens: number;
|
|
580
690
|
totalCostUsd: number;
|
|
@@ -605,6 +715,7 @@ declare class CascadeRouter extends EventEmitter {
|
|
|
605
715
|
private budgetState;
|
|
606
716
|
private budgetExceededReason;
|
|
607
717
|
private tpmLimiter;
|
|
718
|
+
private localQueue;
|
|
608
719
|
/** Thrown when the configured budget is exceeded. */
|
|
609
720
|
static BudgetExceededError: {
|
|
610
721
|
new (msg: string): {
|
|
@@ -619,6 +730,12 @@ declare class CascadeRouter extends EventEmitter {
|
|
|
619
730
|
};
|
|
620
731
|
constructor();
|
|
621
732
|
init(config: CascadeConfig): Promise<void>;
|
|
733
|
+
/**
|
|
734
|
+
* Run model specialization profiling in the background.
|
|
735
|
+
* Only profiles models that haven't been profiled yet (cache-first).
|
|
736
|
+
* No-op if store is not provided.
|
|
737
|
+
*/
|
|
738
|
+
profileModels(store: MemoryStore): Promise<void>;
|
|
622
739
|
generate(tier: TierRole, options: GenerateOptions, onChunk?: (chunk: StreamChunk) => void, requireVision?: boolean): Promise<GenerateResult>;
|
|
623
740
|
getModelForTier(tier: TierRole): ModelInfo | undefined;
|
|
624
741
|
/**
|
|
@@ -768,7 +885,7 @@ interface ToolPlugin {
|
|
|
768
885
|
/** Called once when the plugin is registered */
|
|
769
886
|
onRegister?: (registry: ToolRegistry) => void;
|
|
770
887
|
}
|
|
771
|
-
declare class ToolRegistry {
|
|
888
|
+
declare class ToolRegistry extends EventEmitter {
|
|
772
889
|
private tools;
|
|
773
890
|
private config;
|
|
774
891
|
private ignoreMatcher;
|
|
@@ -777,6 +894,12 @@ declare class ToolRegistry {
|
|
|
777
894
|
private plugins;
|
|
778
895
|
constructor(config: ToolsConfig, workspaceRoot?: string);
|
|
779
896
|
register(tool: BaseTool): void;
|
|
897
|
+
/**
|
|
898
|
+
* Wait until a named tool is registered, resolving immediately if it already exists.
|
|
899
|
+
* T3 workers can call this after encountering a missing-tool error to resume
|
|
900
|
+
* automatically once T2 synthesizes the tool.
|
|
901
|
+
*/
|
|
902
|
+
waitForTool(toolName: string, timeoutMs?: number): Promise<void>;
|
|
780
903
|
/**
|
|
781
904
|
* Register a ToolPlugin, loading all its tools into the registry.
|
|
782
905
|
* Each tool is configured with the current workspace root.
|
|
@@ -802,73 +925,6 @@ declare class ToolRegistry {
|
|
|
802
925
|
private isIgnored;
|
|
803
926
|
}
|
|
804
927
|
|
|
805
|
-
declare class MemoryStore {
|
|
806
|
-
private db;
|
|
807
|
-
constructor(dbPath: string);
|
|
808
|
-
private writeQueue;
|
|
809
|
-
private isProcessingQueue;
|
|
810
|
-
private processQueue;
|
|
811
|
-
private enqueueWrite;
|
|
812
|
-
createSession(session: Session): void;
|
|
813
|
-
updateSession(id: string, updates: Partial<Session>): void;
|
|
814
|
-
getSession(id: string): Session | null;
|
|
815
|
-
listSessions(identityId?: string, limit?: number): Session[];
|
|
816
|
-
deleteSession(id: string): void;
|
|
817
|
-
deleteAllSessions(): void;
|
|
818
|
-
deleteRuntimeSession(sessionId: string): void;
|
|
819
|
-
deleteAllRuntimeNodes(): void;
|
|
820
|
-
branchSession(originalId: string, newId: string): void;
|
|
821
|
-
upsertRuntimeSession(session: RuntimeSession): void;
|
|
822
|
-
listRuntimeSessions(limit?: number): RuntimeSession[];
|
|
823
|
-
upsertRuntimeNode(node: RuntimeNode): void;
|
|
824
|
-
listRuntimeNodes(sessionId?: string, limit?: number): RuntimeNode[];
|
|
825
|
-
addRuntimeNodeLog(log: RuntimeNodeLog): void;
|
|
826
|
-
listRuntimeNodeLogs(sessionId?: string, tierId?: string, limit?: number): RuntimeNodeLog[];
|
|
827
|
-
addMessage(message: StoredMessage): void;
|
|
828
|
-
getSessionMessages(sessionId: string): StoredMessage[];
|
|
829
|
-
searchMessages(query: string, limit?: number): StoredMessage[];
|
|
830
|
-
createIdentity(identity: Identity): void;
|
|
831
|
-
updateIdentity(id: string, updates: Partial<Identity>): void;
|
|
832
|
-
getIdentity(id: string): Identity | null;
|
|
833
|
-
getDefaultIdentity(): Identity | null;
|
|
834
|
-
listIdentities(): Identity[];
|
|
835
|
-
deleteIdentity(id: string): void;
|
|
836
|
-
saveScheduledTask(task: ScheduledTask): void;
|
|
837
|
-
listScheduledTasks(): ScheduledTask[];
|
|
838
|
-
deleteScheduledTask(id: string): void;
|
|
839
|
-
addAuditEntry(entry: AuditEntry): void;
|
|
840
|
-
getAuditLog(sessionId: string, limit?: number): AuditEntry[];
|
|
841
|
-
addFileSnapshot(sessionId: string, filePath: string, content: string): void;
|
|
842
|
-
getLatestFileSnapshots(sessionId: string): Array<{
|
|
843
|
-
filePath: string;
|
|
844
|
-
content: string;
|
|
845
|
-
}>;
|
|
846
|
-
upsertCachedModel(model: ModelInfo): void;
|
|
847
|
-
getCachedModels(provider?: ProviderType): ModelInfo[];
|
|
848
|
-
clearModelCache(provider?: ProviderType): void;
|
|
849
|
-
getCacheAge(): number;
|
|
850
|
-
private toolResultCache;
|
|
851
|
-
private static CACHEABLE_TOOLS;
|
|
852
|
-
private static TOOL_TTL_MS;
|
|
853
|
-
/**
|
|
854
|
-
* Returns a cached tool result, or null if not cached / expired.
|
|
855
|
-
*/
|
|
856
|
-
getToolResult(toolName: string, input: Record<string, unknown>): string | null;
|
|
857
|
-
/**
|
|
858
|
-
* Stores a tool result in the in-memory cache.
|
|
859
|
-
* Only caches read-only/safe tools (see CACHEABLE_TOOLS).
|
|
860
|
-
*/
|
|
861
|
-
setToolResult(toolName: string, input: Record<string, unknown>, result: string): void;
|
|
862
|
-
/** Invalidate tool cache for a specific tool name, or all tools if omitted. */
|
|
863
|
-
invalidateToolCache(toolName?: string): void;
|
|
864
|
-
close(): void;
|
|
865
|
-
private migrate;
|
|
866
|
-
private deserializeSession;
|
|
867
|
-
private deserializeMessage;
|
|
868
|
-
private deserializeIdentity;
|
|
869
|
-
private deserializeScheduledTask;
|
|
870
|
-
}
|
|
871
|
-
|
|
872
928
|
declare class Cascade extends EventEmitter {
|
|
873
929
|
private router;
|
|
874
930
|
private toolRegistry;
|
|
@@ -880,6 +936,7 @@ declare class Cascade extends EventEmitter {
|
|
|
880
936
|
private audit?;
|
|
881
937
|
private telemetry;
|
|
882
938
|
private taskAnalyzer?;
|
|
939
|
+
private perfTracker?;
|
|
883
940
|
private toolCreator?;
|
|
884
941
|
constructor(config: CascadeConfig, workspacePath: string, store?: MemoryStore);
|
|
885
942
|
private initOptionalFeatures;
|
|
@@ -898,6 +955,9 @@ declare class Cascade extends EventEmitter {
|
|
|
898
955
|
init(): Promise<void>;
|
|
899
956
|
private isCasualGreeting;
|
|
900
957
|
private looksLikeSimpleArtifactTask;
|
|
958
|
+
private looksLikeConversational;
|
|
959
|
+
private static globCache;
|
|
960
|
+
private countWorkspaceFiles;
|
|
901
961
|
private determineComplexity;
|
|
902
962
|
run(options: CascadeRunOptions): Promise<CascadeRunResult>;
|
|
903
963
|
getRouter(): CascadeRouter;
|
|
@@ -981,16 +1041,17 @@ declare class PermissionEscalator extends EventEmitter {
|
|
|
981
1041
|
declare class ToolCreator {
|
|
982
1042
|
private router;
|
|
983
1043
|
private registry;
|
|
1044
|
+
private escalator?;
|
|
984
1045
|
private createdTools;
|
|
985
1046
|
constructor(router: CascadeRouter, registry: ToolRegistry);
|
|
1047
|
+
setPermissionEscalator(escalator: PermissionEscalator): void;
|
|
986
1048
|
/**
|
|
987
1049
|
* Generate a new tool from a description and register it with the ToolRegistry.
|
|
1050
|
+
* The generated tool has access to all registered cascade tools via callTool().
|
|
988
1051
|
* Returns the tool name if successful, null if generation failed.
|
|
989
1052
|
*/
|
|
990
1053
|
createTool(description: string, context: string): Promise<string | null>;
|
|
991
|
-
/**
|
|
992
|
-
* Returns the names of all tools created in this session.
|
|
993
|
-
*/
|
|
1054
|
+
/** Returns the names of all tools created in this session. */
|
|
994
1055
|
getCreatedTools(): string[];
|
|
995
1056
|
}
|
|
996
1057
|
|
|
@@ -1006,6 +1067,8 @@ declare class T1Administrator extends BaseTier {
|
|
|
1006
1067
|
private toolCreator?;
|
|
1007
1068
|
/** Stored overall task goal — used when evaluating escalated permissions */
|
|
1008
1069
|
private taskGoal;
|
|
1070
|
+
private peerMessageCallback?;
|
|
1071
|
+
private peerMessageSessionId;
|
|
1009
1072
|
constructor(router: CascadeRouter, toolRegistry: ToolRegistry, config: CascadeConfig);
|
|
1010
1073
|
setStore(store: MemoryStore): void;
|
|
1011
1074
|
/**
|
|
@@ -1014,6 +1077,7 @@ declare class T1Administrator extends BaseTier {
|
|
|
1014
1077
|
*/
|
|
1015
1078
|
setPermissionEscalator(escalator: PermissionEscalator): void;
|
|
1016
1079
|
setToolCreator(creator: ToolCreator): void;
|
|
1080
|
+
setPeerMessageCallback(cb: (event: PeerMessageEvent) => void, sessionId: string): void;
|
|
1017
1081
|
execute(userPrompt: string, images?: ImageAttachment[], systemContext?: string, signal?: AbortSignal): Promise<{
|
|
1018
1082
|
output: string;
|
|
1019
1083
|
t2Results: T2Result[];
|
|
@@ -1063,13 +1127,29 @@ declare class PeerBus extends EventEmitter {
|
|
|
1063
1127
|
private barriers;
|
|
1064
1128
|
private broadcastLog;
|
|
1065
1129
|
private fileLocks;
|
|
1130
|
+
/** subtaskIds whose T3 is being retried by T2 — dependents should re-wait rather than fail fast */
|
|
1131
|
+
private retryPending;
|
|
1132
|
+
/** Called when any peer message or broadcast is sent — used for dashboard visibility. */
|
|
1133
|
+
onPeerMessage?: (event: PeerMessageEvent) => void;
|
|
1134
|
+
sessionId: string;
|
|
1066
1135
|
register(peerId: string): void;
|
|
1067
1136
|
/**
|
|
1068
1137
|
* Publish output — unblocks any peers waiting on this subtaskId
|
|
1069
1138
|
*/
|
|
1070
1139
|
publish(fromId: string, subtaskId: string, output: string, status: PeerOutput['status']): void;
|
|
1071
1140
|
/**
|
|
1072
|
-
*
|
|
1141
|
+
* Mark a subtask as retry-pending so dependents re-wait instead of failing fast
|
|
1142
|
+
* when they see an ESCALATED status.
|
|
1143
|
+
*/
|
|
1144
|
+
markRetryPending(subtaskId: string): void;
|
|
1145
|
+
/** Called by T2 after retry resolves (success or final failure). */
|
|
1146
|
+
clearRetryPending(subtaskId: string): void;
|
|
1147
|
+
/** Remove a single output entry so a respawned worker can republish without clearing prior-wave outputs. */
|
|
1148
|
+
clearOutput(subtaskId: string): void;
|
|
1149
|
+
isRetryPending(subtaskId: string): boolean;
|
|
1150
|
+
/**
|
|
1151
|
+
* Wait for a specific subtask's output — resolves immediately if already available.
|
|
1152
|
+
* If the output is ESCALATED but a retry is pending, waits for the retry result.
|
|
1073
1153
|
*/
|
|
1074
1154
|
waitFor(subtaskId: string, timeoutMs?: number): Promise<PeerOutput>;
|
|
1075
1155
|
/**
|
|
@@ -1104,6 +1184,11 @@ declare class PeerBus extends EventEmitter {
|
|
|
1104
1184
|
* Check if a file is currently locked (non-blocking).
|
|
1105
1185
|
*/
|
|
1106
1186
|
isFileLocked(filePath: string): boolean;
|
|
1187
|
+
/**
|
|
1188
|
+
* Reset all runtime output/waiter state for a fresh T3 respawn wave.
|
|
1189
|
+
* Preserves member registrations and barrier definitions.
|
|
1190
|
+
*/
|
|
1191
|
+
reset(): void;
|
|
1107
1192
|
/**
|
|
1108
1193
|
* Clear broadcast log — call between phases to avoid stale announcements.
|
|
1109
1194
|
*/
|
|
@@ -1133,7 +1218,10 @@ declare class T2Manager extends BaseTier {
|
|
|
1133
1218
|
private t2PeerBus?;
|
|
1134
1219
|
private permissionEscalator?;
|
|
1135
1220
|
private toolCreator?;
|
|
1221
|
+
/** AbortController for the current T3 wave — aborted on cancel-and-respawn */
|
|
1222
|
+
private waveAbortController;
|
|
1136
1223
|
setPeerBus(bus: PeerBus): void;
|
|
1224
|
+
setPeerMessageCallback(cb: (event: PeerMessageEvent) => void, sessionId: string): void;
|
|
1137
1225
|
constructor(router: CascadeRouter, toolRegistry: ToolRegistry, parentId: string);
|
|
1138
1226
|
setStore(store: MemoryStore): void;
|
|
1139
1227
|
/**
|
|
@@ -1157,6 +1245,7 @@ declare class T2Manager extends BaseTier {
|
|
|
1157
1245
|
receivePeerSync(fromId: string, content: unknown): void;
|
|
1158
1246
|
execute(assignment: T1ToT2Assignment, taskId: string, signal?: AbortSignal): Promise<T2Result>;
|
|
1159
1247
|
private decomposeSection;
|
|
1248
|
+
private buildWorkerMap;
|
|
1160
1249
|
private executeSubtasks;
|
|
1161
1250
|
/**
|
|
1162
1251
|
* Runs T3 workers respecting dependsOn declarations.
|
|
@@ -1216,6 +1305,19 @@ declare class T3Worker extends BaseTier {
|
|
|
1216
1305
|
receivePeerSync(fromId: string, content: unknown): void;
|
|
1217
1306
|
private runAgentLoop;
|
|
1218
1307
|
private executeTool;
|
|
1308
|
+
/**
|
|
1309
|
+
* Adaptive fallback cascade — invoked when executeTool() fails.
|
|
1310
|
+
* Strategy order:
|
|
1311
|
+
* 1. Find a semantically similar registered tool and retry with same input
|
|
1312
|
+
* 2. Synthesize a new tool via ToolCreator (if available) and run it
|
|
1313
|
+
* 3. Return the original error so the agent loop can decide what to do next
|
|
1314
|
+
*/
|
|
1315
|
+
private adaptiveFallback;
|
|
1316
|
+
/**
|
|
1317
|
+
* Find a registered tool whose name/description semantically overlaps with
|
|
1318
|
+
* the failing tool. Returns the best candidate name, or null if none found.
|
|
1319
|
+
*/
|
|
1320
|
+
private findAlternativeTool;
|
|
1219
1321
|
/**
|
|
1220
1322
|
* Announce which files this T3 plans to edit, then acquire locks on them
|
|
1221
1323
|
* before competing siblings can claim them. T3s working on different files
|
|
@@ -1392,6 +1494,7 @@ declare class DashboardSocket {
|
|
|
1392
1494
|
emitCascadeEvent(ev: CascadeEvent): void;
|
|
1393
1495
|
emitTierStatus(tierId: string, role: string, status: string, sessionId: string, action?: string): void;
|
|
1394
1496
|
emitStreamToken(tierId: string, text: string, sessionId: string): void;
|
|
1497
|
+
emitPeerMessage(event: PeerMessageEvent): void;
|
|
1395
1498
|
emitApprovalRequest(request: PermissionRequest): void;
|
|
1396
1499
|
onApprovalResponse(callback: (data: PermissionDecisionPayload) => void): void;
|
|
1397
1500
|
private setupHandlers;
|
|
@@ -1585,7 +1688,7 @@ declare class Telemetry {
|
|
|
1585
1688
|
shutdown(): Promise<void>;
|
|
1586
1689
|
}
|
|
1587
1690
|
|
|
1588
|
-
declare const CASCADE_VERSION = "0.
|
|
1691
|
+
declare const CASCADE_VERSION = "0.5.1";
|
|
1589
1692
|
declare const CASCADE_CONFIG_DIR = ".cascade";
|
|
1590
1693
|
declare const CASCADE_MD_FILE = "CASCADE.md";
|
|
1591
1694
|
declare const CASCADE_IGNORE_FILE = ".cascadeignore";
|
|
@@ -1653,4 +1756,4 @@ declare class CascadeToolError extends Error {
|
|
|
1653
1756
|
constructor(userMessage: string, cause?: unknown, retryable?: boolean);
|
|
1654
1757
|
}
|
|
1655
1758
|
|
|
1656
|
-
export { AZURE_BASE_URL_TEMPLATE, type ApprovalRequest, type ApprovalResponse, type AuditEntry, AuditLogger, type BudgetConfig, CASCADE_AUDIT_FILE, CASCADE_CONFIG_DIR, CASCADE_CONFIG_FILE, CASCADE_DASHBOARD_SECRET_FILE, CASCADE_DB_FILE, CASCADE_IGNORE_FILE, CASCADE_KEYSTORE_FILE, CASCADE_MD_FILE, CASCADE_VERSION, COMPLEXITY_T2_COUNT, Cascade, CascadeCancelledError, type CascadeConfig, type CascadeEvent, type CascadeEventType, CascadeIgnore, type CascadeMessage, CascadeRouter, type CascadeRunOptions, type CascadeRunResult, CascadeToolError, ConfigManager, type ConversationMessage, DEFAULT_API_PORT, DEFAULT_APPROVAL_REQUIRED, DEFAULT_AUTO_SUMMARIZE_AT, DEFAULT_CONTEXT_LIMIT, DEFAULT_DASHBOARD_PORT, DEFAULT_MAX_SESSION_MESSAGES, DEFAULT_RETENTION_DAYS, DEFAULT_THEME, type DashboardConfig, DashboardServer, type EscalationPayload, GLOBAL_CONFIG_DIR, GLOBAL_DB_FILE, GLOBAL_KEYSTORE_FILE, GLOBAL_RUNTIME_DB_FILE, type GenerateOptions, type GenerateResult, type HookDefinition, type HooksConfig, HooksRunner, type Identity, type ImageAttachment, Keystore, LM_STUDIO_BASE_URL, MODELS, McpClient, type McpServerConfig$1 as McpServerConfig, type MemoryConfig, MemoryStore, type Message, type MessageContent, type MessagePayload, type MessageStatus, type MessageType, type ModelInfo, type ModelOverrides, OLLAMA_BASE_URL, PROVIDER_DISPLAY_NAMES, type PeerMessage, type PeerSyncPayload, type PeerSyncType, type PermissionDecision, type PermissionDecisionPayload, type PermissionRequest, type ProviderConfig, type ProviderType, type RuntimeNode, type RuntimeNodeLog, type RuntimeRefreshPayload, type RuntimeScope, type RuntimeSession, type RuntimeSnapshotPayload, type ScheduledTask, type Session, type SessionCheckpoint, type SessionMetadata, type SessionSubscriptionPayload, type StatusUpdate, type StoredMessage, type StreamChunk, T1Administrator, type T1ToT2Assignment, T1_MODEL_PRIORITY, T2Manager, type T2Result, type T2ToT3Assignment, T2_MODEL_PRIORITY, type T3Result, type T3ResultPayload, type T3SubtaskSpec, T3Worker, T3_MODEL_PRIORITY, THEME_NAMES, TOOL_NAMES, type TaskComplexity, TaskScheduler, Telemetry, type TelemetryConfig, type Theme, type ThemeColors, type ThemeName, type TierConfig, type TierLimits, type TierRole, type TierStatus, type TokenUsage, type ToolCall, type ToolDefinition, type ToolExecuteOptions, ToolRegistry, type ToolResult, type ToolsConfig, VISION_MODEL_PRIORITY, type WebSearchConfig, type WebhookConfig, type WorkspaceConfig, createCascade, runCascade, streamCascade };
|
|
1759
|
+
export { AZURE_BASE_URL_TEMPLATE, type ApprovalRequest, type ApprovalResponse, type AuditEntry, AuditLogger, type BudgetConfig, CASCADE_AUDIT_FILE, CASCADE_CONFIG_DIR, CASCADE_CONFIG_FILE, CASCADE_DASHBOARD_SECRET_FILE, CASCADE_DB_FILE, CASCADE_IGNORE_FILE, CASCADE_KEYSTORE_FILE, CASCADE_MD_FILE, CASCADE_VERSION, COMPLEXITY_T2_COUNT, Cascade, CascadeCancelledError, type CascadeConfig, type CascadeEvent, type CascadeEventType, CascadeIgnore, type CascadeMessage, CascadeRouter, type CascadeRunOptions, type CascadeRunResult, CascadeToolError, ConfigManager, type ConversationMessage, DEFAULT_API_PORT, DEFAULT_APPROVAL_REQUIRED, DEFAULT_AUTO_SUMMARIZE_AT, DEFAULT_CONTEXT_LIMIT, DEFAULT_DASHBOARD_PORT, DEFAULT_MAX_SESSION_MESSAGES, DEFAULT_RETENTION_DAYS, DEFAULT_THEME, type DashboardConfig, DashboardServer, type EscalationPayload, GLOBAL_CONFIG_DIR, GLOBAL_DB_FILE, GLOBAL_KEYSTORE_FILE, GLOBAL_RUNTIME_DB_FILE, type GenerateOptions, type GenerateResult, type HookDefinition, type HooksConfig, HooksRunner, type Identity, type ImageAttachment, Keystore, LM_STUDIO_BASE_URL, MODELS, McpClient, type McpServerConfig$1 as McpServerConfig, type MemoryConfig, MemoryStore, type Message, type MessageContent, type MessagePayload, type MessageStatus, type MessageType, type ModelInfo, type ModelOverrides, OLLAMA_BASE_URL, PROVIDER_DISPLAY_NAMES, type PeerMessage, type PeerMessageEvent, type PeerSyncPayload, type PeerSyncType, type PermissionDecision, type PermissionDecisionPayload, type PermissionRequest, type ProviderConfig, type ProviderType, type ReplMessage, type RuntimeNode, type RuntimeNodeLog, type RuntimeRefreshPayload, type RuntimeScope, type RuntimeSession, type RuntimeSnapshotPayload, type ScheduledTask, type Session, type SessionCheckpoint, type SessionMetadata, type SessionSubscriptionPayload, type StatusUpdate, type StoredMessage, type StreamChunk, T1Administrator, type T1ToT2Assignment, T1_MODEL_PRIORITY, T2Manager, type T2Result, type T2ToT3Assignment, T2_MODEL_PRIORITY, type T3Result, type T3ResultPayload, type T3SubtaskSpec, T3Worker, T3_MODEL_PRIORITY, THEME_NAMES, TOOL_NAMES, type TaskComplexity, TaskScheduler, Telemetry, type TelemetryConfig, type Theme, type ThemeColors, type ThemeName, type TierConfig, type TierLimits, type TierRole, type TierStatus, type TokenUsage, type ToolCall, type ToolCallBlock, type ToolDefinition, type ToolExecuteOptions, ToolRegistry, type ToolResult, type ToolsConfig, VISION_MODEL_PRIORITY, type WebSearchConfig, type WebhookConfig, type WorkspaceConfig, createCascade, runCascade, streamCascade };
|