@ggui-ai/mcp-server-handlers 0.24.0 → 0.26.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 (196) hide show
  1. package/README.md +2 -2
  2. package/dist/blueprints/search-blueprints.d.ts +5 -5
  3. package/dist/blueprints/search-blueprints.js +5 -5
  4. package/dist/credits/index.d.ts +2 -2
  5. package/dist/credits/index.d.ts.map +1 -1
  6. package/dist/credits/index.js +1 -1
  7. package/dist/credits/list-credit-transactions.d.ts +21 -7
  8. package/dist/credits/list-credit-transactions.d.ts.map +1 -1
  9. package/dist/credits/list-credit-transactions.js +12 -2
  10. package/dist/index.d.ts +2 -5
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +5 -9
  13. package/dist/ops-apps/create-app.d.ts +10 -11
  14. package/dist/ops-apps/create-app.d.ts.map +1 -1
  15. package/dist/ops-apps/create-app.js +12 -13
  16. package/dist/ops-apps/identity.d.ts +9 -8
  17. package/dist/ops-apps/identity.d.ts.map +1 -1
  18. package/dist/ops-apps/identity.js +2 -1
  19. package/dist/ops-apps/index.d.ts +2 -2
  20. package/dist/ops-apps/index.js +2 -2
  21. package/dist/ops-apps/list-apps.d.ts +5 -6
  22. package/dist/ops-apps/list-apps.d.ts.map +1 -1
  23. package/dist/ops-apps/list-apps.js +6 -7
  24. package/dist/ops-apps/set-app-theme.d.ts +12 -8
  25. package/dist/ops-apps/set-app-theme.d.ts.map +1 -1
  26. package/dist/ops-apps/set-app-theme.js +11 -7
  27. package/dist/ops-apps/set-default-app.d.ts +1 -2
  28. package/dist/ops-apps/set-default-app.d.ts.map +1 -1
  29. package/dist/ops-apps/set-default-app.js +1 -2
  30. package/dist/ops-apps/types.d.ts +20 -23
  31. package/dist/ops-apps/types.d.ts.map +1 -1
  32. package/dist/ops-apps/types.js +4 -6
  33. package/dist/ops-blueprint/cache-mirror.d.ts +41 -0
  34. package/dist/ops-blueprint/cache-mirror.d.ts.map +1 -0
  35. package/dist/ops-blueprint/cache-mirror.js +19 -0
  36. package/dist/ops-blueprint/delete.d.ts +18 -0
  37. package/dist/ops-blueprint/delete.d.ts.map +1 -1
  38. package/dist/ops-blueprint/delete.js +21 -2
  39. package/dist/ops-blueprint/errors.d.ts +23 -0
  40. package/dist/ops-blueprint/errors.d.ts.map +1 -1
  41. package/dist/ops-blueprint/errors.js +29 -0
  42. package/dist/ops-blueprint/generate.d.ts +1 -3
  43. package/dist/ops-blueprint/generate.d.ts.map +1 -1
  44. package/dist/ops-blueprint/generate.js +47 -58
  45. package/dist/ops-blueprint/index.d.ts +1 -1
  46. package/dist/ops-blueprint/index.d.ts.map +1 -1
  47. package/dist/ops-blueprint/index.js +1 -1
  48. package/dist/ops-blueprint/list.d.ts.map +1 -1
  49. package/dist/ops-blueprint/list.js +1 -2
  50. package/dist/ops-blueprint/register.d.ts +83 -6
  51. package/dist/ops-blueprint/register.d.ts.map +1 -1
  52. package/dist/ops-blueprint/register.js +261 -158
  53. package/dist/ops-blueprint/update.d.ts +3 -2
  54. package/dist/ops-blueprint/update.d.ts.map +1 -1
  55. package/dist/ops-blueprint/update.js +4 -3
  56. package/dist/renders/blueprint-coverage.d.ts +23 -4
  57. package/dist/renders/blueprint-coverage.d.ts.map +1 -1
  58. package/dist/renders/blueprint-coverage.js +45 -5
  59. package/dist/renders/blueprint-durability.d.ts.map +1 -1
  60. package/dist/renders/blueprint-durability.js +36 -21
  61. package/dist/renders/blueprint-matcher.d.ts +57 -7
  62. package/dist/renders/blueprint-matcher.d.ts.map +1 -1
  63. package/dist/renders/blueprint-matcher.js +154 -36
  64. package/dist/renders/blueprint-registry.d.ts +154 -1
  65. package/dist/renders/blueprint-registry.d.ts.map +1 -1
  66. package/dist/renders/blueprint-registry.js +337 -10
  67. package/dist/renders/build-seed-pool.d.ts.map +1 -1
  68. package/dist/renders/build-seed-pool.js +6 -0
  69. package/dist/renders/cache-trace-sink.d.ts +12 -0
  70. package/dist/renders/cache-trace-sink.d.ts.map +1 -1
  71. package/dist/renders/cache-trace-sink.js +15 -1
  72. package/dist/renders/consume.d.ts +3 -2
  73. package/dist/renders/consume.d.ts.map +1 -1
  74. package/dist/renders/consume.js +50 -15
  75. package/dist/renders/cross-app-refused.d.ts +17 -0
  76. package/dist/renders/cross-app-refused.d.ts.map +1 -0
  77. package/dist/renders/cross-app-refused.js +23 -0
  78. package/dist/renders/decide-handshake.d.ts +47 -1
  79. package/dist/renders/decide-handshake.d.ts.map +1 -1
  80. package/dist/renders/decide-handshake.js +74 -6
  81. package/dist/renders/declare-tool-catalog.d.ts.map +1 -1
  82. package/dist/renders/declare-tool-catalog.js +20 -17
  83. package/dist/renders/export-registry.d.ts +8 -1
  84. package/dist/renders/export-registry.d.ts.map +1 -1
  85. package/dist/renders/export-registry.js +3 -0
  86. package/dist/renders/fits.d.ts +60 -0
  87. package/dist/renders/fits.d.ts.map +1 -0
  88. package/dist/renders/fits.js +114 -0
  89. package/dist/renders/handshake-generation-inputs.d.ts +89 -0
  90. package/dist/renders/handshake-generation-inputs.d.ts.map +1 -0
  91. package/dist/renders/handshake-generation-inputs.js +65 -0
  92. package/dist/renders/handshake.d.ts +6 -42
  93. package/dist/renders/handshake.d.ts.map +1 -1
  94. package/dist/renders/handshake.js +1 -1
  95. package/dist/renders/index.d.ts +10 -5
  96. package/dist/renders/index.d.ts.map +1 -1
  97. package/dist/renders/index.js +10 -3
  98. package/dist/renders/installed-blueprints-provider.d.ts.map +1 -1
  99. package/dist/renders/installed-blueprints-provider.js +3 -1
  100. package/dist/renders/match-precision/pairs.d.ts +6 -5
  101. package/dist/renders/match-precision/pairs.d.ts.map +1 -1
  102. package/dist/renders/match-precision/run-probe.js +1 -2
  103. package/dist/renders/match-precision/topk-probe.js +13 -8
  104. package/dist/renders/record-committed-one-shot.d.ts +18 -3
  105. package/dist/renders/record-committed-one-shot.d.ts.map +1 -1
  106. package/dist/renders/record-committed-one-shot.js +14 -7
  107. package/dist/renders/refresh-ws-token.d.ts +66 -87
  108. package/dist/renders/refresh-ws-token.d.ts.map +1 -1
  109. package/dist/renders/refresh-ws-token.js +93 -89
  110. package/dist/renders/render-identity.d.ts +16 -5
  111. package/dist/renders/render-identity.d.ts.map +1 -1
  112. package/dist/renders/render-identity.js +26 -10
  113. package/dist/renders/render-read-gate.d.ts +85 -0
  114. package/dist/renders/render-read-gate.d.ts.map +1 -0
  115. package/dist/renders/render-read-gate.js +57 -0
  116. package/dist/renders/render.d.ts +77 -27
  117. package/dist/renders/render.d.ts.map +1 -1
  118. package/dist/renders/render.js +269 -95
  119. package/dist/renders/report-render-failure.d.ts +69 -0
  120. package/dist/renders/report-render-failure.d.ts.map +1 -0
  121. package/dist/renders/report-render-failure.js +83 -0
  122. package/dist/renders/runtime-pull.d.ts.map +1 -1
  123. package/dist/renders/runtime-pull.js +6 -0
  124. package/dist/renders/slice-meta-derivation.d.ts +8 -1
  125. package/dist/renders/slice-meta-derivation.d.ts.map +1 -1
  126. package/dist/renders/slice-meta-derivation.js +1 -0
  127. package/dist/renders/submit-action.d.ts +47 -78
  128. package/dist/renders/submit-action.d.ts.map +1 -1
  129. package/dist/renders/submit-action.js +312 -84
  130. package/dist/renders/sync-context.d.ts +3 -1
  131. package/dist/renders/sync-context.d.ts.map +1 -1
  132. package/dist/renders/sync-context.js +53 -20
  133. package/dist/types.d.ts +71 -1
  134. package/dist/types.d.ts.map +1 -1
  135. package/dist/types.js +32 -0
  136. package/package.json +8 -20
  137. package/dist/ops-connector-keys/in-memory-fake.test-util.d.ts +0 -26
  138. package/dist/ops-connector-keys/in-memory-fake.test-util.d.ts.map +0 -1
  139. package/dist/ops-connector-keys/in-memory-fake.test-util.js +0 -60
  140. package/dist/ops-connector-keys/index.d.ts +0 -19
  141. package/dist/ops-connector-keys/index.d.ts.map +0 -1
  142. package/dist/ops-connector-keys/index.js +0 -14
  143. package/dist/ops-connector-keys/issue-connector-key.d.ts +0 -76
  144. package/dist/ops-connector-keys/issue-connector-key.d.ts.map +0 -1
  145. package/dist/ops-connector-keys/issue-connector-key.js +0 -84
  146. package/dist/ops-connector-keys/list-connector-keys.d.ts +0 -58
  147. package/dist/ops-connector-keys/list-connector-keys.d.ts.map +0 -1
  148. package/dist/ops-connector-keys/list-connector-keys.js +0 -39
  149. package/dist/ops-connector-keys/revoke-connector-key.d.ts +0 -32
  150. package/dist/ops-connector-keys/revoke-connector-key.d.ts.map +0 -1
  151. package/dist/ops-connector-keys/revoke-connector-key.js +0 -49
  152. package/dist/ops-connector-keys/types.d.ts +0 -91
  153. package/dist/ops-connector-keys/types.d.ts.map +0 -1
  154. package/dist/ops-connector-keys/types.js +0 -24
  155. package/dist/ops-coupon/in-memory-fake.test-util.d.ts +0 -28
  156. package/dist/ops-coupon/in-memory-fake.test-util.d.ts.map +0 -1
  157. package/dist/ops-coupon/in-memory-fake.test-util.js +0 -66
  158. package/dist/ops-coupon/index.d.ts +0 -15
  159. package/dist/ops-coupon/index.d.ts.map +0 -1
  160. package/dist/ops-coupon/index.js +0 -12
  161. package/dist/ops-coupon/redeem-coupon.d.ts +0 -51
  162. package/dist/ops-coupon/redeem-coupon.d.ts.map +0 -1
  163. package/dist/ops-coupon/redeem-coupon.js +0 -61
  164. package/dist/ops-coupon/types.d.ts +0 -59
  165. package/dist/ops-coupon/types.d.ts.map +0 -1
  166. package/dist/ops-coupon/types.js +0 -38
  167. package/dist/ops-orgs/create-org.d.ts +0 -45
  168. package/dist/ops-orgs/create-org.d.ts.map +0 -1
  169. package/dist/ops-orgs/create-org.js +0 -55
  170. package/dist/ops-orgs/get-org-balance.d.ts +0 -29
  171. package/dist/ops-orgs/get-org-balance.d.ts.map +0 -1
  172. package/dist/ops-orgs/get-org-balance.js +0 -45
  173. package/dist/ops-orgs/in-memory-fake.test-util.d.ts +0 -84
  174. package/dist/ops-orgs/in-memory-fake.test-util.d.ts.map +0 -1
  175. package/dist/ops-orgs/in-memory-fake.test-util.js +0 -209
  176. package/dist/ops-orgs/index.d.ts +0 -33
  177. package/dist/ops-orgs/index.d.ts.map +0 -1
  178. package/dist/ops-orgs/index.js +0 -24
  179. package/dist/ops-orgs/invite-to-org.d.ts +0 -56
  180. package/dist/ops-orgs/invite-to-org.d.ts.map +0 -1
  181. package/dist/ops-orgs/invite-to-org.js +0 -72
  182. package/dist/ops-orgs/list-orgs.d.ts +0 -53
  183. package/dist/ops-orgs/list-orgs.d.ts.map +0 -1
  184. package/dist/ops-orgs/list-orgs.js +0 -38
  185. package/dist/ops-orgs/remove-org-member.d.ts +0 -42
  186. package/dist/ops-orgs/remove-org-member.d.ts.map +0 -1
  187. package/dist/ops-orgs/remove-org-member.js +0 -67
  188. package/dist/ops-orgs/rename-org.d.ts +0 -33
  189. package/dist/ops-orgs/rename-org.d.ts.map +0 -1
  190. package/dist/ops-orgs/rename-org.js +0 -57
  191. package/dist/ops-orgs/revoke-invite.d.ts +0 -38
  192. package/dist/ops-orgs/revoke-invite.d.ts.map +0 -1
  193. package/dist/ops-orgs/revoke-invite.js +0 -53
  194. package/dist/ops-orgs/types.d.ts +0 -209
  195. package/dist/ops-orgs/types.d.ts.map +0 -1
  196. package/dist/ops-orgs/types.js +0 -60
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @ggui-ai/mcp-server-handlers
2
2
 
3
- MCP tool handler logic for the **ggui protocol**.
3
+ MCP tool handler logic for the **GGUI protocol**.
4
4
 
5
- This package implements the actual behavior behind every ggui MCP tool — render
5
+ This package implements the actual behavior behind every GGUI MCP tool — render
6
6
  lifecycle, the contract handshake, UI emission, blueprint management, threads, app
7
7
  discovery, and the operator (`ggui_ops_*`) tools. The handlers are written purely
8
8
  over the seam interfaces in
@@ -58,11 +58,11 @@ import type { BlueprintProvider, EmbeddingProvider, VectorStore } from '@ggui-ai
58
58
  * `score`.
59
59
  *
60
60
  * The handshake matcher (`matchBlueprint`) gates its judge with its own
61
- * number (0.2), not this one, because the two are not on one scale: the
62
- * matcher's retrieval query embeds a request's intent without its
63
- * contract while stored vectors embed both, which depresses its cosines
64
- * (ggui#606, ggui#1275). One shared number returns when the matcher's
65
- * query is composed like the stored side.
61
+ * numbers, not this one, because its query comes in two kinds on two
62
+ * scales (ggui#606): a request that carries a contract composes its query
63
+ * like the stored vectors (contract summary + intent) and is gated at 0.50;
64
+ * a request without one embeds its intent alone, on a lower scale, and is
65
+ * gated at 0.2 (ggui#1275). Neither is this tool's intent-only search.
66
66
  */
67
67
  export declare const MIN_SIMILARITY_SCORE = 0.3;
68
68
  /**
@@ -59,11 +59,11 @@ import { defineHandler } from '../types.js';
59
59
  * `score`.
60
60
  *
61
61
  * The handshake matcher (`matchBlueprint`) gates its judge with its own
62
- * number (0.2), not this one, because the two are not on one scale: the
63
- * matcher's retrieval query embeds a request's intent without its
64
- * contract while stored vectors embed both, which depresses its cosines
65
- * (ggui#606, ggui#1275). One shared number returns when the matcher's
66
- * query is composed like the stored side.
62
+ * numbers, not this one, because its query comes in two kinds on two
63
+ * scales (ggui#606): a request that carries a contract composes its query
64
+ * like the stored vectors (contract summary + intent) and is gated at 0.50;
65
+ * a request without one embeds its intent alone, on a lower scale, and is
66
+ * gated at 0.2 (ggui#1275). Neither is this tool's intent-only search.
67
67
  */
68
68
  export const MIN_SIMILARITY_SCORE = 0.3;
69
69
  /**
@@ -25,6 +25,6 @@
25
25
  */
26
26
  export { createGetCreditBalanceHandler, } from './get-credit-balance.js';
27
27
  export type { CreditBalanceSource, CreditBalanceView, GetCreditBalanceDeps, GetCreditBalanceOutput, } from './get-credit-balance.js';
28
- export { createListCreditTransactionsHandler, } from './list-credit-transactions.js';
29
- export type { CreditTransactionSource, CreditTransactionView, ListCreditTransactionsDeps, ListCreditTransactionsOutput, } from './list-credit-transactions.js';
28
+ export { createListCreditTransactionsHandler, KNOWN_CREDIT_TRANSACTION_KINDS, } from './list-credit-transactions.js';
29
+ export type { CreditTransactionKind, CreditTransactionSource, CreditTransactionView, KnownCreditTransactionKind, ListCreditTransactionsDeps, ListCreditTransactionsOutput, } from './list-credit-transactions.js';
30
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/credits/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EACL,6BAA6B,GAC9B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,mCAAmC,GACpC,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/credits/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EACL,6BAA6B,GAC9B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,mCAAmC,EACnC,8BAA8B,GAC/B,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,+BAA+B,CAAC"}
@@ -24,4 +24,4 @@
24
24
  * side-channel — same posture as the blueprint family.
25
25
  */
26
26
  export { createGetCreditBalanceHandler, } from './get-credit-balance.js';
27
- export { createListCreditTransactionsHandler, } from './list-credit-transactions.js';
27
+ export { createListCreditTransactionsHandler, KNOWN_CREDIT_TRANSACTION_KINDS, } from './list-credit-transactions.js';
@@ -34,9 +34,28 @@ export interface CreditTransactionSource {
34
34
  nextCursor?: string;
35
35
  }>;
36
36
  }
37
+ /**
38
+ * The ledger kinds this package names (ggui#1532). The vocabulary is OPEN: a
39
+ * deployment's ledger may carry kinds not listed here, and a reader MUST accept
40
+ * one it does not know, keep it as named, and never read it as a render charge.
41
+ * Listing a kind here documents it; it is not the set of kinds that may appear.
42
+ */
43
+ export declare const KNOWN_CREDIT_TRANSACTION_KINDS: readonly ["free_credit", "render_charge", "topup", "refund"];
44
+ /** One of the kinds this package names. */
45
+ export type KnownCreditTransactionKind = (typeof KNOWN_CREDIT_TRANSACTION_KINDS)[number];
46
+ /**
47
+ * A ledger entry's kind: a known kind, or any other non-empty kind a
48
+ * deployment names. The `string & {}` arm keeps the set OPEN while editors
49
+ * still offer the known kinds and a `switch` can name them (it needs a default).
50
+ */
51
+ export type CreditTransactionKind = KnownCreditTransactionKind | (string & {});
37
52
  export interface CreditTransactionView {
38
53
  readonly transactionId: string;
39
- readonly kind: 'free_credit' | 'render_charge' | 'topup' | 'refund';
54
+ /**
55
+ * The entry's kind: one of {@link KNOWN_CREDIT_TRANSACTION_KINDS}, or a kind
56
+ * the deployment names that this package does not. Open vocabulary.
57
+ */
58
+ readonly kind: CreditTransactionKind;
40
59
  readonly deltaCents: number;
41
60
  readonly balanceAfterCents: number;
42
61
  readonly reason: string;
@@ -58,12 +77,7 @@ export declare function createListCreditTransactionsHandler(deps: ListCreditTran
58
77
  }, {
59
78
  transactions: z.ZodArray<z.ZodObject<{
60
79
  transactionId: z.ZodString;
61
- kind: z.ZodEnum<{
62
- free_credit: "free_credit";
63
- render_charge: "render_charge";
64
- topup: "topup";
65
- refund: "refund";
66
- }>;
80
+ kind: z.ZodString;
67
81
  deltaCents: z.ZodNumber;
68
82
  balanceAfterCents: z.ZodNumber;
69
83
  reason: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"list-credit-transactions.d.ts","sourceRoot":"","sources":["../../src/credits/list-credit-transactions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;GAIG;AACH,MAAM,W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;;;;;IAqBlE,oFAAoF;;;;;GAgDrF"}
@@ -17,6 +17,13 @@
17
17
  */
18
18
  import { z } from 'zod';
19
19
  import { defineHandler } from '../types.js';
20
+ /**
21
+ * The ledger kinds this package names (ggui#1532). The vocabulary is OPEN: a
22
+ * deployment's ledger may carry kinds not listed here, and a reader MUST accept
23
+ * one it does not know, keep it as named, and never read it as a render charge.
24
+ * Listing a kind here documents it; it is not the set of kinds that may appear.
25
+ */
26
+ export const KNOWN_CREDIT_TRANSACTION_KINDS = ['free_credit', 'render_charge', 'topup', 'refund'];
20
27
  const inputSchema = {
21
28
  /** Default 20. Cap 100. */
22
29
  limit: z.number().int().min(1).max(100).optional(),
@@ -26,7 +33,10 @@ const inputSchema = {
26
33
  const outputSchema = {
27
34
  transactions: z.array(z.object({
28
35
  transactionId: z.string(),
29
- kind: z.enum(['free_credit', 'render_charge', 'topup', 'refund']),
36
+ kind: z
37
+ .string()
38
+ .min(1)
39
+ .describe("The ledger entry's kind, an open vocabulary. Known kinds: 'free_credit', 'render_charge', 'topup', 'refund'. A deployment may add others: accept a kind you do not know, keep it as named, and never read it as a render charge."),
30
40
  deltaCents: z.number().int(),
31
41
  balanceAfterCents: z.number().int(),
32
42
  reason: z.string(),
@@ -41,7 +51,7 @@ export function createListCreditTransactionsHandler(deps) {
41
51
  name: 'ggui_ops_list_credit_transactions',
42
52
  title: 'List credit transactions',
43
53
  audience: ['ops'],
44
- description: "Returns the calling user's credit transaction ledger, newest-first. Each row carries kind ('free_credit' | 'render_charge' | 'topup' | 'refund'), deltaCents (signed — positive for grants/topups, negative for charges), balanceAfterCents (snapshot at time of write), reason (human-readable), and optional relatedSessionId for render_charge rows. Default limit 20, cap 100; pass `cursor` from the previous response's `nextCursor` for paging.",
54
+ description: "Returns the calling user's credit transaction ledger, newest-first. Each row carries kind (an open vocabulary: known kinds are 'free_credit', 'render_charge', 'topup' and 'refund', and a deployment may add others; treat an unknown kind as a ledger entry of that name, never as a render charge), deltaCents (signed — positive for grants/topups, negative for charges), balanceAfterCents (snapshot at time of write), reason (human-readable), and optional relatedSessionId for render_charge rows. Default limit 20, cap 100; pass `cursor` from the previous response's `nextCursor` for paging.",
45
55
  inputSchema,
46
56
  outputSchema,
47
57
  // No `allowedFor` — same toolset on every deployment kind. Callers
package/dist/index.d.ts CHANGED
@@ -15,14 +15,11 @@
15
15
  */
16
16
  export * from "./blueprints/index.js";
17
17
  export * from "./renders/index.js";
18
- export { AuthRequiredError, HANDLER_FAILURE_MARKER, defineHandler, handlerFailure, isHandlerFailure, } from "./types.js";
19
- export type { AudienceTag, EnvelopedHandlerDefinition, EnvelopeFor, HandlerContext, HandlerDefinition, HandlerFailure, ShapeOutput, SharedHandler, SharedHandlerOutputBound, SharedHandlerOutputData, SharedHandlerResult, } from "./types.js";
18
+ export { AuthRequiredError, HANDLER_FAILURE_MARKER, createSessionRowReads, defineHandler, handlerFailure, isHandlerFailure, readSessionRow, viewProofUseFor, } from "./types.js";
19
+ export type { AudienceTag, EnvelopedHandlerDefinition, EnvelopeFor, HandlerContext, HandlerDefinition, HandlerFailure, SessionRowReads, ShapeOutput, SharedHandler, SharedHandlerOutputBound, SharedHandlerOutputData, SharedHandlerResult, ViewProofDeclaration, ViewProofUse, } from "./types.js";
20
20
  export * from "./threads/index.js";
21
21
  export * from "./credits/index.js";
22
22
  export * from "./app-discovery/index.js";
23
23
  export * from "./ops-blueprint/index.js";
24
24
  export * from "./ops-apps/index.js";
25
- export * from "./ops-connector-keys/index.js";
26
- export * from "./ops-coupon/index.js";
27
- export * from "./ops-orgs/index.js";
28
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,WAAW,EACX,0BAA0B,EAC1B,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAIpB,cAAc,oBAAoB,CAAC;AAInC,cAAc,oBAAoB,CAAC;AAInC,cAAc,0BAA0B,CAAC;AAIzC,cAAc,0BAA0B,CAAC;AAMzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,WAAW,EACX,0BAA0B,EAC1B,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,GACb,MAAM,YAAY,CAAC;AAIpB,cAAc,oBAAoB,CAAC;AAInC,cAAc,oBAAoB,CAAC;AAInC,cAAc,0BAA0B,CAAC;AAIzC,cAAc,0BAA0B,CAAC;AAKzC,cAAc,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@
15
15
  */
16
16
  export * from "./blueprints/index.js";
17
17
  export * from "./renders/index.js";
18
- export { AuthRequiredError, HANDLER_FAILURE_MARKER, defineHandler, handlerFailure, isHandlerFailure, } from "./types.js";
18
+ export { AuthRequiredError, HANDLER_FAILURE_MARKER, createSessionRowReads, defineHandler, handlerFailure, isHandlerFailure, readSessionRow, viewProofUseFor, } from "./types.js";
19
19
  // Persistent-chat handler family — thread storage and message
20
20
  // history MCP tools. Thin over @ggui-ai/mcp-server-core ThreadStore.
21
21
  // Available under `@ggui-ai/mcp-server-handlers/threads` subpath too.
@@ -32,12 +32,8 @@ export * from "./app-discovery/index.js";
32
32
  // served on the `/control` plane. Available under
33
33
  // `@ggui-ai/mcp-server-handlers/ops-blueprint` subpath too.
34
34
  export * from "./ops-blueprint/index.js";
35
- // Operator-class apps, orgs, connector-keys, and coupon handler
36
- // families — `ggui_ops_*` tools backing the console's management
37
- // surfaces, each pure over a deps seam. Subpaths:
38
- // `@ggui-ai/mcp-server-handlers/ops-apps`, `…/ops-orgs`,
39
- // `…/ops-connector-keys`, `…/ops-coupon`.
35
+ // Operator-class apps handler family — `ggui_ops_*` tools that
36
+ // manage a deployment's apps, pure over the `AppsSource` seam the
37
+ // deployment binds. Available under
38
+ // `@ggui-ai/mcp-server-handlers/ops-apps` subpath too.
40
39
  export * from "./ops-apps/index.js";
41
- export * from "./ops-connector-keys/index.js";
42
- export * from "./ops-coupon/index.js";
43
- export * from "./ops-orgs/index.js";
@@ -1,16 +1,15 @@
1
1
  /**
2
- * `ggui_ops_create_app` — provision a fresh `GguiApp` owned by the
3
- * calling user. Sibling of the `provisionGguiApp` AppSync mutation
4
- * (`backend/amplify/data/create-app/handler.ts`); same identity gate
5
- * (caller's sub, NEVER an argument-supplied userId), same default
6
- * displayName, same server-side appId allocation — exposed through
7
- * the `ops` MCP surface so an LLM agent in the console can create an
8
- * app without a custom GraphQL call.
2
+ * `ggui_ops_create_app` — create a new app owned by the calling user.
9
3
  *
10
- * Pure over the {@link AppsSource} seam. AppId minting + collision
11
- * retry is the adapter's responsibility — the in-memory test fake
12
- * picks any unique string; the cloud adapter calls the existing
13
- * `provisionGguiApp` Lambda which already enforces base62 + retry.
4
+ * The owner is always the caller's own identity (`resolveOwnerSub`),
5
+ * never a userId passed as an argument, so an operator agent can only
6
+ * create apps for the account it acts for. The appId is minted by the
7
+ * deployment's {@link AppsSource}: the handler never takes one from the
8
+ * caller, and uniqueness (including any retry on a collision) is the
9
+ * store's job. An in-memory store can use any unique string; a store
10
+ * over a database mints ids in whatever format that database keys on.
11
+ *
12
+ * Pure over the {@link AppsSource} seam.
14
13
  */
15
14
  import { z } from 'zod';
16
15
  import { type ShapeOutput } from '../types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../../src/ops-apps/create-app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAiB,KAAK,WAAW,EAAuB,MAAM,aAAa,CAAC;AAEnF,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,YAAY,CAAC;AAaxD,QAAA,MAAM,YAAY;;;;;;;CAYR,CAAC;AAEX,oFAAoF;AACpF,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,OAAO,YAAY,CAAC,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,aAAa;;;;;;;;;;;;;;;;GAiCpB"}
1
+ {"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../../src/ops-apps/create-app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAiB,KAAK,WAAW,EAAuB,MAAM,aAAa,CAAC;AAEnF,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,YAAY,CAAC;AAaxD,QAAA,MAAM,YAAY;;;;;;;CAYR,CAAC;AAEX,oFAAoF;AACpF,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,OAAO,YAAY,CAAC,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,aAAa;;;;;;;;;;;;;;;;GAiCpB"}
@@ -1,16 +1,15 @@
1
1
  /**
2
- * `ggui_ops_create_app` — provision a fresh `GguiApp` owned by the
3
- * calling user. Sibling of the `provisionGguiApp` AppSync mutation
4
- * (`backend/amplify/data/create-app/handler.ts`); same identity gate
5
- * (caller's sub, NEVER an argument-supplied userId), same default
6
- * displayName, same server-side appId allocation — exposed through
7
- * the `ops` MCP surface so an LLM agent in the console can create an
8
- * app without a custom GraphQL call.
2
+ * `ggui_ops_create_app` — create a new app owned by the calling user.
9
3
  *
10
- * Pure over the {@link AppsSource} seam. AppId minting + collision
11
- * retry is the adapter's responsibility — the in-memory test fake
12
- * picks any unique string; the cloud adapter calls the existing
13
- * `provisionGguiApp` Lambda which already enforces base62 + retry.
4
+ * The owner is always the caller's own identity (`resolveOwnerSub`),
5
+ * never a userId passed as an argument, so an operator agent can only
6
+ * create apps for the account it acts for. The appId is minted by the
7
+ * deployment's {@link AppsSource}: the handler never takes one from the
8
+ * caller, and uniqueness (including any retry on a collision) is the
9
+ * store's job. An in-memory store can use any unique string; a store
10
+ * over a database mints ids in whatever format that database keys on.
11
+ *
12
+ * Pure over the {@link AppsSource} seam.
14
13
  */
15
14
  import { z } from 'zod';
16
15
  import { defineHandler } from '../types.js';
@@ -21,7 +20,7 @@ const inputSchema = {
21
20
  .min(1)
22
21
  .max(120)
23
22
  .optional()
24
- .describe("Human-friendly label for the new app. Defaults to 'My ggui app' when absent — the same label the deployment's first-load auto-create uses."),
23
+ .describe("Human-friendly label for the new app. Defaults to 'My ggui app' when absent."),
25
24
  };
26
25
  const outputSchema = {
27
26
  appId: z.string(),
@@ -39,7 +38,7 @@ export function createCreateAppHandler(deps) {
39
38
  name: 'ggui_ops_create_app',
40
39
  title: 'Create app',
41
40
  audience: ['ops'],
42
- description: "Provision a fresh `GguiApp` owned by the calling user: an opaque base62 appId is minted server-side, the row is owned by the caller's identity, displayName defaults to 'My ggui app' when absent (cap 120 chars). Returns the persisted shape — call `ggui_ops_set_default_app({appId})` afterwards to promote the new app to the user's default.",
41
+ description: "Create a new app owned by the calling user. The server mints the appId (it is never an argument), displayName defaults to 'My ggui app' when absent (max 120 chars). Returns the stored app — call `ggui_ops_set_default_app({appId})` afterwards to make it the caller's default.",
43
42
  inputSchema,
44
43
  outputSchema,
45
44
  async handler(rawInput, ctx) {
@@ -1,15 +1,16 @@
1
1
  /**
2
- * Per-call identity resolution for `ops-apps` handlers. The console
3
- * surfaces these tools call against `kind: 'user'` identities — the
4
- * upstream `AuthAdapter` populates `ctx.userId` directly. OSS
5
- * single-app mode (where the auth adapter collapses `appId =
6
- * workspaceId ?? userId`) leaves `ctx.userId` undefined and the same
7
- * value sits on `ctx.appId`. Read whichever is set; fail when neither
8
- * is.
2
+ * Per-call identity resolution for `ops-apps` handlers. A deployment
3
+ * with per-user accounts calls these tools as `kind: 'user'`
4
+ * identities — the upstream `AuthAdapter` populates `ctx.userId`
5
+ * directly. Single-app mode (where the auth adapter collapses
6
+ * `appId = workspaceId ?? userId`) leaves `ctx.userId` undefined and
7
+ * the same value sits on `ctx.appId`. Read whichever is set; fail when
8
+ * neither is.
9
9
  */
10
10
  import type { HandlerContext } from '../types.js';
11
11
  /**
12
- * Resolve the caller's Cognito sub (or OSS-mode equivalent). Throws
12
+ * Resolve the caller's owner id (`ctx.userId`, or `ctx.appId` in
13
+ * single-app mode). Throws
13
14
  * when neither field is set — that means an unauthenticated caller
14
15
  * slipped past the upstream auth adapter, which is a real bug worth
15
16
  * surfacing as a 5xx rather than masking as "empty list".
@@ -1 +1 @@
1
- {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/ops-apps/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,cAAc,GAClB,MAAM,CAQR"}
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/ops-apps/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,cAAc,GAClB,MAAM,CAQR"}
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Resolve the caller's Cognito sub (or OSS-mode equivalent). Throws
2
+ * Resolve the caller's owner id (`ctx.userId`, or `ctx.appId` in
3
+ * single-app mode). Throws
3
4
  * when neither field is set — that means an unauthenticated caller
4
5
  * slipped past the upstream auth adapter, which is a real bug worth
5
6
  * surfacing as a 5xx rather than masking as "empty list".
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * Six MCP tools, all `audience: ['ops']`, all served on `/control`. Pure
5
5
  * over the {@link AppsSource} + {@link UserDefaultAppSource} seams —
6
- * NO AWS imports. Cloud deployments bind AWS-backed adapters; tests
7
- * use in-memory fakes.
6
+ * no storage imports. A deployment binds adapters over its own store;
7
+ * tests use in-memory fakes.
8
8
  *
9
9
  * - `createListAppsHandler` → `ggui_ops_list_apps`
10
10
  * - `createCreateAppHandler` → `ggui_ops_create_app`
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * Six MCP tools, all `audience: ['ops']`, all served on `/control`. Pure
5
5
  * over the {@link AppsSource} + {@link UserDefaultAppSource} seams —
6
- * NO AWS imports. Cloud deployments bind AWS-backed adapters; tests
7
- * use in-memory fakes.
6
+ * no storage imports. A deployment binds adapters over its own store;
7
+ * tests use in-memory fakes.
8
8
  *
9
9
  * - `createListAppsHandler` → `ggui_ops_list_apps`
10
10
  * - `createCreateAppHandler` → `ggui_ops_create_app`
@@ -1,13 +1,12 @@
1
1
  /**
2
2
  * `ggui_ops_list_apps` — enumerate the calling user's `GguiApp` rows.
3
3
  *
4
- * Sibling of the console's Apps section (`apps/console/src/.../apps/`)
5
- * — same data, MCP surface. Pure over the {@link AppsSource} seam; a
6
- * production deployment binds its own implementation, tests bind an
7
- * in-memory Map.
4
+ * The MCP door onto the same data an app-management UI lists. Pure over
5
+ * the {@link AppsSource} seam; a production deployment binds its own
6
+ * implementation, tests bind an in-memory Map.
8
7
  *
9
- * Identity scope: caller's Cognito sub from `ctx.userId` (or
10
- * `ctx.appId` in OSS single-app mode). Cross-user list is impossible
8
+ * Identity scope: the caller's owner id from `ctx.userId` (or
9
+ * `ctx.appId` in single-app mode). Cross-user list is impossible
11
10
  * by construction — `AppsSource.list` only returns rows whose
12
11
  * `ownerSub` matches.
13
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"list-apps.d.ts","sourceRoot":"","sources":["../../src/ops-apps/list-apps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAsC,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAEnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAI7C,QAAA,MAAM,YAAY;;;;;;;;CAUR,CAAC;AAEX,oFAAoF;AACpF,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,YAAY,CAAC,CAAC;AAE9D,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,YAAY;;;;;;;;;;;;;;;;GA4BvD"}
1
+ {"version":3,"file":"list-apps.d.ts","sourceRoot":"","sources":["../../src/ops-apps/list-apps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAsC,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAEnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAI7C,QAAA,MAAM,YAAY;;;;;;;;CAUR,CAAC;AAEX,oFAAoF;AACpF,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,YAAY,CAAC,CAAC;AAE9D,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,YAAY;;;;;;;;;;;;;;;;GA4BvD"}
@@ -1,13 +1,12 @@
1
1
  /**
2
2
  * `ggui_ops_list_apps` — enumerate the calling user's `GguiApp` rows.
3
3
  *
4
- * Sibling of the console's Apps section (`apps/console/src/.../apps/`)
5
- * — same data, MCP surface. Pure over the {@link AppsSource} seam; a
6
- * production deployment binds its own implementation, tests bind an
7
- * in-memory Map.
4
+ * The MCP door onto the same data an app-management UI lists. Pure over
5
+ * the {@link AppsSource} seam; a production deployment binds its own
6
+ * implementation, tests bind an in-memory Map.
8
7
  *
9
- * Identity scope: caller's Cognito sub from `ctx.userId` (or
10
- * `ctx.appId` in OSS single-app mode). Cross-user list is impossible
8
+ * Identity scope: the caller's owner id from `ctx.userId` (or
9
+ * `ctx.appId` in single-app mode). Cross-user list is impossible
11
10
  * by construction — `AppsSource.list` only returns rows whose
12
11
  * `ownerSub` matches.
13
12
  */
@@ -29,7 +28,7 @@ export function createListAppsHandler(deps) {
29
28
  name: 'ggui_ops_list_apps',
30
29
  title: 'List apps',
31
30
  audience: ['ops'],
32
- description: "Enumerate every `GguiApp` row owned by the calling user. Returns metadata only (appId, displayName, optional systemPrompt, createdAt, updatedAt). Same data the console's Apps section renders. Use to discover ids before calling `ggui_ops_update_app` / `ggui_ops_set_default_app` / `ggui_ops_delete_app`.",
31
+ description: "Enumerate every `GguiApp` row owned by the calling user. Returns metadata only (appId, displayName, optional systemPrompt, createdAt, updatedAt). Use to discover ids before calling `ggui_ops_update_app` / `ggui_ops_set_default_app` / `ggui_ops_delete_app`.",
33
32
  inputSchema,
34
33
  outputSchema,
35
34
  async handler(_input, ctx) {
@@ -15,15 +15,19 @@
15
15
  * 2. attestation — `overlayHash` is recomputed with
16
16
  * `canonicalOverlayHash` and a mismatch is refused;
17
17
  * 3. coverage — the injected overlay validator judges each mode's
18
- * set against the consumed-token manifest: a key outside the
19
- * manifest (`unknown`) or a consumed token left unset
20
- * (`uncovered`) is refused, per mode.
18
+ * set against the consumed-token manifest: a consumed token left
19
+ * unset (`uncovered`) is refused, per mode. A key outside the
20
+ * manifest (`unknown`) is ADMITTED, never refused (ggui#1286): the
21
+ * theme is stored verbatim and the write logs the names
22
+ * (`app_theme_unknown_overlay_names`).
21
23
  *
22
24
  * A refusal is a schema-conformant `{ ok: false, code:
23
25
  * 'invalid_app_config', refusal }` RESULT (not a thrown error): the
24
- * body is one of the four the protocol names
25
- * (`appThemeRefusalBodySchema`), so a client reads the same refusal
26
- * from REST, AppSync and this door.
26
+ * body is one the protocol names (`appThemeRefusalBodySchema`, five
27
+ * bodies; this door raises three of them: `refused: 'v1 shape'`,
28
+ * `overlayHash: 'mismatch'` and `uncovered`), so a client reads the
29
+ * same refusal from every write door a deployment offers, this one
30
+ * included. A body the schema itself rejects carries `issues` instead.
27
31
  *
28
32
  * Ownership: `AppsSource.get` first (scoped by `ownerSub`); cross-user
29
33
  * probes return the uniform "not found" shape. The store scopes the
@@ -102,7 +106,7 @@ declare const outputSchema: {
102
106
  readonly updatedAt: z.ZodOptional<z.ZodString>;
103
107
  /** Present on a refusal: the one refusal class this door emits. */
104
108
  readonly code: z.ZodOptional<z.ZodLiteral<"invalid_app_config">>;
105
- /** Present on a coverage / attestation / v1-shape refusal — one of the four protocol-named bodies. */
109
+ /** Present on a coverage / attestation / v1-shape refusal — a protocol-named body (`appThemeRefusalBodySchema`). */
106
110
  readonly refusal: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
107
111
  uncovered: z.ZodObject<{
108
112
  light: z.ZodArray<z.ZodString>;
@@ -265,7 +269,7 @@ export declare function createSetAppThemeHandler(deps: SetAppThemeDeps): import(
265
269
  readonly updatedAt: z.ZodOptional<z.ZodString>;
266
270
  /** Present on a refusal: the one refusal class this door emits. */
267
271
  readonly code: z.ZodOptional<z.ZodLiteral<"invalid_app_config">>;
268
- /** Present on a coverage / attestation / v1-shape refusal — one of the four protocol-named bodies. */
272
+ /** Present on a coverage / attestation / v1-shape refusal — a protocol-named body (`appThemeRefusalBodySchema`). */
269
273
  readonly refusal: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
270
274
  uncovered: z.ZodObject<{
271
275
  light: z.ZodArray<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"set-app-theme.d.ts","sourceRoot":"","sources":["../../src/ops-apps/set-app-theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,mBAAmB,EAEzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK;IACpF,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC,CAAC;AAcF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKhB,m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;AAC1E,MAAM,MAAM,iBAAiB,GACzB;IACE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,8GAA8G;IAC9G,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC;CAC3F,GACD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAA;CAAE,GAC7D;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAY/D;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,wBAAwB,GACxC,OAAO,CAAC,iBAAiB,CAAC,CAmB5B;AAqBD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAzF5D,mEAAmE;;IAEnE,oHAAoH;;;;;;;;;;;;;;;;;;IAEpH,yFAAyF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmI1F"}
@@ -15,15 +15,19 @@
15
15
  * 2. attestation — `overlayHash` is recomputed with
16
16
  * `canonicalOverlayHash` and a mismatch is refused;
17
17
  * 3. coverage — the injected overlay validator judges each mode's
18
- * set against the consumed-token manifest: a key outside the
19
- * manifest (`unknown`) or a consumed token left unset
20
- * (`uncovered`) is refused, per mode.
18
+ * set against the consumed-token manifest: a consumed token left
19
+ * unset (`uncovered`) is refused, per mode. A key outside the
20
+ * manifest (`unknown`) is ADMITTED, never refused (ggui#1286): the
21
+ * theme is stored verbatim and the write logs the names
22
+ * (`app_theme_unknown_overlay_names`).
21
23
  *
22
24
  * A refusal is a schema-conformant `{ ok: false, code:
23
25
  * 'invalid_app_config', refusal }` RESULT (not a thrown error): the
24
- * body is one of the four the protocol names
25
- * (`appThemeRefusalBodySchema`), so a client reads the same refusal
26
- * from REST, AppSync and this door.
26
+ * body is one the protocol names (`appThemeRefusalBodySchema`, five
27
+ * bodies; this door raises three of them: `refused: 'v1 shape'`,
28
+ * `overlayHash: 'mismatch'` and `uncovered`), so a client reads the
29
+ * same refusal from every write door a deployment offers, this one
30
+ * included. A body the schema itself rejects carries `issues` instead.
27
31
  *
28
32
  * Ownership: `AppsSource.get` first (scoped by `ownerSub`); cross-user
29
33
  * probes return the uniform "not found" shape. The store scopes the
@@ -50,7 +54,7 @@ const outputSchema = {
50
54
  updatedAt: z.string().optional(),
51
55
  /** Present on a refusal: the one refusal class this door emits. */
52
56
  code: z.literal('invalid_app_config').optional(),
53
- /** Present on a coverage / attestation / v1-shape refusal — one of the four protocol-named bodies. */
57
+ /** Present on a coverage / attestation / v1-shape refusal — a protocol-named body (`appThemeRefusalBodySchema`). */
54
58
  refusal: appThemeRefusalBodySchema.optional(),
55
59
  /** Present on a shape refusal the schema itself raised — its messages, one per issue. */
56
60
  issues: z.array(z.string()).optional(),
@@ -2,8 +2,7 @@
2
2
  * `ggui_ops_set_default_app` — write the calling user's
3
3
  * `GguiUser.defaultAppId` column.
4
4
  *
5
- * Sibling of the `useGguiUser` first-load hook (`apps/console/.../use-ggui-user`).
6
- * Same column, MCP surface. The handler chains `AppsSource.get` first
5
+ * The MCP door onto the user's default-app setting. The handler chains `AppsSource.get` first
7
6
  * (verify the user owns the target appId) before writing
8
7
  * `UserDefaultAppSource.setDefault` — invariant: `defaultAppId` MUST
9
8
  * point at an app the user owns.
@@ -1 +1 @@
1
- {"version":3,"file":"set-default-app.d.ts","sourceRoot":"","sources":["../../src/ops-apps/set-default-app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAenE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC;CAC/C;AAED,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,iBAAiB;;;;wBA8BxB"}
1
+ {"version":3,"file":"set-default-app.d.ts","sourceRoot":"","sources":["../../src/ops-apps/set-default-app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAenE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC;CAC/C;AAED,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,iBAAiB;;;;wBA8BxB"}
@@ -2,8 +2,7 @@
2
2
  * `ggui_ops_set_default_app` — write the calling user's
3
3
  * `GguiUser.defaultAppId` column.
4
4
  *
5
- * Sibling of the `useGguiUser` first-load hook (`apps/console/.../use-ggui-user`).
6
- * Same column, MCP surface. The handler chains `AppsSource.get` first
5
+ * The MCP door onto the user's default-app setting. The handler chains `AppsSource.get` first
7
6
  * (verify the user owns the target appId) before writing
8
7
  * `UserDefaultAppSource.setDefault` — invariant: `defaultAppId` MUST
9
8
  * point at an app the user owns.