@abloatai/ablo 0.29.0 → 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,10 +1,22 @@
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
+
9
+ ## 0.29.1
10
+
11
+ ### Patch Changes
12
+
13
+ - **The `omitModels` doc example uses generic model names.** The schema-projection example in the `omitModels` JSDoc and the API docs now reads `omitModels(full, ['reports', 'reportSections'])` — an illustrative parent/child pair rather than application-specific model names. Documentation only; no API or behavior change.
14
+
3
15
  ## 0.29.0
4
16
 
5
17
  ### Minor Changes
6
18
 
7
- - **`omitModels()` projects a schema by exclusion — the companion to `selectModels`.** Keep every model except the named ones, so one product can be the general case while another product owns the models it drops. The suite shell narrows with `omitModels(full, ['mailMailboxes', 'mailThreads'])` while the mail app selects those same models. Validation matches `selectModels`: relations into the omitted set are dropped, and a dropped `parent` edge throws, so a model whose scope routes through an omitted parent can't be silently kept. Each app now binds its own schema projection rather than sharing one global registration.
19
+ - **`omitModels()` projects a schema by exclusion — the companion to `selectModels`.** Keep every model except the named ones, so one app can be the general case while a separate app owns the models it drops. The suite shell narrows with `omitModels(full, ['reports', 'reportSections'])` while the standalone app selects those same models. Validation matches `selectModels`: relations into the omitted set are dropped, and a dropped `parent` edge throws, so a model whose scope routes through an omitted parent can't be silently kept. Each app now binds its own schema projection rather than sharing one global registration.
8
20
 
9
21
  - **Every application model has one typed access path: `ablo.<model>`.** Both the WebSocket and stateless HTTP clients return bare rows from `retrieve` and accept the same typed create/update/delete forms. The schema-less `Ablo({ schema: null })` overload, the public `.model(name)` accessors, the transport-envelope types, and the hidden capability CRUD client are removed. Select `transport: 'http'` for workers without changing model syntax, use `commits.create` only for atomic multi-row writes, and `sessions.create` to mint a scoped user or agent credential.
10
22
 
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
  }
@@ -25,12 +25,12 @@ import type { Schema, SchemaRecord } from './schema.js';
25
25
  export declare function selectModels<S extends SchemaRecord, K extends keyof S & string>(schema: Schema<S>, keys: readonly K[]): Schema<Pick<S, K>>;
26
26
  /**
27
27
  * `omitModels` is `selectModels` from the other side: keep every model EXCEPT
28
- * the named ones. Use it when an app is the general case and another product
29
- * owns the omitted models — e.g. the product suite shell drops the standalone
30
- * Mail store, which `@ablo/mail-schema` selects for the mail app:
28
+ * the named ones. Use it when an app is the general case and a separate app
29
+ * owns the omitted models — the suite shell drops a specialized store that the
30
+ * standalone app selects for itself:
31
31
  *
32
32
  * ```ts
33
- * export const schema = omitModels(full, ['mailMailboxes', 'mailThreads']);
33
+ * export const schema = omitModels(full, ['reports', 'reportSections']);
34
34
  * ```
35
35
  *
36
36
  * Same validation as `selectModels`: relations into the omitted set are
@@ -55,12 +55,12 @@ export function selectModels(schema, keys) {
55
55
  }
56
56
  /**
57
57
  * `omitModels` is `selectModels` from the other side: keep every model EXCEPT
58
- * the named ones. Use it when an app is the general case and another product
59
- * owns the omitted models — e.g. the product suite shell drops the standalone
60
- * Mail store, which `@ablo/mail-schema` selects for the mail app:
58
+ * the named ones. Use it when an app is the general case and a separate app
59
+ * owns the omitted models — the suite shell drops a specialized store that the
60
+ * standalone app selects for itself:
61
61
  *
62
62
  * ```ts
63
- * export const schema = omitModels(full, ['mailMailboxes', 'mailThreads']);
63
+ * export const schema = omitModels(full, ['reports', 'reportSections']);
64
64
  * ```
65
65
  *
66
66
  * Same validation as `selectModels`: relations into the omitted set are
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abloatai/ablo",
3
- "version": "0.29.0",
3
+ "version": "0.29.2",
4
4
  "description": "The Collaboration Layer For AI Agents",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",