@openape/apes 0.21.0 → 0.21.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/cli.js
CHANGED
|
@@ -2091,6 +2091,11 @@ var destroyAgentCommand = defineCommand20({
|
|
|
2091
2091
|
}
|
|
2092
2092
|
consola18.warn(`About to destroy "${name}":
|
|
2093
2093
|
${consequences.join("\n")}`);
|
|
2094
|
+
if (!process.stdin.isTTY) {
|
|
2095
|
+
throw new CliError(
|
|
2096
|
+
"No TTY available for the interactive confirmation. Re-run with --force to skip the prompt (this is the same flag CI uses)."
|
|
2097
|
+
);
|
|
2098
|
+
}
|
|
2094
2099
|
const confirmed = await consola18.prompt("Proceed?", { type: "confirm", initial: false });
|
|
2095
2100
|
if (typeof confirmed === "symbol" || !confirmed) {
|
|
2096
2101
|
throw new CliExit(0);
|
|
@@ -3231,14 +3236,17 @@ async function runAudienceMode(audience, action, args) {
|
|
|
3231
3236
|
throw new CliExit(getAsyncExitCode());
|
|
3232
3237
|
}
|
|
3233
3238
|
consola23.success(`Grant requested: ${grant.id}`);
|
|
3239
|
+
consola23.info(`Approve at: ${idp}/grant-approval?grant_id=${grant.id}`);
|
|
3234
3240
|
consola23.info("Waiting for approval...");
|
|
3235
|
-
const maxWait =
|
|
3241
|
+
const maxWait = 15 * 60 * 1e3;
|
|
3236
3242
|
const interval = 3e3;
|
|
3237
3243
|
const start = Date.now();
|
|
3244
|
+
let approved = false;
|
|
3238
3245
|
while (Date.now() - start < maxWait) {
|
|
3239
3246
|
const status = await apiFetch(`${grantsUrl}/${grant.id}`);
|
|
3240
3247
|
if (status.status === "approved") {
|
|
3241
3248
|
consola23.success("Grant approved!");
|
|
3249
|
+
approved = true;
|
|
3242
3250
|
break;
|
|
3243
3251
|
}
|
|
3244
3252
|
if (status.status === "denied" || status.status === "revoked") {
|
|
@@ -3246,6 +3254,12 @@ async function runAudienceMode(audience, action, args) {
|
|
|
3246
3254
|
}
|
|
3247
3255
|
await new Promise((r) => setTimeout(r, interval));
|
|
3248
3256
|
}
|
|
3257
|
+
if (!approved) {
|
|
3258
|
+
const minutes = Math.round(maxWait / 6e4);
|
|
3259
|
+
throw new CliError(
|
|
3260
|
+
`Grant approval timed out after ${minutes} min (still pending). Check your DDISA inbox at ${idp}/grant-approval?grant_id=${grant.id} \u2014 if approved later, re-run the same \`apes run\` command and it will reuse the grant.`
|
|
3261
|
+
);
|
|
3262
|
+
}
|
|
3249
3263
|
consola23.info("Fetching grant token...");
|
|
3250
3264
|
const { authz_jwt } = await apiFetch(`${grantsUrl}/${grant.id}/token`, {
|
|
3251
3265
|
method: "POST"
|
|
@@ -3756,7 +3770,7 @@ var mcpCommand = defineCommand32({
|
|
|
3756
3770
|
if (transport !== "stdio" && transport !== "sse") {
|
|
3757
3771
|
throw new Error('Transport must be "stdio" or "sse"');
|
|
3758
3772
|
}
|
|
3759
|
-
const { startMcpServer } = await import("./server-
|
|
3773
|
+
const { startMcpServer } = await import("./server-FO4XBTPU.js");
|
|
3760
3774
|
await startMcpServer(transport, port);
|
|
3761
3775
|
}
|
|
3762
3776
|
});
|
|
@@ -4394,7 +4408,7 @@ async function bestEffortGrantCount(idp) {
|
|
|
4394
4408
|
}
|
|
4395
4409
|
}
|
|
4396
4410
|
async function runHealth(args) {
|
|
4397
|
-
const version = true ? "0.21.
|
|
4411
|
+
const version = true ? "0.21.2" : "0.0.0";
|
|
4398
4412
|
const auth = loadAuth();
|
|
4399
4413
|
if (!auth) {
|
|
4400
4414
|
throw new CliError("Not logged in. Run `apes login` first.", 1);
|
|
@@ -4596,10 +4610,10 @@ if (shellRewrite) {
|
|
|
4596
4610
|
if (shellRewrite.action === "rewrite") {
|
|
4597
4611
|
process.argv = shellRewrite.argv;
|
|
4598
4612
|
} else if (shellRewrite.action === "version") {
|
|
4599
|
-
console.log(`ape-shell ${"0.21.
|
|
4613
|
+
console.log(`ape-shell ${"0.21.2"} (OpenApe DDISA shell wrapper)`);
|
|
4600
4614
|
process.exit(0);
|
|
4601
4615
|
} else if (shellRewrite.action === "help") {
|
|
4602
|
-
console.log(`ape-shell ${"0.21.
|
|
4616
|
+
console.log(`ape-shell ${"0.21.2"} \u2014 OpenApe DDISA shell wrapper`);
|
|
4603
4617
|
console.log("");
|
|
4604
4618
|
console.log("Usage:");
|
|
4605
4619
|
console.log(" ape-shell Start interactive grant-mediated REPL");
|
|
@@ -4657,7 +4671,7 @@ var configCommand = defineCommand44({
|
|
|
4657
4671
|
var main = defineCommand44({
|
|
4658
4672
|
meta: {
|
|
4659
4673
|
name: "apes",
|
|
4660
|
-
version: "0.21.
|
|
4674
|
+
version: "0.21.2",
|
|
4661
4675
|
description: "Unified CLI for OpenApe"
|
|
4662
4676
|
},
|
|
4663
4677
|
subCommands: {
|