vercel 56.3.0 → 56.3.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/chunks/{add-DMRGZN3Z.js → add-2ITAPI7M.js} +3 -3
- package/dist/chunks/{add-CF5SQESQ.js → add-DVEAUH7N.js} +2 -2
- package/dist/chunks/{chunk-I2IICWBW.js → chunk-2CEGMXO6.js} +14 -2
- package/dist/chunks/{chunk-4YOCOUDN.js → chunk-3OZQ7KHZ.js} +2 -2
- package/dist/chunks/{chunk-KXKQQIUS.js → chunk-573XYQ3D.js} +4 -3
- package/dist/chunks/{chunk-HUKYQKVQ.js → chunk-5FF4WXVM.js} +4 -4
- package/dist/chunks/{chunk-22G26AIX.js → chunk-5POUHPEH.js} +1 -1
- package/dist/chunks/{chunk-ICSIFPXG.js → chunk-AVJRWFTM.js} +1 -1
- package/dist/chunks/{chunk-DZHRFBKE.js → chunk-BFFE4FAO.js} +1 -1
- package/dist/chunks/{chunk-EYNXG3FO.js → chunk-BZXHF66T.js} +1 -1
- package/dist/chunks/{chunk-ERPZJ4SX.js → chunk-FPMWXL3R.js} +1 -1
- package/dist/chunks/{chunk-G4PG5HVE.js → chunk-GB3QQGZU.js} +1 -1
- package/dist/chunks/{chunk-2MXGTALG.js → chunk-HZAINEXG.js} +36 -5
- package/dist/chunks/{chunk-SDK7R4WO.js → chunk-JQBH4QTB.js} +1 -1
- package/dist/chunks/{chunk-NP32PAKT.js → chunk-O3UHQI3T.js} +1 -1
- package/dist/chunks/{chunk-2C2JJTAM.js → chunk-OK6EYKRX.js} +1 -1
- package/dist/chunks/{chunk-ZDCS54ZZ.js → chunk-QW4XUBC3.js} +1 -1
- package/dist/chunks/{chunk-Q5ADSH7D.js → chunk-SRIA62TV.js} +4 -4
- package/dist/chunks/{chunk-QP3C5YS5.js → chunk-TVLLFY7M.js} +4 -4
- package/dist/chunks/{chunk-PRO4S2KV.js → chunk-WQN52QMS.js} +2 -2
- package/dist/chunks/{chunk-A6LE5VAN.js → chunk-ZKKJEOQT.js} +1 -1
- package/dist/chunks/{compile-vercel-config-RPPL7W56.js → compile-vercel-config-P3KRRAC6.js} +1 -1
- package/dist/chunks/{delete-QBVZ5X6B.js → delete-OXEMVOQE.js} +2 -2
- package/dist/chunks/{disable-YYGXPXBI.js → disable-DZA53CJA.js} +2 -2
- package/dist/chunks/{discard-X2MSUFGI.js → discard-3E7Z7CKD.js} +2 -2
- package/dist/chunks/{edit-3ABZQYUU.js → edit-UM6TWX2Z.js} +3 -3
- package/dist/chunks/{enable-HUMYCGKA.js → enable-3SH6X23Z.js} +2 -2
- package/dist/chunks/{export-KGHH4WAT.js → export-TLQERLQP.js} +2 -2
- package/dist/chunks/{image-OO3WWKZV.js → image-YKGEEC2A.js} +3 -3
- package/dist/chunks/{inspect-FNUCB7Y3.js → inspect-34OE66PO.js} +2 -2
- package/dist/chunks/{inspect-Z6SSD2SR.js → inspect-652QJ33O.js} +2 -2
- package/dist/chunks/{inspect-5TNHHD2M.js → inspect-QW6RSV7Z.js} +2 -2
- package/dist/chunks/{inspect-KSSQEAW7.js → inspect-S6X6PCGS.js} +2 -2
- package/dist/chunks/{list-X2AD3HCX.js → list-IWXFZBH7.js} +2 -2
- package/dist/chunks/{list-TXNYRVJG.js → list-OVWTXBSN.js} +1 -1
- package/dist/chunks/{login-SLPCZ2OF.js → login-S77F2DLW.js} +2 -2
- package/dist/chunks/{ls-C7MNQ4IK.js → ls-FQIWFI4K.js} +2 -2
- package/dist/chunks/{ls-QLTOY23G.js → ls-J4HHGSFU.js} +3 -3
- package/dist/chunks/{ls-2YSINRJ3.js → ls-PQPRURTJ.js} +2 -2
- package/dist/chunks/{ls-4QMJLQQL.js → ls-SAY4VQIT.js} +2 -2
- package/dist/chunks/{publish-GV4LLLXP.js → publish-LWCEDLGX.js} +2 -2
- package/dist/chunks/{query-3AHRMAPA.js → query-K2TJKOAL.js} +1 -1
- package/dist/chunks/{reorder-VSVOPNM4.js → reorder-J6OONT76.js} +2 -2
- package/dist/chunks/{restore-FKYCF73P.js → restore-3ME4ZHFW.js} +2 -2
- package/dist/chunks/{rm-4QCXZRC2.js → rm-63AGQFIQ.js} +2 -2
- package/dist/chunks/{rm-UTFG42FN.js → rm-EHEJRXQJ.js} +2 -2
- package/dist/chunks/{rm-YV5WQKQM.js → rm-XOUHC6CU.js} +3 -3
- package/dist/chunks/{rule-inspect-IONN4MTP.js → rule-inspect-3PRCEXIB.js} +3 -3
- package/dist/chunks/{rules-S2KPV7HY.js → rules-UBSIW5ZQ.js} +6 -6
- package/dist/chunks/{schema-3LX3V2HE.js → schema-I4SXEWLS.js} +1 -1
- package/dist/chunks/{tags-CQ4FRIJ4.js → tags-HF2YOQ4V.js} +2 -2
- package/dist/chunks/{update-U7OGHCP5.js → update-RRMAOQDP.js} +3 -3
- package/dist/commands/build/index.js +8 -8
- package/dist/commands/deploy/index.js +13 -11
- package/dist/commands/dev/index.js +7 -7
- package/dist/commands/env/index.js +4 -4
- package/dist/commands/link/index.js +6 -6
- package/dist/commands/list/index.js +2 -2
- package/dist/commands-bulk.js +221 -60
- package/dist/index.js +7 -7
- package/dist/version.mjs +1 -1
- package/package.json +10 -10
package/dist/commands-bulk.js
CHANGED
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
runInteractiveEditLoop,
|
|
32
32
|
stripQuotes,
|
|
33
33
|
validateActionFlags
|
|
34
|
-
} from "./chunks/chunk-
|
|
34
|
+
} from "./chunks/chunk-JQBH4QTB.js";
|
|
35
35
|
import {
|
|
36
36
|
getRouteVersions
|
|
37
37
|
} from "./chunks/chunk-AHU7WNL2.js";
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
requireProjectContext,
|
|
52
52
|
validateRequiredArguments,
|
|
53
53
|
withGlobalFlags as withGlobalFlags2
|
|
54
|
-
} from "./chunks/chunk-
|
|
54
|
+
} from "./chunks/chunk-5POUHPEH.js";
|
|
55
55
|
import {
|
|
56
56
|
normalizeRepeatableStringFilters,
|
|
57
57
|
parseTimeFlag
|
|
@@ -68,11 +68,11 @@ import {
|
|
|
68
68
|
resolveOpenApiTagForTeamsCli,
|
|
69
69
|
setAutoUpdate,
|
|
70
70
|
tryOpenApiFallback
|
|
71
|
-
} from "./chunks/chunk-
|
|
71
|
+
} from "./chunks/chunk-TVLLFY7M.js";
|
|
72
72
|
import {
|
|
73
73
|
getUpdateCommand,
|
|
74
74
|
isGlobal
|
|
75
|
-
} from "./chunks/chunk-
|
|
75
|
+
} from "./chunks/chunk-BFFE4FAO.js";
|
|
76
76
|
import {
|
|
77
77
|
Now,
|
|
78
78
|
addDomain,
|
|
@@ -94,14 +94,14 @@ import {
|
|
|
94
94
|
require_format,
|
|
95
95
|
require_jsonlines,
|
|
96
96
|
setupDomain
|
|
97
|
-
} from "./chunks/chunk-
|
|
97
|
+
} from "./chunks/chunk-SRIA62TV.js";
|
|
98
98
|
import {
|
|
99
99
|
getGlobalPathConfig,
|
|
100
100
|
persistAuthConfig,
|
|
101
101
|
readLocalConfig,
|
|
102
102
|
sleep,
|
|
103
103
|
writeToConfigFile
|
|
104
|
-
} from "./chunks/chunk-
|
|
104
|
+
} from "./chunks/chunk-3OZQ7KHZ.js";
|
|
105
105
|
import "./chunks/chunk-V5P25P7F.js";
|
|
106
106
|
import {
|
|
107
107
|
CHECKBOX_INSTRUCTIONS,
|
|
@@ -128,7 +128,7 @@ import {
|
|
|
128
128
|
import {
|
|
129
129
|
formatEnvironment,
|
|
130
130
|
validateLsArgs
|
|
131
|
-
} from "./chunks/chunk-
|
|
131
|
+
} from "./chunks/chunk-O3UHQI3T.js";
|
|
132
132
|
import {
|
|
133
133
|
validateJsonOutput
|
|
134
134
|
} from "./chunks/chunk-XPKWKPWA.js";
|
|
@@ -415,7 +415,7 @@ import {
|
|
|
415
415
|
webAnalyticsSubcommand,
|
|
416
416
|
webhooksCommand,
|
|
417
417
|
whoamiCommand
|
|
418
|
-
} from "./chunks/chunk-
|
|
418
|
+
} from "./chunks/chunk-2CEGMXO6.js";
|
|
419
419
|
import {
|
|
420
420
|
addSubcommand as addSubcommand12,
|
|
421
421
|
inspectSubcommand as inspectSubcommand8,
|
|
@@ -476,9 +476,9 @@ import "./chunks/chunk-OGG6UBXK.js";
|
|
|
476
476
|
import "./chunks/chunk-LHFNIZ2P.js";
|
|
477
477
|
import {
|
|
478
478
|
main
|
|
479
|
-
} from "./chunks/chunk-
|
|
479
|
+
} from "./chunks/chunk-5FF4WXVM.js";
|
|
480
480
|
import "./chunks/chunk-IB5L4LKZ.js";
|
|
481
|
-
import "./chunks/chunk-
|
|
481
|
+
import "./chunks/chunk-ZKKJEOQT.js";
|
|
482
482
|
import {
|
|
483
483
|
require_execa
|
|
484
484
|
} from "./chunks/chunk-R6IGDGX3.js";
|
|
@@ -493,10 +493,10 @@ import {
|
|
|
493
493
|
} from "./chunks/chunk-VXYGCOKL.js";
|
|
494
494
|
import {
|
|
495
495
|
ensureLink
|
|
496
|
-
} from "./chunks/chunk-
|
|
497
|
-
import "./chunks/chunk-
|
|
498
|
-
import "./chunks/chunk-
|
|
499
|
-
import "./chunks/chunk-
|
|
496
|
+
} from "./chunks/chunk-573XYQ3D.js";
|
|
497
|
+
import "./chunks/chunk-WQN52QMS.js";
|
|
498
|
+
import "./chunks/chunk-QW4XUBC3.js";
|
|
499
|
+
import "./chunks/chunk-BZXHF66T.js";
|
|
500
500
|
import {
|
|
501
501
|
help
|
|
502
502
|
} from "./chunks/chunk-DMSLNAVH.js";
|
|
@@ -561,7 +561,7 @@ import {
|
|
|
561
561
|
selectOrg,
|
|
562
562
|
toHost,
|
|
563
563
|
ua_default
|
|
564
|
-
} from "./chunks/chunk-
|
|
564
|
+
} from "./chunks/chunk-HZAINEXG.js";
|
|
565
565
|
import {
|
|
566
566
|
AGENT_ACTION,
|
|
567
567
|
AGENT_REASON,
|
|
@@ -2396,7 +2396,7 @@ async function activity(client) {
|
|
|
2396
2396
|
return 0;
|
|
2397
2397
|
}
|
|
2398
2398
|
telemetry2.trackCliSubcommandLs(subcommandOriginal);
|
|
2399
|
-
const listFn = (await import("./chunks/list-
|
|
2399
|
+
const listFn = (await import("./chunks/list-OVWTXBSN.js")).default;
|
|
2400
2400
|
return listFn(client, telemetry2);
|
|
2401
2401
|
}
|
|
2402
2402
|
}
|
|
@@ -3891,10 +3891,11 @@ async function resolveAgents(args) {
|
|
|
3891
3891
|
checked: detected[i]
|
|
3892
3892
|
}));
|
|
3893
3893
|
const picked = await client.input.checkbox({
|
|
3894
|
-
message: `Which coding agents should use the AI Gateway?
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3894
|
+
message: `Which coding agents should use the AI Gateway?
|
|
3895
|
+
${import_chalk11.default.dim(
|
|
3896
|
+
" Detected agents are pre-selected \xB7"
|
|
3897
|
+
)}${CHECKBOX_INSTRUCTIONS}`,
|
|
3898
|
+
instructions: false,
|
|
3898
3899
|
choices
|
|
3899
3900
|
});
|
|
3900
3901
|
const selected = picked.map((id) => getAgentById(id)).filter((a) => Boolean(a));
|
|
@@ -3935,9 +3936,7 @@ function defaultKeyName() {
|
|
|
3935
3936
|
async function promptKeyName(client) {
|
|
3936
3937
|
const fallback = defaultKeyName();
|
|
3937
3938
|
const answer = await client.input.text({
|
|
3938
|
-
message:
|
|
3939
|
-
"A new AI Gateway API key will be created for your coding agents"
|
|
3940
|
-
)}`,
|
|
3939
|
+
message: "Key name?",
|
|
3941
3940
|
default: fallback
|
|
3942
3941
|
});
|
|
3943
3942
|
return answer.trim() || fallback;
|
|
@@ -4002,7 +4001,11 @@ async function ensureTeam2(client, opts) {
|
|
|
4002
4001
|
if (canPrompt2 && !yes && !hasExplicitScopeFlag(client.argv)) {
|
|
4003
4002
|
const org = await selectOrg(
|
|
4004
4003
|
client,
|
|
4005
|
-
|
|
4004
|
+
"Which team?",
|
|
4005
|
+
void 0,
|
|
4006
|
+
true,
|
|
4007
|
+
void 0,
|
|
4008
|
+
"The new AI Gateway API key will be created under this team:"
|
|
4006
4009
|
);
|
|
4007
4010
|
client.config.currentTeam = org.type === "team" ? org.id : void 0;
|
|
4008
4011
|
return void 0;
|
|
@@ -4083,6 +4086,18 @@ function keychainLookup(opts = {}) {
|
|
|
4083
4086
|
const cmd2 = `${SECURITY_BIN} find-generic-password -s '${KEYCHAIN_SERVICE}' -a '${KEYCHAIN_ACCOUNT}' -w 2>/dev/null`;
|
|
4084
4087
|
return opts.fish ? `(${cmd2})` : `$(${cmd2})`;
|
|
4085
4088
|
}
|
|
4089
|
+
var PBCOPY_BIN = "/usr/bin/pbcopy";
|
|
4090
|
+
function copyToClipboard(text2) {
|
|
4091
|
+
try {
|
|
4092
|
+
execFileSync(PBCOPY_BIN, {
|
|
4093
|
+
input: text2,
|
|
4094
|
+
stdio: ["pipe", "ignore", "ignore"]
|
|
4095
|
+
});
|
|
4096
|
+
return true;
|
|
4097
|
+
} catch {
|
|
4098
|
+
return false;
|
|
4099
|
+
}
|
|
4100
|
+
}
|
|
4086
4101
|
|
|
4087
4102
|
// src/util/ai-gateway/coding-agents/apply.ts
|
|
4088
4103
|
function detectShellRc(home, override2) {
|
|
@@ -4327,7 +4342,10 @@ function mask(text2, secrets) {
|
|
|
4327
4342
|
return redactSecretFields(maskKnownSecrets(text2, secrets));
|
|
4328
4343
|
}
|
|
4329
4344
|
function renderDiff(before, after, options = {}) {
|
|
4330
|
-
const { secrets = [], context = 2, indent: indent2 = " " } = options;
|
|
4345
|
+
const { secrets = [], context = 2, indent: indent2 = " ", color = true } = options;
|
|
4346
|
+
const dim = color ? import_chalk13.default.dim : (s) => s;
|
|
4347
|
+
const green = color ? import_chalk13.default.green : (s) => s;
|
|
4348
|
+
const red2 = color ? import_chalk13.default.red : (s) => s;
|
|
4331
4349
|
const lines = diffLines(before, after);
|
|
4332
4350
|
if (!lines.some((l) => l.type !== " ")) {
|
|
4333
4351
|
return "";
|
|
@@ -4345,7 +4363,7 @@ function renderDiff(before, after, options = {}) {
|
|
|
4345
4363
|
lines.forEach((line2, idx) => {
|
|
4346
4364
|
if (!keep[idx]) {
|
|
4347
4365
|
if (!collapsed) {
|
|
4348
|
-
rendered.push(
|
|
4366
|
+
rendered.push(dim(`${indent2} \u22EF`));
|
|
4349
4367
|
collapsed = true;
|
|
4350
4368
|
}
|
|
4351
4369
|
return;
|
|
@@ -4353,11 +4371,11 @@ function renderDiff(before, after, options = {}) {
|
|
|
4353
4371
|
collapsed = false;
|
|
4354
4372
|
const text2 = mask(line2.text, secrets);
|
|
4355
4373
|
if (line2.type === "+") {
|
|
4356
|
-
rendered.push(
|
|
4374
|
+
rendered.push(green(`${indent2}+ ${text2}`));
|
|
4357
4375
|
} else if (line2.type === "-") {
|
|
4358
|
-
rendered.push(
|
|
4376
|
+
rendered.push(red2(`${indent2}- ${text2}`));
|
|
4359
4377
|
} else {
|
|
4360
|
-
rendered.push(
|
|
4378
|
+
rendered.push(dim(`${indent2} ${text2}`));
|
|
4361
4379
|
}
|
|
4362
4380
|
});
|
|
4363
4381
|
return rendered.join("\n");
|
|
@@ -4461,7 +4479,7 @@ function printReceiptPath(label, path3) {
|
|
|
4461
4479
|
}
|
|
4462
4480
|
function printKeyRow(key, opts = {}) {
|
|
4463
4481
|
printAlignedLabel(
|
|
4464
|
-
"API Key",
|
|
4482
|
+
opts.created ? "New API Key" : "API Key",
|
|
4465
4483
|
`${maskSecret(key)} \xB7 ${opts.keychain ? "macOS Keychain" : "Config files"}`
|
|
4466
4484
|
);
|
|
4467
4485
|
}
|
|
@@ -4480,6 +4498,31 @@ function printKey(key, opts = {}) {
|
|
|
4480
4498
|
output_manager_default.print("\n");
|
|
4481
4499
|
printKeyRow(key, opts);
|
|
4482
4500
|
}
|
|
4501
|
+
function buildAgentPrompt(plan, apiKey) {
|
|
4502
|
+
const sections = [
|
|
4503
|
+
"Set up the Vercel AI Gateway for my coding agents by applying the file changes below.",
|
|
4504
|
+
"For each file, create it if missing or edit it to match the diff (lines starting with `+` are added, `-` are removed; `\u22EF` marks skipped unchanged lines).",
|
|
4505
|
+
`Any masked value (e.g. ${maskSecret(apiKey)}) is my AI Gateway API key, stored in my macOS Keychain; the config and shell already reference it with \`${"security find-generic-password"}\`, so leave those lookups as-is and do not ask me to paste the key.`,
|
|
4506
|
+
""
|
|
4507
|
+
];
|
|
4508
|
+
for (const change2 of plan.changes) {
|
|
4509
|
+
if (change2.status !== "create" && change2.status !== "update") {
|
|
4510
|
+
continue;
|
|
4511
|
+
}
|
|
4512
|
+
const diff2 = renderDiff(change2.current ?? "", change2.next ?? "", {
|
|
4513
|
+
secrets: [apiKey],
|
|
4514
|
+
indent: "",
|
|
4515
|
+
color: false
|
|
4516
|
+
});
|
|
4517
|
+
sections.push(`# ${change2.label} \u2014 ${change2.path}`);
|
|
4518
|
+
if (diff2) {
|
|
4519
|
+
sections.push(diff2);
|
|
4520
|
+
}
|
|
4521
|
+
sections.push("");
|
|
4522
|
+
}
|
|
4523
|
+
return `${sections.join("\n").trimEnd()}
|
|
4524
|
+
`;
|
|
4525
|
+
}
|
|
4483
4526
|
|
|
4484
4527
|
// src/util/ai-gateway/coding-agents/consent.ts
|
|
4485
4528
|
var import_chalk15 = __toESM(require_source(), 1);
|
|
@@ -4653,6 +4696,45 @@ async function runMachine(args) {
|
|
|
4653
4696
|
overrides: args.overrides,
|
|
4654
4697
|
shellRcOverride: args.shellRcOverride
|
|
4655
4698
|
});
|
|
4699
|
+
if (args.promptMode) {
|
|
4700
|
+
if (!useKeychain) {
|
|
4701
|
+
client.stdout.write(
|
|
4702
|
+
`${JSON.stringify(
|
|
4703
|
+
{
|
|
4704
|
+
status: AGENT_STATUS.ERROR,
|
|
4705
|
+
reason: "keychain_error",
|
|
4706
|
+
message: "The `--apply prompt` mode needs the key in the macOS Keychain, but storing it failed, so no prompt was produced.",
|
|
4707
|
+
skipped,
|
|
4708
|
+
warnings: args.warnings
|
|
4709
|
+
},
|
|
4710
|
+
null,
|
|
4711
|
+
2
|
|
4712
|
+
)}
|
|
4713
|
+
`
|
|
4714
|
+
);
|
|
4715
|
+
return 1;
|
|
4716
|
+
}
|
|
4717
|
+
client.stdout.write(
|
|
4718
|
+
`${JSON.stringify(
|
|
4719
|
+
{
|
|
4720
|
+
status: AGENT_STATUS.OK,
|
|
4721
|
+
reason: "agent_prompt",
|
|
4722
|
+
message: "Created the AI Gateway key and generated an agent prompt. No files were written.",
|
|
4723
|
+
prompt: buildAgentPrompt(finalPlan, key),
|
|
4724
|
+
configured: [],
|
|
4725
|
+
skipped,
|
|
4726
|
+
warnings: args.warnings,
|
|
4727
|
+
notes: finalPlan.notes.flatMap(
|
|
4728
|
+
(n) => n.notes.map((line2) => `${n.displayName}: ${line2}`)
|
|
4729
|
+
)
|
|
4730
|
+
},
|
|
4731
|
+
null,
|
|
4732
|
+
2
|
|
4733
|
+
)}
|
|
4734
|
+
`
|
|
4735
|
+
);
|
|
4736
|
+
return 0;
|
|
4737
|
+
}
|
|
4656
4738
|
const results = await applyPlan(finalPlan, { backup });
|
|
4657
4739
|
client.stdout.write(
|
|
4658
4740
|
`${JSON.stringify(
|
|
@@ -4761,6 +4843,11 @@ var AiGatewayCodingAgentsSetupTelemetryClient = class extends TelemetryClient {
|
|
|
4761
4843
|
this.trackCliOption({ option: "shell-rc", value: this.redactedValue });
|
|
4762
4844
|
}
|
|
4763
4845
|
}
|
|
4846
|
+
trackCliOptionApply(apply) {
|
|
4847
|
+
if (apply) {
|
|
4848
|
+
this.trackCliOption({ option: "apply", value: apply });
|
|
4849
|
+
}
|
|
4850
|
+
}
|
|
4764
4851
|
trackCliFlagYes(yes) {
|
|
4765
4852
|
if (yes) {
|
|
4766
4853
|
this.trackCliFlag("yes");
|
|
@@ -4796,6 +4883,7 @@ async function codingAgentsSetup(client, argv) {
|
|
|
4796
4883
|
const noKeychain = opts["--no-keychain"];
|
|
4797
4884
|
const agentConfig = opts["--agent-config"];
|
|
4798
4885
|
const shellRcOverride = opts["--shell-rc"];
|
|
4886
|
+
const applyMode = opts["--apply"];
|
|
4799
4887
|
const yes = opts["--yes"];
|
|
4800
4888
|
telemetry2.trackCliOptionAgent(agentFlags);
|
|
4801
4889
|
telemetry2.trackCliFlagAll(all);
|
|
@@ -4811,6 +4899,7 @@ async function codingAgentsSetup(client, argv) {
|
|
|
4811
4899
|
telemetry2.trackCliFlagNoKeychain(noKeychain);
|
|
4812
4900
|
telemetry2.trackCliOptionAgentConfig(agentConfig);
|
|
4813
4901
|
telemetry2.trackCliOptionShellRc(shellRcOverride);
|
|
4902
|
+
telemetry2.trackCliOptionApply(applyMode);
|
|
4814
4903
|
telemetry2.trackCliFlagYes(yes);
|
|
4815
4904
|
const machine = shouldEmitNonInteractiveCommandError(client);
|
|
4816
4905
|
const canPrompt2 = Boolean(client.stdin.isTTY) && !machine;
|
|
@@ -4840,6 +4929,22 @@ async function codingAgentsSetup(client, argv) {
|
|
|
4840
4929
|
`Invalid expiration "${expiration}". Must be one of: ${VALID_EXPIRY_VALUES.join(", ")}.`
|
|
4841
4930
|
);
|
|
4842
4931
|
}
|
|
4932
|
+
if (applyMode !== void 0 && applyMode !== "edit" && applyMode !== "prompt") {
|
|
4933
|
+
return failValidation(
|
|
4934
|
+
client,
|
|
4935
|
+
machine,
|
|
4936
|
+
AGENT_REASON.INVALID_ARGUMENTS,
|
|
4937
|
+
`Invalid --apply "${applyMode}". Must be "edit" or "prompt".`
|
|
4938
|
+
);
|
|
4939
|
+
}
|
|
4940
|
+
if (applyMode === "prompt" && !wantKeychain) {
|
|
4941
|
+
return failValidation(
|
|
4942
|
+
client,
|
|
4943
|
+
machine,
|
|
4944
|
+
AGENT_REASON.INVALID_ARGUMENTS,
|
|
4945
|
+
"The `--apply prompt` mode needs the macOS Keychain so the prompt never contains your plaintext key. Run on macOS without --no-keychain, or use `--apply edit`."
|
|
4946
|
+
);
|
|
4947
|
+
}
|
|
4843
4948
|
const flagExpiresAt = expiration && expiration !== "none" ? presetToExpiresAt(expiration) : void 0;
|
|
4844
4949
|
const overrides = {};
|
|
4845
4950
|
for (const pair of agentConfig ?? []) {
|
|
@@ -5049,7 +5154,8 @@ async function codingAgentsSetup(client, argv) {
|
|
|
5049
5154
|
home,
|
|
5050
5155
|
alreadyConfigured,
|
|
5051
5156
|
// With nothing consented there is nothing to rotate or reconfigure.
|
|
5052
|
-
reconfigure: Boolean(reconfigure) && agents.length > 0
|
|
5157
|
+
reconfigure: Boolean(reconfigure) && agents.length > 0,
|
|
5158
|
+
promptMode: applyMode === "prompt"
|
|
5053
5159
|
});
|
|
5054
5160
|
}
|
|
5055
5161
|
if (alreadyConfigured) {
|
|
@@ -5113,11 +5219,32 @@ async function codingAgentsSetup(client, argv) {
|
|
|
5113
5219
|
);
|
|
5114
5220
|
return 1;
|
|
5115
5221
|
}
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
if (
|
|
5119
|
-
|
|
5120
|
-
|
|
5222
|
+
let applyAction = applyMode === "prompt" ? "copy" : "apply";
|
|
5223
|
+
if (applyMode === void 0 && changed.length > 0 && canPrompt2 && !yes) {
|
|
5224
|
+
if (useKeychain) {
|
|
5225
|
+
const choice = await client.input.select({
|
|
5226
|
+
message: "Apply these changes?",
|
|
5227
|
+
choices: [
|
|
5228
|
+
{ name: "Yes, write the files now", value: "apply" },
|
|
5229
|
+
{ name: "Copy a prompt for my agent", value: "copy" },
|
|
5230
|
+
{ name: "Cancel", value: "cancel" }
|
|
5231
|
+
],
|
|
5232
|
+
default: "apply"
|
|
5233
|
+
});
|
|
5234
|
+
if (choice === "cancel") {
|
|
5235
|
+
printStatus("Aborted. No files were changed.");
|
|
5236
|
+
return 0;
|
|
5237
|
+
}
|
|
5238
|
+
applyAction = choice;
|
|
5239
|
+
} else {
|
|
5240
|
+
const confirmed = await client.input.confirm(
|
|
5241
|
+
"Apply these changes?",
|
|
5242
|
+
true
|
|
5243
|
+
);
|
|
5244
|
+
if (!confirmed) {
|
|
5245
|
+
printStatus("Aborted. No files were changed.");
|
|
5246
|
+
return 0;
|
|
5247
|
+
}
|
|
5121
5248
|
}
|
|
5122
5249
|
}
|
|
5123
5250
|
let keySource;
|
|
@@ -5141,6 +5268,12 @@ async function codingAgentsSetup(client, argv) {
|
|
|
5141
5268
|
throw err;
|
|
5142
5269
|
}
|
|
5143
5270
|
if (useKeychain && !storeKeyInKeychain(keySource.key)) {
|
|
5271
|
+
if (applyAction === "copy") {
|
|
5272
|
+
output_manager_default.error(
|
|
5273
|
+
"Failed to store the key in the macOS Keychain, so a prompt would expose your plaintext key. Re-run and choose Apply, or pass --no-keychain to write the key to the config files."
|
|
5274
|
+
);
|
|
5275
|
+
return 1;
|
|
5276
|
+
}
|
|
5144
5277
|
printWarning(
|
|
5145
5278
|
"Failed to store the key in the macOS Keychain; writing it to the config files instead."
|
|
5146
5279
|
);
|
|
@@ -5153,11 +5286,36 @@ async function codingAgentsSetup(client, argv) {
|
|
|
5153
5286
|
overrides,
|
|
5154
5287
|
shellRcOverride
|
|
5155
5288
|
});
|
|
5289
|
+
if (applyAction === "copy") {
|
|
5290
|
+
const promptText = buildAgentPrompt(applyPlanResult, keySource.key);
|
|
5291
|
+
if (applyMode === "prompt") {
|
|
5292
|
+
const copied = copyToClipboard(promptText);
|
|
5293
|
+
printStatus(
|
|
5294
|
+
copied ? "Created the key and generated an agent prompt (copied to clipboard; also written to stdout)." : "Created the key and generated an agent prompt (written to stdout)."
|
|
5295
|
+
);
|
|
5296
|
+
client.stdout.write(`${promptText}
|
|
5297
|
+
`);
|
|
5298
|
+
} else if (copyToClipboard(promptText)) {
|
|
5299
|
+
printStatus(
|
|
5300
|
+
"Prompt copied to clipboard. Paste it into your coding agent to apply the changes."
|
|
5301
|
+
);
|
|
5302
|
+
} else {
|
|
5303
|
+
output_manager_default.debug("pbcopy failed or unavailable");
|
|
5304
|
+
printStatus("Could not access the clipboard \u2014 prompt printed below:");
|
|
5305
|
+
client.stdout.write(`${promptText}
|
|
5306
|
+
`);
|
|
5307
|
+
}
|
|
5308
|
+
printKey(keySource.key, { keychain: true, created: keySource.created });
|
|
5309
|
+
return 0;
|
|
5310
|
+
}
|
|
5156
5311
|
const results = await applyPlan(applyPlanResult, { backup: !noBackup });
|
|
5157
5312
|
if (results.length === 0 && keySource.created) {
|
|
5158
5313
|
output_manager_default.print("\n");
|
|
5159
|
-
printAlignedLabel("Rotated", "AI Gateway API key"
|
|
5160
|
-
printKeyRow(keySource.key, {
|
|
5314
|
+
printAlignedLabel("Rotated", "AI Gateway API key");
|
|
5315
|
+
printKeyRow(keySource.key, {
|
|
5316
|
+
keychain: useKeychain,
|
|
5317
|
+
created: keySource.created
|
|
5318
|
+
});
|
|
5161
5319
|
output_manager_default.print(import_chalk16.default.dim(" No config files changed.\n"));
|
|
5162
5320
|
}
|
|
5163
5321
|
if (results.length > 0) {
|
|
@@ -5171,7 +5329,10 @@ async function codingAgentsSetup(client, argv) {
|
|
|
5171
5329
|
result.path
|
|
5172
5330
|
);
|
|
5173
5331
|
}
|
|
5174
|
-
printKeyRow(keySource.key, {
|
|
5332
|
+
printKeyRow(keySource.key, {
|
|
5333
|
+
keychain: useKeychain,
|
|
5334
|
+
created: keySource.created
|
|
5335
|
+
});
|
|
5175
5336
|
if (results.some((r) => r.backupPath)) {
|
|
5176
5337
|
output_manager_default.print(import_chalk16.default.dim(" Previous files saved alongside as .bak\n"));
|
|
5177
5338
|
}
|
|
@@ -5888,12 +6049,12 @@ async function alerts(client) {
|
|
|
5888
6049
|
switch (subcommand) {
|
|
5889
6050
|
case "inspect": {
|
|
5890
6051
|
telemetry2.trackCliSubcommandInspect(subcommandOriginal);
|
|
5891
|
-
const inspectFn = (await import("./chunks/inspect-
|
|
6052
|
+
const inspectFn = (await import("./chunks/inspect-S6X6PCGS.js")).default;
|
|
5892
6053
|
return inspectFn(client, args);
|
|
5893
6054
|
}
|
|
5894
6055
|
case "rules": {
|
|
5895
6056
|
telemetry2.trackCliSubcommandRules(args[0] ?? "ls");
|
|
5896
|
-
const rulesFn = (await import("./chunks/rules-
|
|
6057
|
+
const rulesFn = (await import("./chunks/rules-UBSIW5ZQ.js")).default;
|
|
5897
6058
|
const rulesArgs = [...args];
|
|
5898
6059
|
const project = parsedArgs.flags["--project"];
|
|
5899
6060
|
const format4 = parsedArgs.flags["--format"];
|
|
@@ -5907,7 +6068,7 @@ async function alerts(client) {
|
|
|
5907
6068
|
}
|
|
5908
6069
|
default: {
|
|
5909
6070
|
telemetry2.trackCliSubcommandLs(subcommandOriginal);
|
|
5910
|
-
const listFn = (await import("./chunks/list-
|
|
6071
|
+
const listFn = (await import("./chunks/list-IWXFZBH7.js")).default;
|
|
5911
6072
|
return listFn(client, telemetry2);
|
|
5912
6073
|
}
|
|
5913
6074
|
}
|
|
@@ -48278,7 +48439,7 @@ async function metrics(client) {
|
|
|
48278
48439
|
return 0;
|
|
48279
48440
|
}
|
|
48280
48441
|
telemetry2.trackCliSubcommandSchema(subcommandOriginal);
|
|
48281
|
-
const schemaFn = (await import("./chunks/schema-
|
|
48442
|
+
const schemaFn = (await import("./chunks/schema-I4SXEWLS.js")).default;
|
|
48282
48443
|
return schemaFn(client, telemetry2);
|
|
48283
48444
|
}
|
|
48284
48445
|
default: {
|
|
@@ -48291,7 +48452,7 @@ async function metrics(client) {
|
|
|
48291
48452
|
output_manager_default.print(help(metricsCommand, { columns: client.stderr.columns }));
|
|
48292
48453
|
return 2;
|
|
48293
48454
|
}
|
|
48294
|
-
const queryFn = (await import("./chunks/query-
|
|
48455
|
+
const queryFn = (await import("./chunks/query-K2TJKOAL.js")).default;
|
|
48295
48456
|
return queryFn(client, telemetry2);
|
|
48296
48457
|
}
|
|
48297
48458
|
}
|
|
@@ -58871,7 +59032,7 @@ async function main26(client) {
|
|
|
58871
59032
|
return 2;
|
|
58872
59033
|
}
|
|
58873
59034
|
telemetry2.trackCliSubcommandEdit(subcommandOriginal);
|
|
58874
|
-
return (await import("./chunks/edit-
|
|
59035
|
+
return (await import("./chunks/edit-UM6TWX2Z.js")).default(client, args);
|
|
58875
59036
|
case "delete":
|
|
58876
59037
|
if (needHelp) {
|
|
58877
59038
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -58879,7 +59040,7 @@ async function main26(client) {
|
|
|
58879
59040
|
return 2;
|
|
58880
59041
|
}
|
|
58881
59042
|
telemetry2.trackCliSubcommandDelete(subcommandOriginal);
|
|
58882
|
-
return (await import("./chunks/delete-
|
|
59043
|
+
return (await import("./chunks/delete-OXEMVOQE.js")).default(client, args);
|
|
58883
59044
|
case "enable":
|
|
58884
59045
|
if (needHelp) {
|
|
58885
59046
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -58887,7 +59048,7 @@ async function main26(client) {
|
|
|
58887
59048
|
return 2;
|
|
58888
59049
|
}
|
|
58889
59050
|
telemetry2.trackCliSubcommandEnable(subcommandOriginal);
|
|
58890
|
-
return (await import("./chunks/enable-
|
|
59051
|
+
return (await import("./chunks/enable-3SH6X23Z.js")).default(client, args);
|
|
58891
59052
|
case "disable":
|
|
58892
59053
|
if (needHelp) {
|
|
58893
59054
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -58895,7 +59056,7 @@ async function main26(client) {
|
|
|
58895
59056
|
return 2;
|
|
58896
59057
|
}
|
|
58897
59058
|
telemetry2.trackCliSubcommandDisable(subcommandOriginal);
|
|
58898
|
-
return (await import("./chunks/disable-
|
|
59059
|
+
return (await import("./chunks/disable-DZA53CJA.js")).default(client, args);
|
|
58899
59060
|
case "reorder":
|
|
58900
59061
|
if (needHelp) {
|
|
58901
59062
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -58903,7 +59064,7 @@ async function main26(client) {
|
|
|
58903
59064
|
return 2;
|
|
58904
59065
|
}
|
|
58905
59066
|
telemetry2.trackCliSubcommandReorder(subcommandOriginal);
|
|
58906
|
-
return (await import("./chunks/reorder-
|
|
59067
|
+
return (await import("./chunks/reorder-J6OONT76.js")).default(client, args);
|
|
58907
59068
|
case "export":
|
|
58908
59069
|
if (needHelp) {
|
|
58909
59070
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -58911,7 +59072,7 @@ async function main26(client) {
|
|
|
58911
59072
|
return 2;
|
|
58912
59073
|
}
|
|
58913
59074
|
telemetry2.trackCliSubcommandExport(subcommandOriginal);
|
|
58914
|
-
return (await import("./chunks/export-
|
|
59075
|
+
return (await import("./chunks/export-TLQERLQP.js")).default(client, args);
|
|
58915
59076
|
case "publish":
|
|
58916
59077
|
if (needHelp) {
|
|
58917
59078
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -58919,7 +59080,7 @@ async function main26(client) {
|
|
|
58919
59080
|
return 2;
|
|
58920
59081
|
}
|
|
58921
59082
|
telemetry2.trackCliSubcommandPublish(subcommandOriginal);
|
|
58922
|
-
return (await import("./chunks/publish-
|
|
59083
|
+
return (await import("./chunks/publish-LWCEDLGX.js")).default(client, args);
|
|
58923
59084
|
case "restore":
|
|
58924
59085
|
if (needHelp) {
|
|
58925
59086
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -58927,7 +59088,7 @@ async function main26(client) {
|
|
|
58927
59088
|
return 2;
|
|
58928
59089
|
}
|
|
58929
59090
|
telemetry2.trackCliSubcommandRestore(subcommandOriginal);
|
|
58930
|
-
return (await import("./chunks/restore-
|
|
59091
|
+
return (await import("./chunks/restore-3ME4ZHFW.js")).default(client, args);
|
|
58931
59092
|
case "discard-staging":
|
|
58932
59093
|
if (needHelp) {
|
|
58933
59094
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -58935,7 +59096,7 @@ async function main26(client) {
|
|
|
58935
59096
|
return 2;
|
|
58936
59097
|
}
|
|
58937
59098
|
telemetry2.trackCliSubcommandDiscardStaging(subcommandOriginal);
|
|
58938
|
-
return (await import("./chunks/discard-
|
|
59099
|
+
return (await import("./chunks/discard-3E7Z7CKD.js")).default(client, args);
|
|
58939
59100
|
default:
|
|
58940
59101
|
output_manager_default.error(getInvalidSubcommand(COMMAND_CONFIG41));
|
|
58941
59102
|
output_manager_default.print(help(routesCommand, { columns: client.stderr.columns }));
|
|
@@ -63546,25 +63707,25 @@ async function vcr(client) {
|
|
|
63546
63707
|
switch (subcommand) {
|
|
63547
63708
|
case "ls":
|
|
63548
63709
|
telemetry2.trackCliSubcommandLs(subcommandOriginal);
|
|
63549
|
-
return (await import("./chunks/ls-
|
|
63710
|
+
return (await import("./chunks/ls-FQIWFI4K.js")).default(client, args, telemetry2);
|
|
63550
63711
|
case "inspect":
|
|
63551
63712
|
telemetry2.trackCliSubcommandInspect(subcommandOriginal);
|
|
63552
|
-
return (await import("./chunks/inspect-
|
|
63713
|
+
return (await import("./chunks/inspect-QW6RSV7Z.js")).default(client, args, telemetry2);
|
|
63553
63714
|
case "add":
|
|
63554
63715
|
telemetry2.trackCliSubcommandAdd(subcommandOriginal);
|
|
63555
|
-
return (await import("./chunks/add-
|
|
63716
|
+
return (await import("./chunks/add-DVEAUH7N.js")).default(client, args, telemetry2);
|
|
63556
63717
|
case "rm":
|
|
63557
63718
|
telemetry2.trackCliSubcommandRm(subcommandOriginal);
|
|
63558
|
-
return (await import("./chunks/rm-
|
|
63719
|
+
return (await import("./chunks/rm-63AGQFIQ.js")).default(client, args, telemetry2);
|
|
63559
63720
|
case "login":
|
|
63560
63721
|
telemetry2.trackCliSubcommandLogin(subcommandOriginal);
|
|
63561
|
-
return (await import("./chunks/login-
|
|
63722
|
+
return (await import("./chunks/login-S77F2DLW.js")).default(client, args, telemetry2);
|
|
63562
63723
|
case "tag":
|
|
63563
63724
|
telemetry2.trackCliSubcommandTag(subcommandOriginal);
|
|
63564
|
-
return (await import("./chunks/tags-
|
|
63725
|
+
return (await import("./chunks/tags-HF2YOQ4V.js")).default(client, args, telemetry2);
|
|
63565
63726
|
case "image":
|
|
63566
63727
|
telemetry2.trackCliSubcommandImage(subcommandOriginal);
|
|
63567
|
-
return (await import("./chunks/image-
|
|
63728
|
+
return (await import("./chunks/image-YKGEEC2A.js")).default(client, args, telemetry2);
|
|
63568
63729
|
default:
|
|
63569
63730
|
output_manager_default.error(getInvalidSubcommand(COMMAND_CONFIG47));
|
|
63570
63731
|
output_manager_default.print(help(vcrCommand, { columns: client.stderr.columns }));
|
package/dist/index.js
CHANGED
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
require_ci_info,
|
|
19
19
|
setAutoUpdate,
|
|
20
20
|
tryOpenApiFallback
|
|
21
|
-
} from "./chunks/chunk-
|
|
21
|
+
} from "./chunks/chunk-TVLLFY7M.js";
|
|
22
22
|
import {
|
|
23
23
|
getUpdateCommand
|
|
24
|
-
} from "./chunks/chunk-
|
|
24
|
+
} from "./chunks/chunk-BFFE4FAO.js";
|
|
25
25
|
import {
|
|
26
26
|
Client,
|
|
27
27
|
getAuthConfigFilePath,
|
|
@@ -30,14 +30,14 @@ import {
|
|
|
30
30
|
readAuthConfigFile,
|
|
31
31
|
readConfigFile,
|
|
32
32
|
writeToConfigFile
|
|
33
|
-
} from "./chunks/chunk-
|
|
33
|
+
} from "./chunks/chunk-3OZQ7KHZ.js";
|
|
34
34
|
import {
|
|
35
35
|
highlight
|
|
36
36
|
} from "./chunks/chunk-V5P25P7F.js";
|
|
37
37
|
import {
|
|
38
38
|
commandNames,
|
|
39
39
|
commands
|
|
40
|
-
} from "./chunks/chunk-
|
|
40
|
+
} from "./chunks/chunk-2CEGMXO6.js";
|
|
41
41
|
import "./chunks/chunk-3VS4DTAU.js";
|
|
42
42
|
import "./chunks/chunk-GIL3VAUR.js";
|
|
43
43
|
import "./chunks/chunk-FYQPTH5C.js";
|
|
@@ -51,8 +51,8 @@ import "./chunks/chunk-LHFNIZ2P.js";
|
|
|
51
51
|
import {
|
|
52
52
|
require_semver
|
|
53
53
|
} from "./chunks/chunk-IB5L4LKZ.js";
|
|
54
|
-
import "./chunks/chunk-
|
|
55
|
-
import "./chunks/chunk-
|
|
54
|
+
import "./chunks/chunk-QW4XUBC3.js";
|
|
55
|
+
import "./chunks/chunk-BZXHF66T.js";
|
|
56
56
|
import "./chunks/chunk-DMSLNAVH.js";
|
|
57
57
|
import "./chunks/chunk-NZRWTCRM.js";
|
|
58
58
|
import {
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
readJSONFile,
|
|
67
67
|
require_dist as require_dist2,
|
|
68
68
|
require_lib
|
|
69
|
-
} from "./chunks/chunk-
|
|
69
|
+
} from "./chunks/chunk-HZAINEXG.js";
|
|
70
70
|
import "./chunks/chunk-UDWRZXIT.js";
|
|
71
71
|
import {
|
|
72
72
|
TelemetryClient,
|
package/dist/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "56.3.
|
|
1
|
+
export const version = "56.3.2";
|