@openape/apes 0.17.0 → 0.18.0

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
@@ -12,11 +12,9 @@ import {
12
12
  checkSudoRejection,
13
13
  isApesSelfDispatch,
14
14
  notifyGrantPending
15
- } from "./chunk-OFIVF6NH.js";
15
+ } from "./chunk-EDYICCBC.js";
16
16
  import {
17
- ApiError,
18
17
  GENERIC_OPERATION_ID,
19
- apiFetch,
20
18
  buildGenericResolved,
21
19
  buildStructuredCliGrantRequest,
22
20
  createShapesGrant,
@@ -28,10 +26,6 @@ import {
28
26
  findAdapter,
29
27
  findConflictingAdapters,
30
28
  findExistingGrant,
31
- getAgentAuthenticateEndpoint,
32
- getAgentChallengeEndpoint,
33
- getDelegationsEndpoint,
34
- getGrantsEndpoint,
35
29
  getInstalledDigest,
36
30
  installAdapter,
37
31
  isInstalled,
@@ -46,7 +40,15 @@ import {
46
40
  searchAdapters,
47
41
  verifyAndExecute,
48
42
  waitForGrantStatus
49
- } from "./chunk-O7GSG3OE.js";
43
+ } from "./chunk-IT6T6AKX.js";
44
+ import {
45
+ ApiError,
46
+ apiFetch,
47
+ getAgentAuthenticateEndpoint,
48
+ getAgentChallengeEndpoint,
49
+ getDelegationsEndpoint,
50
+ getGrantsEndpoint
51
+ } from "./chunk-7NUT2PFT.js";
50
52
  import {
51
53
  AUTH_FILE,
52
54
  CONFIG_DIR,
@@ -58,7 +60,7 @@ import {
58
60
  loadConfig,
59
61
  saveAuth,
60
62
  saveConfig
61
- } from "./chunk-6GPSKAMU.js";
63
+ } from "./chunk-IDPV5SNB.js";
62
64
 
63
65
  // src/cli.ts
64
66
  import consola33 from "consola";
@@ -462,7 +464,7 @@ var whoamiCommand = defineCommand3({
462
464
  console.log(`IdP: ${auth.idp}`);
463
465
  console.log(`Token: ${isExpired ? "\u26A0 EXPIRED" : "valid"} (until ${expiresAt})`);
464
466
  if (isExpired) {
465
- consola4.warn("Token is expired. Run `apes login` to re-authenticate.");
467
+ consola4.warn("Token is expired and could not be auto-refreshed. Run `apes login` to re-authenticate.");
466
468
  }
467
469
  }
468
470
  });
@@ -3699,7 +3701,7 @@ var mcpCommand = defineCommand32({
3699
3701
  if (transport !== "stdio" && transport !== "sse") {
3700
3702
  throw new Error('Transport must be "stdio" or "sse"');
3701
3703
  }
3702
- const { startMcpServer } = await import("./server-YGRMW3OW.js");
3704
+ const { startMcpServer } = await import("./server-RPC46G4J.js");
3703
3705
  await startMcpServer(transport, port);
3704
3706
  }
3705
3707
  });
@@ -4267,7 +4269,7 @@ async function bestEffortGrantCount(idp) {
4267
4269
  }
4268
4270
  }
4269
4271
  async function runHealth(args) {
4270
- const version = true ? "0.17.0" : "0.0.0";
4272
+ const version = true ? "0.18.0" : "0.0.0";
4271
4273
  const auth = loadAuth();
4272
4274
  if (!auth) {
4273
4275
  throw new CliError("Not logged in. Run `apes login` first.", 1);
@@ -4469,10 +4471,10 @@ if (shellRewrite) {
4469
4471
  if (shellRewrite.action === "rewrite") {
4470
4472
  process.argv = shellRewrite.argv;
4471
4473
  } else if (shellRewrite.action === "version") {
4472
- console.log(`ape-shell ${"0.17.0"} (OpenApe DDISA shell wrapper)`);
4474
+ console.log(`ape-shell ${"0.18.0"} (OpenApe DDISA shell wrapper)`);
4473
4475
  process.exit(0);
4474
4476
  } else if (shellRewrite.action === "help") {
4475
- console.log(`ape-shell ${"0.17.0"} \u2014 OpenApe DDISA shell wrapper`);
4477
+ console.log(`ape-shell ${"0.18.0"} \u2014 OpenApe DDISA shell wrapper`);
4476
4478
  console.log("");
4477
4479
  console.log("Usage:");
4478
4480
  console.log(" ape-shell Start interactive grant-mediated REPL");
@@ -4487,7 +4489,7 @@ if (shellRewrite) {
4487
4489
  console.log(" --help, -h Show this help message");
4488
4490
  process.exit(0);
4489
4491
  } else if (shellRewrite.action === "interactive") {
4490
- const { runInteractiveShell } = await import("./orchestrator-PUAO57CY.js");
4492
+ const { runInteractiveShell } = await import("./orchestrator-FJVDWH45.js");
4491
4493
  await runInteractiveShell();
4492
4494
  process.exit(0);
4493
4495
  } else {
@@ -4530,7 +4532,7 @@ var configCommand = defineCommand41({
4530
4532
  var main = defineCommand41({
4531
4533
  meta: {
4532
4534
  name: "apes",
4533
- version: "0.17.0",
4535
+ version: "0.18.0",
4534
4536
  description: "Unified CLI for OpenApe"
4535
4537
  },
4536
4538
  subCommands: {
@@ -4556,6 +4558,34 @@ var main = defineCommand41({
4556
4558
  workflows: workflowsCommand
4557
4559
  }
4558
4560
  });
4561
+ var NO_REFRESH_COMMANDS = /* @__PURE__ */ new Set([
4562
+ "login",
4563
+ "logout",
4564
+ "init",
4565
+ "enroll",
4566
+ "register-user",
4567
+ "dns-check",
4568
+ "utils",
4569
+ "explain",
4570
+ "workflows",
4571
+ "--help",
4572
+ "-h",
4573
+ "help",
4574
+ "--version",
4575
+ "-v"
4576
+ ]);
4577
+ async function maybeRefreshAuth() {
4578
+ const sub = process.argv[2];
4579
+ if (!sub || NO_REFRESH_COMMANDS.has(sub)) return;
4580
+ const { loadAuth: loadAuth2 } = await import("./config-JH2IEPIR.js");
4581
+ if (!loadAuth2()) return;
4582
+ try {
4583
+ const { ensureFreshToken } = await import("./http-JZT4XV5I.js");
4584
+ await ensureFreshToken();
4585
+ } catch {
4586
+ }
4587
+ }
4588
+ await maybeRefreshAuth();
4559
4589
  runMain(main).catch((err) => {
4560
4590
  if (err instanceof CliExit) {
4561
4591
  process.exit(err.exitCode);