@immediately-run/preauth-core 0.1.10 → 0.1.11

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' | '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';
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' | 'analytics:emit';
4
4
  export interface CapabilityDef {
5
5
  kind: CapabilityKind;
6
6
  tier: CapabilityTier;
@@ -31,12 +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.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";
34
+ /** The current registry/vocabulary version (§5.11). Bumped to 1.6.0 with the
35
+ * elevated, app-scoped, parameterized `analytics:emit` (APP_ANALYTICS_SPEC §2
36
+ * R3-350), mirroring capabilities.json. (1.5.0 added the first-party-only
37
+ * `mounts:registry`; 1.4.0 added `authoring:run`; 1.3.0 added the provider-agnostic
38
+ * `llm:chat` slot; 1.2.0 added the per-user settings-space capabilities.) */
39
+ export declare const REGISTRY_VERSION = "1.6.0";
40
40
  /** Is `cap` a known host-core capability? (Closed vocabulary — §5.12.) */
41
41
  export declare function isKnownCapability(cap: string): cap is Capability;
42
42
  export declare function tierOf(cap: Capability): CapabilityTier;
@@ -208,13 +208,31 @@ exports.CAPABILITIES = {
208
208
  // authority with nothing to confine (§3a), and is bounded per call (timeout +
209
209
  // input-size). Not app-scoped: it confers no authority over other apps/mounts.
210
210
  'authoring:run': { kind: 'action', tier: 'baseline', since: '1.4.0' },
211
+ // APP_ANALYTICS_SPEC §2 (R3-350): emit an app's OWN usage analytics through the
212
+ // platform's pipeline, against a vocabulary the app declares in its manifest.
213
+ //
214
+ // **ELEVATED + appScoped, and NOT baseline.** The earlier spec draft wrote
215
+ // "baseline, consented", which is not a tier and not a thing: `baseline` IS the
216
+ // floor — `buildConsent` short-circuits `tier === 'baseline'` before generating any
217
+ // consent line, and a previewed frame is seeded with the baseline set directly. At
218
+ // baseline this would hand EVERY app on the platform an unconsented, unrevocable,
219
+ // un-journalled egress capability. CAPABILITY_REFERENCE had already closed the
220
+ // question: "'App-scoped' is NOT a fourth tier. It is a consent-path annotation on
221
+ // the elevated tier."
222
+ //
223
+ // **Parameterized**, because the grant is not "may emit" but "may emit THIS
224
+ // vocabulary": §2.1 hashes the manifest-declared vocabulary into the grant, and a
225
+ // changed hash invalidates it. `appKey` carries no ref, so without that binding a
226
+ // publisher could observe their aggregates and then ship an alphabet tuned to encode
227
+ // what they now want to read, under a grant the user gave for a different one.
228
+ 'analytics:emit': { kind: 'action', tier: 'elevated', since: '1.6.0', parameterized: true, appScoped: true },
211
229
  };
212
- /** The current registry/vocabulary version (§5.11). Bumped to 1.5.0 with the
213
- * first-party-only `mounts:registry` capability (the PRINCIPALS §9 B2 Session-lens
214
- * mount oracle — R3-95), mirroring capabilities.json. (1.4.0 added `authoring:run`;
215
- * 1.3.0 added the provider-agnostic `llm:chat` slot; 1.2.0 added the per-user
216
- * settings-space capabilities.) */
217
- exports.REGISTRY_VERSION = '1.5.0';
230
+ /** The current registry/vocabulary version (§5.11). Bumped to 1.6.0 with the
231
+ * elevated, app-scoped, parameterized `analytics:emit` (APP_ANALYTICS_SPEC §2
232
+ * R3-350), mirroring capabilities.json. (1.5.0 added the first-party-only
233
+ * `mounts:registry`; 1.4.0 added `authoring:run`; 1.3.0 added the provider-agnostic
234
+ * `llm:chat` slot; 1.2.0 added the per-user settings-space capabilities.) */
235
+ exports.REGISTRY_VERSION = '1.6.0';
218
236
  /** Is `cap` a known host-core capability? (Closed vocabulary — §5.12.) */
219
237
  function isKnownCapability(cap) {
220
238
  return Object.prototype.hasOwnProperty.call(exports.CAPABILITIES, cap);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immediately-run/preauth-core",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
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": {