@mutagent/cli 0.1.55 → 0.1.57
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/bin/cli.js +29 -16
- package/dist/bin/cli.js.map +4 -4
- package/package.json +3 -2
package/dist/bin/cli.js
CHANGED
|
@@ -7471,29 +7471,41 @@ init_errors();
|
|
|
7471
7471
|
function registerDeleteCommand(parent) {
|
|
7472
7472
|
parent.command("delete").description("Delete a provider configuration").argument("<id>", "Provider ID (from: mutagent providers list)").option("-f, --force", "Skip confirmation prompt").addHelpText("after", `
|
|
7473
7473
|
Examples:
|
|
7474
|
+
${chalk24.dim("$")} mutagent providers delete <id>
|
|
7474
7475
|
${chalk24.dim("$")} mutagent providers delete <id> --force
|
|
7475
7476
|
${chalk24.dim("$")} mutagent providers delete <id> --force --json
|
|
7476
7477
|
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
Idempotent: deleting a non-existent provider returns success.
|
|
7478
|
+
${chalk24.dim("Note: --force is required. The CLI is non-interactive — confirm with the user via your native flow, then pass --force.")}
|
|
7479
|
+
${chalk24.dim("Warning: API keys are AES-256-GCM encrypted and irrecoverable after deletion. Agents referencing this provider will lose their model config.")}
|
|
7480
7480
|
`).action(async (id, options) => {
|
|
7481
7481
|
const isJson = getJsonFlag(parent);
|
|
7482
7482
|
const output = new OutputFormatter(isJson ? "json" : "table");
|
|
7483
7483
|
try {
|
|
7484
|
-
if (
|
|
7485
|
-
throw new MutagentError("CONFIRMATION_REQUIRED",
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
throw new MutagentError("CONFIRMATION_REQUIRED", `Deleting provider ${id} requires explicit confirmation`, `Add --force to confirm: mutagent providers delete ${id} --force`);
|
|
7484
|
+
if (!options.force && !isJson) {
|
|
7485
|
+
throw new MutagentError("CONFIRMATION_REQUIRED", `Deleting provider ${id} requires confirmation. ` + "Warning: encrypted API keys are irrecoverable after deletion.", `Run: mutagent providers delete --help
|
|
7486
|
+
` + `[Agent: Ask the user to confirm via MultiChoice, then pass --force]
|
|
7487
|
+
` + `Use --force to confirm: mutagent providers delete ${id} --force`);
|
|
7489
7488
|
}
|
|
7490
7489
|
const client = getSDKClient();
|
|
7491
7490
|
try {
|
|
7492
7491
|
await client.deleteProvider(id);
|
|
7493
7492
|
} catch (error) {
|
|
7494
|
-
if (error instanceof ApiError && error.statusCode === 404) {
|
|
7495
|
-
|
|
7493
|
+
if (error instanceof ApiError && error.statusCode === 404) {
|
|
7494
|
+
if (isJson) {
|
|
7495
|
+
const directive = buildProviderDeletedDirective(id);
|
|
7496
|
+
output.output({
|
|
7497
|
+
success: true,
|
|
7498
|
+
deletedId: id,
|
|
7499
|
+
_links: { providers: providerSettingsLink() },
|
|
7500
|
+
_directive: directive
|
|
7501
|
+
});
|
|
7502
|
+
echoDirectiveToStderr(directive);
|
|
7503
|
+
} else {
|
|
7504
|
+
output.success(`Provider ${id} already deleted (idempotent)`);
|
|
7505
|
+
}
|
|
7506
|
+
return;
|
|
7496
7507
|
}
|
|
7508
|
+
throw error;
|
|
7497
7509
|
}
|
|
7498
7510
|
if (isJson) {
|
|
7499
7511
|
const directive = buildProviderDeletedDirective(id);
|
|
@@ -7501,10 +7513,11 @@ Safety:
|
|
|
7501
7513
|
output.output({
|
|
7502
7514
|
success: true,
|
|
7503
7515
|
deletedId: id,
|
|
7516
|
+
_links: { providers: providerSettingsLink() },
|
|
7504
7517
|
_directive: directive
|
|
7505
7518
|
});
|
|
7506
7519
|
} else {
|
|
7507
|
-
output.success(`
|
|
7520
|
+
output.success(`Deleted provider: ${id}`);
|
|
7508
7521
|
console.log(` Settings: ${providerSettingsLink()}`);
|
|
7509
7522
|
}
|
|
7510
7523
|
} catch (error) {
|
|
@@ -8575,7 +8588,7 @@ async function handleSessionStart() {
|
|
|
8575
8588
|
traceId,
|
|
8576
8589
|
sessionId,
|
|
8577
8590
|
name: "Claude Code Session",
|
|
8578
|
-
source: "
|
|
8591
|
+
source: "sdk",
|
|
8579
8592
|
startTime: now,
|
|
8580
8593
|
status: "running",
|
|
8581
8594
|
spans: []
|
|
@@ -8596,7 +8609,7 @@ async function handleSessionEnd() {
|
|
|
8596
8609
|
traceId,
|
|
8597
8610
|
sessionId,
|
|
8598
8611
|
name: "Claude Code Session",
|
|
8599
|
-
source: "
|
|
8612
|
+
source: "sdk",
|
|
8600
8613
|
startTime,
|
|
8601
8614
|
endTime: now,
|
|
8602
8615
|
status: "completed",
|
|
@@ -8630,7 +8643,7 @@ async function handlePreToolUse() {
|
|
|
8630
8643
|
traceId: state.traceId,
|
|
8631
8644
|
sessionId,
|
|
8632
8645
|
name: "Claude Code Session",
|
|
8633
|
-
source: "
|
|
8646
|
+
source: "sdk",
|
|
8634
8647
|
startTime: state.startTime,
|
|
8635
8648
|
status: "running",
|
|
8636
8649
|
spans: [
|
|
@@ -8679,7 +8692,7 @@ async function handlePostToolUse() {
|
|
|
8679
8692
|
traceId,
|
|
8680
8693
|
sessionId,
|
|
8681
8694
|
name: "Claude Code Session",
|
|
8682
|
-
source: "
|
|
8695
|
+
source: "sdk",
|
|
8683
8696
|
startTime,
|
|
8684
8697
|
status: "running",
|
|
8685
8698
|
spans: [
|
|
@@ -8875,5 +8888,5 @@ program.addCommand(createUsageCommand());
|
|
|
8875
8888
|
program.addCommand(createHooksCommand());
|
|
8876
8889
|
program.parse();
|
|
8877
8890
|
|
|
8878
|
-
//# debugId=
|
|
8891
|
+
//# debugId=5AE0DCCBB0C5BF5A64756E2164756E21
|
|
8879
8892
|
//# sourceMappingURL=cli.js.map
|