@abloatai/ablo 0.29.1 → 0.29.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.29.2
4
+
5
+ ### Patch Changes
6
+
7
+ - **Switching to a project you never minted a key for no longer locks you out.** Project-management commands — `ablo projects list`, `create`, `rename`, and `use` — are organization-level operations, so they now accept any of the organization's stored keys (the active project's key first, then the `default` profile, then any profile still holding an unexpired key) instead of strictly the active project's key. Selecting a keyless project could previously leave `ablo projects use default` unauthorized — the one command that would undo the switch. Data commands keep the strict resolver, so this permissive fallback never routes a read or write through an unintended project.
8
+
3
9
  ## 0.29.1
4
10
 
5
11
  ### Patch Changes
package/dist/cli.cjs CHANGED
@@ -280044,6 +280044,20 @@ function resolveApiKey(modeOverride) {
280044
280044
  if (entry.expiresAt && Date.parse(entry.expiresAt) <= Date.now()) return void 0;
280045
280045
  return entry.apiKey;
280046
280046
  }
280047
+ function resolveOrgKey(modeOverride) {
280048
+ if (process.env.ABLO_API_KEY) return process.env.ABLO_API_KEY;
280049
+ const cfg = readConfig();
280050
+ if (!cfg) return void 0;
280051
+ const mode2 = modeOverride ?? cfg.mode;
280052
+ const order = [.../* @__PURE__ */ new Set([activeProfileName(cfg), DEFAULT_PROFILE, ...Object.keys(cfg.profiles)])];
280053
+ for (const name of order) {
280054
+ const entry = cfg.profiles[name]?.[mode2];
280055
+ if (!entry) continue;
280056
+ if (entry.expiresAt && Date.parse(entry.expiresAt) <= Date.now()) continue;
280057
+ return entry.apiKey;
280058
+ }
280059
+ return void 0;
280060
+ }
280047
280061
  function guardActiveProjectKey() {
280048
280062
  if (process.env.ABLO_API_KEY) {
280049
280063
  return { ok: true, activeProfile: DEFAULT_PROFILE, available: [] };
@@ -280254,7 +280268,7 @@ function apiUrl() {
280254
280268
  return (process.env.ABLO_API_URL ?? ABLO_DEFAULT_BASE_URL).replace(/\/+$/, "");
280255
280269
  }
280256
280270
  function requireKey() {
280257
- const apiKey = resolveApiKey();
280271
+ const apiKey = resolveOrgKey();
280258
280272
  if (!apiKey) {
280259
280273
  console.error(
280260
280274
  import_picocolors3.default.red(" No API key.") + import_picocolors3.default.dim(
@@ -280460,7 +280474,7 @@ async function resolveTarget(opts) {
280460
280474
  keyEnv,
280461
280475
  confirmed,
280462
280476
  localProject,
280463
- mismatches: reconcile({ confirmed, keyEnv, localProject })
280477
+ mismatches: reconcile({ confirmed, keyEnv, localProject, cliMode: getMode() })
280464
280478
  };
280465
280479
  }
280466
280480
  async function confirmFromServer(opts) {
@@ -280505,10 +280519,9 @@ function confirmedProjectSlug(project) {
280505
280519
  return project.isDefault ? DEFAULT_PROJECT_SLUG : project.slug;
280506
280520
  }
280507
280521
  function reconcile(input) {
280508
- const { confirmed, keyEnv, localProject } = input;
280522
+ const { confirmed, keyEnv, localProject, cliMode } = input;
280509
280523
  const mismatches = [];
280510
280524
  const realEnv = confirmed?.environment ?? keyEnv;
280511
- const cliMode = getMode();
280512
280525
  if (realEnv && realEnv !== cliMode) {
280513
280526
  mismatches.push({ kind: "environment", keyEnv: realEnv, cliMode });
280514
280527
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abloatai/ablo",
3
- "version": "0.29.1",
3
+ "version": "0.29.2",
4
4
  "description": "The Collaboration Layer For AI Agents",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",