@openacp/cli 2026.401.3 → 2026.401.5
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/cli.js +78 -174
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +38 -134
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -9756,11 +9756,13 @@ function formatToolSummary(name, rawInput, displaySummary) {
|
|
|
9756
9756
|
return desc ? `\u{1F9E0} Agent: ${desc}` : `\u{1F527} ${name}`;
|
|
9757
9757
|
}
|
|
9758
9758
|
if (lowerName === "webfetch" || lowerName === "web_fetch") {
|
|
9759
|
-
const
|
|
9759
|
+
const raw = args2.url ?? "";
|
|
9760
|
+
const url = (raw !== "undefined" ? String(raw) : "").slice(0, 60);
|
|
9760
9761
|
return url ? `\u{1F310} Fetch ${url}` : `\u{1F527} ${name}`;
|
|
9761
9762
|
}
|
|
9762
9763
|
if (lowerName === "websearch" || lowerName === "web_search") {
|
|
9763
|
-
const
|
|
9764
|
+
const raw = args2.query ?? "";
|
|
9765
|
+
const query = (raw !== "undefined" ? String(raw) : "").slice(0, 60);
|
|
9764
9766
|
return query ? `\u{1F310} Search "${query}"` : `\u{1F527} ${name}`;
|
|
9765
9767
|
}
|
|
9766
9768
|
return `\u{1F527} ${name}`;
|
|
@@ -9789,10 +9791,12 @@ function formatToolTitle(name, rawInput, displayTitle) {
|
|
|
9789
9791
|
return String(args2.description ?? name).slice(0, 60);
|
|
9790
9792
|
}
|
|
9791
9793
|
if (["webfetch", "web_fetch"].includes(lowerName)) {
|
|
9792
|
-
|
|
9794
|
+
const url = typeof args2.url === "string" && args2.url !== "undefined" ? args2.url : null;
|
|
9795
|
+
return (url ?? name).slice(0, 60);
|
|
9793
9796
|
}
|
|
9794
9797
|
if (["websearch", "web_search"].includes(lowerName)) {
|
|
9795
|
-
|
|
9798
|
+
const query = typeof args2.query === "string" && args2.query !== "undefined" ? args2.query : null;
|
|
9799
|
+
return (query ?? name).slice(0, 60);
|
|
9796
9800
|
}
|
|
9797
9801
|
return name;
|
|
9798
9802
|
}
|
|
@@ -10070,7 +10074,7 @@ var BYPASS_KEYWORDS;
|
|
|
10070
10074
|
var init_bypass_detection = __esm({
|
|
10071
10075
|
"src/core/utils/bypass-detection.ts"() {
|
|
10072
10076
|
"use strict";
|
|
10073
|
-
BYPASS_KEYWORDS = ["bypass", "dangerous", "
|
|
10077
|
+
BYPASS_KEYWORDS = ["bypass", "dangerous", "auto_accept"];
|
|
10074
10078
|
}
|
|
10075
10079
|
});
|
|
10076
10080
|
|
|
@@ -10093,7 +10097,7 @@ function setupDangerousModeCallbacks(bot, core) {
|
|
|
10093
10097
|
}
|
|
10094
10098
|
const registry = core.lifecycleManager?.serviceRegistry?.get("command-registry");
|
|
10095
10099
|
if (registry) {
|
|
10096
|
-
await registry.execute(wantOn ? "/
|
|
10100
|
+
await registry.execute(wantOn ? "/bypass_permissions on" : "/bypass_permissions off", {
|
|
10097
10101
|
raw: wantOn ? "on" : "off",
|
|
10098
10102
|
sessionId,
|
|
10099
10103
|
channelId: "telegram",
|
|
@@ -10147,104 +10151,6 @@ function setupDangerousModeCallbacks(bot, core) {
|
|
|
10147
10151
|
}
|
|
10148
10152
|
});
|
|
10149
10153
|
}
|
|
10150
|
-
async function handleEnableDangerous(ctx, core) {
|
|
10151
|
-
const threadId = ctx.message?.message_thread_id;
|
|
10152
|
-
if (!threadId) {
|
|
10153
|
-
await ctx.reply("\u26A0\uFE0F This command only works inside a session topic.", {
|
|
10154
|
-
parse_mode: "HTML"
|
|
10155
|
-
});
|
|
10156
|
-
return;
|
|
10157
|
-
}
|
|
10158
|
-
const session = await core.getOrResumeSession(
|
|
10159
|
-
"telegram",
|
|
10160
|
-
String(threadId)
|
|
10161
|
-
);
|
|
10162
|
-
if (session) {
|
|
10163
|
-
if (session.clientOverrides.bypassPermissions) {
|
|
10164
|
-
await ctx.reply("\u2620\uFE0F Bypass is already enabled.", {
|
|
10165
|
-
parse_mode: "HTML"
|
|
10166
|
-
});
|
|
10167
|
-
return;
|
|
10168
|
-
}
|
|
10169
|
-
session.clientOverrides.bypassPermissions = true;
|
|
10170
|
-
core.sessionManager.patchRecord(session.id, { clientOverrides: session.clientOverrides }).catch(() => {
|
|
10171
|
-
});
|
|
10172
|
-
} else {
|
|
10173
|
-
const record = core.sessionManager.getRecordByThread(
|
|
10174
|
-
"telegram",
|
|
10175
|
-
String(threadId)
|
|
10176
|
-
);
|
|
10177
|
-
if (!record || record.status === "cancelled" || record.status === "error") {
|
|
10178
|
-
await ctx.reply("\u26A0\uFE0F No active session in this topic.", {
|
|
10179
|
-
parse_mode: "HTML"
|
|
10180
|
-
});
|
|
10181
|
-
return;
|
|
10182
|
-
}
|
|
10183
|
-
if (record.clientOverrides?.bypassPermissions ?? record.dangerousMode) {
|
|
10184
|
-
await ctx.reply("\u2620\uFE0F Bypass is already enabled.", {
|
|
10185
|
-
parse_mode: "HTML"
|
|
10186
|
-
});
|
|
10187
|
-
return;
|
|
10188
|
-
}
|
|
10189
|
-
core.sessionManager.patchRecord(record.sessionId, { clientOverrides: { bypassPermissions: true } }).catch(() => {
|
|
10190
|
-
});
|
|
10191
|
-
}
|
|
10192
|
-
await ctx.reply(
|
|
10193
|
-
`\u2620\uFE0F <b>Bypass Permissions enabled</b>
|
|
10194
|
-
|
|
10195
|
-
All permission requests will be auto-approved \u2014 the agent can run any action without asking.
|
|
10196
|
-
|
|
10197
|
-
Use /disable_bypass to turn this off.`,
|
|
10198
|
-
{ parse_mode: "HTML" }
|
|
10199
|
-
);
|
|
10200
|
-
}
|
|
10201
|
-
async function handleDisableDangerous(ctx, core) {
|
|
10202
|
-
const threadId = ctx.message?.message_thread_id;
|
|
10203
|
-
if (!threadId) {
|
|
10204
|
-
await ctx.reply("\u26A0\uFE0F This command only works inside a session topic.", {
|
|
10205
|
-
parse_mode: "HTML"
|
|
10206
|
-
});
|
|
10207
|
-
return;
|
|
10208
|
-
}
|
|
10209
|
-
const session = await core.getOrResumeSession(
|
|
10210
|
-
"telegram",
|
|
10211
|
-
String(threadId)
|
|
10212
|
-
);
|
|
10213
|
-
if (session) {
|
|
10214
|
-
if (!session.clientOverrides.bypassPermissions) {
|
|
10215
|
-
await ctx.reply("\u{1F510} Bypass is already disabled.", {
|
|
10216
|
-
parse_mode: "HTML"
|
|
10217
|
-
});
|
|
10218
|
-
return;
|
|
10219
|
-
}
|
|
10220
|
-
session.clientOverrides.bypassPermissions = false;
|
|
10221
|
-
core.sessionManager.patchRecord(session.id, { clientOverrides: session.clientOverrides }).catch(() => {
|
|
10222
|
-
});
|
|
10223
|
-
} else {
|
|
10224
|
-
const record = core.sessionManager.getRecordByThread(
|
|
10225
|
-
"telegram",
|
|
10226
|
-
String(threadId)
|
|
10227
|
-
);
|
|
10228
|
-
if (!record || record.status === "cancelled" || record.status === "error") {
|
|
10229
|
-
await ctx.reply("\u26A0\uFE0F No active session in this topic.", {
|
|
10230
|
-
parse_mode: "HTML"
|
|
10231
|
-
});
|
|
10232
|
-
return;
|
|
10233
|
-
}
|
|
10234
|
-
if (!(record.clientOverrides?.bypassPermissions ?? record.dangerousMode)) {
|
|
10235
|
-
await ctx.reply("\u{1F510} Bypass is already disabled.", {
|
|
10236
|
-
parse_mode: "HTML"
|
|
10237
|
-
});
|
|
10238
|
-
return;
|
|
10239
|
-
}
|
|
10240
|
-
core.sessionManager.patchRecord(record.sessionId, { clientOverrides: { bypassPermissions: false } }).catch(() => {
|
|
10241
|
-
});
|
|
10242
|
-
}
|
|
10243
|
-
await ctx.reply(
|
|
10244
|
-
"\u{1F510} <b>Bypass Permissions disabled</b>\n\nYou will be asked to approve risky actions.",
|
|
10245
|
-
{ parse_mode: "HTML" }
|
|
10246
|
-
);
|
|
10247
|
-
}
|
|
10248
10154
|
function buildSessionControlKeyboard(sessionId, dangerousMode, voiceMode) {
|
|
10249
10155
|
return new InlineKeyboard().text(
|
|
10250
10156
|
dangerousMode ? "\u{1F510} Disable Bypass Permissions" : "\u2620\uFE0F Enable Bypass Permissions",
|
|
@@ -10659,9 +10565,6 @@ async function createSessionDirect(ctx, core, chatId, agentName, workspace, onCo
|
|
|
10659
10565
|
}
|
|
10660
10566
|
);
|
|
10661
10567
|
onControlMessage?.(session.id, controlMsg.message_id);
|
|
10662
|
-
await core.sessionManager.patchRecord(session.id, {
|
|
10663
|
-
platform: { topicId: threadId }
|
|
10664
|
-
});
|
|
10665
10568
|
return threadId ?? null;
|
|
10666
10569
|
} catch (err) {
|
|
10667
10570
|
log15.error({ err }, "Session creation failed");
|
|
@@ -10741,9 +10644,6 @@ async function handleNewChat(ctx, core, chatId, onControlMessage) {
|
|
|
10741
10644
|
}
|
|
10742
10645
|
);
|
|
10743
10646
|
onControlMessage?.(session.id, controlMsg.message_id);
|
|
10744
|
-
await core.sessionManager.patchRecord(session.id, {
|
|
10745
|
-
platform: { topicId: newThreadId }
|
|
10746
|
-
});
|
|
10747
10647
|
} catch (err) {
|
|
10748
10648
|
if (newThreadId) {
|
|
10749
10649
|
try {
|
|
@@ -11322,8 +11222,7 @@ Each session gets its own topic \u2014 chat there to work with the agent.
|
|
|
11322
11222
|
/menu \u2014 Show action menu
|
|
11323
11223
|
|
|
11324
11224
|
\u{1F512} <b>Session Options</b>
|
|
11325
|
-
/
|
|
11326
|
-
/disable_bypass \u2014 Restore permission prompts
|
|
11225
|
+
/bypass_permissions \u2014 Toggle bypass permissions
|
|
11327
11226
|
/handoff \u2014 Continue session in terminal
|
|
11328
11227
|
/archive \u2014 Archive session topic
|
|
11329
11228
|
/clear \u2014 Clear assistant history
|
|
@@ -12305,9 +12204,6 @@ Repo: <code>${escapeHtml4(repoPath)}</code>`,
|
|
|
12305
12204
|
}
|
|
12306
12205
|
);
|
|
12307
12206
|
onControlMessage?.(session.id, controlMsg.message_id);
|
|
12308
|
-
await core.sessionManager.patchRecord(session.id, {
|
|
12309
|
-
platform: { topicId: threadId }
|
|
12310
|
-
});
|
|
12311
12207
|
} catch (err) {
|
|
12312
12208
|
log17.error({ err }, "Resume session creation failed");
|
|
12313
12209
|
if (threadId) {
|
|
@@ -13779,8 +13675,6 @@ function setupCommands(bot, core, chatId, assistant) {
|
|
|
13779
13675
|
bot.command("install", (ctx) => handleInstall(ctx, core));
|
|
13780
13676
|
bot.command("help", (ctx) => handleHelp(ctx));
|
|
13781
13677
|
bot.command("menu", (ctx) => handleMenu(ctx));
|
|
13782
|
-
bot.command("enable_bypass", (ctx) => handleEnableDangerous(ctx, core));
|
|
13783
|
-
bot.command("disable_bypass", (ctx) => handleDisableDangerous(ctx, core));
|
|
13784
13678
|
bot.command("restart", (ctx) => handleRestart(ctx, core));
|
|
13785
13679
|
bot.command("update", (ctx) => handleUpdate(ctx, core));
|
|
13786
13680
|
bot.command("integrate", (ctx) => handleIntegrate(ctx, core));
|
|
@@ -13888,14 +13782,6 @@ var init_commands3 = __esm({
|
|
|
13888
13782
|
{ command: "install", description: "Install a new agent" },
|
|
13889
13783
|
{ command: "help", description: "Help" },
|
|
13890
13784
|
{ command: "menu", description: "Show menu" },
|
|
13891
|
-
{
|
|
13892
|
-
command: "enable_bypass",
|
|
13893
|
-
description: "Auto-approve all permission requests (session only)"
|
|
13894
|
-
},
|
|
13895
|
-
{
|
|
13896
|
-
command: "disable_bypass",
|
|
13897
|
-
description: "Restore normal permission prompts (session only)"
|
|
13898
|
-
},
|
|
13899
13785
|
{ command: "integrate", description: "Manage agent integrations" },
|
|
13900
13786
|
{ command: "handoff", description: "Continue this session in your terminal" },
|
|
13901
13787
|
{ command: "clear", description: "Clear assistant history" },
|
|
@@ -13909,7 +13795,11 @@ var init_commands3 = __esm({
|
|
|
13909
13795
|
{ command: "verbosity", description: "Deprecated: use /outputmode instead" },
|
|
13910
13796
|
{ command: "outputmode", description: "Control output display level (low/medium/high)" },
|
|
13911
13797
|
{ command: "resume", description: "Resume with conversation history from Entire checkpoints" },
|
|
13912
|
-
{ command: "switch", description: "Switch agent in current session" }
|
|
13798
|
+
{ command: "switch", description: "Switch agent in current session" },
|
|
13799
|
+
{ command: "mode", description: "Change session mode" },
|
|
13800
|
+
{ command: "model", description: "Change AI model" },
|
|
13801
|
+
{ command: "thought", description: "Change thinking level" },
|
|
13802
|
+
{ command: "bypass_permissions", description: "Toggle bypass permissions (on/off)" }
|
|
13913
13803
|
];
|
|
13914
13804
|
}
|
|
13915
13805
|
});
|
|
@@ -14113,8 +14003,8 @@ A notification also appears in the Notifications topic with a link to the reques
|
|
|
14113
14003
|
|
|
14114
14004
|
### Bypass permissions
|
|
14115
14005
|
Auto-approves ALL permission requests \u2014 the agent runs any command without asking.
|
|
14116
|
-
-
|
|
14117
|
-
- Disable: \`/
|
|
14006
|
+
- Toggle: \`/bypass_permissions on\` or tap the \u2620\uFE0F button in the session
|
|
14007
|
+
- Disable: \`/bypass_permissions off\` or tap the \u{1F510} button
|
|
14118
14008
|
- \u26A0\uFE0F Use with caution \u2014 the agent can execute anything
|
|
14119
14009
|
|
|
14120
14010
|
### Session timeout
|
|
@@ -14190,8 +14080,7 @@ Just chat naturally: "How do I create a session?", "What's the status?", "Someth
|
|
|
14190
14080
|
| \`/sessions\` | Anywhere | List all sessions |
|
|
14191
14081
|
| \`/agents\` | Anywhere | Browse & install agents from ACP Registry |
|
|
14192
14082
|
| \`/install <name>\` | Anywhere | Install an agent |
|
|
14193
|
-
| \`/
|
|
14194
|
-
| \`/disable_bypass\` | Session topic | Restore permission prompts |
|
|
14083
|
+
| \`/bypass_permissions\` | Session topic | Toggle bypass permissions (on/off) |
|
|
14195
14084
|
| \`/handoff\` | Session topic | Transfer session to terminal |
|
|
14196
14085
|
| \`/clear\` | Assistant topic | Clear assistant history |
|
|
14197
14086
|
| \`/menu\` | Anywhere | Show action menu |
|
|
@@ -14385,7 +14274,7 @@ Override config with env vars:
|
|
|
14385
14274
|
|
|
14386
14275
|
### Permission request not showing
|
|
14387
14276
|
- Check Notifications topic for the alert
|
|
14388
|
-
- Try \`/
|
|
14277
|
+
- Try \`/bypass_permissions on\` to auto-approve (if you trust the agent)
|
|
14389
14278
|
|
|
14390
14279
|
### Session disappeared after restart
|
|
14391
14280
|
- Sessions persist across restarts
|
|
@@ -14890,6 +14779,13 @@ function buildTitle(entry, kind) {
|
|
|
14890
14779
|
}
|
|
14891
14780
|
return capitalize(entry.name);
|
|
14892
14781
|
}
|
|
14782
|
+
if (kind === "fetch" || kind === "web") {
|
|
14783
|
+
const url = typeof input2.url === "string" ? input2.url : null;
|
|
14784
|
+
if (url && url !== "undefined") return url.length > 60 ? url.slice(0, 57) + "..." : url;
|
|
14785
|
+
const query = typeof input2.query === "string" ? input2.query : null;
|
|
14786
|
+
if (query && query !== "undefined") return query.length > 60 ? query.slice(0, 57) + "..." : query;
|
|
14787
|
+
return capitalize(entry.name);
|
|
14788
|
+
}
|
|
14893
14789
|
if (entry.name.toLowerCase() === "skill" && typeof input2.skill === "string" && input2.skill) {
|
|
14894
14790
|
return input2.skill;
|
|
14895
14791
|
}
|
|
@@ -16444,9 +16340,10 @@ var init_adapter2 = __esm({
|
|
|
16444
16340
|
controlMsgIds = /* @__PURE__ */ new Map();
|
|
16445
16341
|
/** Store control message ID in memory + persist to session record */
|
|
16446
16342
|
storeControlMsgId(sessionId, msgId) {
|
|
16447
|
-
this.
|
|
16343
|
+
this.controlMsgIds.set(sessionId, msgId);
|
|
16344
|
+
const record = this.core.sessionManager.getSessionRecord(sessionId);
|
|
16448
16345
|
this.core.sessionManager.patchRecord(sessionId, {
|
|
16449
|
-
platform: { controlMsgId: msgId }
|
|
16346
|
+
platform: { ...record?.platform ?? {}, controlMsgId: msgId }
|
|
16450
16347
|
}).catch(() => {
|
|
16451
16348
|
});
|
|
16452
16349
|
}
|
|
@@ -18826,7 +18723,14 @@ var init_debug_tracer = __esm({
|
|
|
18826
18723
|
this.dirCreated = true;
|
|
18827
18724
|
}
|
|
18828
18725
|
const filePath = path38.join(this.logDir, `${this.sessionId}_${layer}.jsonl`);
|
|
18829
|
-
const
|
|
18726
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
18727
|
+
const line = JSON.stringify({ ts: Date.now(), ...data }, (_key, value) => {
|
|
18728
|
+
if (typeof value === "object" && value !== null) {
|
|
18729
|
+
if (seen.has(value)) return "[Circular]";
|
|
18730
|
+
seen.add(value);
|
|
18731
|
+
}
|
|
18732
|
+
return value;
|
|
18733
|
+
}) + "\n";
|
|
18830
18734
|
fs35.appendFileSync(filePath, line);
|
|
18831
18735
|
} catch {
|
|
18832
18736
|
}
|
|
@@ -23913,7 +23817,7 @@ function registerCategoryCommand(registry, core, category, commandName) {
|
|
|
23913
23817
|
}
|
|
23914
23818
|
function registerDangerousCommand(registry, core) {
|
|
23915
23819
|
registry.register({
|
|
23916
|
-
name: "
|
|
23820
|
+
name: "bypass_permissions",
|
|
23917
23821
|
description: "Auto-approve all permission requests (skip confirmation prompts)",
|
|
23918
23822
|
usage: "[on|off]",
|
|
23919
23823
|
category: "system",
|
|
@@ -23940,17 +23844,17 @@ function registerDangerousCommand(registry, core) {
|
|
|
23940
23844
|
return {
|
|
23941
23845
|
type: "menu",
|
|
23942
23846
|
title: "\u2620\uFE0F Bypass is ON \u2014 all permissions are auto-approved",
|
|
23943
|
-
options: [{ label: "\u{1F510} Turn off bypass", command: "/
|
|
23847
|
+
options: [{ label: "\u{1F510} Turn off bypass", command: "/bypass_permissions off" }]
|
|
23944
23848
|
};
|
|
23945
23849
|
}
|
|
23946
23850
|
return {
|
|
23947
23851
|
type: "menu",
|
|
23948
23852
|
title: "\u{1F510} Bypass is OFF \u2014 you will be asked before risky actions",
|
|
23949
|
-
options: [{ label: "\u2620\uFE0F Turn on bypass", command: "/
|
|
23853
|
+
options: [{ label: "\u2620\uFE0F Turn on bypass", command: "/bypass_permissions on" }]
|
|
23950
23854
|
};
|
|
23951
23855
|
}
|
|
23952
23856
|
if (raw !== "on" && raw !== "off") {
|
|
23953
|
-
return { type: "error", message: "Use **/
|
|
23857
|
+
return { type: "error", message: "Use **/bypass_permissions on** or **/bypass_permissions off**." };
|
|
23954
23858
|
}
|
|
23955
23859
|
const wantOn = raw === "on";
|
|
23956
23860
|
if (wantOn === isCurrentlyBypassing) {
|
|
@@ -27259,7 +27163,7 @@ Installs the plugin to ~/.openacp/plugins/.
|
|
|
27259
27163
|
`);
|
|
27260
27164
|
return;
|
|
27261
27165
|
}
|
|
27262
|
-
const pkg = args2[
|
|
27166
|
+
const pkg = args2[0];
|
|
27263
27167
|
if (!pkg) {
|
|
27264
27168
|
console.error("Usage: openacp install <package>");
|
|
27265
27169
|
process.exit(1);
|
|
@@ -27298,7 +27202,7 @@ async function cmdUninstall(args2, instanceRoot) {
|
|
|
27298
27202
|
`);
|
|
27299
27203
|
return;
|
|
27300
27204
|
}
|
|
27301
|
-
const pkg = args2[
|
|
27205
|
+
const pkg = args2[0];
|
|
27302
27206
|
if (!pkg) {
|
|
27303
27207
|
console.error("Usage: openacp uninstall <package>");
|
|
27304
27208
|
process.exit(1);
|
|
@@ -27699,7 +27603,7 @@ function printApiHelp() {
|
|
|
27699
27603
|
`);
|
|
27700
27604
|
}
|
|
27701
27605
|
async function cmdApi(args2, instanceRoot) {
|
|
27702
|
-
const subCmd = args2[
|
|
27606
|
+
const subCmd = args2[0];
|
|
27703
27607
|
if (wantsHelp(args2) && (!subCmd || subCmd === "--help" || subCmd === "-h")) {
|
|
27704
27608
|
printApiHelp();
|
|
27705
27609
|
return;
|
|
@@ -27927,9 +27831,9 @@ Shows the version of the currently running daemon process.
|
|
|
27927
27831
|
const call = (urlPath, options) => apiCall(port, urlPath, options, instanceRoot);
|
|
27928
27832
|
try {
|
|
27929
27833
|
if (subCmd === "new") {
|
|
27930
|
-
const agent = args2[
|
|
27834
|
+
const agent = args2[1];
|
|
27931
27835
|
const workspaceIdx = args2.indexOf("--workspace");
|
|
27932
|
-
const workspace = workspaceIdx !== -1 ? args2[workspaceIdx + 1] : args2[
|
|
27836
|
+
const workspace = workspaceIdx !== -1 ? args2[workspaceIdx + 1] : args2[2];
|
|
27933
27837
|
const channelIdx = args2.indexOf("--channel");
|
|
27934
27838
|
const channel = channelIdx !== -1 ? args2[channelIdx + 1] : void 0;
|
|
27935
27839
|
const body = {};
|
|
@@ -27952,7 +27856,7 @@ Shows the version of the currently running daemon process.
|
|
|
27952
27856
|
console.log(` Workspace : ${data.workspace}`);
|
|
27953
27857
|
console.log(` Status : ${data.status}`);
|
|
27954
27858
|
} else if (subCmd === "cancel") {
|
|
27955
|
-
const sessionId = args2[
|
|
27859
|
+
const sessionId = args2[1];
|
|
27956
27860
|
if (!sessionId) {
|
|
27957
27861
|
console.error("Usage: openacp api cancel <session-id>");
|
|
27958
27862
|
process.exit(1);
|
|
@@ -28005,7 +27909,7 @@ Shows the version of the currently running daemon process.
|
|
|
28005
27909
|
}
|
|
28006
27910
|
}
|
|
28007
27911
|
} else if (subCmd === "delete-topic") {
|
|
28008
|
-
const sessionId = args2[
|
|
27912
|
+
const sessionId = args2[1];
|
|
28009
27913
|
if (!sessionId) {
|
|
28010
27914
|
console.error("Usage: openacp api delete-topic <session-id> [--force]");
|
|
28011
27915
|
process.exit(1);
|
|
@@ -28045,12 +27949,12 @@ Shows the version of the currently running daemon process.
|
|
|
28045
27949
|
}
|
|
28046
27950
|
}
|
|
28047
27951
|
} else if (subCmd === "send") {
|
|
28048
|
-
const sessionId = args2[
|
|
27952
|
+
const sessionId = args2[1];
|
|
28049
27953
|
if (!sessionId) {
|
|
28050
27954
|
console.error("Usage: openacp api send <session-id> <prompt>");
|
|
28051
27955
|
process.exit(1);
|
|
28052
27956
|
}
|
|
28053
|
-
const prompt = args2.slice(
|
|
27957
|
+
const prompt = args2.slice(2).join(" ");
|
|
28054
27958
|
if (!prompt) {
|
|
28055
27959
|
console.error("Usage: openacp api send <session-id> <prompt>");
|
|
28056
27960
|
process.exit(1);
|
|
@@ -28067,7 +27971,7 @@ Shows the version of the currently running daemon process.
|
|
|
28067
27971
|
}
|
|
28068
27972
|
console.log(`Prompt sent to session ${sessionId} (queue depth: ${data.queueDepth})`);
|
|
28069
27973
|
} else if (subCmd === "session") {
|
|
28070
|
-
const sessionId = args2[
|
|
27974
|
+
const sessionId = args2[1];
|
|
28071
27975
|
if (!sessionId) {
|
|
28072
27976
|
console.error("Usage: openacp api session <session-id>");
|
|
28073
27977
|
process.exit(1);
|
|
@@ -28092,12 +27996,12 @@ Shows the version of the currently running daemon process.
|
|
|
28092
27996
|
console.log(` Channel : ${s.channelId ?? "(none)"}`);
|
|
28093
27997
|
console.log(` Thread : ${s.threadId ?? "(none)"}`);
|
|
28094
27998
|
} else if (subCmd === "dangerous" || subCmd === "bypass") {
|
|
28095
|
-
const sessionId = args2[
|
|
27999
|
+
const sessionId = args2[1];
|
|
28096
28000
|
if (!sessionId) {
|
|
28097
28001
|
console.error("Usage: openacp api bypass <session-id> [on|off]");
|
|
28098
28002
|
process.exit(1);
|
|
28099
28003
|
}
|
|
28100
|
-
const toggle = args2[
|
|
28004
|
+
const toggle = args2[2];
|
|
28101
28005
|
if (!toggle || toggle !== "on" && toggle !== "off") {
|
|
28102
28006
|
console.error("Usage: openacp api bypass <session-id> [on|off]");
|
|
28103
28007
|
process.exit(1);
|
|
@@ -28148,7 +28052,7 @@ Shows the version of the currently running daemon process.
|
|
|
28148
28052
|
console.log("Restart signal sent. OpenACP is restarting...");
|
|
28149
28053
|
} else if (subCmd === "config") {
|
|
28150
28054
|
console.warn('\u26A0\uFE0F Deprecated: use "openacp config" or "openacp config set" instead.');
|
|
28151
|
-
const subSubCmd = args2[
|
|
28055
|
+
const subSubCmd = args2[1];
|
|
28152
28056
|
if (!subSubCmd) {
|
|
28153
28057
|
const res = await call("/api/config");
|
|
28154
28058
|
const data = await res.json();
|
|
@@ -28158,8 +28062,8 @@ Shows the version of the currently running daemon process.
|
|
|
28158
28062
|
}
|
|
28159
28063
|
console.log(JSON.stringify(data.config, null, 2));
|
|
28160
28064
|
} else if (subSubCmd === "set") {
|
|
28161
|
-
const configPath = args2[
|
|
28162
|
-
const configValue = args2[
|
|
28065
|
+
const configPath = args2[2];
|
|
28066
|
+
const configValue = args2[3];
|
|
28163
28067
|
if (!configPath || configValue === void 0) {
|
|
28164
28068
|
console.error("Usage: openacp api config set <path> <value>");
|
|
28165
28069
|
process.exit(1);
|
|
@@ -28214,7 +28118,7 @@ Shows the version of the currently running daemon process.
|
|
|
28214
28118
|
console.log("Tunnel: not enabled");
|
|
28215
28119
|
}
|
|
28216
28120
|
} else if (subCmd === "notify") {
|
|
28217
|
-
const message = args2.slice(
|
|
28121
|
+
const message = args2.slice(1).join(" ");
|
|
28218
28122
|
if (!message) {
|
|
28219
28123
|
console.error("Usage: openacp api notify <message>");
|
|
28220
28124
|
process.exit(1);
|
|
@@ -28239,12 +28143,12 @@ Shows the version of the currently running daemon process.
|
|
|
28239
28143
|
}
|
|
28240
28144
|
console.log(`Daemon version: ${data.version}`);
|
|
28241
28145
|
} else if (subCmd === "session-config") {
|
|
28242
|
-
const sessionId = args2[
|
|
28146
|
+
const sessionId = args2[1];
|
|
28243
28147
|
if (!sessionId) {
|
|
28244
28148
|
console.error("Usage: openacp api session-config <session-id> [set <opt> <value> | overrides | dangerous [on|off]]");
|
|
28245
28149
|
process.exit(1);
|
|
28246
28150
|
}
|
|
28247
|
-
const configSubCmd = args2[
|
|
28151
|
+
const configSubCmd = args2[2];
|
|
28248
28152
|
if (!configSubCmd || configSubCmd === "list") {
|
|
28249
28153
|
const res = await call(`/api/sessions/${encodeURIComponent(sessionId)}/config`);
|
|
28250
28154
|
const data = await res.json();
|
|
@@ -28282,8 +28186,8 @@ Shows the version of the currently running daemon process.
|
|
|
28282
28186
|
Client overrides: ${JSON.stringify(clientOverrides)}`);
|
|
28283
28187
|
}
|
|
28284
28188
|
} else if (configSubCmd === "set") {
|
|
28285
|
-
const configId = args2[
|
|
28286
|
-
const value = args2[
|
|
28189
|
+
const configId = args2[3];
|
|
28190
|
+
const value = args2[4];
|
|
28287
28191
|
if (!configId || value === void 0) {
|
|
28288
28192
|
console.error("Usage: openacp api session-config <session-id> set <config-id> <value>");
|
|
28289
28193
|
process.exit(1);
|
|
@@ -28321,7 +28225,7 @@ Client overrides: ${JSON.stringify(clientOverrides)}`);
|
|
|
28321
28225
|
}
|
|
28322
28226
|
}
|
|
28323
28227
|
} else if (configSubCmd === "dangerous") {
|
|
28324
|
-
const toggle = args2[
|
|
28228
|
+
const toggle = args2[3];
|
|
28325
28229
|
if (toggle && toggle !== "on" && toggle !== "off") {
|
|
28326
28230
|
console.error("Usage: openacp api session-config <session-id> dangerous [on|off]");
|
|
28327
28231
|
process.exit(1);
|
|
@@ -28456,7 +28360,7 @@ init_api_client();
|
|
|
28456
28360
|
init_helpers();
|
|
28457
28361
|
import * as pathMod from "path";
|
|
28458
28362
|
async function cmdConfig(args2 = [], instanceRoot) {
|
|
28459
|
-
const subCmd = args2[
|
|
28363
|
+
const subCmd = args2[0];
|
|
28460
28364
|
if (wantsHelp(args2) && subCmd === "set") {
|
|
28461
28365
|
console.log(`
|
|
28462
28366
|
\x1B[1mopenacp config set\x1B[0m \u2014 Set a config value directly
|
|
@@ -28504,8 +28408,8 @@ the API for live updates. When stopped, edits config file directly.
|
|
|
28504
28408
|
return;
|
|
28505
28409
|
}
|
|
28506
28410
|
if (subCmd === "set") {
|
|
28507
|
-
const configPath = args2[
|
|
28508
|
-
const configValue = args2[
|
|
28411
|
+
const configPath = args2[1];
|
|
28412
|
+
const configValue = args2[2];
|
|
28509
28413
|
if (!configPath || configValue === void 0) {
|
|
28510
28414
|
console.error("Usage: openacp config set <path> <value>");
|
|
28511
28415
|
process.exit(1);
|
|
@@ -28678,8 +28582,8 @@ as a messaging thread. Requires a running daemon.
|
|
|
28678
28582
|
`);
|
|
28679
28583
|
return;
|
|
28680
28584
|
}
|
|
28681
|
-
const agent = args2[
|
|
28682
|
-
const sessionId = args2[
|
|
28585
|
+
const agent = args2[0];
|
|
28586
|
+
const sessionId = args2[1];
|
|
28683
28587
|
if (!agent || !sessionId) {
|
|
28684
28588
|
console.log("Usage: openacp adopt <agent> <session_id> [--cwd <path>] [--channel <name>]");
|
|
28685
28589
|
console.log("Example: openacp adopt claude abc123-def456 --cwd /path/to/project");
|
|
@@ -28749,7 +28653,7 @@ a "Handoff" slash command to Claude Code.
|
|
|
28749
28653
|
return;
|
|
28750
28654
|
}
|
|
28751
28655
|
const { getIntegration: getIntegration2, listIntegrations: listIntegrations2 } = await Promise.resolve().then(() => (init_integrate(), integrate_exports));
|
|
28752
|
-
const agent = args2[
|
|
28656
|
+
const agent = args2[0];
|
|
28753
28657
|
const uninstall = args2.includes("--uninstall");
|
|
28754
28658
|
if (!agent) {
|
|
28755
28659
|
console.log("Usage: openacp integrate <agent> [--uninstall]");
|
|
@@ -28812,7 +28716,7 @@ Fixable issues can be auto-repaired when not using --dry-run.
|
|
|
28812
28716
|
return;
|
|
28813
28717
|
}
|
|
28814
28718
|
const knownFlags = ["--dry-run"];
|
|
28815
|
-
const unknownFlags = args2.
|
|
28719
|
+
const unknownFlags = args2.filter(
|
|
28816
28720
|
(a) => a.startsWith("--") && !knownFlags.includes(a)
|
|
28817
28721
|
);
|
|
28818
28722
|
if (unknownFlags.length > 0) {
|
|
@@ -28882,7 +28786,7 @@ async function createCatalog(instanceRoot) {
|
|
|
28882
28786
|
return new AgentCatalog2();
|
|
28883
28787
|
}
|
|
28884
28788
|
async function cmdAgents(args2, instanceRoot) {
|
|
28885
|
-
const subcommand = args2[
|
|
28789
|
+
const subcommand = args2[0];
|
|
28886
28790
|
if (wantsHelp(args2) && (!subcommand || subcommand === "--help" || subcommand === "-h")) {
|
|
28887
28791
|
console.log(`
|
|
28888
28792
|
\x1B[1mopenacp agents\x1B[0m \u2014 Manage AI coding agents
|
|
@@ -28909,9 +28813,9 @@ async function cmdAgents(args2, instanceRoot) {
|
|
|
28909
28813
|
}
|
|
28910
28814
|
switch (subcommand) {
|
|
28911
28815
|
case "install":
|
|
28912
|
-
return agentsInstall(args2[
|
|
28816
|
+
return agentsInstall(args2[1], args2.includes("--force"), wantsHelp(args2), instanceRoot);
|
|
28913
28817
|
case "uninstall":
|
|
28914
|
-
return agentsUninstall(args2[
|
|
28818
|
+
return agentsUninstall(args2[1], wantsHelp(args2), instanceRoot);
|
|
28915
28819
|
case "refresh":
|
|
28916
28820
|
if (wantsHelp(args2)) {
|
|
28917
28821
|
console.log(`
|
|
@@ -28927,9 +28831,9 @@ bypassing the normal staleness check.
|
|
|
28927
28831
|
}
|
|
28928
28832
|
return agentsRefresh(instanceRoot);
|
|
28929
28833
|
case "info":
|
|
28930
|
-
return agentsInfo(args2[
|
|
28834
|
+
return agentsInfo(args2[1], wantsHelp(args2), instanceRoot);
|
|
28931
28835
|
case "run":
|
|
28932
|
-
return agentsRun(args2[
|
|
28836
|
+
return agentsRun(args2[1], args2.slice(2), wantsHelp(args2), instanceRoot);
|
|
28933
28837
|
case "list":
|
|
28934
28838
|
case void 0:
|
|
28935
28839
|
return agentsList(instanceRoot);
|
|
@@ -29270,7 +29174,7 @@ ACP-specific flags are automatically stripped.
|
|
|
29270
29174
|
// src/cli/commands/tunnel.ts
|
|
29271
29175
|
init_api_client();
|
|
29272
29176
|
async function cmdTunnel(args2, instanceRoot) {
|
|
29273
|
-
const subCmd = args2[
|
|
29177
|
+
const subCmd = args2[0];
|
|
29274
29178
|
const port = readApiPort(void 0, instanceRoot);
|
|
29275
29179
|
if (port === null) {
|
|
29276
29180
|
console.error("OpenACP is not running. Start with `openacp start`");
|
|
@@ -29279,7 +29183,7 @@ async function cmdTunnel(args2, instanceRoot) {
|
|
|
29279
29183
|
const call = (urlPath, options) => apiCall(port, urlPath, options, instanceRoot);
|
|
29280
29184
|
try {
|
|
29281
29185
|
if (subCmd === "add") {
|
|
29282
|
-
const tunnelPort = args2[
|
|
29186
|
+
const tunnelPort = args2[1];
|
|
29283
29187
|
if (!tunnelPort) {
|
|
29284
29188
|
console.error("Usage: openacp tunnel add <port> [--label name] [--session id]");
|
|
29285
29189
|
process.exit(1);
|
|
@@ -29317,7 +29221,7 @@ async function cmdTunnel(args2, instanceRoot) {
|
|
|
29317
29221
|
if (t.publicUrl) console.log(` \u2192 ${t.publicUrl}`);
|
|
29318
29222
|
}
|
|
29319
29223
|
} else if (subCmd === "stop") {
|
|
29320
|
-
const tunnelPort = args2[
|
|
29224
|
+
const tunnelPort = args2[1];
|
|
29321
29225
|
if (!tunnelPort) {
|
|
29322
29226
|
console.error("Usage: openacp tunnel stop <port>");
|
|
29323
29227
|
process.exit(1);
|