@aiden-ade/sandbox-agent 0.1.6 → 0.1.7

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.cjs CHANGED
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  mod
31
31
  ));
32
32
 
33
- // ../../node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js
33
+ // ../../node_modules/.pnpm/xmlhttprequest-ssl@2.1.2/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js
34
34
  var require_XMLHttpRequest = __commonJS({
35
- "../../node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js"(exports2, module2) {
35
+ "../../node_modules/.pnpm/xmlhttprequest-ssl@2.1.2/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js"(exports2, module2) {
36
36
  "use strict";
37
37
  var fs = require("fs");
38
38
  var Url = require("url");
@@ -434,9 +434,9 @@ var require_XMLHttpRequest = __commonJS({
434
434
  }
435
435
  });
436
436
 
437
- // ../../node_modules/ms/index.js
437
+ // ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
438
438
  var require_ms = __commonJS({
439
- "../../node_modules/ms/index.js"(exports2, module2) {
439
+ "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module2) {
440
440
  "use strict";
441
441
  var s = 1e3;
442
442
  var m = s * 60;
@@ -551,9 +551,9 @@ var require_ms = __commonJS({
551
551
  }
552
552
  });
553
553
 
554
- // ../../node_modules/debug/src/common.js
554
+ // ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js
555
555
  var require_common = __commonJS({
556
- "../../node_modules/debug/src/common.js"(exports2, module2) {
556
+ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js"(exports2, module2) {
557
557
  "use strict";
558
558
  function setup(env) {
559
559
  createDebug.debug = createDebug;
@@ -729,9 +729,9 @@ var require_common = __commonJS({
729
729
  }
730
730
  });
731
731
 
732
- // ../../node_modules/debug/src/browser.js
732
+ // ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js
733
733
  var require_browser = __commonJS({
734
- "../../node_modules/debug/src/browser.js"(exports2, module2) {
734
+ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js"(exports2, module2) {
735
735
  "use strict";
736
736
  exports2.formatArgs = formatArgs;
737
737
  exports2.save = save;
@@ -1015,9 +1015,9 @@ var require_supports_color = __commonJS({
1015
1015
  }
1016
1016
  });
1017
1017
 
1018
- // ../../node_modules/debug/src/node.js
1018
+ // ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js
1019
1019
  var require_node = __commonJS({
1020
- "../../node_modules/debug/src/node.js"(exports2, module2) {
1020
+ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js"(exports2, module2) {
1021
1021
  "use strict";
1022
1022
  var tty = require("tty");
1023
1023
  var util = require("util");
@@ -1190,9 +1190,9 @@ var require_node = __commonJS({
1190
1190
  }
1191
1191
  });
1192
1192
 
1193
- // ../../node_modules/debug/src/index.js
1193
+ // ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js
1194
1194
  var require_src = __commonJS({
1195
- "../../node_modules/debug/src/index.js"(exports2, module2) {
1195
+ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js"(exports2, module2) {
1196
1196
  "use strict";
1197
1197
  if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
1198
1198
  module2.exports = require_browser();
@@ -1202,9 +1202,9 @@ var require_src = __commonJS({
1202
1202
  }
1203
1203
  });
1204
1204
 
1205
- // ../../node_modules/engine.io-client/node_modules/ws/lib/constants.js
1205
+ // ../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/constants.js
1206
1206
  var require_constants = __commonJS({
1207
- "../../node_modules/engine.io-client/node_modules/ws/lib/constants.js"(exports2, module2) {
1207
+ "../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/constants.js"(exports2, module2) {
1208
1208
  "use strict";
1209
1209
  var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
1210
1210
  var hasBlob = typeof Blob !== "undefined";
@@ -1224,9 +1224,9 @@ var require_constants = __commonJS({
1224
1224
  }
1225
1225
  });
1226
1226
 
1227
- // ../../node_modules/engine.io-client/node_modules/ws/lib/buffer-util.js
1227
+ // ../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/buffer-util.js
1228
1228
  var require_buffer_util = __commonJS({
1229
- "../../node_modules/engine.io-client/node_modules/ws/lib/buffer-util.js"(exports2, module2) {
1229
+ "../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/buffer-util.js"(exports2, module2) {
1230
1230
  "use strict";
1231
1231
  var { EMPTY_BUFFER } = require_constants();
1232
1232
  var FastBuffer = Buffer[Symbol.species];
@@ -1299,9 +1299,9 @@ var require_buffer_util = __commonJS({
1299
1299
  }
1300
1300
  });
1301
1301
 
1302
- // ../../node_modules/engine.io-client/node_modules/ws/lib/limiter.js
1302
+ // ../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/limiter.js
1303
1303
  var require_limiter = __commonJS({
1304
- "../../node_modules/engine.io-client/node_modules/ws/lib/limiter.js"(exports2, module2) {
1304
+ "../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/limiter.js"(exports2, module2) {
1305
1305
  "use strict";
1306
1306
  var kDone = /* @__PURE__ */ Symbol("kDone");
1307
1307
  var kRun = /* @__PURE__ */ Symbol("kRun");
@@ -1349,9 +1349,9 @@ var require_limiter = __commonJS({
1349
1349
  }
1350
1350
  });
1351
1351
 
1352
- // ../../node_modules/engine.io-client/node_modules/ws/lib/permessage-deflate.js
1352
+ // ../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/permessage-deflate.js
1353
1353
  var require_permessage_deflate = __commonJS({
1354
- "../../node_modules/engine.io-client/node_modules/ws/lib/permessage-deflate.js"(exports2, module2) {
1354
+ "../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/permessage-deflate.js"(exports2, module2) {
1355
1355
  "use strict";
1356
1356
  var zlib = require("zlib");
1357
1357
  var bufferUtil = require_buffer_util();
@@ -1732,9 +1732,9 @@ var require_permessage_deflate = __commonJS({
1732
1732
  }
1733
1733
  });
1734
1734
 
1735
- // ../../node_modules/engine.io-client/node_modules/ws/lib/validation.js
1735
+ // ../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/validation.js
1736
1736
  var require_validation = __commonJS({
1737
- "../../node_modules/engine.io-client/node_modules/ws/lib/validation.js"(exports2, module2) {
1737
+ "../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/validation.js"(exports2, module2) {
1738
1738
  "use strict";
1739
1739
  var { isUtf8 } = require("buffer");
1740
1740
  var { hasBlob } = require_constants();
@@ -1933,9 +1933,9 @@ var require_validation = __commonJS({
1933
1933
  }
1934
1934
  });
1935
1935
 
1936
- // ../../node_modules/engine.io-client/node_modules/ws/lib/receiver.js
1936
+ // ../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/receiver.js
1937
1937
  var require_receiver = __commonJS({
1938
- "../../node_modules/engine.io-client/node_modules/ws/lib/receiver.js"(exports2, module2) {
1938
+ "../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/receiver.js"(exports2, module2) {
1939
1939
  "use strict";
1940
1940
  var { Writable } = require("stream");
1941
1941
  var PerMessageDeflate = require_permessage_deflate();
@@ -2525,9 +2525,9 @@ var require_receiver = __commonJS({
2525
2525
  }
2526
2526
  });
2527
2527
 
2528
- // ../../node_modules/engine.io-client/node_modules/ws/lib/sender.js
2528
+ // ../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/sender.js
2529
2529
  var require_sender = __commonJS({
2530
- "../../node_modules/engine.io-client/node_modules/ws/lib/sender.js"(exports2, module2) {
2530
+ "../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/sender.js"(exports2, module2) {
2531
2531
  "use strict";
2532
2532
  var { Duplex } = require("stream");
2533
2533
  var { randomFillSync } = require("crypto");
@@ -3013,9 +3013,9 @@ var require_sender = __commonJS({
3013
3013
  }
3014
3014
  });
3015
3015
 
3016
- // ../../node_modules/engine.io-client/node_modules/ws/lib/event-target.js
3016
+ // ../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/event-target.js
3017
3017
  var require_event_target = __commonJS({
3018
- "../../node_modules/engine.io-client/node_modules/ws/lib/event-target.js"(exports2, module2) {
3018
+ "../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/event-target.js"(exports2, module2) {
3019
3019
  "use strict";
3020
3020
  var { kForOnEventAttribute, kListener } = require_constants();
3021
3021
  var kCode = /* @__PURE__ */ Symbol("kCode");
@@ -3242,9 +3242,9 @@ var require_event_target = __commonJS({
3242
3242
  }
3243
3243
  });
3244
3244
 
3245
- // ../../node_modules/engine.io-client/node_modules/ws/lib/extension.js
3245
+ // ../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/extension.js
3246
3246
  var require_extension = __commonJS({
3247
- "../../node_modules/engine.io-client/node_modules/ws/lib/extension.js"(exports2, module2) {
3247
+ "../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/extension.js"(exports2, module2) {
3248
3248
  "use strict";
3249
3249
  var { tokenChars } = require_validation();
3250
3250
  function push(dest, name, elem) {
@@ -3395,16 +3395,16 @@ var require_extension = __commonJS({
3395
3395
  }
3396
3396
  });
3397
3397
 
3398
- // ../../node_modules/engine.io-client/node_modules/ws/lib/websocket.js
3398
+ // ../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/websocket.js
3399
3399
  var require_websocket = __commonJS({
3400
- "../../node_modules/engine.io-client/node_modules/ws/lib/websocket.js"(exports2, module2) {
3400
+ "../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/websocket.js"(exports2, module2) {
3401
3401
  "use strict";
3402
3402
  var EventEmitter = require("events");
3403
3403
  var https = require("https");
3404
3404
  var http = require("http");
3405
3405
  var net = require("net");
3406
3406
  var tls = require("tls");
3407
- var { randomBytes, createHash } = require("crypto");
3407
+ var { randomBytes, createHash: createHash2 } = require("crypto");
3408
3408
  var { Duplex, Readable } = require("stream");
3409
3409
  var { URL } = require("url");
3410
3410
  var PerMessageDeflate = require_permessage_deflate();
@@ -4061,7 +4061,7 @@ var require_websocket = __commonJS({
4061
4061
  abortHandshake(websocket, socket, "Invalid Upgrade header");
4062
4062
  return;
4063
4063
  }
4064
- const digest = createHash("sha1").update(key + GUID).digest("base64");
4064
+ const digest = createHash2("sha1").update(key + GUID).digest("base64");
4065
4065
  if (res.headers["sec-websocket-accept"] !== digest) {
4066
4066
  abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
4067
4067
  return;
@@ -4278,9 +4278,9 @@ var require_websocket = __commonJS({
4278
4278
  }
4279
4279
  });
4280
4280
 
4281
- // ../../node_modules/engine.io-client/node_modules/ws/lib/stream.js
4281
+ // ../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/stream.js
4282
4282
  var require_stream = __commonJS({
4283
- "../../node_modules/engine.io-client/node_modules/ws/lib/stream.js"(exports2, module2) {
4283
+ "../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/stream.js"(exports2, module2) {
4284
4284
  "use strict";
4285
4285
  var WebSocket2 = require_websocket();
4286
4286
  var { Duplex } = require("stream");
@@ -4376,9 +4376,9 @@ var require_stream = __commonJS({
4376
4376
  }
4377
4377
  });
4378
4378
 
4379
- // ../../node_modules/engine.io-client/node_modules/ws/lib/subprotocol.js
4379
+ // ../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/subprotocol.js
4380
4380
  var require_subprotocol = __commonJS({
4381
- "../../node_modules/engine.io-client/node_modules/ws/lib/subprotocol.js"(exports2, module2) {
4381
+ "../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/subprotocol.js"(exports2, module2) {
4382
4382
  "use strict";
4383
4383
  var { tokenChars } = require_validation();
4384
4384
  function parse3(header) {
@@ -4421,14 +4421,14 @@ var require_subprotocol = __commonJS({
4421
4421
  }
4422
4422
  });
4423
4423
 
4424
- // ../../node_modules/engine.io-client/node_modules/ws/lib/websocket-server.js
4424
+ // ../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/websocket-server.js
4425
4425
  var require_websocket_server = __commonJS({
4426
- "../../node_modules/engine.io-client/node_modules/ws/lib/websocket-server.js"(exports2, module2) {
4426
+ "../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/websocket-server.js"(exports2, module2) {
4427
4427
  "use strict";
4428
4428
  var EventEmitter = require("events");
4429
4429
  var http = require("http");
4430
4430
  var { Duplex } = require("stream");
4431
- var { createHash } = require("crypto");
4431
+ var { createHash: createHash2 } = require("crypto");
4432
4432
  var extension = require_extension();
4433
4433
  var PerMessageDeflate = require_permessage_deflate();
4434
4434
  var subprotocol = require_subprotocol();
@@ -4725,7 +4725,7 @@ var require_websocket_server = __commonJS({
4725
4725
  );
4726
4726
  }
4727
4727
  if (this._state > RUNNING) return abortHandshake(socket, 503);
4728
- const digest = createHash("sha1").update(key + GUID).digest("base64");
4728
+ const digest = createHash2("sha1").update(key + GUID).digest("base64");
4729
4729
  const headers = [
4730
4730
  "HTTP/1.1 101 Switching Protocols",
4731
4731
  "Upgrade: websocket",
@@ -4812,58 +4812,75 @@ var require_websocket_server = __commonJS({
4812
4812
 
4813
4813
  // ../agent-core/dist/index.js
4814
4814
  var import_child_process = require("child_process");
4815
+ var import_crypto = require("crypto");
4815
4816
  var import_fs = require("fs");
4816
4817
  var import_os = require("os");
4817
4818
  var import_path = require("path");
4818
4819
  var import_readline = require("readline");
4819
4820
 
4820
- // ../shared/dist/constants/agent.js
4821
- var INTERACTIVE_TOOL_NAMES = /* @__PURE__ */ new Set([
4822
- "askuserquestion",
4823
- "exitplanmode",
4824
- "enterplanmode"
4825
- ]);
4821
+ // ../shared/dist/agent/system-prompt.js
4822
+ var AIDEN_IDENTITY_PROMPT = `You are Aiden, the software factory agent built by Supatest in Bangalore. Software gets built here end to end: plan, write, review, test, ship. You are the teammate \u2014 not a chatbot, not a task management tool. Wear whatever hat the moment demands: product thinker, planner, tech lead, programmer, reviewer, debugger, tester, collaborator. Read the room and pick the hat. Never force programmer mode on a product question.
4826
4823
 
4827
- // ../agent-core/dist/index.js
4828
- var import_fs2 = require("fs");
4829
- var import_os2 = require("os");
4830
- var import_path2 = require("path");
4824
+ Do not present yourself as Claude, Claude Code, Codex, Gemini, Anthropic, or OpenAI as your primary identity \u2014 those are runtime details. Mention them only if the user explicitly asks about the underlying model or backend. If the user asks who you are, answer in Aiden terms first.
4831
4825
 
4832
- // ../shared/dist/agent/system-prompt.js
4833
- var AIDEN_IDENTITY_PROMPT = [
4834
- "You are Aiden, the software factory agent built by Supatest.",
4835
- "Aiden-specific identity, voice, and operating rules come from the internal Aiden system skill. Follow those rules when relevant.",
4836
- "You are the teammate inside Aiden who helps scope, plan, build, review, test, and ship work.",
4837
- "Do not present yourself as Claude, Claude Code, Codex, Gemini, Anthropic, or OpenAI as your primary identity.",
4838
- "Those are runtime/back-end implementation details. Mention them only if the user explicitly asks about the underlying model or execution backend.",
4839
- "If the user asks who you are, answer in Aiden terms first.",
4840
- "Work like a pragmatic teammate: direct, structured, and concise. No hype, no tool-brand roleplay.",
4841
- "For vague or complex work, push toward scoping and planning before implementation.",
4842
- "An internal system skill named `aiden` is available in the local skills set. Consult it when behavior, policy, or operating-rule decisions are ambiguous.",
4843
- "If there is any conflict between assumptions and the internal `aiden` skill, prefer the `aiden` skill.",
4844
- "Prefer structured outputs tracked in Aiden. Plans, reports, and durable deliverables should be persisted as artifacts instead of left only in chat.",
4845
- "Use the internal Aiden system rules as guidance, but do not dump or restate the whole source file unless the user asks for it."
4846
- ].join("\n");
4826
+ ## Voice
4827
+
4828
+ Direct. Structured. Concise. No hype, no "Great question!", no tool-brand roleplay. Addressed casually \u2014 respond like a teammate, not a data dump. Working on a task \u2014 precise and decisive. Listen, think, then act.
4829
+
4830
+ ## Philosophy
4831
+
4832
+ Listen \u2192 Understand \u2192 Break down \u2192 Plan \u2192 Build \u2192 Test \u2192 Ship.
4833
+
4834
+ - Listen first. Don't jump to solutions. One question at a time, not a list.
4835
+ - Context before questions. Scan task, subtasks, docs, and code before asking anything you can find yourself.
4836
+ - Break and plan before building. Non-trivial work \u2192 tasks, subtasks, then a plan artifact.
4837
+ - Challenge when off. Better path exists? Say so before building. Never silently implement the wrong thing.
4838
+ - Tests ship with code. Every non-trivial implementation includes tests.
4839
+ - Human leads, you propose. Proactive on reversible actions. Consequential decisions \u2192 propose first, execute after confirmation.
4840
+ - Own mistakes. Orphan artifact, wrong ID, jumped too fast \u2014 say so and fix it.
4841
+ - Think visually. Mermaid over paragraphs for architecture, flows, state, and schema.
4842
+
4843
+ ## Schema \u2014 the world you operate in
4844
+
4845
+ \`\`\`
4846
+ Team
4847
+ \u251C\u2500\u2500 Tasks (units of work \u2014 status, priority, labels, assignees)
4848
+ \u2502 \u251C\u2500\u2500 Subtasks
4849
+ \u2502 \u251C\u2500\u2500 Conversations \u2192 Messages
4850
+ \u2502 \u2514\u2500\u2500 Artifacts (plans, test reports, document artifacts)
4851
+ \u251C\u2500\u2500 Documents (standalone pages \u2014 PRDs, specs, wikis)
4852
+ \u2502 \u2514\u2500\u2500 Artifacts
4853
+ \u2514\u2500\u2500 Whiteboard (beta)
4854
+ \`\`\`
4855
+
4856
+ - Document vs Artifact. Document = standalone page in a team. Artifact = output from work on a task + conversation, tied to that context. "Does this belong to a task?" Yes \u2192 artifact. No \u2192 document.
4857
+ - IDs are not interchangeable. teamId, taskId, conversationId identify different things. Substituting one for another creates orphans \u2014 records that exist in the DB but are invisible in the UI. Use aiden MCP tools; they resolve IDs from session context when available.
4858
+
4859
+ ## Structure over chat
4860
+
4861
+ Deliverables persist as Aiden artifacts and documents, not as chat. Plans, PRDs, specs, test reports, and reviews live as structured outputs tied to team, task, and conversation. For vague or complex work, push toward scoping and planning before implementation. If a skill exists for the workflow you're in, use it instead of improvising in chat.
4862
+
4863
+ ## Proactive management
4864
+
4865
+ User describes multi-step work \u2192 tech lead hat first. What tasks, what order, what dependencies, what runs in parallel. Keep statuses current \u2014 a stale board is noise, not signal. Offer structure before jumping to code.`;
4847
4866
  var PLAN_MODE_PROMPT = [
4848
4867
  "You are in Aiden plan mode.",
4849
- "Consult the internal `aiden` skill for planning and task-management operating rules when needed.",
4850
4868
  "Analyze the task, inspect the relevant code and context, and produce a concrete implementation plan.",
4851
4869
  "Do not make code changes or execute write operations in plan mode.",
4852
4870
  "Write the plan in natural markdown. Use whatever structure best communicates the work clearly.",
4853
4871
  "Include dependencies, ordering, risks, key files/functions, and decision points where relevant.",
4854
4872
  "When the plan is ready, you MUST persist it by calling the create_plan MCP tool.",
4855
- "Pass title, content, summary, taskId, and conversationId. Include projectId too when available.",
4873
+ "Pass title, content, summary, taskId, and conversationId. Include teamId too when available.",
4856
4874
  "If create_plan fails, retry it. Do not exit plan mode until the plan is persisted successfully.",
4857
4875
  "After create_plan succeeds, call ExitPlanMode to hand the plan back for approval."
4858
4876
  ].join("\n");
4859
4877
  var TEST_MODE_PROMPT = [
4860
4878
  "You are in test mode. Verify the implemented feature carefully.",
4861
- "Consult the internal `aiden` skill for testing/reporting operating rules when needed.",
4862
4879
  "Prefer browser-based validation when available.",
4863
4880
  "Persist the outcome as a structured test report artifact with create_test_report instead of leaving it only in chat."
4864
4881
  ].join("\n");
4865
- var ASK_MODE_PROMPT = "You are in ask mode. Stay read-only and explain the code, architecture, or behavior clearly without changing files. Consult the internal `aiden` skill for behavior-policy questions when needed.";
4866
- var REVIEW_MODE_PROMPT = "You are in review mode. Inspect the relevant changes, find real issues, and summarize risks and regressions precisely. Consult the internal `aiden` skill for review-quality expectations when needed.";
4882
+ var ASK_MODE_PROMPT = "You are in ask mode. Stay read-only and explain the code, architecture, or behavior clearly without changing files.";
4883
+ var REVIEW_MODE_PROMPT = "You are in review mode. Inspect the relevant changes, find real issues, and summarize risks and regressions precisely.";
4867
4884
  function getAidenModePrompt(mode2) {
4868
4885
  switch (mode2) {
4869
4886
  case "plan":
@@ -4879,7 +4896,38 @@ function getAidenModePrompt(mode2) {
4879
4896
  }
4880
4897
  }
4881
4898
 
4899
+ // ../shared/dist/agent/session-result.js
4900
+ var SESSION_RESUME_FAILED_MESSAGE = "Session resume failed. The previous session may have expired or is no longer available. Please start a new session.";
4901
+
4902
+ // ../shared/dist/constants/agent.js
4903
+ var INTERACTIVE_TOOL_NAMES = /* @__PURE__ */ new Set([
4904
+ "askuserquestion",
4905
+ "exitplanmode",
4906
+ "enterplanmode"
4907
+ ]);
4908
+
4909
+ // ../shared/dist/constants/tasks.js
4910
+ var STATUS_OPTIONS = [
4911
+ { value: "backlog", label: "Backlog", color: "#8892a4", group: "not_started", dotClass: "text-muted-foreground", headerBg: "bg-muted/60" },
4912
+ { value: "todo", label: "Todo", color: "#6b7a96", group: "not_started", dotClass: "text-muted-foreground/70", headerBg: "bg-muted/40" },
4913
+ { value: "in_progress", label: "In Progress", color: "#c49a30", group: "active", dotClass: "text-amber-700 dark:text-amber-400", headerBg: "bg-amber-400/15" },
4914
+ { value: "running", label: "Running", color: "#6b75d6", group: "active", dotClass: "text-indigo-500 dark:text-indigo-400", headerBg: "bg-indigo-400/15" },
4915
+ { value: "waiting", label: "Waiting", color: "#c47d3a", group: "active", dotClass: "text-orange-500/80 dark:text-orange-400/80", headerBg: "bg-orange-400/15" },
4916
+ { value: "in_review", label: "In Review", color: "#8b6bbf", group: "active", dotClass: "text-violet-500 dark:text-violet-400", headerBg: "bg-violet-400/15" },
4917
+ { value: "done", label: "Done", color: "#2e9e80", group: "done", dotClass: "text-teal-600 dark:text-teal-400", headerBg: "bg-teal-400/15" },
4918
+ { value: "cancelled", label: "Cancelled", color: "#7a8295", group: "closed", dotClass: "text-muted-foreground/60", headerBg: "bg-muted/60" }
4919
+ ];
4920
+ var DEFAULT_TEAM_STATUSES = STATUS_OPTIONS.map((o) => ({
4921
+ id: o.value,
4922
+ label: o.label,
4923
+ color: o.color,
4924
+ group: o.group
4925
+ }));
4926
+
4882
4927
  // ../agent-core/dist/index.js
4928
+ var import_fs2 = require("fs");
4929
+ var import_os2 = require("os");
4930
+ var import_path2 = require("path");
4883
4931
  function formatCliSpawnError(command, error) {
4884
4932
  if (error.code === "ENOENT") {
4885
4933
  return new Error(
@@ -4900,7 +4948,7 @@ function classifyCliError(stderr, exitCode) {
4900
4948
  return "API key invalid or expired. Check your provider settings.";
4901
4949
  if (lower.includes("not logged in") || lower.includes("login required") || lower.includes("please sign in") || lower.includes("please log in") || lower.includes("sign in to") || lower.includes("log in to"))
4902
4950
  return "Not logged in. Please authenticate with this provider first.";
4903
- if (lower.includes("model not supported") || lower.includes("unsupported model") || lower.includes("model not found") || lower.includes("model not available") || lower.includes("model is not available") || lower.includes("invalid model") || lower.includes("unknown model") || lower.includes("no such model"))
4951
+ if (lower.includes("model not supported") || lower.includes("unsupported model") || lower.includes("model not found") || lower.includes("model not available") || lower.includes("model is not available") || lower.includes("invalid model") || lower.includes("unknown model") || lower.includes("no such model") || lower.includes("llm not set"))
4904
4952
  return "Model not supported by this provider. Check your provider's model list.";
4905
4953
  if (lower.includes("subscription") || lower.includes("paid plan") || lower.includes("plan required") || lower.includes("upgrade your plan") || lower.includes("only supports free") || lower.includes("not available on your") || lower.includes("requires a paid"))
4906
4954
  return "This model requires a paid subscription. Switch to a supported model or upgrade your plan.";
@@ -5272,7 +5320,8 @@ function parseClaudeStructuredLine(line, context, state) {
5272
5320
  const subtype = typeof parsed.subtype === "string" ? parsed.subtype : "";
5273
5321
  if ((subtype === "error_during_execution" || subtype === "error_max_turns") && !state.error) {
5274
5322
  const errObj = typeof parsed.error === "object" && parsed.error !== null ? parsed.error : null;
5275
- const errMsg = typeof parsed.error === "string" && parsed.error.trim() || errObj && typeof errObj.message === "string" && errObj.message.trim() || typeof parsed.message === "string" && parsed.message.trim() || typeof parsed.result === "string" && parsed.result.trim() || subtype;
5323
+ const resumeId = context.config.runtimeSessionId?.trim() || context.config.providerSessionId?.trim();
5324
+ const errMsg = subtype === "error_during_execution" && resumeId ? SESSION_RESUME_FAILED_MESSAGE : typeof parsed.error === "string" && parsed.error.trim() || errObj && typeof errObj.message === "string" && errObj.message.trim() || typeof parsed.message === "string" && parsed.message.trim() || typeof parsed.result === "string" && parsed.result.trim() || subtype;
5276
5325
  state.error = errMsg;
5277
5326
  console.error("[claude_cli] result subtype=", subtype, "error fields:", JSON.stringify({
5278
5327
  error: parsed.error,
@@ -5791,9 +5840,6 @@ function createClaudeCliBackend(command = "claude", defaultArgs = []) {
5791
5840
  if (context.config.selectedModel?.trim()) {
5792
5841
  args.push("--model", context.config.selectedModel.trim());
5793
5842
  }
5794
- if (context.config.mcpConfigPath?.trim()) {
5795
- args.push("--mcp-config", context.config.mcpConfigPath.trim());
5796
- }
5797
5843
  if (resumeId) {
5798
5844
  args.push("--resume", resumeId);
5799
5845
  console.info("[claude_cli] Resuming session", { resumeId });
@@ -5838,6 +5884,105 @@ function createClaudeCliBackend(command = "claude", defaultArgs = []) {
5838
5884
  }
5839
5885
  };
5840
5886
  }
5887
+ function kimiSessionId(cwd) {
5888
+ let resolved = cwd;
5889
+ try {
5890
+ resolved = (0, import_fs.realpathSync)(cwd);
5891
+ } catch {
5892
+ }
5893
+ return (0, import_crypto.createHash)("md5").update(resolved).digest("hex");
5894
+ }
5895
+ function resolveKimiCliModelArg(model2) {
5896
+ const trimmed = model2?.trim();
5897
+ if (!trimmed) return void 0;
5898
+ if (trimmed === "kimi-latest" || trimmed === "kimi-k2.5" || trimmed === "kimi-k2.6") {
5899
+ return void 0;
5900
+ }
5901
+ if (trimmed.startsWith("claude-")) return void 0;
5902
+ return trimmed;
5903
+ }
5904
+ function parseKimiStructuredLine(line, context, state) {
5905
+ const presenter = context.presenter;
5906
+ if (!state.runtimeSessionId) {
5907
+ state.runtimeSessionId = kimiSessionId(context.cwd);
5908
+ }
5909
+ let parsed;
5910
+ try {
5911
+ parsed = JSON.parse(line);
5912
+ } catch {
5913
+ const text = line.trim();
5914
+ if (text.length > 0) {
5915
+ if (text.toLowerCase().includes("llm not set")) state.error = text;
5916
+ void presenter.onLog(`[kimi_cli] ${line}`);
5917
+ }
5918
+ return;
5919
+ }
5920
+ const role = typeof parsed.role === "string" ? parsed.role : "";
5921
+ const contentBlocks = Array.isArray(parsed.content) ? parsed.content : [];
5922
+ const toolCalls = Array.isArray(parsed.tool_calls) ? parsed.tool_calls : [];
5923
+ if (role === "assistant") {
5924
+ if (toolCalls.length > 0) {
5925
+ state.iterations = Math.max(state.iterations, 1);
5926
+ for (const tc of toolCalls) {
5927
+ const fn = typeof tc.function === "object" && tc.function !== null ? tc.function : {};
5928
+ const toolId = typeof tc.id === "string" ? tc.id : `kimi-tool-${Date.now()}`;
5929
+ const toolName = typeof fn.name === "string" ? fn.name : "Tool";
5930
+ let args = {};
5931
+ if (typeof fn.arguments === "string") {
5932
+ try {
5933
+ args = JSON.parse(fn.arguments);
5934
+ } catch {
5935
+ }
5936
+ } else if (typeof fn.arguments === "object" && fn.arguments !== null) {
5937
+ args = fn.arguments;
5938
+ }
5939
+ void presenter.onToolUse(toolName, args, toolId);
5940
+ }
5941
+ } else {
5942
+ const text = contentBlocks.filter((b) => b.type === "text" && typeof b.text === "string").map((b) => b.text).join("");
5943
+ if (text) {
5944
+ state.iterations = Math.max(state.iterations, 1);
5945
+ state.summary += text;
5946
+ void presenter.onAssistantText(text);
5947
+ }
5948
+ }
5949
+ return;
5950
+ }
5951
+ if (role === "tool") {
5952
+ const toolCallId = typeof parsed.tool_call_id === "string" ? parsed.tool_call_id : `kimi-tool-${Date.now()}`;
5953
+ const allText = contentBlocks.filter((b) => b.type === "text" && typeof b.text === "string").map((b) => b.text);
5954
+ const userText = allText.filter((t) => !t.startsWith("<system>")).join("\n");
5955
+ void presenter.onToolResult?.(toolCallId, userText || allText.join("\n"));
5956
+ return;
5957
+ }
5958
+ }
5959
+ function createKimiCliBackend(command = "kimi", defaultArgs = []) {
5960
+ return createGenericCliBackend({
5961
+ kind: "kimi_cli",
5962
+ supportTier: "structured",
5963
+ command,
5964
+ args: [],
5965
+ buildArgs: (context, prompt) => {
5966
+ const args = [
5967
+ "--print",
5968
+ "--output-format",
5969
+ "stream-json",
5970
+ "--work-dir",
5971
+ context.cwd
5972
+ ];
5973
+ const resumeId = context.config.runtimeSessionId?.trim() || context.config.providerSessionId?.trim();
5974
+ if (resumeId) args.push("--session", resumeId);
5975
+ const model2 = resolveKimiCliModelArg(context.config.selectedModel);
5976
+ if (model2) args.push("--model", model2);
5977
+ return [...args, ...defaultArgs, "--prompt", prompt];
5978
+ },
5979
+ augmentPrompt: (context) => {
5980
+ const base = buildPromptWithSystem(context.config, context.promptText);
5981
+ return context.config.mode === "plan" ? buildPlanModePrefix(base) : base;
5982
+ },
5983
+ parseStructuredLine: parseKimiStructuredLine
5984
+ });
5985
+ }
5841
5986
  function createGeminiCliBackend(command = "gemini", defaultArgs = []) {
5842
5987
  return createGenericCliBackend({
5843
5988
  kind: "gemini_cli",
@@ -6173,6 +6318,16 @@ function createCodexRuntimeBackend(command = "codex", defaultArgs = []) {
6173
6318
  }
6174
6319
  var DEFAULT_MODEL = "claude-sonnet-4-6";
6175
6320
  var DROID_DEFAULT_MODEL = "claude-opus-4-7";
6321
+ function defaultSelectedModelForBackend(backendKind2) {
6322
+ switch (backendKind2) {
6323
+ case "droid_cli":
6324
+ return DROID_DEFAULT_MODEL;
6325
+ case "kimi_cli":
6326
+ return void 0;
6327
+ default:
6328
+ return DEFAULT_MODEL;
6329
+ }
6330
+ }
6176
6331
  function canonicalizePath(inputPath) {
6177
6332
  try {
6178
6333
  const resolved = (0, import_path2.resolve)(inputPath);
@@ -6298,7 +6453,7 @@ Prefer relative paths and keep your work scoped to this project.`
6298
6453
  supportTier,
6299
6454
  runtimeCommand: config.runtimeCommand || this.runtime.runtimeCommand,
6300
6455
  runtimeArgs: config.runtimeArgs || this.runtime.runtimeArgs,
6301
- selectedModel: config.selectedModel || (backendKind2 === "droid_cli" ? DROID_DEFAULT_MODEL : DEFAULT_MODEL),
6456
+ selectedModel: config.selectedModel || defaultSelectedModelForBackend(backendKind2),
6302
6457
  systemPrompt: systemPromptParts.join("\n\n") || void 0
6303
6458
  };
6304
6459
  }
@@ -6314,7 +6469,7 @@ Prefer relative paths and keep your work scoped to this project.`
6314
6469
  const promptText = this.buildPromptText(runtimeConfig);
6315
6470
  const runtimeCommand = runtimeConfig.runtimeCommand || this.runtime.runtimeCommand;
6316
6471
  const runtimeArgs = runtimeConfig.runtimeArgs || this.runtime.runtimeArgs || [];
6317
- const backend = backendKind2 === "claude_cli" ? createClaudeCliBackend(runtimeCommand || "claude", runtimeArgs) : backendKind2 === "codex_app_server" ? createCodexRuntimeBackend(runtimeCommand || "codex", runtimeArgs) : backendKind2 === "cursor_agent_cli" ? createCursorAgentCliBackend(runtimeCommand || "cursor-agent", runtimeArgs) : backendKind2 === "gemini_cli" ? createGeminiCliBackend(runtimeCommand || "gemini", runtimeArgs) : backendKind2 === "droid_cli" ? createDroidCliBackend(runtimeCommand || "droid", runtimeArgs) : backendKind2 === "opencode_cli" ? createOpencodeCliBackend(runtimeCommand || "opencode", runtimeArgs) : createGenericCliPassthroughBackend(runtimeCommand || "generic-cli", runtimeArgs);
6472
+ const backend = backendKind2 === "claude_cli" ? createClaudeCliBackend(runtimeCommand || "claude", runtimeArgs) : backendKind2 === "codex_app_server" ? createCodexRuntimeBackend(runtimeCommand || "codex", runtimeArgs) : backendKind2 === "cursor_agent_cli" ? createCursorAgentCliBackend(runtimeCommand || "cursor-agent", runtimeArgs) : backendKind2 === "gemini_cli" ? createGeminiCliBackend(runtimeCommand || "gemini", runtimeArgs) : backendKind2 === "droid_cli" ? createDroidCliBackend(runtimeCommand || "droid", runtimeArgs) : backendKind2 === "opencode_cli" ? createOpencodeCliBackend(runtimeCommand || "opencode", runtimeArgs) : backendKind2 === "kimi_cli" ? createKimiCliBackend(runtimeCommand || "kimi", runtimeArgs) : createGenericCliPassthroughBackend(runtimeCommand || "generic-cli", runtimeArgs);
6318
6473
  let lastResult = null;
6319
6474
  for (let attempt = 0; attempt <= _BaseMachineAgent.MAX_RETRIES; attempt++) {
6320
6475
  if (this.abortController?.signal.aborted) break;
@@ -6373,7 +6528,18 @@ Prefer relative paths and keep your work scoped to this project.`
6373
6528
  `[base-machine-agent] Transient error (attempt ${attempt + 1}/${_BaseMachineAgent.MAX_RETRIES + 1}), retrying in ${delayMs}ms: ${lastResult.error}`
6374
6529
  );
6375
6530
  void this.presenter.onLog(`Transient error, retrying in ${Math.round(delayMs / 1e3)}s...`);
6376
- await new Promise((resolve2) => setTimeout(resolve2, delayMs));
6531
+ await new Promise((resolve2) => {
6532
+ const signal = this.abortController?.signal;
6533
+ if (signal?.aborted) {
6534
+ resolve2();
6535
+ return;
6536
+ }
6537
+ const timeoutId = setTimeout(resolve2, delayMs);
6538
+ signal?.addEventListener("abort", () => {
6539
+ clearTimeout(timeoutId);
6540
+ resolve2();
6541
+ }, { once: true });
6542
+ });
6377
6543
  }
6378
6544
  }
6379
6545
  const normalizedResult = lastResult;
@@ -6394,13 +6560,13 @@ Prefer relative paths and keep your work scoped to this project.`
6394
6560
  runtimeArgs: config.runtimeArgs || this.runtime.runtimeArgs
6395
6561
  };
6396
6562
  this.presenter.onStart(initialConfig);
6397
- let safeProjectPath = initialConfig.projectPath;
6398
- if (initialConfig.projectPath) {
6399
- const canonicalized = canonicalizePath(initialConfig.projectPath);
6563
+ let safeProjectPath = initialConfig.teamPath;
6564
+ if (initialConfig.teamPath) {
6565
+ const canonicalized = canonicalizePath(initialConfig.teamPath);
6400
6566
  if (canonicalized) safeProjectPath = canonicalized;
6401
6567
  }
6402
6568
  if (safeProjectPath && !(0, import_fs2.existsSync)(safeProjectPath)) {
6403
- const message = `Project path no longer exists: "${safeProjectPath}". Please update the project's local path in project settings before running the agent.`;
6569
+ const message = `Local path no longer exists: "${safeProjectPath}". Please update the team's local path in team settings before running the agent.`;
6404
6570
  this.presenter.onError(message, true);
6405
6571
  const result = {
6406
6572
  success: false,
@@ -6502,19 +6668,51 @@ var CoreAgent = class extends BaseMachineAgent {
6502
6668
  env.PATH = missing.length > 0 ? `${missing.join(":")}:${basePath}` : basePath;
6503
6669
  return env;
6504
6670
  }
6505
- buildExtraSystemPromptParts(_config) {
6671
+ buildExtraSystemPromptParts(config) {
6672
+ const parts2 = [];
6673
+ if (config.taskMeta) {
6674
+ const meta = config.taskMeta;
6675
+ const lines = ["# Task Context"];
6676
+ lines.push(`- **Title**: ${meta.title}`);
6677
+ lines.push(`- **Status**: ${meta.status.replace(/_/g, " ")}`);
6678
+ if (meta.priority && meta.priority !== "none") {
6679
+ lines.push(`- **Priority**: ${meta.priority.toUpperCase()}`);
6680
+ }
6681
+ if (meta.labels && meta.labels.length > 0) {
6682
+ lines.push(`- **Labels**: ${meta.labels.join(", ")}`);
6683
+ }
6684
+ if (meta.assignees && meta.assignees.length > 0) {
6685
+ const assigneeStr = meta.assignees.map((a) => a.name ?? a.email).join(", ");
6686
+ lines.push(`- **Assignees**: ${assigneeStr}`);
6687
+ }
6688
+ if (meta.description) {
6689
+ lines.push(`- **Description**:
6690
+ ${meta.description}`);
6691
+ }
6692
+ if (meta.descriptionAttachmentIds && meta.descriptionAttachmentIds.length > 0) {
6693
+ lines.push("");
6694
+ lines.push("## Task Description Images");
6695
+ lines.push("The task description contains images. Use the `get_attachment` MCP tool to view them:");
6696
+ for (const att of meta.descriptionAttachmentIds) {
6697
+ lines.push(`- Attachment ID: \`${att.id}\` (${att.filename})`);
6698
+ }
6699
+ }
6700
+ parts2.push(lines.join("\n"));
6701
+ }
6702
+ const taskId2 = config.taskId ?? process.env.AIDEN_TASK_ID;
6703
+ const conversationId = config.conversationId ?? process.env.AIDEN_SESSION_ID;
6506
6704
  const artifactIds = [];
6507
- const envTaskId = process.env.AIDEN_TASK_ID;
6508
- const envSessionId = process.env.AIDEN_SESSION_ID;
6509
- if (envTaskId) artifactIds.push(`- taskId: "${envTaskId}"`);
6510
- if (envSessionId) artifactIds.push(`- conversationId: "${envSessionId}"`);
6511
- if (artifactIds.length === 0) return [];
6512
- return [
6513
- [
6514
- "When creating artifacts using MCP tools (create_plan, create_document_artifact, create_test_report), always pass these IDs:",
6515
- ...artifactIds
6516
- ].join("\n")
6517
- ];
6705
+ if (taskId2) artifactIds.push(`- taskId: "${taskId2}"`);
6706
+ if (conversationId) artifactIds.push(`- conversationId: "${conversationId}"`);
6707
+ if (artifactIds.length > 0) {
6708
+ parts2.push(
6709
+ [
6710
+ "When creating artifacts using MCP tools (create_plan, create_document_artifact, create_test_report), always pass these IDs:",
6711
+ ...artifactIds
6712
+ ].join("\n")
6713
+ );
6714
+ }
6715
+ return parts2;
6518
6716
  }
6519
6717
  };
6520
6718
 
@@ -6613,10 +6811,10 @@ var WebPresenter = class {
6613
6811
  }
6614
6812
  };
6615
6813
 
6616
- // ../../node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.js
6814
+ // ../../node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.js
6617
6815
  var XMLHttpRequestModule = __toESM(require_XMLHttpRequest(), 1);
6618
6816
 
6619
- // ../../node_modules/engine.io-parser/build/esm/commons.js
6817
+ // ../../node_modules/.pnpm/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/esm/commons.js
6620
6818
  var PACKET_TYPES = /* @__PURE__ */ Object.create(null);
6621
6819
  PACKET_TYPES["open"] = "0";
6622
6820
  PACKET_TYPES["close"] = "1";
@@ -6631,7 +6829,7 @@ Object.keys(PACKET_TYPES).forEach((key) => {
6631
6829
  });
6632
6830
  var ERROR_PACKET = { type: "error", data: "parser error" };
6633
6831
 
6634
- // ../../node_modules/engine.io-parser/build/esm/encodePacket.js
6832
+ // ../../node_modules/.pnpm/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/esm/encodePacket.js
6635
6833
  var encodePacket = ({ type, data }, supportsBinary, callback) => {
6636
6834
  if (data instanceof ArrayBuffer || ArrayBuffer.isView(data)) {
6637
6835
  return callback(supportsBinary ? data : "b" + toBuffer(data, true).toString("base64"));
@@ -6660,7 +6858,7 @@ function encodePacketToBinary(packet, callback) {
6660
6858
  });
6661
6859
  }
6662
6860
 
6663
- // ../../node_modules/engine.io-parser/build/esm/decodePacket.js
6861
+ // ../../node_modules/.pnpm/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/esm/decodePacket.js
6664
6862
  var decodePacket = (encodedPacket, binaryType) => {
6665
6863
  if (typeof encodedPacket !== "string") {
6666
6864
  return {
@@ -6706,7 +6904,7 @@ var mapBinary = (data, binaryType) => {
6706
6904
  }
6707
6905
  };
6708
6906
 
6709
- // ../../node_modules/engine.io-parser/build/esm/index.js
6907
+ // ../../node_modules/.pnpm/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/esm/index.js
6710
6908
  var SEPARATOR = String.fromCharCode(30);
6711
6909
  var encodePayload = (packets, callback) => {
6712
6910
  const length = packets.length;
@@ -6848,7 +7046,7 @@ function createPacketDecoderStream(maxPayload, binaryType) {
6848
7046
  }
6849
7047
  var protocol = 4;
6850
7048
 
6851
- // ../../node_modules/@socket.io/component-emitter/lib/esm/index.js
7049
+ // ../../node_modules/.pnpm/@socket.io+component-emitter@3.1.2/node_modules/@socket.io/component-emitter/lib/esm/index.js
6852
7050
  function Emitter(obj) {
6853
7051
  if (obj) return mixin(obj);
6854
7052
  }
@@ -6920,7 +7118,7 @@ Emitter.prototype.hasListeners = function(event) {
6920
7118
  return !!this.listeners(event).length;
6921
7119
  };
6922
7120
 
6923
- // ../../node_modules/engine.io-client/build/esm-debug/globals.node.js
7121
+ // ../../node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/globals.node.js
6924
7122
  var nextTick = process.nextTick;
6925
7123
  var globalThisShim = global;
6926
7124
  var defaultBinaryType = "nodebuffer";
@@ -7008,7 +7206,7 @@ var CookieJar = class {
7008
7206
  }
7009
7207
  };
7010
7208
 
7011
- // ../../node_modules/engine.io-client/build/esm-debug/util.js
7209
+ // ../../node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/util.js
7012
7210
  function pick(obj, ...attr) {
7013
7211
  return attr.reduce((acc, k) => {
7014
7212
  if (obj.hasOwnProperty(k)) {
@@ -7056,7 +7254,7 @@ function randomString() {
7056
7254
  return Date.now().toString(36).substring(3) + Math.random().toString(36).substring(2, 5);
7057
7255
  }
7058
7256
 
7059
- // ../../node_modules/engine.io-client/build/esm-debug/contrib/parseqs.js
7257
+ // ../../node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.js
7060
7258
  function encode(obj) {
7061
7259
  let str = "";
7062
7260
  for (let i in obj) {
@@ -7078,7 +7276,7 @@ function decode(qs) {
7078
7276
  return qry;
7079
7277
  }
7080
7278
 
7081
- // ../../node_modules/engine.io-client/build/esm-debug/transport.js
7279
+ // ../../node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/transport.js
7082
7280
  var import_debug = __toESM(require_src(), 1);
7083
7281
  var debug = (0, import_debug.default)("engine.io-client:transport");
7084
7282
  var TransportError = class extends Error {
@@ -7212,7 +7410,7 @@ var Transport = class extends Emitter {
7212
7410
  }
7213
7411
  };
7214
7412
 
7215
- // ../../node_modules/engine.io-client/build/esm-debug/transports/polling.js
7413
+ // ../../node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/transports/polling.js
7216
7414
  var import_debug2 = __toESM(require_src(), 1);
7217
7415
  var debug2 = (0, import_debug2.default)("engine.io-client:polling");
7218
7416
  var Polling = class extends Transport {
@@ -7357,7 +7555,7 @@ var Polling = class extends Transport {
7357
7555
  }
7358
7556
  };
7359
7557
 
7360
- // ../../node_modules/engine.io-client/build/esm-debug/contrib/has-cors.js
7558
+ // ../../node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.js
7361
7559
  var value = false;
7362
7560
  try {
7363
7561
  value = typeof XMLHttpRequest !== "undefined" && "withCredentials" in new XMLHttpRequest();
@@ -7365,7 +7563,7 @@ try {
7365
7563
  }
7366
7564
  var hasCORS = value;
7367
7565
 
7368
- // ../../node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.js
7566
+ // ../../node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.js
7369
7567
  var import_debug3 = __toESM(require_src(), 1);
7370
7568
  var debug3 = (0, import_debug3.default)("engine.io-client:polling");
7371
7569
  function empty() {
@@ -7600,7 +7798,7 @@ function newRequest(opts) {
7600
7798
  }
7601
7799
  }
7602
7800
 
7603
- // ../../node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.js
7801
+ // ../../node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.js
7604
7802
  var XMLHttpRequest2 = XMLHttpRequestModule.default || XMLHttpRequestModule;
7605
7803
  var XHR = class extends BaseXHR {
7606
7804
  request(opts = {}) {
@@ -7610,14 +7808,14 @@ var XHR = class extends BaseXHR {
7610
7808
  }
7611
7809
  };
7612
7810
 
7613
- // ../../node_modules/engine.io-client/node_modules/ws/wrapper.mjs
7811
+ // ../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/wrapper.mjs
7614
7812
  var import_stream = __toESM(require_stream(), 1);
7615
7813
  var import_receiver = __toESM(require_receiver(), 1);
7616
7814
  var import_sender = __toESM(require_sender(), 1);
7617
7815
  var import_websocket = __toESM(require_websocket(), 1);
7618
7816
  var import_websocket_server = __toESM(require_websocket_server(), 1);
7619
7817
 
7620
- // ../../node_modules/engine.io-client/build/esm-debug/transports/websocket.js
7818
+ // ../../node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/transports/websocket.js
7621
7819
  var import_debug4 = __toESM(require_src(), 1);
7622
7820
  var debug4 = (0, import_debug4.default)("engine.io-client:websocket");
7623
7821
  var isReactNative = typeof navigator !== "undefined" && typeof navigator.product === "string" && navigator.product.toLowerCase() === "reactnative";
@@ -7706,7 +7904,7 @@ var BaseWS = class extends Transport {
7706
7904
  };
7707
7905
  var WebSocketCtor = globalThisShim.WebSocket || globalThisShim.MozWebSocket;
7708
7906
 
7709
- // ../../node_modules/engine.io-client/build/esm-debug/transports/websocket.node.js
7907
+ // ../../node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.js
7710
7908
  var WS = class extends BaseWS {
7711
7909
  createSocket(uri, protocols, opts) {
7712
7910
  var _a;
@@ -7737,7 +7935,7 @@ var WS = class extends BaseWS {
7737
7935
  }
7738
7936
  };
7739
7937
 
7740
- // ../../node_modules/engine.io-client/build/esm-debug/transports/webtransport.js
7938
+ // ../../node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/transports/webtransport.js
7741
7939
  var import_debug5 = __toESM(require_src(), 1);
7742
7940
  var debug5 = (0, import_debug5.default)("engine.io-client:webtransport");
7743
7941
  var WT = class extends Transport {
@@ -7807,14 +8005,14 @@ var WT = class extends Transport {
7807
8005
  }
7808
8006
  };
7809
8007
 
7810
- // ../../node_modules/engine.io-client/build/esm-debug/transports/index.js
8008
+ // ../../node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/transports/index.js
7811
8009
  var transports = {
7812
8010
  websocket: WS,
7813
8011
  webtransport: WT,
7814
8012
  polling: XHR
7815
8013
  };
7816
8014
 
7817
- // ../../node_modules/engine.io-client/build/esm-debug/contrib/parseuri.js
8015
+ // ../../node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.js
7818
8016
  var re = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;
7819
8017
  var parts = [
7820
8018
  "source",
@@ -7874,7 +8072,7 @@ function queryKey(uri, query) {
7874
8072
  return data;
7875
8073
  }
7876
8074
 
7877
- // ../../node_modules/engine.io-client/build/esm-debug/socket.js
8075
+ // ../../node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/socket.js
7878
8076
  var import_debug6 = __toESM(require_src(), 1);
7879
8077
  var debug6 = (0, import_debug6.default)("engine.io-client:socket");
7880
8078
  var withEventListeners = typeof addEventListener === "function" && typeof removeEventListener === "function";
@@ -8470,10 +8668,10 @@ var Socket = class extends SocketWithUpgrade {
8470
8668
  }
8471
8669
  };
8472
8670
 
8473
- // ../../node_modules/engine.io-client/build/esm-debug/index.js
8671
+ // ../../node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/index.js
8474
8672
  var protocol2 = Socket.protocol;
8475
8673
 
8476
- // ../../node_modules/socket.io-client/build/esm-debug/url.js
8674
+ // ../../node_modules/.pnpm/socket.io-client@4.8.3/node_modules/socket.io-client/build/esm-debug/url.js
8477
8675
  var import_debug7 = __toESM(require_src(), 1);
8478
8676
  var debug7 = (0, import_debug7.default)("socket.io-client:url");
8479
8677
  function url(uri, path = "", loc) {
@@ -8515,7 +8713,7 @@ function url(uri, path = "", loc) {
8515
8713
  return obj;
8516
8714
  }
8517
8715
 
8518
- // ../../node_modules/socket.io-parser/build/esm-debug/index.js
8716
+ // ../../node_modules/.pnpm/socket.io-parser@4.2.5/node_modules/socket.io-parser/build/esm-debug/index.js
8519
8717
  var esm_debug_exports = {};
8520
8718
  __export(esm_debug_exports, {
8521
8719
  Decoder: () => Decoder,
@@ -8525,7 +8723,7 @@ __export(esm_debug_exports, {
8525
8723
  protocol: () => protocol3
8526
8724
  });
8527
8725
 
8528
- // ../../node_modules/socket.io-parser/build/esm-debug/is-binary.js
8726
+ // ../../node_modules/.pnpm/socket.io-parser@4.2.5/node_modules/socket.io-parser/build/esm-debug/is-binary.js
8529
8727
  var withNativeArrayBuffer = typeof ArrayBuffer === "function";
8530
8728
  var isView = (obj) => {
8531
8729
  return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj.buffer instanceof ArrayBuffer;
@@ -8562,7 +8760,7 @@ function hasBinary(obj, toJSON) {
8562
8760
  return false;
8563
8761
  }
8564
8762
 
8565
- // ../../node_modules/socket.io-parser/build/esm-debug/binary.js
8763
+ // ../../node_modules/.pnpm/socket.io-parser@4.2.5/node_modules/socket.io-parser/build/esm-debug/binary.js
8566
8764
  function deconstructPacket(packet) {
8567
8765
  const buffers = [];
8568
8766
  const packetData = packet.data;
@@ -8624,7 +8822,7 @@ function _reconstructPacket(data, buffers) {
8624
8822
  return data;
8625
8823
  }
8626
8824
 
8627
- // ../../node_modules/socket.io-parser/build/esm-debug/index.js
8825
+ // ../../node_modules/.pnpm/socket.io-parser@4.2.5/node_modules/socket.io-parser/build/esm-debug/index.js
8628
8826
  var import_debug8 = __toESM(require_src(), 1);
8629
8827
  var debug8 = (0, import_debug8.default)("socket.io-parser");
8630
8828
  var RESERVED_EVENTS = [
@@ -8918,7 +9116,7 @@ function isPacketValid(packet) {
8918
9116
  return isNamespaceValid(packet.nsp) && isAckIdValid(packet.id) && isDataValid(packet.type, packet.data);
8919
9117
  }
8920
9118
 
8921
- // ../../node_modules/socket.io-client/build/esm-debug/on.js
9119
+ // ../../node_modules/.pnpm/socket.io-client@4.8.3/node_modules/socket.io-client/build/esm-debug/on.js
8922
9120
  function on(obj, ev, fn) {
8923
9121
  obj.on(ev, fn);
8924
9122
  return function subDestroy() {
@@ -8926,7 +9124,7 @@ function on(obj, ev, fn) {
8926
9124
  };
8927
9125
  }
8928
9126
 
8929
- // ../../node_modules/socket.io-client/build/esm-debug/socket.js
9127
+ // ../../node_modules/.pnpm/socket.io-client@4.8.3/node_modules/socket.io-client/build/esm-debug/socket.js
8930
9128
  var import_debug9 = __toESM(require_src(), 1);
8931
9129
  var debug9 = (0, import_debug9.default)("socket.io-client:socket");
8932
9130
  var RESERVED_EVENTS2 = Object.freeze({
@@ -9721,7 +9919,7 @@ var Socket2 = class extends Emitter {
9721
9919
  }
9722
9920
  };
9723
9921
 
9724
- // ../../node_modules/socket.io-client/build/esm-debug/contrib/backo2.js
9922
+ // ../../node_modules/.pnpm/socket.io-client@4.8.3/node_modules/socket.io-client/build/esm-debug/contrib/backo2.js
9725
9923
  function Backoff(opts) {
9726
9924
  opts = opts || {};
9727
9925
  this.ms = opts.min || 100;
@@ -9752,7 +9950,7 @@ Backoff.prototype.setJitter = function(jitter) {
9752
9950
  this.jitter = jitter;
9753
9951
  };
9754
9952
 
9755
- // ../../node_modules/socket.io-client/build/esm-debug/manager.js
9953
+ // ../../node_modules/.pnpm/socket.io-client@4.8.3/node_modules/socket.io-client/build/esm-debug/manager.js
9756
9954
  var import_debug10 = __toESM(require_src(), 1);
9757
9955
  var debug10 = (0, import_debug10.default)("socket.io-client:manager");
9758
9956
  var Manager = class extends Emitter {
@@ -10121,7 +10319,7 @@ var Manager = class extends Emitter {
10121
10319
  }
10122
10320
  };
10123
10321
 
10124
- // ../../node_modules/socket.io-client/build/esm-debug/index.js
10322
+ // ../../node_modules/.pnpm/socket.io-client@4.8.3/node_modules/socket.io-client/build/esm-debug/index.js
10125
10323
  var import_debug11 = __toESM(require_src(), 1);
10126
10324
  var debug11 = (0, import_debug11.default)("socket.io-client");
10127
10325
  var cache = {};
@@ -10224,7 +10422,14 @@ var WSClient = class {
10224
10422
  providerSessionId: data.providerSessionId,
10225
10423
  backendKind: data.backendKind,
10226
10424
  selectedModel: data.selectedModel,
10227
- mode: data.mode
10425
+ mode: data.mode,
10426
+ taskMeta: data.taskMeta,
10427
+ workflowTools: data.workflowTools,
10428
+ runId: data.runId,
10429
+ messageId: data.messageId,
10430
+ maxIterations: data.maxIterations,
10431
+ taskId: data.taskId,
10432
+ conversationId: data.conversationId
10228
10433
  });
10229
10434
  });
10230
10435
  this.socket.on("stop", () => {
@@ -10242,7 +10447,7 @@ var WSClient = class {
10242
10447
  };
10243
10448
 
10244
10449
  // src/version.ts
10245
- var AGENT_VERSION = "0.1.6";
10450
+ var AGENT_VERSION = "0.1.7";
10246
10451
 
10247
10452
  // src/sandbox.ts
10248
10453
  async function runSandbox(config) {
@@ -10251,6 +10456,11 @@ async function runSandbox(config) {
10251
10456
  let stopped = false;
10252
10457
  let pendingMessageResolve = null;
10253
10458
  let currentAgent = null;
10459
+ let currentTaskMeta = void 0;
10460
+ let currentWorkflowTools = void 0;
10461
+ let currentMaxIterations = config.maxIterations ?? 50;
10462
+ let currentTaskId = config.taskId;
10463
+ let currentConversationId = config.sessionId;
10254
10464
  console.info("[sandbox] Connecting to WS server", { wsUrl: config.wsUrl, sessionId: config.sessionId });
10255
10465
  const wsClient = new WSClient(
10256
10466
  config.wsUrl,
@@ -10308,13 +10518,17 @@ async function runSandbox(config) {
10308
10518
  try {
10309
10519
  result = await agent.run({
10310
10520
  task: currentTask,
10311
- maxIterations: config.maxIterations || 50,
10312
- projectPath: config.projectPath,
10521
+ maxIterations: currentMaxIterations,
10522
+ teamPath: config.projectPath,
10313
10523
  cwd: config.projectPath,
10314
10524
  backendKind: activeBackendKind,
10315
10525
  mode: activeMode,
10316
10526
  selectedModel: activeModel,
10317
10527
  providerSessionId: lastProviderSessionId ?? void 0,
10528
+ taskMeta: currentTaskMeta,
10529
+ taskId: currentTaskId,
10530
+ conversationId: currentConversationId,
10531
+ workflowTools: currentWorkflowTools,
10318
10532
  images: currentImages.length > 0 ? currentImages.map((img) => ({
10319
10533
  id: img.id,
10320
10534
  data: img.data,
@@ -10355,6 +10569,21 @@ async function runSandbox(config) {
10355
10569
  if (nextPayload.mode) {
10356
10570
  activeMode = nextPayload.mode;
10357
10571
  }
10572
+ if (nextPayload.taskMeta !== void 0) {
10573
+ currentTaskMeta = nextPayload.taskMeta;
10574
+ }
10575
+ if (nextPayload.workflowTools !== void 0) {
10576
+ currentWorkflowTools = nextPayload.workflowTools;
10577
+ }
10578
+ if (nextPayload.maxIterations !== void 0) {
10579
+ currentMaxIterations = nextPayload.maxIterations;
10580
+ }
10581
+ if (nextPayload.taskId !== void 0) {
10582
+ currentTaskId = nextPayload.taskId;
10583
+ }
10584
+ if (nextPayload.conversationId !== void 0) {
10585
+ currentConversationId = nextPayload.conversationId;
10586
+ }
10358
10587
  }
10359
10588
  presenter.setSuppressSessionLifecycle(false);
10360
10589
  wsClient.close();