@ggui-ai/protocol 0.15.0 → 0.16.0

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.
Files changed (75) hide show
  1. package/dist/errors/domain-error.d.ts +70 -0
  2. package/dist/errors/domain-error.d.ts.map +1 -0
  3. package/dist/errors/domain-error.js +118 -0
  4. package/dist/gadgets/stdlib-gadgets.d.ts +1 -1
  5. package/dist/gadgets/stdlib-gadgets.js +1 -1
  6. package/dist/index.d.ts +3 -1
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +4 -2
  9. package/dist/integrations/mcp-apps.d.ts +33 -7
  10. package/dist/integrations/mcp-apps.d.ts.map +1 -1
  11. package/dist/integrations/mcp-apps.js +13 -13
  12. package/dist/integrations/overlay-hash.d.ts +19 -0
  13. package/dist/integrations/overlay-hash.d.ts.map +1 -0
  14. package/dist/integrations/overlay-hash.js +29 -0
  15. package/dist/integrations/theme-binding.d.ts +14 -12
  16. package/dist/integrations/theme-binding.d.ts.map +1 -1
  17. package/dist/integrations/theme-binding.js +10 -6
  18. package/dist/registry/blueprint-key.d.ts.map +1 -1
  19. package/dist/registry/blueprint-key.js +4 -3
  20. package/dist/schemas/app-theme.d.ts +46 -10
  21. package/dist/schemas/app-theme.d.ts.map +1 -1
  22. package/dist/schemas/app-theme.js +108 -40
  23. package/dist/schemas/blueprint.d.ts +2 -1
  24. package/dist/schemas/blueprint.d.ts.map +1 -1
  25. package/dist/schemas/blueprint.js +15 -3
  26. package/dist/schemas/data-contract.d.ts +1 -1
  27. package/dist/schemas/data-contract.js +1 -1
  28. package/dist/schemas/handshake-suggestion.d.ts.map +1 -1
  29. package/dist/schemas/handshake-suggestion.js +8 -1
  30. package/dist/schemas/mcp.d.ts +48 -22
  31. package/dist/schemas/mcp.d.ts.map +1 -1
  32. package/dist/schemas/mcp.js +44 -15
  33. package/dist/schemas/ops-blueprint.d.ts +4 -4
  34. package/dist/schemas/ops-blueprint.d.ts.map +1 -1
  35. package/dist/schemas/ops-blueprint.js +13 -8
  36. package/dist/schemas/render-input-envelope.js +1 -1
  37. package/dist/types/blueprint-source.d.ts +27 -7
  38. package/dist/types/blueprint-source.d.ts.map +1 -1
  39. package/dist/types/blueprint-source.js +19 -3
  40. package/dist/types/blueprint.d.ts +2 -2
  41. package/dist/types/blueprint.d.ts.map +1 -1
  42. package/dist/types/data-contract.d.ts +3 -3
  43. package/dist/types/domain-error-codes.d.ts +167 -0
  44. package/dist/types/domain-error-codes.d.ts.map +1 -0
  45. package/dist/types/domain-error-codes.js +170 -0
  46. package/dist/types/handshake-suggestion.d.ts +2 -2
  47. package/dist/types/live-channel.d.ts +1 -1
  48. package/dist/types/llm-route.d.ts +59 -2
  49. package/dist/types/llm-route.d.ts.map +1 -1
  50. package/dist/types/llm-route.js +62 -16
  51. package/dist/types/llm.d.ts +22 -2
  52. package/dist/types/llm.d.ts.map +1 -1
  53. package/dist/types/llm.js +29 -2
  54. package/dist/types/mcp.d.ts +31 -39
  55. package/dist/types/mcp.d.ts.map +1 -1
  56. package/dist/types/mcp.js +22 -10
  57. package/dist/types/refusal-codes.d.ts +31 -93
  58. package/dist/types/refusal-codes.d.ts.map +1 -1
  59. package/dist/types/refusal-codes.js +41 -96
  60. package/dist/types/render.d.ts +3 -3
  61. package/dist/types/render.d.ts.map +1 -1
  62. package/dist/validation/contract-validator.d.ts +8 -2
  63. package/dist/validation/contract-validator.d.ts.map +1 -1
  64. package/dist/validation/contract-validator.js +12 -4
  65. package/dist/validation/lint-contract.d.ts +2 -2
  66. package/dist/validation/lint-contract.d.ts.map +1 -1
  67. package/dist/validation/lint-contract.js +6 -4
  68. package/dist/validation/schema-subset.d.ts +3 -3
  69. package/dist/version.d.ts +357 -6
  70. package/dist/version.d.ts.map +1 -1
  71. package/dist/version.js +356 -5
  72. package/package.json +1 -1
  73. package/dist/envelope-adapters.d.ts +0 -12
  74. package/dist/envelope-adapters.d.ts.map +0 -1
  75. package/dist/envelope-adapters.js +0 -30
@@ -1,41 +1,21 @@
1
1
  import type { z } from 'zod';
2
2
  import type { DataContract, JsonObject, JsonSchema, JsonValue } from './data-contract.js';
3
3
  import type { DeepReadonly } from './readonly.js';
4
- import type { consumeInputSchema, getRenderSourceInputSchema, getSessionInputSchema, handshakeInputSchema, handshakeOutputSchema, renderBlueprintInputSchema, renderCacheMarkerSchema, renderErrorSchema, renderInputSchema, renderOutputSchema, resourceReadErrorCodeSchema, resourceReadErrorSchema, runtimePullInputSchema, runtimeTelemetryInputSchema, runtimeTelemetryOutputSchema, searchBlueprintsInputSchema, updateInputSchema, updateOutputSchema, amendInputSchema, amendOutputSchema, declareToolCatalogOutputSchema, gguiGetSessionOutputSchema, gguiSearchBlueprintsOutputSchema, consumeEventEntrySchema, gguiConsumeOutputSchema, gguiEmitOutputSchema, gguiListSessionsOutputSchema } from '../schemas/mcp.js';
4
+ import type { consumeInputSchema, getRenderSourceInputSchema, getSessionInputSchema, handshakeInputSchema, handshakeOutputSchema, renderBlueprintInputSchema, renderCacheMarkerSchema, renderErrorSchema, renderInputSchema, renderOutputSchema, resourceReadErrorCodeSchema, resourceReadErrorSchema, runtimePullInputSchema, runtimeTelemetryInputSchema, runtimeTelemetryOutputSchema, searchBlueprintsInputSchema, updateInputSchema, updateOutputSchema, amendInputSchema, amendOutputSchema, declareToolCatalogOutputSchema, gguiGetSessionOutputSchema, gguiSearchBlueprintsOutputSchema, consumeEventEntrySchema, pendingEventSchema, gguiConsumeOutputSchema, gguiEmitOutputSchema, gguiListSessionsOutputSchema } from '../schemas/mcp.js';
5
5
  import type { EventsResponse, ReplayHorizonPassedError } from './ggui-session-event.js';
6
6
  export type { GguiSessionStatus } from './render.js';
7
7
  /** Target screen size category for responsive layout */
8
8
  export type Screen = 'mobile' | 'tablet' | 'desktop' | 'universal';
9
9
  /**
10
- * Pending action stored server-side for agent consumption.
10
+ * One stored row of the consume pipe — a user action awaiting the agent's
11
+ * `ggui_consume`. Derived from {@link pendingEventSchema} (ggui#839): the
12
+ * shape a producer appends and a store drains, on every store.
11
13
  *
12
- * `envelope` is the canonical {@link ConsumeEventEntry} row. `sequence`
13
- * is the render-scoped monotonic assigned at ingestion; it sits on the
14
- * row wrapper so consumers can detect gaps without parsing the payload.
15
- *
16
- * **Storage note**: the envelope is stored as either a JSON object or
17
- * a JSON-stringified object, depending on how the deployment's storage
18
- * layer serializes rows. Consume readers MUST accept both — see
19
- * {@link parsePendingEnvelope}.
20
- */
21
- export interface PendingEvent {
22
- /** Stable row id — UUID assigned at ingestion. */
23
- id: string;
24
- /**
25
- * Canonical {@link ConsumeEventEntry} row payload. JSON object or
26
- * stringified JSON on the wire (both shapes round-trip through the
27
- * consume helpers).
28
- */
29
- envelope: ConsumeEventEntry | string;
30
- /**
31
- * GguiSession-scoped monotonic sequence assigned at ingestion. Mirrors
32
- * `GguiSession.eventSequence` at the moment this row was appended so
33
- * consumers can detect gaps without reading render state.
34
- */
35
- sequence: number;
36
- /** ISO datetime when the row was appended. */
37
- createdAt: string;
38
- }
14
+ * `envelope` is the canonical {@link ConsumeEventEntry} — always the
15
+ * object. `id` is the drain_ack key and the idempotency key per
16
+ * `(sessionId, id)`. `createdAt` is when the row was appended.
17
+ */
18
+ export type PendingEvent = Readonly<z.infer<typeof pendingEventSchema>>;
39
19
  /**
40
20
  * Input for ggui_consume tool — long-poll for buffered events on a
41
21
  * specific render.
@@ -280,7 +260,7 @@ export type GguiHandshakeOutput = z.infer<typeof handshakeOutputSchema>;
280
260
  *
281
261
  * Mirrors `handshakeOutputSchema.serverCapabilities` exactly — exported
282
262
  * here as a named TypeScript type so server-side composition layers
283
- * (the OSS `createGguiServer` resolver, the cloud pod composer) can hand
263
+ * (the OSS `createGguiServer` resolver, a hosted deployment's composer) can hand
284
264
  * one back to the handshake factory without re-deriving the shape from
285
265
  * the schema.
286
266
  *
@@ -395,8 +375,17 @@ export type GguiRuntimeTelemetryOutput = z.infer<typeof runtimeTelemetryOutputSc
395
375
  * §7.1; see {@link RenderErrorCode}). The slot stays unassigned so a
396
376
  * future canonical code can't silently collide with stale consumers.
397
377
  *
378
+ * `-32001` is RETIRED-RESERVED too (ggui#853): `UNAUTHORIZED` lived
379
+ * there until the 0.16.0 wave, but `-32001` is the MCP SDK client's own
380
+ * `RequestTimeout` — minted locally, never sent by a server — so a
381
+ * client reading the number could not tell a server's UNAUTHORIZED
382
+ * from its own timeout, the class ggui#836 closed for `-32000`
383
+ * (`ConnectionClosed`). `UNAUTHORIZED` is `-32007`; the slot stays
384
+ * unassigned. `error-codes-vs-sdk.test.ts` pins that no ggui-chosen
385
+ * code equals a code the SDK's `ErrorCode` enum owns.
386
+ *
398
387
  * `-32006` is assigned to `MOUNT_UNAVAILABLE`; new canonical codes come
399
- * at `-32007` onwards.
388
+ * at `-32008` onwards.
400
389
  */
401
390
  export declare const MCP_ERROR_CODES: {
402
391
  readonly PARSE_ERROR: -32700;
@@ -404,10 +393,9 @@ export declare const MCP_ERROR_CODES: {
404
393
  readonly METHOD_NOT_FOUND: -32601;
405
394
  readonly INVALID_PARAMS: -32602;
406
395
  readonly INTERNAL_ERROR: -32603;
407
- readonly UNAUTHORIZED: -32001;
396
+ readonly UNAUTHORIZED: -32007;
408
397
  readonly SESSION_NOT_FOUND: -32002;
409
398
  readonly APP_NOT_FOUND: -32003;
410
- readonly CAPABILITY_DENIED: -32005;
411
399
  /**
412
400
  * A `resources/read` identified the resource but cannot return a
413
401
  * mount for it — the component behind it is gone, the server keeps no
@@ -427,19 +415,23 @@ export declare const MCP_ERROR_CODES: {
427
415
  /**
428
416
  * Platform-specific error codes (-32010 range).
429
417
  * These are ggui platform extensions, not part of the core protocol.
418
+ * `-32010`..`-32013` and `-32020` are retired-reserved (SPEC §7.9,
419
+ * ggui#910 / ggui#890): declared once, emitted by nothing first-party —
420
+ * quota, app-limit and concurrency states are refusals or
421
+ * implementation-range codes, and a contract violation is the Plane-2
422
+ * `contract_violation` result or the live channel's `CONTRACT_VIOLATION`
423
+ * frame code, never a JSON-RPC number.
430
424
  */
431
425
  export declare const PLATFORM_ERROR_CODES: {
432
- readonly GENERATION_QUOTA_EXCEEDED: -32010;
433
- readonly APP_LIMIT_EXCEEDED: -32011;
434
- readonly CONCURRENT_SESSION_LIMIT: -32012;
435
- readonly RATE_LIMIT_EXCEEDED: -32013;
436
426
  /**
437
427
  * The generation queue is saturated — the server, not the caller, is
438
- * the limit (contrast `RATE_LIMIT_EXCEEDED`: the caller slows down). HTTP
428
+ * the limit (contrast a caller-side rate cap, which is a render-gate
429
+ * REFUSAL — `app_rate_limited` / `issuer_rate_limited`, SPEC §7.1 — the
430
+ * caller slows down; its former numeric `-32013` is retired-reserved,
431
+ * SPEC §7.9, ggui#890). HTTP
439
432
  * 503 with `Retry-After`, which governs the retry; a parsed request's
440
433
  * refusal, so it speaks this table (ggui#836 follow-up).
441
434
  */
442
435
  readonly GENERATION_OVERLOADED: -32014;
443
- readonly CONTRACT_VIOLATION: -32020;
444
436
  };
445
437
  //# sourceMappingURL=mcp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/types/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,2BAA2B,EAC3B,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,8BAA8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;;;;;GASG;AACH,eAAO,MAAM,oBAAoB;IAC/B;;;;;;;;OAQG;;CAEK,CAAC"}
package/dist/types/mcp.js CHANGED
@@ -11,8 +11,17 @@
11
11
  * §7.1; see {@link RenderErrorCode}). The slot stays unassigned so a
12
12
  * future canonical code can't silently collide with stale consumers.
13
13
  *
14
+ * `-32001` is RETIRED-RESERVED too (ggui#853): `UNAUTHORIZED` lived
15
+ * there until the 0.16.0 wave, but `-32001` is the MCP SDK client's own
16
+ * `RequestTimeout` — minted locally, never sent by a server — so a
17
+ * client reading the number could not tell a server's UNAUTHORIZED
18
+ * from its own timeout, the class ggui#836 closed for `-32000`
19
+ * (`ConnectionClosed`). `UNAUTHORIZED` is `-32007`; the slot stays
20
+ * unassigned. `error-codes-vs-sdk.test.ts` pins that no ggui-chosen
21
+ * code equals a code the SDK's `ErrorCode` enum owns.
22
+ *
14
23
  * `-32006` is assigned to `MOUNT_UNAVAILABLE`; new canonical codes come
15
- * at `-32007` onwards.
24
+ * at `-32008` onwards.
16
25
  */
17
26
  export const MCP_ERROR_CODES = {
18
27
  PARSE_ERROR: -32700,
@@ -20,11 +29,10 @@ export const MCP_ERROR_CODES = {
20
29
  METHOD_NOT_FOUND: -32601,
21
30
  INVALID_PARAMS: -32602,
22
31
  INTERNAL_ERROR: -32603,
23
- // Protocol-specific error codes (-32004 retired-reserved — see above)
24
- UNAUTHORIZED: -32001,
32
+ // Protocol-specific error codes (-32001, -32004 and -32005 retired-reserved — see above)
33
+ UNAUTHORIZED: -32007,
25
34
  SESSION_NOT_FOUND: -32002,
26
35
  APP_NOT_FOUND: -32003,
27
- CAPABILITY_DENIED: -32005,
28
36
  /**
29
37
  * A `resources/read` identified the resource but cannot return a
30
38
  * mount for it — the component behind it is gone, the server keeps no
@@ -44,18 +52,22 @@ export const MCP_ERROR_CODES = {
44
52
  /**
45
53
  * Platform-specific error codes (-32010 range).
46
54
  * These are ggui platform extensions, not part of the core protocol.
55
+ * `-32010`..`-32013` and `-32020` are retired-reserved (SPEC §7.9,
56
+ * ggui#910 / ggui#890): declared once, emitted by nothing first-party —
57
+ * quota, app-limit and concurrency states are refusals or
58
+ * implementation-range codes, and a contract violation is the Plane-2
59
+ * `contract_violation` result or the live channel's `CONTRACT_VIOLATION`
60
+ * frame code, never a JSON-RPC number.
47
61
  */
48
62
  export const PLATFORM_ERROR_CODES = {
49
- GENERATION_QUOTA_EXCEEDED: -32010,
50
- APP_LIMIT_EXCEEDED: -32011,
51
- CONCURRENT_SESSION_LIMIT: -32012,
52
- RATE_LIMIT_EXCEEDED: -32013,
53
63
  /**
54
64
  * The generation queue is saturated — the server, not the caller, is
55
- * the limit (contrast `RATE_LIMIT_EXCEEDED`: the caller slows down). HTTP
65
+ * the limit (contrast a caller-side rate cap, which is a render-gate
66
+ * REFUSAL — `app_rate_limited` / `issuer_rate_limited`, SPEC §7.1 — the
67
+ * caller slows down; its former numeric `-32013` is retired-reserved,
68
+ * SPEC §7.9, ggui#890). HTTP
56
69
  * 503 with `Retry-After`, which governs the retry; a parsed request's
57
70
  * refusal, so it speaks this table (ggui#836 follow-up).
58
71
  */
59
72
  GENERATION_OVERLOADED: -32014,
60
- CONTRACT_VIOLATION: -32020,
61
73
  };
@@ -102,7 +102,7 @@ declare const REFUSAL_ROWS: {
102
102
  readonly retry: "after-fix";
103
103
  readonly fixBy: "owner";
104
104
  readonly emitter: "a deployment's generation gate, balance arm";
105
- readonly description: "The balance this deployment funds the app from is exhausted. The app owner adds funds, after which the same call succeeds.";
105
+ readonly description: "The balance this deployment funds the render from is at or below zero — pool or BYOK lane alike — so nothing renders under it. The owner adds credit, after which the same call succeeds.";
106
106
  };
107
107
  readonly hard_cap_exceeded: {
108
108
  readonly code: "hard_cap_exceeded";
@@ -111,13 +111,13 @@ declare const REFUSAL_ROWS: {
111
111
  readonly emitter: "a deployment's generation gate, cap arm";
112
112
  readonly description: "The app reached the hard ceiling this deployment set for the current period. Nothing the caller or the owner does lifts it before the period rolls over.";
113
113
  };
114
- readonly model_not_in_tier: {
115
- readonly code: "model_not_in_tier";
114
+ readonly model_not_allowed: {
115
+ readonly code: "model_not_allowed";
116
116
  readonly surfaces: readonly ["render-gate"];
117
117
  readonly retry: "after-fix";
118
118
  readonly fixBy: "caller";
119
119
  readonly emitter: "a deployment's generation gate, model arm";
120
- readonly description: "The requested model is not among those the app is allowed to use. The caller picks an allowed model and retries — the one render-gate state an agent may act on itself.";
120
+ readonly description: "The requested model is not one this account has been granted on this deployment. The caller picks a granted model and retries with the same handshakeId — the one render-gate state an agent may act on itself.";
121
121
  };
122
122
  readonly managed_default_cap_exceeded: {
123
123
  readonly code: "managed_default_cap_exceeded";
@@ -142,30 +142,6 @@ declare const REFUSAL_ROWS: {
142
142
  readonly emitter: "a deployment's provisioning guard and its generation gate, reading the same record";
143
143
  readonly description: "The app record declares a funding mode this deployment does not recognise, or declares none at all. The value is reported as read and never coerced — an unreadable record is not a policy.";
144
144
  };
145
- readonly app_canceled: {
146
- readonly code: "app_canceled";
147
- readonly surfaces: readonly ["render-gate"];
148
- readonly retry: "after-fix";
149
- readonly fixBy: "owner";
150
- readonly emitter: "a deployment's generation gate, plan-state arm";
151
- readonly description: "The app's plan has ended, so it renders nothing while the stored work is kept. The owner starts a new plan to restore rendering.";
152
- };
153
- readonly trial_exhausted: {
154
- readonly code: "trial_exhausted";
155
- readonly surfaces: readonly ["render-gate"];
156
- readonly retry: "after-fix";
157
- readonly fixBy: "owner";
158
- readonly emitter: "a deployment's generation gate, trial arm";
159
- readonly description: "The trial this deployment grants the app has used up its allotment. The owner starts a paid plan.";
160
- };
161
- readonly trial_expired: {
162
- readonly code: "trial_expired";
163
- readonly surfaces: readonly ["render-gate"];
164
- readonly retry: "after-fix";
165
- readonly fixBy: "owner";
166
- readonly emitter: "a deployment's generation gate, trial arm";
167
- readonly description: "The app's trial window has closed. The owner starts a paid plan.";
168
- };
169
145
  readonly issuer_rate_limited: {
170
146
  readonly code: "issuer_rate_limited";
171
147
  readonly surfaces: readonly ["render-gate"];
@@ -192,16 +168,8 @@ declare const REFUSAL_ROWS: {
192
168
  readonly surfaces: readonly ["render-gate"];
193
169
  readonly retry: "after-fix";
194
170
  readonly fixBy: "owner";
195
- readonly emitter: "the generation gate's fall-through arm: a non-playground identity that resolves to no billing path (not a trial account, not a managed app, not a credit holder)";
196
- readonly description: "The caller has no billing subject on this deployment, so nothing renders under it. The owner provisions one — a trial account, a managed policy, or credit. Unlike `billing_mode_anomaly` — an app record that exists and declares a funding mode this deployment cannot read — no record arm applies here: there is simply no subject to bill. A deployment MAY suppress this refusal by operator override; that switch is deployment policy, not a wire state.";
197
- };
198
- readonly subscription_exists: {
199
- readonly code: "subscription_exists";
200
- readonly surfaces: readonly ["owner-api"];
201
- readonly retry: "after-fix";
202
- readonly fixBy: "owner";
203
- readonly emitter: "a deployment's owner billing mutations";
204
- readonly description: "An active (non-canceled) plan exists on this app. It refuses starting another one AND deleting the app — the refusal's own `fix` names the next step for the action that was called.";
171
+ readonly emitter: "the generation gate's fall-through arm: a non-playground identity that resolves to no billing path (not a managed app, not a credit holder)";
172
+ readonly description: "The caller has no billing subject on this deployment, so nothing renders under it. The owner provisions one — a managed policy, or credit. Unlike `billing_mode_anomaly` — an app record that exists and declares a funding mode this deployment cannot read — no record arm applies here: there is simply no subject to bill. A deployment MAY suppress this refusal by operator override; that switch is deployment policy, not a wire state.";
205
173
  };
206
174
  readonly checkout_unavailable: {
207
175
  readonly code: "checkout_unavailable";
@@ -209,60 +177,7 @@ declare const REFUSAL_ROWS: {
209
177
  readonly retry: "later";
210
178
  readonly fixBy: "operator";
211
179
  readonly emitter: "a deployment's owner billing mutations";
212
- readonly description: "The surface that starts a plan is unavailable on this deployment right now — unconfigured, or its provider is down. Only the operator can restore it.";
213
- };
214
- readonly card_update_unavailable: {
215
- readonly code: "card_update_unavailable";
216
- readonly surfaces: readonly ["owner-api"];
217
- readonly retry: "later";
218
- readonly fixBy: "operator";
219
- readonly emitter: "a deployment's owner billing mutations";
220
- readonly description: "The surface that updates a payment method is unavailable on this deployment right now. Only the operator can restore it.";
221
- };
222
- readonly portal_unavailable: {
223
- readonly code: "portal_unavailable";
224
- readonly surfaces: readonly ["owner-api"];
225
- readonly retry: "later";
226
- readonly fixBy: "operator";
227
- readonly emitter: "a deployment's owner billing mutations";
228
- readonly description: "The self-service billing surface is unavailable on this deployment right now. Only the operator can restore it.";
229
- };
230
- readonly no_subscription: {
231
- readonly code: "no_subscription";
232
- readonly surfaces: readonly ["owner-api"];
233
- readonly retry: "after-fix";
234
- readonly fixBy: "owner";
235
- readonly emitter: "a deployment's owner billing mutations";
236
- readonly description: "A plan-management action was called on an app that has no plan. The owner starts a plan first.";
237
- };
238
- readonly already_on_tier: {
239
- readonly code: "already_on_tier";
240
- readonly surfaces: readonly ["owner-api"];
241
- readonly retry: "after-fix";
242
- readonly fixBy: "owner";
243
- readonly emitter: "a deployment's owner billing mutations";
244
- readonly description: "The plan requested is the one the app is already on. The owner picks a different plan.";
245
- };
246
- readonly managed_app_no_checkout: {
247
- readonly code: "managed_app_no_checkout";
248
- readonly surfaces: readonly ["owner-api"];
249
- readonly retry: "never";
250
- readonly emitter: "a deployment's owner billing mutations";
251
- readonly description: "This app is funded by the tenant that provisioned it, so it has no owner-facing plan surface at all. No owner action creates one.";
252
- };
253
- readonly managed_app_no_card_update: {
254
- readonly code: "managed_app_no_card_update";
255
- readonly surfaces: readonly ["owner-api"];
256
- readonly retry: "never";
257
- readonly emitter: "a deployment's owner billing mutations";
258
- readonly description: "This app is funded by the tenant that provisioned it, so it carries no owner payment method to update.";
259
- };
260
- readonly managed_app_no_portal: {
261
- readonly code: "managed_app_no_portal";
262
- readonly surfaces: readonly ["owner-api"];
263
- readonly retry: "never";
264
- readonly emitter: "a deployment's owner billing mutations";
265
- readonly description: "This app is funded by the tenant that provisioned it, so it has no owner self-service billing surface.";
180
+ readonly description: "The surface that adds credit (a top-up) is unavailable on this deployment right now — unconfigured, or its provider is down. Only the operator can restore it.";
266
181
  };
267
182
  readonly owner_ref_mismatch: {
268
183
  readonly code: "owner_ref_mismatch";
@@ -301,6 +216,15 @@ export interface RefusalRow {
301
216
  }
302
217
  /** The registry consumers read. */
303
218
  export declare const PRE_GENERATION_REFUSAL_CODES: Readonly<Record<RefusalCode, RefusalRow>>;
219
+ /**
220
+ * The SAME registry object with its per-key literal types kept
221
+ * (ggui#889): `PRE_GENERATION_REFUSAL_ROWS.app_rate_limited.code` is
222
+ * `'app_rate_limited'`, its `retry` is `'later'`. The normalized view
223
+ * above erases those literals so `fixBy` reads uniformly; a producer
224
+ * that must satisfy a wire enum from a row (the registry-purity pin
225
+ * forbids the literal in source) reads it here — no parse, no literal.
226
+ */
227
+ export declare const PRE_GENERATION_REFUSAL_ROWS: typeof REFUSAL_ROWS;
304
228
  /**
305
229
  * The codes on one surface, derived type-level from the literal rows'
306
230
  * `surfaces` tuples. A runtime `.filter()` cannot narrow a type, so the
@@ -328,7 +252,7 @@ export type McpEndpointRefusalCode = CodesOnSurface<'mcp-endpoint'>;
328
252
  * Every render-gate code, as the literal tuple the wire enum
329
253
  * (`renderRefusalSchema.code`) is built from. Order is the registry's.
330
254
  */
331
- export declare const RENDER_GATE_REFUSAL_CODES: readonly ["unsupported_provider", "insufficient_credit", "hard_cap_exceeded", "model_not_in_tier", "managed_default_cap_exceeded", "app_policy_missing", "billing_mode_anomaly", "billing_path_missing", "app_canceled", "trial_exhausted", "trial_expired", "issuer_rate_limited", "app_rate_limited", "app_deprovisioned"];
255
+ export declare const RENDER_GATE_REFUSAL_CODES: readonly ["unsupported_provider", "insufficient_credit", "hard_cap_exceeded", "model_not_allowed", "managed_default_cap_exceeded", "app_policy_missing", "billing_mode_anomaly", "billing_path_missing", "issuer_rate_limited", "app_rate_limited", "app_deprovisioned"];
332
256
  /**
333
257
  * Every mcp-endpoint code, as the literal tuple the transport wire enum
334
258
  * (`transportRefusalSchema.code`) is built from — the refusals a per-app
@@ -336,5 +260,19 @@ export declare const RENDER_GATE_REFUSAL_CODES: readonly ["unsupported_provider"
336
260
  * (ggui#825). Order is the registry's.
337
261
  */
338
262
  export declare const MCP_ENDPOINT_REFUSAL_CODES: readonly ["app_deprovisioned"];
263
+ /**
264
+ * A code an owner-API billing mutation may refuse with — i.e. one whose
265
+ * `surfaces` include `owner-api`. Derived, so a render-gate code is not
266
+ * expressible on an owner-API refusal. Registry v11 (ggui#960): the
267
+ * plan-era owner-api rows retired with the plan model; one owner billing
268
+ * surface remains — adding credit.
269
+ */
270
+ export type OwnerApiRefusalCode = CodesOnSurface<'owner-api'>;
271
+ /**
272
+ * Every owner-api code, as the literal tuple a backend's owner-API
273
+ * refusal helper types its `code` from (ggui#960). Order is the
274
+ * registry's.
275
+ */
276
+ export declare const OWNER_API_REFUSAL_CODES: readonly ["checkout_unavailable"];
339
277
  export {};
340
278
  //# sourceMappingURL=refusal-codes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"refusal-codes.d.ts","sourceRoot":"","sources":["../../src/types/refusal-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,2EAKnB,CAAC;AAEX,8CAA8C;AAC9C,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,yEAAyE;AACzE,eAAO,MAAM,eAAe,yDAKlB,CAAC;AAEX,6CAA6C;AAC7C,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,cAAc,oDAAqD,CAAC;AAEjF,4CAA4C;AAC5C,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAiD3D,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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QAAQ,CACjD,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,CACjB,CAAC;AAEjB;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,EAAE,OAAO,YAA2B,CAAC;AAE7E;;;;;GAKG;AACH,KAAK,cAAc,CAAC,CAAC,SAAS,cAAc,IAAI;KAC7C,CAAC,IAAI,WAAW,GAAG,CAAC,SAAS,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,GACtE,CAAC,GACD,KAAK;CACV,CAAC,WAAW,CAAC,CAAC;AAEf;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;AAErE;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAkBpE;;;GAGG;AACH,eAAO,MAAM,yBAAyB,0QAYpC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,gCAErC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,mCAElC,CAAC"}
@@ -91,6 +91,22 @@ export const REFUSAL_RETRIES = [
91
91
  * itself — see the no-auto-retry rule in the file header.
92
92
  */
93
93
  export const REFUSAL_FIX_BY = ['caller', 'owner', 'tenant', 'operator'];
94
+ /**
95
+ * Registry v11 (ggui#960, 2026-09-08) — the plan model is retired: a
96
+ * deployment funds renders from a credit balance at flat rates, and the
97
+ * states that only a plan, a trial or a subscription could produce no
98
+ * longer exist. Retired with their emitting arms, in the same slice:
99
+ * render-gate `trial_exhausted`, `trial_expired`, `app_canceled`;
100
+ * owner-api `subscription_exists`, `no_subscription`,
101
+ * `subscription_unchanged`, `portal_unavailable`, `card_update_unavailable`,
102
+ * `managed_app_no_portal`, `managed_app_no_card_update`,
103
+ * `managed_app_no_checkout` (the top-up mutation is user-scoped — no
104
+ * managed branch exists to refuse from). Re-described: `billing_path_missing`
105
+ * (off the trial), `model_not_allowed` (per-account grant),
106
+ * `checkout_unavailable` (adding credit), `insufficient_credit` (pool or
107
+ * BYOK — the BYOK lane is charged). `managed_default_cap_exceeded` is NOT in this
108
+ * bump: unemitted since N1's swap but federated-side (ggui#965).
109
+ */
94
110
  /**
95
111
  * The registry is the ONLY list of refusal codes: {@link RefusalCode}
96
112
  * is derived from the keys below, and this definer forces every row's
@@ -120,7 +136,7 @@ const REFUSAL_ROWS = /* @__PURE__ */ defineRefusalRegistry({
120
136
  retry: 'after-fix',
121
137
  fixBy: 'owner',
122
138
  emitter: "a deployment's generation gate, balance arm",
123
- description: 'The balance this deployment funds the app from is exhausted. The app owner adds funds, after which the same call succeeds.',
139
+ description: "The balance this deployment funds the render from is at or below zero — pool or BYOK lane alike — so nothing renders under it. The owner adds credit, after which the same call succeeds.",
124
140
  },
125
141
  hard_cap_exceeded: {
126
142
  code: 'hard_cap_exceeded',
@@ -129,13 +145,13 @@ const REFUSAL_ROWS = /* @__PURE__ */ defineRefusalRegistry({
129
145
  emitter: "a deployment's generation gate, cap arm",
130
146
  description: 'The app reached the hard ceiling this deployment set for the current period. Nothing the caller or the owner does lifts it before the period rolls over.',
131
147
  },
132
- model_not_in_tier: {
133
- code: 'model_not_in_tier',
148
+ model_not_allowed: {
149
+ code: 'model_not_allowed',
134
150
  surfaces: ['render-gate'],
135
151
  retry: 'after-fix',
136
152
  fixBy: 'caller',
137
153
  emitter: "a deployment's generation gate, model arm",
138
- description: 'The requested model is not among those the app is allowed to use. The caller picks an allowed model and retries — the one render-gate state an agent may act on itself.',
154
+ description: 'The requested model is not one this account has been granted on this deployment. The caller picks a granted model and retries with the same handshakeId — the one render-gate state an agent may act on itself.',
139
155
  },
140
156
  managed_default_cap_exceeded: {
141
157
  code: 'managed_default_cap_exceeded',
@@ -163,30 +179,6 @@ const REFUSAL_ROWS = /* @__PURE__ */ defineRefusalRegistry({
163
179
  emitter: "a deployment's provisioning guard and its generation gate, reading the same record",
164
180
  description: 'The app record declares a funding mode this deployment does not recognise, or declares none at all. The value is reported as read and never coerced — an unreadable record is not a policy.',
165
181
  },
166
- app_canceled: {
167
- code: 'app_canceled',
168
- surfaces: ['render-gate'],
169
- retry: 'after-fix',
170
- fixBy: 'owner',
171
- emitter: "a deployment's generation gate, plan-state arm",
172
- description: "The app's plan has ended, so it renders nothing while the stored work is kept. The owner starts a new plan to restore rendering.",
173
- },
174
- trial_exhausted: {
175
- code: 'trial_exhausted',
176
- surfaces: ['render-gate'],
177
- retry: 'after-fix',
178
- fixBy: 'owner',
179
- emitter: "a deployment's generation gate, trial arm",
180
- description: 'The trial this deployment grants the app has used up its allotment. The owner starts a paid plan.',
181
- },
182
- trial_expired: {
183
- code: 'trial_expired',
184
- surfaces: ['render-gate'],
185
- retry: 'after-fix',
186
- fixBy: 'owner',
187
- emitter: "a deployment's generation gate, trial arm",
188
- description: "The app's trial window has closed. The owner starts a paid plan.",
189
- },
190
182
  issuer_rate_limited: {
191
183
  code: 'issuer_rate_limited',
192
184
  surfaces: ['render-gate'],
@@ -213,78 +205,17 @@ const REFUSAL_ROWS = /* @__PURE__ */ defineRefusalRegistry({
213
205
  surfaces: ['render-gate'],
214
206
  retry: 'after-fix',
215
207
  fixBy: 'owner',
216
- emitter: "the generation gate's fall-through arm: a non-playground identity that resolves to no billing path (not a trial account, not a managed app, not a credit holder)",
217
- description: 'The caller has no billing subject on this deployment, so nothing renders under it. The owner provisions one — a trial account, a managed policy, or credit. Unlike `billing_mode_anomaly` — an app record that exists and declares a funding mode this deployment cannot read — no record arm applies here: there is simply no subject to bill. A deployment MAY suppress this refusal by operator override; that switch is deployment policy, not a wire state.',
208
+ emitter: "the generation gate's fall-through arm: a non-playground identity that resolves to no billing path (not a managed app, not a credit holder)",
209
+ description: "The caller has no billing subject on this deployment, so nothing renders under it. The owner provisions one — a managed policy, or credit. Unlike `billing_mode_anomaly` — an app record that exists and declares a funding mode this deployment cannot read — no record arm applies here: there is simply no subject to bill. A deployment MAY suppress this refusal by operator override; that switch is deployment policy, not a wire state.",
218
210
  },
219
211
  // ── owner-api ─────────────────────────────────────────────────────
220
- subscription_exists: {
221
- code: 'subscription_exists',
222
- surfaces: ['owner-api'],
223
- retry: 'after-fix',
224
- fixBy: 'owner',
225
- emitter: "a deployment's owner billing mutations",
226
- description: "An active (non-canceled) plan exists on this app. It refuses starting another one AND deleting the app — the refusal's own `fix` names the next step for the action that was called.",
227
- },
228
212
  checkout_unavailable: {
229
213
  code: 'checkout_unavailable',
230
214
  surfaces: ['owner-api'],
231
215
  retry: 'later',
232
216
  fixBy: 'operator',
233
217
  emitter: "a deployment's owner billing mutations",
234
- description: 'The surface that starts a plan is unavailable on this deployment right now — unconfigured, or its provider is down. Only the operator can restore it.',
235
- },
236
- card_update_unavailable: {
237
- code: 'card_update_unavailable',
238
- surfaces: ['owner-api'],
239
- retry: 'later',
240
- fixBy: 'operator',
241
- emitter: "a deployment's owner billing mutations",
242
- description: 'The surface that updates a payment method is unavailable on this deployment right now. Only the operator can restore it.',
243
- },
244
- portal_unavailable: {
245
- code: 'portal_unavailable',
246
- surfaces: ['owner-api'],
247
- retry: 'later',
248
- fixBy: 'operator',
249
- emitter: "a deployment's owner billing mutations",
250
- description: "The self-service billing surface is unavailable on this deployment right now. Only the operator can restore it.",
251
- },
252
- no_subscription: {
253
- code: 'no_subscription',
254
- surfaces: ['owner-api'],
255
- retry: 'after-fix',
256
- fixBy: 'owner',
257
- emitter: "a deployment's owner billing mutations",
258
- description: 'A plan-management action was called on an app that has no plan. The owner starts a plan first.',
259
- },
260
- already_on_tier: {
261
- code: 'already_on_tier',
262
- surfaces: ['owner-api'],
263
- retry: 'after-fix',
264
- fixBy: 'owner',
265
- emitter: "a deployment's owner billing mutations",
266
- description: 'The plan requested is the one the app is already on. The owner picks a different plan.',
267
- },
268
- managed_app_no_checkout: {
269
- code: 'managed_app_no_checkout',
270
- surfaces: ['owner-api'],
271
- retry: 'never',
272
- emitter: "a deployment's owner billing mutations",
273
- description: 'This app is funded by the tenant that provisioned it, so it has no owner-facing plan surface at all. No owner action creates one.',
274
- },
275
- managed_app_no_card_update: {
276
- code: 'managed_app_no_card_update',
277
- surfaces: ['owner-api'],
278
- retry: 'never',
279
- emitter: "a deployment's owner billing mutations",
280
- description: 'This app is funded by the tenant that provisioned it, so it carries no owner payment method to update.',
281
- },
282
- managed_app_no_portal: {
283
- code: 'managed_app_no_portal',
284
- surfaces: ['owner-api'],
285
- retry: 'never',
286
- emitter: "a deployment's owner billing mutations",
287
- description: 'This app is funded by the tenant that provisioned it, so it has no owner self-service billing surface.',
218
+ description: 'The surface that adds credit (a top-up) is unavailable on this deployment right now — unconfigured, or its provider is down. Only the operator can restore it.',
288
219
  },
289
220
  // ── provisioning-api ──────────────────────────────────────────────
290
221
  owner_ref_mismatch: {
@@ -306,6 +237,15 @@ const REFUSAL_ROWS = /* @__PURE__ */ defineRefusalRegistry({
306
237
  });
307
238
  /** The registry consumers read. */
308
239
  export const PRE_GENERATION_REFUSAL_CODES = REFUSAL_ROWS;
240
+ /**
241
+ * The SAME registry object with its per-key literal types kept
242
+ * (ggui#889): `PRE_GENERATION_REFUSAL_ROWS.app_rate_limited.code` is
243
+ * `'app_rate_limited'`, its `retry` is `'later'`. The normalized view
244
+ * above erases those literals so `fixBy` reads uniformly; a producer
245
+ * that must satisfy a wire enum from a row (the registry-purity pin
246
+ * forbids the literal in source) reads it here — no parse, no literal.
247
+ */
248
+ export const PRE_GENERATION_REFUSAL_ROWS = REFUSAL_ROWS;
309
249
  /**
310
250
  * Identity helper that only accepts an EXHAUSTIVE tuple of one surface's
311
251
  * codes: omit one and the parameter type collapses to `never`, so the
@@ -323,14 +263,11 @@ export const RENDER_GATE_REFUSAL_CODES = exhaustiveCodesOn()([
323
263
  'unsupported_provider',
324
264
  'insufficient_credit',
325
265
  'hard_cap_exceeded',
326
- 'model_not_in_tier',
266
+ 'model_not_allowed',
327
267
  'managed_default_cap_exceeded',
328
268
  'app_policy_missing',
329
269
  'billing_mode_anomaly',
330
270
  'billing_path_missing',
331
- 'app_canceled',
332
- 'trial_exhausted',
333
- 'trial_expired',
334
271
  'issuer_rate_limited',
335
272
  'app_rate_limited',
336
273
  'app_deprovisioned',
@@ -344,3 +281,11 @@ export const RENDER_GATE_REFUSAL_CODES = exhaustiveCodesOn()([
344
281
  export const MCP_ENDPOINT_REFUSAL_CODES = exhaustiveCodesOn()([
345
282
  'app_deprovisioned',
346
283
  ]);
284
+ /**
285
+ * Every owner-api code, as the literal tuple a backend's owner-API
286
+ * refusal helper types its `code` from (ggui#960). Order is the
287
+ * registry's.
288
+ */
289
+ export const OWNER_API_REFUSAL_CODES = exhaustiveCodesOn()([
290
+ 'checkout_unavailable',
291
+ ]);
@@ -46,7 +46,7 @@ export type AdapterPermissions = {
46
46
  export type GguiSessionStatus = z.infer<typeof gguiSessionStatusSchema>;
47
47
  /**
48
48
  * Common base for every {@link GguiSession} variant. Carries identity,
49
- * tenancy, lifecycle, and conversation-scoped context that every
49
+ * app scope, lifecycle, and conversation-scoped context that every
50
50
  * rendered thing has regardless of how its visible bits are
51
51
  * produced (LLM-generated component, server-emitted system card,
52
52
  * embedded MCP-App iframe).
@@ -62,7 +62,7 @@ export interface GguiSessionBase {
62
62
  /** GguiSession identity. The value an iframe's bootstrap meta and every
63
63
  * wire reference (props_update, consume, update) keys by. */
64
64
  readonly id: string;
65
- /** App identity (tenancy boundary, always per-render). */
65
+ /** App identity (the app-scope boundary, always per-render). */
66
66
  readonly appId: string;
67
67
  /** Authenticated end-user (after the auth gate). Absent for anon
68
68
  * flows. */
@@ -143,7 +143,7 @@ export interface GguiSessionBase {
143
143
  /**
144
144
  * `GguiSession` — the canonical protocol shape for a single rendered UI.
145
145
  *
146
- * Three variants share {@link GguiSessionBase} (identity, tenancy,
146
+ * Three variants share {@link GguiSessionBase} (identity, app scope,
147
147
  * lifecycle); each variant adds its own visible-bits surface:
148
148
  *
149
149
  * - {@link ComponentGguiSession} — LLM-generated / native React component.