@openape/apes 1.8.0 → 1.9.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
@@ -1366,7 +1366,7 @@ var delegateCommand = defineCommand14({
1366
1366
  const body = {
1367
1367
  delegate: args.to,
1368
1368
  audience: args.at,
1369
- approval: args.approval
1369
+ grant_type: args.approval
1370
1370
  };
1371
1371
  if (args.scopes) {
1372
1372
  body.scopes = args.scopes.split(",").map((s) => s.trim());
@@ -2514,15 +2514,20 @@ async function tryDelegatedEnrollToken(idp) {
2514
2514
  const idpUrl = idp ?? auth.idp;
2515
2515
  if (!idpUrl) return null;
2516
2516
  const grantId = await findEnrollDelegationGrantId(idpUrl, ownerEmail, myEmail);
2517
- if (!grantId) return null;
2517
+ if (!grantId) {
2518
+ console.warn(`[agent-bootstrap] no enroll-agent delegation from ${ownerEmail} to ${myEmail} \u2014 falling back to direct enroll`);
2519
+ return null;
2520
+ }
2518
2521
  const result = await exchangeWithDelegation({
2519
2522
  idp: idpUrl,
2520
2523
  actorToken: auth.access_token,
2521
2524
  audience: ENROLL_AUDIENCE,
2522
2525
  delegationGrantId: grantId
2523
2526
  });
2527
+ console.log(`[agent-bootstrap] using delegated token from grant ${grantId} (sub=${ownerEmail}, act=${myEmail})`);
2524
2528
  return result.access_token;
2525
- } catch {
2529
+ } catch (err) {
2530
+ console.warn(`[agent-bootstrap] delegated-enroll exchange failed: ${err instanceof Error ? err.message : String(err)} \u2014 falling back to direct enroll`);
2526
2531
  return null;
2527
2532
  }
2528
2533
  }
@@ -5149,6 +5154,19 @@ function installAdapter2() {
5149
5154
  consola29.success(`Wrote shapes adapter ${target}`);
5150
5155
  return true;
5151
5156
  }
5157
+ function writeBridgeModelDefault(model) {
5158
+ const envDir = join10(homedir11(), "litellm");
5159
+ const envFile = join10(envDir, ".env");
5160
+ mkdirSync5(envDir, { recursive: true });
5161
+ let lines = [];
5162
+ if (existsSync12(envFile)) {
5163
+ lines = readFileSync11(envFile, "utf8").split("\n").filter((l) => !l.startsWith("APE_CHAT_BRIDGE_MODEL="));
5164
+ }
5165
+ lines.push(`APE_CHAT_BRIDGE_MODEL=${model}`);
5166
+ while (lines.length > 0 && lines.at(-1).trim() === "") lines.pop();
5167
+ writeFileSync7(envFile, `${lines.join("\n")}
5168
+ `, { mode: 384 });
5169
+ }
5152
5170
  function findBinary(name) {
5153
5171
  for (const dir of [
5154
5172
  join10(homedir11(), ".bun", "bin"),
@@ -5170,6 +5188,10 @@ var installNestCommand = defineCommand32({
5170
5188
  port: {
5171
5189
  type: "string",
5172
5190
  description: "Port for the nest HTTP API (default: 9091)"
5191
+ },
5192
+ "bridge-model": {
5193
+ type: "string",
5194
+ description: "Default model for chat-bridge spawns. Persisted as APE_CHAT_BRIDGE_MODEL in ~/litellm/.env so every `apes [nest|agents] spawn --bridge` picks it up automatically. Common values: `gpt-5.4` (ChatGPT-only LiteLLM proxy), `claude-haiku-4-5` (Anthropic-only). Re-run install with a new value to overwrite."
5173
5195
  }
5174
5196
  },
5175
5197
  async run({ args }) {
@@ -5184,6 +5206,10 @@ var installNestCommand = defineCommand32({
5184
5206
  consola29.info(` nest binary: ${nestBin}`);
5185
5207
  consola29.info(` apes binary: ${apesBin}`);
5186
5208
  consola29.info(` HTTP port: ${port}`);
5209
+ if (typeof args["bridge-model"] === "string" && args["bridge-model"]) {
5210
+ writeBridgeModelDefault(args["bridge-model"]);
5211
+ consola29.success(`Default bridge model set to ${args["bridge-model"]} (in ~/litellm/.env)`);
5212
+ }
5187
5213
  installAdapter2();
5188
5214
  mkdirSync5(join10(homeDir, "Library", "LaunchAgents"), { recursive: true });
5189
5215
  mkdirSync5(NEST_DATA_DIR, { recursive: true });
@@ -6870,7 +6896,7 @@ var mcpCommand = defineCommand49({
6870
6896
  if (transport !== "stdio" && transport !== "sse") {
6871
6897
  throw new Error('Transport must be "stdio" or "sse"');
6872
6898
  }
6873
- const { startMcpServer } = await import("./server-6B26NNLZ.js");
6899
+ const { startMcpServer } = await import("./server-6WQYPDVO.js");
6874
6900
  await startMcpServer(transport, port);
6875
6901
  }
6876
6902
  });
@@ -7508,7 +7534,7 @@ async function bestEffortGrantCount(idp) {
7508
7534
  }
7509
7535
  }
7510
7536
  async function runHealth(args) {
7511
- const version = true ? "1.8.0" : "0.0.0";
7537
+ const version = true ? "1.9.0" : "0.0.0";
7512
7538
  const auth = loadAuth();
7513
7539
  if (!auth) {
7514
7540
  throw new CliError("Not logged in. Run `apes login` first.", 1);
@@ -7781,10 +7807,10 @@ if (shellRewrite) {
7781
7807
  if (shellRewrite.action === "rewrite") {
7782
7808
  process.argv = shellRewrite.argv;
7783
7809
  } else if (shellRewrite.action === "version") {
7784
- console.log(`ape-shell ${"1.8.0"} (OpenApe DDISA shell wrapper)`);
7810
+ console.log(`ape-shell ${"1.9.0"} (OpenApe DDISA shell wrapper)`);
7785
7811
  process.exit(0);
7786
7812
  } else if (shellRewrite.action === "help") {
7787
- console.log(`ape-shell ${"1.8.0"} \u2014 OpenApe DDISA shell wrapper`);
7813
+ console.log(`ape-shell ${"1.9.0"} \u2014 OpenApe DDISA shell wrapper`);
7788
7814
  console.log("");
7789
7815
  console.log("Usage:");
7790
7816
  console.log(" ape-shell Start interactive grant-mediated REPL");
@@ -7842,7 +7868,7 @@ var configCommand = defineCommand61({
7842
7868
  var main = defineCommand61({
7843
7869
  meta: {
7844
7870
  name: "apes",
7845
- version: "1.8.0",
7871
+ version: "1.9.0",
7846
7872
  description: "Unified CLI for OpenApe"
7847
7873
  },
7848
7874
  subCommands: {
@@ -7899,7 +7925,7 @@ async function maybeRefreshAuth() {
7899
7925
  }
7900
7926
  }
7901
7927
  await maybeRefreshAuth();
7902
- await maybeWarnStaleVersion("1.8.0").catch(() => {
7928
+ await maybeWarnStaleVersion("1.9.0").catch(() => {
7903
7929
  });
7904
7930
  runMain(main).catch((err) => {
7905
7931
  if (err instanceof CliExit) {