@ggui-ai/protocol 0.15.0 → 0.17.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 (81) 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 +5 -1
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +11 -4
  9. package/dist/integrations/mcp-apps.d.ts +48 -8
  10. package/dist/integrations/mcp-apps.d.ts.map +1 -1
  11. package/dist/integrations/mcp-apps.js +29 -23
  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-generation-profile.d.ts +139 -0
  21. package/dist/schemas/app-generation-profile.d.ts.map +1 -0
  22. package/dist/schemas/app-generation-profile.js +121 -0
  23. package/dist/schemas/app-theme.d.ts +235 -9
  24. package/dist/schemas/app-theme.d.ts.map +1 -1
  25. package/dist/schemas/app-theme.js +218 -40
  26. package/dist/schemas/blueprint.d.ts +2 -1
  27. package/dist/schemas/blueprint.d.ts.map +1 -1
  28. package/dist/schemas/blueprint.js +15 -3
  29. package/dist/schemas/data-contract.d.ts +1 -1
  30. package/dist/schemas/data-contract.js +1 -1
  31. package/dist/schemas/handshake-suggestion.d.ts.map +1 -1
  32. package/dist/schemas/handshake-suggestion.js +8 -1
  33. package/dist/schemas/mcp.d.ts +62 -27
  34. package/dist/schemas/mcp.d.ts.map +1 -1
  35. package/dist/schemas/mcp.js +59 -21
  36. package/dist/schemas/ops-blueprint.d.ts +11 -4
  37. package/dist/schemas/ops-blueprint.d.ts.map +1 -1
  38. package/dist/schemas/ops-blueprint.js +25 -8
  39. package/dist/schemas/render-input-envelope.js +1 -1
  40. package/dist/schemas/rendering-context.d.ts +48 -0
  41. package/dist/schemas/rendering-context.d.ts.map +1 -0
  42. package/dist/schemas/rendering-context.js +39 -0
  43. package/dist/types/blueprint-source.d.ts +27 -7
  44. package/dist/types/blueprint-source.d.ts.map +1 -1
  45. package/dist/types/blueprint-source.js +19 -3
  46. package/dist/types/blueprint.d.ts +2 -2
  47. package/dist/types/blueprint.d.ts.map +1 -1
  48. package/dist/types/data-contract.d.ts +3 -3
  49. package/dist/types/domain-error-codes.d.ts +167 -0
  50. package/dist/types/domain-error-codes.d.ts.map +1 -0
  51. package/dist/types/domain-error-codes.js +170 -0
  52. package/dist/types/handshake-suggestion.d.ts +2 -2
  53. package/dist/types/live-channel.d.ts +1 -1
  54. package/dist/types/llm-route.d.ts +59 -2
  55. package/dist/types/llm-route.d.ts.map +1 -1
  56. package/dist/types/llm-route.js +62 -16
  57. package/dist/types/llm.d.ts +22 -2
  58. package/dist/types/llm.d.ts.map +1 -1
  59. package/dist/types/llm.js +29 -2
  60. package/dist/types/mcp.d.ts +31 -39
  61. package/dist/types/mcp.d.ts.map +1 -1
  62. package/dist/types/mcp.js +22 -10
  63. package/dist/types/refusal-codes.d.ts +31 -93
  64. package/dist/types/refusal-codes.d.ts.map +1 -1
  65. package/dist/types/refusal-codes.js +41 -96
  66. package/dist/types/render.d.ts +6 -5
  67. package/dist/types/render.d.ts.map +1 -1
  68. package/dist/validation/contract-validator.d.ts +8 -2
  69. package/dist/validation/contract-validator.d.ts.map +1 -1
  70. package/dist/validation/contract-validator.js +12 -4
  71. package/dist/validation/lint-contract.d.ts +2 -2
  72. package/dist/validation/lint-contract.d.ts.map +1 -1
  73. package/dist/validation/lint-contract.js +6 -4
  74. package/dist/validation/schema-subset.d.ts +3 -3
  75. package/dist/version.d.ts +445 -6
  76. package/dist/version.d.ts.map +1 -1
  77. package/dist/version.js +444 -5
  78. package/package.json +1 -1
  79. package/dist/envelope-adapters.d.ts +0 -12
  80. package/dist/envelope-adapters.d.ts.map +0 -1
  81. package/dist/envelope-adapters.js +0 -30
@@ -7,7 +7,7 @@
7
7
  * Two consumption patterns, both anchored here:
8
8
  *
9
9
  * - **Wired raw shapes** (`*InputShape`): handlers in
10
- * `@ggui-ai/mcp-server-handlers` (and the hosted pod's discover
10
+ * `@ggui-ai/mcp-server-handlers` (and a hosted deployment's discover
11
11
  * tool) import the SHAPE directly as their `inputSchema` and
12
12
  * validate with `z.object(shape)` — unknown keys are STRIPPED.
13
13
  * The shape is the one authored copy of the validation rules AND
@@ -48,14 +48,14 @@ export const consumeInputShape = {
48
48
  sessionId: z
49
49
  .string()
50
50
  .min(1)
51
- .describe('Globally-unique sessionId to consume events from. Cross-tenant access surfaces uniformly as session_not_found.'),
51
+ .describe('Globally-unique sessionId to consume events from. Cross-app access surfaces uniformly as session_not_found.'),
52
52
  timeout: z
53
53
  .number()
54
54
  .int()
55
55
  .min(0)
56
56
  .max(25)
57
57
  .optional()
58
- .describe('Inline long-poll seconds, integer in [0, 25]. 0 = immediate. Values outside the bound reject INVALID_PARAMS. Returns on first event OR timeout; re-call on empty to keep waiting — longer waits are your loop, not a bigger timeout.'),
58
+ .describe('Inline long-poll seconds, integer in [0, 25]. 0 = immediate. Values outside the bound reject INVALID_PARAMS. Returns on first event OR timeout; on empty you may re-call once, then end your turn — a later gesture arrives as a new user message carrying its own consume directive.'),
59
59
  };
60
60
  export const consumeInputSchema = z.object(consumeInputShape);
61
61
  /**
@@ -220,7 +220,7 @@ export const handshakeInputSchema = z.object({
220
220
  * `'declined'` cover every legal outcome.
221
221
  */
222
222
  export const handshakeOutputSchema = z.object({
223
- handshakeId: z.string().describe('Stable id — pass to ggui_render / ggui_update'),
223
+ handshakeId: z.string().describe('Stable id — pass to ggui_render'),
224
224
  action: z.enum(['create', 'reuse', 'update', 'replace', 'declined']),
225
225
  /**
226
226
  * The handshake suggestion — see `handshakeSuggestionSchema`. The
@@ -330,7 +330,7 @@ export const renderInputShape = {
330
330
  .string()
331
331
  .min(1)
332
332
  .optional()
333
- .describe('Model route in either wire form — canonical `anthropic:claude-haiku-4-5-20251001` or LiteLLM `anthropic/claude-haiku-4-5` (aliases resolve in both); generator-specific prefixes (e.g. `bedrock/...`) route to that transport. A value that parses in neither form fails the handler input parse at `infra.model`, before any pre-generation gate; `model_not_in_tier` is only ever a well-formed route with no rate row on the effective tier.'),
333
+ .describe('Model route in either wire form — canonical `anthropic:claude-haiku-4-5-20251001` or LiteLLM `anthropic/claude-haiku-4-5` (aliases resolve in both); generator-specific prefixes (e.g. `bedrock/...`) route to that transport. A value that parses in neither form fails the handler input parse at `infra.model`, before any pre-generation gate; `model_not_allowed` is only ever a well-formed route with no rate row on the effective tier.'),
334
334
  })
335
335
  .strict()
336
336
  .optional(),
@@ -516,13 +516,23 @@ export const renderRefusalSchema = z.object({
516
516
  * from {@link MCP_ENDPOINT_REFUSAL_CODES} — today exactly
517
517
  * `app_deprovisioned`, the one refusal with a tenant-side fix and
518
518
  * therefore the one that MUST be legible where a deleted app and a bad
519
- * credential would otherwise look alike.
519
+ * credential would otherwise look alike. `appId` (ggui#870) is the app
520
+ * the refused endpoint serves, as DATA — equal to the path's `{appId}`
521
+ * — so a tenant's repair loop keys on it and never parses prose; it is
522
+ * the ggui id the bound caller already holds, never the tenant's own
523
+ * `ownerRef`. The typed refusal answers a correctly bound federated
524
+ * identity only (identity first): an anonymous request is refused by the
525
+ * auth adapter before this arm, and learns nothing about the app.
520
526
  */
521
527
  export const transportRefusalSchema = z.strictObject({
522
528
  code: z
523
529
  .enum(MCP_ENDPOINT_REFUSAL_CODES)
524
530
  .describe("Registered refusal state on the per-app endpoint. Look the code up in the protocol's refusal registry for its retry class and which party can act."),
525
531
  ...refusalProjectionFields,
532
+ appId: z
533
+ .string()
534
+ .min(1)
535
+ .describe('The app id the refused endpoint serves — equals the {appId} of the endpoint path. Structured here so a repair loop keys on it instead of parsing the message.'),
526
536
  });
527
537
  /**
528
538
  * The JSON-RPC error object a per-app MCP endpoint answers with when it
@@ -532,7 +542,7 @@ export const transportRefusalSchema = z.strictObject({
532
542
  * proxy 403) and `message` `App not found`, plus `data.refusal`, which
533
543
  * makes it legible. `data` is strict: it carries the refusal and nothing
534
544
  * else. An authorization failure that is not a registry state answers
535
- * HTTP 403 with `-32001` (`UNAUTHORIZED`) and NO `data` — the three
545
+ * HTTP 403 with `-32007` (`UNAUTHORIZED`) and NO `data` — the three
536
546
  * untyped arms stay indistinguishable among themselves by contract:
537
547
  * naming any of them would say which is true. A first-party server
538
548
  * never chooses `-32000`: it is the SDK client's `ConnectionClosed`, so
@@ -851,7 +861,7 @@ export const renderOutputSchema = z.object({
851
861
  * wise). Use when most props stay the same and the agent only
852
862
  * needs to send a small delta — common after a single domain-tool
853
863
  * mutation. RFC 7396 chosen because it has a published spec and
854
- * wide library support (GitHub API, Kubernetes strategic-merge).
864
+ * wide library support (GitHub API's merge semantics, strategic-merge-patch).
855
865
  *
856
866
  * Anti-patterns (the discriminated union rejects these structurally,
857
867
  * but they're a common author mistake when copy-pasting):
@@ -864,7 +874,7 @@ export const renderOutputSchema = z.object({
864
874
  * partial patches that would break required fields, type-mismatch
865
875
  * values, etc. all reject pre-persist.
866
876
  *
867
- * `sessionId` is globally unique; the server tenancy-checks via
877
+ * `sessionId` is globally unique; the server checks the app scope via
868
878
  * `ctx.appId`.
869
879
  */
870
880
  export const updateInputSchema = z.discriminatedUnion('kind', [
@@ -1084,11 +1094,20 @@ export const declareToolCatalogOutputSchema = z
1084
1094
  */
1085
1095
  export const RUNTIME_PULL_MAX_LIMIT = 100;
1086
1096
  /**
1087
- * Server-side ceiling on `ggui_runtime_pull`'s `wait` hold, in seconds.
1088
- * Chosen under `ggui_consume`'s proven 25-second host tolerance for
1089
- * held tool calls — the hold must resolve before any host-side
1090
- * `tools/call` timeout fires, or the transport counts a failure the
1091
- * server intended as a quiet success.
1097
+ * Server-side ceiling on `ggui_runtime_pull`'s `wait` hold, in seconds —
1098
+ * the LONGEST hold the server will honour, never a promise that every
1099
+ * host tolerates it (ggui#1030).
1100
+ *
1101
+ * The contract has two sides. SERVER: honour `wait` up to this ceiling,
1102
+ * return the empty page as a normal result when the hold elapses, and
1103
+ * end the hold when the caller's transport closes. CALLER (the pulling
1104
+ * runtime): choose a `wait` that does not exceed the `tools/call`
1105
+ * timeout of the host relaying the call, minus a margin; a host that
1106
+ * relays a pull clamps the forwarded `wait` to its own timeout minus one
1107
+ * second. A host timeout below the hold is a caller-side failure — the
1108
+ * server's `success` after the socket closed is not a server fault, and
1109
+ * a caller that keeps pulling through such failures must demote to
1110
+ * sparse un-held pulls exactly as it does after consecutive empties.
1092
1111
  */
1093
1112
  export const RUNTIME_PULL_MAX_WAIT_SECONDS = 20;
1094
1113
  /**
@@ -1138,15 +1157,15 @@ export const gguiSessionEventSchema = z.object({
1138
1157
  * OPTIONAL here (the bridge rung owns its cursor and seeds from 0; the
1139
1158
  * route requires it because a bare browser GET has no cursor owner),
1140
1159
  * and `limit` is clamped to {@link RUNTIME_PULL_MAX_LIMIT} instead of
1141
- * rejecting above it. Tenancy violations and unknown sessionIds
1160
+ * rejecting above it. Cross-app access and unknown sessionIds
1142
1161
  * surface uniformly as the `session_not_found` error — existence of
1143
- * other tenants' renders is never leaked.
1162
+ * other apps' renders is never leaked.
1144
1163
  */
1145
1164
  export const runtimePullInputShape = {
1146
1165
  sessionId: z
1147
1166
  .string()
1148
1167
  .min(1)
1149
- .describe('Active render id — sourced from `_meta["ai.ggui/render"].sessionId` on the iframe boot envelope. Unknown and cross-tenant ids surface uniformly as session_not_found.'),
1168
+ .describe('Active render id — sourced from `_meta["ai.ggui/render"].sessionId` on the iframe boot envelope. Unknown and cross-app ids surface uniformly as session_not_found.'),
1150
1169
  sinceSequence: z
1151
1170
  .number()
1152
1171
  .int()
@@ -1163,7 +1182,7 @@ export const runtimePullInputShape = {
1163
1182
  .number()
1164
1183
  .min(0)
1165
1184
  .optional()
1166
- .describe(`Subscription-mode hold, in seconds. When set and the cursor page is empty, the server holds this call until an event lands or the hold elapses (values above ${RUNTIME_PULL_MAX_WAIT_SECONDS} are clamped to ${RUNTIME_PULL_MAX_WAIT_SECONDS}). An empty page after a full hold is a NORMAL result — immediately re-pull to stay subscribed, or back off to sparse un-held pulls after a few consecutive empties. Omit (= 0) for an immediate return.`),
1185
+ .describe(`Subscription-mode hold, in seconds. When set and the cursor page is empty, the server holds this call until an event lands or the hold elapses (values above ${RUNTIME_PULL_MAX_WAIT_SECONDS} are clamped to ${RUNTIME_PULL_MAX_WAIT_SECONDS}). CALLER OBLIGATION: your \`wait\` MUST NOT exceed the tools/call timeout of the host relaying this call, minus a margin — a host that relays a pull MUST clamp the forwarded \`wait\` to its own timeout minus one second; a host timeout below the hold is a caller-side failure (the server's success after the socket closed is not a server fault), and a caller seeing such failures MUST demote to sparse un-held pulls as it would after consecutive empties. An empty page after a full hold is a NORMAL result — immediately re-pull to stay subscribed, or back off to sparse un-held pulls after a few consecutive empties. Omit (= 0) for an immediate return.`),
1167
1186
  };
1168
1187
  export const runtimePullInputSchema = z.object(runtimePullInputShape);
1169
1188
  /**
@@ -1332,9 +1351,9 @@ export const gguiSessionStatusSchema = z.enum(['active', 'expired']);
1332
1351
  /**
1333
1352
  * One drained row of `ggui_consume` — a user action that reached the
1334
1353
  * pipe (ggui#817 part C2). Closed on the wire: an unknown key is
1335
- * stripped at the transport, a missing key refuses the row at the seam
1336
- * (`parsePendingEnvelope`), so a malformed pipe entry never ships to an
1337
- * agent typed as a good one.
1354
+ * stripped at the transport, a missing key refuses the row at the store
1355
+ * boundary (`pendingEventSchema`, ggui#839), so a malformed pipe entry
1356
+ * never ships to an agent typed as a good one.
1338
1357
  */
1339
1358
  export const consumeEventEntrySchema = z.object({
1340
1359
  type: z.literal('action'),
@@ -1345,6 +1364,25 @@ export const consumeEventEntrySchema = z.object({
1345
1364
  actionId: z.string(),
1346
1365
  firedAt: z.string(),
1347
1366
  });
1367
+ /**
1368
+ * One stored row of the consume pipe — what a producer appends and
1369
+ * `consumeAndClear` drains, the same shape on every store (ggui#839; a
1370
+ * store-boundary contract, never wire — `ggui_consume` returns the
1371
+ * entries, never the wrapper). `id` is the drain_ack key and the
1372
+ * idempotency key per `(sessionId, id)`; `envelope` is the
1373
+ * {@link consumeEventEntrySchema} entry, always the object (every writer
1374
+ * passes one; a store that serializes the row serializes the whole row);
1375
+ * `createdAt` is when the row was appended — a string, never `.datetime()`:
1376
+ * the relay copies the client's `firedAt`, which the ingress accepts as a
1377
+ * diagnostic. `PendingEventConsumer` adapters validate every row through
1378
+ * this schema on append and, when rows come back from a serialization, on
1379
+ * drain — a malformed row never reaches an agent typed as a good entry.
1380
+ */
1381
+ export const pendingEventSchema = z.object({
1382
+ id: z.string().min(1),
1383
+ envelope: consumeEventEntrySchema,
1384
+ createdAt: z.string(),
1385
+ });
1348
1386
  /**
1349
1387
  * `ggui_consume`'s output — the drained rows, the session's state, and the
1350
1388
  * client's observations when the host sent any (ggui#817 part C2). The
@@ -7,7 +7,7 @@
7
7
  * persisting the result. Optionally pins as the operator default
8
8
  * for its `(appId, contractHash)` group.
9
9
  * - `ggui_ops_list_blueprints` — enumerate blueprint metadata
10
- * (no code body) under tenancy + optional filters. Sorted by
10
+ * (no code body) under the caller's app scope + optional filters. Sorted by
11
11
  * `createdAt desc`.
12
12
  * - `ggui_ops_update_blueprint` — toggle the operator-default flag
13
13
  * and/or patch variance tags. Immutable fields (contractHash,
@@ -19,7 +19,7 @@
19
19
  * The schemas live in `@ggui-ai/protocol` (not the handler package)
20
20
  * for the same reason all wire-shape schemas do: the protocol package
21
21
  * is the source of truth for every MCP wire surface, and consumers
22
- * (cloud pod handlers, console UI, fixture authors) can import from
22
+ * (a hosted deployment's handlers, console UI, fixture authors) can import from
23
23
  * one place. Handler package wraps these into `SharedHandler`
24
24
  * factories.
25
25
  */
@@ -39,6 +39,12 @@ import { z } from 'zod';
39
39
  * caller's bound app identity; cross-app calls are subject to the
40
40
  * deployment's authorization policy.
41
41
  */
42
+ /**
43
+ * Bound on `intent` (ggui#1046), in characters — one exported number the
44
+ * door checks and readers may cap at; standalone (not tied to any other
45
+ * text bound: they move independently).
46
+ */
47
+ export declare const OPS_GENERATE_BLUEPRINT_INTENT_MAX_CHARS = 2000;
42
48
  export declare const opsGenerateBlueprintInputSchema: z.ZodObject<{
43
49
  appId: z.ZodOptional<z.ZodString>;
44
50
  contract: z.ZodType<import("../index.js").DataContract, unknown, z.core.$ZodTypeInternals<import("../index.js").DataContract, unknown>>;
@@ -47,6 +53,7 @@ export declare const opsGenerateBlueprintInputSchema: z.ZodObject<{
47
53
  aesthetic: z.ZodOptional<z.ZodString>;
48
54
  context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../index.js").JsonValue, unknown, z.core.$ZodTypeInternals<import("../index.js").JsonValue, unknown>>>>;
49
55
  seedPrompt: z.ZodOptional<z.ZodString>;
56
+ intent: z.ZodOptional<z.ZodString>;
50
57
  setAsOperatorDefault: z.ZodOptional<z.ZodBoolean>;
51
58
  }, z.core.$strict>;
52
59
  /**
@@ -69,11 +76,11 @@ export declare const opsGenerateBlueprintOutputSchema: z.ZodObject<{
69
76
  * - Seeding pre-vetted blueprints at deploy time (fixture corpus,
70
77
  * migration imports).
71
78
  * - Round-tripping export+reimport — operator exports a blueprint
72
- * from one tenant and re-registers it in another.
79
+ * from one app (or one deployment) and re-registers it in another.
73
80
  * - Reapplying a fixed version of a blueprint after live edits
74
81
  * (manual recovery from a bad generate run).
75
82
  *
76
- * Same tenancy + variance + default-pin semantics as
83
+ * Same app-scoping + variance + default-pin semantics as
77
84
  * `*_generate_*`; the only difference is the LLM/generator dispatch
78
85
  * is replaced with a verbatim accept of the operator's
79
86
  * `componentCode` string.
@@ -1 +1 @@
1
- {"version":3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AC;AAEZ,eAAO,MAAM,8BAA8B;;kBAIhC,CAAC;AAEZ;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,gCAAgC,CACxC,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,gCAAgC,CACxC,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC"}
@@ -7,7 +7,7 @@
7
7
  * persisting the result. Optionally pins as the operator default
8
8
  * for its `(appId, contractHash)` group.
9
9
  * - `ggui_ops_list_blueprints` — enumerate blueprint metadata
10
- * (no code body) under tenancy + optional filters. Sorted by
10
+ * (no code body) under the caller's app scope + optional filters. Sorted by
11
11
  * `createdAt desc`.
12
12
  * - `ggui_ops_update_blueprint` — toggle the operator-default flag
13
13
  * and/or patch variance tags. Immutable fields (contractHash,
@@ -19,11 +19,12 @@
19
19
  * The schemas live in `@ggui-ai/protocol` (not the handler package)
20
20
  * for the same reason all wire-shape schemas do: the protocol package
21
21
  * is the source of truth for every MCP wire surface, and consumers
22
- * (cloud pod handlers, console UI, fixture authors) can import from
22
+ * (a hosted deployment's handlers, console UI, fixture authors) can import from
23
23
  * one place. Handler package wraps these into `SharedHandler`
24
24
  * factories.
25
25
  */
26
26
  import { z } from 'zod';
27
+ import { GENERATOR_ID_PATTERN } from '../types/blueprint-source.js';
27
28
  import { dataContractSchema, jsonValueSchema, } from './data-contract.js';
28
29
  import { blueprintSchema, blueprintVarianceSchema, llmBlueprintSourceSchema, userBlueprintSourceSchema, } from './blueprint.js';
29
30
  /**
@@ -41,6 +42,12 @@ import { blueprintSchema, blueprintVarianceSchema, llmBlueprintSourceSchema, use
41
42
  * caller's bound app identity; cross-app calls are subject to the
42
43
  * deployment's authorization policy.
43
44
  */
45
+ /**
46
+ * Bound on `intent` (ggui#1046), in characters — one exported number the
47
+ * door checks and readers may cap at; standalone (not tied to any other
48
+ * text bound: they move independently).
49
+ */
50
+ export const OPS_GENERATE_BLUEPRINT_INTENT_MAX_CHARS = 2000;
44
51
  export const opsGenerateBlueprintInputSchema = z
45
52
  .object({
46
53
  appId: z
@@ -51,9 +58,11 @@ export const opsGenerateBlueprintInputSchema = z
51
58
  contract: dataContractSchema,
52
59
  generator: z
53
60
  .string()
54
- .min(1)
61
+ .regex(GENERATOR_ID_PATTERN, {
62
+ error: 'generator is an identity `ui-gen-<tier>` — one tier token, no model segment (ggui#924)',
63
+ })
55
64
  .optional()
56
- .describe('Generator slug (e.g. `ui-gen-default-haiku-4-5`). When omitted, dispatches through `GeneratorRegistry.defaultGenerator()`.'),
65
+ .describe('Generator identity (e.g. `ui-gen-default`; the model is chosen by the deployment and reported on `source.model`). When omitted, dispatches through `GeneratorRegistry.defaultGenerator()`.'),
57
66
  persona: z
58
67
  .string()
59
68
  .optional()
@@ -70,6 +79,12 @@ export const opsGenerateBlueprintInputSchema = z
70
79
  .string()
71
80
  .optional()
72
81
  .describe("The raw operator prompt that produced this variant. Round-trip input for the variant-selector + audit trail."),
82
+ intent: z
83
+ .string()
84
+ .trim()
85
+ .max(OPS_GENERATE_BLUEPRINT_INTENT_MAX_CHARS)
86
+ .optional()
87
+ .describe(`What the operator wants generated for this contract, in plain words — the prompt the generator composes from (at most ${OPS_GENERATE_BLUEPRINT_INTENT_MAX_CHARS} characters). Not part of the cache identity: two calls that differ only in \`intent\` share a variant key. When omitted, the generator falls back to \`seedPrompt\`; omitting both is a caller gap that a future release refuses.`),
73
88
  setAsOperatorDefault: z
74
89
  .boolean()
75
90
  .optional()
@@ -106,11 +121,11 @@ export const opsGenerateBlueprintOutputSchema = z
106
121
  * - Seeding pre-vetted blueprints at deploy time (fixture corpus,
107
122
  * migration imports).
108
123
  * - Round-tripping export+reimport — operator exports a blueprint
109
- * from one tenant and re-registers it in another.
124
+ * from one app (or one deployment) and re-registers it in another.
110
125
  * - Reapplying a fixed version of a blueprint after live edits
111
126
  * (manual recovery from a bad generate run).
112
127
  *
113
- * Same tenancy + variance + default-pin semantics as
128
+ * Same app-scoping + variance + default-pin semantics as
114
129
  * `*_generate_*`; the only difference is the LLM/generator dispatch
115
130
  * is replaced with a verbatim accept of the operator's
116
131
  * `componentCode` string.
@@ -206,9 +221,11 @@ export const opsListBlueprintsInputSchema = z
206
221
  .describe('Filter to a single `(appId, contractHash)` group. Combine with `generator` / `persona` to narrow within the group.'),
207
222
  generator: z
208
223
  .string()
209
- .min(1)
224
+ .regex(GENERATOR_ID_PATTERN, {
225
+ error: 'generator is an identity `ui-gen-<tier>` — one tier token, no model segment (ggui#924)',
226
+ })
210
227
  .optional()
211
- .describe('Filter to engine-generated blueprints (`source.kind === "llm"`) whose `source.generator` equals this slug. `user`-sourced rows never match (they carry no engine provenance).'),
228
+ .describe('Filter to engine-generated blueprints (`source.kind === "llm"`) whose `source.generator` equals this identity (`ui-gen-<tier>`, e.g. `ui-gen-advanced`). `user`-sourced rows never match (they carry no engine provenance).'),
212
229
  persona: z
213
230
  .string()
214
231
  .optional()
@@ -7,7 +7,7 @@ import { renderInputShape } from './mcp.js';
7
7
  * either wire form (canonical `provider:model` or LiteLLM `provider/model`;
8
8
  * aliases resolve in both). The render handler parses this BEFORE its
9
9
  * pre-generation gate, so a malformed route is a contract error at zod path
10
- * `infra.model` — never a policy refusal (`model_not_in_tier` is reserved
10
+ * `infra.model` — never a policy refusal (`model_not_allowed` is reserved
11
11
  * for a well-formed route with no rate row on the effective tier).
12
12
  *
13
13
  * Kept OUT of the registered shape on purpose: `@ggui-ai/iframe-runtime`
@@ -0,0 +1,48 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The rendering-context vocabulary — how and where a generated component
4
+ * will be displayed (ggui#1000, `items[].rendering?` on the bootstrap door).
5
+ *
6
+ * ONE vocabulary. It used to exist twice as hand-declared unions
7
+ * (`@ggui-ai/mcp-server-core` `UiGenerateInput.rendering`, `@ggui-ai/ui-gen`
8
+ * `RenderingContext`) and nowhere as a schema; a wire that carries it needs
9
+ * a validator, so it lives here and every consumer derives its type from
10
+ * this schema — never a second spelling, never a narrower one at a door.
11
+ *
12
+ * Parties and obligations: a SENDER (a host announcing where the
13
+ * component renders; a provisioning caller pre-minting for a chip) sends
14
+ * `{ shell, device, viewport? }` from this vocabulary and nothing else; a
15
+ * RECEIVER validates with this schema and answers an invalid value with its
16
+ * surface's typed refusal (the bootstrap door: `400 invalid_rendering`);
17
+ * what a lane can JUDGE for a given shell/device (its canvas pair) is that
18
+ * lane's policy, reported on its receipt — never a trimmed vocabulary.
19
+ * Absent ⇒ the receiver's default behaviour, unchanged.
20
+ */
21
+ export declare const RENDERING_SHELLS: readonly ["chat", "fullscreen", "partial"];
22
+ export declare const RENDERING_DEVICES: readonly ["mobile", "tablet", "desktop", "spatial"];
23
+ export type RenderingShell = (typeof RENDERING_SHELLS)[number];
24
+ export type RenderingDevice = (typeof RENDERING_DEVICES)[number];
25
+ /** Viewport in CSS pixels — both dimensions, finite and positive. */
26
+ export declare const renderingViewportSchema: z.ZodObject<{
27
+ width: z.ZodNumber;
28
+ height: z.ZodNumber;
29
+ }, z.core.$strict>;
30
+ export declare const renderingContextSchema: z.ZodObject<{
31
+ device: z.ZodEnum<{
32
+ desktop: "desktop";
33
+ mobile: "mobile";
34
+ tablet: "tablet";
35
+ spatial: "spatial";
36
+ }>;
37
+ shell: z.ZodEnum<{
38
+ fullscreen: "fullscreen";
39
+ chat: "chat";
40
+ partial: "partial";
41
+ }>;
42
+ viewport: z.ZodOptional<z.ZodObject<{
43
+ width: z.ZodNumber;
44
+ height: z.ZodNumber;
45
+ }, z.core.$strict>>;
46
+ }, z.core.$strict>;
47
+ export type RenderingContext = z.infer<typeof renderingContextSchema>;
48
+ //# sourceMappingURL=rendering-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rendering-context.d.ts","sourceRoot":"","sources":["../../src/schemas/rendering-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,gBAAgB,4CAA6C,CAAC;AAC3E,eAAO,MAAM,iBAAiB,qDAAsD,CAAC;AAErF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/D,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE,qEAAqE;AACrE,eAAO,MAAM,uBAAuB;;;kBAKzB,CAAC;AAEZ,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;kBASxB,CAAC;AAEZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The rendering-context vocabulary — how and where a generated component
4
+ * will be displayed (ggui#1000, `items[].rendering?` on the bootstrap door).
5
+ *
6
+ * ONE vocabulary. It used to exist twice as hand-declared unions
7
+ * (`@ggui-ai/mcp-server-core` `UiGenerateInput.rendering`, `@ggui-ai/ui-gen`
8
+ * `RenderingContext`) and nowhere as a schema; a wire that carries it needs
9
+ * a validator, so it lives here and every consumer derives its type from
10
+ * this schema — never a second spelling, never a narrower one at a door.
11
+ *
12
+ * Parties and obligations: a SENDER (a host announcing where the
13
+ * component renders; a provisioning caller pre-minting for a chip) sends
14
+ * `{ shell, device, viewport? }` from this vocabulary and nothing else; a
15
+ * RECEIVER validates with this schema and answers an invalid value with its
16
+ * surface's typed refusal (the bootstrap door: `400 invalid_rendering`);
17
+ * what a lane can JUDGE for a given shell/device (its canvas pair) is that
18
+ * lane's policy, reported on its receipt — never a trimmed vocabulary.
19
+ * Absent ⇒ the receiver's default behaviour, unchanged.
20
+ */
21
+ export const RENDERING_SHELLS = ['chat', 'fullscreen', 'partial'];
22
+ export const RENDERING_DEVICES = ['mobile', 'tablet', 'desktop', 'spatial'];
23
+ /** Viewport in CSS pixels — both dimensions, finite and positive. */
24
+ export const renderingViewportSchema = z
25
+ .object({
26
+ width: z.number().finite().positive(),
27
+ height: z.number().finite().positive(),
28
+ })
29
+ .strict();
30
+ export const renderingContextSchema = z
31
+ .object({
32
+ /** Device category — affects touch targets, column count, density. */
33
+ device: z.enum(RENDERING_DEVICES),
34
+ /** Shell type — the container the component renders in. */
35
+ shell: z.enum(RENDERING_SHELLS),
36
+ /** Viewport dimensions in CSS pixels (optional). */
37
+ viewport: renderingViewportSchema.optional(),
38
+ })
39
+ .strict();
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * - `llm` — engine-generated. `generator` is the slug of the
13
13
  * {@link UiGenerator} that produced the component code; `model` is
14
- * the LLM model id the engine called. Both REQUIRED: every
14
+ * the route the engine called, as a `ModelRef`. Both REQUIRED: every
15
15
  * generation mint site has them in scope, and an engine-generated
16
16
  * artifact without them is not a real state.
17
17
  * - `user` — developer-registered / hand-authored. Covers
@@ -30,21 +30,41 @@
30
30
  * cache (invalidation = regeneration, never data loss), so unlabeled
31
31
  * rows are dropped at the trust boundary, never coerced.
32
32
  */
33
+ import { type ModelRef } from "./llm-route.js";
33
34
  /** Closed list of `BlueprintSource` discriminants. */
34
35
  export declare const BLUEPRINT_SOURCE_KINDS: readonly ["llm", "user", "curated"];
35
36
  /** Discriminant of {@link BlueprintSource}. */
36
37
  export type BlueprintSourceKind = (typeof BLUEPRINT_SOURCE_KINDS)[number];
38
+ /**
39
+ * The de-modeled generator identity (ggui#924): `ui-gen-` + ONE tier token
40
+ * — `ui-gen-default`, `ui-gen-advanced`, or an operator-defined tier. No
41
+ * model segment: the model is its own field, so a model retirement never
42
+ * renames an identity or re-keys a stored record. The template admits any
43
+ * `ui-gen-*` at the type level; {@link isGeneratorId} is the grammar.
44
+ */
45
+ export declare const GENERATOR_ID_PATTERN: RegExp;
46
+ /** A generator identity — see {@link GENERATOR_ID_PATTERN}. */
47
+ export type GeneratorId = `ui-gen-${string}`;
48
+ /** Whether `value` is a generator identity: one tier token, no model segment. */
49
+ export declare function isGeneratorId(value: string): value is GeneratorId;
37
50
  /** Engine-generated — full engine provenance is mandatory. */
38
51
  export interface LlmBlueprintSource {
39
52
  readonly kind: "llm";
40
53
  /**
41
- * Slug of the generator that produced the component code (e.g.
42
- * `'ui-gen-default-haiku-4-5'`). The server's `GeneratorRegistry` is
43
- * the authority for which slugs exist on a given deployment.
54
+ * The generator identity that produced the component code (e.g.
55
+ * `'ui-gen-default'`), de-modeled — see {@link GENERATOR_ID_PATTERN}.
56
+ * The server's `GeneratorRegistry` is the authority for which
57
+ * identities exist on a given deployment.
58
+ */
59
+ readonly generator: GeneratorId;
60
+ /**
61
+ * The route the generator's LLM call used, rendered in the registry's
62
+ * spelling (`<prefix>/<model>`; {@link ModelRef}, composed only by
63
+ * `modelRefOfRoute`). Registry ids (`'anthropic/claude-haiku-4-5'`) are
64
+ * the subset the registry lists; a self-hoster's bedrock or OpenRouter
65
+ * route is a ref too. One spelling per route: a dated wire id is refused.
44
66
  */
45
- readonly generator: string;
46
- /** Model id of the LLM call the generator made. */
47
- readonly model: string;
67
+ readonly model: ModelRef;
48
68
  }
49
69
  /** Developer-registered / hand-authored — no engine provenance exists. */
50
70
  export interface UserBlueprintSource {
@@ -1 +1 @@
1
- {"version":3,"file":"blueprint-source.d.ts","sourceRoot":"","sources":["../../src/types/blueprint-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAIH,sDAAsD;AACtD,eAAO,MAAM,sBAAsB,qCAAsC,CAAC;AAE1E,+CAA+C;AAC/C,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,8DAA8D;AAC9D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,0EAA0E;AAC1E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,0EAA0E;AAC1E,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;CAC1B;AAED,MAAM,MAAM,eAAe,GACvB,kBAAkB,GAClB,mBAAmB,GACnB,sBAAsB,CAAC;AAE3B;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAoB3E;AAED,uDAAuD;AACvD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAE1E;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,0BAA0B;;;;CAI7B,CAAC;AAEX;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,C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CAAC;CAC1B;AAED,0EAA0E;AAC1E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,0EAA0E;AAC1E,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;CAC1B;AAED,MAAM,MAAM,eAAe,GACvB,kBAAkB,GAClB,mBAAmB,GACnB,sBAAsB,CAAC;AAE3B;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAuB3E;AAED,uDAAuD;AACvD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAE1E;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,0BAA0B;;;;CAI7B,CAAC;AAEX;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;IACzC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,qEAAqE;AACrE,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,eAAe,GACtB,mBAAmB,CAQrB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE;IACzC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC,GAAG,eAAe,GAAG,IAAI,CAMzB"}
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * - `llm` — engine-generated. `generator` is the slug of the
13
13
  * {@link UiGenerator} that produced the component code; `model` is
14
- * the LLM model id the engine called. Both REQUIRED: every
14
+ * the route the engine called, as a `ModelRef`. Both REQUIRED: every
15
15
  * generation mint site has them in scope, and an engine-generated
16
16
  * artifact without them is not a real state.
17
17
  * - `user` — developer-registered / hand-authored. Covers
@@ -31,8 +31,21 @@
31
31
  * rows are dropped at the trust boundary, never coerced.
32
32
  */
33
33
  import { isRecord } from "../validation/is-record.js";
34
+ import { isModelRef } from "./llm-route.js";
34
35
  /** Closed list of `BlueprintSource` discriminants. */
35
36
  export const BLUEPRINT_SOURCE_KINDS = ["llm", "user", "curated"];
37
+ /**
38
+ * The de-modeled generator identity (ggui#924): `ui-gen-` + ONE tier token
39
+ * — `ui-gen-default`, `ui-gen-advanced`, or an operator-defined tier. No
40
+ * model segment: the model is its own field, so a model retirement never
41
+ * renames an identity or re-keys a stored record. The template admits any
42
+ * `ui-gen-*` at the type level; {@link isGeneratorId} is the grammar.
43
+ */
44
+ export const GENERATOR_ID_PATTERN = /^ui-gen-[a-z0-9]+$/;
45
+ /** Whether `value` is a generator identity: one tier token, no model segment. */
46
+ export function isGeneratorId(value) {
47
+ return GENERATOR_ID_PATTERN.test(value);
48
+ }
36
49
  /**
37
50
  * Validating narrower for trust boundaries (DB row → union, JSON
38
51
  * artifact → union). Returns a CANONICAL rebuild of the union value —
@@ -50,9 +63,12 @@ export function parseBlueprintSource(value) {
50
63
  case "llm": {
51
64
  const generator = v["generator"];
52
65
  const model = v["model"];
53
- if (typeof generator !== "string" || generator.length === 0)
66
+ // ggui#924: a modeled identity (`ui-gen-default-haiku-4-5`) or a
67
+ // non-route model (a bare `claude-…`, a dated API name) is not a
68
+ // provenance — null.
69
+ if (typeof generator !== "string" || !isGeneratorId(generator))
54
70
  return null;
55
- if (typeof model !== "string" || model.length === 0)
71
+ if (typeof model !== "string" || !isModelRef(model))
56
72
  return null;
57
73
  return { kind: "llm", generator, model };
58
74
  }
@@ -18,7 +18,7 @@
18
18
  * advanced-generator iterative-loop output routinely exceeds
19
19
  * them). The in-memory adapter skips the body store (in-process
20
20
  * `Map<codeHash, string>`).
21
- * - **Tenancy.** Scoped per `(appId, contractHash)`. Different apps'
21
+ * - **App scope.** Scoped per `(appId, contractHash)`. Different apps'
22
22
  * contract may coincidentally hash the same; their blueprints
23
23
  * must never cross-pollinate. Rows are keyed by `blueprintId`;
24
24
  * lookups go through an indexed `(appId, contractHash)` query.
@@ -127,7 +127,7 @@ export interface Blueprint {
127
127
  * key.
128
128
  */
129
129
  readonly contractHash: string;
130
- /** Tenancy scope. Composite secondary key with `contractHash`. */
130
+ /** App scope. Composite secondary key with `contractHash`. */
131
131
  readonly appId: string;
132
132
  /**
133
133
  * S3 URL (`s3://<bucket>/<key>`) of the generated code body when
@@ -1 +1 @@
1
- {"version":3,"file":"blueprint.d.ts","sourceRoot":"","sources":["../../src/types/blueprint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,sBAAsB;IACrC;;qDAEiD;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;0CACsC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;yCACqC;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;yCACqC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,wBAAwB;IACvC;8CAC0C;IAC1C,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACnD;yCACqC;IACrC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAA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ACH,MAAM,WAAW,SAAS;IACxB,mEAAmE;IACnE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC;;;;;;;;;OASG;IACH,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC;;;;;;;;;OASG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC;IAClC,qDAAqD;IACrD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,UAAU,CAAC;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChD"}
@@ -188,7 +188,7 @@ export interface StreamChannelEntry {
188
188
  * `CTR_SCHEMA_INCOMPAT` linter additionally checks that the feed
189
189
  * tool's declared return schema is a subset of this schema — see
190
190
  * the docstring on {@link ActionEntry.schema} for the schema-subset
191
- * algorithm and the `SCHEMA_MISMATCH_ERROR` failure surface.
191
+ * algorithm and the `schema_mismatch_error` failure surface.
192
192
  */
193
193
  schema: JsonSchema;
194
194
  /** Example payload (used for documentation and smoke testing). Typed as {@link JsonValue}. */
@@ -276,7 +276,7 @@ export interface ActionEntry {
276
276
  * advisory — the agent owns the actual tool call on its next turn
277
277
  * and is responsible for shaping the payload as the tool expects.
278
278
  * For tools registered on THIS server, the F4 schema-compat checker
279
- * surfaces a `SCHEMA_MISMATCH_ERROR` at render-time / blueprint-
279
+ * surfaces a `schema_mismatch_error` at render-time / blueprint-
280
280
  * registration-time so authors get fail-loud feedback.
281
281
  *
282
282
  * The canonical algorithm lives in
@@ -610,7 +610,7 @@ export interface GadgetDescriptor {
610
610
  package: string;
611
611
  /**
612
612
  * ggui-hosted bundle URL — the preferred distribution path. Same
613
- * origin as the iframe in single-tenant OSS deployments (served
613
+ * origin as the iframe in single-deployment installs (served
614
614
  * from `/_ggui/libs/<libId>/bundle.js`) and the ggui marketplace
615
615
  * CDN in cloud deployments. CSP `script-src` allowlists only the
616
616
  * ggui origin — no per-plugin third-party origins.