@immediately-run/preauth-core 0.1.10 → 0.1.12

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' | 'chrome: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,13 @@ 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.7.0 with the baseline
35
+ * state read `chrome:read` (PRESENT_MODE_CHROME_SPEC §6 R3-191), mirroring
36
+ * capabilities.json. (1.6.0 added the elevated, app-scoped, parameterized
37
+ * `analytics:emit`; 1.5.0 added the first-party-only `mounts:registry`; 1.4.0 added
38
+ * `authoring:run`; 1.3.0 added the provider-agnostic `llm:chat` slot; 1.2.0 added the
39
+ * per-user settings-space capabilities.) */
40
+ export declare const REGISTRY_VERSION = "1.7.0";
40
41
  /** Is `cap` a known host-core capability? (Closed vocabulary — §5.12.) */
41
42
  export declare function isKnownCapability(cap: string): cap is Capability;
42
43
  export declare function tierOf(cap: Capability): CapabilityTier;
@@ -208,13 +208,48 @@ 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 },
229
+ // PRESENT_MODE_CHROME_SPEC §6 (R-PMC-17, R3-191): read the host's own present-mode
230
+ // chrome state — whether the platform menu/sheet is open over the app, and which
231
+ // edge the reveal tab sits on — so a platform-aware app MAY pause an animation
232
+ // while it is dimmed, or keep its corner clear of the tab.
233
+ //
234
+ // **BASELINE, alongside `formFactor:read`.** Both are reads of the HOST's own UI
235
+ // state, not of anything app-foreign: the app already knows it is being displayed,
236
+ // and "chrome is currently over you" discloses nothing about the user, other apps,
237
+ // the filesystem, or the network. There is no `chrome:set` counterpart — an app
238
+ // cannot operate platform chrome, only observe it, so this cannot become an
239
+ // authority-escalation path.
240
+ //
241
+ // R-PMC-18 is the reason it can be baseline without a consent line at all: no
242
+ // platform behavior may depend on an app consuming this channel, so an app that
243
+ // never reads it is indistinguishable from one that does.
244
+ 'chrome:read': { kind: 'read', tier: 'baseline', since: '1.7.0' },
211
245
  };
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';
246
+ /** The current registry/vocabulary version (§5.11). Bumped to 1.7.0 with the baseline
247
+ * state read `chrome:read` (PRESENT_MODE_CHROME_SPEC §6 R3-191), mirroring
248
+ * capabilities.json. (1.6.0 added the elevated, app-scoped, parameterized
249
+ * `analytics:emit`; 1.5.0 added the first-party-only `mounts:registry`; 1.4.0 added
250
+ * `authoring:run`; 1.3.0 added the provider-agnostic `llm:chat` slot; 1.2.0 added the
251
+ * per-user settings-space capabilities.) */
252
+ exports.REGISTRY_VERSION = '1.7.0';
218
253
  /** Is `cap` a known host-core capability? (Closed vocabulary — §5.12.) */
219
254
  function isKnownCapability(cap) {
220
255
  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.12",
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": {