@ggui-ai/protocol 0.2.0-alpha.3 → 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.
- package/README.md +16 -16
- package/dist/envelope-adapters.d.ts +6 -5
- package/dist/envelope-adapters.d.ts.map +1 -1
- package/dist/envelope-adapters.js +3 -3
- package/dist/envelopes/builders.d.ts +6 -32
- package/dist/envelopes/builders.d.ts.map +1 -1
- package/dist/envelopes/builders.js +3 -25
- package/dist/errors/version-mismatch.d.ts +1 -1
- package/dist/errors/version-mismatch.js +1 -1
- package/dist/gadgets/resolve-app-gadgets.d.ts +10 -0
- package/dist/gadgets/resolve-app-gadgets.d.ts.map +1 -0
- package/dist/gadgets/resolve-app-gadgets.js +19 -0
- package/dist/gadgets/resolve-contract-gadgets.d.ts +6 -6
- package/dist/gadgets/resolve-contract-gadgets.js +5 -5
- package/dist/gadgets/stdlib-gadgets.d.ts +1 -1
- package/dist/gadgets/stdlib-gadgets.d.ts.map +1 -1
- package/dist/gadgets/stdlib-gadgets.js +43 -22
- package/dist/iframe-bridge.d.ts +4 -43
- package/dist/iframe-bridge.d.ts.map +1 -1
- package/dist/iframe-bridge.js +4 -141
- package/dist/index.d.ts +60 -62
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +66 -61
- package/dist/integrations/mcp-apps.d.ts +83 -38
- package/dist/integrations/mcp-apps.d.ts.map +1 -1
- package/dist/integrations/mcp-apps.js +98 -52
- package/dist/recommended-prompts.d.ts +1 -1
- package/dist/recommended-prompts.js +1 -1
- package/dist/registry/blueprint-key.d.ts +3 -0
- package/dist/registry/blueprint-key.d.ts.map +1 -1
- package/dist/registry/blueprint-key.js +9 -0
- package/dist/registry/blueprint-stamp.d.ts +12 -0
- package/dist/registry/blueprint-stamp.d.ts.map +1 -0
- package/dist/registry/blueprint-stamp.js +12 -0
- package/dist/registry/canonicalize-contract.d.ts +31 -2
- package/dist/registry/canonicalize-contract.d.ts.map +1 -1
- package/dist/registry/canonicalize-contract.js +125 -13
- package/dist/registry/portable-blueprint.d.ts +64 -0
- package/dist/registry/portable-blueprint.d.ts.map +1 -0
- package/dist/registry/portable-blueprint.js +103 -0
- package/dist/registry/summarize-contract.d.ts +7 -2
- package/dist/registry/summarize-contract.d.ts.map +1 -1
- package/dist/registry/summarize-contract.js +12 -3
- package/dist/registry/variant-key.d.ts +17 -0
- package/dist/registry/variant-key.d.ts.map +1 -0
- package/dist/registry/variant-key.js +22 -0
- package/dist/schema-learning/derive-contract.d.ts +2 -2
- package/dist/schema-learning/derive-contract.js +2 -2
- package/dist/schema-learning/merge.d.ts.map +1 -1
- package/dist/schema-learning/merge.js +3 -2
- package/dist/schemas/app-theme.d.ts +38 -0
- package/dist/schemas/app-theme.d.ts.map +1 -0
- package/dist/schemas/app-theme.js +43 -0
- package/dist/schemas/blueprint.d.ts +30 -11
- package/dist/schemas/blueprint.d.ts.map +1 -1
- package/dist/schemas/blueprint.js +62 -26
- package/dist/schemas/data-contract.d.ts +28 -30
- package/dist/schemas/data-contract.d.ts.map +1 -1
- package/dist/schemas/data-contract.js +26 -26
- package/dist/schemas/handshake-suggestion.d.ts +2 -4
- package/dist/schemas/handshake-suggestion.d.ts.map +1 -1
- package/dist/schemas/handshake-suggestion.js +5 -14
- package/dist/schemas/mcp.d.ts +240 -58
- package/dist/schemas/mcp.d.ts.map +1 -1
- package/dist/schemas/mcp.js +285 -93
- package/dist/schemas/ops-blueprint.d.ts +12 -12
- package/dist/schemas/ops-blueprint.d.ts.map +1 -1
- package/dist/schemas/ops-blueprint.js +14 -24
- package/dist/screen-blueprints/define.d.ts +2 -2
- package/dist/screen-blueprints/match.d.ts +12 -7
- package/dist/screen-blueprints/match.d.ts.map +1 -1
- package/dist/screen-blueprints/match.js +7 -5
- package/dist/screen-blueprints/types.d.ts +14 -18
- package/dist/screen-blueprints/types.d.ts.map +1 -1
- package/dist/transport/websocket.d.ts +5 -26
- package/dist/transport/websocket.d.ts.map +1 -1
- package/dist/types/app-config.d.ts +0 -1
- package/dist/types/app-config.d.ts.map +1 -1
- package/dist/types/auth.d.ts +1 -46
- package/dist/types/auth.d.ts.map +1 -1
- package/dist/types/blueprint-source.d.ts +123 -0
- package/dist/types/blueprint-source.d.ts.map +1 -0
- package/dist/types/blueprint-source.js +126 -0
- package/dist/types/blueprint.d.ts +25 -18
- package/dist/types/blueprint.d.ts.map +1 -1
- package/dist/types/contract-inference.d.ts +2 -43
- package/dist/types/contract-inference.d.ts.map +1 -1
- package/dist/types/data-contract.d.ts +59 -344
- package/dist/types/data-contract.d.ts.map +1 -1
- package/dist/types/data-contract.js +5 -12
- package/dist/types/events.d.ts +31 -69
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/{render-event.d.ts → ggui-session-event.d.ts} +15 -15
- package/dist/types/ggui-session-event.d.ts.map +1 -0
- package/dist/types/{render-event.js → ggui-session-event.js} +5 -5
- package/dist/types/handshake-suggestion.d.ts +60 -40
- package/dist/types/handshake-suggestion.d.ts.map +1 -1
- package/dist/types/host-context.d.ts +8 -8
- package/dist/types/host-context.d.ts.map +1 -1
- package/dist/types/host-context.js +5 -5
- package/dist/types/invoke.d.ts +1 -13
- package/dist/types/invoke.d.ts.map +1 -1
- package/dist/types/{canvas-lifecycle.d.ts → lifecycle.d.ts} +35 -37
- package/dist/types/lifecycle.d.ts.map +1 -0
- package/dist/types/{canvas-lifecycle.js → lifecycle.js} +12 -14
- package/dist/types/live-channel.d.ts +48 -104
- package/dist/types/live-channel.d.ts.map +1 -1
- package/dist/types/llm.d.ts +13 -24
- package/dist/types/llm.d.ts.map +1 -1
- package/dist/types/llm.js +23 -53
- package/dist/types/mcp.d.ts +55 -176
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/types/mcp.js +2 -2
- package/dist/types/oauth-user-id.d.ts +12 -0
- package/dist/types/oauth-user-id.d.ts.map +1 -0
- package/dist/types/oauth-user-id.js +10 -0
- package/dist/types/portable-blueprint.d.ts +53 -0
- package/dist/types/portable-blueprint.d.ts.map +1 -0
- package/dist/types/portable-blueprint.js +8 -0
- package/dist/types/{session.d.ts → render.d.ts} +51 -53
- package/dist/types/render.d.ts.map +1 -0
- package/dist/types/thread.d.ts.map +1 -1
- package/dist/types/thread.js +3 -3
- package/dist/types/ui-generator.d.ts +5 -46
- package/dist/types/ui-generator.d.ts.map +1 -1
- package/dist/types/ui-generator.js +1 -53
- package/dist/validation/ajv-runtime.d.ts +3 -3
- package/dist/validation/ajv-runtime.d.ts.map +1 -1
- package/dist/validation/ajv-runtime.js +6 -5
- package/dist/validation/contract-validator.d.ts +23 -22
- package/dist/validation/contract-validator.d.ts.map +1 -1
- package/dist/validation/contract-validator.js +28 -26
- package/dist/validation/cross-references.d.ts +3 -3
- package/dist/validation/cross-references.js +3 -3
- package/dist/validation/hygiene-rules.d.ts +13 -10
- package/dist/validation/hygiene-rules.d.ts.map +1 -1
- package/dist/validation/hygiene-rules.js +20 -14
- package/dist/validation/is-record.d.ts +17 -0
- package/dist/validation/is-record.d.ts.map +1 -0
- package/dist/validation/is-record.js +18 -0
- package/dist/validation/lint-contract.d.ts +9 -8
- package/dist/validation/lint-contract.d.ts.map +1 -1
- package/dist/validation/lint-contract.js +89 -26
- package/dist/validation/name-invariants.d.ts +4 -4
- package/dist/validation/name-invariants.js +4 -4
- package/dist/validation/reserved-channels.d.ts +43 -46
- package/dist/validation/reserved-channels.d.ts.map +1 -1
- package/dist/validation/reserved-channels.js +14 -177
- package/dist/validation/resolve-stream-channel.d.ts +3 -9
- package/dist/validation/resolve-stream-channel.d.ts.map +1 -1
- package/dist/validation/resolve-stream-channel.js +3 -4
- package/dist/validation/sanitize-error.d.ts +10 -9
- package/dist/validation/sanitize-error.d.ts.map +1 -1
- package/dist/validation/sanitize-error.js +19 -18
- package/dist/validation/schema-compat-invariants.d.ts +1 -1
- package/dist/validation/schema-compat-invariants.js +3 -3
- package/dist/validation/schema-meta-validation.d.ts +21 -8
- package/dist/validation/schema-meta-validation.d.ts.map +1 -1
- package/dist/validation/schema-meta-validation.js +28 -14
- package/dist/validation/schema-subset.d.ts +9 -8
- package/dist/validation/schema-subset.d.ts.map +1 -1
- package/dist/validation/ui-security.d.ts +0 -17
- package/dist/validation/ui-security.d.ts.map +1 -1
- package/dist/validation/ui-security.js +17 -22
- package/dist/validation/zod-to-json-schema.d.ts +1 -1
- package/dist/validation/zod-to-json-schema.d.ts.map +1 -1
- package/dist/validation/zod-to-json-schema.js +4 -3
- package/dist/version.d.ts +783 -9
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +782 -8
- package/package.json +2 -2
- package/dist/bridge/invoke-agent.d.ts +0 -65
- package/dist/bridge/invoke-agent.d.ts.map +0 -1
- package/dist/bridge/invoke-agent.js +0 -113
- package/dist/stream/stream-parser.d.ts +0 -62
- package/dist/stream/stream-parser.d.ts.map +0 -1
- package/dist/stream/stream-parser.js +0 -199
- package/dist/types/canvas-lifecycle.d.ts.map +0 -1
- package/dist/types/credential.d.ts +0 -41
- package/dist/types/credential.d.ts.map +0 -1
- package/dist/types/credential.js +0 -32
- package/dist/types/data-bindings.d.ts +0 -322
- package/dist/types/data-bindings.d.ts.map +0 -1
- package/dist/types/data-bindings.js +0 -29
- package/dist/types/feedback.d.ts +0 -22
- package/dist/types/feedback.d.ts.map +0 -1
- package/dist/types/feedback.js +0 -7
- package/dist/types/mcp-proxy.d.ts +0 -67
- package/dist/types/mcp-proxy.d.ts.map +0 -1
- package/dist/types/mcp-proxy.js +0 -46
- package/dist/types/openrouter-models.d.ts +0 -23
- package/dist/types/openrouter-models.d.ts.map +0 -1
- package/dist/types/openrouter-models.js +0 -4843
- package/dist/types/region.d.ts +0 -26
- package/dist/types/region.d.ts.map +0 -1
- package/dist/types/region.js +0 -36
- package/dist/types/render-event.d.ts.map +0 -1
- package/dist/types/session.d.ts.map +0 -1
- /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,
|
|
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
|
|
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
|
-
|
|
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
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
* `*_generate_*`
|
|
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
|
-
|
|
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
|
|
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
|
-
* `
|
|
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
|
|
6
|
-
*
|
|
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
|
|
5
|
-
*
|
|
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
|
|
9
|
-
*
|
|
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 {
|
|
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
|
-
|
|
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,
|
|
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 —
|
|
3
|
-
* else ties. Matches the spec: "curated generally wins when
|
|
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
|
|
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 —
|
|
12
|
-
*
|
|
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 (
|
|
18
|
-
*
|
|
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" | "
|
|
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
|
|
159
|
-
*
|
|
160
|
-
*
|
|
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
|
|
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;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/screen-blueprints/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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A0BG;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,
|
|
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 {
|
|
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' | '
|
|
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.
|
|
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:
|
|
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,
|
|
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,UAAU,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EAChB,MAAM,uBAAuB,CAA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BAAmB,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
|
|
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"}
|
package/dist/types/auth.d.ts
CHANGED
|
@@ -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
|
|
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
|
package/dist/types/auth.d.ts.map
CHANGED
|
@@ -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
|
|
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;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,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,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,CAAC,UAAU,EAAE,mBAAmB,CAAC;IACzC,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