@openacp/cli 2026.41.3 → 2026.41.4
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 +123 -109
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.js +30 -59
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1443,17 +1443,17 @@ function createSecurityPlugin() {
|
|
|
1443
1443
|
});
|
|
1444
1444
|
ctx.registerService("security", guard);
|
|
1445
1445
|
ctx.registerCommand({
|
|
1446
|
-
name: "
|
|
1447
|
-
description: "Toggle
|
|
1446
|
+
name: "bypass",
|
|
1447
|
+
description: "Toggle bypass permissions (auto-approve all permissions)",
|
|
1448
1448
|
usage: "on|off",
|
|
1449
1449
|
category: "plugin",
|
|
1450
1450
|
handler: async (args2) => {
|
|
1451
1451
|
const mode = args2.raw.trim().toLowerCase();
|
|
1452
|
-
if (mode === "on") return { type: "text", text: "
|
|
1453
|
-
if (mode === "off") return { type: "text", text: "
|
|
1454
|
-
return { type: "menu", title: "
|
|
1455
|
-
{ label: "Enable", command: "/
|
|
1456
|
-
{ label: "Disable", command: "/
|
|
1452
|
+
if (mode === "on") return { type: "text", text: "Bypass permissions enabled \u2014 all permissions will be auto-approved." };
|
|
1453
|
+
if (mode === "off") return { type: "text", text: "Bypass permissions disabled \u2014 permissions require manual approval." };
|
|
1454
|
+
return { type: "menu", title: "Bypass Permissions", options: [
|
|
1455
|
+
{ label: "Enable", command: "/bypass on" },
|
|
1456
|
+
{ label: "Disable", command: "/bypass off" }
|
|
1457
1457
|
] };
|
|
1458
1458
|
}
|
|
1459
1459
|
});
|
|
@@ -7090,9 +7090,6 @@ async function sessionRoutes(app, deps) {
|
|
|
7090
7090
|
return allowOption.id;
|
|
7091
7091
|
};
|
|
7092
7092
|
}
|
|
7093
|
-
session.warmup().catch(
|
|
7094
|
-
(err) => log10.warn({ err, sessionId: session.id }, "API session warmup failed")
|
|
7095
|
-
);
|
|
7096
7093
|
return {
|
|
7097
7094
|
sessionId: session.id,
|
|
7098
7095
|
agent: session.agentName,
|
|
@@ -10074,11 +10071,11 @@ function setupDangerousModeCallbacks(bot, core) {
|
|
|
10074
10071
|
session.clientOverrides.bypassPermissions = newDangerousMode2;
|
|
10075
10072
|
log14.info(
|
|
10076
10073
|
{ sessionId, dangerousMode: newDangerousMode2 },
|
|
10077
|
-
"
|
|
10074
|
+
"Bypass permissions toggled via button"
|
|
10078
10075
|
);
|
|
10079
10076
|
core.sessionManager.patchRecord(sessionId, { clientOverrides: session.clientOverrides }).catch(() => {
|
|
10080
10077
|
});
|
|
10081
|
-
const toastText2 = newDangerousMode2 ? "\u2620\uFE0F
|
|
10078
|
+
const toastText2 = newDangerousMode2 ? "\u2620\uFE0F Bypass enabled \u2014 permissions auto-approved" : "\u{1F510} Bypass disabled \u2014 approvals required";
|
|
10082
10079
|
try {
|
|
10083
10080
|
await ctx.answerCallbackQuery({ text: toastText2 });
|
|
10084
10081
|
} catch {
|
|
@@ -10110,9 +10107,9 @@ function setupDangerousModeCallbacks(bot, core) {
|
|
|
10110
10107
|
});
|
|
10111
10108
|
log14.info(
|
|
10112
10109
|
{ sessionId, dangerousMode: newDangerousMode },
|
|
10113
|
-
"
|
|
10110
|
+
"Bypass permissions toggled via button (store-only, session not in memory)"
|
|
10114
10111
|
);
|
|
10115
|
-
const toastText = newDangerousMode ? "\u2620\uFE0F
|
|
10112
|
+
const toastText = newDangerousMode ? "\u2620\uFE0F Bypass enabled \u2014 permissions auto-approved" : "\u{1F510} Bypass disabled \u2014 approvals required";
|
|
10116
10113
|
try {
|
|
10117
10114
|
await ctx.answerCallbackQuery({ text: toastText });
|
|
10118
10115
|
} catch {
|
|
@@ -10143,7 +10140,7 @@ async function handleEnableDangerous(ctx, core) {
|
|
|
10143
10140
|
);
|
|
10144
10141
|
if (session) {
|
|
10145
10142
|
if (session.clientOverrides.bypassPermissions) {
|
|
10146
|
-
await ctx.reply("\u2620\uFE0F
|
|
10143
|
+
await ctx.reply("\u2620\uFE0F Bypass is already enabled.", {
|
|
10147
10144
|
parse_mode: "HTML"
|
|
10148
10145
|
});
|
|
10149
10146
|
return;
|
|
@@ -10163,7 +10160,7 @@ async function handleEnableDangerous(ctx, core) {
|
|
|
10163
10160
|
return;
|
|
10164
10161
|
}
|
|
10165
10162
|
if (record.clientOverrides?.bypassPermissions ?? record.dangerousMode) {
|
|
10166
|
-
await ctx.reply("\u2620\uFE0F
|
|
10163
|
+
await ctx.reply("\u2620\uFE0F Bypass is already enabled.", {
|
|
10167
10164
|
parse_mode: "HTML"
|
|
10168
10165
|
});
|
|
10169
10166
|
return;
|
|
@@ -10172,11 +10169,11 @@ async function handleEnableDangerous(ctx, core) {
|
|
|
10172
10169
|
});
|
|
10173
10170
|
}
|
|
10174
10171
|
await ctx.reply(
|
|
10175
|
-
`\
|
|
10172
|
+
`\u2620\uFE0F <b>Bypass enabled</b>
|
|
10176
10173
|
|
|
10177
|
-
All permission requests will be auto-approved
|
|
10174
|
+
All permission requests will be auto-approved \u2014 the agent can run any action without asking.
|
|
10178
10175
|
|
|
10179
|
-
Use /
|
|
10176
|
+
Use /disable_bypass to turn this off.`,
|
|
10180
10177
|
{ parse_mode: "HTML" }
|
|
10181
10178
|
);
|
|
10182
10179
|
}
|
|
@@ -10194,7 +10191,7 @@ async function handleDisableDangerous(ctx, core) {
|
|
|
10194
10191
|
);
|
|
10195
10192
|
if (session) {
|
|
10196
10193
|
if (!session.clientOverrides.bypassPermissions) {
|
|
10197
|
-
await ctx.reply("\u{1F510}
|
|
10194
|
+
await ctx.reply("\u{1F510} Bypass is already disabled.", {
|
|
10198
10195
|
parse_mode: "HTML"
|
|
10199
10196
|
});
|
|
10200
10197
|
return;
|
|
@@ -10214,7 +10211,7 @@ async function handleDisableDangerous(ctx, core) {
|
|
|
10214
10211
|
return;
|
|
10215
10212
|
}
|
|
10216
10213
|
if (!(record.clientOverrides?.bypassPermissions ?? record.dangerousMode)) {
|
|
10217
|
-
await ctx.reply("\u{1F510}
|
|
10214
|
+
await ctx.reply("\u{1F510} Bypass is already disabled.", {
|
|
10218
10215
|
parse_mode: "HTML"
|
|
10219
10216
|
});
|
|
10220
10217
|
return;
|
|
@@ -10223,13 +10220,13 @@ async function handleDisableDangerous(ctx, core) {
|
|
|
10223
10220
|
});
|
|
10224
10221
|
}
|
|
10225
10222
|
await ctx.reply(
|
|
10226
|
-
"\u{1F510} <b>
|
|
10223
|
+
"\u{1F510} <b>Bypass disabled</b>\n\nYou will be asked to approve risky actions.",
|
|
10227
10224
|
{ parse_mode: "HTML" }
|
|
10228
10225
|
);
|
|
10229
10226
|
}
|
|
10230
10227
|
function buildSessionControlKeyboard(sessionId, dangerousMode, voiceMode) {
|
|
10231
10228
|
return new InlineKeyboard().text(
|
|
10232
|
-
dangerousMode ? "\u{1F510} Disable
|
|
10229
|
+
dangerousMode ? "\u{1F510} Disable Bypass" : "\u2620\uFE0F Enable Bypass",
|
|
10233
10230
|
`d:${sessionId}`
|
|
10234
10231
|
).row().text(
|
|
10235
10232
|
voiceMode ? "\u{1F50A} Text to Speech" : "\u{1F507} Text to Speech",
|
|
@@ -10618,7 +10615,6 @@ This is your coding session \u2014 chat here to work with the agent.`,
|
|
|
10618
10615
|
reply_markup: buildSessionControlKeyboard(session.id, false, false)
|
|
10619
10616
|
}
|
|
10620
10617
|
);
|
|
10621
|
-
session.warmup().catch((err) => log15.error({ err }, "Warm-up error"));
|
|
10622
10618
|
return threadId ?? null;
|
|
10623
10619
|
} catch (err) {
|
|
10624
10620
|
log15.error({ err }, "Session creation failed");
|
|
@@ -10699,7 +10695,6 @@ async function handleNewChat(ctx, core, chatId) {
|
|
|
10699
10695
|
reply_markup: buildSessionControlKeyboard(session.id, false, false)
|
|
10700
10696
|
}
|
|
10701
10697
|
);
|
|
10702
|
-
session.warmup().catch((err) => log15.error({ err }, "Warm-up error"));
|
|
10703
10698
|
} catch (err) {
|
|
10704
10699
|
if (newThreadId) {
|
|
10705
10700
|
try {
|
|
@@ -10730,7 +10725,6 @@ async function executeNewSession(bot, core, chatId, agentName, workspace) {
|
|
|
10730
10725
|
} });
|
|
10731
10726
|
const finalName = `\u{1F504} ${session.agentName} \u2014 New Session`;
|
|
10732
10727
|
await renameSessionTopic(bot, chatId, threadId, finalName);
|
|
10733
|
-
session.warmup().catch((err) => log15.error({ err }, "Warm-up error"));
|
|
10734
10728
|
return { session, threadId, firstMsgId };
|
|
10735
10729
|
} catch (err) {
|
|
10736
10730
|
try {
|
|
@@ -11279,8 +11273,8 @@ Each session gets its own topic \u2014 chat there to work with the agent.
|
|
|
11279
11273
|
/menu \u2014 Show action menu
|
|
11280
11274
|
|
|
11281
11275
|
\u{1F512} <b>Session Options</b>
|
|
11282
|
-
/
|
|
11283
|
-
/
|
|
11276
|
+
/enable_bypass \u2014 Auto-approve permissions
|
|
11277
|
+
/disable_bypass \u2014 Restore permission prompts
|
|
11284
11278
|
/handoff \u2014 Continue session in terminal
|
|
11285
11279
|
/archive \u2014 Archive session topic
|
|
11286
11280
|
/clear \u2014 Clear assistant history
|
|
@@ -12264,7 +12258,6 @@ Context is ready \u2014 chat here to continue working with the agent.`,
|
|
|
12264
12258
|
reply_markup: buildSessionControlKeyboard(session.id, false, false)
|
|
12265
12259
|
}
|
|
12266
12260
|
);
|
|
12267
|
-
session.warmup().catch((err) => log17.error({ err }, "Warm-up error"));
|
|
12268
12261
|
} catch (err) {
|
|
12269
12262
|
log17.error({ err }, "Resume session creation failed");
|
|
12270
12263
|
if (threadId) {
|
|
@@ -13735,8 +13728,8 @@ function setupCommands(bot, core, chatId, assistant) {
|
|
|
13735
13728
|
bot.command("install", (ctx) => handleInstall(ctx, core));
|
|
13736
13729
|
bot.command("help", (ctx) => handleHelp(ctx));
|
|
13737
13730
|
bot.command("menu", (ctx) => handleMenu(ctx));
|
|
13738
|
-
bot.command("
|
|
13739
|
-
bot.command("
|
|
13731
|
+
bot.command("enable_bypass", (ctx) => handleEnableDangerous(ctx, core));
|
|
13732
|
+
bot.command("disable_bypass", (ctx) => handleDisableDangerous(ctx, core));
|
|
13740
13733
|
bot.command("restart", (ctx) => handleRestart(ctx, core));
|
|
13741
13734
|
bot.command("update", (ctx) => handleUpdate(ctx, core));
|
|
13742
13735
|
bot.command("integrate", (ctx) => handleIntegrate(ctx, core));
|
|
@@ -13845,11 +13838,11 @@ var init_commands3 = __esm({
|
|
|
13845
13838
|
{ command: "help", description: "Help" },
|
|
13846
13839
|
{ command: "menu", description: "Show menu" },
|
|
13847
13840
|
{
|
|
13848
|
-
command: "
|
|
13841
|
+
command: "enable_bypass",
|
|
13849
13842
|
description: "Auto-approve all permission requests (session only)"
|
|
13850
13843
|
},
|
|
13851
13844
|
{
|
|
13852
|
-
command: "
|
|
13845
|
+
command: "disable_bypass",
|
|
13853
13846
|
description: "Restore normal permission prompts (session only)"
|
|
13854
13847
|
},
|
|
13855
13848
|
{ command: "integrate", description: "Manage agent integrations" },
|
|
@@ -14067,10 +14060,10 @@ When the agent wants to run a command, it asks for permission.
|
|
|
14067
14060
|
You see buttons: \u2705 Allow, \u274C Reject (and sometimes "Always Allow").
|
|
14068
14061
|
A notification also appears in the Notifications topic with a link to the request.
|
|
14069
14062
|
|
|
14070
|
-
###
|
|
14063
|
+
### Bypass permissions
|
|
14071
14064
|
Auto-approves ALL permission requests \u2014 the agent runs any command without asking.
|
|
14072
|
-
- Enable: \`/
|
|
14073
|
-
- Disable: \`/
|
|
14065
|
+
- Enable: \`/enable_bypass\` or tap the \u2620\uFE0F button in the session
|
|
14066
|
+
- Disable: \`/disable_bypass\` or tap the \u{1F510} button
|
|
14074
14067
|
- \u26A0\uFE0F Use with caution \u2014 the agent can execute anything
|
|
14075
14068
|
|
|
14076
14069
|
### Session timeout
|
|
@@ -14146,8 +14139,8 @@ Just chat naturally: "How do I create a session?", "What's the status?", "Someth
|
|
|
14146
14139
|
| \`/sessions\` | Anywhere | List all sessions |
|
|
14147
14140
|
| \`/agents\` | Anywhere | Browse & install agents from ACP Registry |
|
|
14148
14141
|
| \`/install <name>\` | Anywhere | Install an agent |
|
|
14149
|
-
| \`/
|
|
14150
|
-
| \`/
|
|
14142
|
+
| \`/enable_bypass\` | Session topic | Auto-approve all permissions |
|
|
14143
|
+
| \`/disable_bypass\` | Session topic | Restore permission prompts |
|
|
14151
14144
|
| \`/handoff\` | Session topic | Transfer session to terminal |
|
|
14152
14145
|
| \`/clear\` | Assistant topic | Clear assistant history |
|
|
14153
14146
|
| \`/menu\` | Anywhere | Show action menu |
|
|
@@ -14219,7 +14212,7 @@ Just chat naturally: "How do I create a session?", "What's the status?", "Someth
|
|
|
14219
14212
|
| \`new <agent> <path>\` | Create session |
|
|
14220
14213
|
| \`send <id> "text"\` | Send prompt |
|
|
14221
14214
|
| \`cancel <id>\` | Cancel session |
|
|
14222
|
-
| \`
|
|
14215
|
+
| \`bypass <id> on/off\` | Toggle bypass permissions |
|
|
14223
14216
|
| \`topics [--status x,y]\` | List topics |
|
|
14224
14217
|
| \`delete-topic <id> [--force]\` | Delete topic |
|
|
14225
14218
|
| \`cleanup [--status x,y]\` | Cleanup old topics |
|
|
@@ -14341,7 +14334,7 @@ Override config with env vars:
|
|
|
14341
14334
|
|
|
14342
14335
|
### Permission request not showing
|
|
14343
14336
|
- Check Notifications topic for the alert
|
|
14344
|
-
- Try \`/
|
|
14337
|
+
- Try \`/enable_bypass\` to auto-approve (if you trust the agent)
|
|
14345
14338
|
|
|
14346
14339
|
### Session disappeared after restart
|
|
14347
14340
|
- Sessions persist across restarts
|
|
@@ -14518,9 +14511,9 @@ function buildAssistantSystemPrompt(ctx) {
|
|
|
14518
14511
|
- Always ask for confirmation \u2014 these are disruptive actions
|
|
14519
14512
|
- Guide user: "Tap \u{1F504} Restart button or type /restart"
|
|
14520
14513
|
|
|
14521
|
-
### Toggle
|
|
14522
|
-
- Run \`openacp api
|
|
14523
|
-
- Explain:
|
|
14514
|
+
### Toggle Bypass Permissions
|
|
14515
|
+
- Run \`openacp api bypass <id> on|off\`
|
|
14516
|
+
- Explain: bypass permissions auto-approves all permission requests \u2014 the agent can run any command without asking
|
|
14524
14517
|
|
|
14525
14518
|
## CLI Commands Reference
|
|
14526
14519
|
\`\`\`bash
|
|
@@ -14530,7 +14523,7 @@ openacp api session <id> # Session detail
|
|
|
14530
14523
|
openacp api new <agent> <workspace> --channel telegram # Create new session
|
|
14531
14524
|
openacp api send <id> "prompt text" # Send prompt to session
|
|
14532
14525
|
openacp api cancel <id> # Cancel session
|
|
14533
|
-
openacp api
|
|
14526
|
+
openacp api bypass <id> on|off # Toggle bypass permissions
|
|
14534
14527
|
|
|
14535
14528
|
# Topic management
|
|
14536
14529
|
openacp api topics # List all topics
|
|
@@ -19579,10 +19572,6 @@ Additionally, include a [TTS]...[/TTS] block with a spoken-friendly summary of y
|
|
|
19579
19572
|
await this.queue.enqueue(text6, attachments);
|
|
19580
19573
|
}
|
|
19581
19574
|
async processPrompt(text6, attachments) {
|
|
19582
|
-
if (text6 === "\0__warmup__") {
|
|
19583
|
-
await this.runWarmup();
|
|
19584
|
-
return;
|
|
19585
|
-
}
|
|
19586
19575
|
if (this._status === "finished") return;
|
|
19587
19576
|
this.promptCount++;
|
|
19588
19577
|
this.emit("prompt_count_changed", this.promptCount);
|
|
@@ -19758,27 +19747,6 @@ ${result.text}` : result.text;
|
|
|
19758
19747
|
this.resume();
|
|
19759
19748
|
}
|
|
19760
19749
|
}
|
|
19761
|
-
/** Fire-and-forget warm-up: primes model cache while user types their first message */
|
|
19762
|
-
async warmup() {
|
|
19763
|
-
await this.queue.enqueue("\0__warmup__");
|
|
19764
|
-
}
|
|
19765
|
-
async runWarmup() {
|
|
19766
|
-
this.pause((_event, args2) => {
|
|
19767
|
-
const agentEvent = args2[0];
|
|
19768
|
-
return agentEvent?.type === "commands_update";
|
|
19769
|
-
});
|
|
19770
|
-
try {
|
|
19771
|
-
const start = Date.now();
|
|
19772
|
-
await this.agentInstance.prompt('Reply with only "ready".');
|
|
19773
|
-
this.activate();
|
|
19774
|
-
this.log.info({ durationMs: Date.now() - start }, "Warm-up complete");
|
|
19775
|
-
} catch (err) {
|
|
19776
|
-
this.log.error({ err }, "Warm-up failed");
|
|
19777
|
-
} finally {
|
|
19778
|
-
this.clearBuffer();
|
|
19779
|
-
this.resume();
|
|
19780
|
-
}
|
|
19781
|
-
}
|
|
19782
19750
|
// --- ACP Mode / Config / Model State ---
|
|
19783
19751
|
setInitialConfigOptions(options) {
|
|
19784
19752
|
this.configOptions = options ?? [];
|
|
@@ -23738,30 +23706,41 @@ function flattenChoices(options) {
|
|
|
23738
23706
|
}
|
|
23739
23707
|
return result;
|
|
23740
23708
|
}
|
|
23741
|
-
function
|
|
23709
|
+
function getLabels(category, commandName) {
|
|
23710
|
+
return CATEGORY_LABELS[category] ?? {
|
|
23711
|
+
menuTitle: (cur) => `Choose ${commandName} (current: ${cur})`,
|
|
23712
|
+
successMsg: (label) => `${commandName} set to **${label}**.`,
|
|
23713
|
+
notSupported: `This agent does not support ${commandName}.`,
|
|
23714
|
+
description: `Change ${commandName} for this session`
|
|
23715
|
+
};
|
|
23716
|
+
}
|
|
23717
|
+
function registerCategoryCommand(registry, core, category, commandName) {
|
|
23718
|
+
const labels = getLabels(category, commandName);
|
|
23742
23719
|
registry.register({
|
|
23743
23720
|
name: commandName,
|
|
23744
|
-
description:
|
|
23721
|
+
description: labels.description,
|
|
23745
23722
|
usage: `[value]`,
|
|
23746
23723
|
category: "system",
|
|
23747
23724
|
handler: async (args2) => {
|
|
23748
23725
|
if (!args2.sessionId) {
|
|
23749
|
-
return { type: "error", message: "
|
|
23726
|
+
return { type: "error", message: "No active session. Start a session first." };
|
|
23750
23727
|
}
|
|
23751
23728
|
const session = core.sessionManager.getSession(args2.sessionId);
|
|
23752
23729
|
if (!session) {
|
|
23753
|
-
return { type: "error", message: "
|
|
23730
|
+
return { type: "error", message: "Session not found." };
|
|
23754
23731
|
}
|
|
23755
23732
|
const configOption = session.getConfigByCategory(category);
|
|
23756
23733
|
if (!configOption || configOption.type !== "select") {
|
|
23757
|
-
return { type: "error", message:
|
|
23734
|
+
return { type: "error", message: labels.notSupported };
|
|
23758
23735
|
}
|
|
23759
23736
|
const choices = flattenChoices(configOption.options);
|
|
23760
23737
|
const raw = args2.raw.trim();
|
|
23761
23738
|
if (!raw) {
|
|
23739
|
+
const currentChoice = choices.find((c3) => c3.value === configOption.currentValue);
|
|
23740
|
+
const currentLabel = currentChoice?.name ?? String(configOption.currentValue);
|
|
23762
23741
|
return {
|
|
23763
23742
|
type: "menu",
|
|
23764
|
-
title:
|
|
23743
|
+
title: labels.menuTitle(currentLabel),
|
|
23765
23744
|
options: choices.map((c3) => ({
|
|
23766
23745
|
label: c3.value === configOption.currentValue ? `\u2705 ${c3.name}` : c3.name,
|
|
23767
23746
|
command: `/${commandName} ${c3.value}`,
|
|
@@ -23771,8 +23750,11 @@ function registerCategoryCommand(registry, core, category, commandName, notSuppo
|
|
|
23771
23750
|
}
|
|
23772
23751
|
const match = choices.find((c3) => c3.value === raw);
|
|
23773
23752
|
if (!match) {
|
|
23774
|
-
const valid = choices.map((c3) => c3.value).join(", ");
|
|
23775
|
-
return { type: "error", message:
|
|
23753
|
+
const valid = choices.map((c3) => `**${c3.value}** (${c3.name})`).join(", ");
|
|
23754
|
+
return { type: "error", message: `Unknown option "${raw}". Available: ${valid}` };
|
|
23755
|
+
}
|
|
23756
|
+
if (configOption.currentValue === raw) {
|
|
23757
|
+
return { type: "text", text: `Already using **${match.name}**.` };
|
|
23776
23758
|
}
|
|
23777
23759
|
if (session.middlewareChain) {
|
|
23778
23760
|
const result = await session.middlewareChain.execute("config:beforeChange", {
|
|
@@ -23781,7 +23763,7 @@ function registerCategoryCommand(registry, core, category, commandName, notSuppo
|
|
|
23781
23763
|
oldValue: configOption.currentValue,
|
|
23782
23764
|
newValue: raw
|
|
23783
23765
|
}, async (p2) => p2);
|
|
23784
|
-
if (!result) return { type: "error", message: `
|
|
23766
|
+
if (!result) return { type: "error", message: `This change was blocked by a plugin.` };
|
|
23785
23767
|
}
|
|
23786
23768
|
try {
|
|
23787
23769
|
const response = await session.agentInstance.setConfigOption(
|
|
@@ -23791,27 +23773,27 @@ function registerCategoryCommand(registry, core, category, commandName, notSuppo
|
|
|
23791
23773
|
if (response.configOptions) {
|
|
23792
23774
|
session.configOptions = response.configOptions;
|
|
23793
23775
|
}
|
|
23794
|
-
return { type: "text", text:
|
|
23776
|
+
return { type: "text", text: labels.successMsg(match.name, configOption.name) };
|
|
23795
23777
|
} catch (err) {
|
|
23796
23778
|
const msg = err instanceof Error ? err.message : String(err);
|
|
23797
|
-
return { type: "error", message:
|
|
23779
|
+
return { type: "error", message: `Could not change ${commandName}: ${msg}` };
|
|
23798
23780
|
}
|
|
23799
23781
|
}
|
|
23800
23782
|
});
|
|
23801
23783
|
}
|
|
23802
23784
|
function registerDangerousCommand(registry, core) {
|
|
23803
23785
|
registry.register({
|
|
23804
|
-
name: "
|
|
23805
|
-
description: "
|
|
23786
|
+
name: "bypass",
|
|
23787
|
+
description: "Auto-approve all permission requests (skip confirmation prompts)",
|
|
23806
23788
|
usage: "[on|off]",
|
|
23807
23789
|
category: "system",
|
|
23808
23790
|
handler: async (args2) => {
|
|
23809
23791
|
if (!args2.sessionId) {
|
|
23810
|
-
return { type: "error", message: "
|
|
23792
|
+
return { type: "error", message: "No active session. Start a session first." };
|
|
23811
23793
|
}
|
|
23812
23794
|
const session = core.sessionManager.getSession(args2.sessionId);
|
|
23813
23795
|
if (!session) {
|
|
23814
|
-
return { type: "error", message: "
|
|
23796
|
+
return { type: "error", message: "Session not found." };
|
|
23815
23797
|
}
|
|
23816
23798
|
const raw = args2.raw.trim().toLowerCase();
|
|
23817
23799
|
const modeConfig = session.getConfigByCategory("mode");
|
|
@@ -23822,21 +23804,31 @@ function registerDangerousCommand(registry, core) {
|
|
|
23822
23804
|
bypassValue = choices.find((c3) => isPermissionBypass(c3.value))?.value;
|
|
23823
23805
|
nonBypassDefault = choices.find((c3) => !isPermissionBypass(c3.value))?.value;
|
|
23824
23806
|
}
|
|
23825
|
-
const
|
|
23807
|
+
const isCurrentlyBypassing = bypassValue ? modeConfig.type === "select" && isPermissionBypass(modeConfig.currentValue) : !!session.clientOverrides.bypassPermissions;
|
|
23826
23808
|
if (!raw) {
|
|
23827
|
-
|
|
23828
|
-
|
|
23829
|
-
|
|
23809
|
+
if (isCurrentlyBypassing) {
|
|
23810
|
+
return {
|
|
23811
|
+
type: "menu",
|
|
23812
|
+
title: "\u2620\uFE0F Bypass is ON \u2014 all permissions are auto-approved",
|
|
23813
|
+
options: [{ label: "\u{1F510} Turn off bypass", command: "/bypass off" }]
|
|
23814
|
+
};
|
|
23815
|
+
}
|
|
23830
23816
|
return {
|
|
23831
23817
|
type: "menu",
|
|
23832
|
-
title:
|
|
23833
|
-
options: [{ label:
|
|
23818
|
+
title: "\u{1F510} Bypass is OFF \u2014 you will be asked before risky actions",
|
|
23819
|
+
options: [{ label: "\u2620\uFE0F Turn on bypass", command: "/bypass on" }]
|
|
23834
23820
|
};
|
|
23835
23821
|
}
|
|
23836
23822
|
if (raw !== "on" && raw !== "off") {
|
|
23837
|
-
return { type: "error", message: "
|
|
23823
|
+
return { type: "error", message: "Use **/bypass on** or **/bypass off**." };
|
|
23838
23824
|
}
|
|
23839
23825
|
const wantOn = raw === "on";
|
|
23826
|
+
if (wantOn === isCurrentlyBypassing) {
|
|
23827
|
+
return {
|
|
23828
|
+
type: "text",
|
|
23829
|
+
text: wantOn ? "\u2620\uFE0F Bypass is already enabled." : "\u{1F510} Bypass is already disabled."
|
|
23830
|
+
};
|
|
23831
|
+
}
|
|
23840
23832
|
if (bypassValue && modeConfig) {
|
|
23841
23833
|
try {
|
|
23842
23834
|
const targetValue = wantOn ? bypassValue : nonBypassDefault;
|
|
@@ -23849,11 +23841,11 @@ function registerDangerousCommand(registry, core) {
|
|
|
23849
23841
|
}
|
|
23850
23842
|
return {
|
|
23851
23843
|
type: "text",
|
|
23852
|
-
text:
|
|
23844
|
+
text: wantOn ? "\u2620\uFE0F **Bypass enabled** \u2014 all permission requests will be auto-approved. The agent can run any action without asking." : "\u{1F510} **Bypass disabled** \u2014 you will be asked to approve risky actions."
|
|
23853
23845
|
};
|
|
23854
23846
|
} catch (err) {
|
|
23855
23847
|
const msg = err instanceof Error ? err.message : String(err);
|
|
23856
|
-
return { type: "error", message:
|
|
23848
|
+
return { type: "error", message: `Could not toggle bypass: ${msg}` };
|
|
23857
23849
|
}
|
|
23858
23850
|
}
|
|
23859
23851
|
session.clientOverrides.bypassPermissions = wantOn;
|
|
@@ -23862,23 +23854,44 @@ function registerDangerousCommand(registry, core) {
|
|
|
23862
23854
|
});
|
|
23863
23855
|
return {
|
|
23864
23856
|
type: "text",
|
|
23865
|
-
text:
|
|
23857
|
+
text: wantOn ? "\u2620\uFE0F **Bypass enabled** (client-side) \u2014 all permission requests will be auto-approved.\n\n_Note: This agent doesn't natively support bypass mode, so OpenACP will auto-approve on your behalf._" : "\u{1F510} **Bypass disabled** \u2014 you will be asked to approve risky actions."
|
|
23866
23858
|
};
|
|
23867
23859
|
}
|
|
23868
23860
|
});
|
|
23869
23861
|
}
|
|
23870
23862
|
function registerConfigCommands(registry, _core) {
|
|
23871
23863
|
const core = _core;
|
|
23872
|
-
registerCategoryCommand(registry, core, "mode", "mode"
|
|
23873
|
-
registerCategoryCommand(registry, core, "model", "model"
|
|
23874
|
-
registerCategoryCommand(registry, core, "thought_level", "thought"
|
|
23864
|
+
registerCategoryCommand(registry, core, "mode", "mode");
|
|
23865
|
+
registerCategoryCommand(registry, core, "model", "model");
|
|
23866
|
+
registerCategoryCommand(registry, core, "thought_level", "thought");
|
|
23875
23867
|
registerDangerousCommand(registry, core);
|
|
23876
23868
|
}
|
|
23869
|
+
var CATEGORY_LABELS;
|
|
23877
23870
|
var init_config5 = __esm({
|
|
23878
23871
|
"src/core/commands/config.ts"() {
|
|
23879
23872
|
"use strict";
|
|
23880
23873
|
init_bypass_detection();
|
|
23881
23874
|
init_bypass_detection();
|
|
23875
|
+
CATEGORY_LABELS = {
|
|
23876
|
+
mode: {
|
|
23877
|
+
menuTitle: (cur) => `Choose session mode (current: ${cur})`,
|
|
23878
|
+
successMsg: (label) => `Mode switched to **${label}**.`,
|
|
23879
|
+
notSupported: "This agent does not support switching modes.",
|
|
23880
|
+
description: "Switch the session mode (e.g. code, architect, ask)"
|
|
23881
|
+
},
|
|
23882
|
+
model: {
|
|
23883
|
+
menuTitle: (cur) => `Choose a model (current: ${cur})`,
|
|
23884
|
+
successMsg: (label) => `Model switched to **${label}**.`,
|
|
23885
|
+
notSupported: "This agent does not support switching models.",
|
|
23886
|
+
description: "Switch the AI model for this session"
|
|
23887
|
+
},
|
|
23888
|
+
thought_level: {
|
|
23889
|
+
menuTitle: (cur) => `Choose thinking level (current: ${cur})`,
|
|
23890
|
+
successMsg: (label) => `Thinking level set to **${label}**.`,
|
|
23891
|
+
notSupported: "This agent does not support changing the thinking level.",
|
|
23892
|
+
description: "Adjust how much the agent thinks before responding"
|
|
23893
|
+
}
|
|
23894
|
+
};
|
|
23882
23895
|
}
|
|
23883
23896
|
});
|
|
23884
23897
|
|
|
@@ -27059,7 +27072,7 @@ Connect messaging platforms (Telegram, Discord) to 28+ AI coding agents via ACP
|
|
|
27059
27072
|
openacp api new [agent] [workspace] Create session
|
|
27060
27073
|
openacp api send <id> <prompt> Send prompt
|
|
27061
27074
|
openacp api cancel <id> Cancel session
|
|
27062
|
-
openacp api
|
|
27075
|
+
openacp api bypass <id> on|off Toggle bypass permissions
|
|
27063
27076
|
openacp api topics [--status ...] List topics
|
|
27064
27077
|
openacp api cleanup [--status ...] Cleanup old topics
|
|
27065
27078
|
openacp api health System health check
|
|
@@ -27519,7 +27532,7 @@ function printApiHelp() {
|
|
|
27519
27532
|
[--channel <id>]
|
|
27520
27533
|
openacp api send <id> <prompt> Send prompt to session
|
|
27521
27534
|
openacp api cancel <id> Cancel a session
|
|
27522
|
-
openacp api
|
|
27535
|
+
openacp api bypass <id> on|off Toggle bypass permissions
|
|
27523
27536
|
|
|
27524
27537
|
\x1B[1mSession Config Commands:\x1B[0m
|
|
27525
27538
|
openacp api session-config <id> List all config options
|
|
@@ -27573,7 +27586,7 @@ Lists all active sessions with their ID, agent, status, and name.
|
|
|
27573
27586
|
<id> Session ID
|
|
27574
27587
|
|
|
27575
27588
|
Shows detailed info: agent, status, name, workspace, creation time,
|
|
27576
|
-
|
|
27589
|
+
bypass permissions, queue depth, and channel/thread IDs.
|
|
27577
27590
|
`,
|
|
27578
27591
|
"new": `
|
|
27579
27592
|
\x1B[1mopenacp api new\x1B[0m \u2014 Create a new session
|
|
@@ -27617,17 +27630,17 @@ dangerous mode, queue depth, and channel/thread IDs.
|
|
|
27617
27630
|
\x1B[1mArguments:\x1B[0m
|
|
27618
27631
|
<id> Session ID to cancel
|
|
27619
27632
|
`,
|
|
27620
|
-
"
|
|
27621
|
-
\x1B[1mopenacp api
|
|
27633
|
+
"bypass": `
|
|
27634
|
+
\x1B[1mopenacp api bypass\x1B[0m \u2014 Toggle bypass permissions for a session
|
|
27622
27635
|
|
|
27623
27636
|
\x1B[1mUsage:\x1B[0m
|
|
27624
|
-
openacp api
|
|
27637
|
+
openacp api bypass <id> on|off
|
|
27625
27638
|
|
|
27626
27639
|
\x1B[1mArguments:\x1B[0m
|
|
27627
27640
|
<id> Session ID
|
|
27628
|
-
on|off Enable or disable
|
|
27641
|
+
on|off Enable or disable bypass permissions
|
|
27629
27642
|
|
|
27630
|
-
|
|
27643
|
+
Bypass permissions allows the agent to run destructive commands
|
|
27631
27644
|
without confirmation prompts.
|
|
27632
27645
|
`,
|
|
27633
27646
|
"topics": `
|
|
@@ -27940,15 +27953,15 @@ Shows the version of the currently running daemon process.
|
|
|
27940
27953
|
console.log(` Prompt active : ${s.promptRunning}`);
|
|
27941
27954
|
console.log(` Channel : ${s.channelId ?? "(none)"}`);
|
|
27942
27955
|
console.log(` Thread : ${s.threadId ?? "(none)"}`);
|
|
27943
|
-
} else if (subCmd === "dangerous") {
|
|
27956
|
+
} else if (subCmd === "dangerous" || subCmd === "bypass") {
|
|
27944
27957
|
const sessionId = args2[2];
|
|
27945
27958
|
if (!sessionId) {
|
|
27946
|
-
console.error("Usage: openacp api
|
|
27959
|
+
console.error("Usage: openacp api bypass <session-id> [on|off]");
|
|
27947
27960
|
process.exit(1);
|
|
27948
27961
|
}
|
|
27949
27962
|
const toggle = args2[3];
|
|
27950
27963
|
if (!toggle || toggle !== "on" && toggle !== "off") {
|
|
27951
|
-
console.error("Usage: openacp api
|
|
27964
|
+
console.error("Usage: openacp api bypass <session-id> [on|off]");
|
|
27952
27965
|
process.exit(1);
|
|
27953
27966
|
}
|
|
27954
27967
|
const res = await call(`/api/sessions/${encodeURIComponent(sessionId)}/dangerous`, {
|
|
@@ -27962,7 +27975,7 @@ Shows the version of the currently running daemon process.
|
|
|
27962
27975
|
process.exit(1);
|
|
27963
27976
|
}
|
|
27964
27977
|
const state = toggle === "on" ? "enabled" : "disabled";
|
|
27965
|
-
console.log(`
|
|
27978
|
+
console.log(`Bypass permissions ${state} for session ${sessionId}`);
|
|
27966
27979
|
} else if (subCmd === "health") {
|
|
27967
27980
|
const res = await call("/api/health");
|
|
27968
27981
|
const data = await res.json();
|
|
@@ -28219,6 +28232,7 @@ Client overrides: ${JSON.stringify(clientOverrides)}`);
|
|
|
28219
28232
|
"cleanup",
|
|
28220
28233
|
"send",
|
|
28221
28234
|
"session",
|
|
28235
|
+
"bypass",
|
|
28222
28236
|
"dangerous",
|
|
28223
28237
|
"health",
|
|
28224
28238
|
"restart",
|