@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
@@ -0,0 +1,70 @@
1
+ /**
2
+ * `DomainError` — the ONE composer of a Plane-2 error's wire text (ggui#880).
3
+ *
4
+ * SPEC §7.9 Plane 2. The MCP SDK converts every error a tool handler throws
5
+ * into `{content: [{type: 'text', text: error.message}], isError: true}` —
6
+ * no `structuredContent`, no `_meta`, no field for a code. So `message` IS
7
+ * the wire, and this base is the only place that composes it:
8
+ *
9
+ * <code> ": " <detail>
10
+ *
11
+ * with `code` a member of {@link DOMAIN_ERROR_CODES}. A reader branches on
12
+ * `text.startsWith(code + ': ')` for a REGISTERED code and on nothing else
13
+ * — a tool-name prefix inside the detail (`ggui_render: …`) is prose. The
14
+ * one thing the base refuses at construction is a detail that itself
15
+ * begins with a registered domain or refusal code followed by `': '`: the
16
+ * leading slug would then lie to the reader, and the emitter's own suite
17
+ * sees the `TypeError` instead of the wire.
18
+ *
19
+ * Parties (the contract): the EMITTER is any data-plane handler that throws
20
+ * for a caller-fixable, nothing-committed condition; the TRANSPORT is the
21
+ * server's `tools/call` dispatch and the SDK's catch it hands to; the
22
+ * CONSUMER is a raw MCP agent reading the result text. Observable violation:
23
+ * the conformance kit's `domain-error` catalog grades the raw result.
24
+ */
25
+ import { type DomainErrorCode } from '../types/domain-error-codes.js';
26
+ /**
27
+ * Marks a {@link DomainError} across bundle copies and realms: an instance
28
+ * from another copy of `@ggui-ai/protocol` is still a domain error to
29
+ * {@link isDomainError}, which never uses `instanceof`.
30
+ */
31
+ export declare const DOMAIN_ERROR_MARKER: unique symbol;
32
+ /**
33
+ * Thrown at construction when a detail begins with a registered code —
34
+ * an emitter bug, surfaced in the emitter's own suite, never on the wire.
35
+ */
36
+ export declare class DomainErrorDetailCollisionError extends TypeError {
37
+ readonly code: DomainErrorCode;
38
+ readonly collidingCode: string;
39
+ readonly detail: string;
40
+ constructor(code: DomainErrorCode, collidingCode: string, detail: string);
41
+ }
42
+ /**
43
+ * Base of every Plane-2 error. Subclass it per state; the subclass owns the
44
+ * detail text and any typed fields, the base owns the wire grammar.
45
+ */
46
+ export declare class DomainError<C extends DomainErrorCode = DomainErrorCode> extends Error {
47
+ readonly [DOMAIN_ERROR_MARKER]: true;
48
+ readonly code: C;
49
+ readonly detail: string;
50
+ constructor(code: C, detail: string, options?: ErrorOptions);
51
+ }
52
+ /**
53
+ * Whether `err` is a domain error — by marker and shape, never by
54
+ * `instanceof` (not even `instanceof Error`, which is realm-bound), so an
55
+ * instance from another bundle copy or realm still qualifies and a plain
56
+ * `Error` that merely carries a `code` does not.
57
+ */
58
+ export declare function isDomainError(err: unknown): err is DomainError;
59
+ /** A parsed Plane-2 wire text. */
60
+ export interface ParsedDomainErrorText {
61
+ readonly code: DomainErrorCode;
62
+ readonly detail: string;
63
+ }
64
+ /**
65
+ * The reader side of the grammar: `<code>: <detail>` for a REGISTERED code,
66
+ * else `null` — a Plane-1 text (`MCP error -32602: …`), a tool-name prefix
67
+ * (`ggui_render: …`) or an unregistered slug is not a domain error.
68
+ */
69
+ export declare function parseDomainErrorText(text: string): ParsedDomainErrorText | null;
70
+ //# sourceMappingURL=domain-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain-error.d.ts","sourceRoot":"","sources":["../../src/errors/domain-error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AAGrC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,OAAO,MAA0C,CAAC;AAapF;;;GAGG;AACH,qBAAa,+BAAgC,SAAQ,SAAS;IAE1D,QAAQ,CAAC,IAAI,EAAE,eAAe;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAFd,IAAI,EAAE,eAAe,EACrB,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM;CAO1B;AAED;;;GAGG;AACH,qBAAa,WAAW,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,CAAE,SAAQ,KAAK;IACjF,QAAQ,CAAC,CAAC,mBAAmB,CAAC,EAAG,IAAI,CAAU;IAC/C,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAa5D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,WAAW,CAc9D;AAED,kCAAkC;AAClC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,GAAG,IAAI,CAO/E"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * `DomainError` — the ONE composer of a Plane-2 error's wire text (ggui#880).
3
+ *
4
+ * SPEC §7.9 Plane 2. The MCP SDK converts every error a tool handler throws
5
+ * into `{content: [{type: 'text', text: error.message}], isError: true}` —
6
+ * no `structuredContent`, no `_meta`, no field for a code. So `message` IS
7
+ * the wire, and this base is the only place that composes it:
8
+ *
9
+ * <code> ": " <detail>
10
+ *
11
+ * with `code` a member of {@link DOMAIN_ERROR_CODES}. A reader branches on
12
+ * `text.startsWith(code + ': ')` for a REGISTERED code and on nothing else
13
+ * — a tool-name prefix inside the detail (`ggui_render: …`) is prose. The
14
+ * one thing the base refuses at construction is a detail that itself
15
+ * begins with a registered domain or refusal code followed by `': '`: the
16
+ * leading slug would then lie to the reader, and the emitter's own suite
17
+ * sees the `TypeError` instead of the wire.
18
+ *
19
+ * Parties (the contract): the EMITTER is any data-plane handler that throws
20
+ * for a caller-fixable, nothing-committed condition; the TRANSPORT is the
21
+ * server's `tools/call` dispatch and the SDK's catch it hands to; the
22
+ * CONSUMER is a raw MCP agent reading the result text. Observable violation:
23
+ * the conformance kit's `domain-error` catalog grades the raw result.
24
+ */
25
+ import { DOMAIN_ERROR_CODES, isDomainErrorCode, } from '../types/domain-error-codes.js';
26
+ import { PRE_GENERATION_REFUSAL_CODES } from '../types/refusal-codes.js';
27
+ /**
28
+ * Marks a {@link DomainError} across bundle copies and realms: an instance
29
+ * from another copy of `@ggui-ai/protocol` is still a domain error to
30
+ * {@link isDomainError}, which never uses `instanceof`.
31
+ */
32
+ export const DOMAIN_ERROR_MARKER = Symbol.for('ai.ggui.domainError');
33
+ /** The leading `"<code>: "` a detail must not carry — either registry. */
34
+ function leadingRegisteredCode(detail) {
35
+ for (const code of DOMAIN_ERROR_CODES) {
36
+ if (detail.startsWith(`${code}: `))
37
+ return code;
38
+ }
39
+ for (const code of Object.keys(PRE_GENERATION_REFUSAL_CODES)) {
40
+ if (detail.startsWith(`${code}: `))
41
+ return code;
42
+ }
43
+ return undefined;
44
+ }
45
+ /**
46
+ * Thrown at construction when a detail begins with a registered code —
47
+ * an emitter bug, surfaced in the emitter's own suite, never on the wire.
48
+ */
49
+ export class DomainErrorDetailCollisionError extends TypeError {
50
+ code;
51
+ collidingCode;
52
+ detail;
53
+ constructor(code, collidingCode, detail) {
54
+ super(`DomainError(${code}): the detail begins with the registered code "${collidingCode}: " — a reader branches on the leading slug, so a nested code would lie to it; say the cause in words instead`);
55
+ this.code = code;
56
+ this.collidingCode = collidingCode;
57
+ this.detail = detail;
58
+ this.name = 'DomainErrorDetailCollisionError';
59
+ }
60
+ }
61
+ /**
62
+ * Base of every Plane-2 error. Subclass it per state; the subclass owns the
63
+ * detail text and any typed fields, the base owns the wire grammar.
64
+ */
65
+ export class DomainError extends Error {
66
+ [DOMAIN_ERROR_MARKER] = true;
67
+ code;
68
+ detail;
69
+ constructor(code, detail, options) {
70
+ if (detail.trim().length === 0) {
71
+ throw new TypeError(`DomainError(${code}): the detail must be non-empty — the wire text is "${code}: <detail>"`);
72
+ }
73
+ const collision = leadingRegisteredCode(detail);
74
+ if (collision !== undefined) {
75
+ throw new DomainErrorDetailCollisionError(code, collision, detail);
76
+ }
77
+ super(`${code}: ${detail}`, options);
78
+ this.code = code;
79
+ this.detail = detail;
80
+ this.name = new.target.name;
81
+ }
82
+ }
83
+ /**
84
+ * Whether `err` is a domain error — by marker and shape, never by
85
+ * `instanceof` (not even `instanceof Error`, which is realm-bound), so an
86
+ * instance from another bundle copy or realm still qualifies and a plain
87
+ * `Error` that merely carries a `code` does not.
88
+ */
89
+ export function isDomainError(err) {
90
+ // Structural on purpose: `instanceof Error` is realm-bound, and an
91
+ // error thrown in another realm or bundle copy is still a domain error.
92
+ if (typeof err !== 'object' || err === null)
93
+ return false;
94
+ if (Reflect.get(err, DOMAIN_ERROR_MARKER) !== true)
95
+ return false;
96
+ const code = Reflect.get(err, 'code');
97
+ const detail = Reflect.get(err, 'detail');
98
+ const message = Reflect.get(err, 'message');
99
+ return (typeof code === 'string' &&
100
+ isDomainErrorCode(code) &&
101
+ typeof detail === 'string' &&
102
+ typeof message === 'string');
103
+ }
104
+ /**
105
+ * The reader side of the grammar: `<code>: <detail>` for a REGISTERED code,
106
+ * else `null` — a Plane-1 text (`MCP error -32602: …`), a tool-name prefix
107
+ * (`ggui_render: …`) or an unregistered slug is not a domain error.
108
+ */
109
+ export function parseDomainErrorText(text) {
110
+ const separator = text.indexOf(': ');
111
+ if (separator <= 0)
112
+ return null;
113
+ const code = text.slice(0, separator);
114
+ const detail = text.slice(separator + 2);
115
+ if (!isDomainErrorCode(code) || detail.trim().length === 0)
116
+ return null;
117
+ return { code, detail };
118
+ }
@@ -12,7 +12,7 @@ export declare const STDLIB_GADGETS_PACKAGE = "@ggui-ai/gadgets";
12
12
  * in `@ggui-ai/gadgets` asserts the two stay in sync, so a release-time
13
13
  * bump to the runtime package without updating this constant fails CI.
14
14
  */
15
- export declare const STDLIB_GADGETS_VERSION = "0.15.0";
15
+ export declare const STDLIB_GADGETS_VERSION = "0.17.0";
16
16
  /**
17
17
  * v1 catalog of stdlib gadget descriptors. Every entry's
18
18
  * `package` defaults to {@link STDLIB_GADGETS_PACKAGE}; the
@@ -39,7 +39,7 @@ export const STDLIB_GADGETS_PACKAGE = '@ggui-ai/gadgets';
39
39
  * in `@ggui-ai/gadgets` asserts the two stay in sync, so a release-time
40
40
  * bump to the runtime package without updating this constant fails CI.
41
41
  */
42
- export const STDLIB_GADGETS_VERSION = '0.15.0';
42
+ export const STDLIB_GADGETS_VERSION = '0.17.0';
43
43
  /**
44
44
  * v1 catalog of stdlib gadget descriptors. Every entry's
45
45
  * `package` defaults to {@link STDLIB_GADGETS_PACKAGE}; the
package/dist/index.d.ts CHANGED
@@ -16,12 +16,16 @@ export type { DeepReadonly } from "./types/readonly.js";
16
16
  export * from "./schemas/invoke.js";
17
17
  export * from "./schemas/data-contract.js";
18
18
  export * from "./schemas/app-theme.js";
19
+ export * from "./integrations/overlay-hash.js";
20
+ export * from "./schemas/app-generation-profile.js";
21
+ export * from "./schemas/rendering-context.js";
19
22
  export { canonicalizeContracts, canonicalizeValue } from "./registry/canonicalize-contract.js";
20
23
  export { summarizeContract } from "./registry/summarize-contract.js";
21
24
  export { buildEnforcedPropsSchema, canonicalPropsSchemaBytes, classifyPropsSchemaProfile, GRAMMAR_SAFE_FORMATS, GRAMMAR_SAFE_KEYWORDS, type PropsSchemaProfile, } from "./validation/enforced-props-schema.js";
22
25
  export type { TextBlock, ToolUseBlock, ToolResultBlock, ContentBlock, InvokeEvent, InvokeErrorCode, InvokeTurn, } from "./types/invoke.js";
23
26
  export * from "./types/llm.js";
24
27
  export * from "./types/refusal-codes.js";
28
+ export * from "./types/domain-error-codes.js";
25
29
  export * from "./types/llm-route.js";
26
30
  export * from "./types/interface-context.js";
27
31
  export * from "./types/host-context.js";
@@ -39,12 +43,12 @@ export * from "./types/gadget.js";
39
43
  export * from "./types/app-config.js";
40
44
  export { composeOAuthUserId } from "./types/oauth-user-id.js";
41
45
  export * from "./iframe-bridge.js";
42
- export * from "./envelope-adapters.js";
43
46
  export * from "./envelopes/builders.js";
44
47
  export * from "./envelopes/render-refusal.js";
45
48
  export * from "./errors/version-mismatch.js";
46
49
  export * from "./errors/unknown-permission-name.js";
47
50
  export * from "./errors/resource-read.js";
51
+ export * from "./errors/domain-error.js";
48
52
  export * from "./validation/contract-validator.js";
49
53
  export * from "./validation/cross-references.js";
50
54
  export * from "./validation/is-record.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAI/B,cAAc,sBAAsB,CAAC;AAOrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AAIxC,cAAc,qBAAqB,CAAC;AAIpC,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAK5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAOlE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,0BAA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A6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,oCAAoC,CAAC"}
package/dist/index.js CHANGED
@@ -23,10 +23,16 @@ export * from "./schemas/public-env-key.js";
23
23
  export * from "./schemas/render-input-envelope.js";
24
24
  export * from "./schemas/invoke.js";
25
25
  export * from "./schemas/data-contract.js";
26
- // Per-app theme overlay — `AppTheme` + injection-safe `appThemeSchema`
27
- // (`--ggui-*` css-var map). Consumed by the deploy/persist path (ggui.json
26
+ // Per-app theme overlay — `AppTheme` + the injection-safe WRITE schema
27
+ // `appThemeSchema` (`--ggui-*` css-var map), the READ-door variant
28
+ // `appThemeReadSchema` / `parseAppThemeAtReadDoor` (VERSION-POLICY §3.6,
29
+ // ggui#1093) and the declared-asset grammar (`fontFaceDeclarationSchema`,
30
+ // `appThemeImagerySchema`). Consumed by the deploy/persist path (ggui.json
28
31
  // → managed cloud app) and projected into the rendered iframe's `:root`.
29
32
  export * from "./schemas/app-theme.js";
33
+ export * from "./integrations/overlay-hash.js";
34
+ export * from "./schemas/app-generation-profile.js";
35
+ export * from "./schemas/rendering-context.js";
30
36
  // Registry-side helpers — pure utilities for computing the canonical
31
37
  // identity hash of a DataContract shape. Consumed by the Tier 1
32
38
  // exact-match path of the blueprint registry.
@@ -49,6 +55,7 @@ export * from "./types/llm.js";
49
55
  // so it rides the root barrel (unlike ./blueprint-key, which is
50
56
  // subpathed only because it pulls node:crypto).
51
57
  export * from "./types/refusal-codes.js";
58
+ export * from "./types/domain-error-codes.js";
52
59
  export * from "./types/llm-route.js";
53
60
  export * from "./types/interface-context.js";
54
61
  export * from "./types/host-context.js";
@@ -61,7 +68,7 @@ export * from "./schemas/blueprint.js";
61
68
  export * from "./types/handshake-suggestion.js";
62
69
  export * from "./schemas/handshake-suggestion.js";
63
70
  // Operator-class blueprint tool schemas. Lives alongside the blueprint
64
- // type schemas so handlers + cloud pod + console + fixtures all import
71
+ // type schemas so handlers + a hosted deployment + console + fixtures all import
65
72
  // the wire shape from one place.
66
73
  export * from "./schemas/ops-blueprint.js";
67
74
  export * from "./types/contract-inference.js";
@@ -73,7 +80,6 @@ export * from "./types/app-config.js";
73
80
  // same id from one definition.
74
81
  export { composeOAuthUserId } from "./types/oauth-user-id.js";
75
82
  export * from "./iframe-bridge.js";
76
- export * from "./envelope-adapters.js";
77
83
  export * from "./envelopes/builders.js";
78
84
  export * from "./envelopes/render-refusal.js";
79
85
  export * from "./errors/version-mismatch.js";
@@ -81,6 +87,7 @@ export * from "./errors/unknown-permission-name.js";
81
87
  // Typed `resources/read` failures → JSON-RPC. The single exit for every
82
88
  // non-mount outcome of a render-locator read.
83
89
  export * from "./errors/resource-read.js";
90
+ export * from "./errors/domain-error.js";
84
91
  export * from "./validation/contract-validator.js";
85
92
  export * from "./validation/cross-references.js";
86
93
  export * from "./validation/is-record.js";
@@ -255,12 +255,20 @@ export interface McpAppAiGguiRenderMeta {
255
255
  readonly themeId?: string;
256
256
  readonly themeMode?: 'light' | 'dark';
257
257
  /**
258
- * Resolved per-app theme overlay — mode + the `--ggui-*` CSS-variable
259
- * map snapshotted from `App.theme` and projected by `deriveRenderMeta`.
260
- * Distinct from `themeId` (a registry preset reference) and `themeMode`
261
- * (the bare light/dark discriminator): this carries the concrete
262
- * variable values the iframe applies as a `:root` declaration block.
263
- * Absent ⇒ no per-app overlay; the renderer applies its default theme.
258
+ * Resolved per-app theme overlay (ggui#987): the projection for BOTH
259
+ * modes (`overlays.light` / `overlays.dark`), the mode-agnostic
260
+ * `cssVariables` on top, per-mode keyframes, the `overlayHash`
261
+ * attestation, an optional default `mode`, and (ggui#1093) the declared
262
+ * assets — `fonts` (faces the host admits under `font-src` and the shell
263
+ * inlines) and `imagery` (mark / hero / pattern), both outside the
264
+ * attestation — snapshotted from `App.theme`. Distinct from `themeId`
265
+ * (a compiled-theme reference) and `themeMode` (the bare light/dark
266
+ * discriminator): the iframe injects `overlays[effectiveMode]` then
267
+ * `cssVariables` as `:root` declarations. Absent ⇒ no per-app overlay;
268
+ * the renderer applies its default theme. Parsed at the READ door
269
+ * (`parseAppThemeAtReadDoor`, VERSION-POLICY §3.6): a top-level member
270
+ * this release does not name is stripped and reported, never dropped
271
+ * with the theme.
264
272
  */
265
273
  readonly theme?: AppTheme;
266
274
  readonly gadgets?: ReadonlyArray<McpAppGadgetRef>;
@@ -348,7 +356,23 @@ export type ParseMcpAppAiGguiRenderMetaResult = {
348
356
  *
349
357
  * @public
350
358
  */
351
- export declare function parseMcpAppAiGguiRenderMeta(meta: unknown): ParseMcpAppAiGguiRenderMetaResult;
359
+ export interface ParseMcpAppAiGguiRenderMetaOptions {
360
+ /**
361
+ * Called when a `theme` is present but the read door refuses it
362
+ * (`parseAppThemeAtReadDoor`: a reason the write door would refuse too) —
363
+ * the slice drops it (tolerant degrade) but MUST NOT be silent
364
+ * (ggui#987 §3.4): the caller logs or emits its observability event.
365
+ */
366
+ readonly onInvalidTheme?: ((issues: readonly string[]) => void) | undefined;
367
+ /**
368
+ * Called when the read door KEPT the theme but stripped top-level members
369
+ * this release does not name (ggui#1093 belt, VERSION-POLICY §3.6) — the
370
+ * caller logs the keys (never theme content). The theme in the slice is
371
+ * the stripped one; nothing else changes.
372
+ */
373
+ readonly onStrippedThemeMembers?: ((keys: readonly string[]) => void) | undefined;
374
+ }
375
+ export declare function parseMcpAppAiGguiRenderMeta(meta: unknown, options?: ParseMcpAppAiGguiRenderMetaOptions): ParseMcpAppAiGguiRenderMetaResult;
352
376
  /**
353
377
  * Emitter convenience — wrap a server-built {@link McpAppAiGguiRenderMeta}
354
378
  * slice as the wire `_meta` envelope under the canonical key constant.
@@ -953,6 +977,22 @@ export declare const SUBMIT_ACTION_KINDS: readonly ["dispatch", "openLink", "req
953
977
  * MUST validate shape before consuming.
954
978
  */
955
979
  export declare function isGguiSubmitActionInput(value: unknown): value is GguiSubmitActionInput;
980
+ /**
981
+ * The `dispatch` member of {@link GguiSubmitActionInput} — the one kind
982
+ * whose payload the pipe stores. Derived here, never restated in a
983
+ * consumer (ggui#839): `env.kind === 'dispatch'` alone cannot narrow the
984
+ * union, because the forward-compat extension member (`kind: string` with a
985
+ * `Record<string, unknown>` payload) also admits the literal at the type level.
986
+ */
987
+ export type GguiSubmitDispatchInput = Extract<GguiSubmitActionInput, {
988
+ readonly kind: 'dispatch';
989
+ }>;
990
+ /**
991
+ * Narrow a guarded envelope to its `dispatch` member. Sound because
992
+ * {@link isGguiSubmitActionInput}'s closed-set `switch` validates the
993
+ * `'dispatch'` payload before any extension kind can carry that literal.
994
+ */
995
+ export declare function isGguiSubmitDispatchInput(env: GguiSubmitActionInput): env is GguiSubmitDispatchInput;
956
996
  /**
957
997
  * `content[0]._meta["ai.ggui/userAction"]` — a PURE DOORBELL.
958
998
  *
@@ -1077,7 +1117,7 @@ export declare function toolResultGguiRender(result: unknown): GguiRenderBootstr
1077
1117
  *
1078
1118
  * @public
1079
1119
  */
1080
- export declare const GGUI_RENDER_SHELL_SURFACE = "var(--ggui-shell-background, var(--ggui-color-surface, var(--ggui-shell-scheme-surface, #f9fafb)))";
1120
+ export declare const GGUI_RENDER_SHELL_SURFACE = "var(--ggui-shell-background, var(--ggui-color-ground, var(--ggui-shell-scheme-surface, #f9fafb)))";
1081
1121
  /**
1082
1122
  * Inline `<style>` block that gives the shell's pre-render placeholder
1083
1123
  * a SCHEME-AWARE neutral ground (#662).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,OAAO,GACZ,mBAAmB,GAAG,SAAS,CAUjC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,OAAO,GACd,mBAAmB,GAAG,SAAS,CAGjC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,yBAAyB,sGAC+D,CAAC;AAEtG;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iCAAiC,QA0BpC,CAAC;AAEX,eAAO,MAAM,8BAA8B,kPACsM,CAAC;AAElP;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IAChD;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,mBAAmB,EAC9B,OAAO,CAAC,EAAE,oBAAoB,GAC7B,MAAM,CA6CR;AAED;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,gCAAgC,CAAC;AAEpE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAa3D"}
@@ -27,7 +27,7 @@
27
27
  * bootstrap mechanism (short-code auto-login, signed-URL bootstrap, etc.)
28
28
  * reuses the same slots.
29
29
  */
30
- import { appThemeSchema } from '../schemas/app-theme.js';
30
+ import { parseAppThemeAtReadDoor } from '../schemas/app-theme.js';
31
31
  import { isRecord } from '../validation/is-record.js';
32
32
  /**
33
33
  * MCP capability name ggui servers advertise in their MCP `initialize`
@@ -131,18 +131,7 @@ export function deriveContextName(slotKey) {
131
131
  * @public
132
132
  */
133
133
  export const MCP_APP_AI_GGUI_RENDER_META_KEY = 'ai.ggui/render';
134
- /**
135
- * Read the `ai.ggui/render` slice off a parsed JSON-RPC `_meta` object.
136
- *
137
- * Structural validation only. Missing key returns `{ok: true, meta: undefined}`
138
- * — not a failure. Required-fields gate (sessionId / appId / runtimeUrl)
139
- * fires only when the key is present. Field-level optional-field
140
- * defensive parsing (e.g. context-slot schema narrowing, expiresAt date
141
- * parse) lives downstream in the iframe-runtime's `validateMeta`.
142
- *
143
- * @public
144
- */
145
- export function parseMcpAppAiGguiRenderMeta(meta) {
134
+ export function parseMcpAppAiGguiRenderMeta(meta, options = {}) {
146
135
  if (!isRecord(meta)) {
147
136
  return { ok: true };
148
137
  }
@@ -235,12 +224,20 @@ export function parseMcpAppAiGguiRenderMeta(meta) {
235
224
  cHash.length > 0 &&
236
225
  typeof vUrl === 'string' &&
237
226
  vUrl.length > 0;
238
- // Theme overlay — validated via the complete `appThemeSchema` so the
239
- // parsed value is typed `AppTheme` without an unguarded cast. A
240
- // malformed/absent overlay yields `undefined` and is dropped from the
241
- // slice (tolerant degrade, consistent with the other optional fields).
242
- const themeParse = s.theme !== undefined ? appThemeSchema.safeParse(s.theme) : undefined;
243
- const parsedTheme = themeParse?.success === true ? themeParse.data : undefined;
227
+ // Theme overlay — parsed at the READ door (`parseAppThemeAtReadDoor`,
228
+ // ggui#1093 belt): unknown top-level members are stripped and reported,
229
+ // the overlays kept, so a slice from a later release never loses its
230
+ // theme here; anything the write door would refuse is refused and
231
+ // reported, and the theme is dropped from the slice (tolerant degrade,
232
+ // consistent with the other optional fields).
233
+ const themeRead = s.theme !== undefined ? parseAppThemeAtReadDoor(s.theme) : undefined;
234
+ const parsedTheme = themeRead?.ok === true ? themeRead.theme : undefined;
235
+ if (themeRead !== undefined && !themeRead.ok) {
236
+ options.onInvalidTheme?.(themeRead.issues);
237
+ }
238
+ if (themeRead?.ok === true && themeRead.stripped.length > 0) {
239
+ options.onStrippedThemeMembers?.(themeRead.stripped);
240
+ }
244
241
  const slice = {
245
242
  sessionId: s.sessionId,
246
243
  appId: s.appId,
@@ -257,9 +254,10 @@ export function parseMcpAppAiGguiRenderMeta(meta) {
257
254
  ...(s.themeMode !== undefined
258
255
  ? { themeMode: s.themeMode }
259
256
  : {}),
260
- // `theme` is the only structured optional field on the slice, so
261
- // it gets the schema as its parser (the rest are scalar/array
262
- // casts). `appThemeSchema` is the complete validator — a malformed
257
+ // `theme` is the only structured optional field on the slice, so it
258
+ // gets a parser (the rest are scalar/array casts): the READ door
259
+ // `parseAppThemeAtReadDoor` — unknown top-level members stripped and
260
+ // reported, everything the write door would refuse refused. A refused
263
261
  // overlay degrades to "no overlay" rather than failing the whole
264
262
  // slice, matching the tolerant posture of the other optional fields.
265
263
  ...(parsedTheme !== undefined ? { theme: parsedTheme } : {}),
@@ -601,6 +599,14 @@ export function isGguiSubmitActionInput(value) {
601
599
  return true;
602
600
  }
603
601
  }
602
+ /**
603
+ * Narrow a guarded envelope to its `dispatch` member. Sound because
604
+ * {@link isGguiSubmitActionInput}'s closed-set `switch` validates the
605
+ * `'dispatch'` payload before any extension kind can carry that literal.
606
+ */
607
+ export function isGguiSubmitDispatchInput(env) {
608
+ return env.kind === 'dispatch';
609
+ }
604
610
  /**
605
611
  * Does this slice carry at least one MOUNT MODE discriminator?
606
612
  * Mirrors the iframe-runtime's `validateMeta`: the runtime needs
@@ -686,7 +692,7 @@ export function toolResultGguiRender(result) {
686
692
  *
687
693
  * @public
688
694
  */
689
- export const GGUI_RENDER_SHELL_SURFACE = 'var(--ggui-shell-background, var(--ggui-color-surface, var(--ggui-shell-scheme-surface, #f9fafb)))';
695
+ export const GGUI_RENDER_SHELL_SURFACE = 'var(--ggui-shell-background, var(--ggui-color-ground, var(--ggui-shell-scheme-surface, #f9fafb)))';
690
696
  /**
691
697
  * Inline `<style>` block that gives the shell's pre-render placeholder
692
698
  * a SCHEME-AWARE neutral ground (#662). Before the runtime injects
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Overlay attestation (ggui#987 §6.3): ONE canonical serialization and ONE
3
+ * hash for the per-app theme overlay, so every minter (a platform's
4
+ * projector, a console, a CLI) and every write door compute the same bytes.
5
+ *
6
+ * Canonical JSON: object keys sorted recursively, no whitespace, `undefined`
7
+ * members omitted, strings/numbers as JSON emits them. Hash: SHA-256 over the
8
+ * UTF-8 bytes, lowercase hex. Async because it uses Web Crypto
9
+ * (`globalThis.crypto.subtle`), available in every runtime the protocol
10
+ * targets.
11
+ */
12
+ import type { AppTheme } from '../schemas/app-theme.js';
13
+ /** The attested part of an overlay — never `mode`, `name`, `frameless`, nor the declared assets `fonts` / `imagery` (ggui#1093). */
14
+ export type OverlayHashInput = Pick<AppTheme, 'overlays' | 'cssVariables' | 'keyframes'>;
15
+ /** The canonical JSON the hash is taken over — exported so tests and other minters can pin it. */
16
+ export declare function canonicalOverlayJson(input: OverlayHashInput): string;
17
+ /** `sha256(canonicalOverlayJson(input))` as lowercase hex — the value `AppTheme.overlayHash` carries. */
18
+ export declare function canonicalOverlayHash(input: OverlayHashInput): Promise<string>;
19
+ //# sourceMappingURL=overlay-hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay-hash.d.ts","sourceRoot":"","sources":["../../src/integrations/overlay-hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,oIAAoI;AACpI,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,GAAG,cAAc,GAAG,WAAW,CAAC,CAAC;AAczF,kGAAkG;AAClG,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAOpE;AAMD,yGAAyG;AACzG,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAGnF"}
@@ -0,0 +1,29 @@
1
+ function canonicalize(v) {
2
+ if (v === undefined)
3
+ return 'null';
4
+ if (v === null || typeof v !== 'object')
5
+ return JSON.stringify(v);
6
+ if (Array.isArray(v))
7
+ return `[${v.map((x) => canonicalize(x)).join(',')}]`;
8
+ const keys = Object.keys(v)
9
+ .filter((k) => v[k] !== undefined)
10
+ .sort();
11
+ return `{${keys.map((k) => `${JSON.stringify(k)}:${canonicalize(v[k])}`).join(',')}}`;
12
+ }
13
+ /** The canonical JSON the hash is taken over — exported so tests and other minters can pin it. */
14
+ export function canonicalOverlayJson(input) {
15
+ const doc = {
16
+ overlays: input.overlays,
17
+ cssVariables: input.cssVariables,
18
+ keyframes: input.keyframes,
19
+ };
20
+ return canonicalize(doc);
21
+ }
22
+ function toHex(bytes) {
23
+ return Array.from(new Uint8Array(bytes), (b) => b.toString(16).padStart(2, '0')).join('');
24
+ }
25
+ /** `sha256(canonicalOverlayJson(input))` as lowercase hex — the value `AppTheme.overlayHash` carries. */
26
+ export async function canonicalOverlayHash(input) {
27
+ const bytes = new TextEncoder().encode(canonicalOverlayJson(input));
28
+ return toHex(await globalThis.crypto.subtle.digest('SHA-256', bytes));
29
+ }