@elizaos/plugin-agent-orchestrator 0.4.0 → 0.4.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.
@@ -1 +1 @@
1
- {"version":3,"file":"start-coding-task.d.ts","sourceRoot":"","sources":["../../src/actions/start-coding-task.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,MAAM,EAOP,MAAM,eAAe,CAAC;AAWvB,eAAO,MAAM,qBAAqB,EAAE,MAwQnC,CAAC"}
1
+ {"version":3,"file":"start-coding-task.d.ts","sourceRoot":"","sources":["../../src/actions/start-coding-task.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,MAAM,EAOP,MAAM,eAAe,CAAC;AAWvB,eAAO,MAAM,qBAAqB,EAAE,MA2QnC,CAAC"}
package/dist/index.js CHANGED
@@ -3241,6 +3241,7 @@ import * as os from "os";
3241
3241
  import * as path2 from "path";
3242
3242
  var MAX_ENTRIES = 150;
3243
3243
  var TRUNCATE_TO = 100;
3244
+ var MAX_FILE_SIZE_BYTES = 1048576;
3244
3245
 
3245
3246
  class WriteMutex {
3246
3247
  queue = [];
@@ -3280,6 +3281,13 @@ class SwarmHistory {
3280
3281
  await fs.appendFile(this.filePath, `${JSON.stringify(entry)}
3281
3282
  `, "utf-8");
3282
3283
  this.appendCount++;
3284
+ try {
3285
+ const stat2 = await fs.stat(this.filePath);
3286
+ if (stat2.size > MAX_FILE_SIZE_BYTES) {
3287
+ await this.truncateInner(TRUNCATE_TO);
3288
+ return;
3289
+ }
3290
+ } catch {}
3283
3291
  if (this.appendCount >= MAX_ENTRIES - TRUNCATE_TO) {
3284
3292
  const content = await fs.readFile(this.filePath, "utf-8");
3285
3293
  const lineCount = content.split(`
@@ -3339,10 +3347,16 @@ class SwarmHistory {
3339
3347
  return;
3340
3348
  }
3341
3349
  }
3342
- const kept = entries.slice(-maxEntries);
3343
- const content = kept.map((e) => JSON.stringify(e)).join(`
3350
+ let kept = entries.slice(-maxEntries);
3351
+ let content = kept.map((e) => JSON.stringify(e)).join(`
3352
+ `) + `
3353
+ `;
3354
+ while (Buffer.byteLength(content, "utf-8") > MAX_FILE_SIZE_BYTES && kept.length > 1) {
3355
+ kept = kept.slice(Math.max(1, Math.floor(kept.length * 0.2)));
3356
+ content = kept.map((e) => JSON.stringify(e)).join(`
3344
3357
  `) + `
3345
3358
  `;
3359
+ }
3346
3360
  await fs.writeFile(this.filePath, content, "utf-8");
3347
3361
  this.appendCount = 0;
3348
3362
  }
@@ -5746,7 +5760,8 @@ var startCodingTaskAction = {
5746
5760
  return handleMultiAgent(ctx, agentsParam);
5747
5761
  }
5748
5762
  const task = params?.task ?? content.task;
5749
- const singleAgentSpec = task || "";
5763
+ const userText = content.text?.trim() || "";
5764
+ const singleAgentSpec = task || userText;
5750
5765
  return handleMultiAgent(ctx, singleAgentSpec);
5751
5766
  },
5752
5767
  parameters: [
@@ -8028,5 +8043,5 @@ export {
8028
8043
  CodingWorkspaceService
8029
8044
  };
8030
8045
 
8031
- //# debugId=5999C4AE1407A27464756E2164756E21
8046
+ //# debugId=322E3591797FD51B64756E2164756E21
8032
8047
  //# sourceMappingURL=index.js.map