@ggui-ai/protocol 0.2.0-alpha.4 → 0.3.0-rc.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 (197) hide show
  1. package/README.md +16 -16
  2. package/dist/envelope-adapters.d.ts +6 -5
  3. package/dist/envelope-adapters.d.ts.map +1 -1
  4. package/dist/envelope-adapters.js +3 -3
  5. package/dist/envelopes/builders.d.ts +6 -32
  6. package/dist/envelopes/builders.d.ts.map +1 -1
  7. package/dist/envelopes/builders.js +3 -25
  8. package/dist/errors/version-mismatch.d.ts +1 -1
  9. package/dist/errors/version-mismatch.js +1 -1
  10. package/dist/gadgets/resolve-app-gadgets.d.ts +10 -0
  11. package/dist/gadgets/resolve-app-gadgets.d.ts.map +1 -0
  12. package/dist/gadgets/resolve-app-gadgets.js +19 -0
  13. package/dist/gadgets/resolve-contract-gadgets.d.ts +6 -6
  14. package/dist/gadgets/resolve-contract-gadgets.js +5 -5
  15. package/dist/gadgets/stdlib-gadgets.d.ts +1 -1
  16. package/dist/gadgets/stdlib-gadgets.d.ts.map +1 -1
  17. package/dist/gadgets/stdlib-gadgets.js +43 -22
  18. package/dist/iframe-bridge.d.ts +4 -43
  19. package/dist/iframe-bridge.d.ts.map +1 -1
  20. package/dist/iframe-bridge.js +4 -141
  21. package/dist/index.d.ts +60 -62
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +66 -61
  24. package/dist/integrations/mcp-apps.d.ts +83 -38
  25. package/dist/integrations/mcp-apps.d.ts.map +1 -1
  26. package/dist/integrations/mcp-apps.js +98 -52
  27. package/dist/recommended-prompts.d.ts +1 -1
  28. package/dist/recommended-prompts.js +1 -1
  29. package/dist/registry/blueprint-key.d.ts +3 -0
  30. package/dist/registry/blueprint-key.d.ts.map +1 -1
  31. package/dist/registry/blueprint-key.js +9 -0
  32. package/dist/registry/blueprint-stamp.d.ts +12 -0
  33. package/dist/registry/blueprint-stamp.d.ts.map +1 -0
  34. package/dist/registry/blueprint-stamp.js +12 -0
  35. package/dist/registry/canonicalize-contract.d.ts +31 -2
  36. package/dist/registry/canonicalize-contract.d.ts.map +1 -1
  37. package/dist/registry/canonicalize-contract.js +125 -13
  38. package/dist/registry/portable-blueprint.d.ts +64 -0
  39. package/dist/registry/portable-blueprint.d.ts.map +1 -0
  40. package/dist/registry/portable-blueprint.js +103 -0
  41. package/dist/registry/summarize-contract.d.ts +7 -2
  42. package/dist/registry/summarize-contract.d.ts.map +1 -1
  43. package/dist/registry/summarize-contract.js +12 -3
  44. package/dist/registry/variant-key.d.ts +17 -0
  45. package/dist/registry/variant-key.d.ts.map +1 -0
  46. package/dist/registry/variant-key.js +22 -0
  47. package/dist/schema-learning/derive-contract.d.ts +2 -2
  48. package/dist/schema-learning/derive-contract.js +2 -2
  49. package/dist/schema-learning/merge.d.ts.map +1 -1
  50. package/dist/schema-learning/merge.js +3 -2
  51. package/dist/schemas/app-theme.d.ts +38 -0
  52. package/dist/schemas/app-theme.d.ts.map +1 -0
  53. package/dist/schemas/app-theme.js +43 -0
  54. package/dist/schemas/blueprint.d.ts +30 -11
  55. package/dist/schemas/blueprint.d.ts.map +1 -1
  56. package/dist/schemas/blueprint.js +62 -26
  57. package/dist/schemas/data-contract.d.ts +28 -30
  58. package/dist/schemas/data-contract.d.ts.map +1 -1
  59. package/dist/schemas/data-contract.js +26 -26
  60. package/dist/schemas/handshake-suggestion.d.ts +2 -4
  61. package/dist/schemas/handshake-suggestion.d.ts.map +1 -1
  62. package/dist/schemas/handshake-suggestion.js +5 -14
  63. package/dist/schemas/mcp.d.ts +240 -58
  64. package/dist/schemas/mcp.d.ts.map +1 -1
  65. package/dist/schemas/mcp.js +285 -93
  66. package/dist/schemas/ops-blueprint.d.ts +12 -12
  67. package/dist/schemas/ops-blueprint.d.ts.map +1 -1
  68. package/dist/schemas/ops-blueprint.js +14 -24
  69. package/dist/screen-blueprints/define.d.ts +2 -2
  70. package/dist/screen-blueprints/match.d.ts +12 -7
  71. package/dist/screen-blueprints/match.d.ts.map +1 -1
  72. package/dist/screen-blueprints/match.js +7 -5
  73. package/dist/screen-blueprints/types.d.ts +14 -18
  74. package/dist/screen-blueprints/types.d.ts.map +1 -1
  75. package/dist/transport/websocket.d.ts +5 -26
  76. package/dist/transport/websocket.d.ts.map +1 -1
  77. package/dist/types/app-config.d.ts +0 -1
  78. package/dist/types/app-config.d.ts.map +1 -1
  79. package/dist/types/auth.d.ts +1 -46
  80. package/dist/types/auth.d.ts.map +1 -1
  81. package/dist/types/blueprint-source.d.ts +123 -0
  82. package/dist/types/blueprint-source.d.ts.map +1 -0
  83. package/dist/types/blueprint-source.js +126 -0
  84. package/dist/types/blueprint.d.ts +25 -18
  85. package/dist/types/blueprint.d.ts.map +1 -1
  86. package/dist/types/contract-inference.d.ts +2 -43
  87. package/dist/types/contract-inference.d.ts.map +1 -1
  88. package/dist/types/data-contract.d.ts +59 -344
  89. package/dist/types/data-contract.d.ts.map +1 -1
  90. package/dist/types/data-contract.js +5 -12
  91. package/dist/types/events.d.ts +31 -69
  92. package/dist/types/events.d.ts.map +1 -1
  93. package/dist/types/{render-event.d.ts → ggui-session-event.d.ts} +15 -15
  94. package/dist/types/ggui-session-event.d.ts.map +1 -0
  95. package/dist/types/{render-event.js → ggui-session-event.js} +5 -5
  96. package/dist/types/handshake-suggestion.d.ts +49 -35
  97. package/dist/types/handshake-suggestion.d.ts.map +1 -1
  98. package/dist/types/host-context.d.ts +8 -8
  99. package/dist/types/host-context.d.ts.map +1 -1
  100. package/dist/types/host-context.js +5 -5
  101. package/dist/types/invoke.d.ts +1 -13
  102. package/dist/types/invoke.d.ts.map +1 -1
  103. package/dist/types/{canvas-lifecycle.d.ts → lifecycle.d.ts} +35 -37
  104. package/dist/types/lifecycle.d.ts.map +1 -0
  105. package/dist/types/{canvas-lifecycle.js → lifecycle.js} +12 -14
  106. package/dist/types/live-channel.d.ts +48 -104
  107. package/dist/types/live-channel.d.ts.map +1 -1
  108. package/dist/types/llm.d.ts +13 -24
  109. package/dist/types/llm.d.ts.map +1 -1
  110. package/dist/types/llm.js +23 -53
  111. package/dist/types/mcp.d.ts +55 -176
  112. package/dist/types/mcp.d.ts.map +1 -1
  113. package/dist/types/mcp.js +2 -2
  114. package/dist/types/oauth-user-id.d.ts +12 -0
  115. package/dist/types/oauth-user-id.d.ts.map +1 -0
  116. package/dist/types/oauth-user-id.js +10 -0
  117. package/dist/types/portable-blueprint.d.ts +53 -0
  118. package/dist/types/portable-blueprint.d.ts.map +1 -0
  119. package/dist/types/portable-blueprint.js +8 -0
  120. package/dist/types/{session.d.ts → render.d.ts} +51 -53
  121. package/dist/types/render.d.ts.map +1 -0
  122. package/dist/types/thread.d.ts.map +1 -1
  123. package/dist/types/thread.js +3 -3
  124. package/dist/types/ui-generator.d.ts +5 -46
  125. package/dist/types/ui-generator.d.ts.map +1 -1
  126. package/dist/types/ui-generator.js +1 -53
  127. package/dist/validation/ajv-runtime.d.ts +3 -3
  128. package/dist/validation/ajv-runtime.d.ts.map +1 -1
  129. package/dist/validation/ajv-runtime.js +6 -5
  130. package/dist/validation/contract-validator.d.ts +23 -22
  131. package/dist/validation/contract-validator.d.ts.map +1 -1
  132. package/dist/validation/contract-validator.js +28 -26
  133. package/dist/validation/cross-references.d.ts +3 -3
  134. package/dist/validation/cross-references.js +3 -3
  135. package/dist/validation/hygiene-rules.d.ts +9 -9
  136. package/dist/validation/hygiene-rules.js +13 -13
  137. package/dist/validation/is-record.d.ts +17 -0
  138. package/dist/validation/is-record.d.ts.map +1 -0
  139. package/dist/validation/is-record.js +18 -0
  140. package/dist/validation/lint-contract.d.ts +1 -1
  141. package/dist/validation/lint-contract.js +3 -3
  142. package/dist/validation/name-invariants.d.ts +4 -4
  143. package/dist/validation/name-invariants.js +4 -4
  144. package/dist/validation/reserved-channels.d.ts +43 -46
  145. package/dist/validation/reserved-channels.d.ts.map +1 -1
  146. package/dist/validation/reserved-channels.js +14 -177
  147. package/dist/validation/resolve-stream-channel.d.ts +3 -9
  148. package/dist/validation/resolve-stream-channel.d.ts.map +1 -1
  149. package/dist/validation/resolve-stream-channel.js +3 -4
  150. package/dist/validation/sanitize-error.d.ts +10 -9
  151. package/dist/validation/sanitize-error.d.ts.map +1 -1
  152. package/dist/validation/sanitize-error.js +19 -18
  153. package/dist/validation/schema-compat-invariants.d.ts +1 -1
  154. package/dist/validation/schema-compat-invariants.js +3 -3
  155. package/dist/validation/schema-meta-validation.d.ts +4 -4
  156. package/dist/validation/schema-meta-validation.d.ts.map +1 -1
  157. package/dist/validation/schema-meta-validation.js +7 -9
  158. package/dist/validation/schema-subset.d.ts +9 -8
  159. package/dist/validation/schema-subset.d.ts.map +1 -1
  160. package/dist/validation/ui-security.d.ts +0 -17
  161. package/dist/validation/ui-security.d.ts.map +1 -1
  162. package/dist/validation/ui-security.js +17 -22
  163. package/dist/validation/zod-to-json-schema.d.ts +1 -1
  164. package/dist/validation/zod-to-json-schema.d.ts.map +1 -1
  165. package/dist/validation/zod-to-json-schema.js +4 -3
  166. package/dist/version.d.ts +783 -9
  167. package/dist/version.d.ts.map +1 -1
  168. package/dist/version.js +782 -8
  169. package/package.json +2 -2
  170. package/dist/bridge/invoke-agent.d.ts +0 -65
  171. package/dist/bridge/invoke-agent.d.ts.map +0 -1
  172. package/dist/bridge/invoke-agent.js +0 -113
  173. package/dist/stream/stream-parser.d.ts +0 -62
  174. package/dist/stream/stream-parser.d.ts.map +0 -1
  175. package/dist/stream/stream-parser.js +0 -199
  176. package/dist/types/canvas-lifecycle.d.ts.map +0 -1
  177. package/dist/types/credential.d.ts +0 -41
  178. package/dist/types/credential.d.ts.map +0 -1
  179. package/dist/types/credential.js +0 -32
  180. package/dist/types/data-bindings.d.ts +0 -322
  181. package/dist/types/data-bindings.d.ts.map +0 -1
  182. package/dist/types/data-bindings.js +0 -29
  183. package/dist/types/feedback.d.ts +0 -22
  184. package/dist/types/feedback.d.ts.map +0 -1
  185. package/dist/types/feedback.js +0 -7
  186. package/dist/types/mcp-proxy.d.ts +0 -67
  187. package/dist/types/mcp-proxy.d.ts.map +0 -1
  188. package/dist/types/mcp-proxy.js +0 -46
  189. package/dist/types/openrouter-models.d.ts +0 -23
  190. package/dist/types/openrouter-models.d.ts.map +0 -1
  191. package/dist/types/openrouter-models.js +0 -4843
  192. package/dist/types/region.d.ts +0 -26
  193. package/dist/types/region.d.ts.map +0 -1
  194. package/dist/types/region.js +0 -36
  195. package/dist/types/render-event.d.ts.map +0 -1
  196. package/dist/types/session.d.ts.map +0 -1
  197. /package/dist/types/{session.js → render.js} +0 -0
@@ -11,7 +11,7 @@
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,
14
- * appId, codeS3Url, codeHash, generator, createdAt, createdBy)
14
+ * appId, codeS3Url, codeHash, source, createdAt, createdBy)
15
15
  * never mutate; the tool MUST refuse them on input.
16
16
  * - `ggui_ops_delete_blueprint` — idempotent removal. Second delete
17
17
  * for the same id returns `{deleted: true}` — never throws.
@@ -25,7 +25,7 @@
25
25
  */
26
26
  import { z } from 'zod';
27
27
  import { dataContractSchema, jsonValueSchema, } from './data-contract.js';
28
- import { blueprintSchema, blueprintVarianceSchema } from './blueprint.js';
28
+ import { blueprintSchema, blueprintVarianceSchema, llmBlueprintSourceSchema, userBlueprintSourceSchema, } from './blueprint.js';
29
29
  /**
30
30
  * `ggui_ops_generate_blueprint` input. Operator picks the contract +
31
31
  * optional generator override + variance tags. `setAsOperatorDefault`
@@ -74,7 +74,7 @@ export const opsGenerateBlueprintInputSchema = z
74
74
  /**
75
75
  * `ggui_ops_generate_blueprint` output. Metadata-only — the code body
76
76
  * lives in S3 (cloud) or the in-memory code map (OSS) and is fetched
77
- * via the existing push fast-path on cache hit.
77
+ * via the existing render fast-path on cache hit.
78
78
  */
79
79
  export const opsGenerateBlueprintOutputSchema = z
80
80
  .object({
@@ -89,10 +89,7 @@ export const opsGenerateBlueprintOutputSchema = z
89
89
  .max(1)
90
90
  .optional()
91
91
  .describe("Advanced generator's iterative-loop validator score (0-1). Absent for default-generator output."),
92
- generator: z
93
- .string()
94
- .min(1)
95
- .describe('Slug of the generator the dispatch resolved to.'),
92
+ source: llmBlueprintSourceSchema.describe('Provenance stamped on the persisted `Blueprint.source` — always the `llm` arm on this path: `generator` is the engine slug the dispatch resolved to (stamped from the engine\'s own metadata claim); `model` is the LLM model id the engine called.'),
96
93
  })
97
94
  .strict();
98
95
  /**
@@ -113,12 +110,13 @@ export const opsGenerateBlueprintOutputSchema = z
113
110
  * is replaced with a verbatim accept of the operator's
114
111
  * `componentCode` string.
115
112
  *
116
- * `generator` is OPTIONAL here too — when omitted, the handler stamps
117
- * the registry default's slug onto the persisted Blueprint so
118
- * downstream `*_list_blueprints` consumers see a stable provenance
119
- * field. `validatorScore` is never populated (no validator ran);
120
- * operators wanting validator metadata should round-trip through
121
- * `*_generate_*` instead.
113
+ * Provenance is STRUCTURAL on this path — the handler stamps
114
+ * `source: {kind: 'user'}` on the persisted Blueprint (operator-
115
+ * supplied bytes carry no engine claim, and fabricating one is
116
+ * banned), so the input carries no provenance field at all.
117
+ * `validatorScore` is never populated (no validator ran); operators
118
+ * wanting validator metadata should round-trip through `*_generate_*`
119
+ * instead.
122
120
  */
123
121
  export const opsRegisterBlueprintInputSchema = z
124
122
  .object({
@@ -127,11 +125,6 @@ export const opsRegisterBlueprintInputSchema = z
127
125
  .string()
128
126
  .min(1)
129
127
  .describe('Verbatim component-code body to persist. Stored as-is — no LLM call, no validator pass. Operator owns correctness; the handler computes the canonical sha256 codeHash and routes the bytes through the same persistence seams as `*_generate_*`.'),
130
- generator: z
131
- .string()
132
- .min(1)
133
- .optional()
134
- .describe('Optional generator slug to stamp on the persisted Blueprint.generator field — purely an audit/provenance hint for downstream `*_list_blueprints` consumers. Defaults to the registry default slug.'),
135
128
  persona: z
136
129
  .string()
137
130
  .optional()
@@ -166,10 +159,7 @@ export const opsRegisterBlueprintOutputSchema = z
166
159
  .string()
167
160
  .min(1)
168
161
  .describe('Content hash of the persisted code body (full sha256 hex).'),
169
- generator: z
170
- .string()
171
- .min(1)
172
- .describe('Resolved generator slug stamped on the Blueprint.generator field — either the supplied input or the registry default.'),
162
+ source: userBlueprintSourceSchema.describe('Provenance stamped on the persisted `Blueprint.source` — always `{kind: "user"}` on this path: operator-supplied bytes, no LLM dispatch, no engine claim to record.'),
173
163
  })
174
164
  .strict();
175
165
  /**
@@ -201,7 +191,7 @@ export const opsListBlueprintsInputSchema = z
201
191
  .string()
202
192
  .min(1)
203
193
  .optional()
204
- .describe('Filter to blueprints produced by a specific generator slug.'),
194
+ .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).'),
205
195
  persona: z
206
196
  .string()
207
197
  .optional()
@@ -220,7 +210,7 @@ export const opsListBlueprintsOutputSchema = z
220
210
  /**
221
211
  * `ggui_ops_update_blueprint` input. Only mutable fields are present
222
212
  * here — `contractHash`, `appId`, `codeS3Url`, `codeHash`,
223
- * `generator`, `createdAt`, `createdBy` are immutable invariants
213
+ * `source`, `createdAt`, `createdBy` are immutable invariants
224
214
  * and the schema does NOT accept them. Operators who want to
225
215
  * "replace" a row delete + re-generate.
226
216
  */
@@ -2,8 +2,8 @@
2
2
  * `defineScreenBlueprint()` — authoring helper.
3
3
  *
4
4
  * Pass-through identity function. Exists purely to give IDE autocomplete
5
- * and type-checking on blueprint manifest files in
6
- * `cloud/amplify/data/screen-blueprints/*.ts`.
5
+ * and type-checking on a deployment's blueprint manifest files (the
6
+ * hand-authored screen-blueprint catalog).
7
7
  *
8
8
  * The helper is narrow by design — it preserves the literal type of the
9
9
  * blueprint so consumers can do precise inference (e.g. a future typed
@@ -1,21 +1,26 @@
1
1
  /**
2
2
  * Blueprint matcher — pure algorithm.
3
3
  *
4
- * Given a list of candidate `McpScreenBlueprint` rows (retrieved from DDB
5
- * via `byPrimaryDataTool` GSI) and the agent's `sourceTools`, return the
6
- * best matching blueprint.
4
+ * Given a list of candidate `McpScreenBlueprint` rows (retrieved by the
5
+ * hosting deployment via an indexed primary-data-tool query) and the
6
+ * agent's `sourceTools`, return the best matching blueprint.
7
7
  *
8
- * I/O-free. The DDB query layer lives in `core/src/blueprint-matcher.ts`;
9
- * that module's only job is fetching candidates and calling this function.
8
+ * I/O-free. The storage query layer lives in the hosting deployment;
9
+ * its only job is fetching candidates and calling this function.
10
10
  */
11
- import type { ScreenBlueprintSource } from "./types.js";
11
+ import type { BlueprintSource } from "../types/blueprint-source.js";
12
12
  /** Subset of `McpScreenBlueprintRow` the matcher needs. Keeps tests isolated. */
13
13
  export interface MatchableBlueprint {
14
14
  blueprintId: string;
15
15
  serverId: string;
16
16
  dataTools: string[];
17
17
  status: "active" | "stale" | "retired";
18
- source?: ScreenBlueprintSource;
18
+ /**
19
+ * Provenance ({@link BlueprintSource}). Required — rows reach the
20
+ * matcher through a validating narrower at the storage boundary, so
21
+ * an unlabeled candidate is dropped there, never defaulted here.
22
+ */
23
+ source: BlueprintSource;
19
24
  /** Engagement / selection rate populated by the ranker. Undefined = 0. */
20
25
  score?: number;
21
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../src/screen-blueprints/match.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,iFAAiF;AACjF,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IACvC,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAoBD;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,kBAAkB,EACzD,UAAU,EAAE,SAAS,CAAC,EAAE,EACxB,WAAW,EAAE,SAAS,MAAM,EAAE,GAC7B,CAAC,GAAG,IAAI,CAmBV"}
1
+ {"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../src/screen-blueprints/match.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,eAAe,EAAuB,MAAM,8BAA8B,CAAC;AAEzF,iFAAiF;AACjF,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IACvC;;;;OAIG;IACH,MAAM,EAAE,eAAe,CAAC;IACxB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAsBD;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,kBAAkB,EACzD,UAAU,EAAE,SAAS,CAAC,EAAE,EACxB,WAAW,EAAE,SAAS,MAAM,EAAE,GAC7B,CAAC,GAAG,IAAI,CAmBV"}
@@ -1,12 +1,14 @@
1
1
  /**
2
- * Source weights — curated designs outrank generated ones when everything
3
- * else ties. Matches the spec: "curated generally wins when everything else
4
- * ties — because a human made a design call."
2
+ * Source weights — hand-authored designs outrank generated ones when
3
+ * everything else ties. Matches the spec: "curated generally wins when
4
+ * everything else ties — because a human made a design call." `user`
5
+ * (developer-registered) is the same trust class: a human made the
6
+ * design call there too.
5
7
  */
6
8
  const SOURCE_WEIGHT = {
7
9
  curated: 3,
10
+ user: 3,
8
11
  llm: 2,
9
- heuristic: 1,
10
12
  };
11
13
  /**
12
14
  * Select the best-matching blueprint from `candidates` given the agent's
@@ -31,7 +33,7 @@ export function matchBlueprint(candidates, sourceTools) {
31
33
  if (!isSubset(bp.dataTools, available))
32
34
  continue;
33
35
  const overlap = bp.dataTools.length;
34
- const weight = SOURCE_WEIGHT[bp.source ?? "curated"];
36
+ const weight = SOURCE_WEIGHT[bp.source.kind];
35
37
  const score = bp.score ?? 1;
36
38
  scored.push({ blueprint: bp, overlap, rankScore: overlap * weight * score });
37
39
  }
@@ -8,24 +8,20 @@
8
8
  * - the intent, interaction mechanic, and a free-form layout hint
9
9
  *
10
10
  * Blueprints compile deterministically into {@link DataContract}. They are the
11
- * authoring surface of the Screen Designer pipeline — human-curated, heuristic,
12
- * or LLM-produced. All three producers emit the same shape.
11
+ * authoring surface of the Screen Designer pipeline — every producer emits the
12
+ * same shape and stamps its provenance as a {@link BlueprintSource}.
13
13
  */
14
14
  import type { JsonSchema } from "../types/data-contract.js";
15
+ import type { BlueprintSource } from "../types/blueprint-source.js";
15
16
  /**
16
17
  * UI interaction mechanic hint. Tiny enum — generation uses it to select
17
- * primitives (draggable cards vs swipe stack vs live-polling hook).
18
- * Layout details live in {@link ScreenBlueprint.layoutHint} (free text).
18
+ * primitives (live-polling hook vs static form). Layout details live in
19
+ * {@link ScreenBlueprint.layoutHint} (free text). The `drag` / `swipe`
20
+ * members were deleted in draft-2026-06-12 — no authored blueprint ever
21
+ * used them (the generator's gesture classification infers drag/swipe
22
+ * from the prompt instead); they re-enter when a real blueprint does.
19
23
  */
20
- export type ScreenMechanic = "static" | "drag" | "swipe" | "live" | "form";
21
- /**
22
- * Provenance — who authored this blueprint. Same shape, different producers.
23
- *
24
- * - `curated`: hand-written TS in `cloud/amplify/data/screen-blueprints/*.ts`
25
- * - `heuristic`: rule-based composer ("every `list_*` → default list view")
26
- * - `llm`: LLM-driven designer for novel compositions
27
- */
28
- export type ScreenBlueprintSource = "curated" | "heuristic" | "llm";
24
+ export type ScreenMechanic = "static" | "live" | "form";
29
25
  /**
30
26
  * Data source for a single prop slot. The tool's outputSchema becomes the
31
27
  * prop's schema (optionally unwrapped via `pick`). For `live` mechanic,
@@ -113,7 +109,6 @@ export type ScreenBlueprintAction = ScreenBlueprintDirectAction | ScreenBlueprin
113
109
  * server: "_composed",
114
110
  * displayName: "Plan My Week",
115
111
  * intent: "Drag tasks onto a weekly calendar to schedule focus blocks",
116
- * mechanic: "drag",
117
112
  * data: {
118
113
  * tasks: { tool: "todoist_list_tasks", pick: "tasks" },
119
114
  * events: { tool: "gcal_list_events", pick: "events" },
@@ -127,6 +122,7 @@ export type ScreenBlueprintAction = ScreenBlueprintDirectAction | ScreenBlueprin
127
122
  * completeTask: { tool: "todoist_complete_task" },
128
123
  * },
129
124
  * layoutHint: "Left: task cards. Right: 7-day grid. Drag to schedule.",
125
+ * source: { kind: "curated" },
130
126
  * });
131
127
  * ```
132
128
  */
@@ -155,10 +151,10 @@ export interface ScreenBlueprint {
155
151
  /** Free-form layout guidance passed to the generator as prompt context. */
156
152
  layoutHint?: string;
157
153
  /**
158
- * Provenance. Set automatically by each producer (curated producer = this
159
- * file's co-location; heuristic + llm producers set explicitly). Included
160
- * here for the compiler's downstream use.
154
+ * Provenance — who authored this blueprint ({@link BlueprintSource}).
155
+ * Required: every producer stamps its own arm at mint time, and the
156
+ * match ranker weighs it. Unlabeled blueprints are not a real state.
161
157
  */
162
- source?: ScreenBlueprintSource;
158
+ source: BlueprintSource;
163
159
  }
164
160
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/screen-blueprints/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,WAAW,GAAG,KAAK,CAAC;AAEpE;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,oDAAoD;IACpD,IAAI,EAAE,MAA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C;IAChB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,yDAAyD;AACzD,MAAM,WAAW,6BAA6B;IAC5C,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAC7B,2BAA2B,GAC3B,iCAAiC,GACjC,6BAA6B,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,EAAE,EAAE,MAAM,CAAC;IACX;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,yEAAyE;IACzE,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;IAChD,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAChD,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,MAAM,EAAE,eAAe,CAAC;CACzB"}
@@ -22,14 +22,14 @@
22
22
  */
23
23
  import type { ActionEnvelope } from '../types/events';
24
24
  import type { JsonObject } from '../types/data-contract';
25
- import type { SubscribePayload, ClosePayload, AckPayload, ErrorPayload, RenderPayload, StreamEnvelope, StreamPayload, ProgressPayload, AgentMsgPayload, PropsUpdatePayload, UrlPayload, SystemPayload, InternalProgressPayload, ChannelSubscribePayload, ChannelUnsubscribePayload, ChannelPayloadFrame, ChannelErrorPayload, DrainAckPayload } from '../types/live-channel';
25
+ import type { SubscribePayload, AckPayload, ErrorPayload, RenderPayload, StreamEnvelope, PropsUpdatePayload, SystemPayload, ChannelSubscribePayload, ChannelUnsubscribePayload, ChannelPayloadFrame, ChannelErrorPayload, DrainAckPayload } from '../types/live-channel';
26
26
  import type { HostContextObservedPayload } from '../types/host-context';
27
- import type { RenderEvent } from '../types/render-event';
27
+ import type { GguiSessionEvent } from '../types/ggui-session-event';
28
28
  /**
29
29
  * WebSocket message types for client-server communication.
30
30
  * Each type maps to a specific payload shape in the {@link WebSocketMessage} discriminated union.
31
31
  */
32
- export type WebSocketMessageType = 'action' | 'subscribe' | 'close' | 'feedback' | 'ping' | 'pong' | 'ack' | 'error' | 'render' | 'data' | 'stream' | 'progress' | 'agent-msg' | 'props_update' | 'url' | 'system' | 'internal:progress' | 'channel_subscribe' | 'channel_unsubscribe' | 'channel_payload' | 'channel_error' | 'drain_ack' | 'host_context_observed' | 'render_event';
32
+ export type WebSocketMessageType = 'action' | 'subscribe' | 'ping' | 'pong' | 'ack' | 'error' | 'render' | 'data' | 'props_update' | 'system' | 'channel_subscribe' | 'channel_unsubscribe' | 'channel_payload' | 'channel_error' | 'drain_ack' | 'host_context_observed' | 'render_event';
33
33
  /** Fields shared by all WebSocket message variants. */
34
34
  interface WsMessageBase {
35
35
  requestId?: string;
@@ -52,7 +52,7 @@ interface WsMessageBase {
52
52
  * msg.payload.details; // JsonValue | undefined
53
53
  * break;
54
54
  * case 'render':
55
- * msg.payload.render; // RenderPayload — auto-narrowed
55
+ * msg.payload.session; // RenderPayload — auto-narrowed
56
56
  * break;
57
57
  * case 'data':
58
58
  * msg.payload.payload; // StreamEnvelope.payload
@@ -67,12 +67,6 @@ export type WebSocketMessage = (WsMessageBase & {
67
67
  }) | (WsMessageBase & {
68
68
  type: 'subscribe';
69
69
  payload: SubscribePayload;
70
- }) | (WsMessageBase & {
71
- type: 'close';
72
- payload: ClosePayload;
73
- }) | (WsMessageBase & {
74
- type: 'feedback';
75
- payload: JsonObject;
76
70
  }) | (WsMessageBase & {
77
71
  type: 'ping';
78
72
  payload: JsonObject;
@@ -91,27 +85,12 @@ export type WebSocketMessage = (WsMessageBase & {
91
85
  }) | (WsMessageBase & {
92
86
  type: 'data';
93
87
  payload: StreamEnvelope;
94
- }) | (WsMessageBase & {
95
- type: 'stream';
96
- payload: StreamPayload;
97
- }) | (WsMessageBase & {
98
- type: 'progress';
99
- payload: ProgressPayload;
100
- }) | (WsMessageBase & {
101
- type: 'agent-msg';
102
- payload: AgentMsgPayload;
103
88
  }) | (WsMessageBase & {
104
89
  type: 'props_update';
105
90
  payload: PropsUpdatePayload;
106
- }) | (WsMessageBase & {
107
- type: 'url';
108
- payload: UrlPayload;
109
91
  }) | (WsMessageBase & {
110
92
  type: 'system';
111
93
  payload: SystemPayload;
112
- }) | (WsMessageBase & {
113
- type: 'internal:progress';
114
- payload: InternalProgressPayload;
115
94
  }) | (WsMessageBase & {
116
95
  type: 'channel_subscribe';
117
96
  payload: ChannelSubscribePayload;
@@ -132,7 +111,7 @@ export type WebSocketMessage = (WsMessageBase & {
132
111
  payload: HostContextObservedPayload;
133
112
  }) | (WsMessageBase & {
134
113
  type: 'render_event';
135
- payload: RenderEvent;
114
+ payload: GguiSessionEvent;
136
115
  });
137
116
  /**
138
117
  * WebSocket connection status. Client-side transport enum describing
@@ -1 +1 @@
1
- {"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../src/transport/websocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,aAAa,EACb,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EAChB,MA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AI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,aAAa,CAAA;CAAE,CAAC,GAE5D,CAAC,aAAa,GAAG;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,OAAO,EAAE,uBAAuB,CAAA;CAAE,CAAC,GACjF,CAAC,aAAa,GAAG;IAAE,IAAI,EAAE,qBAAqB,CAAC;IAAC,OAAO,EAAE,yBAAyB,CAAA;CAAE,CAAC,GACrF,CAAC,aAAa,GAAG;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAE,CAAC,GAC3E,CAAC,aAAa,GAAG;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAE,CAAC,GAEzE,CAAC,aAAa,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,eAAe,CAAA;CAAE,CAAC,GAKjE,CAAC,aAAa,GAAG;IAAE,IAAI,EAAE,uBAAuB,CAAC;IAAC,OAAO,EAAE,0BAA0B,CAAA;CAAE,CAAC,GAQxF,CAAC,aAAa,GAAG;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAAC;AAE1E;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC"}
@@ -10,7 +10,6 @@ export interface AppDisplayConfig {
10
10
  themeId: string;
11
11
  defaultScreenPrompt?: string;
12
12
  designSystemPreset?: string;
13
- userAuthMode: string;
14
13
  /**
15
14
  * Agent invoke endpoint URL.
16
15
  *
@@ -1 +1 @@
1
- {"version":3,"file":"app-config.d.ts","sourceRoot":"","sources":["../../src/types/app-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;;;;;;OAgBG;IACH,kBAAkB,CAAC,EAAE,gBAAgB,CAAC;CACvC"}
1
+ {"version":3,"file":"app-config.d.ts","sourceRoot":"","sources":["../../src/types/app-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;;;;;;OAgBG;IACH,kBAAkB,CAAC,EAAE,gBAAgB,CAAC;CACvC"}
@@ -1,45 +1,7 @@
1
1
  import type { JsonObject } from './data-contract';
2
- /**
3
- * User authentication modes.
4
- *
5
- * - `anonymous`: no auth gate, cookie-based pseudonymous identity.
6
- * - `cognito`: ggui-managed Cognito identity (OAuth/OIDC handled by platform).
7
- * - `byo`: builder supplies their own JWT/OIDC issuer; platform validates against JWKS.
8
- */
9
- export type UserAuthMode = 'anonymous' | 'cognito' | 'byo';
10
- /**
11
- * Scopes requestable from ggui identity
12
- */
13
- export type GguiAuthScope = 'email' | 'name' | 'picture';
14
- /**
15
- * User auth config for cognito + byo modes.
16
- * Matches the backend UserAuthConfig schema.
17
- *
18
- * BYO has two flavors:
19
- * - Render-surface HMAC-JWT shortcut: {@link authUrl} / {@link callbackSecret} /
20
- * {@link tokenClaimUserId} (`your-app.example/auth/callback`, iframe UIs).
21
- * - Portal BYO OAuth 2.1 flow: the `oauth*` fields below
22
- * (`your-app.example/oauth/byo/callback`, native Portal).
23
- * The `tokenClaim*` fields are reused across both flavors.
24
- */
25
- export interface UserAuthConfig {
26
- authUrl?: string;
27
- callbackSecret?: string;
28
- tokenClaimUserId?: string;
29
- tokenClaimEmail?: string;
30
- tokenClaimName?: string;
31
- oauthAuthorizationUrl?: string;
32
- oauthTokenUrl?: string;
33
- oauthJwksUrl?: string;
34
- oauthIssuer?: string;
35
- oauthClientIdPublic?: string;
36
- oauthScopes?: string[];
37
- oauthRedirectUriAllowlist?: string[];
38
- requestedScopes?: GguiAuthScope[];
39
- }
40
2
  /**
41
3
  * Authenticated end-user identity.
42
- * Attached to sessions and included in events consumed by agents.
4
+ * Attached to renders and included in events consumed by agents.
43
5
  *
44
6
  * Extends {@link JsonObject} for direct JSON serialization over WebSocket.
45
7
  */
@@ -51,11 +13,4 @@ export interface EndUserIdentity extends JsonObject {
51
13
  provider: 'ggui' | 'custom';
52
14
  authenticatedAt: string;
53
15
  }
54
- /**
55
- * User auth settings for an app (convenience wrapper)
56
- */
57
- export interface UserAuthSettings {
58
- mode: UserAuthMode;
59
- config?: UserAuthConfig;
60
- }
61
16
  //# sourceMappingURL=auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/types/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,SAAS,GAAG,KAAK,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG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,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;CACzB"}
@@ -0,0 +1,123 @@
1
+ /**
2
+ * `BlueprintSource` — the single provenance vocabulary for blueprints.
3
+ *
4
+ * One discriminated union, replacing the flat provenance strings that
5
+ * previously lived on three separate seams (catalog entries, screen
6
+ * blueprints, and the runtime cache registry). The discriminant is
7
+ * `kind`; the `llm` arm carries the engine provenance that the flat
8
+ * strings could never express.
9
+ *
10
+ * Arms:
11
+ *
12
+ * - `llm` — engine-generated. `generator` is the slug of the
13
+ * {@link UiGenerator} that produced the component code; `model` is
14
+ * the LLM model id the engine called. Both REQUIRED: every
15
+ * generation mint site has them in scope, and an engine-generated
16
+ * artifact without them is not a real state.
17
+ * - `user` — developer-registered / hand-authored. Covers
18
+ * manifest-declared UIs, operator-registered blueprints, and
19
+ * imported artifacts that carry no engine claim. No engine
20
+ * provenance exists for these, so the arm carries none.
21
+ * - `curated` — hand-authored system blueprint shipped with a
22
+ * deployment's screen-blueprint catalog (a design call made by the
23
+ * catalog author, ranked above generated output by the matcher).
24
+ *
25
+ * Dead-arm verdict (2026-06 provenance trace): the legacy flat
26
+ * vocabularies also declared a `heuristic` arm ("rule-based composer").
27
+ * A repo-wide mint trace found ZERO sites that ever produced it, so the
28
+ * arm is deleted rather than carried. There is intentionally NO
29
+ * legacy/unlabeled arm and NO optional provenance: blueprints are a
30
+ * cache (invalidation = regeneration, never data loss), so unlabeled
31
+ * rows are dropped at the trust boundary, never coerced.
32
+ */
33
+ /** Closed list of `BlueprintSource` discriminants. */
34
+ export declare const BLUEPRINT_SOURCE_KINDS: readonly ["llm", "user", "curated"];
35
+ /** Discriminant of {@link BlueprintSource}. */
36
+ export type BlueprintSourceKind = (typeof BLUEPRINT_SOURCE_KINDS)[number];
37
+ /** Engine-generated — full engine provenance is mandatory. */
38
+ export interface LlmBlueprintSource {
39
+ readonly kind: "llm";
40
+ /**
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.
44
+ */
45
+ readonly generator: string;
46
+ /** Model id of the LLM call the generator made. */
47
+ readonly model: string;
48
+ }
49
+ /** Developer-registered / hand-authored — no engine provenance exists. */
50
+ export interface UserBlueprintSource {
51
+ readonly kind: "user";
52
+ }
53
+ /** Hand-authored system blueprint shipped with a deployment's catalog. */
54
+ export interface CuratedBlueprintSource {
55
+ readonly kind: "curated";
56
+ }
57
+ export type BlueprintSource = LlmBlueprintSource | UserBlueprintSource | CuratedBlueprintSource;
58
+ /**
59
+ * Validating narrower for trust boundaries (DB row → union, JSON
60
+ * artifact → union). Returns a CANONICAL rebuild of the union value —
61
+ * stray keys on the input do not ride through — or `null` when the
62
+ * value is not a well-formed `BlueprintSource`. Callers at load seams
63
+ * drop-with-log or reject loudly on `null`; coercing a malformed value
64
+ * into an arm is banned.
65
+ */
66
+ export declare function parseBlueprintSource(value: unknown): BlueprintSource | null;
67
+ /** Type-guard form of {@link parseBlueprintSource}. */
68
+ export declare function isBlueprintSource(value: unknown): value is BlueprintSource;
69
+ /**
70
+ * Flat-encoded provenance: the SINGLE key vocabulary every store uses
71
+ * when it persists a {@link BlueprintSource} as scalar columns /
72
+ * attributes (vector-store metadata, key-value rows, …). The union is
73
+ * the code shape; storage stays flat — and every store flattens and
74
+ * rebuilds through THIS codec, never through hand-rolled key names.
75
+ *
76
+ * Key vocabulary: `sourceKind` / `sourceGenerator` / `sourceModel`.
77
+ * The `source`-prefixed triple is deliberate: flat rows mix provenance
78
+ * with arbitrary other attributes, and bare `generator` / `model` keys
79
+ * collide with row-level fields that legitimately carry their own
80
+ * generator/model semantics (e.g. a generation-result row). The prefix
81
+ * keeps the provenance keys self-describing, collision-free, and
82
+ * greppable, and mirrors the union access path (`source.kind` →
83
+ * `sourceKind`). No storage engine ergonomics argue against it —
84
+ * attribute names are free-form in every store we target.
85
+ */
86
+ export declare const FLAT_BLUEPRINT_SOURCE_KEYS: {
87
+ readonly kind: "sourceKind";
88
+ readonly generator: "sourceGenerator";
89
+ readonly model: "sourceModel";
90
+ };
91
+ /**
92
+ * Flat (storage) shape of a {@link BlueprintSource}. `sourceGenerator`
93
+ * / `sourceModel` are present exactly when `sourceKind === 'llm'` —
94
+ * {@link blueprintSourceToFlat} never writes them for other arms, and
95
+ * {@link flatToBlueprintSource} sheds stray values on non-llm rows.
96
+ */
97
+ export interface FlatBlueprintSource {
98
+ readonly sourceKind: BlueprintSourceKind;
99
+ readonly sourceGenerator?: string;
100
+ readonly sourceModel?: string;
101
+ }
102
+ /** Flatten a canonical {@link BlueprintSource} into storage keys. */
103
+ export declare function blueprintSourceToFlat(source: BlueprintSource): FlatBlueprintSource;
104
+ /**
105
+ * Validating narrower at the flat-row trust boundary: reassemble the
106
+ * `sourceKind` / `sourceGenerator` / `sourceModel` scalars of an
107
+ * UNTRUSTED row into a canonical {@link BlueprintSource}, or `null`
108
+ * when the row carries no valid provenance (rows written under a
109
+ * retired vocabulary, foreign rows, malformed writes). Callers drop
110
+ * the row — coercing into an arm is banned. Delegates the union
111
+ * rebuild to {@link parseBlueprintSource}, so stray keys never ride
112
+ * through and a non-llm row carrying vestigial generator/model
113
+ * scalars rebuilds to its bare arm.
114
+ *
115
+ * Accepts any object-shaped row (metadata records, unmarshalled rows);
116
+ * only the three codec keys are read.
117
+ */
118
+ export declare function flatToBlueprintSource(row: {
119
+ readonly sourceKind?: unknown;
120
+ readonly sourceGenerator?: unknown;
121
+ readonly sourceModel?: unknown;
122
+ }): BlueprintSource | null;
123
+ //# sourceMappingURL=blueprint-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blueprint-source.d.ts","sourceRoot":"","sources":["../../src/types/blueprint-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAIH,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