@immediately-run/preauth-core 0.1.0 → 0.1.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.
@@ -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';
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';
4
4
  export interface CapabilityDef {
5
5
  kind: CapabilityKind;
6
6
  tier: CapabilityTier;
@@ -13,10 +13,10 @@ export interface CapabilityDef {
13
13
  * elevated capability can be EARNED by a URL-loaded/previewed app via lazy
14
14
  * first-use or manifest-`requests` consent and recorded as a per-`(user,
15
15
  * appKey)` grant; non-app-scoped elevated caps are never earnable that way
16
- * (region binding only). The app-scoped set is `net:fetch`, `task:invoke`, and
16
+ * (region binding only). The app-scoped set is `net:fetch`, `task:invoke`,
17
17
  * `contribute:self` (decision #1 — its baseline→elevated reclassification landed
18
- * in R3-33d; the durable grant participates in the §8.15 90-day expiry like any
19
- * app-scoped grant). */
18
+ * in R3-33d), and `diagnostics:read` (R3-74 / P3-72, D4); the durable grant
19
+ * participates in the §8.15 90-day expiry like any app-scoped grant. */
20
20
  appScoped?: boolean;
21
21
  /** Render this capability's consent line with the platform's **maximally-
22
22
  * explicit** (scariest) styling, never bundled into a combined prompt
@@ -27,10 +27,10 @@ export interface CapabilityDef {
27
27
  maximallyExplicit?: boolean;
28
28
  }
29
29
  export declare const CAPABILITIES: Record<Capability, CapabilityDef>;
30
- /** The current registry/vocabulary version (§5.11). Bumped to 1.2.0 with the
31
- * per-user settings-space capabilities (`settings:app`/`settings:fork`/
32
- * `settings:all`), mirroring capabilities.json. */
33
- export declare const REGISTRY_VERSION = "1.2.0";
30
+ /** The current registry/vocabulary version (§5.11). Bumped to 1.3.0 with the
31
+ * provider-agnostic `llm:chat` capability (the `llm.chat@1` slot), mirroring
32
+ * capabilities.json. (1.2.0 added the per-user settings-space capabilities.) */
33
+ export declare const REGISTRY_VERSION = "1.3.0";
34
34
  /** Is `cap` a known kernel capability? (Closed vocabulary — §5.12.) */
35
35
  export declare function isKnownCapability(cap: string): cap is Capability;
36
36
  export declare function tierOf(cap: Capability): CapabilityTier;
@@ -153,12 +153,37 @@ exports.CAPABILITIES = {
153
153
  'secrets:add': { kind: 'action', tier: 'elevated', since: '1.1.0' },
154
154
  'secrets:list': { kind: 'read', tier: 'elevated', since: '1.1.0' },
155
155
  'secrets:revoke': { kind: 'action', tier: 'elevated', since: '1.1.0' },
156
- 'agent:session': { kind: 'action', tier: 'elevated', since: '1.0.0' },
156
+ // R3-76 (P3-74, LLM_AND_AGENTS_SPEC §3.4/§4; LOCAL_DEV_AUTHED_SERVER_SPEC):
157
+ // open and drive a user-local Claude Code via the bridge — the in-browser host
158
+ // kernel connects OUT to the CLI's authenticated localhost server and runs each
159
+ // tool call through its §8.4-gated invoke(). Promoted from proposed/since:null
160
+ // to a defined, gated, elevated capability landing in the current 1.2.0
161
+ // registry — gated host-side by `protocol-agent` (site-main actionGate) and held
162
+ // by the Agent-panel system app. Elevated and NOT app-scoped: a URL-loaded app
163
+ // cannot earn it via lazy/manifest consent (region binding only) — driving the
164
+ // user's local machine is first-party-grade authority, never silently earnable.
165
+ 'agent:session': { kind: 'action', tier: 'elevated', since: '1.2.0' },
166
+ // R3-74 (P3-72, LLM_AND_AGENTS_SPEC §3.3/§4, D4): a sibling agent app reading the
167
+ // PREVIEWED app's own build/transpile errors + captured console — the in-browser
168
+ // analogue of a local agent reading compiler output. App-scoped elevated so a
169
+ // URL-loaded agent can EARN it via lazy/manifest consent (a clean, withholdable
170
+ // consent line, D4); read-only and scoped to the paired previewed app's own
171
+ // diagnostics (no cross-app bleed — enforced host-side by the channel projection).
172
+ 'diagnostics:read': { kind: 'action', tier: 'elevated', since: '1.2.0', appScoped: true },
173
+ // SERVICE_PROVIDERS_SPEC `llm.chat@1` / LLM_AND_AGENTS_SPEC D5: invoke the shared,
174
+ // provider-agnostic chat slot. The app calls ONE slot; the host resolves which
175
+ // vendor answers from the key the user holds (`SecretView.boundOrigin`) + their
176
+ // `preferredImplementation` choice, injects the key host-side (§6, look-at-nothing
177
+ // proxy), and streams normalized deltas back. The app never names a vendor, never
178
+ // sees the key, and needs NO `net:fetch`/`secrets` grant of its own — only this.
179
+ // Elevated + app-scoped: a fork/previewed app EARNS it via lazy/manifest consent
180
+ // (the fork-needs-more-caps story), recorded as a per-(user,appKey) §8.15 grant.
181
+ 'llm:chat': { kind: 'action', tier: 'elevated', since: '1.3.0', appScoped: true },
157
182
  };
158
- /** The current registry/vocabulary version (§5.11). Bumped to 1.2.0 with the
159
- * per-user settings-space capabilities (`settings:app`/`settings:fork`/
160
- * `settings:all`), mirroring capabilities.json. */
161
- exports.REGISTRY_VERSION = '1.2.0';
183
+ /** The current registry/vocabulary version (§5.11). Bumped to 1.3.0 with the
184
+ * provider-agnostic `llm:chat` capability (the `llm.chat@1` slot), mirroring
185
+ * capabilities.json. (1.2.0 added the per-user settings-space capabilities.) */
186
+ exports.REGISTRY_VERSION = '1.3.0';
162
187
  /** Is `cap` a known kernel capability? (Closed vocabulary — §5.12.) */
163
188
  function isKnownCapability(cap) {
164
189
  return Object.prototype.hasOwnProperty.call(exports.CAPABILITIES, cap);
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@immediately-run/preauth-core",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
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
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/immediately-run/immediately-run-preauth-core.git"
9
+ },
6
10
  "type": "commonjs",
7
11
  "main": "dist/index.js",
8
12
  "types": "dist/index.d.ts",