@immediately-run/preauth-core 0.1.4 → 0.1.6

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.
@@ -1,6 +1,6 @@
1
1
  export type CapabilityKind = 'read' | 'action';
2
2
  export type CapabilityTier = 'baseline' | 'elevated' | 'first-party-only';
3
- export type Capability = 'theme:read' | 'theme:set' | 'auth:status' | 'auth:identity' | 'route:read' | 'formFactor:read' | 'mounts:read' | 'spaces:app' | 'spaces:user' | 'spaces:admin' | 'settings:app' | 'settings:fork' | 'settings:all' | 'contribute:self' | 'contribute:any' | 'contribute:direct' | 'editor:read' | 'editor:open' | 'editor:write' | 'editor:document' | 'editor:requestEdit' | 'vcs:read' | 'vcs:reset' | 'dnd:source' | 'catalog:read' | 'commands:read' | 'commands:run' | 'ipc' | 'task:invoke' | 'net:fetch' | 'secrets:add' | 'secrets:list' | 'secrets:revoke' | 'agent:session' | 'diagnostics:read' | 'llm:chat' | 'authoring:run';
3
+ export type Capability = 'theme:read' | 'theme:set' | 'auth:status' | 'auth:identity' | 'route:read' | 'formFactor:read' | 'mounts:read' | 'mounts:registry' | 'spaces:app' | 'spaces:user' | 'spaces:admin' | 'settings:app' | 'settings:fork' | 'settings:all' | 'contribute:self' | 'contribute:any' | 'contribute:direct' | 'editor:read' | 'editor:open' | 'editor:write' | 'editor:document' | 'editor:requestEdit' | 'vcs:read' | 'vcs:reset' | 'dnd:source' | 'catalog:read' | 'commands:read' | 'commands:run' | 'ipc' | 'task:invoke' | 'net:fetch' | 'secrets:add' | 'secrets:list' | 'secrets:revoke' | 'agent:session' | 'diagnostics:read' | 'llm:chat' | 'authoring:run';
4
4
  export interface CapabilityDef {
5
5
  kind: CapabilityKind;
6
6
  tier: CapabilityTier;
@@ -31,11 +31,12 @@ export interface CapabilityDef {
31
31
  maximallyExplicit?: boolean;
32
32
  }
33
33
  export declare const CAPABILITIES: Record<Capability, CapabilityDef>;
34
- /** The current registry/vocabulary version (§5.11). Bumped to 1.4.0 with the
35
- * `authoring:run` capability (the kernel authoring services — CLIENT_SERVICES §6,
36
- * R3-107), mirroring capabilities.json. (1.3.0 added the provider-agnostic
37
- * `llm:chat` slot; 1.2.0 added the per-user settings-space capabilities.) */
38
- export declare const REGISTRY_VERSION = "1.4.0";
34
+ /** The current registry/vocabulary version (§5.11). Bumped to 1.5.0 with the
35
+ * first-party-only `mounts:registry` capability (the PRINCIPALS §9 B2 Session-lens
36
+ * mount oracle — R3-95), mirroring capabilities.json. (1.4.0 added `authoring:run`;
37
+ * 1.3.0 added the provider-agnostic `llm:chat` slot; 1.2.0 added the per-user
38
+ * settings-space capabilities.) */
39
+ export declare const REGISTRY_VERSION = "1.5.0";
39
40
  /** Is `cap` a known host-core capability? (Closed vocabulary — §5.12.) */
40
41
  export declare function isKnownCapability(cap: string): cap is Capability;
41
42
  export declare function tierOf(cap: Capability): CapabilityTier;
@@ -25,6 +25,20 @@ exports.CAPABILITIES = {
25
25
  'route:read': { kind: 'read', tier: 'baseline', since: '1.0.0' },
26
26
  'formFactor:read': { kind: 'read', tier: 'baseline', since: '1.0.0' },
27
27
  'mounts:read': { kind: 'read', tier: 'baseline', since: '1.0.0' },
28
+ // Enumerate the session's mounts BEYOND the app's own — the Session-lens
29
+ // "App | Session" superset (PRINCIPALS_SPEC §9 B2 / §8.9.1 / D-PRIN-4). Where
30
+ // `mounts:read` is a per-app filter (own mounts only, baseline), this is the
31
+ // cross-scope registry oracle: it reveals mounts the previewed app was never
32
+ // granted (the editor/agent session's own), so it is an activity oracle exactly
33
+ // like `settings:all`. **Permanently first-party-only:** a URL-loaded/previewed
34
+ // fork of the File Explorer may hold the App lens (`mounts:read`) but NEVER the
35
+ // Session lens — `buildConsent` refuses a first-party-only cap to a non-first-
36
+ // party binding regardless of consent, `overridePolicy` strips it on a repoint
37
+ // (D-PRIN-4 rejected both a forkable Session lens and a separate "session lens"
38
+ // capability: this IS the settled `mounts:registry`, a view selector over the
39
+ // mount registry, not a new power). Read kind — it gates the first-party
40
+ // `session-mounts` push channel (§8.3 view() projection).
41
+ 'mounts:registry': { kind: 'read', tier: 'first-party-only', since: '1.5.0' },
28
42
  'spaces:app': { kind: 'action', tier: 'baseline', since: '1.0.0', parameterized: true },
29
43
  'spaces:user': { kind: 'action', tier: 'elevated', since: '1.0.0' },
30
44
  'spaces:admin': { kind: 'action', tier: 'elevated', since: '1.0.0' },
@@ -194,11 +208,12 @@ exports.CAPABILITIES = {
194
208
  // input-size). Not app-scoped: it confers no authority over other apps/mounts.
195
209
  'authoring:run': { kind: 'action', tier: 'baseline', since: '1.4.0' },
196
210
  };
197
- /** The current registry/vocabulary version (§5.11). Bumped to 1.4.0 with the
198
- * `authoring:run` capability (the kernel authoring services — CLIENT_SERVICES §6,
199
- * R3-107), mirroring capabilities.json. (1.3.0 added the provider-agnostic
200
- * `llm:chat` slot; 1.2.0 added the per-user settings-space capabilities.) */
201
- exports.REGISTRY_VERSION = '1.4.0';
211
+ /** The current registry/vocabulary version (§5.11). Bumped to 1.5.0 with the
212
+ * first-party-only `mounts:registry` capability (the PRINCIPALS §9 B2 Session-lens
213
+ * mount oracle — R3-95), mirroring capabilities.json. (1.4.0 added `authoring:run`;
214
+ * 1.3.0 added the provider-agnostic `llm:chat` slot; 1.2.0 added the per-user
215
+ * settings-space capabilities.) */
216
+ exports.REGISTRY_VERSION = '1.5.0';
202
217
  /** Is `cap` a known host-core capability? (Closed vocabulary — §5.12.) */
203
218
  function isKnownCapability(cap) {
204
219
  return Object.prototype.hasOwnProperty.call(exports.CAPABILITIES, cap);
@@ -23,10 +23,6 @@ export declare const GRANT_EXPIRY_MS: number;
23
23
  * RENAME-1). The stored Firestore path segment is a doc-ID, not a field literally
24
24
  * named `principal`, so this rename is code-symbol-only — no data migration. */
25
25
  export declare const granteeId: (uid: string) => string;
26
- /** @deprecated use {@link granteeId}. Kept as an alias for the `userPrincipal →
27
- * granteeId` migration (the SDK + site-main + backend RENAME-1 track); removed once
28
- * consumers migrate. */
29
- export declare const userPrincipal: (uid: string) => string;
30
26
  /** Drop undefined values — Firestore rejects them. The two adapters historically
31
27
  * each had their own copy of this; sharing it keeps the "omit absent optionals"
32
28
  * rule identical on both sides. */
package/dist/docLayout.js CHANGED
@@ -16,7 +16,7 @@
16
16
  // `.set()`/`.update()` is the only thing each adapter does itself. Drift is then
17
17
  // impossible without editing a helper both consume.
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.netFetchGrantFields = exports.mergeNetFetchHosts = exports.appSpaceGrantFields = exports.appKeyTouchFields = exports.appCountFields = exports.userCountFields = exports.ownerUserSpaceFields = exports.ownerMemberFields = exports.spaceDocFields = exports.appCountPath = exports.userCountPath = exports.appSpacePath = exports.appKeyPath = exports.userSpacePath = exports.memberPath = exports.spacePath = exports.defined = exports.userPrincipal = exports.granteeId = exports.GRANT_EXPIRY_MS = exports.grantKey = void 0;
19
+ exports.netFetchGrantFields = exports.mergeNetFetchHosts = exports.appSpaceGrantFields = exports.appKeyTouchFields = exports.appCountFields = exports.userCountFields = exports.ownerUserSpaceFields = exports.ownerMemberFields = exports.spaceDocFields = exports.appCountPath = exports.userCountPath = exports.appSpacePath = exports.appKeyPath = exports.userSpacePath = exports.memberPath = exports.spacePath = exports.defined = exports.granteeId = exports.GRANT_EXPIRY_MS = exports.grantKey = void 0;
20
20
  /** Stable per-user identifier for a grant `(appKey, spaceId)`, used as the value
21
21
  * of a delegated grant's `parentGrantId`. `::` is delimiter-safe: `appKey` uses
22
22
  * `__` separators and a Firestore `spaceId` is alphanumeric. */
@@ -33,10 +33,6 @@ exports.GRANT_EXPIRY_MS = 90 * 24 * 60 * 60 * 1000;
33
33
  * named `principal`, so this rename is code-symbol-only — no data migration. */
34
34
  const granteeId = (uid) => `user:${uid}`;
35
35
  exports.granteeId = granteeId;
36
- /** @deprecated use {@link granteeId}. Kept as an alias for the `userPrincipal →
37
- * granteeId` migration (the SDK + site-main + backend RENAME-1 track); removed once
38
- * consumers migrate. */
39
- exports.userPrincipal = exports.granteeId;
40
36
  /** Drop undefined values — Firestore rejects them. The two adapters historically
41
37
  * each had their own copy of this; sharing it keeps the "omit absent optionals"
42
38
  * rule identical on both sides. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immediately-run/preauth-core",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "The shared §8.9 pre-auth target check + the single grant-mint path (mintConsentedGrants) + the capability vocabulary + the byte-faithful grant/space/net-fetch document layout. Consumed by site-main (browser Firestore) and the backend (admin Firestore) so there is ONE gate, ONE mint path, ONE wire layout.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {