apiblaze 0.20.21 → 0.20.26

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.
Files changed (2) hide show
  1. package/dist/index.js +26 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1024,7 +1024,7 @@ var import_commander = require("commander");
1024
1024
  var import_chalk54 = __toESM(require("chalk"));
1025
1025
 
1026
1026
  // package.json
1027
- var version = "0.20.21";
1027
+ var version = "0.20.26";
1028
1028
 
1029
1029
  // src/index.ts
1030
1030
  init_types();
@@ -2493,12 +2493,12 @@ function installIntoCodex(spec2) {
2493
2493
  }
2494
2494
  }
2495
2495
  function codexOneShot(_spec, prompt) {
2496
- const argv = ["codex", "exec", prompt];
2496
+ const argv = ["codex", "exec", "--skip-git-repo-check", prompt];
2497
2497
  const r = run(argv[0], argv.slice(1), { inherit: true });
2498
2498
  return { argv, status: r.status };
2499
2499
  }
2500
2500
  function codexInteractive(_spec, prompt) {
2501
- const argv = ["codex", prompt];
2501
+ const argv = ["codex", "--skip-git-repo-check", prompt];
2502
2502
  const r = run(argv[0], argv.slice(1), { interactive: true });
2503
2503
  return { argv, status: r.status };
2504
2504
  }
@@ -2575,7 +2575,7 @@ async function installAndDemo(cli, spec2, getQuestion, log = console.log) {
2575
2575
  const ask = handoff ? cli.kind === "claude" ? claudeInteractive : codexInteractive : oneShot;
2576
2576
  log(`
2577
2577
  ${import_chalk12.default.dim(handoff ? `Opening ${cli.label} with your question \u2014 you'll stay in that session:` : `Your question, through ${cli.label}:`)}`);
2578
- const shown = cli.kind === "claude" ? handoff ? ["claude", question, "--allowedTools", `mcp__${spec2.name}__*`] : ["claude", "-p", question, "--allowedTools", `mcp__${spec2.name}__*`] : handoff ? ["codex", question] : ["codex", "exec", question];
2578
+ const shown = cli.kind === "claude" ? handoff ? ["claude", question, "--allowedTools", `mcp__${spec2.name}__*`] : ["claude", "-p", question, "--allowedTools", `mcp__${spec2.name}__*`] : handoff ? ["codex", "--skip-git-repo-check", question] : ["codex", "exec", "--skip-git-repo-check", question];
2579
2579
  log(` ${import_chalk12.default.dim("$")} ${renderCommand(shown)}
2580
2580
  `);
2581
2581
  const ans = ask(spec2, question);
@@ -3751,7 +3751,12 @@ async function openServerProxy(project) {
3751
3751
  proxyUrl: `https://${project.projectId}.abz.run/${version2}/${environment}`,
3752
3752
  anon: false,
3753
3753
  // Reusing an owned proxy: logged-in apichat doors default to invite-only.
3754
- access: "invite"
3754
+ access: "invite",
3755
+ // Identity domain — needed to authorize an external client's registration
3756
+ // (and by anything else that acts on the tenant). Dropping these made the
3757
+ // registration authorization silently skip.
3758
+ tenant: tenant2,
3759
+ teamId: project.teamId
3755
3760
  };
3756
3761
  const spinner = (0, import_ora4.default)("Preparing the chat\u2026").start();
3757
3762
  try {
@@ -3925,7 +3930,12 @@ async function noArgsMenu(opts) {
3925
3930
  proxyUrl: void 0,
3926
3931
  anon: a.anon,
3927
3932
  // Saved sessions predate the access field: mirror the provisioning default.
3928
- access: a.anon ? "open" : "invite"
3933
+ access: a.anon ? "open" : "invite",
3934
+ // The tenant we just re-derived above (and the owning team): without them
3935
+ // the registration authorization can't name a tenant and silently skips.
3936
+ tenant: savedTenant,
3937
+ teamId: resumeTeamId,
3938
+ endUserId: a.endUserId
3929
3939
  };
3930
3940
  return { p, messages };
3931
3941
  }
@@ -4109,13 +4119,16 @@ async function maybeInstallExternalCli(p, opts) {
4109
4119
  }
4110
4120
  }
4111
4121
  const pending = clis.filter((c) => !offer[c.kind]);
4112
- if (pending.length === 0) return false;
4122
+ const anyInstalled = clis.some((c) => offer[c.kind] === "installed");
4113
4123
  const { default: inquirer3 } = await import("inquirer");
4114
4124
  const names = clis.map((c) => c.label).join(" and ");
4115
4125
  const targetName = clis.length > 1 ? "one of them" : clis[0].label;
4116
4126
  const { pick: pick2 } = await inquirer3.prompt([{
4117
4127
  type: "list",
4118
4128
  name: "pick",
4129
+ // Already wired up? Default to chatting here — they came to ask something,
4130
+ // not to re-install. Otherwise default to the first client not yet offered.
4131
+ default: anyInstalled || pending.length === 0 ? "here" : pending[0],
4119
4132
  message: `I see ${names} ${clis.length > 1 ? "are" : "is"} installed on this computer. Do you want to add the MCP for this proxy to ${targetName} so you can chat with your API from there directly, or chat here directly?`,
4120
4133
  choices: [
4121
4134
  ...clis.map((c) => ({
@@ -4157,10 +4170,15 @@ async function authorizeClientRegistration(p, cliLabel) {
4157
4170
  if (!p.consumerAuth) return;
4158
4171
  const teamId = p.teamId ?? loadCredentials()?.teamId;
4159
4172
  const tenant2 = p.tenant;
4160
- if (!teamId || !tenant2) return;
4173
+ if (!teamId || !tenant2) {
4174
+ console.log(import_chalk14.default.dim(` (Can't pre-authorize ${cliLabel}'s registration \u2014 tenant unknown for this proxy. If sign-in says the app needs verifying: apiblaze allowoauthregistration --tenant <slug>, then retry.)`));
4175
+ return;
4176
+ }
4161
4177
  const ok = await openRegistrationAuthorization(teamId, tenant2, 600);
4162
4178
  if (ok) {
4163
4179
  console.log(import_chalk14.default.dim(` Authorized ${cliLabel}'s sign-in registration on tenant ${import_chalk14.default.bold(tenant2)} (single use).`));
4180
+ } else {
4181
+ console.log(import_chalk14.default.yellow(` Could not pre-authorize the registration on ${tenant2} \u2014 if sign-in says the app needs verifying, run: apiblaze allowoauthregistration --tenant ${tenant2}`));
4164
4182
  }
4165
4183
  }
4166
4184
  async function ensureInstallableDoor(p, opts) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apiblaze",
3
- "version": "0.20.21",
3
+ "version": "0.20.26",
4
4
  "description": "APIblaze CLI — Chat with your APIs, Manage your API keys, users and groups with the APIblaze serverless proxy",
5
5
  "keywords": [
6
6
  "apiblaze",