autopilot-ai 1.12.0 → 1.12.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.js CHANGED
@@ -4478,8 +4478,9 @@ How to work:
4478
4478
  - Before any mutating tool call (write, edit, bash), state in one short sentence what you're about to do, then call the tool. The user will be asked to approve each mutating call.
4479
4479
  - When the user asks for a change, make the change. Do not paste code in chat that you could apply with \`edit\` or \`write\`.
4480
4480
  - When working through a multi-step task list, you MUST call \`tasks_set\` **immediately before starting each new step** and **immediately after completing each step**. Do not execute mutating tools (\`write\`, \`edit\`, \`bash\`) without updating task progress first. Skip \`tasks_set\` for trivial single-step requests.
4481
- - Keep responses terse. The user sees tool calls and their results inline \u2014 do not re-summarize them unless asked.
4482
- - If a tool returns an error, read it carefully and adjust; do not retry the same call blindly.
4481
+ - Keep responses concise, but make them useful: the user sees tool calls inline, so do not re-summarize routine progress.
4482
+ - Treat blockers as problems to work through, not as a stopping point. After an error or failed attempt, diagnose the cause and try a safe, materially different recovery or verification path when possible; do not repeat the same failed attempt blindly.
4483
+ - Prefer resolving a blocker yourself with available tools over shifting diagnosis to the user. If you still cannot finish after reasonable attempts, say what remains undone, why it is blocked, and the single most useful next action. Make that action concrete (for example, an exact command, setting to check, or specific input you need). Ask the user to act only when their access, choice, or interactive participation is genuinely required, and never imply unverified work succeeded.
4483
4484
  - Read as much of a file as needed rather than guessing; your context window is large enough to absorb whole files.
4484
4485
  - If a request is ambiguous, ask one focused question instead of making large assumptions.
4485
4486
  - When you finish a task, stop. Do not add a closing summary.
@@ -24085,6 +24086,9 @@ __export(camouflage_view_exports, {
24085
24086
  listMentionDir: () => listMentionDir,
24086
24087
  modelOptions: () => modelOptions,
24087
24088
  runCamouflageView: () => runCamouflageView,
24089
+ shouldSendSubagentPolicyNotice: () => shouldSendSubagentPolicyNotice,
24090
+ splitBangResult: () => splitBangResult,
24091
+ syncSlashCommands: () => syncSlashCommands,
24088
24092
  toolRow: () => toolRow,
24089
24093
  toolSummary: () => toolSummary,
24090
24094
  validateCommandName: () => validateCommandName
@@ -24191,6 +24195,38 @@ function runShell(command) {
24191
24195
  child.on("error", (err) => resolve15({ ok: false, output: err.message }));
24192
24196
  });
24193
24197
  }
24198
+ function syncSlashCommands(custom, lastKey, send) {
24199
+ const builtin = [
24200
+ ...BUILTIN_COMMANDS.map((c) => ({ name: c.name, description: c.description, args_hint: c.argHint })),
24201
+ { name: "jobs", description: "Browse background jobs and agents" },
24202
+ { name: "agents", description: "Browse background agents and jobs" }
24203
+ ];
24204
+ const names = new Set(builtin.map((c) => c.name));
24205
+ const commands = [
24206
+ ...builtin,
24207
+ ...custom.filter((c) => !names.has(c.name)).map((c) => ({ name: c.name, description: c.description ? `${c.description} (custom)` : "Custom command" }))
24208
+ ];
24209
+ const key = JSON.stringify(commands);
24210
+ if (key !== lastKey) send(commands);
24211
+ return key;
24212
+ }
24213
+ function shouldSendSubagentPolicyNotice(message2, sent) {
24214
+ if (!message2.startsWith("Subagent policy:") || message2.startsWith("Subagent policy: respecting your ")) return true;
24215
+ if (sent.has(message2)) return false;
24216
+ sent.add(message2);
24217
+ return true;
24218
+ }
24219
+ function splitBangResult(title, content) {
24220
+ if (!title?.startsWith("! ")) return { output: content };
24221
+ const match = /^(exit=\d+|signal=[^\r\n]+|exit=\?)(?:\r?\n)/.exec(content);
24222
+ if (!match) return { output: content };
24223
+ const exit = /^exit=(\d+)$/.exec(match[1]);
24224
+ return {
24225
+ output: content.slice(match[0].length),
24226
+ status: match[1],
24227
+ ...exit ? { exitCode: Number(exit[1]) } : {}
24228
+ };
24229
+ }
24194
24230
  function validateCommandName(name, existing) {
24195
24231
  if (!name) return "a name is required";
24196
24232
  if (!/^[a-zA-Z][a-zA-Z0-9_\-/]*$/.test(name)) return "use letters, numbers, _ - / and start with a letter";
@@ -24408,7 +24444,8 @@ var init_camouflage_view = __esm({
24408
24444
  todos = "";
24409
24445
  permission = null;
24410
24446
  openPrompt = null;
24411
- commandsKey = "";
24447
+ commandsKey;
24448
+ sentSubagentPolicyNotices = /* @__PURE__ */ new Set();
24412
24449
  jobs = new JobManager();
24413
24450
  sentActivities = /* @__PURE__ */ new Map();
24414
24451
  workerActivities = /* @__PURE__ */ new Map();
@@ -24561,17 +24598,9 @@ var init_camouflage_view = __esm({
24561
24598
  }
24562
24599
  }
24563
24600
  syncCommands(custom) {
24564
- const key = custom.map((c) => `${c.name}:${c.description ?? ""}`).join("|");
24565
- if (key === this.commandsKey && this.commandsKey !== "") return;
24566
- this.commandsKey = key || "(none)";
24567
- const builtin = [
24568
- ...BUILTIN_COMMANDS.map((c) => ({ name: c.name, description: c.description, args_hint: c.argHint })),
24569
- { name: "jobs", description: "Browse background jobs and agents", args_hint: void 0 },
24570
- { name: "agents", description: "Browse background agents and jobs", args_hint: void 0 }
24571
- ];
24572
- const names = new Set(builtin.map((c) => c.name));
24573
- const mine = custom.filter((c) => !names.has(c.name)).map((c) => ({ name: c.name, description: c.description ? `${c.description} (custom)` : "Custom command" }));
24574
- this.cam.send("SlashCommandsRegistered", { commands: [...builtin, ...mine] });
24601
+ this.commandsKey = syncSlashCommands(custom, this.commandsKey, (commands) => {
24602
+ this.cam.send("SlashCommandsRegistered", { commands });
24603
+ });
24575
24604
  }
24576
24605
  syncEvents(events) {
24577
24606
  if (events.length < this.settled || this.firstKey !== void 0 && events[0]?.key !== this.firstKey) {
@@ -24622,6 +24651,9 @@ var init_camouflage_view = __esm({
24622
24651
  return this.syncTool(e, prev);
24623
24652
  case "info":
24624
24653
  case "memory":
24654
+ if (e.kind === "info" && !shouldSendSubagentPolicyNotice(e.text, this.sentSubagentPolicyNotices)) {
24655
+ return this.mark(e.key, 0, true);
24656
+ }
24625
24657
  return this.notice(e.key, e.text, "info");
24626
24658
  case "error":
24627
24659
  return this.notice(e.key, e.text, "error");
@@ -24644,12 +24676,14 @@ var init_camouflage_view = __esm({
24644
24676
  if (e.status === "queued" || e.status === "running") return this.mark(e.key, 0, false);
24645
24677
  const ok = e.status === "done";
24646
24678
  const content = e.result ?? "";
24679
+ const bang = splitBangResult(e.render?.title, content);
24680
+ const output = e.status === "rejected" ? "" : bang.output;
24647
24681
  this.cam.send("ToolExecutionFinished", {
24648
24682
  tool_id: e.key,
24649
- exit_code: ok ? 0 : 1,
24683
+ exit_code: bang.exitCode ?? (ok ? 0 : 1),
24650
24684
  status: e.status === "rejected" ? "rejected" : e.status === "cancelled" ? "cancelled" : ok ? "done" : "error",
24651
- summary: toolSummary(e.name, ok, e.status === "rejected", content),
24652
- output: e.status === "rejected" ? "" : content,
24685
+ summary: bang.status ?? toolSummary(e.name, ok, e.status === "rejected", output),
24686
+ output,
24653
24687
  ...ok && e.render?.diff ? { diff: e.render.diff } : {}
24654
24688
  });
24655
24689
  return this.mark(e.key, 0, true);
@@ -26881,10 +26915,18 @@ var init_chat = __esm({
26881
26915
  return /* @__PURE__ */ jsx13(ToolView, { evt, verbose, isRepeated, intentTier });
26882
26916
  }
26883
26917
  if (evt.kind === "info") {
26884
- return /* @__PURE__ */ jsxs10(Text12, { color: theme.info.color, children: [
26885
- "\xB7 ",
26886
- humanizeInfo(evt.text, intentTier)
26887
- ] });
26918
+ const isSubagentHint = /^(Subagent policy|Subagent suggestion):/.test(evt.text);
26919
+ return /* @__PURE__ */ jsxs10(
26920
+ Text12,
26921
+ {
26922
+ color: isSubagentHint ? theme.muted?.color ?? theme.info.color : theme.info.color,
26923
+ dimColor: isSubagentHint || void 0,
26924
+ children: [
26925
+ "\xB7 ",
26926
+ humanizeInfo(evt.text, intentTier)
26927
+ ]
26928
+ }
26929
+ );
26888
26930
  }
26889
26931
  if (evt.kind === "jev") {
26890
26932
  const resultColor = evt.tone === "yes" ? theme.palette.success : evt.tone === "no" ? theme.warn : theme.accent;