@ggui-ai/mcp-server-handlers 0.12.0 → 0.14.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 (194) hide show
  1. package/dist/__tests__/define-handler.test-d.d.ts +2 -0
  2. package/dist/__tests__/define-handler.test-d.d.ts.map +1 -0
  3. package/dist/__tests__/define-handler.test-d.js +99 -0
  4. package/dist/app-discovery/list-gadgets.d.ts +62 -9
  5. package/dist/app-discovery/list-gadgets.d.ts.map +1 -1
  6. package/dist/app-discovery/list-gadgets.js +6 -3
  7. package/dist/app-discovery/list-themes.d.ts +24 -9
  8. package/dist/app-discovery/list-themes.d.ts.map +1 -1
  9. package/dist/app-discovery/list-themes.js +21 -11
  10. package/dist/blueprints/describe-blueprint-format.d.ts +30 -11
  11. package/dist/blueprints/describe-blueprint-format.d.ts.map +1 -1
  12. package/dist/blueprints/describe-blueprint-format.js +3 -2
  13. package/dist/blueprints/describe-data-contract-format.d.ts +9 -14
  14. package/dist/blueprints/describe-data-contract-format.d.ts.map +1 -1
  15. package/dist/blueprints/describe-data-contract-format.js +5 -3
  16. package/dist/blueprints/get-blueprint-boilerplate.d.ts +5 -10
  17. package/dist/blueprints/get-blueprint-boilerplate.d.ts.map +1 -1
  18. package/dist/blueprints/get-blueprint-boilerplate.js +3 -2
  19. package/dist/blueprints/get-example-blueprints.d.ts +14 -20
  20. package/dist/blueprints/get-example-blueprints.d.ts.map +1 -1
  21. package/dist/blueprints/get-example-blueprints.js +3 -2
  22. package/dist/blueprints/list-available-primitives.d.ts +5 -10
  23. package/dist/blueprints/list-available-primitives.d.ts.map +1 -1
  24. package/dist/blueprints/list-available-primitives.js +3 -2
  25. package/dist/blueprints/list-featured-blueprints.d.ts +34 -33
  26. package/dist/blueprints/list-featured-blueprints.d.ts.map +1 -1
  27. package/dist/blueprints/list-featured-blueprints.js +17 -13
  28. package/dist/blueprints/render-blueprint.d.ts +13 -13
  29. package/dist/blueprints/render-blueprint.d.ts.map +1 -1
  30. package/dist/blueprints/render-blueprint.js +3 -2
  31. package/dist/blueprints/search-blueprints.d.ts +71 -19
  32. package/dist/blueprints/search-blueprints.d.ts.map +1 -1
  33. package/dist/blueprints/search-blueprints.js +7 -20
  34. package/dist/blueprints/validate-blueprint.d.ts +21 -11
  35. package/dist/blueprints/validate-blueprint.d.ts.map +1 -1
  36. package/dist/blueprints/validate-blueprint.js +17 -20
  37. package/dist/credits/get-credit-balance.d.ts +13 -12
  38. package/dist/credits/get-credit-balance.d.ts.map +1 -1
  39. package/dist/credits/get-credit-balance.js +3 -2
  40. package/dist/credits/list-credit-transactions.d.ts +10 -11
  41. package/dist/credits/list-credit-transactions.d.ts.map +1 -1
  42. package/dist/credits/list-credit-transactions.js +3 -2
  43. package/dist/index.d.ts +2 -2
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +1 -1
  46. package/dist/ops-apps/create-app.d.ts +20 -18
  47. package/dist/ops-apps/create-app.d.ts.map +1 -1
  48. package/dist/ops-apps/create-app.js +3 -2
  49. package/dist/ops-apps/delete-app.d.ts +5 -9
  50. package/dist/ops-apps/delete-app.d.ts.map +1 -1
  51. package/dist/ops-apps/delete-app.js +3 -2
  52. package/dist/ops-apps/list-apps.d.ts +21 -7
  53. package/dist/ops-apps/list-apps.d.ts.map +1 -1
  54. package/dist/ops-apps/list-apps.js +15 -4
  55. package/dist/ops-apps/set-app-theme.d.ts +39 -33
  56. package/dist/ops-apps/set-app-theme.d.ts.map +1 -1
  57. package/dist/ops-apps/set-app-theme.js +3 -2
  58. package/dist/ops-apps/set-default-app.d.ts +5 -9
  59. package/dist/ops-apps/set-default-app.d.ts.map +1 -1
  60. package/dist/ops-apps/set-default-app.js +3 -2
  61. package/dist/ops-apps/update-app.d.ts +13 -17
  62. package/dist/ops-apps/update-app.d.ts.map +1 -1
  63. package/dist/ops-apps/update-app.js +3 -2
  64. package/dist/ops-blueprint/delete.d.ts +8 -11
  65. package/dist/ops-blueprint/delete.d.ts.map +1 -1
  66. package/dist/ops-blueprint/delete.js +3 -2
  67. package/dist/ops-blueprint/generate.d.ts +26 -24
  68. package/dist/ops-blueprint/generate.d.ts.map +1 -1
  69. package/dist/ops-blueprint/generate.js +11 -2
  70. package/dist/ops-blueprint/list.d.ts +12 -14
  71. package/dist/ops-blueprint/list.d.ts.map +1 -1
  72. package/dist/ops-blueprint/list.js +3 -2
  73. package/dist/ops-blueprint/register.d.ts +21 -21
  74. package/dist/ops-blueprint/register.d.ts.map +1 -1
  75. package/dist/ops-blueprint/register.js +3 -2
  76. package/dist/ops-blueprint/update.d.ts +13 -14
  77. package/dist/ops-blueprint/update.d.ts.map +1 -1
  78. package/dist/ops-blueprint/update.js +3 -2
  79. package/dist/ops-connector-keys/issue-connector-key.d.ts +37 -18
  80. package/dist/ops-connector-keys/issue-connector-key.d.ts.map +1 -1
  81. package/dist/ops-connector-keys/issue-connector-key.js +3 -2
  82. package/dist/ops-connector-keys/list-connector-keys.d.ts +30 -7
  83. package/dist/ops-connector-keys/list-connector-keys.d.ts.map +1 -1
  84. package/dist/ops-connector-keys/list-connector-keys.js +5 -3
  85. package/dist/ops-connector-keys/revoke-connector-key.d.ts +10 -14
  86. package/dist/ops-connector-keys/revoke-connector-key.d.ts.map +1 -1
  87. package/dist/ops-connector-keys/revoke-connector-key.js +3 -2
  88. package/dist/ops-coupon/redeem-coupon.d.ts +22 -13
  89. package/dist/ops-coupon/redeem-coupon.d.ts.map +1 -1
  90. package/dist/ops-coupon/redeem-coupon.js +3 -2
  91. package/dist/ops-orgs/create-org.d.ts +18 -12
  92. package/dist/ops-orgs/create-org.d.ts.map +1 -1
  93. package/dist/ops-orgs/create-org.js +3 -2
  94. package/dist/ops-orgs/get-org-balance.d.ts +6 -10
  95. package/dist/ops-orgs/get-org-balance.d.ts.map +1 -1
  96. package/dist/ops-orgs/get-org-balance.js +3 -2
  97. package/dist/ops-orgs/invite-to-org.d.ts +17 -21
  98. package/dist/ops-orgs/invite-to-org.d.ts.map +1 -1
  99. package/dist/ops-orgs/invite-to-org.js +3 -2
  100. package/dist/ops-orgs/list-orgs.d.ts +25 -7
  101. package/dist/ops-orgs/list-orgs.d.ts.map +1 -1
  102. package/dist/ops-orgs/list-orgs.js +5 -3
  103. package/dist/ops-orgs/remove-org-member.d.ts +8 -12
  104. package/dist/ops-orgs/remove-org-member.d.ts.map +1 -1
  105. package/dist/ops-orgs/remove-org-member.js +3 -2
  106. package/dist/ops-orgs/rename-org.d.ts +8 -12
  107. package/dist/ops-orgs/rename-org.d.ts.map +1 -1
  108. package/dist/ops-orgs/rename-org.js +3 -2
  109. package/dist/ops-orgs/revoke-invite.d.ts +11 -15
  110. package/dist/ops-orgs/revoke-invite.d.ts.map +1 -1
  111. package/dist/ops-orgs/revoke-invite.js +3 -2
  112. package/dist/ops-themes/delete-theme.d.ts +13 -10
  113. package/dist/ops-themes/delete-theme.d.ts.map +1 -1
  114. package/dist/ops-themes/delete-theme.js +3 -2
  115. package/dist/ops-themes/list-themes.d.ts +20 -13
  116. package/dist/ops-themes/list-themes.d.ts.map +1 -1
  117. package/dist/ops-themes/list-themes.js +3 -2
  118. package/dist/ops-themes/register-theme.d.ts +27 -19
  119. package/dist/ops-themes/register-theme.d.ts.map +1 -1
  120. package/dist/ops-themes/register-theme.js +7 -4
  121. package/dist/provider-keys/list-provider-keys.d.ts +26 -7
  122. package/dist/provider-keys/list-provider-keys.d.ts.map +1 -1
  123. package/dist/provider-keys/list-provider-keys.js +7 -10
  124. package/dist/provider-keys/remove-provider-key.d.ts +13 -17
  125. package/dist/provider-keys/remove-provider-key.d.ts.map +1 -1
  126. package/dist/provider-keys/remove-provider-key.js +3 -2
  127. package/dist/provider-keys/set-provider-key.d.ts +19 -17
  128. package/dist/provider-keys/set-provider-key.d.ts.map +1 -1
  129. package/dist/provider-keys/set-provider-key.js +3 -2
  130. package/dist/provider-keys/types.d.ts +31 -15
  131. package/dist/provider-keys/types.d.ts.map +1 -1
  132. package/dist/provider-keys/types.js +24 -6
  133. package/dist/renders/amend.d.ts +23 -48
  134. package/dist/renders/amend.d.ts.map +1 -1
  135. package/dist/renders/amend.js +19 -24
  136. package/dist/renders/blueprint-matcher.d.ts.map +1 -1
  137. package/dist/renders/blueprint-matcher.js +20 -13
  138. package/dist/renders/consume.d.ts +60 -55
  139. package/dist/renders/consume.d.ts.map +1 -1
  140. package/dist/renders/consume.js +26 -6
  141. package/dist/renders/declare-tool-catalog.d.ts +12 -67
  142. package/dist/renders/declare-tool-catalog.d.ts.map +1 -1
  143. package/dist/renders/declare-tool-catalog.js +3 -2
  144. package/dist/renders/get-render-source.d.ts +13 -11
  145. package/dist/renders/get-render-source.d.ts.map +1 -1
  146. package/dist/renders/get-render-source.js +3 -2
  147. package/dist/renders/get-session.d.ts +18 -12
  148. package/dist/renders/get-session.d.ts.map +1 -1
  149. package/dist/renders/get-session.js +25 -47
  150. package/dist/renders/handshake.d.ts +27 -39
  151. package/dist/renders/handshake.d.ts.map +1 -1
  152. package/dist/renders/handshake.js +3 -2
  153. package/dist/renders/index.d.ts +2 -2
  154. package/dist/renders/index.d.ts.map +1 -1
  155. package/dist/renders/list-sessions.d.ts +27 -22
  156. package/dist/renders/list-sessions.d.ts.map +1 -1
  157. package/dist/renders/list-sessions.js +9 -21
  158. package/dist/renders/match-precision/topk-probe.d.ts +2 -0
  159. package/dist/renders/match-precision/topk-probe.d.ts.map +1 -0
  160. package/dist/renders/match-precision/topk-probe.js +148 -0
  161. package/dist/renders/props-mutation-core.d.ts.map +1 -1
  162. package/dist/renders/props-mutation-core.js +3 -10
  163. package/dist/renders/refresh-ws-token.d.ts +33 -37
  164. package/dist/renders/refresh-ws-token.d.ts.map +1 -1
  165. package/dist/renders/refresh-ws-token.js +3 -2
  166. package/dist/renders/render.d.ts +215 -116
  167. package/dist/renders/render.d.ts.map +1 -1
  168. package/dist/renders/render.js +1327 -1216
  169. package/dist/renders/runtime-pull.d.ts +33 -27
  170. package/dist/renders/runtime-pull.d.ts.map +1 -1
  171. package/dist/renders/runtime-pull.js +15 -9
  172. package/dist/renders/runtime-telemetry.d.ts +12 -15
  173. package/dist/renders/runtime-telemetry.d.ts.map +1 -1
  174. package/dist/renders/runtime-telemetry.js +3 -2
  175. package/dist/renders/slice-meta-derivation.d.ts +1 -1
  176. package/dist/renders/stream.d.ts +12 -13
  177. package/dist/renders/stream.d.ts.map +1 -1
  178. package/dist/renders/stream.js +12 -2
  179. package/dist/renders/submit-action.d.ts +47 -50
  180. package/dist/renders/submit-action.d.ts.map +1 -1
  181. package/dist/renders/submit-action.js +3 -2
  182. package/dist/renders/sync-context.d.ts +18 -21
  183. package/dist/renders/sync-context.d.ts.map +1 -1
  184. package/dist/renders/sync-context.js +3 -2
  185. package/dist/renders/update.d.ts +33 -98
  186. package/dist/renders/update.d.ts.map +1 -1
  187. package/dist/renders/update.js +35 -57
  188. package/dist/types.d.ts +117 -3
  189. package/dist/types.d.ts.map +1 -1
  190. package/dist/types.js +3 -0
  191. package/package.json +10 -10
  192. package/dist/renders/client-observations.d.ts +0 -79
  193. package/dist/renders/client-observations.d.ts.map +0 -1
  194. package/dist/renders/client-observations.js +0 -48
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=define-handler.test-d.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-handler.test-d.d.ts","sourceRoot":"","sources":["../../src/__tests__/define-handler.test-d.ts"],"names":[],"mappings":""}
@@ -0,0 +1,99 @@
1
+ // Compile-time type tests for the handler contract (#817).
2
+ // This file must compile with zero errors — that IS the test.
3
+ // Run: pnpm typecheck (from this package — tsc compiles this file with the rest)
4
+ //
5
+ // Two obligations, both stated by the TYPE so a disagreement is a compile
6
+ // error where there used to be silence (runtime `validateOutputPayload` on
7
+ // the wire was the only failure mode):
8
+ // 1. `defineHandler` binds the handler's output to what its `outputSchema`
9
+ // produces (inferred from the handler's return, checked against the
10
+ // shape) — so nobody hand-writes one; with an `outputEnvelopeSchema` the
11
+ // envelope must produce that same shape with exactly its keys.
12
+ // 2. `SharedHandler` itself constrains `OutputData` to what its own
13
+ // `outputSchema` (or envelope) produces, so a raw literal that bypasses
14
+ // the helper still cannot omit a key.
15
+ // No `@ts-expect-error` here — a negative case is asserted with vitest's
16
+ // `expectTypeOf(...).not.toMatchTypeOf`, which fails to COMPILE when the
17
+ // relationship holds the wrong way (precedent: protocol's
18
+ // contract-inference.test-d.ts).
19
+ import { expectTypeOf } from 'vitest';
20
+ import { z } from 'zod';
21
+ import { defineHandler, } from '../types.js';
22
+ const inputSchema = { id: z.string() };
23
+ const outputSchema = { id: z.string(), count: z.number(), note: z.string().optional() };
24
+ // ── 1. defineHandler derives OutputData from outputSchema ──────────────────
25
+ const derived = defineHandler({
26
+ name: 'x_derived',
27
+ description: 'd',
28
+ inputSchema,
29
+ outputSchema,
30
+ async handler() {
31
+ return { id: 'a', count: 1 };
32
+ },
33
+ });
34
+ // OutputData is INFERRED from what the handler returns and checked against the
35
+ // shape's bound: this infallible handler is exactly its shape — no failure arm
36
+ // it never produces, no narrowing for consumers.
37
+ expectTypeOf(derived).toMatchTypeOf();
38
+ // And every handler still assigns to the bound the list boundary uses.
39
+ expectTypeOf(derived).toMatchTypeOf();
40
+ expectTypeOf().toMatchTypeOf();
41
+ expectTypeOf().not.toMatchTypeOf();
42
+ // ── 1b. with an envelope: the envelope must produce the shape's output ────────
43
+ const envelope = z.object({ id: z.string(), count: z.number(), note: z.string().optional() });
44
+ const enveloped = defineHandler({
45
+ name: 'x_enveloped',
46
+ description: 'd',
47
+ inputSchema,
48
+ outputSchema,
49
+ outputEnvelopeSchema: envelope,
50
+ async handler() {
51
+ return { id: 'a', count: 1 };
52
+ },
53
+ });
54
+ // The enveloped definition is a SharedHandler like any other — same bound at the list boundary.
55
+ expectTypeOf(enveloped).toMatchTypeOf();
56
+ // Inferred, not stamped: this handler never fails, so its output is exactly the
57
+ // envelope's shape — no failure arm it never produces.
58
+ expectTypeOf().toEqualTypeOf();
59
+ expectTypeOf().toMatchTypeOf();
60
+ expectTypeOf().not.toMatchTypeOf();
61
+ expectTypeOf().toMatchTypeOf();
62
+ expectTypeOf().toEqualTypeOf();
63
+ expectTypeOf().not.toMatchTypeOf();
64
+ expectTypeOf().toEqualTypeOf();
65
+ // … and so is a failure envelope carrying the shape.
66
+ expectTypeOf().toEqualTypeOf();
67
+ // ── 3. envelope keys must equal outputSchema keys (keyof identity) ─────────
68
+ // A mismatched envelope (a key the raw shape does not declare) is rejected by
69
+ // the helper's parameter type — asserted as non-assignability of the
70
+ // definition object, never by @ts-expect-error.
71
+ const mismatchedEnvelope = z.object({ id: z.string(), count: z.number(), rogue: z.boolean() });
72
+ // It DOES produce the shape's output (extra key is fine for assignability) — the
73
+ // rejection below is the keys rule, not the output rule.
74
+ expectTypeOf(mismatchedEnvelope).toMatchTypeOf();
75
+ // Same keys → admissible …
76
+ expectTypeOf().toMatchTypeOf();
77
+ // … a rogue key → the property type is unsatisfiable, the definition does not type.
78
+ expectTypeOf().not.toMatchTypeOf();
79
+ // Both mismatch directions, pinned on the operator itself. The EXTRA-key case
80
+ // above is the one a strip-parsing transport hides at runtime (the key is
81
+ // dropped, nothing fails) — the type is its only receipt. The MISSING-key case
82
+ // is caught twice: the envelope no longer produces the shape's output (rule 1),
83
+ // and its keys differ (rule 3). Exact keys are the identity.
84
+ const missingKeyEnvelope = z.object({ id: z.string() });
85
+ expectTypeOf(missingKeyEnvelope).not.toMatchTypeOf();
86
+ expectTypeOf().toEqualTypeOf();
87
+ expectTypeOf().toBeNever();
88
+ expectTypeOf().toBeNever();
89
+ const interfaceTyped = defineHandler({
90
+ name: 'x_interface',
91
+ description: 'd',
92
+ inputSchema,
93
+ outputSchema,
94
+ async handler() {
95
+ return { id: 'a', count: 1 };
96
+ },
97
+ });
98
+ expectTypeOf(interfaceTyped).toMatchTypeOf();
99
+ expectTypeOf(enveloped).toMatchTypeOf();
@@ -42,12 +42,8 @@
42
42
  * defeats per-app curation.
43
43
  */
44
44
  import { z } from 'zod';
45
- import { type GadgetDescriptor } from '@ggui-ai/protocol';
46
45
  import type { AppMetadataStore } from '@ggui-ai/mcp-server-core';
47
- import type { SharedHandler } from '../types.js';
48
- declare const inputSchema: {
49
- readonly appId: z.ZodOptional<z.ZodString>;
50
- };
46
+ import { type ShapeOutput } from '../types.js';
51
47
  declare const outputSchema: {
52
48
  readonly gadgets: z.ZodArray<z.ZodObject<{
53
49
  exports: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
@@ -86,9 +82,66 @@ export interface GguiListGadgetsHandlerDeps {
86
82
  */
87
83
  readonly appMetadataStore: AppMetadataStore;
88
84
  }
89
- export interface GguiListGadgetsOutput {
90
- readonly gadgets: readonly GadgetDescriptor[];
91
- }
92
- export declare function createGguiListGadgetsHandler(deps: GguiListGadgetsHandlerDeps): SharedHandler<typeof inputSchema, typeof outputSchema, GguiListGadgetsOutput>;
85
+ /** The wire shape — derived from `outputSchema`, the one source of truth (#817). */
86
+ export type GguiListGadgetsOutput = ShapeOutput<typeof outputSchema>;
87
+ export declare function createGguiListGadgetsHandler(deps: GguiListGadgetsHandlerDeps): import("../types.js").SharedHandler<{
88
+ readonly appId: z.ZodOptional<z.ZodString>;
89
+ }, {
90
+ readonly gadgets: z.ZodArray<z.ZodObject<{
91
+ exports: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
92
+ description: z.ZodOptional<z.ZodString>;
93
+ usage: z.ZodOptional<z.ZodString>;
94
+ example: z.ZodOptional<z.ZodType<import("@ggui-ai/protocol").JsonValue, unknown, z.core.$ZodTypeInternals<import("@ggui-ai/protocol").JsonValue, unknown>>>;
95
+ permission: z.ZodOptional<z.ZodString>;
96
+ gotchas: z.ZodOptional<z.ZodString>;
97
+ hook: z.ZodString;
98
+ }, z.core.$strict>, z.ZodObject<{
99
+ description: z.ZodOptional<z.ZodString>;
100
+ usage: z.ZodOptional<z.ZodString>;
101
+ example: z.ZodOptional<z.ZodType<import("@ggui-ai/protocol").JsonValue, unknown, z.core.$ZodTypeInternals<import("@ggui-ai/protocol").JsonValue, unknown>>>;
102
+ permission: z.ZodOptional<z.ZodString>;
103
+ gotchas: z.ZodOptional<z.ZodString>;
104
+ component: z.ZodString;
105
+ }, z.core.$strict>]>>;
106
+ version: z.ZodString;
107
+ package: z.ZodString;
108
+ bundleUrl: z.ZodOptional<z.ZodURL>;
109
+ bundleHost: z.ZodOptional<z.ZodString>;
110
+ bundleSri: z.ZodOptional<z.ZodString>;
111
+ styleUrl: z.ZodOptional<z.ZodURL>;
112
+ connect: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodURL>>>;
113
+ requires: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
114
+ typesUrl: z.ZodOptional<z.ZodURL>;
115
+ typesSri: z.ZodOptional<z.ZodString>;
116
+ }, z.core.$strict>>;
117
+ }, {
118
+ gadgets: {
119
+ exports: ({
120
+ hook: string;
121
+ description?: string | undefined;
122
+ usage?: string | undefined;
123
+ example?: import("@ggui-ai/protocol").JsonValue | undefined;
124
+ permission?: string | undefined;
125
+ gotchas?: string | undefined;
126
+ } | {
127
+ component: string;
128
+ description?: string | undefined;
129
+ usage?: string | undefined;
130
+ example?: import("@ggui-ai/protocol").JsonValue | undefined;
131
+ permission?: string | undefined;
132
+ gotchas?: string | undefined;
133
+ })[];
134
+ version: string;
135
+ package: string;
136
+ bundleUrl?: string | undefined;
137
+ bundleHost?: string | undefined;
138
+ bundleSri?: string | undefined;
139
+ styleUrl?: string | undefined;
140
+ connect?: readonly string[] | undefined;
141
+ requires?: readonly string[] | undefined;
142
+ typesUrl?: string | undefined;
143
+ typesSri?: string | undefined;
144
+ }[];
145
+ }>;
93
146
  export {};
94
147
  //# sourceMappingURL=list-gadgets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-gadgets.d.ts","sourceRoot":"","sources":["../../src/app-discovery/list-gadgets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjE,QAAA,MAAM,WAAW;;CAQP,CAAC;AAkBX,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAER,CAAC;AAEX,MAAM,WAAW,0BAA0B;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;CAC7C;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAC/C;AAED,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,0BAA0B,GAC/B,aAAa,CACd,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,qBAAqB,CACtB,CA6BA"}
1
+ {"version":3,"file":"list-gadgets.d.ts","sourceRoot":"","sources":["../../src/app-discovery/list-gadgets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAsC,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AA6BnF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAER,CAAC;AAEX,MAAM,WAAW,0BAA0B;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;CAC7C;AAED,oFAAoF;AACpF,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC,OAAO,YAAY,CAAC,CAAC;AAErE,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+B5E"}
@@ -43,6 +43,7 @@
43
43
  */
44
44
  import { z } from 'zod';
45
45
  import { resolveAppGadgets, gadgetDescriptorSchema, } from '@ggui-ai/protocol';
46
+ import { defineHandler } from '../types.js';
46
47
  import { AppAccessDeniedError } from './errors.js';
47
48
  const inputSchema = {
48
49
  appId: z
@@ -70,7 +71,7 @@ const outputSchema = {
70
71
  gadgets: z.array(gadgetEntryWireSchema),
71
72
  };
72
73
  export function createGguiListGadgetsHandler(deps) {
73
- return {
74
+ return defineHandler({
74
75
  name: 'ggui_list_gadgets',
75
76
  title: 'List gadgets',
76
77
  audience: ['agent'],
@@ -90,7 +91,9 @@ export function createGguiListGadgetsHandler(deps) {
90
91
  // get a meaningful catalog. This mirrors the cloud DDB adapter's
91
92
  // default-on-read pattern at the row-projection site.
92
93
  const gadgets = resolveAppGadgets(app?.gadgets);
93
- return { gadgets };
94
+ // A fresh copy: the resolver may hand back the stdlib singleton, which is
95
+ // a resolver-internal guard, never a wire fact — the wire is mutable JSON.
96
+ return { gadgets: [...gadgets] };
94
97
  },
95
- };
98
+ });
96
99
  }
@@ -25,10 +25,7 @@
25
25
  */
26
26
  import { z } from 'zod';
27
27
  import type { AppMetadataStore } from '@ggui-ai/mcp-server-core';
28
- import type { SharedHandler } from '../types.js';
29
- declare const inputSchema: {
30
- readonly appId: z.ZodOptional<z.ZodString>;
31
- };
28
+ import { type ShapeOutput } from '../types.js';
32
29
  declare const outputSchema: {
33
30
  readonly themes: z.ZodArray<z.ZodObject<{
34
31
  id: z.ZodString;
@@ -38,7 +35,7 @@ declare const outputSchema: {
38
35
  light: "light";
39
36
  dark: "dark";
40
37
  }>>;
41
- }, z.core.$loose>>;
38
+ }, z.core.$strip>>;
42
39
  };
43
40
  export interface ThemeCatalogEntry {
44
41
  readonly id: string;
@@ -62,9 +59,27 @@ export interface GguiListThemesHandlerDeps {
62
59
  */
63
60
  readonly themes: () => readonly ThemeCatalogEntry[];
64
61
  }
65
- export interface GguiListThemesOutput {
66
- readonly themes: readonly ThemeCatalogEntry[];
67
- }
68
- export declare function createGguiListThemesHandler(deps: GguiListThemesHandlerDeps): SharedHandler<typeof inputSchema, typeof outputSchema, GguiListThemesOutput>;
62
+ /** The wire shape — derived from `outputSchema`, the one source of truth (#817). */
63
+ export type GguiListThemesOutput = ShapeOutput<typeof outputSchema>;
64
+ export declare function createGguiListThemesHandler(deps: GguiListThemesHandlerDeps): import("../types.js").SharedHandler<{
65
+ readonly appId: z.ZodOptional<z.ZodString>;
66
+ }, {
67
+ readonly themes: z.ZodArray<z.ZodObject<{
68
+ id: z.ZodString;
69
+ name: z.ZodString;
70
+ description: z.ZodString;
71
+ modes: z.ZodArray<z.ZodEnum<{
72
+ light: "light";
73
+ dark: "dark";
74
+ }>>;
75
+ }, z.core.$strip>>;
76
+ }, {
77
+ themes: {
78
+ id: string;
79
+ name: string;
80
+ description: string;
81
+ modes: ("light" | "dark")[];
82
+ }[];
83
+ }>;
69
84
  export {};
70
85
  //# sourceMappingURL=list-themes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-themes.d.ts","sourceRoot":"","sources":["../../src/app-discovery/list-themes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjE,QAAA,MAAM,WAAW;;CAQP,CAAC;AAkBX,QAAA,MAAM,YAAY;;;;;;;;;;CAER,CAAC;AAEX,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,SAAS,iBAAiB,EAAE,CAAC;CACrD;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC/C;AAED,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,yBAAyB,GAC9B,aAAa,CACd,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,oBAAoB,CACrB,CAgCA"}
1
+ {"version":3,"file":"list-themes.d.ts","sourceRoot":"","sources":["../../src/app-discovery/list-themes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAsC,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AA8BnF,QAAA,MAAM,YAAY;;;;;;;;;;CAER,CAAC;AAEX,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,SAAS,iBAAiB,EAAE,CAAC;CACrD;AAED,oFAAoF;AACpF,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC,OAAO,YAAY,CAAC,CAAC;AAEpE,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,yBAAyB;;;;;;;;;;;;;;;;;;;GAyC1E"}
@@ -24,6 +24,7 @@
24
24
  * apply a chosen theme.
25
25
  */
26
26
  import { z } from 'zod';
27
+ import { defineHandler } from '../types.js';
27
28
  import { AppAccessDeniedError } from './errors.js';
28
29
  const inputSchema = {
29
30
  appId: z
@@ -39,19 +40,20 @@ const inputSchema = {
39
40
  * `themes` resolver and is responsible for whatever upstream shape
40
41
  * produces it.
41
42
  */
42
- const themeEntryWireSchema = z
43
- .object({
43
+ // Closed: the wire carries exactly the four documented keys. A catalog
44
+ // entry's undeclared extras (a resolver's `metadata`, say) stay seam-side —
45
+ // declare a key here if agents should see it.
46
+ const themeEntryWireSchema = z.object({
44
47
  id: z.string().min(1),
45
48
  name: z.string(),
46
49
  description: z.string(),
47
50
  modes: z.array(z.enum(['light', 'dark'])),
48
- })
49
- .passthrough();
51
+ });
50
52
  const outputSchema = {
51
53
  themes: z.array(themeEntryWireSchema),
52
54
  };
53
55
  export function createGguiListThemesHandler(deps) {
54
- return {
56
+ return defineHandler({
55
57
  name: 'ggui_list_themes',
56
58
  title: 'List themes',
57
59
  audience: ['agent'],
@@ -70,11 +72,19 @@ export function createGguiListThemesHandler(deps) {
70
72
  // (so the picker UI stays stable) and silently drops ids that
71
73
  // appear in the allowlist but aren't registered (defensive
72
74
  // against operator typos — agent still sees a working list).
73
- if (app?.availableThemeIds && app.availableThemeIds.length > 0) {
74
- const allowed = new Set(app.availableThemeIds);
75
- return { themes: catalog.filter((t) => allowed.has(t.id)) };
76
- }
77
- return { themes: catalog };
75
+ const visible = app?.availableThemeIds && app.availableThemeIds.length > 0
76
+ ? catalog.filter((t) => new Set(app.availableThemeIds).has(t.id))
77
+ : catalog;
78
+ // Project the seam entries onto the wire shape — exactly the four keys
79
+ // `outputSchema` declares, as fresh mutable values.
80
+ return {
81
+ themes: visible.map((t) => ({
82
+ id: t.id,
83
+ name: t.name,
84
+ description: t.description,
85
+ modes: [...t.modes],
86
+ })),
87
+ };
78
88
  },
79
- };
89
+ });
80
90
  }
@@ -8,18 +8,37 @@
8
8
  * composing from stale training-data assumptions about the shape.
9
9
  */
10
10
  import { z } from 'zod';
11
- import type { SharedHandler } from '../types.js';
12
- declare const inputSchema: {};
13
- declare const outputSchema: {
11
+ export declare function createDescribeBlueprintFormatHandler(): import("../types.js").SharedHandler<{}, {
14
12
  format: z.ZodLiteral<"AgentBlueprint">;
15
13
  documentation: z.ZodString;
16
14
  example: z.ZodRecord<z.ZodString, z.ZodUnknown>;
17
- };
18
- interface DescribeBlueprintFormatOutput {
19
- readonly format: 'AgentBlueprint';
20
- readonly documentation: string;
21
- readonly example: Record<string, unknown>;
22
- }
23
- export declare function createDescribeBlueprintFormatHandler(): SharedHandler<typeof inputSchema, typeof outputSchema, DescribeBlueprintFormatOutput>;
24
- export {};
15
+ }, {
16
+ format: "AgentBlueprint";
17
+ documentation: string;
18
+ example: {
19
+ source: string;
20
+ contract: {
21
+ propsSpec: {
22
+ properties: {
23
+ greeting: {
24
+ schema: {
25
+ type: string;
26
+ };
27
+ required: boolean;
28
+ description: string;
29
+ };
30
+ };
31
+ };
32
+ actionSpec: {
33
+ dismiss: {
34
+ label: string;
35
+ description: string;
36
+ };
37
+ };
38
+ };
39
+ fixtureProps: {
40
+ greeting: string;
41
+ };
42
+ };
43
+ }>;
25
44
  //# sourceMappingURL=describe-blueprint-format.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"describe-blueprint-format.d.ts","sourceRoot":"","sources":["../../src/blueprints/describe-blueprint-format.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,QAAA,MAAM,WAAW,IAAK,CAAC;AAEvB,QAAA,MAAM,YAAY;;;;CAIjB,CAAC;AAEF,UAAU,6BAA6B;IACrC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AA6GD,wBAAgB,oCAAoC,IAAI,aAAa,CACnE,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,6BAA6B,CAC9B,CAiBA"}
1
+ {"version":3,"file":"describe-blueprint-format.d.ts","sourceRoot":"","sources":["../../src/blueprints/describe-blueprint-format.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsHxB,wBAAgB,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBnD"}
@@ -8,6 +8,7 @@
8
8
  * composing from stale training-data assumptions about the shape.
9
9
  */
10
10
  import { z } from 'zod';
11
+ import { defineHandler } from '../types.js';
11
12
  const inputSchema = {};
12
13
  const outputSchema = {
13
14
  format: z.literal('AgentBlueprint'),
@@ -120,7 +121,7 @@ export default function Hello(props: Props) {
120
121
  },
121
122
  };
122
123
  export function createDescribeBlueprintFormatHandler() {
123
- return {
124
+ return defineHandler({
124
125
  name: 'ggui_protocol_describe_blueprint_format',
125
126
  title: 'Describe blueprint format',
126
127
  audience: ['protocol'],
@@ -134,5 +135,5 @@ export function createDescribeBlueprintFormatHandler() {
134
135
  example: EXAMPLE,
135
136
  };
136
137
  },
137
- };
138
+ });
138
139
  }
@@ -8,24 +8,19 @@
8
8
  * what Claude composes and what `ggui_protocol_validate_blueprint` expects.
9
9
  */
10
10
  import { z } from 'zod';
11
- import type { SharedHandler } from '../types.js';
12
- declare const inputSchema: {};
13
- declare const outputSchema: {
11
+ export declare function createDescribeDataContractFormatHandler(): import("../types.js").SharedHandler<{}, {
14
12
  format: z.ZodLiteral<"DataContract">;
15
13
  documentation: z.ZodString;
16
14
  examples: z.ZodArray<z.ZodObject<{
17
15
  title: z.ZodString;
18
16
  contract: z.ZodRecord<z.ZodString, z.ZodUnknown>;
19
17
  }, z.core.$strip>>;
20
- };
21
- interface DescribeDataContractFormatOutput {
22
- readonly format: 'DataContract';
23
- readonly documentation: string;
24
- readonly examples: ReadonlyArray<{
25
- readonly title: string;
26
- readonly contract: Record<string, unknown>;
27
- }>;
28
- }
29
- export declare function createDescribeDataContractFormatHandler(): SharedHandler<typeof inputSchema, typeof outputSchema, DescribeDataContractFormatOutput>;
30
- export {};
18
+ }, {
19
+ format: "DataContract";
20
+ documentation: string;
21
+ examples: {
22
+ title: string;
23
+ contract: Record<string, unknown>;
24
+ }[];
25
+ }>;
31
26
  //# sourceMappingURL=describe-data-contract-format.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"describe-data-contract-format.d.ts","sourceRoot":"","sources":["../../src/blueprints/describe-data-contract-format.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,QAAA,MAAM,WAAW,IAAK,CAAC;AAEvB,QAAA,MAAM,YAAY;;;;;;;CASjB,CAAC;AAEF,UAAU,gCAAgC;IACxC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;QAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC5C,CAAC,CAAC;CACJ;AAyUD,wBAAgB,uCAAuC,IAAI,aAAa,CACtE,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,gCAAgC,CACjC,CAiBA"}
1
+ {"version":3,"file":"describe-data-contract-format.d.ts","sourceRoot":"","sources":["../../src/blueprints/describe-data-contract-format.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA2VxB,wBAAgB,uCAAuC;;;;;;;;;;;;;;GAkBtD"}
@@ -9,6 +9,7 @@
9
9
  */
10
10
  import { z } from 'zod';
11
11
  import { RETIRED_CONTRACT_FIELDS } from '@ggui-ai/protocol';
12
+ import { defineHandler } from '../types.js';
12
13
  const inputSchema = {};
13
14
  const outputSchema = {
14
15
  format: z.literal('DataContract'),
@@ -343,7 +344,7 @@ const EXAMPLES = [
343
344
  },
344
345
  ];
345
346
  export function createDescribeDataContractFormatHandler() {
346
- return {
347
+ return defineHandler({
347
348
  name: 'ggui_protocol_describe_data_contract_format',
348
349
  title: 'Describe data contract format',
349
350
  audience: ['protocol'],
@@ -354,8 +355,9 @@ export function createDescribeDataContractFormatHandler() {
354
355
  return {
355
356
  format: 'DataContract',
356
357
  documentation: DOCUMENTATION,
357
- examples: EXAMPLES,
358
+ // A fresh copy: the wire is mutable JSON, the module constant is not ours to hand out.
359
+ examples: [...EXAMPLES],
358
360
  };
359
361
  },
360
- };
362
+ });
361
363
  }
@@ -18,8 +18,7 @@
18
18
  * is the load-bearing input: a richer contract → a more complete scaffold.
19
19
  */
20
20
  import { z } from 'zod';
21
- import type { SharedHandler } from '../types.js';
22
- declare const inputSchema: {
21
+ export declare function createGetBlueprintBoilerplateHandler(): import("../types.js").SharedHandler<{
23
22
  contract: z.ZodUnknown;
24
23
  intent: z.ZodOptional<z.ZodString>;
25
24
  shell: z.ZodDefault<z.ZodEnum<{
@@ -33,13 +32,9 @@ declare const inputSchema: {
33
32
  desktop: "desktop";
34
33
  universal: "universal";
35
34
  }>>;
36
- };
37
- declare const outputSchema: {
35
+ }, {
38
36
  source: z.ZodString;
39
- };
40
- interface GetBlueprintBoilerplateOutput {
41
- readonly source: string;
42
- }
43
- export declare function createGetBlueprintBoilerplateHandler(): SharedHandler<typeof inputSchema, typeof outputSchema, GetBlueprintBoilerplateOutput>;
44
- export {};
37
+ }, {
38
+ source: string;
39
+ }>;
45
40
  //# sourceMappingURL=get-blueprint-boilerplate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-blueprint-boilerplate.d.ts","sourceRoot":"","sources":["../../src/blueprints/get-blueprint-boilerplate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;CAwBhB,CAAC;AAEF,QAAA,MAAM,YAAY;;CAEjB,CAAC;AAEF,UAAU,6BAA6B;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,oCAAoC,IAAI,aAAa,CACnE,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,6BAA6B,CAC9B,CAqBA"}
1
+ {"version":3,"file":"get-blueprint-boilerplate.d.ts","sourceRoot":"","sources":["../../src/blueprints/get-blueprint-boilerplate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuCxB,wBAAgB,oCAAoC;;;;;;;;;;;;;;;;;;GAqBnD"}
@@ -19,6 +19,7 @@
19
19
  */
20
20
  import { z } from 'zod';
21
21
  import { generateBoilerplate, } from '@ggui-ai/ui-gen/boilerplate';
22
+ import { defineHandler } from '../types.js';
22
23
  const inputSchema = {
23
24
  contract: z
24
25
  .unknown()
@@ -40,7 +41,7 @@ const outputSchema = {
40
41
  source: z.string().describe('TSX source ready to compile + render.'),
41
42
  };
42
43
  export function createGetBlueprintBoilerplateHandler() {
43
- return {
44
+ return defineHandler({
44
45
  name: 'ggui_protocol_get_blueprint_boilerplate',
45
46
  title: 'Get blueprint boilerplate',
46
47
  audience: ['protocol'],
@@ -53,5 +54,5 @@ export function createGetBlueprintBoilerplateHandler() {
53
54
  const source = generateBoilerplate(parsed.intent ?? '', contract, parsed.shell, parsed.screen);
54
55
  return { source };
55
56
  },
56
- };
57
+ });
57
58
  }
@@ -24,16 +24,14 @@
24
24
  * generative path; this is the curated reference path.
25
25
  */
26
26
  import { z } from 'zod';
27
- import type { SharedHandler } from '../types.js';
28
- declare const inputSchema: {
27
+ export declare function createGetExampleBlueprintsHandler(): import("../types.js").SharedHandler<{
29
28
  kind: z.ZodDefault<z.ZodEnum<{
30
29
  display: "display";
31
30
  collect: "collect";
32
31
  converse: "converse";
33
32
  all: "all";
34
33
  }>>;
35
- };
36
- declare const outputSchema: {
34
+ }, {
37
35
  examples: z.ZodArray<z.ZodObject<{
38
36
  title: z.ZodString;
39
37
  kind: z.ZodEnum<{
@@ -48,20 +46,16 @@ declare const outputSchema: {
48
46
  fixtureProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
49
47
  }, z.core.$strip>;
50
48
  }, z.core.$strip>>;
51
- };
52
- interface ExampleBlueprintEntry {
53
- readonly title: string;
54
- readonly kind: 'display' | 'collect' | 'converse';
55
- readonly summary: string;
56
- readonly blueprint: {
57
- readonly source: string;
58
- readonly contract: Record<string, unknown>;
59
- readonly fixtureProps?: Record<string, unknown>;
60
- };
61
- }
62
- interface GetExampleBlueprintsOutput {
63
- readonly examples: ReadonlyArray<ExampleBlueprintEntry>;
64
- }
65
- export declare function createGetExampleBlueprintsHandler(): SharedHandler<typeof inputSchema, typeof outputSchema, GetExampleBlueprintsOutput>;
66
- export {};
49
+ }, {
50
+ examples: {
51
+ title: string;
52
+ kind: "display" | "collect" | "converse";
53
+ summary: string;
54
+ blueprint: {
55
+ source: string;
56
+ contract: Record<string, unknown>;
57
+ fixtureProps?: Record<string, unknown> | undefined;
58
+ };
59
+ }[];
60
+ }>;
67
61
  //# sourceMappingURL=get-example-blueprints.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-example-blueprints.d.ts","sourceRoot":"","sources":["../../src/blueprints/get-example-blueprints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,QAAA,MAAM,WAAW;;;;;;;CAOhB,CAAC;AAEF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;CAajB,CAAC;AAEF,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IAClD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE;QAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC3C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACjD,CAAC;CACH;AAED,UAAU,0BAA0B;IAClC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;CACzD;AAuQD,wBAAgB,iCAAiC,IAAI,aAAa,CAChE,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,0BAA0B,CAC3B,CAkBA"}
1
+ {"version":3,"file":"get-example-blueprints.d.ts","sourceRoot":"","sources":["../../src/blueprints/get-example-blueprints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqSxB,wBAAgB,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkBhD"}
@@ -24,6 +24,7 @@
24
24
  * generative path; this is the curated reference path.
25
25
  */
26
26
  import { z } from 'zod';
27
+ import { defineHandler } from '../types.js';
27
28
  const inputSchema = {
28
29
  kind: z
29
30
  .enum(['display', 'collect', 'converse', 'all'])
@@ -297,7 +298,7 @@ const ALL_EXAMPLES = [
297
298
  CHAT_PANEL,
298
299
  ];
299
300
  export function createGetExampleBlueprintsHandler() {
300
- return {
301
+ return defineHandler({
301
302
  name: 'ggui_protocol_get_example_blueprints',
302
303
  title: 'Get example blueprints',
303
304
  audience: ['protocol'],
@@ -311,5 +312,5 @@ export function createGetExampleBlueprintsHandler() {
311
312
  : ALL_EXAMPLES.filter((ex) => ex.kind === parsed.kind);
312
313
  return { examples: [...filtered] };
313
314
  },
314
- };
315
+ });
315
316
  }