@ggui-ai/protocol 0.14.0 → 0.15.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 (66) hide show
  1. package/dist/envelope-adapters.d.ts +1 -14
  2. package/dist/envelope-adapters.d.ts.map +1 -1
  3. package/dist/envelope-adapters.js +17 -1
  4. package/dist/envelopes/render-refusal.d.ts +49 -0
  5. package/dist/envelopes/render-refusal.d.ts.map +1 -0
  6. package/dist/envelopes/render-refusal.js +12 -0
  7. package/dist/gadgets/resolve-app-gadgets.d.ts +1 -1
  8. package/dist/gadgets/stdlib-gadgets.d.ts +2 -2
  9. package/dist/gadgets/stdlib-gadgets.js +1 -1
  10. package/dist/index.d.ts +67 -63
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +4 -0
  13. package/dist/integrations/mcp-apps.d.ts +2 -2
  14. package/dist/schemas/blueprint.d.ts +2 -2
  15. package/dist/schemas/data-contract.d.ts +10 -30
  16. package/dist/schemas/data-contract.d.ts.map +1 -1
  17. package/dist/schemas/data-contract.js +4 -27
  18. package/dist/schemas/interface-context.d.ts +44 -0
  19. package/dist/schemas/interface-context.d.ts.map +1 -0
  20. package/dist/schemas/interface-context.js +22 -0
  21. package/dist/schemas/invoke.d.ts +3 -3
  22. package/dist/schemas/invoke.js +1 -1
  23. package/dist/schemas/mcp.d.ts +203 -94
  24. package/dist/schemas/mcp.d.ts.map +1 -1
  25. package/dist/schemas/mcp.js +110 -32
  26. package/dist/schemas/public-env-key.d.ts +26 -0
  27. package/dist/schemas/public-env-key.d.ts.map +1 -0
  28. package/dist/schemas/public-env-key.js +25 -0
  29. package/dist/schemas/render-input-envelope.d.ts +2 -2
  30. package/dist/schemas/runtime-telemetry-limits.d.ts +11 -0
  31. package/dist/schemas/runtime-telemetry-limits.d.ts.map +1 -0
  32. package/dist/schemas/runtime-telemetry-limits.js +10 -0
  33. package/dist/transport/websocket.d.ts +5 -5
  34. package/dist/types/auth.d.ts +1 -1
  35. package/dist/types/contract-inference.d.ts +1 -1
  36. package/dist/types/events.d.ts +1 -1
  37. package/dist/types/ggui-session-event.d.ts +2 -2
  38. package/dist/types/host-context.d.ts +3 -3
  39. package/dist/types/interface-context.d.ts +1 -1
  40. package/dist/types/invoke.d.ts +1 -1
  41. package/dist/types/lifecycle.d.ts +1 -1
  42. package/dist/types/live-channel.d.ts +2 -2
  43. package/dist/types/mcp.d.ts +20 -63
  44. package/dist/types/mcp.d.ts.map +1 -1
  45. package/dist/types/mcp.js +7 -0
  46. package/dist/types/refusal-codes.d.ts +23 -2
  47. package/dist/types/refusal-codes.d.ts.map +1 -1
  48. package/dist/types/refusal-codes.js +26 -9
  49. package/dist/types/render.d.ts +9 -8
  50. package/dist/types/render.d.ts.map +1 -1
  51. package/dist/types/ui-generator.d.ts +1 -1
  52. package/dist/validation/ajv-runtime.d.ts +2 -2
  53. package/dist/validation/contract-validator.d.ts +6 -6
  54. package/dist/validation/cross-references.d.ts +2 -2
  55. package/dist/validation/hygiene-rules.d.ts +1 -1
  56. package/dist/validation/name-invariants.d.ts +2 -2
  57. package/dist/validation/reserved-channels.d.ts +1 -1
  58. package/dist/validation/schema-compat-invariants.d.ts +2 -2
  59. package/dist/validation/schema-meta-validation.d.ts +1 -1
  60. package/dist/version.d.ts +132 -10
  61. package/dist/version.d.ts.map +1 -1
  62. package/dist/version.js +132 -10
  63. package/dist/wire.d.ts +45 -0
  64. package/dist/wire.d.ts.map +1 -0
  65. package/dist/wire.js +44 -0
  66. package/package.json +7 -1
@@ -1,17 +1,4 @@
1
- /**
2
- * Envelope adapters — storage-side helpers for the consume pipe.
3
- *
4
- * `PendingEvent.envelope` carries the per-gesture {@link ConsumeEventEntry}
5
- * row written by `submit_action`'s `kind:"dispatch"` branch. Storage is
6
- * single-shaped (the same shape `ggui_consume` returns verbatim on drain).
7
- *
8
- * The only bounded adapter that lives here now is
9
- * {@link parsePendingEnvelope} — a shape-neutral reader for stored
10
- * `PendingEvent.envelope` values that may arrive as raw objects or as
11
- * JSON strings, depending on how the deployment's storage layer
12
- * serializes rows.
13
- */
14
- import type { ConsumeEventEntry } from './types/mcp';
1
+ import type { ConsumeEventEntry } from './types/mcp.js';
15
2
  /**
16
3
  * Parse a {@link PendingEvent.envelope} that may arrive as either a raw
17
4
  * object or a JSON-stringified object, depending on how the
@@ -1 +1 @@
1
- {"version":3,"file":"envelope-adapters.d.ts","sourceRoot":"","sources":["../src/envelope-adapters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,iBAAiB,GAAG,MAAM,GACjC,iBAAiB,CAGnB"}
1
+ {"version":3,"file":"envelope-adapters.d.ts","sourceRoot":"","sources":["../src/envelope-adapters.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,iBAAiB,GAAG,MAAM,GACjC,iBAAiB,CAKnB"}
@@ -1,3 +1,17 @@
1
+ /**
2
+ * Envelope adapters — storage-side helpers for the consume pipe.
3
+ *
4
+ * `PendingEvent.envelope` carries the per-gesture {@link ConsumeEventEntry}
5
+ * row written by `submit_action`'s `kind:"dispatch"` branch. Storage is
6
+ * single-shaped (the same shape `ggui_consume` returns verbatim on drain).
7
+ *
8
+ * The only bounded adapter that lives here now is
9
+ * {@link parsePendingEnvelope} — a shape-neutral reader for stored
10
+ * `PendingEvent.envelope` values that may arrive as raw objects or as
11
+ * JSON strings, depending on how the deployment's storage layer
12
+ * serializes rows.
13
+ */
14
+ import { consumeEventEntrySchema } from './schemas/mcp.js';
1
15
  /**
2
16
  * Parse a {@link PendingEvent.envelope} that may arrive as either a raw
3
17
  * object or a JSON-stringified object, depending on how the
@@ -10,5 +24,7 @@
10
24
  export function parsePendingEnvelope(stored) {
11
25
  if (typeof stored !== 'string')
12
26
  return stored;
13
- return JSON.parse(stored);
27
+ // Parsed, never cast (ggui#817 part C2): a malformed pipe entry refuses
28
+ // here, at the seam, instead of shipping to the agent typed as good.
29
+ return consumeEventEntrySchema.parse(JSON.parse(stored));
14
30
  }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * SPEC §7.1's REFUSED arm as one primitive (ggui#803 leg 9).
3
+ *
4
+ * A render gate that refuses before generation answers with a tool
5
+ * RESULT — never a throw, never a JSON-RPC error — carrying four facts:
6
+ *
7
+ * 1. `isError: true` — the call did not render.
8
+ * 2. `content[0].text` = `<code>: <message> <fix>` — a courtesy line
9
+ * for the model; the code LEADS so the state is visible without
10
+ * parsing, but `structuredContent.refusal.code` is the mechanism.
11
+ * 3. `structuredContent` = `{ outcome: 'refused', refusal }` — the
12
+ * refusal verbatim, the whole payload being
13
+ * {@link refusedOutputSchema}.
14
+ * 4. No `_meta` — nothing was read, no handshake consumed, nothing
15
+ * committed, so there is no identity to carry.
16
+ *
17
+ * Parties: every server that projects a pre-generation refusal — the
18
+ * shipping `ggui_render` handler and the protocol reference server
19
+ * both build the result HERE, so the facts have one source. Failure
20
+ * mode: a projection that drifts from these facts fails the
21
+ * conformance kit's `refusal-envelope` catalog; the violation is
22
+ * observed by the handler's and the reference server's conformance
23
+ * suites, which grade this function through each of them.
24
+ *
25
+ * The text deliberately shares nothing with a FAILED render's text:
26
+ * that one says the handshakeId "is consumed", which is false for a
27
+ * refusal — the same id is valid on a retry. The two texts are
28
+ * contradictory by construction and must never be one builder.
29
+ */
30
+ import type { z } from 'zod';
31
+ import type { PreGenerationRefusal, refusedOutputSchema } from '../schemas/mcp.js';
32
+ /** The refused arm's `structuredContent` — derived from the schema, never restated. */
33
+ export type RefusedRenderOutput = z.infer<typeof refusedOutputSchema>;
34
+ /** The tool result a render gate answers a pre-generation refusal with. */
35
+ export interface RenderRefusalResult {
36
+ readonly isError: true;
37
+ readonly content: readonly [{
38
+ readonly type: 'text';
39
+ readonly text: string;
40
+ }];
41
+ readonly structuredContent: RefusedRenderOutput;
42
+ }
43
+ /**
44
+ * Project a {@link PreGenerationRefusal} onto the §7.1 refused tool
45
+ * result. Pure and synchronous: the deterministic projection is the
46
+ * whole obligation.
47
+ */
48
+ export declare function projectRenderRefusal(refusal: PreGenerationRefusal): RenderRefusalResult;
49
+ //# sourceMappingURL=render-refusal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-refusal.d.ts","sourceRoot":"","sources":["../../src/envelopes/render-refusal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEnF,uFAAuF;AACvF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,2EAA2E;AAC3E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9E,QAAQ,CAAC,iBAAiB,EAAE,mBAAmB,CAAC;CACjD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB,CAMvF"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Project a {@link PreGenerationRefusal} onto the §7.1 refused tool
3
+ * result. Pure and synchronous: the deterministic projection is the
4
+ * whole obligation.
5
+ */
6
+ export function projectRenderRefusal(refusal) {
7
+ return {
8
+ isError: true,
9
+ content: [{ type: 'text', text: `${refusal.code}: ${refusal.message} ${refusal.fix}` }],
10
+ structuredContent: { outcome: 'refused', refusal },
11
+ };
12
+ }
@@ -1,4 +1,4 @@
1
- import type { GadgetDescriptor } from '../types/data-contract';
1
+ import type { GadgetDescriptor } from '../types/data-contract.js';
2
2
  /**
3
3
  * Resolve an app's effective gadget set from its three sources, in
4
4
  * ascending precedence: the first-party stdlib package is the
@@ -1,4 +1,4 @@
1
- import type { GadgetDescriptor } from '../types/data-contract';
1
+ import type { GadgetDescriptor } from '../types/data-contract.js';
2
2
  /**
3
3
  * The first-party `@ggui-ai/gadgets` package name. Used as
4
4
  * the default `package` for every entry in {@link STDLIB_GADGETS}
@@ -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.14.0";
15
+ export declare const STDLIB_GADGETS_VERSION = "0.15.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.14.0';
42
+ export const STDLIB_GADGETS_VERSION = '0.15.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
@@ -1,65 +1,69 @@
1
- export * from "./version";
2
- export * from "./types/auth";
3
- export * from "./types/events";
4
- export * from "./types/render";
5
- export * from "./types/ggui-session-event";
6
- export * from "./types/thread";
7
- export * from "./types/live-channel";
8
- export * from "./types/ui-generator";
9
- export * from "./types/mcp";
10
- export * from "./schemas/mcp";
11
- export * from "./schemas/render-input-envelope";
12
- export type { DeepReadonly } from "./types/readonly";
13
- export * from "./schemas/invoke";
14
- export * from "./schemas/data-contract";
15
- export * from "./schemas/app-theme";
16
- export { canonicalizeContracts, canonicalizeValue } from "./registry/canonicalize-contract";
17
- export { summarizeContract } from "./registry/summarize-contract";
18
- export { buildEnforcedPropsSchema, canonicalPropsSchemaBytes, classifyPropsSchemaProfile, GRAMMAR_SAFE_FORMATS, GRAMMAR_SAFE_KEYWORDS, type PropsSchemaProfile, } from "./validation/enforced-props-schema";
19
- export type { TextBlock, ToolUseBlock, ToolResultBlock, ContentBlock, InvokeEvent, InvokeErrorCode, InvokeTurn, } from "./types/invoke";
20
- export * from "./types/llm";
21
- export * from "./types/refusal-codes";
22
- export * from "./types/llm-route";
23
- export * from "./types/interface-context";
24
- export * from "./types/host-context";
25
- export * from "./types/lifecycle";
26
- export * from "./types/data-contract";
27
- export * from "./types/blueprint";
28
- export * from "./types/blueprint-source";
29
- export * from "./types/portable-blueprint";
30
- export * from "./schemas/blueprint";
31
- export * from "./types/handshake-suggestion";
32
- export * from "./schemas/handshake-suggestion";
33
- export * from "./schemas/ops-blueprint";
34
- export * from "./types/contract-inference";
35
- export * from "./types/gadget";
36
- export * from "./types/app-config";
1
+ export * from "./version.js";
2
+ export * from "./types/auth.js";
3
+ export * from "./types/events.js";
4
+ export * from "./types/render.js";
5
+ export * from "./types/ggui-session-event.js";
6
+ export * from "./types/thread.js";
7
+ export * from "./types/live-channel.js";
8
+ export * from "./types/ui-generator.js";
9
+ export * from "./types/mcp.js";
10
+ export * from "./schemas/mcp.js";
11
+ export * from "./schemas/interface-context.js";
12
+ export * from "./schemas/runtime-telemetry-limits.js";
13
+ export * from "./schemas/public-env-key.js";
14
+ export * from "./schemas/render-input-envelope.js";
15
+ export type { DeepReadonly } from "./types/readonly.js";
16
+ export * from "./schemas/invoke.js";
17
+ export * from "./schemas/data-contract.js";
18
+ export * from "./schemas/app-theme.js";
19
+ export { canonicalizeContracts, canonicalizeValue } from "./registry/canonicalize-contract.js";
20
+ export { summarizeContract } from "./registry/summarize-contract.js";
21
+ export { buildEnforcedPropsSchema, canonicalPropsSchemaBytes, classifyPropsSchemaProfile, GRAMMAR_SAFE_FORMATS, GRAMMAR_SAFE_KEYWORDS, type PropsSchemaProfile, } from "./validation/enforced-props-schema.js";
22
+ export type { TextBlock, ToolUseBlock, ToolResultBlock, ContentBlock, InvokeEvent, InvokeErrorCode, InvokeTurn, } from "./types/invoke.js";
23
+ export * from "./types/llm.js";
24
+ export * from "./types/refusal-codes.js";
25
+ export * from "./types/llm-route.js";
26
+ export * from "./types/interface-context.js";
27
+ export * from "./types/host-context.js";
28
+ export * from "./types/lifecycle.js";
29
+ export * from "./types/data-contract.js";
30
+ export * from "./types/blueprint.js";
31
+ export * from "./types/blueprint-source.js";
32
+ export * from "./types/portable-blueprint.js";
33
+ export * from "./schemas/blueprint.js";
34
+ export * from "./types/handshake-suggestion.js";
35
+ export * from "./schemas/handshake-suggestion.js";
36
+ export * from "./schemas/ops-blueprint.js";
37
+ export * from "./types/contract-inference.js";
38
+ export * from "./types/gadget.js";
39
+ export * from "./types/app-config.js";
37
40
  export { composeOAuthUserId } from "./types/oauth-user-id.js";
38
- export * from "./iframe-bridge";
39
- export * from "./envelope-adapters";
40
- export * from "./envelopes/builders";
41
- export * from "./errors/version-mismatch";
42
- export * from "./errors/unknown-permission-name";
43
- export * from "./errors/resource-read";
44
- export * from "./validation/contract-validator";
45
- export * from "./validation/cross-references";
46
- export * from "./validation/is-record";
47
- export * from "./validation/hygiene-rules";
48
- export * from "./validation/lint-contract";
49
- export * from "./validation/name-invariants";
50
- export * from "./validation/schema-compat-invariants";
51
- export * from "./validation/schema-meta-validation";
52
- export * from "./validation/resolve-stream-channel";
53
- export * from "./validation/reserved-channels";
54
- export * from "./validation/sanitize-error";
55
- export * from "./validation/schema-subset";
56
- export * from "./validation/zod-to-json-schema";
57
- export * from "./validation/ui-security";
58
- export * from "./schema-learning/merge";
59
- export * from "./schema-learning/derive-contract";
60
- export * from "./screen-blueprints/index";
61
- export { GGUI_AGENT_SYSTEM_PROMPT } from "./recommended-prompts";
62
- export { STDLIB_GADGETS, STDLIB_GADGETS_PACKAGE, STDLIB_GADGETS_VERSION, STDLIB_GADGET_HOOKS, } from "./gadgets/stdlib-gadgets";
63
- export { resolveAppGadgets } from './gadgets/resolve-app-gadgets';
64
- export { filterDescriptorsToContract, gadgetIdentityKey, gadgetExportName, listContractGadgets, } from "./gadgets/resolve-contract-gadgets";
41
+ export * from "./iframe-bridge.js";
42
+ export * from "./envelope-adapters.js";
43
+ export * from "./envelopes/builders.js";
44
+ export * from "./envelopes/render-refusal.js";
45
+ export * from "./errors/version-mismatch.js";
46
+ export * from "./errors/unknown-permission-name.js";
47
+ export * from "./errors/resource-read.js";
48
+ export * from "./validation/contract-validator.js";
49
+ export * from "./validation/cross-references.js";
50
+ export * from "./validation/is-record.js";
51
+ export * from "./validation/hygiene-rules.js";
52
+ export * from "./validation/lint-contract.js";
53
+ export * from "./validation/name-invariants.js";
54
+ export * from "./validation/schema-compat-invariants.js";
55
+ export * from "./validation/schema-meta-validation.js";
56
+ export * from "./validation/resolve-stream-channel.js";
57
+ export * from "./validation/reserved-channels.js";
58
+ export * from "./validation/sanitize-error.js";
59
+ export * from "./validation/schema-subset.js";
60
+ export * from "./validation/zod-to-json-schema.js";
61
+ export * from "./validation/ui-security.js";
62
+ export * from "./schema-learning/merge.js";
63
+ export * from "./schema-learning/derive-contract.js";
64
+ export * from "./screen-blueprints/index.js";
65
+ export { GGUI_AGENT_SYSTEM_PROMPT } from "./recommended-prompts.js";
66
+ export { STDLIB_GADGETS, STDLIB_GADGETS_PACKAGE, STDLIB_GADGETS_VERSION, STDLIB_GADGET_HOOKS, } from "./gadgets/stdlib-gadgets.js";
67
+ export { resolveAppGadgets } from './gadgets/resolve-app-gadgets.js';
68
+ export { filterDescriptorsToContract, gadgetIdentityKey, gadgetExportName, listContractGadgets, } from "./gadgets/resolve-contract-gadgets.js";
65
69
  //# sourceMappingURL=index.d.ts.map
@@ -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,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,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,KAAK,kBAAkB,GACxB,MAAM,oCAAoC,CAAC;AAM5C,YAAY,EAEV,SAAS,EACT,YAAY,EACZ,eAAe,EACf,YAAY,EAEZ,WAAW,EACX,eAAe,EAEf,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,cAAc,aAAa,CAAC;AAK5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;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c,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AAKnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AAGjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,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
@@ -17,6 +17,9 @@ export * from "./types/live-channel.js";
17
17
  export * from "./types/ui-generator.js";
18
18
  export * from "./types/mcp.js";
19
19
  export * from "./schemas/mcp.js";
20
+ export * from "./schemas/interface-context.js";
21
+ export * from "./schemas/runtime-telemetry-limits.js";
22
+ export * from "./schemas/public-env-key.js";
20
23
  export * from "./schemas/render-input-envelope.js";
21
24
  export * from "./schemas/invoke.js";
22
25
  export * from "./schemas/data-contract.js";
@@ -72,6 +75,7 @@ export { composeOAuthUserId } from "./types/oauth-user-id.js";
72
75
  export * from "./iframe-bridge.js";
73
76
  export * from "./envelope-adapters.js";
74
77
  export * from "./envelopes/builders.js";
78
+ export * from "./envelopes/render-refusal.js";
75
79
  export * from "./errors/version-mismatch.js";
76
80
  export * from "./errors/unknown-permission-name.js";
77
81
  // Typed `resources/read` failures → JSON-RPC. The single exit for every
@@ -30,8 +30,8 @@
30
30
  import type { JsonObject, JsonSchema, JsonValue } from '../types/data-contract.js';
31
31
  import { type AppTheme } from '../schemas/app-theme.js';
32
32
  import type { z } from 'zod';
33
- import type { gguiSessionSummaryWireSchema } from '../schemas/mcp';
34
- import type { DeepReadonly } from '../types/readonly';
33
+ import type { gguiSessionSummaryWireSchema } from '../schemas/mcp.js';
34
+ import type { DeepReadonly } from '../types/readonly.js';
35
35
  /**
36
36
  * MCP capability name ggui servers advertise in their MCP `initialize`
37
37
  * response capabilities when they implement the MCP Apps outbound path.
@@ -5,8 +5,8 @@
5
5
  * here is `z.ZodType<Blueprint>` so any drift fails compile.
6
6
  */
7
7
  import { z } from 'zod';
8
- import type { AppBlueprintSearchConfig, Blueprint, BlueprintVariance } from '../types/blueprint';
9
- import type { BlueprintSource, CuratedBlueprintSource, LlmBlueprintSource, UserBlueprintSource } from '../types/blueprint-source';
8
+ import type { AppBlueprintSearchConfig, Blueprint, BlueprintVariance } from '../types/blueprint.js';
9
+ import type { BlueprintSource, CuratedBlueprintSource, LlmBlueprintSource, UserBlueprintSource } from '../types/blueprint-source.js';
10
10
  /**
11
11
  * Zod mirror of {@link LlmBlueprintSource} — the engine-generated arm.
12
12
  * Both provenance fields are REQUIRED: every generation mint site has
@@ -51,7 +51,7 @@
51
51
  * just to accept the contract and pass it to the generator.
52
52
  */
53
53
  import { z } from 'zod';
54
- import type { DataContract, JsonValue, JsonSchema, JsonObject } from '../types/data-contract';
54
+ import type { DataContract, JsonValue, JsonSchema, JsonObject } from '../types/data-contract.js';
55
55
  /**
56
56
  * Recursive {@link JsonValue} — string | number | boolean | null |
57
57
  * array | object. All fields on contract entries that carry default
@@ -211,26 +211,6 @@ export declare const agentCapabilitiesSpecSchema: z.ZodObject<{
211
211
  }, z.core.$strict>>;
212
212
  }, z.core.$strict>>;
213
213
  }, z.core.$loose>;
214
- /**
215
- * `App.publicEnv` key regex.
216
- *
217
- * Each key in `App.publicEnv` MUST match this pattern. The prefix is
218
- * the **security boundary** — operators can't accidentally stash
219
- * sensitive credentials under arbitrary names, and downstream consumers
220
- * (render gate, bootstrap projection, iframe shim) can rely on the
221
- * naming convention to mean "public-by-design".
222
- *
223
- * Rule: `GGUI_PUBLIC_APP_` prefix, then uppercase letters / digits /
224
- * underscores, at least one char after the prefix.
225
- *
226
- * `GGUI_PUBLIC_USER_*` keys are RESERVED for a future per-user
227
- * channel. The current regex rejects them so App-side config can't
228
- * pre-emptively use the namespace.
229
- *
230
- * Hoisted above `gadgetDescriptorSchema` so the wrapper's `requires`
231
- * array can reference it at schema-construction time (TDZ-safe).
232
- */
233
- export declare const PUBLIC_ENV_APP_KEY_RE: RegExp;
234
214
  /**
235
215
  * Single source of truth for the `requires[]` field shape on gadget
236
216
  * descriptors. The wire-permissive `gadgetDescriptorSchema`, the
@@ -244,7 +224,7 @@ export declare const PUBLIC_ENV_APP_KEY_RE: RegExp;
244
224
  * that declare a `requires` key must have a corresponding App-side
245
225
  * publicEnv value at render time (gate: `assertPublicEnvSatisfied`).
246
226
  */
247
- export declare const gadgetRequiresSchema: z.ZodReadonly<z.ZodArray<z.ZodString>>;
227
+ export declare const gadgetRequiresSchema: z.ZodArray<z.ZodString>;
248
228
  /**
249
229
  * SRI hash format for gadget bundles. Registry install writes
250
230
  * `bundleSri` in this shape; iframe-runtime emits it verbatim into
@@ -367,7 +347,7 @@ export declare function bundleHostScheme(host: string): 'http' | 'https';
367
347
  * needs the grammars and which this module imports
368
348
  * `KNOWN_PERMISSION_NAMES` from).
369
349
  */
370
- export { HOOK_NAME_RE, COMPONENT_NAME_RE } from './gadget-name-grammar';
350
+ export { HOOK_NAME_RE, COMPONENT_NAME_RE } from './gadget-name-grammar.js';
371
351
  /**
372
352
  * Wire-permissive {@link GadgetExport} schema — a union of a
373
353
  * hook-export shape (carries `hook`) and a component-export shape
@@ -475,8 +455,8 @@ export declare const gadgetDescriptorSchema: z.ZodObject<{
475
455
  bundleHost: z.ZodOptional<z.ZodString>;
476
456
  bundleSri: z.ZodOptional<z.ZodString>;
477
457
  styleUrl: z.ZodOptional<z.ZodURL>;
478
- connect: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodURL>>>;
479
- requires: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
458
+ connect: z.ZodOptional<z.ZodArray<z.ZodURL>>;
459
+ requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
480
460
  typesUrl: z.ZodOptional<z.ZodURL>;
481
461
  typesSri: z.ZodOptional<z.ZodString>;
482
462
  }, z.core.$strict>;
@@ -550,8 +530,8 @@ export declare const strictGadgetDescriptorSchema: z.ZodObject<{
550
530
  bundleHost: z.ZodOptional<z.ZodString>;
551
531
  bundleSri: z.ZodOptional<z.ZodString>;
552
532
  styleUrl: z.ZodOptional<z.ZodURL>;
553
- connect: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodURL>>>;
554
- requires: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
533
+ connect: z.ZodOptional<z.ZodArray<z.ZodURL>>;
534
+ requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
555
535
  typesUrl: z.ZodOptional<z.ZodURL>;
556
536
  typesSri: z.ZodOptional<z.ZodString>;
557
537
  }, z.core.$strict>;
@@ -640,8 +620,8 @@ export declare const registeredGadgetDescriptorSchema: z.ZodObject<{
640
620
  bundleHost: z.ZodOptional<z.ZodString>;
641
621
  bundleSri: z.ZodOptional<z.ZodString>;
642
622
  styleUrl: z.ZodOptional<z.ZodURL>;
643
- connect: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodURL>>>;
644
- requires: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
623
+ connect: z.ZodOptional<z.ZodArray<z.ZodURL>>;
624
+ requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
645
625
  typesUrl: z.ZodOptional<z.ZodURL>;
646
626
  typesSri: z.ZodOptional<z.ZodString>;
647
627
  }, z.core.$strict>;
@@ -718,7 +698,7 @@ export declare const clientCapabilitiesSpecSchema: z.ZodObject<{
718
698
  * - Defensive re-validation in the iframe-runtime slice-meta
719
699
  * extractors (`parseMetaFromGlobal`, `parseMetaFromToolResult`).
720
700
  */
721
- export declare const appPublicEnvSchema: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>;
701
+ export declare const appPublicEnvSchema: z.ZodRecord<z.ZodString, z.ZodString>;
722
702
  /**
723
703
  * {@link DataContract} — the unified four-spec contract surface
724
704
  * agents author on `story.contract` and that the generator
@@ -1 +1 @@
1
- {"version":3,"file":"data-contract.d.ts","sourceRoot":"","sources":["../../src/schemas/data-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EACV,UAAU,EACX,MAAM,wBAAwB,CAAC;AAEhC;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAYhD,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAyC,CAAC;AAmB7F,eAAO,MAAM,gBAAgB,EAA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;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAU1C,CAAC;AAQJ;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,qBAAqB;;;kBAKvB,CAAC;AAEZ;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB;;;mBAa/B,CAAC;AAEL;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,4BAA4B;;;;;kBAO9B,CAAC;AAEZ;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,uCAAgE,CAAC;AAEhG;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,QAQa,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAehC,CAAC;AAEX,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAiCZ,CAAC"}
@@ -51,6 +51,7 @@
51
51
  * just to accept the contract and pass it to the generator.
52
52
  */
53
53
  import { z } from 'zod';
54
+ import { PUBLIC_ENV_APP_KEY_RE } from './public-env-key.js';
54
55
  import { KNOWN_PERMISSION_NAMES } from '../validation/hygiene-rules.js';
55
56
  import { STDLIB_GADGETS_PACKAGE } from '../gadgets/stdlib-gadgets.js';
56
57
  import { COMPONENT_NAME_RE, HOOK_NAME_RE } from './gadget-name-grammar.js';
@@ -220,26 +221,6 @@ export const agentCapabilitiesSpecSchema = z
220
221
  tools: z.record(z.string(), agentToolEntrySchema),
221
222
  })
222
223
  .passthrough();
223
- /**
224
- * `App.publicEnv` key regex.
225
- *
226
- * Each key in `App.publicEnv` MUST match this pattern. The prefix is
227
- * the **security boundary** — operators can't accidentally stash
228
- * sensitive credentials under arbitrary names, and downstream consumers
229
- * (render gate, bootstrap projection, iframe shim) can rely on the
230
- * naming convention to mean "public-by-design".
231
- *
232
- * Rule: `GGUI_PUBLIC_APP_` prefix, then uppercase letters / digits /
233
- * underscores, at least one char after the prefix.
234
- *
235
- * `GGUI_PUBLIC_USER_*` keys are RESERVED for a future per-user
236
- * channel. The current regex rejects them so App-side config can't
237
- * pre-emptively use the namespace.
238
- *
239
- * Hoisted above `gadgetDescriptorSchema` so the wrapper's `requires`
240
- * array can reference it at schema-construction time (TDZ-safe).
241
- */
242
- export const PUBLIC_ENV_APP_KEY_RE = /^GGUI_PUBLIC_APP_[A-Z0-9_]+$/;
243
224
  /**
244
225
  * Single source of truth for the `requires[]` field shape on gadget
245
226
  * descriptors. The wire-permissive `gadgetDescriptorSchema`, the
@@ -253,9 +234,7 @@ export const PUBLIC_ENV_APP_KEY_RE = /^GGUI_PUBLIC_APP_[A-Z0-9_]+$/;
253
234
  * that declare a `requires` key must have a corresponding App-side
254
235
  * publicEnv value at render time (gate: `assertPublicEnvSatisfied`).
255
236
  */
256
- export const gadgetRequiresSchema = z
257
- .array(z.string().regex(PUBLIC_ENV_APP_KEY_RE))
258
- .readonly();
237
+ export const gadgetRequiresSchema = z.array(z.string().regex(PUBLIC_ENV_APP_KEY_RE));
259
238
  /**
260
239
  * SRI hash format for gadget bundles. Registry install writes
261
240
  * `bundleSri` in this shape; iframe-runtime emits it verbatim into
@@ -434,7 +413,7 @@ const basePackageFieldsShape = {
434
413
  bundleSri: z.string().regex(BUNDLE_SRI_RE).optional(),
435
414
  styleUrl: z.url().optional(),
436
415
  // CSP `connect-src` feed — full URL shape on every entry.
437
- connect: z.array(z.url()).readonly().optional(),
416
+ connect: z.array(z.url()).optional(),
438
417
  // Shared `gadgetRequiresSchema`.
439
418
  requires: gadgetRequiresSchema.optional(),
440
419
  // HTTPS URL of the package's `.d.ts`. The handler fetches it at
@@ -640,9 +619,7 @@ export const clientCapabilitiesSpecSchema = z
640
619
  * - Defensive re-validation in the iframe-runtime slice-meta
641
620
  * extractors (`parseMetaFromGlobal`, `parseMetaFromToolResult`).
642
621
  */
643
- export const appPublicEnvSchema = z
644
- .record(z.string().regex(PUBLIC_ENV_APP_KEY_RE), z.string())
645
- .readonly();
622
+ export const appPublicEnvSchema = z.record(z.string().regex(PUBLIC_ENV_APP_KEY_RE), z.string());
646
623
  /**
647
624
  * {@link DataContract} — the unified four-spec contract surface
648
625
  * agents author on `story.contract` and that the generator
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Interface-context schema — the client's viewport/platform snapshot every
3
+ * handshake and every `InvokeEvent` carries. Its own module (ggui#819) so
4
+ * the browser entry (`@ggui-ai/protocol/wire`) reaches it without the
5
+ * tool schemas that used to share its file.
6
+ */
7
+ import { z } from 'zod';
8
+ export declare const viewportSchema: z.ZodObject<{
9
+ width: z.ZodNumber;
10
+ height: z.ZodNumber;
11
+ }, z.core.$strip>;
12
+ export declare const interfaceContextSchema: z.ZodObject<{
13
+ viewport: z.ZodObject<{
14
+ width: z.ZodNumber;
15
+ height: z.ZodNumber;
16
+ }, z.core.$strip>;
17
+ platform: z.ZodEnum<{
18
+ web: "web";
19
+ desktop: "desktop";
20
+ mobile: "mobile";
21
+ }>;
22
+ deviceType: z.ZodEnum<{
23
+ desktop: "desktop";
24
+ tablet: "tablet";
25
+ phone: "phone";
26
+ }>;
27
+ orientation: z.ZodEnum<{
28
+ portrait: "portrait";
29
+ landscape: "landscape";
30
+ }>;
31
+ devicePixelRatio: z.ZodOptional<z.ZodNumber>;
32
+ touchPrimary: z.ZodOptional<z.ZodBoolean>;
33
+ shellType: z.ZodOptional<z.ZodEnum<{
34
+ fullscreen: "fullscreen";
35
+ chat: "chat";
36
+ spatial: "spatial";
37
+ }>>;
38
+ colorScheme: z.ZodOptional<z.ZodEnum<{
39
+ light: "light";
40
+ dark: "dark";
41
+ }>>;
42
+ reducedMotion: z.ZodOptional<z.ZodBoolean>;
43
+ }, z.core.$loose>;
44
+ //# sourceMappingURL=interface-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface-context.d.ts","sourceRoot":"","sources":["../../src/schemas/interface-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc;;;iBAGzB,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUnB,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Interface-context schema — the client's viewport/platform snapshot every
3
+ * handshake and every `InvokeEvent` carries. Its own module (ggui#819) so
4
+ * the browser entry (`@ggui-ai/protocol/wire`) reaches it without the
5
+ * tool schemas that used to share its file.
6
+ */
7
+ import { z } from 'zod';
8
+ export const viewportSchema = z.object({
9
+ width: z.number(),
10
+ height: z.number(),
11
+ });
12
+ export const interfaceContextSchema = z.object({
13
+ viewport: viewportSchema,
14
+ platform: z.enum(['web', 'mobile', 'desktop']),
15
+ deviceType: z.enum(['phone', 'tablet', 'desktop']),
16
+ orientation: z.enum(['portrait', 'landscape']),
17
+ devicePixelRatio: z.number().optional(),
18
+ touchPrimary: z.boolean().optional(),
19
+ shellType: z.enum(['chat', 'fullscreen', 'spatial']).optional(),
20
+ colorScheme: z.enum(['light', 'dark']).optional(),
21
+ reducedMotion: z.boolean().optional(),
22
+ }).passthrough();
@@ -307,13 +307,13 @@ export declare const invokeRequestSchema: z.ZodObject<{
307
307
  }, z.core.$strip>;
308
308
  platform: z.ZodEnum<{
309
309
  web: "web";
310
- mobile: "mobile";
311
310
  desktop: "desktop";
311
+ mobile: "mobile";
312
312
  }>;
313
313
  deviceType: z.ZodEnum<{
314
314
  desktop: "desktop";
315
- phone: "phone";
316
315
  tablet: "tablet";
316
+ phone: "phone";
317
317
  }>;
318
318
  orientation: z.ZodEnum<{
319
319
  portrait: "portrait";
@@ -322,8 +322,8 @@ export declare const invokeRequestSchema: z.ZodObject<{
322
322
  devicePixelRatio: z.ZodOptional<z.ZodNumber>;
323
323
  touchPrimary: z.ZodOptional<z.ZodBoolean>;
324
324
  shellType: z.ZodOptional<z.ZodEnum<{
325
- chat: "chat";
326
325
  fullscreen: "fullscreen";
326
+ chat: "chat";
327
327
  spatial: "spatial";
328
328
  }>>;
329
329
  colorScheme: z.ZodOptional<z.ZodEnum<{
@@ -12,7 +12,7 @@
12
12
  * and types for authoring.
13
13
  */
14
14
  import { z } from 'zod';
15
- import { interfaceContextSchema } from './mcp.js';
15
+ import { interfaceContextSchema } from './interface-context.js';
16
16
  // ── Content blocks ────────────────────────────────────────────────────
17
17
  /** Plain text content — streamed via `text_delta` events. */
18
18
  export const textBlockSchema = z.object({