cascade-ai 0.2.1 → 0.2.2

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/index.d.cts CHANGED
@@ -1534,7 +1534,7 @@ declare class Telemetry {
1534
1534
  shutdown(): Promise<void>;
1535
1535
  }
1536
1536
 
1537
- declare const CASCADE_VERSION = "0.2.0";
1537
+ declare const CASCADE_VERSION = "0.2.2";
1538
1538
  declare const CASCADE_CONFIG_DIR = ".cascade";
1539
1539
  declare const CASCADE_MD_FILE = "CASCADE.md";
1540
1540
  declare const CASCADE_IGNORE_FILE = ".cascadeignore";
package/dist/index.d.ts CHANGED
@@ -1534,7 +1534,7 @@ declare class Telemetry {
1534
1534
  shutdown(): Promise<void>;
1535
1535
  }
1536
1536
 
1537
- declare const CASCADE_VERSION = "0.2.0";
1537
+ declare const CASCADE_VERSION = "0.2.2";
1538
1538
  declare const CASCADE_CONFIG_DIR = ".cascade";
1539
1539
  declare const CASCADE_MD_FILE = "CASCADE.md";
1540
1540
  declare const CASCADE_IGNORE_FILE = ".cascadeignore";
package/dist/index.js CHANGED
@@ -123,7 +123,7 @@ var require_keytar2 = __commonJS({
123
123
  });
124
124
 
125
125
  // src/constants.ts
126
- var CASCADE_VERSION = "0.2.0";
126
+ var CASCADE_VERSION = "0.2.2";
127
127
  var CASCADE_CONFIG_DIR = ".cascade";
128
128
  var CASCADE_MD_FILE = "CASCADE.md";
129
129
  var CASCADE_IGNORE_FILE = ".cascadeignore";
@@ -2266,14 +2266,13 @@ Now execute your subtask using this context where relevant.`
2266
2266
  await this.peerBus.barrier(this.id, barrierName, total);
2267
2267
  }
2268
2268
  receivePeerSync(fromId, content) {
2269
- const existing = this.peerSyncBuffer.find((p) => p.fromId === fromId);
2270
- if (existing) {
2271
- existing.content = content;
2272
- existing.timestamp = (/* @__PURE__ */ new Date()).toISOString();
2273
- } else {
2274
- this.peerSyncBuffer.push({ fromId, content, timestamp: (/* @__PURE__ */ new Date()).toISOString() });
2275
- }
2269
+ this.peerSyncBuffer.push({ fromId, content, timestamp: (/* @__PURE__ */ new Date()).toISOString() });
2276
2270
  this.emit("peer-sync-received", { fromId, content });
2271
+ this.context.addMessage({
2272
+ role: "user",
2273
+ content: `[SYSTEM_NOTIFICATION]: You received a new peer message from ${fromId}. Use the "peer_message" tool with action="receive" to read it.`
2274
+ }).catch(() => {
2275
+ });
2277
2276
  }
2278
2277
  // ── Private ──────────────────────────────────
2279
2278
  async runAgentLoop(systemPrompt, tools) {
@@ -2404,7 +2403,11 @@ HIERARCHY CONTEXT: ${this.hierarchyContext}` : ""),
2404
2403
  sendPeerSync: (to, syncType, content) => {
2405
2404
  this.peerBus?.send(this.id, to, syncType, this.assignment?.subtaskId ?? "", content);
2406
2405
  },
2407
- getPeerMessages: () => [...this.peerSyncBuffer]
2406
+ getPeerMessages: () => {
2407
+ const msgs = [...this.peerSyncBuffer];
2408
+ this.peerSyncBuffer = [];
2409
+ return msgs;
2410
+ }
2408
2411
  });
2409
2412
  if (this.audit) {
2410
2413
  this.audit.toolCall(this.id, tc.name, tc.input);
@@ -2946,13 +2949,17 @@ var T2Manager = class extends BaseTier {
2946
2949
  }
2947
2950
  // ── Private ──────────────────────────────────
2948
2951
  async decomposeSection(assignment) {
2952
+ const peerPlans = this.peerSyncBuffer.filter((p) => p.content?.type === "T2_PLAN_ANNOUNCEMENT").map((p) => `[Peer ${p.fromId} Plan]: ${p.content.sectionTitle} - ${p.content.subtaskTitles?.join(", ")}`).join("\n");
2949
2953
  const prompt = `Decompose this section into 2-5 concrete subtasks for T3 workers.
2950
2954
 
2951
2955
  Section: ${assignment.sectionTitle}
2952
2956
  Description: ${assignment.description}
2953
2957
  Expected output: ${assignment.expectedOutput}
2954
2958
  Constraints: ${assignment.constraints.join("; ")}
2955
-
2959
+ ${peerPlans ? `
2960
+ Context from sibling T2 plans (use this to align execution and avoid overlaps):
2961
+ ${peerPlans}
2962
+ ` : ""}
2956
2963
  Return a JSON array of subtask objects, each with:
2957
2964
  - subtaskId: string (unique)
2958
2965
  - subtaskTitle: string
@@ -3166,9 +3173,14 @@ HIERARCHY CONTEXT: ${this.hierarchyContext}` : ""),
3166
3173
  const completed = results.filter((r) => r.status === "COMPLETED");
3167
3174
  if (!completed.length) return `Section ${assignment.sectionTitle} failed \u2014 no T3 workers completed.`;
3168
3175
  const outputs = completed.map((r, i) => `[T3-${i + 1}]: ${r.output}`).join("\n\n");
3176
+ const peerOutputs = this.peerSyncBuffer.filter((p) => p.content?.type === "T2_SECTION_OUTPUT").map((p) => `[Peer ${p.fromId} Output]: ${p.content.output}`).join("\n\n");
3169
3177
  const prompt = `Summarize these T3 worker outputs for section "${assignment.sectionTitle}" in 2-3 sentences:
3170
3178
 
3171
- ${outputs}`;
3179
+ ${outputs}
3180
+ ${peerOutputs ? `
3181
+
3182
+ Context from sibling T2 completed sections (use this to ensure your summary aligns with the overall state):
3183
+ ${peerOutputs}` : ""}`;
3172
3184
  const messages = [{ role: "user", content: prompt }];
3173
3185
  try {
3174
3186
  const result = await this.router.generate("T2", {