autopilot-ai 1.12.0 → 1.12.1
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 +60 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -24085,6 +24085,9 @@ __export(camouflage_view_exports, {
|
|
|
24085
24085
|
listMentionDir: () => listMentionDir,
|
|
24086
24086
|
modelOptions: () => modelOptions,
|
|
24087
24087
|
runCamouflageView: () => runCamouflageView,
|
|
24088
|
+
shouldSendSubagentPolicyNotice: () => shouldSendSubagentPolicyNotice,
|
|
24089
|
+
splitBangResult: () => splitBangResult,
|
|
24090
|
+
syncSlashCommands: () => syncSlashCommands,
|
|
24088
24091
|
toolRow: () => toolRow,
|
|
24089
24092
|
toolSummary: () => toolSummary,
|
|
24090
24093
|
validateCommandName: () => validateCommandName
|
|
@@ -24191,6 +24194,38 @@ function runShell(command) {
|
|
|
24191
24194
|
child.on("error", (err) => resolve15({ ok: false, output: err.message }));
|
|
24192
24195
|
});
|
|
24193
24196
|
}
|
|
24197
|
+
function syncSlashCommands(custom, lastKey, send) {
|
|
24198
|
+
const builtin = [
|
|
24199
|
+
...BUILTIN_COMMANDS.map((c) => ({ name: c.name, description: c.description, args_hint: c.argHint })),
|
|
24200
|
+
{ name: "jobs", description: "Browse background jobs and agents" },
|
|
24201
|
+
{ name: "agents", description: "Browse background agents and jobs" }
|
|
24202
|
+
];
|
|
24203
|
+
const names = new Set(builtin.map((c) => c.name));
|
|
24204
|
+
const commands = [
|
|
24205
|
+
...builtin,
|
|
24206
|
+
...custom.filter((c) => !names.has(c.name)).map((c) => ({ name: c.name, description: c.description ? `${c.description} (custom)` : "Custom command" }))
|
|
24207
|
+
];
|
|
24208
|
+
const key = JSON.stringify(commands);
|
|
24209
|
+
if (key !== lastKey) send(commands);
|
|
24210
|
+
return key;
|
|
24211
|
+
}
|
|
24212
|
+
function shouldSendSubagentPolicyNotice(message2, sent) {
|
|
24213
|
+
if (!message2.startsWith("Subagent policy:") || message2.startsWith("Subagent policy: respecting your ")) return true;
|
|
24214
|
+
if (sent.has(message2)) return false;
|
|
24215
|
+
sent.add(message2);
|
|
24216
|
+
return true;
|
|
24217
|
+
}
|
|
24218
|
+
function splitBangResult(title, content) {
|
|
24219
|
+
if (!title?.startsWith("! ")) return { output: content };
|
|
24220
|
+
const match = /^(exit=\d+|signal=[^\r\n]+|exit=\?)(?:\r?\n)/.exec(content);
|
|
24221
|
+
if (!match) return { output: content };
|
|
24222
|
+
const exit = /^exit=(\d+)$/.exec(match[1]);
|
|
24223
|
+
return {
|
|
24224
|
+
output: content.slice(match[0].length),
|
|
24225
|
+
status: match[1],
|
|
24226
|
+
...exit ? { exitCode: Number(exit[1]) } : {}
|
|
24227
|
+
};
|
|
24228
|
+
}
|
|
24194
24229
|
function validateCommandName(name, existing) {
|
|
24195
24230
|
if (!name) return "a name is required";
|
|
24196
24231
|
if (!/^[a-zA-Z][a-zA-Z0-9_\-/]*$/.test(name)) return "use letters, numbers, _ - / and start with a letter";
|
|
@@ -24408,7 +24443,8 @@ var init_camouflage_view = __esm({
|
|
|
24408
24443
|
todos = "";
|
|
24409
24444
|
permission = null;
|
|
24410
24445
|
openPrompt = null;
|
|
24411
|
-
commandsKey
|
|
24446
|
+
commandsKey;
|
|
24447
|
+
sentSubagentPolicyNotices = /* @__PURE__ */ new Set();
|
|
24412
24448
|
jobs = new JobManager();
|
|
24413
24449
|
sentActivities = /* @__PURE__ */ new Map();
|
|
24414
24450
|
workerActivities = /* @__PURE__ */ new Map();
|
|
@@ -24561,17 +24597,9 @@ var init_camouflage_view = __esm({
|
|
|
24561
24597
|
}
|
|
24562
24598
|
}
|
|
24563
24599
|
syncCommands(custom) {
|
|
24564
|
-
|
|
24565
|
-
|
|
24566
|
-
|
|
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] });
|
|
24600
|
+
this.commandsKey = syncSlashCommands(custom, this.commandsKey, (commands) => {
|
|
24601
|
+
this.cam.send("SlashCommandsRegistered", { commands });
|
|
24602
|
+
});
|
|
24575
24603
|
}
|
|
24576
24604
|
syncEvents(events) {
|
|
24577
24605
|
if (events.length < this.settled || this.firstKey !== void 0 && events[0]?.key !== this.firstKey) {
|
|
@@ -24622,6 +24650,9 @@ var init_camouflage_view = __esm({
|
|
|
24622
24650
|
return this.syncTool(e, prev);
|
|
24623
24651
|
case "info":
|
|
24624
24652
|
case "memory":
|
|
24653
|
+
if (e.kind === "info" && !shouldSendSubagentPolicyNotice(e.text, this.sentSubagentPolicyNotices)) {
|
|
24654
|
+
return this.mark(e.key, 0, true);
|
|
24655
|
+
}
|
|
24625
24656
|
return this.notice(e.key, e.text, "info");
|
|
24626
24657
|
case "error":
|
|
24627
24658
|
return this.notice(e.key, e.text, "error");
|
|
@@ -24644,12 +24675,14 @@ var init_camouflage_view = __esm({
|
|
|
24644
24675
|
if (e.status === "queued" || e.status === "running") return this.mark(e.key, 0, false);
|
|
24645
24676
|
const ok = e.status === "done";
|
|
24646
24677
|
const content = e.result ?? "";
|
|
24678
|
+
const bang = splitBangResult(e.render?.title, content);
|
|
24679
|
+
const output = e.status === "rejected" ? "" : bang.output;
|
|
24647
24680
|
this.cam.send("ToolExecutionFinished", {
|
|
24648
24681
|
tool_id: e.key,
|
|
24649
|
-
exit_code: ok ? 0 : 1,
|
|
24682
|
+
exit_code: bang.exitCode ?? (ok ? 0 : 1),
|
|
24650
24683
|
status: e.status === "rejected" ? "rejected" : e.status === "cancelled" ? "cancelled" : ok ? "done" : "error",
|
|
24651
|
-
summary: toolSummary(e.name, ok, e.status === "rejected",
|
|
24652
|
-
output
|
|
24684
|
+
summary: bang.status ?? toolSummary(e.name, ok, e.status === "rejected", output),
|
|
24685
|
+
output,
|
|
24653
24686
|
...ok && e.render?.diff ? { diff: e.render.diff } : {}
|
|
24654
24687
|
});
|
|
24655
24688
|
return this.mark(e.key, 0, true);
|
|
@@ -26881,10 +26914,18 @@ var init_chat = __esm({
|
|
|
26881
26914
|
return /* @__PURE__ */ jsx13(ToolView, { evt, verbose, isRepeated, intentTier });
|
|
26882
26915
|
}
|
|
26883
26916
|
if (evt.kind === "info") {
|
|
26884
|
-
|
|
26885
|
-
|
|
26886
|
-
|
|
26887
|
-
|
|
26917
|
+
const isSubagentHint = /^(Subagent policy|Subagent suggestion):/.test(evt.text);
|
|
26918
|
+
return /* @__PURE__ */ jsxs10(
|
|
26919
|
+
Text12,
|
|
26920
|
+
{
|
|
26921
|
+
color: isSubagentHint ? theme.muted?.color ?? theme.info.color : theme.info.color,
|
|
26922
|
+
dimColor: isSubagentHint || void 0,
|
|
26923
|
+
children: [
|
|
26924
|
+
"\xB7 ",
|
|
26925
|
+
humanizeInfo(evt.text, intentTier)
|
|
26926
|
+
]
|
|
26927
|
+
}
|
|
26928
|
+
);
|
|
26888
26929
|
}
|
|
26889
26930
|
if (evt.kind === "jev") {
|
|
26890
26931
|
const resultColor = evt.tone === "yes" ? theme.palette.success : evt.tone === "no" ? theme.warn : theme.accent;
|