cascade-ai 0.2.12 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +99 -44
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +99 -44
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +46 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +46 -27
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/web/dist/assets/{index-BdaS_Mbj.js → index-BvxaBI9b.js} +34 -34
- package/web/dist/index.html +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -175,6 +175,7 @@ interface StatusUpdate {
|
|
|
175
175
|
progressPct: number;
|
|
176
176
|
currentAction: string;
|
|
177
177
|
status: 'IN_PROGRESS' | 'BLOCKED' | 'ESCALATING';
|
|
178
|
+
output?: string;
|
|
178
179
|
}
|
|
179
180
|
interface T2Result {
|
|
180
181
|
sectionId: string;
|
|
@@ -274,6 +275,7 @@ interface RuntimeNode {
|
|
|
274
275
|
updatedAt: string;
|
|
275
276
|
workspacePath?: string;
|
|
276
277
|
isGlobal?: boolean;
|
|
278
|
+
output?: string;
|
|
277
279
|
}
|
|
278
280
|
interface RuntimeNodeLog {
|
|
279
281
|
id: string;
|
|
@@ -287,6 +289,7 @@ interface RuntimeNodeLog {
|
|
|
287
289
|
timestamp: string;
|
|
288
290
|
workspacePath?: string;
|
|
289
291
|
isGlobal?: boolean;
|
|
292
|
+
output?: string;
|
|
290
293
|
}
|
|
291
294
|
type RuntimeScope = 'workspace' | 'global';
|
|
292
295
|
interface RuntimeSnapshotPayload {
|
|
@@ -919,7 +922,7 @@ declare abstract class BaseTier extends EventEmitter {
|
|
|
919
922
|
protected signal?: AbortSignal;
|
|
920
923
|
constructor(role: TierRole, id?: string, parentId?: string);
|
|
921
924
|
getStatus(): TierStatus;
|
|
922
|
-
protected setStatus(status: TierStatus): void;
|
|
925
|
+
protected setStatus(status: TierStatus, output?: string): void;
|
|
923
926
|
protected setLabel(label: string): void;
|
|
924
927
|
setSystemPromptOverride(prompt: string): void;
|
|
925
928
|
setHierarchyContext(context: string): void;
|
|
@@ -1581,7 +1584,7 @@ declare class Telemetry {
|
|
|
1581
1584
|
shutdown(): Promise<void>;
|
|
1582
1585
|
}
|
|
1583
1586
|
|
|
1584
|
-
declare const CASCADE_VERSION = "0.
|
|
1587
|
+
declare const CASCADE_VERSION = "0.3.0";
|
|
1585
1588
|
declare const CASCADE_CONFIG_DIR = ".cascade";
|
|
1586
1589
|
declare const CASCADE_MD_FILE = "CASCADE.md";
|
|
1587
1590
|
declare const CASCADE_IGNORE_FILE = ".cascadeignore";
|
package/dist/index.d.ts
CHANGED
|
@@ -175,6 +175,7 @@ interface StatusUpdate {
|
|
|
175
175
|
progressPct: number;
|
|
176
176
|
currentAction: string;
|
|
177
177
|
status: 'IN_PROGRESS' | 'BLOCKED' | 'ESCALATING';
|
|
178
|
+
output?: string;
|
|
178
179
|
}
|
|
179
180
|
interface T2Result {
|
|
180
181
|
sectionId: string;
|
|
@@ -274,6 +275,7 @@ interface RuntimeNode {
|
|
|
274
275
|
updatedAt: string;
|
|
275
276
|
workspacePath?: string;
|
|
276
277
|
isGlobal?: boolean;
|
|
278
|
+
output?: string;
|
|
277
279
|
}
|
|
278
280
|
interface RuntimeNodeLog {
|
|
279
281
|
id: string;
|
|
@@ -287,6 +289,7 @@ interface RuntimeNodeLog {
|
|
|
287
289
|
timestamp: string;
|
|
288
290
|
workspacePath?: string;
|
|
289
291
|
isGlobal?: boolean;
|
|
292
|
+
output?: string;
|
|
290
293
|
}
|
|
291
294
|
type RuntimeScope = 'workspace' | 'global';
|
|
292
295
|
interface RuntimeSnapshotPayload {
|
|
@@ -919,7 +922,7 @@ declare abstract class BaseTier extends EventEmitter {
|
|
|
919
922
|
protected signal?: AbortSignal;
|
|
920
923
|
constructor(role: TierRole, id?: string, parentId?: string);
|
|
921
924
|
getStatus(): TierStatus;
|
|
922
|
-
protected setStatus(status: TierStatus): void;
|
|
925
|
+
protected setStatus(status: TierStatus, output?: string): void;
|
|
923
926
|
protected setLabel(label: string): void;
|
|
924
927
|
setSystemPromptOverride(prompt: string): void;
|
|
925
928
|
setHierarchyContext(context: string): void;
|
|
@@ -1581,7 +1584,7 @@ declare class Telemetry {
|
|
|
1581
1584
|
shutdown(): Promise<void>;
|
|
1582
1585
|
}
|
|
1583
1586
|
|
|
1584
|
-
declare const CASCADE_VERSION = "0.
|
|
1587
|
+
declare const CASCADE_VERSION = "0.3.0";
|
|
1585
1588
|
declare const CASCADE_CONFIG_DIR = ".cascade";
|
|
1586
1589
|
declare const CASCADE_MD_FILE = "CASCADE.md";
|
|
1587
1590
|
declare const CASCADE_IGNORE_FILE = ".cascadeignore";
|
package/dist/index.js
CHANGED
|
@@ -124,7 +124,7 @@ var require_keytar2 = __commonJS({
|
|
|
124
124
|
});
|
|
125
125
|
|
|
126
126
|
// src/constants.ts
|
|
127
|
-
var CASCADE_VERSION = "0.
|
|
127
|
+
var CASCADE_VERSION = "0.3.0";
|
|
128
128
|
var CASCADE_CONFIG_DIR = ".cascade";
|
|
129
129
|
var CASCADE_MD_FILE = "CASCADE.md";
|
|
130
130
|
var CASCADE_IGNORE_FILE = ".cascadeignore";
|
|
@@ -1995,7 +1995,7 @@ var BaseTier = class extends EventEmitter {
|
|
|
1995
1995
|
getStatus() {
|
|
1996
1996
|
return this.status;
|
|
1997
1997
|
}
|
|
1998
|
-
setStatus(status) {
|
|
1998
|
+
setStatus(status, output) {
|
|
1999
1999
|
this.status = status;
|
|
2000
2000
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
2001
2001
|
const event = {
|
|
@@ -2004,7 +2004,8 @@ var BaseTier = class extends EventEmitter {
|
|
|
2004
2004
|
parentId: this.parentId,
|
|
2005
2005
|
label: this.label,
|
|
2006
2006
|
status,
|
|
2007
|
-
timestamp
|
|
2007
|
+
timestamp,
|
|
2008
|
+
output
|
|
2008
2009
|
};
|
|
2009
2010
|
this.emit("status", event);
|
|
2010
2011
|
this.emit("tier:status", event);
|
|
@@ -2030,7 +2031,8 @@ var BaseTier = class extends EventEmitter {
|
|
|
2030
2031
|
status: this.status,
|
|
2031
2032
|
currentAction: update.currentAction,
|
|
2032
2033
|
progressPct: update.progressPct,
|
|
2033
|
-
timestamp
|
|
2034
|
+
timestamp,
|
|
2035
|
+
output: update.output
|
|
2034
2036
|
});
|
|
2035
2037
|
}
|
|
2036
2038
|
buildMessage(type, to, payload) {
|
|
@@ -2410,16 +2412,17 @@ Now execute your subtask using this context where relevant.`
|
|
|
2410
2412
|
return this.buildResult("ESCALATED", output, { checksRun, passed, failed }, issues, correctionAttempts);
|
|
2411
2413
|
}
|
|
2412
2414
|
}
|
|
2413
|
-
this.setStatus("COMPLETED");
|
|
2414
|
-
this.sendStatusUpdate({ progressPct: 100, currentAction: "Subtask complete", status: "IN_PROGRESS" });
|
|
2415
|
+
this.setStatus("COMPLETED", output);
|
|
2416
|
+
this.sendStatusUpdate({ progressPct: 100, currentAction: "Subtask complete", status: "IN_PROGRESS", output });
|
|
2415
2417
|
this.peerBus?.publish(this.id, assignment.subtaskId, output, "COMPLETED");
|
|
2416
2418
|
return this.buildResult("COMPLETED", output, { checksRun, passed, failed }, issues, correctionAttempts);
|
|
2417
2419
|
} catch (err) {
|
|
2418
2420
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
2419
2421
|
issues.push(`Execution error: ${errMsg}`);
|
|
2420
|
-
|
|
2421
|
-
this.
|
|
2422
|
-
|
|
2422
|
+
const finalOutput = output || errMsg;
|
|
2423
|
+
this.setStatus("FAILED", finalOutput);
|
|
2424
|
+
this.peerBus?.publish(this.id, assignment.subtaskId, finalOutput, "FAILED");
|
|
2425
|
+
return this.buildResult("ESCALATED", finalOutput, { checksRun, passed, failed }, issues, correctionAttempts);
|
|
2423
2426
|
}
|
|
2424
2427
|
}
|
|
2425
2428
|
sendToPeer(toId, content) {
|
|
@@ -3102,8 +3105,9 @@ var T2Manager = class extends BaseTier {
|
|
|
3102
3105
|
const summary = await this.aggregateResults(assignment, t3Results);
|
|
3103
3106
|
const issues = t3Results.filter((r) => r.status !== "COMPLETED").flatMap((r) => r.issues);
|
|
3104
3107
|
const overallStatus = this.determineStatus(t3Results);
|
|
3105
|
-
|
|
3106
|
-
this.
|
|
3108
|
+
const isOk = overallStatus === "COMPLETED" || overallStatus === "PARTIAL";
|
|
3109
|
+
this.setStatus(isOk ? "COMPLETED" : "FAILED", summary);
|
|
3110
|
+
this.sendStatusUpdate({ progressPct: 100, currentAction: "Section complete", status: "IN_PROGRESS", output: summary });
|
|
3107
3111
|
const result = {
|
|
3108
3112
|
sectionId: assignment.sectionId,
|
|
3109
3113
|
sectionTitle: assignment.sectionTitle,
|
|
@@ -3116,7 +3120,7 @@ var T2Manager = class extends BaseTier {
|
|
|
3116
3120
|
return result;
|
|
3117
3121
|
} catch (err) {
|
|
3118
3122
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
3119
|
-
this.setStatus("FAILED");
|
|
3123
|
+
this.setStatus("FAILED", errMsg);
|
|
3120
3124
|
const failedResult = {
|
|
3121
3125
|
sectionId: assignment.sectionId,
|
|
3122
3126
|
sectionTitle: assignment.sectionTitle,
|
|
@@ -3678,8 +3682,8 @@ Create a CORRECTION PLAN that contains only the new sections needed to fix the i
|
|
|
3678
3682
|
status: "IN_PROGRESS"
|
|
3679
3683
|
});
|
|
3680
3684
|
const output = await this.compileFinalOutput(userPrompt, plan, allT2Results);
|
|
3681
|
-
this.setStatus("COMPLETED");
|
|
3682
|
-
this.sendStatusUpdate({ progressPct: 100, currentAction: "Task complete", status: "IN_PROGRESS" });
|
|
3685
|
+
this.setStatus("COMPLETED", output);
|
|
3686
|
+
this.sendStatusUpdate({ progressPct: 100, currentAction: "Task complete", status: "IN_PROGRESS", output });
|
|
3683
3687
|
return { output, t2Results: allT2Results, taskId: this.taskId, complexity: plan.complexity };
|
|
3684
3688
|
}
|
|
3685
3689
|
getEscalations() {
|
|
@@ -6817,8 +6821,8 @@ Original error: ${err.message}`
|
|
|
6817
6821
|
upsertRuntimeNode(node) {
|
|
6818
6822
|
this.enqueueWrite(() => {
|
|
6819
6823
|
this.db.prepare(`
|
|
6820
|
-
INSERT INTO runtime_nodes (tier_id, session_id, parent_id, role, label, status, current_action, progress_pct, updated_at, workspace_path, is_global)
|
|
6821
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
6824
|
+
INSERT INTO runtime_nodes (tier_id, session_id, parent_id, role, label, status, current_action, progress_pct, updated_at, workspace_path, is_global, output)
|
|
6825
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
6822
6826
|
ON CONFLICT(tier_id) DO UPDATE SET
|
|
6823
6827
|
session_id = excluded.session_id,
|
|
6824
6828
|
parent_id = excluded.parent_id,
|
|
@@ -6829,7 +6833,8 @@ Original error: ${err.message}`
|
|
|
6829
6833
|
progress_pct = excluded.progress_pct,
|
|
6830
6834
|
updated_at = excluded.updated_at,
|
|
6831
6835
|
workspace_path = excluded.workspace_path,
|
|
6832
|
-
is_global = excluded.is_global
|
|
6836
|
+
is_global = excluded.is_global,
|
|
6837
|
+
output = excluded.output
|
|
6833
6838
|
`).run(
|
|
6834
6839
|
node.tierId,
|
|
6835
6840
|
node.sessionId,
|
|
@@ -6841,7 +6846,8 @@ Original error: ${err.message}`
|
|
|
6841
6846
|
node.progressPct ?? null,
|
|
6842
6847
|
node.updatedAt,
|
|
6843
6848
|
node.workspacePath ?? null,
|
|
6844
|
-
node.isGlobal ? 1 : 0
|
|
6849
|
+
node.isGlobal ? 1 : 0,
|
|
6850
|
+
node.output ?? null
|
|
6845
6851
|
);
|
|
6846
6852
|
});
|
|
6847
6853
|
}
|
|
@@ -6862,14 +6868,15 @@ Original error: ${err.message}`
|
|
|
6862
6868
|
progressPct: row.progress_pct ?? void 0,
|
|
6863
6869
|
updatedAt: row.updated_at,
|
|
6864
6870
|
workspacePath: row.workspace_path ?? void 0,
|
|
6865
|
-
isGlobal: row.is_global === 1
|
|
6871
|
+
isGlobal: row.is_global === 1,
|
|
6872
|
+
output: row.output ?? void 0
|
|
6866
6873
|
}));
|
|
6867
6874
|
}
|
|
6868
6875
|
addRuntimeNodeLog(log) {
|
|
6869
6876
|
this.enqueueWrite(() => {
|
|
6870
6877
|
this.db.prepare(`
|
|
6871
|
-
INSERT INTO runtime_node_logs (id, session_id, tier_id, role, label, status, current_action, progress_pct, timestamp, workspace_path, is_global)
|
|
6872
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
6878
|
+
INSERT INTO runtime_node_logs (id, session_id, tier_id, role, label, status, current_action, progress_pct, timestamp, workspace_path, is_global, output)
|
|
6879
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
6873
6880
|
`).run(
|
|
6874
6881
|
log.id,
|
|
6875
6882
|
log.sessionId,
|
|
@@ -6881,7 +6888,8 @@ Original error: ${err.message}`
|
|
|
6881
6888
|
log.progressPct ?? null,
|
|
6882
6889
|
log.timestamp,
|
|
6883
6890
|
log.workspacePath ?? null,
|
|
6884
|
-
log.isGlobal ? 1 : 0
|
|
6891
|
+
log.isGlobal ? 1 : 0,
|
|
6892
|
+
log.output ?? null
|
|
6885
6893
|
);
|
|
6886
6894
|
this.db.prepare(`
|
|
6887
6895
|
DELETE FROM runtime_node_logs
|
|
@@ -6924,7 +6932,8 @@ Original error: ${err.message}`
|
|
|
6924
6932
|
progressPct: row.progress_pct ?? void 0,
|
|
6925
6933
|
timestamp: row.timestamp,
|
|
6926
6934
|
workspacePath: row.workspace_path ?? void 0,
|
|
6927
|
-
isGlobal: row.is_global === 1
|
|
6935
|
+
isGlobal: row.is_global === 1,
|
|
6936
|
+
output: row.output ?? void 0
|
|
6928
6937
|
}));
|
|
6929
6938
|
}
|
|
6930
6939
|
// ── Messages ──────────────────────────────────
|
|
@@ -7251,7 +7260,8 @@ Original error: ${err.message}`
|
|
|
7251
7260
|
progress_pct INTEGER,
|
|
7252
7261
|
updated_at TEXT NOT NULL,
|
|
7253
7262
|
workspace_path TEXT,
|
|
7254
|
-
is_global INTEGER NOT NULL DEFAULT 0
|
|
7263
|
+
is_global INTEGER NOT NULL DEFAULT 0,
|
|
7264
|
+
output TEXT
|
|
7255
7265
|
);
|
|
7256
7266
|
|
|
7257
7267
|
CREATE INDEX IF NOT EXISTS idx_runtime_nodes_session ON runtime_nodes(session_id);
|
|
@@ -7268,7 +7278,8 @@ Original error: ${err.message}`
|
|
|
7268
7278
|
progress_pct INTEGER,
|
|
7269
7279
|
timestamp TEXT NOT NULL,
|
|
7270
7280
|
workspace_path TEXT,
|
|
7271
|
-
is_global INTEGER NOT NULL DEFAULT 0
|
|
7281
|
+
is_global INTEGER NOT NULL DEFAULT 0,
|
|
7282
|
+
output TEXT
|
|
7272
7283
|
);
|
|
7273
7284
|
|
|
7274
7285
|
CREATE TABLE IF NOT EXISTS model_cache (
|
|
@@ -7297,6 +7308,14 @@ Original error: ${err.message}`
|
|
|
7297
7308
|
|
|
7298
7309
|
CREATE INDEX IF NOT EXISTS idx_file_snapshots_session ON file_snapshots(session_id);
|
|
7299
7310
|
`);
|
|
7311
|
+
try {
|
|
7312
|
+
this.db.exec("ALTER TABLE runtime_nodes ADD COLUMN output TEXT");
|
|
7313
|
+
} catch {
|
|
7314
|
+
}
|
|
7315
|
+
try {
|
|
7316
|
+
this.db.exec("ALTER TABLE runtime_node_logs ADD COLUMN output TEXT");
|
|
7317
|
+
} catch {
|
|
7318
|
+
}
|
|
7300
7319
|
}
|
|
7301
7320
|
// ── Deserializers ─────────────────────────────
|
|
7302
7321
|
deserializeSession(row, messages) {
|
|
@@ -8070,8 +8089,8 @@ var DashboardServer = class {
|
|
|
8070
8089
|
void (async () => {
|
|
8071
8090
|
const cascade = new Cascade(this.config, this.workspacePath, this.store);
|
|
8072
8091
|
cascade.on("stream:token", (e) => {
|
|
8073
|
-
this.socket.broadcast("stream:token", { sessionId,
|
|
8074
|
-
this.socket.broadcastToRoom(`session:${sessionId}`, "stream:token", { sessionId,
|
|
8092
|
+
this.socket.broadcast("stream:token", { sessionId, tierId: e.tierId, text: e.text });
|
|
8093
|
+
this.socket.broadcastToRoom(`session:${sessionId}`, "stream:token", { sessionId, tierId: e.tierId, text: e.text });
|
|
8075
8094
|
});
|
|
8076
8095
|
cascade.on("tier:status", (e) => {
|
|
8077
8096
|
this.socket.broadcast("tier:status", { sessionId, ...e });
|