@openape/apes 0.14.0 → 0.14.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
@@ -2461,15 +2461,7 @@ import { defineCommand as defineCommand22 } from "citty";
2461
2461
  import consola20 from "consola";
2462
2462
 
2463
2463
  // src/proxy/config.ts
2464
- import { homedir as homedir4 } from "os";
2465
- import { join as join2 } from "path";
2466
- function defaultAuditPath() {
2467
- const xdg = process.env.XDG_STATE_HOME;
2468
- const stateDir = xdg && xdg.length > 0 ? xdg : join2(homedir4(), ".local", "state");
2469
- return join2(stateDir, "openape", "proxy-audit.jsonl");
2470
- }
2471
2464
  function buildDefaultProxyConfigToml(opts) {
2472
- const auditPath = defaultAuditPath();
2473
2465
  const defaultAction = opts.mediated ? "request" : "allow";
2474
2466
  const escEmail = opts.agentEmail.replace(/"/g, '\\"');
2475
2467
  const escIdp = opts.idpUrl.replace(/"/g, '\\"');
@@ -2481,7 +2473,6 @@ listen = "127.0.0.1:0"
2481
2473
  idp_url = "${escIdp}"
2482
2474
  agent_email = "${escEmail}"
2483
2475
  default_action = "${defaultAction}"
2484
- audit_log = "${auditPath.replace(/"/g, '\\"')}"
2485
2476
 
2486
2477
  # Cloud / link-local metadata endpoints \u2014 never let agent traffic reach these
2487
2478
  # even if a downstream policy mistake would otherwise allow it.
@@ -2504,7 +2495,7 @@ import { spawn } from "child_process";
2504
2495
  import { mkdtempSync, rmSync, writeFileSync } from "fs";
2505
2496
  import { createRequire } from "module";
2506
2497
  import { tmpdir } from "os";
2507
- import { dirname, join as join3, resolve as resolve2 } from "path";
2498
+ import { dirname, join as join2, resolve as resolve2 } from "path";
2508
2499
  var require2 = createRequire(import.meta.url);
2509
2500
  function findProxyBin() {
2510
2501
  const pkgPath = require2.resolve("@openape/proxy/package.json");
@@ -2516,8 +2507,8 @@ function findProxyBin() {
2516
2507
  return resolve2(dirname(pkgPath), binRel);
2517
2508
  }
2518
2509
  async function startEphemeralProxy(configToml) {
2519
- const tmpDir = mkdtempSync(join3(tmpdir(), "openape-proxy-"));
2520
- const configPath = join3(tmpDir, "config.toml");
2510
+ const tmpDir = mkdtempSync(join2(tmpdir(), "openape-proxy-"));
2511
+ const configPath = join2(tmpDir, "config.toml");
2521
2512
  writeFileSync(configPath, configToml, { mode: 384 });
2522
2513
  const binPath = findProxyBin();
2523
2514
  const child = spawn(process.execPath, [binPath, "-c", configPath], {
@@ -2677,7 +2668,7 @@ var proxyCommand = defineCommand22({
2677
2668
  });
2678
2669
  });
2679
2670
  if (close) await close();
2680
- if (exitCode !== 0) throw new CliExit(exitCode);
2671
+ if (exitCode !== 0) process.exit(exitCode);
2681
2672
  }
2682
2673
  });
2683
2674
  function signalNumber(signal) {
@@ -2953,7 +2944,7 @@ var mcpCommand = defineCommand27({
2953
2944
  if (transport !== "stdio" && transport !== "sse") {
2954
2945
  throw new Error('Transport must be "stdio" or "sse"');
2955
2946
  }
2956
- const { startMcpServer } = await import("./server-LU6IBZ76.js");
2947
+ const { startMcpServer } = await import("./server-4K72OKR4.js");
2957
2948
  await startMcpServer(transport, port);
2958
2949
  }
2959
2950
  });
@@ -2962,7 +2953,7 @@ var mcpCommand = defineCommand27({
2962
2953
  import { existsSync as existsSync3, copyFileSync, writeFileSync as writeFileSync2 } from "fs";
2963
2954
  import { randomBytes } from "crypto";
2964
2955
  import { execFileSync as execFileSync3 } from "child_process";
2965
- import { join as join4 } from "path";
2956
+ import { join as join3 } from "path";
2966
2957
  import { defineCommand as defineCommand28 } from "citty";
2967
2958
  import consola23 from "consola";
2968
2959
  var DEFAULT_IDP_URL = "https://id.openape.at";
@@ -2971,7 +2962,7 @@ async function downloadTemplate(repo, targetDir) {
2971
2962
  await gigetDownload(`gh:${repo}`, { dir: targetDir, force: false });
2972
2963
  }
2973
2964
  function installDeps(dir) {
2974
- const hasLockFile = (name) => existsSync3(join4(dir, name));
2965
+ const hasLockFile = (name) => existsSync3(join3(dir, name));
2975
2966
  if (hasLockFile("pnpm-lock.yaml")) {
2976
2967
  execFileSync3("pnpm", ["install"], { cwd: dir, stdio: "inherit" });
2977
2968
  } else if (hasLockFile("bun.lockb")) {
@@ -3036,7 +3027,7 @@ var initCommand = defineCommand28({
3036
3027
  });
3037
3028
  async function initSP(targetDir) {
3038
3029
  const dir = targetDir || "my-app";
3039
- if (existsSync3(join4(dir, "package.json"))) {
3030
+ if (existsSync3(join3(dir, "package.json"))) {
3040
3031
  throw new CliError(`Directory "${dir}" already contains a project.`);
3041
3032
  }
3042
3033
  consola23.start("Scaffolding SP starter...");
@@ -3045,8 +3036,8 @@ async function initSP(targetDir) {
3045
3036
  consola23.start("Installing dependencies...");
3046
3037
  installDeps(dir);
3047
3038
  consola23.success("Dependencies installed");
3048
- const envExample = join4(dir, ".env.example");
3049
- const envFile = join4(dir, ".env");
3039
+ const envExample = join3(dir, ".env.example");
3040
+ const envFile = join3(dir, ".env");
3050
3041
  if (existsSync3(envExample) && !existsSync3(envFile)) {
3051
3042
  copyFileSync(envExample, envFile);
3052
3043
  consola23.success(`\`.env\` created (using Free IdP at ${DEFAULT_IDP_URL})`);
@@ -3061,7 +3052,7 @@ async function initSP(targetDir) {
3061
3052
  }
3062
3053
  async function initIdP(targetDir) {
3063
3054
  const dir = targetDir || "my-idp";
3064
- if (existsSync3(join4(dir, "package.json"))) {
3055
+ if (existsSync3(join3(dir, "package.json"))) {
3065
3056
  throw new CliError(`Directory "${dir}" already contains a project.`);
3066
3057
  }
3067
3058
  const domain = await promptText("Domain for the IdP", "localhost");
@@ -3093,7 +3084,7 @@ async function initIdP(targetDir) {
3093
3084
  `NUXT_OPENAPE_RP_ID=${domain}`,
3094
3085
  `NUXT_OPENAPE_RP_ORIGIN=${origin}`
3095
3086
  ].join("\n");
3096
- writeFileSync2(join4(dir, ".env"), `${envContent}
3087
+ writeFileSync2(join3(dir, ".env"), `${envContent}
3097
3088
  `, { mode: 384 });
3098
3089
  consola23.success(".env created");
3099
3090
  console.log("");
@@ -3118,7 +3109,7 @@ import { existsSync as existsSync4, readFileSync as readFileSync2, writeFileSync
3118
3109
  import { execFile as execFile2 } from "child_process";
3119
3110
  import { generateKeyPairSync, sign } from "crypto";
3120
3111
  import { dirname as dirname2, resolve as resolve3 } from "path";
3121
- import { homedir as homedir5 } from "os";
3112
+ import { homedir as homedir4 } from "os";
3122
3113
  import { defineCommand as defineCommand29 } from "citty";
3123
3114
  import consola24 from "consola";
3124
3115
  var DEFAULT_IDP_URL2 = "https://id.openape.at";
@@ -3126,7 +3117,7 @@ var DEFAULT_KEY_PATH = "~/.ssh/id_ed25519";
3126
3117
  var POLL_INTERVAL = 3e3;
3127
3118
  var POLL_TIMEOUT = 3e5;
3128
3119
  function resolvePath2(p) {
3129
- return resolve3(p.replace(/^~/, homedir5()));
3120
+ return resolve3(p.replace(/^~/, homedir4()));
3130
3121
  }
3131
3122
  function openBrowser2(url) {
3132
3123
  const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
@@ -3445,7 +3436,7 @@ async function bestEffortGrantCount(idp) {
3445
3436
  }
3446
3437
  }
3447
3438
  async function runHealth(args) {
3448
- const version = true ? "0.14.0" : "0.0.0";
3439
+ const version = true ? "0.14.2" : "0.0.0";
3449
3440
  const auth = loadAuth();
3450
3441
  if (!auth) {
3451
3442
  throw new CliError("Not logged in. Run `apes login` first.", 1);
@@ -3647,10 +3638,10 @@ if (shellRewrite) {
3647
3638
  if (shellRewrite.action === "rewrite") {
3648
3639
  process.argv = shellRewrite.argv;
3649
3640
  } else if (shellRewrite.action === "version") {
3650
- console.log(`ape-shell ${"0.14.0"} (OpenApe DDISA shell wrapper)`);
3641
+ console.log(`ape-shell ${"0.14.2"} (OpenApe DDISA shell wrapper)`);
3651
3642
  process.exit(0);
3652
3643
  } else if (shellRewrite.action === "help") {
3653
- console.log(`ape-shell ${"0.14.0"} \u2014 OpenApe DDISA shell wrapper`);
3644
+ console.log(`ape-shell ${"0.14.2"} \u2014 OpenApe DDISA shell wrapper`);
3654
3645
  console.log("");
3655
3646
  console.log("Usage:");
3656
3647
  console.log(" ape-shell Start interactive grant-mediated REPL");
@@ -3708,7 +3699,7 @@ var configCommand = defineCommand34({
3708
3699
  var main = defineCommand34({
3709
3700
  meta: {
3710
3701
  name: "apes",
3711
- version: "0.14.0",
3702
+ version: "0.14.2",
3712
3703
  description: "Unified CLI for OpenApe"
3713
3704
  },
3714
3705
  subCommands: {