@noodleseed/one 0.120.0 → 0.121.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 (416) hide show
  1. package/dist/commands/auth-ops.d.ts.map +1 -1
  2. package/dist/commands/auth-ops.js +1 -0
  3. package/dist/commands/auth-ops.js.map +1 -1
  4. package/dist/commands/catalog-data-bootstrap-authoring.d.ts.map +1 -1
  5. package/dist/commands/catalog-data-bootstrap-authoring.js +98 -189
  6. package/dist/commands/catalog-data-bootstrap-authoring.js.map +1 -1
  7. package/dist/commands/mcp-apps.d.ts.map +1 -1
  8. package/dist/commands/mcp-apps.js +1 -0
  9. package/dist/commands/mcp-apps.js.map +1 -1
  10. package/dist/commands/project-setup.d.ts.map +1 -1
  11. package/dist/commands/project-setup.js +25 -5
  12. package/dist/commands/project-setup.js.map +1 -1
  13. package/dist/delegated-token-exchange-preflight.d.ts.map +1 -1
  14. package/dist/delegated-token-exchange-preflight.js +1 -0
  15. package/dist/delegated-token-exchange-preflight.js.map +1 -1
  16. package/dist/deploy.d.ts.map +1 -1
  17. package/dist/deploy.js +8 -131
  18. package/dist/deploy.js.map +1 -1
  19. package/dist/index.d.ts +1 -3
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/local-compile.d.ts.map +1 -1
  24. package/dist/local-compile.js +1 -0
  25. package/dist/local-compile.js.map +1 -1
  26. package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.d.ts.map +1 -1
  27. package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.js +2 -0
  28. package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.js.map +1 -1
  29. package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.d.ts.map +1 -1
  30. package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +7 -5
  31. package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js.map +1 -1
  32. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.d.ts.map +1 -1
  33. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +5 -0
  34. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js.map +1 -1
  35. package/node_modules/@noodle-borg/agent-kit/dist/plugin-submission.js +1 -1
  36. package/node_modules/@noodle-borg/agent-kit/dist/plugin-submission.js.map +1 -1
  37. package/node_modules/@noodle-borg/agent-kit/dist/product-skill-ownership.d.ts.map +1 -1
  38. package/node_modules/@noodle-borg/agent-kit/dist/product-skill-ownership.js +5 -3
  39. package/node_modules/@noodle-borg/agent-kit/dist/product-skill-ownership.js.map +1 -1
  40. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.d.ts.map +1 -1
  41. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js +20 -0
  42. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js.map +1 -1
  43. package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.d.ts.map +1 -1
  44. package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.js +5 -1
  45. package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.js.map +1 -1
  46. package/node_modules/@noodle-borg/agent-packaging/dist/host-package-assets.d.ts +2 -1
  47. package/node_modules/@noodle-borg/agent-packaging/dist/host-package-assets.d.ts.map +1 -1
  48. package/node_modules/@noodle-borg/agent-packaging/dist/host-package-assets.js +11 -1
  49. package/node_modules/@noodle-borg/agent-packaging/dist/host-package-assets.js.map +1 -1
  50. package/node_modules/@noodle-borg/agent-packaging/dist/host-packaging-types.d.ts +16 -3
  51. package/node_modules/@noodle-borg/agent-packaging/dist/host-packaging-types.d.ts.map +1 -1
  52. package/node_modules/@noodle-borg/agent-packaging/dist/host-packaging-validation.d.ts.map +1 -1
  53. package/node_modules/@noodle-borg/agent-packaging/dist/host-packaging-validation.js +13 -4
  54. package/node_modules/@noodle-borg/agent-packaging/dist/host-packaging-validation.js.map +1 -1
  55. package/node_modules/@noodle-borg/agent-packaging/dist/index.d.ts +1 -0
  56. package/node_modules/@noodle-borg/agent-packaging/dist/index.d.ts.map +1 -1
  57. package/node_modules/@noodle-borg/agent-packaging/dist/index.js +1 -0
  58. package/node_modules/@noodle-borg/agent-packaging/dist/index.js.map +1 -1
  59. package/node_modules/@noodle-borg/agent-packaging/dist/product-skill-validation.d.ts.map +1 -1
  60. package/node_modules/@noodle-borg/agent-packaging/dist/product-skill-validation.js +4 -3
  61. package/node_modules/@noodle-borg/agent-packaging/dist/product-skill-validation.js.map +1 -1
  62. package/node_modules/@noodle-borg/assistant-gateway/package.json +1 -1
  63. package/node_modules/@noodle-borg/authoring/dist/assistant.d.ts +4 -3
  64. package/node_modules/@noodle-borg/authoring/dist/assistant.d.ts.map +1 -1
  65. package/node_modules/@noodle-borg/authoring/dist/assistant.js.map +1 -1
  66. package/node_modules/@noodle-borg/authoring/dist/distribution.d.ts +17 -3
  67. package/node_modules/@noodle-borg/authoring/dist/distribution.d.ts.map +1 -1
  68. package/node_modules/@noodle-borg/authoring/dist/distribution.js.map +1 -1
  69. package/node_modules/@noodle-borg/authoring/dist/index.d.ts +2 -1
  70. package/node_modules/@noodle-borg/authoring/dist/index.d.ts.map +1 -1
  71. package/node_modules/@noodle-borg/authoring/dist/index.js +1 -0
  72. package/node_modules/@noodle-borg/authoring/dist/index.js.map +1 -1
  73. package/node_modules/@noodle-borg/authoring/dist/knowledge.d.ts +70 -0
  74. package/node_modules/@noodle-borg/authoring/dist/knowledge.d.ts.map +1 -0
  75. package/node_modules/@noodle-borg/authoring/dist/knowledge.js +50 -0
  76. package/node_modules/@noodle-borg/authoring/dist/knowledge.js.map +1 -0
  77. package/node_modules/@noodle-borg/authoring/dist/load-authored.d.ts +24 -0
  78. package/node_modules/@noodle-borg/authoring/dist/load-authored.d.ts.map +1 -0
  79. package/node_modules/@noodle-borg/authoring/dist/load-authored.js +141 -0
  80. package/node_modules/@noodle-borg/authoring/dist/load-authored.js.map +1 -0
  81. package/node_modules/@noodle-borg/authoring/dist/react/components.d.ts +3 -3
  82. package/node_modules/@noodle-borg/authoring/dist/react/native-components.d.ts +2 -2
  83. package/node_modules/@noodle-borg/authoring/dist/server.d.ts +3 -0
  84. package/node_modules/@noodle-borg/authoring/dist/server.d.ts.map +1 -1
  85. package/node_modules/@noodle-borg/authoring/dist/server.js +4 -0
  86. package/node_modules/@noodle-borg/authoring/dist/server.js.map +1 -1
  87. package/node_modules/@noodle-borg/authoring/package.json +5 -0
  88. package/node_modules/@noodle-borg/brand-kit/dist/index.d.ts +8 -0
  89. package/node_modules/@noodle-borg/brand-kit/dist/index.d.ts.map +1 -0
  90. package/node_modules/@noodle-borg/brand-kit/dist/index.js +8 -0
  91. package/node_modules/@noodle-borg/brand-kit/dist/index.js.map +1 -0
  92. package/node_modules/@noodle-borg/{compiler/dist/widget-palette.d.ts → brand-kit/dist/palette.d.ts} +1 -1
  93. package/node_modules/@noodle-borg/brand-kit/dist/palette.d.ts.map +1 -0
  94. package/node_modules/@noodle-borg/{compiler/dist/widget-palette.js → brand-kit/dist/palette.js} +1 -1
  95. package/node_modules/@noodle-borg/brand-kit/dist/palette.js.map +1 -0
  96. package/node_modules/@noodle-borg/{compiler/dist/widget-ui-style.d.ts → brand-kit/dist/ui-style.d.ts} +1 -1
  97. package/node_modules/@noodle-borg/brand-kit/dist/ui-style.d.ts.map +1 -0
  98. package/node_modules/@noodle-borg/{compiler/dist/widget-ui-style.js → brand-kit/dist/ui-style.js} +1 -1
  99. package/node_modules/@noodle-borg/brand-kit/dist/ui-style.js.map +1 -0
  100. package/node_modules/@noodle-borg/brand-kit/package.json +28 -0
  101. package/node_modules/@noodle-borg/compiler/dist/artifact/assemble.d.ts +2 -1
  102. package/node_modules/@noodle-borg/compiler/dist/artifact/assemble.d.ts.map +1 -1
  103. package/node_modules/@noodle-borg/compiler/dist/artifact/assemble.js +2 -1
  104. package/node_modules/@noodle-borg/compiler/dist/artifact/assemble.js.map +1 -1
  105. package/node_modules/@noodle-borg/compiler/dist/artifact/types.d.ts +3 -0
  106. package/node_modules/@noodle-borg/compiler/dist/artifact/types.d.ts.map +1 -1
  107. package/node_modules/@noodle-borg/compiler/dist/artifact/types.js.map +1 -1
  108. package/node_modules/@noodle-borg/compiler/dist/branding.d.ts.map +1 -1
  109. package/node_modules/@noodle-borg/compiler/dist/branding.js +1 -1
  110. package/node_modules/@noodle-borg/compiler/dist/branding.js.map +1 -1
  111. package/node_modules/@noodle-borg/compiler/dist/compile.d.ts +8 -0
  112. package/node_modules/@noodle-borg/compiler/dist/compile.d.ts.map +1 -1
  113. package/node_modules/@noodle-borg/compiler/dist/compile.js +8 -1
  114. package/node_modules/@noodle-borg/compiler/dist/compile.js.map +1 -1
  115. package/node_modules/@noodle-borg/compiler/dist/errors.d.ts +1 -1
  116. package/node_modules/@noodle-borg/compiler/dist/errors.d.ts.map +1 -1
  117. package/node_modules/@noodle-borg/compiler/dist/index.d.ts +1 -1
  118. package/node_modules/@noodle-borg/compiler/dist/index.d.ts.map +1 -1
  119. package/node_modules/@noodle-borg/compiler/dist/index.js +1 -1
  120. package/node_modules/@noodle-borg/compiler/dist/index.js.map +1 -1
  121. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +36 -0
  122. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts.map +1 -1
  123. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +7 -1
  124. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js.map +1 -1
  125. package/node_modules/@noodle-borg/compiler/dist/manifest/website-projection.d.ts +4 -0
  126. package/node_modules/@noodle-borg/compiler/dist/manifest/website-projection.d.ts.map +1 -1
  127. package/node_modules/@noodle-borg/compiler/dist/manifest/website-projection.js +1 -0
  128. package/node_modules/@noodle-borg/compiler/dist/manifest/website-projection.js.map +1 -1
  129. package/node_modules/@noodle-borg/compiler/dist/widget-emit.d.ts +1 -1
  130. package/node_modules/@noodle-borg/compiler/dist/widget-emit.d.ts.map +1 -1
  131. package/node_modules/@noodle-borg/compiler/dist/widget-emit.js +1 -1
  132. package/node_modules/@noodle-borg/compiler/dist/widget-emit.js.map +1 -1
  133. package/node_modules/@noodle-borg/compiler/dist/widget-size-validation.d.ts +1 -1
  134. package/node_modules/@noodle-borg/compiler/dist/widget-size-validation.d.ts.map +1 -1
  135. package/node_modules/@noodle-borg/compiler/dist/widget-size-validation.js.map +1 -1
  136. package/node_modules/@noodle-borg/compiler/package.json +3 -0
  137. package/node_modules/@noodle-borg/knowledge/dist/bm25.d.ts +14 -0
  138. package/node_modules/@noodle-borg/knowledge/dist/bm25.d.ts.map +1 -0
  139. package/node_modules/@noodle-borg/knowledge/dist/bm25.js +133 -0
  140. package/node_modules/@noodle-borg/knowledge/dist/bm25.js.map +1 -0
  141. package/node_modules/@noodle-borg/knowledge/dist/budget.d.ts +37 -0
  142. package/node_modules/@noodle-borg/knowledge/dist/budget.d.ts.map +1 -0
  143. package/node_modules/@noodle-borg/knowledge/dist/budget.js +52 -0
  144. package/node_modules/@noodle-borg/knowledge/dist/budget.js.map +1 -0
  145. package/node_modules/@noodle-borg/knowledge/dist/compile.d.ts +52 -0
  146. package/node_modules/@noodle-borg/knowledge/dist/compile.d.ts.map +1 -0
  147. package/node_modules/@noodle-borg/knowledge/dist/compile.js +250 -0
  148. package/node_modules/@noodle-borg/knowledge/dist/compile.js.map +1 -0
  149. package/node_modules/@noodle-borg/knowledge/dist/conformance.d.ts +21 -0
  150. package/node_modules/@noodle-borg/knowledge/dist/conformance.d.ts.map +1 -0
  151. package/node_modules/@noodle-borg/knowledge/dist/conformance.js +225 -0
  152. package/node_modules/@noodle-borg/knowledge/dist/conformance.js.map +1 -0
  153. package/node_modules/@noodle-borg/knowledge/dist/fakes.d.ts +23 -0
  154. package/node_modules/@noodle-borg/knowledge/dist/fakes.d.ts.map +1 -0
  155. package/node_modules/@noodle-borg/knowledge/dist/fakes.js +141 -0
  156. package/node_modules/@noodle-borg/knowledge/dist/fakes.js.map +1 -0
  157. package/node_modules/@noodle-borg/knowledge/dist/fusion.d.ts +27 -0
  158. package/node_modules/@noodle-borg/knowledge/dist/fusion.d.ts.map +1 -0
  159. package/node_modules/@noodle-borg/knowledge/dist/fusion.js +119 -0
  160. package/node_modules/@noodle-borg/knowledge/dist/fusion.js.map +1 -0
  161. package/node_modules/@noodle-borg/knowledge/dist/google-agent-search.d.ts +49 -0
  162. package/node_modules/@noodle-borg/knowledge/dist/google-agent-search.d.ts.map +1 -0
  163. package/node_modules/@noodle-borg/knowledge/dist/google-agent-search.js +235 -0
  164. package/node_modules/@noodle-borg/knowledge/dist/google-agent-search.js.map +1 -0
  165. package/node_modules/@noodle-borg/knowledge/dist/hits.d.ts +31 -0
  166. package/node_modules/@noodle-borg/knowledge/dist/hits.d.ts.map +1 -0
  167. package/node_modules/@noodle-borg/knowledge/dist/hits.js +75 -0
  168. package/node_modules/@noodle-borg/knowledge/dist/hits.js.map +1 -0
  169. package/node_modules/@noodle-borg/knowledge/dist/index.d.ts +25 -0
  170. package/node_modules/@noodle-borg/knowledge/dist/index.d.ts.map +1 -0
  171. package/node_modules/@noodle-borg/knowledge/dist/index.js +25 -0
  172. package/node_modules/@noodle-borg/knowledge/dist/index.js.map +1 -0
  173. package/node_modules/@noodle-borg/knowledge/dist/ir.d.ts +53 -0
  174. package/node_modules/@noodle-borg/knowledge/dist/ir.d.ts.map +1 -0
  175. package/node_modules/@noodle-borg/knowledge/dist/ir.js +87 -0
  176. package/node_modules/@noodle-borg/knowledge/dist/ir.js.map +1 -0
  177. package/node_modules/@noodle-borg/knowledge/dist/limits.d.ts +19 -0
  178. package/node_modules/@noodle-borg/knowledge/dist/limits.d.ts.map +1 -0
  179. package/node_modules/@noodle-borg/knowledge/dist/limits.js +19 -0
  180. package/node_modules/@noodle-borg/knowledge/dist/limits.js.map +1 -0
  181. package/node_modules/@noodle-borg/knowledge/dist/manifest-schema.d.ts +42 -0
  182. package/node_modules/@noodle-borg/knowledge/dist/manifest-schema.d.ts.map +1 -0
  183. package/node_modules/@noodle-borg/knowledge/dist/manifest-schema.js +45 -0
  184. package/node_modules/@noodle-borg/knowledge/dist/manifest-schema.js.map +1 -0
  185. package/node_modules/@noodle-borg/knowledge/dist/ports.d.ts +56 -0
  186. package/node_modules/@noodle-borg/knowledge/dist/ports.d.ts.map +1 -0
  187. package/node_modules/@noodle-borg/knowledge/dist/ports.js +13 -0
  188. package/node_modules/@noodle-borg/knowledge/dist/ports.js.map +1 -0
  189. package/node_modules/@noodle-borg/knowledge/dist/postgres-revision-store.d.ts +33 -0
  190. package/node_modules/@noodle-borg/knowledge/dist/postgres-revision-store.d.ts.map +1 -0
  191. package/node_modules/@noodle-borg/knowledge/dist/postgres-revision-store.js +200 -0
  192. package/node_modules/@noodle-borg/knowledge/dist/postgres-revision-store.js.map +1 -0
  193. package/node_modules/@noodle-borg/knowledge/dist/revision-store.d.ts +59 -0
  194. package/node_modules/@noodle-borg/knowledge/dist/revision-store.d.ts.map +1 -0
  195. package/node_modules/@noodle-borg/knowledge/dist/revision-store.js +128 -0
  196. package/node_modules/@noodle-borg/knowledge/dist/revision-store.js.map +1 -0
  197. package/node_modules/@noodle-borg/knowledge/package.json +36 -0
  198. package/node_modules/@noodle-borg/module/dist/contract.d.ts +2 -0
  199. package/node_modules/@noodle-borg/module/dist/contract.d.ts.map +1 -1
  200. package/node_modules/@noodle-borg/module/dist/contract.js.map +1 -1
  201. package/node_modules/@noodle-borg/plugin-distribution/dist/anthropic-connector-render.d.ts +4 -0
  202. package/node_modules/@noodle-borg/plugin-distribution/dist/anthropic-connector-render.d.ts.map +1 -0
  203. package/node_modules/@noodle-borg/plugin-distribution/dist/anthropic-connector-render.js +147 -0
  204. package/node_modules/@noodle-borg/plugin-distribution/dist/anthropic-connector-render.js.map +1 -0
  205. package/node_modules/@noodle-borg/plugin-distribution/dist/anthropic-connector-types.d.ts +14 -0
  206. package/node_modules/@noodle-borg/plugin-distribution/dist/anthropic-connector-types.d.ts.map +1 -0
  207. package/node_modules/@noodle-borg/plugin-distribution/dist/anthropic-connector-types.js +2 -0
  208. package/node_modules/@noodle-borg/plugin-distribution/dist/anthropic-connector-types.js.map +1 -0
  209. package/node_modules/@noodle-borg/plugin-distribution/dist/anthropic-connector-validation.d.ts +10 -0
  210. package/node_modules/@noodle-borg/plugin-distribution/dist/anthropic-connector-validation.d.ts.map +1 -0
  211. package/node_modules/@noodle-borg/plugin-distribution/dist/anthropic-connector-validation.js +152 -0
  212. package/node_modules/@noodle-borg/plugin-distribution/dist/anthropic-connector-validation.js.map +1 -0
  213. package/node_modules/@noodle-borg/plugin-distribution/dist/anthropic-connector.d.ts +7 -0
  214. package/node_modules/@noodle-borg/plugin-distribution/dist/anthropic-connector.d.ts.map +1 -0
  215. package/node_modules/@noodle-borg/plugin-distribution/dist/anthropic-connector.js +24 -0
  216. package/node_modules/@noodle-borg/plugin-distribution/dist/anthropic-connector.js.map +1 -0
  217. package/node_modules/@noodle-borg/plugin-distribution/dist/claude-distribution-command.d.ts +6 -0
  218. package/node_modules/@noodle-borg/plugin-distribution/dist/claude-distribution-command.d.ts.map +1 -0
  219. package/node_modules/@noodle-borg/plugin-distribution/dist/claude-distribution-command.js +260 -0
  220. package/node_modules/@noodle-borg/plugin-distribution/dist/claude-distribution-command.js.map +1 -0
  221. package/node_modules/@noodle-borg/plugin-distribution/dist/claude-plugin-render.d.ts +3 -0
  222. package/node_modules/@noodle-borg/plugin-distribution/dist/claude-plugin-render.d.ts.map +1 -0
  223. package/node_modules/@noodle-borg/plugin-distribution/dist/claude-plugin-render.js +89 -0
  224. package/node_modules/@noodle-borg/plugin-distribution/dist/claude-plugin-render.js.map +1 -0
  225. package/node_modules/@noodle-borg/plugin-distribution/dist/claude-plugin-validation.d.ts +3 -0
  226. package/node_modules/@noodle-borg/plugin-distribution/dist/claude-plugin-validation.d.ts.map +1 -0
  227. package/node_modules/@noodle-borg/plugin-distribution/dist/claude-plugin-validation.js +16 -0
  228. package/node_modules/@noodle-borg/plugin-distribution/dist/claude-plugin-validation.js.map +1 -0
  229. package/node_modules/@noodle-borg/plugin-distribution/dist/claude-plugin.d.ts +5 -0
  230. package/node_modules/@noodle-borg/plugin-distribution/dist/claude-plugin.d.ts.map +1 -0
  231. package/node_modules/@noodle-borg/plugin-distribution/dist/claude-plugin.js +15 -0
  232. package/node_modules/@noodle-borg/plugin-distribution/dist/claude-plugin.js.map +1 -0
  233. package/node_modules/@noodle-borg/plugin-distribution/dist/command.d.ts +3 -0
  234. package/node_modules/@noodle-borg/plugin-distribution/dist/command.d.ts.map +1 -0
  235. package/node_modules/@noodle-borg/plugin-distribution/dist/command.js +3 -0
  236. package/node_modules/@noodle-borg/plugin-distribution/dist/command.js.map +1 -0
  237. package/node_modules/@noodle-borg/plugin-distribution/dist/distribution-command-support.d.ts +37 -0
  238. package/node_modules/@noodle-borg/plugin-distribution/dist/distribution-command-support.d.ts.map +1 -0
  239. package/node_modules/@noodle-borg/plugin-distribution/dist/distribution-command-support.js +60 -0
  240. package/node_modules/@noodle-borg/plugin-distribution/dist/distribution-command-support.js.map +1 -0
  241. package/node_modules/@noodle-borg/plugin-distribution/dist/index.d.ts +2 -0
  242. package/node_modules/@noodle-borg/plugin-distribution/dist/index.d.ts.map +1 -1
  243. package/node_modules/@noodle-borg/plugin-distribution/dist/index.js +2 -0
  244. package/node_modules/@noodle-borg/plugin-distribution/dist/index.js.map +1 -1
  245. package/node_modules/@noodle-borg/plugin-distribution/dist/openai-plugin-command.d.ts +3 -28
  246. package/node_modules/@noodle-borg/plugin-distribution/dist/openai-plugin-command.d.ts.map +1 -1
  247. package/node_modules/@noodle-borg/plugin-distribution/dist/openai-plugin-command.js +23 -64
  248. package/node_modules/@noodle-borg/plugin-distribution/dist/openai-plugin-command.js.map +1 -1
  249. package/node_modules/@noodle-borg/plugin-distribution/dist/openai-plugin-render.d.ts.map +1 -1
  250. package/node_modules/@noodle-borg/plugin-distribution/dist/openai-plugin-render.js +3 -97
  251. package/node_modules/@noodle-borg/plugin-distribution/dist/openai-plugin-render.js.map +1 -1
  252. package/node_modules/@noodle-borg/plugin-distribution/dist/openai-plugin-validation.d.ts.map +1 -1
  253. package/node_modules/@noodle-borg/plugin-distribution/dist/openai-plugin-validation.js +19 -8
  254. package/node_modules/@noodle-borg/plugin-distribution/dist/openai-plugin-validation.js.map +1 -1
  255. package/node_modules/@noodle-borg/plugin-distribution/dist/openai-submission-render.d.ts +5 -0
  256. package/node_modules/@noodle-borg/plugin-distribution/dist/openai-submission-render.d.ts.map +1 -0
  257. package/node_modules/@noodle-borg/plugin-distribution/dist/openai-submission-render.js +147 -0
  258. package/node_modules/@noodle-borg/plugin-distribution/dist/openai-submission-render.js.map +1 -0
  259. package/node_modules/@noodle-borg/plugin-distribution/dist/public-url.d.ts +3 -0
  260. package/node_modules/@noodle-borg/plugin-distribution/dist/public-url.d.ts.map +1 -0
  261. package/node_modules/@noodle-borg/plugin-distribution/dist/public-url.js +22 -0
  262. package/node_modules/@noodle-borg/plugin-distribution/dist/public-url.js.map +1 -0
  263. package/node_modules/@noodle-borg/plugin-distribution/package.json +2 -2
  264. package/node_modules/@noodle-borg/protocol/dist/handlers/resources.d.ts +1 -1
  265. package/node_modules/@noodle-borg/protocol/dist/handlers/resources.d.ts.map +1 -1
  266. package/node_modules/@noodle-borg/protocol/dist/handlers/resources.js +1 -1
  267. package/node_modules/@noodle-borg/protocol/dist/handlers/resources.js.map +1 -1
  268. package/node_modules/@noodle-borg/protocol/dist/v2/response-observation.d.ts +1 -1
  269. package/node_modules/@noodle-borg/protocol/dist/v2/response-observation.d.ts.map +1 -1
  270. package/node_modules/@noodle-borg/protocol/dist/v2/response-observation.js +1 -1
  271. package/node_modules/@noodle-borg/protocol/dist/v2/response-observation.js.map +1 -1
  272. package/node_modules/@noodle-borg/protocol/dist/v2/server.d.ts.map +1 -1
  273. package/node_modules/@noodle-borg/protocol/dist/v2/server.js +1 -1
  274. package/node_modules/@noodle-borg/protocol/dist/v2/server.js.map +1 -1
  275. package/node_modules/@noodle-borg/protocol/package.json +1 -0
  276. package/node_modules/@noodle-borg/service/dist/index.d.ts +0 -1
  277. package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
  278. package/node_modules/@noodle-borg/service/dist/index.js +0 -1
  279. package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
  280. package/node_modules/@noodle-borg/service/dist/main.js +0 -52
  281. package/node_modules/@noodle-borg/service/dist/main.js.map +1 -1
  282. package/node_modules/@noodle-borg/service/dist/modules/host.d.ts +2 -6
  283. package/node_modules/@noodle-borg/service/dist/modules/host.d.ts.map +1 -1
  284. package/node_modules/@noodle-borg/service/dist/modules/host.js.map +1 -1
  285. package/node_modules/@noodle-borg/service/dist/options.d.ts +1 -21
  286. package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
  287. package/node_modules/@noodle-borg/service/dist/serve-options.d.ts +7 -1
  288. package/node_modules/@noodle-borg/service/dist/serve-options.d.ts.map +1 -1
  289. package/node_modules/@noodle-borg/service/dist/serve.d.ts +0 -1
  290. package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
  291. package/node_modules/@noodle-borg/service/dist/serve.js +22 -26
  292. package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
  293. package/node_modules/@noodle-borg/service/dist/service-config.d.ts +1 -1
  294. package/node_modules/@noodle-borg/service/dist/service-config.d.ts.map +1 -1
  295. package/node_modules/@noodle-borg/service/dist/service-config.js.map +1 -1
  296. package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
  297. package/node_modules/@noodle-borg/service/dist/service.js +1 -24
  298. package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
  299. package/node_modules/@noodle-borg/service/package.json +1 -0
  300. package/node_modules/@noodle-borg/service-modules/dist/index.d.ts +9 -0
  301. package/node_modules/@noodle-borg/service-modules/dist/index.d.ts.map +1 -0
  302. package/node_modules/@noodle-borg/service-modules/dist/index.js +9 -0
  303. package/node_modules/@noodle-borg/service-modules/dist/index.js.map +1 -0
  304. package/node_modules/@noodle-borg/service-modules/dist/loaded-module.d.ts +8 -0
  305. package/node_modules/@noodle-borg/service-modules/dist/loaded-module.d.ts.map +1 -0
  306. package/node_modules/@noodle-borg/service-modules/dist/loaded-module.js +2 -0
  307. package/node_modules/@noodle-borg/service-modules/dist/loaded-module.js.map +1 -0
  308. package/node_modules/@noodle-borg/{service/dist/modules → service-modules/dist}/loader.d.ts +1 -1
  309. package/node_modules/@noodle-borg/service-modules/dist/loader.d.ts.map +1 -0
  310. package/node_modules/@noodle-borg/service-modules/dist/loader.js.map +1 -0
  311. package/node_modules/@noodle-borg/service-modules/package.json +32 -0
  312. package/node_modules/@noodle-borg/uri-template/dist/index.d.ts +7 -0
  313. package/node_modules/@noodle-borg/uri-template/dist/index.d.ts.map +1 -0
  314. package/node_modules/@noodle-borg/uri-template/dist/index.js +7 -0
  315. package/node_modules/@noodle-borg/uri-template/dist/index.js.map +1 -0
  316. package/node_modules/@noodle-borg/uri-template/package.json +28 -0
  317. package/node_modules/@noodleseed/assistant/dist/{chunk-7L52WJ2E.js → chunk-MZNENVFY.js} +11 -3
  318. package/node_modules/@noodleseed/assistant/dist/{chunk-7L52WJ2E.js.map → chunk-MZNENVFY.js.map} +1 -1
  319. package/node_modules/@noodleseed/assistant/dist/{chunk-NPV64PUX.js → chunk-RIKRQFKS.js} +5 -1
  320. package/node_modules/@noodleseed/assistant/dist/{chunk-NPV64PUX.js.map → chunk-RIKRQFKS.js.map} +1 -1
  321. package/node_modules/@noodleseed/assistant/dist/{client-Ii_xTV09.d.ts → client-B6pnBmF8.d.ts} +1 -0
  322. package/node_modules/@noodleseed/assistant/dist/{client-401BAJqk.d.cts → client-BQ30Fq-c.d.cts} +1 -0
  323. package/node_modules/@noodleseed/assistant/dist/client.cjs +4 -0
  324. package/node_modules/@noodleseed/assistant/dist/client.cjs.map +1 -1
  325. package/node_modules/@noodleseed/assistant/dist/client.d.cts +1 -1
  326. package/node_modules/@noodleseed/assistant/dist/client.d.ts +1 -1
  327. package/node_modules/@noodleseed/assistant/dist/client.js +1 -1
  328. package/node_modules/@noodleseed/assistant/dist/embed.global.js +2 -2
  329. package/node_modules/@noodleseed/assistant/dist/index.cjs +13 -1
  330. package/node_modules/@noodleseed/assistant/dist/index.cjs.map +1 -1
  331. package/node_modules/@noodleseed/assistant/dist/index.d.cts +2 -2
  332. package/node_modules/@noodleseed/assistant/dist/index.d.ts +2 -2
  333. package/node_modules/@noodleseed/assistant/dist/index.js +2 -2
  334. package/node_modules/@noodleseed/assistant/dist/react/client.cjs +4 -0
  335. package/node_modules/@noodleseed/assistant/dist/react/client.cjs.map +1 -1
  336. package/node_modules/@noodleseed/assistant/dist/react/client.d.cts +1 -1
  337. package/node_modules/@noodleseed/assistant/dist/react/client.d.ts +1 -1
  338. package/node_modules/@noodleseed/assistant/dist/react/client.js +1 -1
  339. package/node_modules/@noodleseed/assistant/dist/react.cjs +13 -1
  340. package/node_modules/@noodleseed/assistant/dist/react.cjs.map +1 -1
  341. package/node_modules/@noodleseed/assistant/dist/react.d.cts +1 -1
  342. package/node_modules/@noodleseed/assistant/dist/react.d.ts +1 -1
  343. package/node_modules/@noodleseed/assistant/dist/react.js +2 -2
  344. package/node_modules/@noodleseed/assistant/package.json +2 -1
  345. package/package.json +5 -1
  346. package/node_modules/@noodle-borg/compiler/dist/widget-palette.d.ts.map +0 -1
  347. package/node_modules/@noodle-borg/compiler/dist/widget-palette.js.map +0 -1
  348. package/node_modules/@noodle-borg/compiler/dist/widget-ui-style.d.ts.map +0 -1
  349. package/node_modules/@noodle-borg/compiler/dist/widget-ui-style.js.map +0 -1
  350. package/node_modules/@noodle-borg/service/dist/feedback-operations/bootstrap.d.ts +0 -7
  351. package/node_modules/@noodle-borg/service/dist/feedback-operations/bootstrap.d.ts.map +0 -1
  352. package/node_modules/@noodle-borg/service/dist/feedback-operations/bootstrap.js +0 -23
  353. package/node_modules/@noodle-borg/service/dist/feedback-operations/bootstrap.js.map +0 -1
  354. package/node_modules/@noodle-borg/service/dist/feedback-operations/config.d.ts +0 -12
  355. package/node_modules/@noodle-borg/service/dist/feedback-operations/config.d.ts.map +0 -1
  356. package/node_modules/@noodle-borg/service/dist/feedback-operations/config.js +0 -47
  357. package/node_modules/@noodle-borg/service/dist/feedback-operations/config.js.map +0 -1
  358. package/node_modules/@noodle-borg/service/dist/feedback-operations/contracts.d.ts +0 -24
  359. package/node_modules/@noodle-borg/service/dist/feedback-operations/contracts.d.ts.map +0 -1
  360. package/node_modules/@noodle-borg/service/dist/feedback-operations/contracts.js +0 -2
  361. package/node_modules/@noodle-borg/service/dist/feedback-operations/contracts.js.map +0 -1
  362. package/node_modules/@noodle-borg/service/dist/feedback-operations/delivery-worker.d.ts +0 -29
  363. package/node_modules/@noodle-borg/service/dist/feedback-operations/delivery-worker.d.ts.map +0 -1
  364. package/node_modules/@noodle-borg/service/dist/feedback-operations/delivery-worker.js +0 -263
  365. package/node_modules/@noodle-borg/service/dist/feedback-operations/delivery-worker.js.map +0 -1
  366. package/node_modules/@noodle-borg/service/dist/feedback-operations/linear-client.d.ts +0 -39
  367. package/node_modules/@noodle-borg/service/dist/feedback-operations/linear-client.d.ts.map +0 -1
  368. package/node_modules/@noodle-borg/service/dist/feedback-operations/linear-client.js +0 -142
  369. package/node_modules/@noodle-borg/service/dist/feedback-operations/linear-client.js.map +0 -1
  370. package/node_modules/@noodle-borg/service/dist/feedback-operations/reporter-email.d.ts +0 -33
  371. package/node_modules/@noodle-borg/service/dist/feedback-operations/reporter-email.d.ts.map +0 -1
  372. package/node_modules/@noodle-borg/service/dist/feedback-operations/reporter-email.js +0 -142
  373. package/node_modules/@noodle-borg/service/dist/feedback-operations/reporter-email.js.map +0 -1
  374. package/node_modules/@noodle-borg/service/dist/feedback-operations/slack-card.d.ts +0 -138
  375. package/node_modules/@noodle-borg/service/dist/feedback-operations/slack-card.d.ts.map +0 -1
  376. package/node_modules/@noodle-borg/service/dist/feedback-operations/slack-card.js +0 -199
  377. package/node_modules/@noodle-borg/service/dist/feedback-operations/slack-card.js.map +0 -1
  378. package/node_modules/@noodle-borg/service/dist/feedback-operations/slack-client.d.ts +0 -52
  379. package/node_modules/@noodle-borg/service/dist/feedback-operations/slack-client.d.ts.map +0 -1
  380. package/node_modules/@noodle-borg/service/dist/feedback-operations/slack-client.js +0 -103
  381. package/node_modules/@noodle-borg/service/dist/feedback-operations/slack-client.js.map +0 -1
  382. package/node_modules/@noodle-borg/service/dist/github/feedback-issues.d.ts +0 -44
  383. package/node_modules/@noodle-borg/service/dist/github/feedback-issues.d.ts.map +0 -1
  384. package/node_modules/@noodle-borg/service/dist/github/feedback-issues.js +0 -117
  385. package/node_modules/@noodle-borg/service/dist/github/feedback-issues.js.map +0 -1
  386. package/node_modules/@noodle-borg/service/dist/modules/loader.d.ts.map +0 -1
  387. package/node_modules/@noodle-borg/service/dist/modules/loader.js.map +0 -1
  388. package/node_modules/@noodle-borg/service/dist/routes/feedback-operations-dispatch.d.ts +0 -10
  389. package/node_modules/@noodle-borg/service/dist/routes/feedback-operations-dispatch.d.ts.map +0 -1
  390. package/node_modules/@noodle-borg/service/dist/routes/feedback-operations-dispatch.js +0 -54
  391. package/node_modules/@noodle-borg/service/dist/routes/feedback-operations-dispatch.js.map +0 -1
  392. package/node_modules/@noodle-borg/service/dist/routes/feedback.d.ts +0 -30
  393. package/node_modules/@noodle-borg/service/dist/routes/feedback.d.ts.map +0 -1
  394. package/node_modules/@noodle-borg/service/dist/routes/feedback.js +0 -233
  395. package/node_modules/@noodle-borg/service/dist/routes/feedback.js.map +0 -1
  396. package/node_modules/@noodle-borg/service/dist/routes/linear-feedback-webhook.d.ts +0 -17
  397. package/node_modules/@noodle-borg/service/dist/routes/linear-feedback-webhook.d.ts.map +0 -1
  398. package/node_modules/@noodle-borg/service/dist/routes/linear-feedback-webhook.js +0 -141
  399. package/node_modules/@noodle-borg/service/dist/routes/linear-feedback-webhook.js.map +0 -1
  400. package/node_modules/@noodle-borg/service/dist/routes/slack-feedback-actions.d.ts +0 -15
  401. package/node_modules/@noodle-borg/service/dist/routes/slack-feedback-actions.d.ts.map +0 -1
  402. package/node_modules/@noodle-borg/service/dist/routes/slack-feedback-actions.js +0 -135
  403. package/node_modules/@noodle-borg/service/dist/routes/slack-feedback-actions.js.map +0 -1
  404. package/node_modules/@noodle-borg/service/dist/store/feedback-operations.d.ts +0 -188
  405. package/node_modules/@noodle-borg/service/dist/store/feedback-operations.d.ts.map +0 -1
  406. package/node_modules/@noodle-borg/service/dist/store/feedback-operations.js +0 -489
  407. package/node_modules/@noodle-borg/service/dist/store/feedback-operations.js.map +0 -1
  408. package/node_modules/@noodle-borg/service/dist/store/postgres-feedback-operations.d.ts +0 -35
  409. package/node_modules/@noodle-borg/service/dist/store/postgres-feedback-operations.d.ts.map +0 -1
  410. package/node_modules/@noodle-borg/service/dist/store/postgres-feedback-operations.js +0 -172
  411. package/node_modules/@noodle-borg/service/dist/store/postgres-feedback-operations.js.map +0 -1
  412. /package/node_modules/@noodle-borg/{service/dist/modules → service-modules/dist}/loader.js +0 -0
  413. /package/node_modules/@noodle-borg/{compiler → uri-template}/dist/uri-template.d.ts +0 -0
  414. /package/node_modules/@noodle-borg/{compiler → uri-template}/dist/uri-template.d.ts.map +0 -0
  415. /package/node_modules/@noodle-borg/{compiler → uri-template}/dist/uri-template.js +0 -0
  416. /package/node_modules/@noodle-borg/{compiler → uri-template}/dist/uri-template.js.map +0 -0
@@ -33,10 +33,12 @@ export const BUNDLED_EXAMPLE_FILES = [
33
33
  { relPath: "examples/acme-discovery/noodle.json", content: "{\n \"entrypoint\": \"src/server.ts\",\n \"name\": \"acme-discovery\",\n \"template\": \"widget\"\n}\n" },
34
34
  { relPath: "examples/acme-discovery/package.json", content: "{\n \"name\": \"acme-discovery\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"test\": \"vitest run\",\n \"validate\": \"noodle validate\",\n \"dev\": \"noodle dev\",\n \"deploy\": \"noodle deploy\"\n },\n \"devDependencies\": {\n \"@vitejs/plugin-react\": \"latest\",\n \"@noodleseed/one\": \"latest\",\n \"react\": \"latest\",\n \"react-dom\": \"latest\",\n \"vite\": \"latest\",\n \"vitest\": \"latest\"\n }\n}\n" },
35
35
  { relPath: "examples/acme-discovery/src/helpers.ts", content: "import type { ServerDefinition } from '@noodleseed/one';\nimport { generateHelpers } from '@noodleseed/one/react';\n\nexport type AppType = ServerDefinition;\n\nexport const { useCallTool, useLayout, useOpenExternal, useToolInfo, useViewState } =\n generateHelpers<AppType>();\n" },
36
- { relPath: "examples/acme-discovery/src/server.ts", content: "import {\n annotations,\n embeddedAssistant,\n openAICompatible,\n publicWebsite,\n secret,\n server,\n tool,\n variable,\n z,\n} from '@noodleseed/one';\n\n// Acme Getaways is a fictional travel brand. This app is deliberately top-of-funnel: discovery and\n// configuration happen inside ChatGPT; the booking/transaction happens off-app on Acme's own site,\n// reached through a signed, attributable handoff deep link. Destinations are the partner's own\n// catalog (grounding) — the app never invents a place, price, or best-month.\n//\n// Authoring note: a tool `fulfil` is *recorded*, not run as live JS. Inputs flow through as\n// `${input.x}` substitutions when placed directly into an output string; do not transform them\n// (no URL-encoding, arithmetic, or filtering on an input value — those break substitution). The\n// curated catalog below is static data the runtime returns verbatim.\n\nconst catalog = [\n {\n id: 'coral_bay',\n name: 'Coral Bay',\n region: 'Adriatic coast',\n vibe: 'beach',\n priceFrom: 890,\n bestMonths: 'May–Sep',\n why: 'Calm swimming coves and a walkable old town — easy for a relaxed first trip.',\n },\n {\n id: 'monte_alto',\n name: 'Monte Alto',\n region: 'Northern Alps',\n vibe: 'mountains',\n priceFrom: 1120,\n bestMonths: 'Dec–Mar',\n why: 'Ski-in village with beginner slopes and long groomed runs.',\n },\n {\n id: 'old_quarter',\n name: 'Old Quarter',\n region: 'Central Europe',\n vibe: 'culture',\n priceFrom: 640,\n bestMonths: 'Apr–Oct',\n why: 'Dense museum district and food halls, all reachable on foot.',\n },\n {\n id: 'harbor_city',\n name: 'Harbor City',\n region: 'Pacific rim',\n vibe: 'city',\n priceFrom: 980,\n bestMonths: 'Sep–Nov',\n why: 'Waterfront nightlife and day-trip islands a short ferry away.',\n },\n] as const;\n\n// A closed set of URL-safe month values. A `fulfil` cannot url-encode an input (recording would break\n// substitution), so the deep link carries `month` only if it is already safe — the model maps natural\n// phrasing (\"early June\") onto one of these when it fills the tool.\nconst monthEnum = z\n .enum([\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ])\n .default('June');\n\n// The catalog ids are already url-safe slugs. Constrain the handoff `destination` to this closed set so\n// only a real, url-safe id can reach the deep link.\nconst destinationId = z.enum(['coral_bay', 'monte_alto', 'old_quarter', 'harbor_city']);\n\nconst discoverInput = z.object({\n vibe: z.enum(['beach', 'mountains', 'culture', 'city']).default('beach'),\n month: monthEnum,\n travelers: z.number().int().min(1).default(2),\n});\n\n// Tool annotations for host planners: reads are read-only, the handoff opens an external link, and\n// shortlisting is a local non-destructive write.\nconst readOnly = annotations.readOnly();\nconst openLink = annotations.openAction();\nconst localWrite = annotations.localAction({ destructive: false, confirm: false });\n\nconst destinationOutput = z.object({\n id: z.string(),\n name: z.string(),\n region: z.string(),\n vibe: z.string(),\n priceFrom: z.number(),\n bestMonths: z.string(),\n why: z.string(),\n});\n\nconst discoverGetaways = tool('discover_getaways', {\n title: 'Discover getaways',\n description:\n 'Suggest Acme Getaways destinations for a vibe and month and render a discovery carousel.',\n annotations: readOnly,\n input: discoverInput,\n output: z.object({\n status: z.string(),\n vibe: z.string(),\n month: z.string(),\n travelers: z.number(),\n // Bounded list: the curated catalog is fixed and small, and the declared ceiling tells the\n // model and host the payload cannot grow. `noodle check` reports `tool_design_output_bounds`.\n options: z.array(destinationOutput).max(20),\n }),\n // The carousel presents Acme's curated catalog; the model narrates which fit the stated vibe.\n // (A tool cannot filter on an input value — that is connector/flow work — so all are returned.)\n fulfil: ({ input }) => ({\n status: `Acme Getaways for a ${input.vibe} trip in ${input.month}, ${input.travelers} traveler(s).`,\n vibe: input.vibe,\n month: input.month,\n travelers: input.travelers,\n options: catalog,\n }),\n viewTitle: 'Discover getaways',\n // ChatGPT host status copy (openai/toolInvocation/*) — required for widget-opening tools.\n invoking: 'Finding getaways…',\n invoked: 'Getaways ready',\n domain: 'https://getaways.acme.example',\n view: {\n component: 'discovery-carousel',\n entry: './views/discovery-carousel.tsx',\n },\n viewDescription:\n 'A top-of-funnel discovery carousel: pick a destination, then hand off to Acme to book.',\n csp: {\n connectDomains: ['https://acme.example'],\n resourceDomains: ['https://acme.example'],\n frameDomains: ['https://acme.example'],\n },\n});\n\nconst createHandoff = tool('create_handoff', {\n title: 'Create booking handoff',\n description:\n 'Create the Acme booking deep link for a chosen destination, carrying the configured trip. ' +\n 'Pass the destination id (url-safe slug, e.g. \"coral_bay\") and its display name.',\n annotations: openLink,\n input: z.object({\n destination: destinationId,\n destinationName: z.string().min(1),\n month: monthEnum,\n travelers: z.number().int().min(1).default(2),\n }),\n output: z.object({\n status: z.string(),\n destination: z.string(),\n summary: z.string(),\n handoffUrl: z.string(),\n }),\n // Inline the inputs directly so they substitute at runtime; every value is already url-safe\n // (id slug, month enum, integer), and `src=chatgpt` is the attribution the partner measures\n // ChatGPT-sourced conversions on.\n fulfil: ({ input }) => ({\n status: `Ready to continue on Acme for ${input.destinationName}.`,\n destination: input.destination,\n summary: `${input.destinationName} · ${input.month} · ${input.travelers} traveler(s)`,\n handoffUrl: `https://book.acme.example/plan?dest=${input.destination}&month=${input.month}&pax=${input.travelers}&src=chatgpt`,\n }),\n});\n\nconst shortlistGetaway = tool('shortlist_getaway', {\n visibility: ['app'],\n description: 'Record the traveler’s shortlisted destination from the discovery widget.',\n annotations: localWrite,\n input: z.object({\n destination: z.string(),\n note: z.string().default(''),\n }),\n output: z.object({\n status: z.string(),\n destination: z.string(),\n note: z.string(),\n }),\n fulfil: ({ input }) => ({\n status: `Shortlisted ${input.destination}.`,\n destination: input.destination,\n note: input.note,\n }),\n});\n\nexport default server(\n 'acme_discovery',\n {\n title: 'Acme Getaways',\n version: '1.0.0',\n branding: {\n name: 'Acme Getaways',\n accent: '#0EA5A4',\n surface: '#F0FDFA',\n surfaceDark: '#0B1B1B',\n radius: 'lg',\n density: 'comfortable',\n },\n // The only external destinations the app links out to — the compiler derives ChatGPT's\n // redirect_domains from this so the handoff opens without a safe-link warning.\n handoff: {\n allowedDomains: ['https://book.acme.example', 'https://acme.example'],\n },\n // The same three tools also serve Acme's own marketing site, with no second tool set and no\n // session backend: a visitor with no account gets the discovery carousel and the booking\n // handoff. `capabilities` is the whole externally reachable surface — short enough to review in\n // one glance, and closed by default when a tool is added to the server later.\n assistant: embeddedAssistant({\n model: openAICompatible({\n baseUrl: variable('ASSISTANT_MODEL_BASE_URL'),\n model: variable('ASSISTANT_MODEL'),\n apiKey: secret('ASSISTANT_MODEL_API_KEY'),\n }),\n access: publicWebsite({\n origins: ['https://getaways.acme.example'],\n capabilities: [discoverGetaways, createHandoff, shortlistGetaway],\n }),\n layout: { mode: 'floating', position: 'bottom-right' },\n labels: { welcomeHeading: 'Where would you like to go?' },\n }),\n },\n [discoverGetaways, createHandoff, shortlistGetaway],\n);\n" },
36
+ { relPath: "examples/acme-discovery/src/knowledge/faq.txt", content: "ACME GETAWAYS FAQ\n\nQ: Does the assistant book and take payment?\nA: No. The assistant shapes the trip and hands off to Acmes own checkout with a signed link.\n\nQ: How current are prices?\nA: Starting prices come from Acmes live site; the assistant cites the page it used.\n\nQ: Can I compare destinations?\nA: Yes, ask for a shortlist by vibe, month, or budget.\n" },
37
+ { relPath: "examples/acme-discovery/src/knowledge/product.md", content: "# Acme Getaways product guide\n\nAcme Getaways curates four destination types: beach, mountains, culture, and city escapes. Every listing shows a real starting price and the best months to travel. Bookings, payments, and date selection happen on Acmes own site through a signed handoff link; the assistant never takes payment details.\n\n## Cancellation and support\n\nAll trips can be cancelled free within 48 hours of the handoff. Support runs seven days a week through the chat on book.acme.example.\n" },
38
+ { relPath: "examples/acme-discovery/src/server.ts", content: "import {\n annotations,\n embeddedAssistant,\n file,\n knowledge,\n openAICompatible,\n publicWebsite,\n secret,\n server,\n site,\n tool,\n variable,\n z,\n} from '@noodleseed/one';\n\n// Acme Getaways is a fictional travel brand. This app is deliberately top-of-funnel: discovery and\n// configuration happen inside ChatGPT; the booking/transaction happens off-app on Acme's own site,\n// reached through a signed, attributable handoff deep link. Destinations are the partner's own\n// catalog (grounding) — the app never invents a place, price, or best-month.\n//\n// Authoring note: a tool `fulfil` is *recorded*, not run as live JS. Inputs flow through as\n// `${input.x}` substitutions when placed directly into an output string; do not transform them\n// (no URL-encoding, arithmetic, or filtering on an input value — those break substitution). The\n// curated catalog below is static data the runtime returns verbatim.\n\nconst catalog = [\n {\n id: 'coral_bay',\n name: 'Coral Bay',\n region: 'Adriatic coast',\n vibe: 'beach',\n priceFrom: 890,\n bestMonths: 'May–Sep',\n why: 'Calm swimming coves and a walkable old town — easy for a relaxed first trip.',\n },\n {\n id: 'monte_alto',\n name: 'Monte Alto',\n region: 'Northern Alps',\n vibe: 'mountains',\n priceFrom: 1120,\n bestMonths: 'Dec–Mar',\n why: 'Ski-in village with beginner slopes and long groomed runs.',\n },\n {\n id: 'old_quarter',\n name: 'Old Quarter',\n region: 'Central Europe',\n vibe: 'culture',\n priceFrom: 640,\n bestMonths: 'Apr–Oct',\n why: 'Dense museum district and food halls, all reachable on foot.',\n },\n {\n id: 'harbor_city',\n name: 'Harbor City',\n region: 'Pacific rim',\n vibe: 'city',\n priceFrom: 980,\n bestMonths: 'Sep–Nov',\n why: 'Waterfront nightlife and day-trip islands a short ferry away.',\n },\n] as const;\n\n// A closed set of URL-safe month values. A `fulfil` cannot url-encode an input (recording would break\n// substitution), so the deep link carries `month` only if it is already safe — the model maps natural\n// phrasing (\"early June\") onto one of these when it fills the tool.\nconst monthEnum = z\n .enum([\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ])\n .default('June');\n\n// The catalog ids are already url-safe slugs. Constrain the handoff `destination` to this closed set so\n// only a real, url-safe id can reach the deep link.\nconst destinationId = z.enum(['coral_bay', 'monte_alto', 'old_quarter', 'harbor_city']);\n\nconst discoverInput = z.object({\n vibe: z.enum(['beach', 'mountains', 'culture', 'city']).default('beach'),\n month: monthEnum,\n travelers: z.number().int().min(1).default(2),\n});\n\n// Tool annotations for host planners: reads are read-only, the handoff opens an external link, and\n// shortlisting is a local non-destructive write.\nconst readOnly = annotations.readOnly();\nconst openLink = annotations.openAction();\nconst localWrite = annotations.localAction({ destructive: false, confirm: false });\n\nconst destinationOutput = z.object({\n id: z.string(),\n name: z.string(),\n region: z.string(),\n vibe: z.string(),\n priceFrom: z.number(),\n bestMonths: z.string(),\n why: z.string(),\n});\n\nconst discoverGetaways = tool('discover_getaways', {\n title: 'Discover getaways',\n description:\n 'Suggest Acme Getaways destinations for a vibe and month and render a discovery carousel.',\n annotations: readOnly,\n input: discoverInput,\n output: z.object({\n status: z.string(),\n vibe: z.string(),\n month: z.string(),\n travelers: z.number(),\n // Bounded list: the curated catalog is fixed and small, and the declared ceiling tells the\n // model and host the payload cannot grow. `noodle check` reports `tool_design_output_bounds`.\n options: z.array(destinationOutput).max(20),\n }),\n // The carousel presents Acme's curated catalog; the model narrates which fit the stated vibe.\n // (A tool cannot filter on an input value — that is connector/flow work — so all are returned.)\n fulfil: ({ input }) => ({\n status: `Acme Getaways for a ${input.vibe} trip in ${input.month}, ${input.travelers} traveler(s).`,\n vibe: input.vibe,\n month: input.month,\n travelers: input.travelers,\n options: catalog,\n }),\n viewTitle: 'Discover getaways',\n // ChatGPT host status copy (openai/toolInvocation/*) — required for widget-opening tools.\n invoking: 'Finding getaways…',\n invoked: 'Getaways ready',\n domain: 'https://getaways.acme.example',\n view: {\n component: 'discovery-carousel',\n entry: './views/discovery-carousel.tsx',\n },\n viewDescription:\n 'A top-of-funnel discovery carousel: pick a destination, then hand off to Acme to book.',\n csp: {\n connectDomains: ['https://acme.example'],\n resourceDomains: ['https://acme.example'],\n frameDomains: ['https://acme.example'],\n },\n});\n\nconst createHandoff = tool('create_handoff', {\n title: 'Create booking handoff',\n description:\n 'Create the Acme booking deep link for a chosen destination, carrying the configured trip. ' +\n 'Pass the destination id (url-safe slug, e.g. \"coral_bay\") and its display name.',\n annotations: openLink,\n input: z.object({\n destination: destinationId,\n destinationName: z.string().min(1),\n month: monthEnum,\n travelers: z.number().int().min(1).default(2),\n }),\n output: z.object({\n status: z.string(),\n destination: z.string(),\n summary: z.string(),\n handoffUrl: z.string(),\n }),\n // Inline the inputs directly so they substitute at runtime; every value is already url-safe\n // (id slug, month enum, integer), and `src=chatgpt` is the attribution the partner measures\n // ChatGPT-sourced conversions on.\n fulfil: ({ input }) => ({\n status: `Ready to continue on Acme for ${input.destinationName}.`,\n destination: input.destination,\n summary: `${input.destinationName} · ${input.month} · ${input.travelers} traveler(s)`,\n handoffUrl: `https://book.acme.example/plan?dest=${input.destination}&month=${input.month}&pax=${input.travelers}&src=chatgpt`,\n }),\n});\n\nconst shortlistGetaway = tool('shortlist_getaway', {\n visibility: ['app'],\n description: 'Record the traveler’s shortlisted destination from the discovery widget.',\n annotations: localWrite,\n input: z.object({\n destination: z.string(),\n note: z.string().default(''),\n }),\n output: z.object({\n status: z.string(),\n destination: z.string(),\n note: z.string(),\n }),\n fulfil: ({ input }) => ({\n status: `Shortlisted ${input.destination}.`,\n destination: input.destination,\n note: input.note,\n }),\n});\n\n// Grounding beyond the catalog: two controlled files answer policy/pricing/support questions with\n// citations, and Acme's live public site stays current through its search provider — no sync job,\n// no handwritten search tool. One declaration, one generated `search_destinations` capability.\nconst destinations = knowledge('destinations', {\n title: 'Acme Getaways destinations',\n description: 'Public destination, pricing, cancellation, and support information.',\n documents: [\n file('./knowledge/product.md', {\n title: 'Product guide',\n sourceUrl: 'https://getaways.acme.example/product',\n }),\n file('./knowledge/faq.txt', { title: 'FAQ' }),\n ],\n sites: [\n site({\n origin: 'https://getaways.acme.example',\n include: ['/destinations/**', '/pricing', '/support'],\n }),\n ],\n});\n\nexport default server(\n 'acme_discovery',\n {\n title: 'Acme Getaways',\n version: '1.0.0',\n branding: {\n name: 'Acme Getaways',\n accent: '#0EA5A4',\n surface: '#F0FDFA',\n surfaceDark: '#0B1B1B',\n radius: 'lg',\n density: 'comfortable',\n },\n // The only external destinations the app links out to — the compiler derives ChatGPT's\n // redirect_domains from this so the handoff opens without a safe-link warning.\n handoff: {\n allowedDomains: ['https://book.acme.example', 'https://acme.example'],\n },\n // The same three tools also serve Acme's own marketing site, with no second tool set and no\n // session backend: a visitor with no account gets the discovery carousel and the booking\n // handoff. `capabilities` is the whole externally reachable surface — short enough to review in\n // one glance, and closed by default when a tool is added to the server later. The knowledge\n // component projects its generated search capability the same way a tool does.\n assistant: embeddedAssistant({\n model: openAICompatible({\n baseUrl: variable('ASSISTANT_MODEL_BASE_URL'),\n model: variable('ASSISTANT_MODEL'),\n apiKey: secret('ASSISTANT_MODEL_API_KEY'),\n }),\n access: publicWebsite({\n origins: ['https://getaways.acme.example'],\n capabilities: [destinations, discoverGetaways, createHandoff, shortlistGetaway],\n }),\n layout: { mode: 'floating', position: 'bottom-right' },\n labels: { welcomeHeading: 'Where would you like to go?' },\n }),\n knowledge: [destinations],\n },\n [discoverGetaways, createHandoff, shortlistGetaway],\n);\n" },
37
39
  { relPath: "examples/acme-discovery/src/views/discovery-carousel.tsx", content: "import { useState } from 'react';\nimport { useCallTool, useLayout, useOpenExternal, useToolInfo, useViewState } from '../helpers.js';\nimport './widget-style.css';\n\ntype Destination = {\n readonly id: string;\n readonly name: string;\n readonly region: string;\n readonly vibe: string;\n readonly priceFrom: number;\n readonly bestMonths: string;\n readonly why: string;\n};\n\nfunction asDiscovery(value: unknown) {\n return value as\n | {\n readonly status?: string;\n readonly month?: string;\n readonly travelers?: number;\n readonly options?: readonly Destination[];\n }\n | undefined;\n}\n\nexport default function DiscoveryCarousel() {\n const { displayMode, theme } = useLayout();\n const openExternal = useOpenExternal();\n const discovery = asDiscovery(useToolInfo('discover_getaways').structuredContent);\n const shortlist = useCallTool('shortlist_getaway');\n const handoff = useCallTool('create_handoff');\n\n const options = discovery?.options ?? [];\n const month = discovery?.month ?? 'June';\n const travelers = discovery?.travelers ?? 2;\n const [chosen, setChosen] = useViewState('chosen', options[0]?.id ?? '');\n const [status, setStatus] = useState(discovery?.status ?? 'Pick a getaway to continue.');\n const selected = options.find((entry) => entry.id === chosen) ?? options[0];\n const continueLabel = handoff.isPending\n ? 'Opening Acme…'\n : `Continue on Acme${selected ? ` · ${selected.name}` : ''}`;\n\n async function shortlistDestination(destination: Destination) {\n setChosen(destination.id);\n try {\n const result = await shortlist.callTool({ destination: destination.name });\n const structured = result.structuredContent as { readonly status?: string } | undefined;\n setStatus(structured?.status ?? `Shortlisted ${destination.name}.`);\n } catch {\n setStatus(`Couldn't shortlist ${destination.name} — try again.`);\n }\n }\n\n async function continueOnAcme() {\n if (selected === undefined) return;\n // The handoff is the product: configure here, transact off-app. The deep link carries the trip.\n // Only open the external target on a successful handoff; surface failures instead of failing silently.\n try {\n const result = await handoff.callTool({\n destination: selected.id,\n destinationName: selected.name,\n month,\n travelers,\n });\n const structured = result.structuredContent as { readonly handoffUrl?: string } | undefined;\n if (structured?.handoffUrl) openExternal(structured.handoffUrl);\n else setStatus('Continue on Acme is unavailable right now — try again.');\n } catch {\n setStatus('Continue on Acme failed — try again.');\n }\n }\n\n return (\n <main\n className={`nw-shell${theme === 'dark' ? ' dark' : ''}`}\n data-llm={`Acme Getaways discovery: ${options.length} options for ${month}, ${travelers} traveler(s); shortlisted ${selected?.name ?? 'none'}`}\n >\n <section className=\"nw-card\">\n <header className=\"nw-header\">\n <span className=\"nw-icon\" aria-hidden=\"true\">\n <CompassIcon />\n </span>\n <div className=\"nw-title-block\">\n <h1 className=\"nw-title\">Acme Getaways</h1>\n <p className=\"nw-subtitle\" aria-live=\"polite\">\n {status}\n </p>\n </div>\n <span className=\"nw-chip\">\n {displayMode === 'fullscreen' ? 'Fullscreen' : 'Discover'}\n </span>\n </header>\n\n <div className=\"nw-carousel\">\n {options.map((entry) => (\n <article\n className={`nw-dest${entry.id === chosen ? ' nw-dest-active' : ''}`}\n key={entry.id}\n >\n <div className=\"nw-dest-head\">\n <span className=\"nw-dest-name\">{entry.name}</span>\n <span className=\"nw-price\">from ${entry.priceFrom}</span>\n </div>\n <p className=\"nw-dest-region\">\n {entry.region} · best {entry.bestMonths}\n </p>\n {/* Grounded copy: the \"why\" comes from Acme's catalog, not invented at runtime. */}\n <p className=\"nw-dest-why\">{entry.why}</p>\n <button\n aria-pressed={entry.id === chosen}\n className=\"nw-button nw-button-ghost\"\n type=\"button\"\n onClick={() => shortlistDestination(entry)}\n >\n {entry.id === chosen ? 'Shortlisted' : 'Shortlist'}\n </button>\n </article>\n ))}\n </div>\n\n <div className=\"nw-actions\">\n <button\n className=\"nw-button nw-button-primary\"\n type=\"button\"\n disabled={selected === undefined || handoff.isPending}\n onClick={continueOnAcme}\n >\n <ExternalIcon />\n {continueLabel}\n </button>\n </div>\n <p className=\"nw-note\">Booking and payment happen on acme.example — never inside chat.</p>\n </section>\n </main>\n );\n}\n\nfunction CompassIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"m15.5 8.5-2 5-5 2 2-5 5-2Z\" />\n </svg>\n );\n}\n\nfunction ExternalIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M14 4h6v6\" />\n <path d=\"m20 4-9 9\" />\n <path d=\"M20 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h5\" />\n </svg>\n );\n}\n" },
38
40
  { relPath: "examples/acme-discovery/src/views/widget-style.css", content: ":root {\n color-scheme: light dark;\n font-family:\n Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n --nw-bg: #ffffff;\n --nw-surface: #f4fbfa;\n --nw-text: #10201f;\n --nw-muted: #5b6b6a;\n --nw-border: #d4e6e4;\n --nw-accent: #0ea5a4;\n --nw-accent-strong: #0f766e;\n --nw-accent-soft: #e6faf8;\n --nw-radius: 10px;\n --nw-shadow: 0 18px 50px rgb(15 40 40 / 12%);\n}\n\n.dark,\n[data-theme=\"dark\"] {\n --nw-bg: #0b1b1b;\n --nw-surface: #102624;\n --nw-text: #eafaf8;\n --nw-muted: #9fb6b3;\n --nw-border: #244341;\n --nw-accent: #2dd4bf;\n --nw-accent-strong: #14b8a6;\n --nw-accent-soft: #0f3835;\n --nw-shadow: 0 18px 50px rgb(0 0 0 / 30%);\n}\n\n* {\n box-sizing: border-box;\n}\n\nbody {\n margin: 0;\n background: var(--nw-bg);\n color: var(--nw-text);\n}\n\nbutton {\n font: inherit;\n}\n\n.nw-shell {\n min-height: 100vh;\n padding: 14px;\n background: var(--nw-bg);\n color: var(--nw-text);\n}\n\n.nw-card {\n max-width: 720px;\n margin: 0 auto;\n background: var(--nw-surface);\n border: 1px solid var(--nw-border);\n border-radius: var(--nw-radius);\n box-shadow: var(--nw-shadow);\n overflow: hidden;\n}\n\n.nw-header {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 16px;\n border-bottom: 1px solid var(--nw-border);\n}\n\n.nw-icon svg {\n width: 26px;\n height: 26px;\n fill: none;\n stroke: var(--nw-accent);\n stroke-width: 1.7;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.nw-title-block {\n flex: 1;\n min-width: 0;\n}\n\n.nw-title {\n margin: 0;\n font-size: 17px;\n font-weight: 700;\n}\n\n.nw-subtitle {\n margin: 2px 0 0;\n font-size: 13px;\n color: var(--nw-muted);\n}\n\n.nw-chip {\n padding: 4px 10px;\n border-radius: 999px;\n background: var(--nw-accent-soft);\n color: var(--nw-accent-strong);\n font-size: 12px;\n font-weight: 600;\n}\n\n.nw-carousel {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));\n gap: 12px;\n padding: 16px;\n}\n\n.nw-dest {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 12px;\n border: 1px solid var(--nw-border);\n border-radius: 12px;\n background: var(--nw-bg);\n}\n\n.nw-dest-active {\n border-color: var(--nw-accent);\n box-shadow: 0 0 0 1px var(--nw-accent);\n}\n\n.nw-dest-head {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 8px;\n}\n\n.nw-dest-name {\n font-weight: 700;\n}\n\n.nw-price {\n color: var(--nw-accent-strong);\n font-size: 12px;\n font-weight: 600;\n}\n\n.nw-dest-region {\n margin: 0;\n font-size: 12px;\n color: var(--nw-muted);\n}\n\n.nw-dest-why {\n margin: 0;\n font-size: 13px;\n flex: 1;\n}\n\n.nw-actions {\n display: flex;\n gap: 8px;\n padding: 0 16px 12px;\n}\n\n.nw-button {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 9px 14px;\n border: 1px solid var(--nw-border);\n border-radius: 10px;\n background: var(--nw-bg);\n color: var(--nw-text);\n cursor: pointer;\n}\n\n.nw-button svg {\n width: 16px;\n height: 16px;\n fill: none;\n stroke: currentColor;\n stroke-width: 1.7;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.nw-button-ghost {\n align-self: flex-start;\n padding: 6px 12px;\n font-size: 13px;\n}\n\n.nw-button-primary {\n background: var(--nw-accent);\n border-color: var(--nw-accent);\n color: #ffffff;\n font-weight: 600;\n}\n\n.nw-button-primary:disabled {\n opacity: 0.6;\n cursor: default;\n}\n\n.nw-note {\n margin: 0;\n padding: 0 16px 16px;\n font-size: 12px;\n color: var(--nw-muted);\n}\n" },
39
- { relPath: "examples/acme-discovery/test/server.test.ts", content: "import { describe, expect, it } from 'vitest';\nimport app from '../src/server.js';\n\ndescribe('acme-discovery example', () => {\n it('exports a Noodle server definition', () => {\n expect(typeof app.toManifest).toBe('function');\n });\n\n it('declares the off-app handoff domain the deep link lands on', async () => {\n // Top-of-funnel: the only external target is Acme's booking site, declared once at the server.\n const manifest = await app.toManifest();\n expect(JSON.stringify(manifest)).toContain('https://book.acme.example');\n });\n\n it('exposes the discovery tool and the handoff tool', async () => {\n const manifest = await app.toManifest();\n const text = JSON.stringify(manifest);\n // The discovery tool renders the carousel; the handoff tool emits the deep link; the widget-only\n // helper records a shortlist.\n expect(text).toContain('discover_getaways');\n expect(text).toContain('create_handoff');\n expect(text).toContain('shortlist_getaway');\n });\n});\n" },
41
+ { relPath: "examples/acme-discovery/test/server.test.ts", content: "import { describe, expect, it } from 'vitest';\nimport app from '../src/server.js';\n\ndescribe('acme-discovery example', () => {\n it('exports a Noodle server definition', () => {\n expect(typeof app.toManifest).toBe('function');\n });\n\n it('declares the off-app handoff domain the deep link lands on', async () => {\n // Top-of-funnel: the only external target is Acme's booking site, declared once at the server.\n const manifest = await app.toManifest();\n expect(JSON.stringify(manifest)).toContain('https://book.acme.example');\n });\n\n it('exposes the discovery tool and the handoff tool', async () => {\n const manifest = await app.toManifest();\n const text = JSON.stringify(manifest);\n // The discovery tool renders the carousel; the handoff tool emits the deep link; the widget-only\n // helper records a shortlist.\n expect(text).toContain('discover_getaways');\n expect(text).toContain('create_handoff');\n expect(text).toContain('shortlist_getaway');\n });\n\n it('declares the grounded knowledge component and its live site scope', async () => {\n const manifest = (await app.toManifest()) as { server: { knowledge?: unknown[] } };\n // One declaration: controlled files plus the live public site, compiled later into the\n // generated `search_destinations` capability with citations.\n expect(manifest.server.knowledge).toHaveLength(1);\n const text = JSON.stringify(manifest);\n expect(text).toContain('knowledge/product.md');\n expect(text).toContain('https://getaways.acme.example');\n });\n});\n" },
40
42
  { relPath: "examples/acme-discovery/vitest.config.ts", content: "import { defineConfig } from 'vitest/config';\n\n// Local config so `npm test` (vitest run) discovers this example's own tests instead of inheriting a\n// parent monorepo config's include globs.\nexport default defineConfig({\n test: { include: ['test/**/*.test.ts'] },\n});\n" },
41
43
  { relPath: "examples/acme-tasks/README.md", content: "# Acme Tasks — designed around its top-3 prioritized user flows\n\nA Noodle MCP App for **Acme Tasks**, a fictional productivity tool. It is the flagship for\n**designing an app around its prioritized user flows**: a two-way (read + write) experience where the\ntop-3 flows — **Capture, Prioritize, Complete** — all happen in chat, each mapped to a tool and surfaced\nin one `TaskList` widget. It shows the \"identify and prioritize the flows first, then build\" discipline\nthe `noodle-seed` skill's `references/experience-design.md` teaches.\n\nCapability slots: prioritized multi-flow app design, a two-way (read + write) in-chat pattern, a task-list\nwidget with `tool` helpers, and a worked **design-first** artifact (the flow spec + wireframe\nbelow). A real deployment would connect the user's account with the end-user auth pattern — see\n[`../customer-auth/README.md`](../customer-auth/README.md); this example seeds a list so the focus stays\non the flows.\n\n## Design spec (write this before the code)\n\n- **What it is** — an in-chat task manager. Unlike a top-of-funnel app, there is **no handoff**: the value\n is doing the work in place (read the list, add, re-prioritize, complete).\n- **Personas** — the quick capturer (\"remind me to email the vendor\"), the morning triager (re-orders the\n day), the closer (marks things done without leaving chat).\n- **Top-3 prioritized user flows** (the heart of this example — build these, defer the rest)\n 1. **Capture** (`add_task`) — \"add: book flights for the offsite, high priority\" → task captured.\n 2. **Prioritize** (`list_today` renders the widget; `set_priority` re-orders) — triage today's list.\n 3. **Complete** (`complete_task`) — check a task off; the model can also complete on request.\n- **Tools** — `list_today` (model-visible, renders the widget), `add_task` and `complete_task`\n (model-visible), `set_priority` (widget-only helper hidden from the model).\n- **Widgets + display modes** — `TaskList` as an inline card that expands to fullscreen for a long list.\n No carousel or picture-in-picture — a single list is the right surface.\n- **Grounding** — the seeded list in `src/server.ts` stands in for the user's real list; the app never\n invents a task.\n- **Two users** — tools are atomic and model-fillable (\"high priority\" → `priority: \"high\"`), and each\n returns a spoken-ready status so the model can confirm in one turn.\n- **Cross-host confirmation** — `complete_task` keeps `confirm: true`. The server's explicit\n `interactions.confirmationFallback: 'host'` uses Noodle confirmation in capable/embedded hosts and trusts\n ChatGPT's native write approval only when the stateless transport cannot present that form. Backend\n authorization remains independent.\n\n## Wireframe (one screen: the three flows in place)\n\n```html\n<div class=\"phone\"> <!-- in-app: solid frame -->\n <div class=\"chatgpt-header\">ChatGPT · Acme Tasks</div>\n <div class=\"msg user\">what's on my list today?</div>\n <div class=\"tool-call\">list_today { focus: \"today\" }</div>\n <div class=\"wcard\">\n <div class=\"wcard-head\">TaskList</div> <!-- component name = code + spec -->\n <div class=\"wcard-body\">\n <input placeholder=\"Add a task…\" /> <!-- Flow 1: Capture -->\n <div class=\"task\">◻ Email the vendor about the Q3 quote [high ▾]</div> <!-- Flow 2 -->\n <div class=\"task\">◻ Review the analytics pull request [medium ▾]</div>\n <div class=\"task done\">✓ Book flights for the team offsite [low ▾]</div> <!-- Flow 3 -->\n </div>\n </div>\n</div>\n```\n\n## Local author loop\n\n```sh\nnoodle validate\nnoodle test\nnoodle dev\n```\n\nIn another terminal:\n\n```sh\nnoodle tools list\nnoodle tools call list_today --args '{\"focus\":\"today\"}'\nnoodle tools call add_task --args '{\"title\":\"Book flights for the offsite\",\"priority\":\"high\"}'\nnoodle tools call complete_task --args '{\"task\":\"review_pr\",\"title\":\"Review the analytics pull request\"}'\nnoodle check --target chatgpt\n```\n\n## Product agent guide\n\n[`src/agent-guide.ts`](src/agent-guide.ts) expresses the same three prioritized workflows as one host-neutral\n`agentGuide`. It supplies product judgment such as grounding and confirmation while the compiler derives\ncapability schemas, annotations, visibility, and widget relationships from `server.ts`. The guide does not\nweaken `complete_task` confirmation or make the app-only `set_priority` tool model-visible.\n\nPreview the generated Codex and Claude Code product skills before installing them:\n\n```sh\nnoodle agents setup --json\nnoodle agents setup --write\n```\n\nAfter changing a workflow or capability, regeneration is explicit so a normal Noodle workflow-skill update\ncannot overwrite the app product skill or local modifications:\n\n```sh\nnoodle agents setup --regenerate-app-skill --json\nnoodle agents setup --write --regenerate-app-skill\nnoodle agents doctor --json\n```\n\n## Deploy\n\n```sh\nnoodle link --org demo --app acme-tasks\nnoodle deploy --access owner-only\nnoodle open\n```\n\n## Optional in-product assistant\n\nThe default SaaS and widget scaffolds are credential-free. When the product deliberately includes an\nassistant, use the existing server tools and add an `assistant` option to the same `server.ts` instead of\ncreating a second entrypoint or tool set:\n\n```ts\nassistant: embeddedAssistant({\n model: openAICompatible({\n baseUrl: variable('ASSISTANT_MODEL_BASE_URL'),\n model: variable('ASSISTANT_MODEL'),\n apiKey: secret('ASSISTANT_MODEL_API_KEY'),\n }),\n allowedOrigins: ['https://tasks.example.com'],\n layout: { mode: 'floating', position: 'bottom-right' },\n labels: { welcomeHeading: 'How can I help with Acme Tasks?' },\n}),\n```\n\nThe assistant automatically inherits this server's existing `branding` block, so its name, accent,\nlight/dark surfaces, density, and radius match the `TaskList` widget without a second brand declaration.\n\nEvery assistant origin is exact and HTTPS-only. If the customer web app needs local browser testing, it\nmust serve itself over development HTTPS and add its `https://localhost:<port>` origin; `noodle dev` does\nnot provide TLS for that separate SaaS app.\n\nThe customer backend exchanges its authenticated user through `@noodleseed/assistant/server`; the browser\nuses the Web Component or React wrapper and never receives the embed client or model secret. Validate with\n`noodle check --target embedded-assistant`, then create the backend credential with\n`noodle assistant clients create` after deployment. Model URL/name/key values stay in Noodle managed config;\nonly the Noodle service URL and assistant client ID/secret belong in the authenticated customer backend.\n\nInstall the independently versioned embed SDK with the customer web application's existing package manager;\ndo not introduce a second lockfile.\n\nThis example has no connector secrets and does not include tokens, caller-key mechanisms, or\n`.env.noodle` values. All tasks are fictional seed data.\n" },
42
44
  { relPath: "examples/acme-tasks/design/UX-Document.md", content: "# Acme Tasks ChatGPT App — User Flow & Experience Document\n\n**Prepared by:** Noodle Seed\n**Scope:** Capture, prioritize, and complete today's tasks entirely inside ChatGPT — a two-way (read + write) task manager. There is no handoff; the value is doing the work in place.\n**Status:** Design specification (v1)\n**Two-way scope & auth stance:** IN-APP (in chat) — read today's list, capture new tasks, re-prioritize, and complete them, each write confirmed in-chat. OFF-APP — nothing transactional; the only boundary crossing is a **one-time scoped account connection** (`customerAuth` end-user OAuth: read + write, connected once). Every scope debate resolves here: if a request is \"see, add, re-order, or finish a task,\" it stays in chat; the account link is the single, revocable off-app moment.\n\n> This document is the master spec. The wireframes (`wireframe.html`), the widget code (`src/views/task-list.tsx`), and the server (`src/server.ts`) are all derivable from it. Acme Tasks is a fictional productivity app; all data below is sample content.\n\n---\n\n## Section 0 — The One-Paragraph Thesis\n\nA person mid-conversation in ChatGPT says *\"remind me to email the vendor about the Q3 quote\"* — and today that intent evaporates, because acting on it means leaving the conversation for a separate app. Acme Tasks closes that gap: the moment a task is spoken it is **captured, prioritized, and completed without ever leaving chat**. This is deliberately **not** a top-of-funnel handoff app — there is no cart to check out, no site to open, no \"continue in the app.\" The task manager *is* the conversation. We own the in-chat experience end to end (read the live list, add by natural language, re-prioritize, complete); the user owns their account, connected once through a scoped, revocable link. The strategic kicker: a to-do app is the highest-frequency surface a person touches, and the app that lets them clear their list *in the same window where the work is being discussed* becomes the one they never close. **In-chat completion is the product.**\n\n---\n\n## 1. Acme Tasks Product Overview (Knowledge Base)\n\n**What the company is.** Acme Tasks is a personal + small-team task manager: a single prioritized list per user, each task carrying a **title**, a **priority** (`high` / `medium` / `low`), and a **done** state. It is intentionally minimal — no projects, no assignees, no sub-tasks in v1 — so the model can reason about the whole list in one turn.\n\n**The data domain the app must know.** The user's *today* list. In this flagship the list is **seeded** so the design can focus on the flows; the three seed items are the canonical fixtures every downstream artifact reuses:\n\n| id | title | priority |\n| :--- | :--- | :--- |\n| `email_vendor` | Email the vendor about the Q3 quote | `high` |\n| `review_pr` | Review the analytics pull request | `medium` |\n| `book_offsite` | Book flights for the team offsite | `low` |\n\n**The highest-value / highest-risk domain** is the account write. Because the app can *complete* and *re-prioritize* real tasks, every mutation must be legible and confirmed — a silently-checked-off task is the worst possible failure.\n\n**What lives after any boundary crossing.** Nothing transactional. Unlike a discovery funnel, Acme Tasks has no off-app destination it hands users to; the only off-app step is the one-time `customerAuth` consent screen (§9). After that, everything is in chat.\n\n**Business model / why this matters.** Frequency and retention. A task app is opened many times a day; the version that removes the app-switch tax — \"I thought of it, I said it, it's on my list, it's done\" — wins the habit. The bottleneck the app removes is **context-switching**, not data entry.\n\n---\n\n## 2. Competitive Landscape — Task Managers on ChatGPT\n\nMost task integrations on assistant platforms are **read-only or one-way**: they can list what's due but push the user to a separate app to actually change anything, or they capture a task into a black box with no confirmation. The generic model can *talk about* a to-do list but has no grounded state — it will happily invent tasks that don't exist.\n\n**Acme Tasks' unique position** is the *closed two-way loop in one surface*: a grounded read (the real list, never guessed), natural-language writes (capture, re-prioritize, complete), and an in-chat confirmation for every mutation. The differentiator is not the widget — it is that the widget's actions **commit** and the user **sees what changed** without a tab switch.\n\n---\n\n## 3. Target User Personas\n\n- **The Quick Capturer** — *\"add: book flights for the offsite, low priority.\"* Thinks of a task mid-conversation and wants it on the list before the thought is gone. Values zero-friction capture.\n- **The Morning Triager** — *\"what's on my plate today?\"* Opens the day, scans the list, and re-orders priorities before starting. Values a fast, grounded read plus one-tap re-prioritize.\n- **The Closer** — *\"mark the vendor email done.\"* Finishes work and wants the satisfaction of checking it off without leaving the thread. Values instant, confirmed completion.\n\nAll three are the **same user at different moments of the day** — capture in the morning stand-up, triage before lunch, close out at end of day. The app is designed so one connected session serves all three.\n\n---\n\n## 4. Conversational User Flow\n\n### 4.1 Entry points (natural triggers)\n\n- **Capture:** \"remind me to…\", \"add a task…\", \"put X on my list\", \"I need to email the vendor.\"\n- **Prioritize / read:** \"what's on my list today?\", \"what's due?\", \"show my tasks\", \"make the PR review high priority.\"\n- **Complete:** \"mark X done\", \"I finished the vendor email\", \"check off the offsite booking.\"\n\n### 4.2 Flow architecture\n\n```\n ┌─────────────────────────────┐\n first run ─────────▶│ Connect Acme Tasks (once) │ §9 · customerAuth, scoped R/W\n └──────────────┬──────────────┘\n │ connection live thereafter\n ┌─────────────────────────────┼─────────────────────────────┐\n ▼ ▼ ▼\n ① CAPTURE ② PRIORITIZE ③ COMPLETE\n add_task list_today → TaskList complete_task\n \"add X, high\" (render widget) \"mark X done\"\n │ set_priority (in widget) │\n └──────────────▶ TaskList reflects the change ◀───────────┘\n (grounded read, always current)\n```\n\n`list_today` is the hub — it renders the `TaskList` widget the other two flows write into. Every flow returns a spoken-ready status so the model confirms in one turn.\n\n### 4.3 Detailed conversational scenarios (playscripts)\n\n**Scenario A — Capture (The Quick Capturer)**\n\n```\nUser: Add \"book flights for the team offsite\", low priority.\nTool call: add_task { title: \"Book flights for the team offsite\", priority: \"low\" }\nReturns: { status: \"Added “Book flights for the team offsite” (low).\", title, priority }\nAssistant: Added \"Book flights for the team offsite\" at low priority. Want to see the full list?\n```\n\n**Scenario B — Prioritize / read + re-order (The Morning Triager)**\n\n```\nUser: What's on my plate today?\nTool call: list_today { focus: \"today\" } ← renders TaskList widget\nReturns: { status: \"Acme Tasks for today: 3 open items, highest priority first.\", focus, tasks:[…] }\nWidget: TaskList — Email the vendor (high) · Review the analytics PR (medium) · Book offsite (low)\n\nUser: Bump the PR review to high.\nTool call: set_priority { task: \"review_pr\", priority: \"high\" } ← widget-only helper\nReturns: { status: \"Set review_pr to high priority.\", task, priority }\nWidget: TaskList re-orders — Review the analytics PR now sits with the high group.\n```\n\n**Scenario C — Complete (The Closer)**\n\n```\nUser: I finished the vendor email — mark it done.\nTool call: complete_task { task: \"email_vendor\", title: \"Email the vendor about the Q3 quote\" }\nReturns: { status: \"Completed “Email the vendor about the Q3 quote”.\", task }\nWidget: TaskList strikes the row through; open count drops from 3 → 2.\nAssistant: Done — \"Email the vendor about the Q3 quote\" is checked off. Two left today.\n```\n\n---\n\n## 5. UI Widget Specifications (Noodle Seed Apps Compliant)\n\n### 5.1 Design system compliance\n\nWidgets render inside the host (ChatGPT) via Noodle Seed's `view` component model and **CSS Cascade Layers**, so they inherit the host's light/dark surface and typography rather than shipping an app theme. Compliance rules, all enforceable via `noodle check --target chatgpt`:\n\n- **Tokens, not hard-coded chrome.** Text, surface, and border come from host/Noodle Seed semantic tokens. The **brand accent is declared once** in the server `branding` block — `accent: #7C3AED`, `surface: #F5F3FF`, `surfaceDark: #161228`, `radius: lg`, `density: comfortable` — and is restricted to the **primary CTA, the logo/check mark, and the \"high\" priority emphasis only**. It is never a background wash.\n- **Priority palette (semantic, fixed):** `high` = red `#DC2626`, `medium` = amber `#D97706`, `low` = slate `#6B7280`. These map 1:1 to the `priority` enum so the widget and the model share one vocabulary.\n- **System fonts, outlined monochrome icons, WCAG AA contrast, no nested scroll**, and every mutation shows a confirmable result. The widget exposes a single flat `data-llm` summary line (\"N open of M; K completed this session\") so the model can narrate state without re-reading the DOM.\n\n### 5.2 Display mode strategy\n\n| User intent | Display mode | Why |\n| :--- | :--- | :--- |\n| \"What's on my list?\" | **Inline card** | The whole list fits; the answer is the list. |\n| Triage a long list | **Fullscreen** (expand) | Density without nested scroll when items exceed the card. |\n| Capture / complete / re-prioritize | **Inline card (in place)** | The write updates the same card; no new surface. |\n\n**Deliberately NOT used:** *Carousel* (there is one list, not a set of peers) and *Picture-in-Picture* (nothing runs in the background). Stating the omissions is part of the compliance story.\n\n### 5.3 Widget specifications\n\n**★ `TaskList`** — the single widget; the hub all three flows read and write.\n- **Purpose:** show today's prioritized list and let the user capture, re-prioritize, and complete in place.\n- **Content fields:** header (logo, \"Acme Tasks\", status subtitle, open-count chip); a **capture input** (\"Add a task…\"); a **task row** per item = complete check + title + priority `<select>`; a footer note (\"Two-way in chat: read, capture, re-prioritize, complete\").\n- **Actions (≤2 primary):** **Add** (capture) and the per-row **complete check**; re-prioritize is a lightweight inline `<select>`, not a primary CTA.\n- **States:** *default* (seeded list), *captured* (new row appears immediately, then `add_task` records it), *re-prioritized* (row moves priority group), *completed* (row struck through, check filled, count decremented), *all-clear* (empty-state celebration + nudge to capture the next thing).\n- **Grounding flag:** the list only ever shows tasks that exist in state — the app never invents a task.\n\n---\n\n## 6. Tool Definitions (App Backend)\n\nAll tools are atomic, model-fillable from natural language, and each returns a spoken-ready `status`.\n\n**★ `list_today`** *(read-only · renders `TaskList`)*\n- **Input:** `{ focus: string = \"today\" }`\n- **Output:** `{ status, focus, tasks: [{ id, title, priority, done }] }`\n- **Notes:** `tool` — the one tool that opens the widget. Host status copy: invoking \"Loading your tasks…\", invoked \"Tasks ready\".\n\n**★ `add_task`** *(local write, non-destructive · model-visible)*\n- **Input:** `{ title: string, priority: \"high\"|\"medium\"|\"low\" = \"medium\" }`\n- **Output:** `{ status, title, priority }`\n- **Notes:** capture from natural language; \"high priority\" fills `priority: \"high\"`.\n\n**`complete_task`** *(local write, non-destructive · model-visible)*\n- **Input:** `{ task: string (id), title: string = \"\" }`\n- **Output:** `{ status, task }`\n- **Notes:** model-visible so the user can complete by voice (\"mark the vendor email done\") without touching the widget.\n\n**`set_priority`** *(local write, non-destructive · widget-only)*\n- **Input:** `{ task: string (id), priority: \"high\"|\"medium\"|\"low\" }`\n- **Output:** `{ status, task, priority }`\n- **Notes:** `tool` — hidden from the model; the `<select>` in `TaskList` is its only caller, keeping the model's tool surface to the three it should reason about.\n\n---\n\n## 7. Conversation Design Principles\n\n**Tone.** Brisk, confirming, never chatty. A task app earns trust by getting out of the way; every reply names *what changed* and offers the obvious next move.\n\n**Guardrails (non-negotiable):**\n- **Never invent a task.** The list is grounded in `list_today`'s returned state; if the app hasn't read a list, it says so rather than guessing.\n- **Never mutate silently.** Capture, re-prioritize, and complete each return a visible confirmation and update the widget — the user always sees the new state.\n- **Confirm completion explicitly.** \"Done — *X* is checked off\" plus the remaining count; completion is irreversible-feeling, so it is always narrated.\n- **Priority is the user's, not the model's.** The model may *suggest* a priority when capturing (\"this sounds high?\") but sets what the user says; it does not silently re-rank the list.\n\n**Memory strategy.** Session-scoped: captured tasks and completions persist across turns within the conversation (`added`/`done`/`priority` state layered over the seeded read). A production deployment persists to the connected account (§9).\n\n**Multi-turn intelligence.** The model **infers** structured fields from prose (\"book flights for the offsite, low\" → title + `priority: low`) and **asks** only when a title is genuinely missing. It never asks the user to restate a task it can already see in `TaskList`.\n\n---\n\n## 8. End-to-End User Journey Map\n\n| Phase | Time budget | What happens |\n| :--- | :--- | :--- |\n| **First run — Connect** | one-time, ~10s | Scoped `customerAuth` consent (read + write); dismissed forever after (§9). |\n| **Read (grounded)** | first 3–5s | \"What's on my plate?\" → `list_today` renders `TaskList` with the real list. |\n| **Capture** | ~2s per task | \"Add X, high\" → row appears instantly, `add_task` records it. |\n| **Prioritize** | ~2s per change | Inline `<select>` or \"bump the PR to high\" → `set_priority`, list re-orders. |\n| **Complete** | ~2s per task | Check the row or \"mark X done\" → `complete_task`, struck through, count drops. |\n| **Close-out** | end of day | All-clear empty state; nudge to capture tomorrow's first task. |\n\n---\n\n## 9. Account-Connection / Auth Architecture (Deep Dive)\n\nBecause Acme Tasks **writes** to the user's tasks, the first interaction is a **scoped, one-time connection** — Noodle Seed's `customerAuth` end-user OAuth pattern (see the `customer-auth` example). This replaces the \"handoff\" a top-of-funnel app would have: there is no destination to send the user to, only an account to link.\n\n**What must be true of the connection:**\n- **Plain-language scope.** The consent card names *read* (your tasks and priorities) and *write* (add, re-prioritize, complete tasks you ask me to) in the user's words — not buried in an OAuth redirect.\n- **Held by the connector, never the model.** The delegated credential is exchanged and stored by the credential broker; it is never surfaced in tool payloads, the widget, logs, or the model's context.\n- **Connected once, revocable anytime.** One connection powers all three flows; the consent card links the revoke path.\n- **The request resumes automatically.** After the user approves, the original ask (\"what's on my plate?\") continues without re-typing.\n\n**Flagship simplification (honest note):** this example ships with a **seeded** `today` list rather than a live account, so the design can stay focused on the three flows. The connect screen is wireframed as step 1 because it is the production pattern; the seed list stands in for the connected account's read. A real deployment swaps the seed for `customerAuth`-brokered account reads/writes — the tool signatures and widget do not change.\n\n**Edge cases at the boundary:** connection declined (app degrades to a read-only explanation, no writes attempted); token revoked mid-session (next write returns a re-connect prompt, never a silent failure); scope mismatch (write attempted without write scope → explicit \"reconnect to allow changes\").\n\n---\n\n## 10. Demo Scope Recommendation\n\n**MVP (build these, defer the rest):** the three flows against the seeded list, in one `TaskList` widget — Capture (`add_task`), Prioritize (`list_today` + `set_priority`), Complete (`complete_task`).\n\n**2-minute demo script:**\n1. **0:00** — \"What's on my plate today?\" → `TaskList` renders the three seed tasks, highest priority first. *(grounded read)*\n2. **0:25** — \"Add 'draft the board update', high priority.\" → new row appears at the top instantly. *(capture)*\n3. **0:50** — Open the PR review's priority `<select>`, set **high** → list re-orders. *(prioritize, in-widget)*\n4. **1:15** — \"I finished the vendor email — mark it done.\" → row strikes through, count 4 → 3. *(complete by voice)*\n5. **1:40** — Check the last row in the widget → all-clear empty state + \"capture tomorrow's first task?\" *(close the loop)*\n\n---\n\n## 11. Technical Architecture (High Level)\n\n- **Server:** one `server('acme_tasks', …)` in `src/server.ts` (Noodle Seed authoring SDK), four tools, `branding` tokens, per-tool CSP allowlist.\n- **Widget:** `TaskList` (`src/views/task-list.tsx`), a React `view` using `useCallTool` / `useToolInfo` / `useLayout` / `useViewState`; local session state (`added` / `done` / `priority`) layered over the `list_today` read, each change recorded through a tool call.\n- **State:** session-scoped in the flagship (seed list + local overlay). Production: `customerAuth`-brokered reads/writes to the account.\n- **Validation loop:** `noodle validate` → `noodle test` → `noodle dev`; compliance via `noodle check --target chatgpt`.\n\n---\n\n## 12. Success Metrics\n\n| Metric | Maps to |\n| :--- | :--- |\n| **Connect completion rate** | % of first-runs that finish the `customerAuth` consent (§9). |\n| **In-chat write rate** | writes (`add_task` + `set_priority` + `complete_task`) per session — the core \"work done in chat\" signal. |\n| **Capture-to-list latency** | time from utterance to the row appearing in `TaskList` (target < 1s optimistic). |\n| **Completion rate** | % of read sessions that end with at least one `complete_task` — the retention-driving \"closed the loop\" event. |\n| **Return frequency** | sessions per user per day — the habit metric a task app lives or dies on. |\n\n**Attribution:** each tool call carries the connected account identity (server identity + tenant), so writes are traceable to the session without exposing the credential.\n\n---\n\n## 13. Future Enhancements (Post-Launch)\n\n- **Live account** via `customerAuth` replacing the seed list (the natural first step out of the flagship).\n- **Due dates & scheduling** (\"email the vendor by Friday\") once the model can be trusted to parse relative dates.\n- **Bulk triage** (\"move everything low to tomorrow\") — a batched, previewed, reversible write.\n- **Projects / grouping** beyond a single flat list, once the single-list flows are proven.\n- **Undo** as a first-class in-chat verb for every write.\n\n---\n\n## Appendix — Two-Way Scope Cheat-Sheet\n\n| User request | In chat (in-app) | Off-app |\n| :--- | :---: | :---: |\n| \"What's on my list?\" | ✓ `list_today` → `TaskList` | — |\n| \"Add a task…\" | ✓ `add_task` | — |\n| \"Make X high priority\" | ✓ `set_priority` | — |\n| \"Mark X done\" | ✓ `complete_task` | — |\n| First-run account link | — | ✓ `customerAuth` consent (once, scoped, revocable) |\n| Anything transactional | — | *(none — the app has no transactional off-app step)* |\n" },
@@ -55,18 +57,18 @@ export const BUNDLED_EXAMPLE_FILES = [
55
57
  { relPath: "examples/customer-auth/package.json", content: "{\n \"name\": \"customer-auth\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"test\": \"vitest run\",\n \"validate\": \"noodle validate\",\n \"dev\": \"noodle dev\",\n \"deploy\": \"noodle deploy\"\n },\n \"devDependencies\": {\n \"@noodleseed/one\": \"latest\",\n \"vitest\": \"latest\"\n }\n}\n" },
56
58
  { relPath: "examples/customer-auth/src/server.ts", content: "import {\n annotations,\n authenticatedWebsite,\n connector,\n customerAuth,\n customerEndpoint,\n embeddedAssistant,\n openAICompatible,\n secret,\n server,\n tool,\n variable,\n z,\n} from '@noodleseed/one';\n\nconst customerApi = customerEndpoint('customer_api', {\n allowedHttpsHostSuffixes: ['api.noodleseed.dev'],\n});\n\nconst noodleseedApi = connector('noodleseed_app_api')\n .version('1.0.0')\n .http({\n baseUrl: customerApi,\n auth: {\n kind: 'delegatedTokenExchange',\n tokenUrl: 'https://id.noodleseed.dev/oauth/token',\n clientId: variable('CUSTOMER_API_CLIENT_ID'),\n clientSecret: secret('CUSTOMER_API_CLIENT_SECRET'),\n scopes: ['organizations:read', 'org_apps:read', 'org_apps:write'],\n audience: 'noodleseed-customer-api',\n },\n operations: {\n list_org_apps: {\n type: 'read',\n method: 'GET',\n path: '/api/organizations/${args.org_id}/apps',\n query: ['skip', 'limit'],\n input: z.object({\n org_id: z.string(),\n skip: z.number().optional(),\n limit: z.number().optional(),\n }),\n output: z.object({ result: z.unknown().optional() }),\n response: {\n result: '${response}',\n },\n },\n list_organizations: {\n type: 'read',\n method: 'GET',\n path: '/api/organizations',\n output: z.object({ organizations: z.array(z.unknown()).optional() }),\n response: {\n organizations: '${response.organizations}',\n },\n },\n archive_org_app: {\n type: 'action',\n method: 'POST',\n path: '/api/organizations/${args.org_id}/apps/${args.app_id}/archive',\n input: z.object({\n org_id: z.string(),\n app_id: z.string(),\n }),\n output: z.object({ archived: z.boolean() }),\n response: {\n archived: '${response.archived}',\n },\n },\n },\n });\n\nexport default server(\n 'noodleseed_customer_auth',\n {\n title: 'NoodleSeed.com Customer Auth',\n version: '1.0.0',\n branding: {\n name: 'Noodle Seed Assistant',\n accent: '#E85D24',\n surface: '#FFFFFF',\n surfaceDark: '#171310',\n colorScheme: 'auto',\n theme: {\n light: { accentText: '#FFFFFF', text: '#1C1714' },\n dark: { accent: '#FF8A4C', accentText: '#1C100A', text: '#FFF8F2' },\n },\n },\n use: { app_api: noodleseedApi },\n interactions: { confirmationFallback: 'host' },\n auth: customerAuth.oidc({\n issuer: 'https://id.noodleseed.dev',\n audience: 'noodleseed-customer-auth-prod',\n claims: {\n id: 'sub',\n email: 'email',\n name: 'name',\n orgs: 'permissions.orgs',\n roles: 'permissions.roles',\n scopes: 'permissions.scopes',\n },\n routing: {\n endpoints: {\n customer_api: { claim: 'tenant.api_base_url' },\n },\n },\n }),\n instructions:\n 'Direct/federated MCP OIDC demo. The customer IdP proves identity and privately selects the tenant API base URL, while the broker supplies delegated credentials and confirmed actions stay bound to the reviewed route.',\n assistant: embeddedAssistant({\n model: openAICompatible({\n baseUrl: variable('ASSISTANT_MODEL_BASE_URL'),\n model: variable('ASSISTANT_MODEL'),\n apiKey: secret('ASSISTANT_MODEL_API_KEY'),\n }),\n // Production origins are exact HTTPS; http://localhost:<port> is allowed for local development.\n access: authenticatedWebsite({\n origins: [\n 'https://app.noodleseed.com',\n 'https://dev.noodleseed.com',\n 'http://localhost:3000',\n ],\n }),\n layout: { mode: 'floating', position: 'bottom-right', panelWidth: 420 },\n labels: {\n welcomeHeading: 'How can I help with Noodle Seed?',\n composerPlaceholder: 'Ask about your apps…',\n },\n presentation: {\n panel: { surface: 'glass', elevation: 'soft', border: 'subtle' },\n launcher: { icon: 'brand-mark', status: 'session', effect: 'pulse' },\n header: {\n mark: 'status',\n badge: { text: 'Workspace online', tone: 'success', indicator: true },\n },\n composer: { leadingIcon: 'brand-mark', shape: 'pill' },\n },\n suggestedPrompts: ['Explain how to connect this customer-authenticated MCP server'],\n }),\n },\n [\n tool('list_org_apps', {\n title: 'List organization apps',\n description: 'List NoodleSeed.com apps for an organization from its customer API.',\n authorization: {\n requiredScopes: ['org_apps:read'],\n allowedRoles: ['org_admin', 'org_member'],\n },\n input: z.object({\n org_id: z.string().meta({ title: 'Organization' }),\n skip: z.number().int().min(0).optional().meta({ title: 'Starting item' }),\n limit: z.number().int().min(1).max(100).optional().meta({ title: 'Maximum results' }),\n }),\n output: z.object({\n result: z.unknown(),\n }),\n annotations: annotations.readOnly(),\n fulfil({ input, connectors }) {\n const apps = connectors.app_api.listOrgApps({\n org_id: input.org_id,\n skip: input.skip,\n limit: input.limit,\n });\n return {\n result: apps.result,\n };\n },\n }),\n tool('list_my_organizations', {\n title: 'List my organizations',\n description: 'List the NoodleSeed.com organizations the signed-in customer belongs to.',\n contextProvider: true,\n input: z.object({}),\n // The customer API returns every organization for the signed-in customer in one response, with no\n // page parameter to pass through, so the bound is declared on the shape. A customer belongs to a\n // handful of organizations; `noodle check` reports an unbounded list as\n // `tool_design_output_bounds`.\n output: z.object({\n organizations: z.array(z.unknown()).max(100),\n }),\n annotations: annotations.readOnly(),\n fulfil({ connectors }) {\n const organizations = connectors.app_api.listOrganizations();\n return {\n organizations: organizations.organizations,\n };\n },\n }),\n tool('archive_org_app', {\n title: 'Archive organization app',\n description: 'Archive one NoodleSeed.com app through its customer API after confirmation.',\n authorization: {\n requiredScopes: ['org_apps:write'],\n allowedRoles: ['org_admin'],\n },\n input: z.object({\n org_id: z.string().meta({ title: 'Organization' }),\n app_id: z.string().meta({ title: 'App' }),\n }),\n output: z.object({\n archived: z.boolean(),\n }),\n annotations: annotations.openAction({ destructive: false, confirm: true }),\n fulfil({ input, connectors }) {\n const result = connectors.app_api.archiveOrgApp({\n org_id: input.org_id,\n app_id: input.app_id,\n });\n return {\n archived: result.archived,\n };\n },\n }),\n ],\n);\n" },
57
59
  { relPath: "examples/customer-auth/test/server.test.ts", content: "import { describe, expect, it } from 'vitest';\nimport app from '../src/server.js';\n\ndescribe('customer-auth example', () => {\n it('exports a customer-authenticated, customer-branded embedded assistant', async () => {\n expect(typeof app.toManifest).toBe('function');\n const manifest = await app.toManifest();\n expect(manifest.server.assistant).toMatchObject({\n model: { kind: 'openai-compatible', apiKey: 'ASSISTANT_MODEL_API_KEY' },\n layout: { mode: 'floating' },\n presentation: {\n panel: { surface: 'glass', elevation: 'soft', border: 'subtle' },\n launcher: { icon: 'brand-mark', status: 'session', effect: 'pulse' },\n header: { mark: 'status', badge: { text: 'Workspace online', tone: 'success' } },\n },\n });\n expect(\n manifest.server.assistant?.allowedOrigins.every(\n (origin) => origin.startsWith('https://') || origin.startsWith('http://localhost:'),\n ),\n ).toBe(true);\n expect(manifest.server.branding).toMatchObject({\n name: 'Noodle Seed Assistant',\n colorScheme: 'auto',\n });\n expect(manifest.server.auth).toEqual({\n kind: 'oidc',\n issuer: 'https://id.noodleseed.dev',\n audience: 'noodleseed-customer-auth-prod',\n claims: {\n id: 'sub',\n email: 'email',\n name: 'name',\n orgs: 'permissions.orgs',\n roles: 'permissions.roles',\n scopes: 'permissions.scopes',\n },\n routing: {\n endpoints: {\n customer_api: { claim: 'tenant.api_base_url' },\n },\n },\n });\n expect(manifest.server.interactions).toEqual({ confirmationFallback: 'host' });\n const catalog = app.toConnectorCatalog();\n expect(catalog?.connectors).toHaveLength(1);\n expect(catalog?.connectors[0]?.http).toMatchObject({\n baseUrl: {\n kind: 'customerEndpoint',\n name: 'customer_api',\n policy: { allowedHttpsHostSuffixes: ['api.noodleseed.dev'] },\n },\n auth: {\n kind: 'delegatedTokenExchange',\n tokenUrl: 'https://id.noodleseed.dev/oauth/token',\n clientId: '${env.CUSTOMER_API_CLIENT_ID}',\n clientSecret: 'CUSTOMER_API_CLIENT_SECRET',\n },\n });\n expect(catalog?.connectors[0]?.operations).toMatchObject({\n list_org_apps: { type: 'read' },\n list_organizations: { type: 'read' },\n archive_org_app: { type: 'action', method: 'POST' },\n });\n expect(catalog?.connectors[0]?.http).not.toHaveProperty('allowedOrigins');\n expect(JSON.stringify({ manifest, catalog })).not.toContain('tenant-a.api.noodleseed.dev');\n expect(manifest.tools.find((tool) => tool.name === 'list_org_apps')?.authorization).toEqual({\n requiredScopes: ['org_apps:read'],\n allowedRoles: ['org_admin', 'org_member'],\n });\n expect(\n manifest.tools.find((tool) => tool.name === 'list_my_organizations')?.authorization,\n ).toBeUndefined();\n expect(manifest.tools.find((tool) => tool.name === 'archive_org_app')).toMatchObject({\n authorization: {\n requiredScopes: ['org_apps:write'],\n allowedRoles: ['org_admin'],\n },\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n openWorldHint: true,\n confirm: true,\n },\n });\n });\n});\n" },
58
- { relPath: "examples/food-ordering/README.md", content: "# Food Ordering\n\n**Owns:** The flagship consumer ordering MCP App example: React view authoring, app-only helper tools,\ncaller-scoped cart state handles, invocation context, model-visible widget state/lifecycle, packaged image\nassets, portable structured elicitation, checkout handoff policy, host actions, CSP/permissions metadata,\nproduct-agent guidance, host-neutral distribution metadata, and widget preview coverage.\n\nFood Ordering is a generic, synthetic version of a live marketplace ordering app. It lets a user search\nstores, browse menus, customize an item, build a multi-line cart, review the order, and hand off checkout to\nan allowlisted example domain. It does not use real restaurant APIs, real checkout, customer credentials, or\nprivate customer data.\n\n## What It Shows\n\n| Capability | Example |\n| :--- | :--- |\n| Public entry tool | `open_ordering` returns structured fallback content and renders the React widget |\n| Product and distribution projections | `agentGuide` supplies grounded cross-capability guidance; `distribution` supplies listing, publisher, legal, image, and review facts separately from the runtime manifest |\n| App-only helper tools | `search_stores`, `load_menu`, `load_item`, `read_cart`, `sync_cart`, `prepare_checkout`; mutating widget-owned helpers use `confirm: false` (equivalent to omission) and execute directly because action hints alone never gate |\n| Durable cart state | `server(..., { state: { handles: { cart } }, use: { state } })` with caller scope and revision checks |\n| React app runtime kit | `@noodleseed/one/react` supplies app flow, shell/nav/view, async state, form, quantity, choice, and handoff primitives |\n| Multi-step widget flow | One React shell navigates stores, menu, item customization, cart, review, and handoff views through `useAppFlow` |\n| Invocation context | `server.context` sets locale/time-zone defaults, derives an ambient service area/date, and makes the same snapshot available to tools and the reserved `noodle_context` MCP adapter |\n| Structured missing input | `plan_order` uses `ctx.elicit` to collect a fulfilment method and date through embedded/headless forms, standard bidirectional elicitation, a linked MCP App form, or an exact structured conversational retry on stateless hosts |\n| Model-visible widget state | `useUpdateModelContext` publishes one cohesive replacement snapshot when supported; `useWidgetLifecycle` auto-publishes mounted/cancelled/dismissed and reports author-owned submitted milestones for future context (not host-presentation proof), while the user-triggered submit pairs `useSendFollowUpMessage` for an immediate reply |\n| Handoff | `handoff.allowedDomains` allows only `https://orders.example.com` checkout URLs |\n| Progressive enhancement | Non-Apps hosts still receive stores, featured items, and a readable fallback summary |\n| Fail-closed hydration | The React view treats only the unhydrated, pre-result `{}` envelope as pending; a hydrated empty success remains distinct. It surfaces `isError`, validates required records and identifiers, and withholds ordering actions from malformed results |\n\nThe example is intentionally richer than the generated starter, but each inline view still follows the\nsame default: one immediate purpose, one primary action, at most one subordinate action, and progressive\ndisclosure for the rest. Preview it at 280px before adding navigation or local CSS; loading, empty, stale,\nerror/retry, and success states must remain readable without nested vertical scrolling.\n\nLike the comprehensive default `noodle init my-app` scaffold, this flagship keeps the server feature-rich\nwhile making each individual widget view focused; server capability breadth and screen density are separate.\nThe compiled initial widget should normally remain under the 1 MiB performance recommendation; Noodle Seed's\nhard ceilings are 10 MiB per compiled widget and 20 MiB across one deployment. Run `noodle check` to see raw\nand gzip-estimated sizes. Deploy requests are gzip-compressed as one stream so repeated self-contained React\nruntime bytes deduplicate on the wire without a cross-tenant CDN. Keep menu images or large live datasets in assets/resources and app-only tools\nrather than embedding them into the initial HTML bundle.\n\n## Local Author Loop\n\n```sh\nnoodle validate\nnoodle test\nnoodle dev\n```\n\nThe same `server.ts` declares `distribution` metadata for host adapters. It references real packaged images\nand keeps listing copy, support/legal URLs, and positive/negative review scenarios outside the canonical App\nPackage and Runtime Artifact. The OpenAI adapter can now project those facts and the generated product skill\ninto separate local-testing or public-submission archives. A Claude package remains a separate adapter.\n\nIn another terminal:\n\n```sh\nnoodle tools list\nnoodle tools call open_ordering --args '{\"customer\":\"Asha\",\"query\":\"noodles\"}'\nnoodle tools call summarize_ordering_options --args '{}'\n```\n\nWhen a developer finalizes visual feedback in the local Design experience, a coding agent can inspect the\nlatest project-local brief without a path or session id:\n\n```sh\nnoodle design inspect --latest --json\n```\n\nThe agent should locate the captured elements in this example's authored React source, preserve the listed\nbehavior and accessibility constraints, and verify every acceptance check before changing unrelated UI.\n\nFor Apps metadata conformance, start `noodle dev`, copy the loopback MCP endpoint, then run:\n\n```sh\nnpx @mcpjam/cli@latest apps conformance --url http://127.0.0.1:<port>/o/demo/food-ordering/mcp --quiet --format json\n```\n\n## Export an OpenAI plugin\n\nThis flagship includes the guided workflows, listing metadata, review cases, and image assets needed to test\nOpenAI export. See the public [product-agent guide](https://docs.noodleseed.dev/docs/guides/product-agent-guides#export-an-openai-package)\nfor the current package workflow and boundaries.\n\nAgainst its deployed MCP URL, generate the Food Ordering submission candidate with:\n\n```sh\nnoodle export plugin openai \\\n --state submission \\\n --mcp-url https://food-ordering.noodleseed.app/mcp \\\n --category \"Food & Drink\" \\\n --output food-ordering-openai.zip\n```\n\nAfter registering that same URL in ChatGPT developer mode, substitute its real technical ID to generate the\nFood Ordering local test package:\n\n```sh\nnoodle export plugin openai \\\n --state local \\\n --mcp-url https://food-ordering.noodleseed.app/mcp \\\n --category \"Food & Drink\" \\\n --registered-app-id plugin_asdk_app_0123456789abcdef0123456789abcdef \\\n --output food-ordering-openai-local.zip\n```\n\n## Client Setup\n\nUse the CLI to print the exact setup flow for your MCP client:\n\n```sh\nnoodle connect claude\nnoodle connect chatgpt\nnoodle connect inspector\n```\n\n## Deploy\n\n```sh\nnoodle deploy --org demo --app food-ordering --env prod --access owner-only\nnoodle open\n```\n\nThat one deploy command preflights the complete target, creates a missing app/environment, and verifies\nhosted readiness. If it is interrupted, rerun the same command to resume the unfinished operation without a\nduplicate deployment. Use `--access org-members` for an org-wide internal demo. This example has no\nconnector secrets and does not include tokens, caller-key mechanisms, or `.env.noodle` values.\n\n## Demo Assets\n\nThe packaged demo images live under `assets/` and are public web assets when deployed. The current app uses\n`assets/noodle-bowl.jpg` as the server branding image.\n\nImage sources:\n\n- `assets/noodle-bowl.jpg` — Unsplash photo\n [`IRv8V9Hb8gI`](https://unsplash.com/photos/IRv8V9Hb8gI), downloaded from Unsplash.\n- `assets/lentil-soup.jpg` — Unsplash image\n [`photo-1510431198580-7727c9fa1e3a`](https://images.unsplash.com/photo-1510431198580-7727c9fa1e3a), downloaded from Unsplash.\n- `assets/mint-lemonade.jpg` — Unsplash photo\n [`X7Nx327NtuA`](https://unsplash.com/photos/X7Nx327NtuA) by Imad 786.\n- `assets/lentil-soup-openai.png` and `assets/mint-lemonade-openai.png` PNG screenshot renditions\n produced from the two corresponding Unsplash references for OpenAI plugin packaging.\n\nUnsplash photos are free to use under the [Unsplash License](https://unsplash.com/license); attribution is\nnot required, but source notes are kept here for provenance.\n" },
60
+ { relPath: "examples/food-ordering/README.md", content: "# Food Ordering\n\n**Owns:** The flagship consumer ordering MCP App example: React view authoring, app-only helper tools,\ncaller-scoped cart state handles, invocation context, model-visible widget state/lifecycle, packaged image\nassets, portable structured elicitation, checkout handoff policy, host actions, CSP/permissions metadata,\nproduct-agent guidance, host-neutral distribution metadata, and widget preview coverage.\n\nFood Ordering is a generic, synthetic version of a live marketplace ordering app. It lets a user search\nstores, browse menus, customize an item, build a multi-line cart, review the order, and hand off checkout to\nan allowlisted example domain. It does not use real restaurant APIs, real checkout, customer credentials, or\nprivate customer data.\n\n## What It Shows\n\n| Capability | Example |\n| :--- | :--- |\n| Public entry tool | `open_ordering` returns structured fallback content and renders the React widget |\n| Product and distribution projections | `agentGuide` supplies grounded cross-capability guidance; `distribution` supplies listing, publisher, legal, image, and review facts separately from the runtime manifest |\n| App-only helper tools | `search_stores`, `load_menu`, `load_item`, `read_cart`, `sync_cart`, `prepare_checkout`; mutating widget-owned helpers use `confirm: false` (equivalent to omission) and execute directly because action hints alone never gate |\n| Durable cart state | `server(..., { state: { handles: { cart } }, use: { state } })` with caller scope and revision checks |\n| React app runtime kit | `@noodleseed/one/react` supplies app flow, shell/nav/view, async state, form, quantity, choice, and handoff primitives |\n| Multi-step widget flow | One React shell navigates stores, menu, item customization, cart, review, and handoff views through `useAppFlow` |\n| Invocation context | `server.context` sets locale/time-zone defaults, derives an ambient service area/date, and makes the same snapshot available to tools and the reserved `noodle_context` MCP adapter |\n| Structured missing input | `plan_order` uses `ctx.elicit` to collect a fulfilment method and date through embedded/headless forms, standard bidirectional elicitation, a linked MCP App form, or an exact structured conversational retry on stateless hosts |\n| Model-visible widget state | `useUpdateModelContext` publishes one cohesive replacement snapshot when supported; `useWidgetLifecycle` auto-publishes mounted/cancelled/dismissed and reports author-owned submitted milestones for future context (not host-presentation proof), while the user-triggered submit pairs `useSendFollowUpMessage` for an immediate reply |\n| Handoff | `handoff.allowedDomains` allows only `https://orders.example.com` checkout URLs |\n| Progressive enhancement | Non-Apps hosts still receive stores, featured items, and a readable fallback summary |\n| Fail-closed hydration | The React view treats only the unhydrated, pre-result `{}` envelope as pending; a hydrated empty success remains distinct. It surfaces `isError`, validates required records and identifiers, and withholds ordering actions from malformed results |\n\nThe example is intentionally richer than the generated starter, but each inline view still follows the\nsame default: one immediate purpose, one primary action, at most one subordinate action, and progressive\ndisclosure for the rest. Preview it at 280px before adding navigation or local CSS; loading, empty, stale,\nerror/retry, and success states must remain readable without nested vertical scrolling.\n\nLike the comprehensive default `noodle init my-app` scaffold, this flagship keeps the server feature-rich\nwhile making each individual widget view focused; server capability breadth and screen density are separate.\nThe compiled initial widget should normally remain under the 1 MiB performance recommendation; Noodle Seed's\nhard ceilings are 10 MiB per compiled widget and 20 MiB across one deployment. Run `noodle check` to see raw\nand gzip-estimated sizes. Deploy requests are gzip-compressed as one stream so repeated self-contained React\nruntime bytes deduplicate on the wire without a cross-tenant CDN. Keep menu images or large live datasets in assets/resources and app-only tools\nrather than embedding them into the initial HTML bundle.\n\n## Local Author Loop\n\n```sh\nnoodle validate\nnoodle test\nnoodle dev\n```\n\nThe same `server.ts` declares `distribution` metadata for host adapters. It references real packaged images\nand keeps listing copy, support/legal URLs, and positive/negative review scenarios outside the canonical App\nPackage and Runtime Artifact. Explicit OpenAI and Claude adapters project those facts with the generated\nproduct skill; installable plugin archives and directory-submission dossiers remain separate outputs.\n\nIn another terminal:\n\n```sh\nnoodle tools list\nnoodle tools call open_ordering --args '{\"customer\":\"Asha\",\"query\":\"noodles\"}'\nnoodle tools call summarize_ordering_options --args '{}'\n```\n\nWhen a developer finalizes visual feedback in the local Design experience, a coding agent can inspect the\nlatest project-local brief without a path or session id:\n\n```sh\nnoodle design inspect --latest --json\n```\n\nThe agent should locate the captured elements in this example's authored React source, preserve the listed\nbehavior and accessibility constraints, and verify every acceptance check before changing unrelated UI.\n\nFor Apps metadata conformance, start `noodle dev`, copy the loopback MCP endpoint, then run:\n\n```sh\nnpx @mcpjam/cli@latest apps conformance --url http://127.0.0.1:<port>/o/demo/food-ordering/mcp --quiet --format json\n```\n\n## Export an OpenAI plugin\n\nThis flagship includes the guided workflows, listing metadata, review cases, and image assets needed to test\nOpenAI export. See the public [product-agent guide](https://docs.noodleseed.dev/docs/guides/product-agent-guides#export-an-openai-package)\nfor the current package workflow and boundaries.\n\nAgainst its deployed MCP URL, generate the Food Ordering submission candidate with:\n\n```sh\nnoodle export plugin openai \\\n --state submission \\\n --mcp-url https://food-ordering.noodleseed.app/mcp \\\n --category \"Food & Drink\" \\\n --output food-ordering-openai.zip\n```\n\nExtract `food-ordering-openai.zip` before using the portal. Upload\n`submission/chatgpt-app-submission.json` to the Codex-assisted import field and\n`submission/food-ordering-skill.zip` to **With MCP → Skills**. The outer ZIP is the complete review kit and\nis not itself a valid skill upload; `submission/README.md` repeats the portal steps.\n\nAfter registering that same URL in ChatGPT developer mode, substitute its real technical ID to generate the\nFood Ordering local test package:\n\n```sh\nnoodle export plugin openai \\\n --state local \\\n --mcp-url https://food-ordering.noodleseed.app/mcp \\\n --category \"Food & Drink\" \\\n --registered-app-id plugin_asdk_app_0123456789abcdef0123456789abcdef \\\n --output food-ordering-openai-local.zip\n```\n\n## Export for Claude\n\nClaude Code plugin packaging and Anthropic Connector Directory review are separate outputs. Generate the\ninstallable plugin repository with:\n\n```sh\nnoodle export plugin claude \\\n --mcp-url https://food-ordering.noodleseed.app/mcp \\\n --output food-ordering-claude.zip\n```\n\nGenerate the credential-free operator dossier for the remote Connector Directory with:\n\n```sh\nnoodle export connector claude \\\n --mcp-url https://food-ordering.noodleseed.app/mcp \\\n --auth none \\\n --category \"Food & Drink\" \\\n --output food-ordering-anthropic-connector.zip\n```\n\nThe dossier is deliberately marked `portalUploadable: false`: it gathers the listing, tool annotations,\nuse cases, allowed-link candidates, test-account guidance, and MCP App screenshot evidence, but a human must\nverify ownership/compliance and enter the final answers in Anthropic's portal. The plugin ZIP does not\ncontain this dossier.\n\n## Client Setup\n\nUse the CLI to print the exact setup flow for your MCP client:\n\n```sh\nnoodle connect claude\nnoodle connect chatgpt\nnoodle connect inspector\n```\n\n## Deploy\n\n```sh\nnoodle deploy --org demo --app food-ordering --env prod --access owner-only\nnoodle open\n```\n\nThat one deploy command preflights the complete target, creates a missing app/environment, and verifies\nhosted readiness. If it is interrupted, rerun the same command to resume the unfinished operation without a\nduplicate deployment. Use `--access org-members` for an org-wide internal demo. This example has no\nconnector secrets and does not include tokens, caller-key mechanisms, or `.env.noodle` values.\n\n## Demo Assets\n\nThe packaged demo images live under `assets/`. The current app uses `assets/noodle-bowl.jpg` as the server\nbranding image. Its three distribution screenshots are real, response-only MCP App captures from Noodle\nDevtools at 2× device scale; each is 1640×970 PNG and has the producing user prompt next to its `asset(...)`\nreference in `server.ts`.\n\nImage sources:\n\n- `assets/noodle-bowl.jpg` — Unsplash photo\n [`IRv8V9Hb8gI`](https://unsplash.com/photos/IRv8V9Hb8gI), downloaded from Unsplash.\n- `assets/food-ordering-stores.png` — store-discovery state produced by “Help me build a noodle order for\n pickup.”\n- `assets/food-ordering-menu.png` — Harbor Noodles menu state produced by “Show me the Harbor Noodles\n menu.”\n- `assets/food-ordering-handoff.png` checkout-handoff state produced by “Review my spicy miso bowl order\n before checkout.”\n\nThe Unsplash branding photo is free to use under the [Unsplash License](https://unsplash.com/license);\nattribution is not required, but the source note is kept here for provenance.\n" },
59
61
  { relPath: "examples/food-ordering/noodle.json", content: "{\n \"entrypoint\": \"src/server.ts\",\n \"name\": \"food-ordering\",\n \"template\": \"widget\"\n}\n" },
60
62
  { relPath: "examples/food-ordering/package.json", content: "{\n \"name\": \"food-ordering\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"test\": \"vitest run test\",\n \"validate\": \"noodle validate\",\n \"dev\": \"noodle dev\",\n \"deploy\": \"noodle deploy\"\n },\n \"devDependencies\": {\n \"@vitejs/plugin-react\": \"latest\",\n \"@noodleseed/one\": \"latest\",\n \"@types/react\": \"latest\",\n \"@types/react-dom\": \"latest\",\n \"react\": \"latest\",\n \"react-dom\": \"latest\",\n \"vite\": \"latest\",\n \"vitest\": \"latest\"\n }\n}\n" },
61
63
  { relPath: "examples/food-ordering/src/agent-guide.ts", content: "import type { AgentGuideSource } from '@noodleseed/one';\n\n/** Product guidance for the model-visible ordering and planning workflows. */\nexport const FOOD_ORDERING_AGENT_GUIDE = {\n description:\n 'Use Food Ordering to browse synthetic local options, build a reviewable cart, and hand checkout to the user.',\n useWhen: [\n 'The user wants to browse nearby food or assemble an order.',\n 'The user wants a structured pickup or delivery plan before ordering.',\n ],\n workflows: [\n {\n id: 'build_order',\n title: 'Browse and build an order',\n steps: [\n {\n capability: { kind: 'tool', name: 'open_ordering' },\n guidance:\n 'Open the ordering app so the user can choose a store, review the cart, and control checkout handoff.',\n },\n ],\n },\n {\n id: 'summarize_options',\n title: 'Summarize available options',\n steps: [{ capability: { kind: 'tool', name: 'summarize_ordering_options' } }],\n },\n {\n id: 'plan_fulfilment',\n title: 'Plan pickup or delivery',\n steps: [\n {\n capability: { kind: 'tool', name: 'plan_order' },\n guidance: 'Collect the user’s fulfilment preference without claiming to place an order.',\n },\n ],\n },\n ],\n boundaries: [\n 'Treat every store, menu item, price, and service area in this example as synthetic.',\n 'Never claim checkout or payment completed; the final order happens only after the external handoff.',\n ],\n examples: [\n { prompt: 'Help me put together a noodle order.', workflow: 'build_order' },\n { prompt: 'What food options are available?', workflow: 'summarize_options' },\n { prompt: 'Plan a delivery for Friday.', workflow: 'plan_fulfilment' },\n ],\n} as const satisfies AgentGuideSource;\n" },
62
64
  { relPath: "examples/food-ordering/src/helpers.ts", content: "import type { ServerDefinition } from '@noodleseed/one';\n\nexport {\n ActionBar,\n AppShell,\n AsyncBoundary,\n ChoiceGroup,\n createViewStore,\n DataCard,\n DataList,\n Feedback,\n Field,\n Form,\n HandoffButton,\n QuantityStepper,\n ShellNav,\n StatusBadge,\n SubmitButton,\n View,\n ViewStack,\n} from '@noodleseed/one/react';\n\nimport { generateHelpers } from '@noodleseed/one/react';\n\nexport type AppType = ServerDefinition;\n\nexport const {\n useCallTool,\n useAppFlow,\n useHandoff,\n useLayout,\n useOpenExternal,\n useSendFollowUpMessage,\n useToolInfo,\n useUpdateModelContext,\n useViewState,\n useWidgetLifecycle,\n useWidgetReady,\n} = generateHelpers<AppType>();\n" },
63
- { relPath: "examples/food-ordering/src/server.ts", content: "import { annotations, asset, connector, resource, server, tool, z } from '@noodleseed/one';\nimport { FOOD_ORDERING_AGENT_GUIDE } from './agent-guide.js';\n\nconst heroImage = asset('assets/noodle-bowl.jpg');\nconst menuScreenshot = asset('assets/lentil-soup-openai.png');\nconst cartScreenshot = asset('assets/mint-lemonade-openai.png');\n\nconst state = connector('noodle_state')\n .version('1.0.0')\n .operation('read_state', {\n type: 'read',\n input: z.object({\n handle: z.string(),\n key: z.string().optional(),\n }),\n output: z.object({\n value: z.record(z.string(), z.unknown()),\n revision: z.number().int(),\n status: z.string(),\n }),\n })\n .operation('patch_state', {\n type: 'action',\n input: z.object({\n handle: z.string(),\n expectedRevision: z.number().int(),\n value: z.record(z.string(), z.unknown()),\n }),\n output: z.object({\n value: z.record(z.string(), z.unknown()),\n revision: z.number().int(),\n status: z.string(),\n }),\n });\n\nconst stores = [\n {\n id: 'harbor-noodles',\n name: 'Harbor Noodles',\n cuisine: 'Noodles',\n address: '18 Pier Lane',\n open: true,\n etaMinutes: 24,\n rating: 4.8,\n },\n {\n id: 'garden-wraps',\n name: 'Garden Wraps',\n cuisine: 'Vegetarian',\n address: '44 Market Street',\n open: true,\n etaMinutes: 18,\n rating: 4.6,\n },\n {\n id: 'midnight-tacos',\n name: 'Midnight Tacos',\n cuisine: 'Mexican',\n address: '7 Station Road',\n open: false,\n etaMinutes: 35,\n rating: 4.7,\n },\n] as const;\n\nconst menu = [\n {\n id: 'spicy_miso',\n storeId: 'harbor-noodles',\n category: 'Bowls',\n name: 'Spicy Miso Bowl',\n price: 16,\n description: 'Miso broth, wheat noodles, chili crisp, egg, and greens.',\n modifiers: ['extra_noodles', 'soft_egg', 'chili_crisp'],\n },\n {\n id: 'ginger_tofu',\n storeId: 'harbor-noodles',\n category: 'Bowls',\n name: 'Ginger Tofu Bowl',\n price: 15,\n description: 'Tofu, ginger broth, mushrooms, and scallions.',\n modifiers: ['extra_tofu', 'brown_rice', 'no_mushroom'],\n },\n {\n id: 'green_falafel',\n storeId: 'garden-wraps',\n category: 'Wraps',\n name: 'Green Falafel Wrap',\n price: 13,\n description: 'Falafel, herbs, pickles, tahini, and crisp vegetables.',\n modifiers: ['extra_tahini', 'add_fries', 'gluten_free_wrap'],\n },\n {\n id: 'sweet_potato',\n storeId: 'garden-wraps',\n category: 'Plates',\n name: 'Sweet Potato Plate',\n price: 14,\n description: 'Roasted sweet potato, grains, greens, and lemon yogurt.',\n modifiers: ['vegan_yogurt', 'extra_greens', 'hot_sauce'],\n },\n] as const;\n\nconst cartLine = z.object({\n itemId: z.string(),\n quantity: z.number().int().min(1),\n modifiers: z.array(z.string()).default([]),\n note: z.string().optional(),\n});\n\nconst cartInput = z.object({\n selectedStoreId: z.string().optional(),\n lines: z.array(cartLine).default([]),\n customer: z.string().default('Guest'),\n notes: z.string().optional(),\n subtotal: z.number().default(0),\n expectedRevision: z.number().int().min(0).default(0),\n});\n\nconst storeShape = z.object({\n id: z.string(),\n name: z.string(),\n cuisine: z.string(),\n address: z.string(),\n open: z.boolean(),\n etaMinutes: z.number(),\n rating: z.number(),\n});\n\nconst menuItemShape = z.object({\n id: z.string(),\n storeId: z.string(),\n category: z.string(),\n name: z.string(),\n price: z.number(),\n description: z.string(),\n // Nested lists count toward the output budget too: unbounded modifiers multiply by every item in a\n // menu payload, so the ceiling is declared here rather than only on the outer array.\n modifiers: z.array(z.string()).max(10),\n});\n\nconst cartOutput = z.object({\n selectedStoreId: z.string().optional(),\n lines: z.array(cartLine),\n customer: z.string(),\n notes: z.string().optional(),\n subtotal: z.number(),\n status: z.enum(['draft', 'review', 'handoff']),\n checkoutUrl: z.string().optional(),\n});\n\nconst cartStateSchema = z.object({\n selectedStoreId: z.string().optional(),\n lines: z.array(cartLine),\n customer: z.string(),\n notes: z.string().optional(),\n subtotal: z.number(),\n // `.default()`/`.optional()` state fields are optional on write: a cart save that omits\n // `status` still validates, and a fresh cart starts in `draft`.\n status: z.enum(['draft', 'review', 'handoff']).default('draft'),\n checkoutUrl: z.string().optional(),\n});\n\ntype CartLine = {\n readonly itemId: string;\n readonly quantity: number;\n readonly modifiers: readonly string[];\n readonly note?: string;\n};\n\ntype CartInput = {\n readonly selectedStoreId?: string;\n readonly lines: readonly CartLine[];\n readonly customer: string;\n readonly notes?: string;\n readonly subtotal: number;\n readonly expectedRevision: number;\n};\n\nconst readOnly = annotations.readOnly();\n// These writes are app-only controls inside the cart widget. The widget already presents the\n// reviewed state and explicit button; `confirm: false` documents direct execution and is equivalent\n// to omission because action/open-world hints alone never enable the confirmation gate.\nconst action = annotations.openAction({ destructive: false, confirm: false });\n\nfunction checkoutUrl(customer: string): string {\n return `https://orders.example.com/checkout?customer=${encodeURIComponent(customer)}`;\n}\n\nfunction cartValue(input: CartInput, status: 'draft' | 'review' | 'handoff') {\n return {\n selectedStoreId: input.selectedStoreId,\n lines: input.lines,\n customer: input.customer,\n notes: input.notes,\n subtotal: input.subtotal,\n status,\n ...(status === 'handoff' ? { checkoutUrl: 'https://orders.example.com/checkout' } : {}),\n };\n}\n\nexport default server(\n 'food_ordering',\n {\n title: 'Food Ordering',\n version: '1.0.0',\n agentGuide: FOOD_ORDERING_AGENT_GUIDE,\n distribution: {\n listing: {\n summary: 'Browse local food, build a cart, and review checkout in conversation.',\n description:\n 'Food Ordering is a synthetic MCP App that demonstrates store discovery, menu browsing, a caller-scoped cart, fulfilment planning, and explicit checkout handoff.',\n keywords: ['food', 'ordering', 'delivery'],\n },\n publisher: {\n name: 'Noodle Seed Examples',\n websiteUrl: 'https://noodleseed.com',\n },\n support: {\n documentationUrl: 'https://docs.noodleseed.com/examples/food-ordering',\n supportUrl: 'https://noodleseed.com/support',\n },\n legal: {\n privacyPolicyUrl: 'https://noodleseed.com/privacy',\n termsOfServiceUrl: 'https://noodleseed.com/terms',\n },\n assets: {\n icon: { source: heroImage, alt: 'Food Ordering noodle bowl' },\n screenshots: [\n { source: menuScreenshot, alt: 'A featured lentil soup menu item' },\n { source: cartScreenshot, alt: 'A mint lemonade shown with the order' },\n ],\n },\n review: {\n instructions:\n 'Use the synthetic menu and guest cart. No account or reviewer credential is required.',\n scenarios: [\n {\n id: 'build_order',\n prompt: 'Help me build a noodle order for pickup.',\n expected:\n 'The ordering app opens with stores and menu items; checkout remains a handoff.',\n shouldInvoke: true,\n },\n {\n id: 'browse_menu',\n prompt: 'Show me vegetarian menu options nearby.',\n expected: 'The app shows matching stores and bounded menu choices.',\n shouldInvoke: true,\n },\n {\n id: 'compare_options',\n prompt: 'Compare the quickest open food options for me.',\n expected: 'The app grounds its comparison in the synthetic store data.',\n shouldInvoke: true,\n },\n {\n id: 'plan_pickup',\n prompt: 'Plan a pickup order for Friday.',\n expected: 'The app collects the missing fulfilment details before planning the order.',\n shouldInvoke: true,\n },\n {\n id: 'review_checkout',\n prompt: 'Review my cart before I continue to checkout.',\n expected: 'The app shows the cart and keeps payment on the explicit external handoff.',\n shouldInvoke: true,\n },\n {\n id: 'unrelated_weather',\n prompt: 'Will it rain tomorrow?',\n expected: 'Food Ordering is not invoked.',\n shouldInvoke: false,\n },\n {\n id: 'unrelated_email',\n prompt: 'Draft an email to my manager.',\n expected: 'Food Ordering is not invoked.',\n shouldInvoke: false,\n },\n {\n id: 'unrelated_travel',\n prompt: 'Book me a flight to Lisbon.',\n expected: 'Food Ordering is not invoked.',\n shouldInvoke: false,\n },\n ],\n },\n },\n use: { state },\n context: {\n defaults: { locale: 'en-US', timeZone: 'America/New_York' },\n ambient: {\n output: z.object({ serviceArea: z.string(), orderingDate: z.string() }),\n fulfil: ({ context }) => ({\n serviceArea: 'Harbor District',\n orderingDate: context.temporal.localDate,\n }),\n },\n },\n state: {\n handles: {\n cart: {\n kind: 'cart',\n version: 'v1',\n scope: 'caller',\n ttlSeconds: 7200,\n schema: cartStateSchema,\n },\n },\n },\n branding: {\n name: 'Food Ordering',\n accent: '#0F8F5F',\n surface: '#F7F7F5',\n surfaceDark: '#111820',\n logo: {\n uri: heroImage,\n alt: 'Food Ordering noodle bowl',\n },\n radius: 'lg',\n density: 'comfortable',\n },\n handoff: {\n allowedDomains: ['https://orders.example.com'],\n },\n },\n [\n tool('open_ordering', {\n title: 'Open food ordering',\n description:\n 'Open a complete food-ordering widget with store discovery, menu browsing, cart review, and checkout handoff.',\n annotations: readOnly,\n input: z.object({\n query: z.string().optional(),\n customer: z.string().default('Guest'),\n }),\n // List outputs declare a ceiling so a host and the model both know the payload is bounded.\n // A recorded `fulfil` cannot slice, so the cap belongs on the shape; connector-backed lists take\n // a pagination input instead. `noodle check` reports `tool_design_output_bounds` without one.\n output: z.object({\n status: z.string(),\n customer: z.string(),\n stores: z.array(storeShape).max(20),\n featuredItems: z.array(menuItemShape).max(20),\n localDate: z.string(),\n serviceArea: z.string(),\n fallback: z.string(),\n }),\n fulfil: ({ input, context }) => ({\n status: 'Ready to build a food order.',\n customer: input.customer,\n stores,\n featuredItems: menu,\n localDate: context.temporal.localDate,\n serviceArea: context.ambient.serviceArea,\n fallback: 'Open stores: Harbor Noodles (Noodles), Garden Wraps (Vegetarian).',\n }),\n viewTitle: 'Food ordering',\n domain: 'https://orders.example.com',\n view: {\n component: 'ordering-flow',\n entry: './views/ordering-flow.tsx',\n },\n viewDescription:\n 'A complete consumer ordering surface with app-only helper tools, cart state, and checkout handoff.',\n csp: {\n connectDomains: ['https://orders.example.com'],\n resourceDomains: ['https://orders.example.com'],\n frameDomains: ['https://orders.example.com'],\n },\n permissions: { clipboardWrite: {} },\n }),\n tool('search_stores', {\n visibility: ['app'],\n description: 'Filter synthetic restaurants for the ordering widget.',\n annotations: readOnly,\n input: z.object({\n query: z.string().optional(),\n openOnly: z.boolean().default(false),\n }),\n output: z.object({ stores: z.array(storeShape) }),\n fulfil: () => ({ stores }),\n }),\n tool('load_menu', {\n visibility: ['app'],\n description: 'Load synthetic menu categories and items for one store.',\n annotations: readOnly,\n input: z.object({ storeId: z.string() }),\n output: z.object({\n storeId: z.string(),\n stores: z.array(storeShape),\n items: z.array(menuItemShape),\n }),\n fulfil: ({ input }) => ({ storeId: input.storeId, stores, items: menu }),\n }),\n tool('load_item', {\n visibility: ['app'],\n description: 'Load item details and modifier options for the ordering widget.',\n annotations: readOnly,\n input: z.object({ itemId: z.string() }),\n output: z.object({ itemId: z.string(), items: z.array(menuItemShape) }),\n fulfil: ({ input }) => ({ itemId: input.itemId, items: menu }),\n }),\n tool('read_cart', {\n visibility: ['app'],\n description: 'Read the caller-scoped ordering cart state.',\n annotations: readOnly,\n input: z.object({}),\n output: z.object({\n value: z.unknown(),\n revision: z.number(),\n status: z.string(),\n }),\n fulfil: ({ connectors }) => {\n const state = connectors.state.readState({ handle: 'cart' });\n return { value: state.value, revision: state.revision, status: state.status };\n },\n }),\n tool('sync_cart', {\n visibility: ['app'],\n description: 'Patch the caller-scoped ordering cart with the widget cart mirror.',\n annotations: action,\n input: cartInput,\n output: z.object({\n cart: cartOutput,\n revision: z.number(),\n status: z.string(),\n }),\n fulfil: ({ input, connectors }) => {\n const cart = cartValue(input, 'draft');\n const state = connectors.state.patchState({\n handle: 'cart',\n expectedRevision: input.expectedRevision,\n value: cart,\n });\n return { cart, revision: state.revision, status: state.status };\n },\n }),\n tool('prepare_checkout', {\n visibility: ['app'],\n description: 'Prepare the caller-scoped cart for checkout handoff.',\n annotations: action,\n input: cartInput,\n output: z.object({\n cart: cartOutput,\n revision: z.number(),\n checkoutUrl: z.string(),\n }),\n fulfil: ({ input, connectors }) => {\n const cart = cartValue(input, 'handoff');\n const state = connectors.state.patchState({\n handle: 'cart',\n expectedRevision: input.expectedRevision,\n value: cart,\n });\n return {\n cart,\n revision: state.revision,\n checkoutUrl: cart.checkoutUrl ?? checkoutUrl(input.customer),\n };\n },\n }),\n tool('summarize_ordering_options', {\n title: 'Summarize ordering options',\n description: 'Summarize available stores and menu examples without opening the widget.',\n annotations: readOnly,\n input: z.object({}),\n output: z.object({\n stores: z.array(storeShape).max(20),\n featuredItems: z.array(menuItemShape).max(20),\n }),\n fulfil: () => ({ stores, featuredItems: menu }),\n }),\n tool('plan_order', {\n title: 'Plan an order',\n description:\n 'Collect a fulfilment method and requested date as structured input, then return a reviewable order plan without placing an order.',\n annotations: readOnly,\n input: z.object({ customer: z.string().default('Guest') }),\n output: z.object({\n customer: z.string(),\n method: z.enum(['pickup', 'delivery']),\n requestedDate: z.string(),\n serviceArea: z.string(),\n }),\n fulfil: ({ input, context, elicit }) => {\n const preference = elicit({\n id: 'choose_fulfilment',\n message: 'How should we fulfil this order?',\n input: z.object({\n method: z.enum(['pickup', 'delivery']).describe('Fulfilment method'),\n requestedDate: z.string().describe('Requested date').meta({ format: 'date' }),\n }),\n });\n return {\n customer: input.customer,\n method: preference.method,\n requestedDate: preference.requestedDate,\n serviceArea: context.ambient.serviceArea,\n };\n },\n }),\n tool('show_capabilities', {\n title: 'Show capabilities',\n description: 'Return a concise summary for the standalone widget capability preview.',\n annotations: readOnly,\n input: z.object({}),\n output: z.object({ status: z.string(), note: z.string() }),\n fulfil: () => ({\n status: 'Food Ordering widget capabilities are ready.',\n note: 'Standalone preview covers React views, helper tools, cart state, handoff, CSP, and permissions.',\n }),\n viewName: 'capabilities_card',\n viewTitle: 'Food Ordering capabilities',\n viewDescription: 'Standalone widget resource for previewing the ordering capability surface.',\n domain: 'https://orders.example.com',\n view: { component: 'capabilities-card', entry: './views/capabilities-card.tsx' },\n csp: {\n connectDomains: ['https://orders.example.com'],\n resourceDomains: ['https://orders.example.com'],\n frameDomains: ['https://orders.example.com'],\n },\n permissions: { clipboardWrite: {} },\n }),\n resource('food_ordering_guide', {\n uri: 'docs://food-ordering',\n title: 'Food Ordering widget guide',\n description: 'Synthetic guide resource for the consumer ordering flagship.',\n mimeType: 'text/markdown',\n // Return the resource body directly; the runtime maps it into MCP `contents` using the\n // resource's own uri + mimeType. Do not return a `{ contents: [...] }` wrapper — that double-wraps.\n fulfil: () =>\n [\n '# Food Ordering Widget Guide',\n '',\n '- Demonstrates a multi-step ordering widget, app-only helper tools, typed cart state, and handoff.',\n '- Store, menu, and checkout data are synthetic and contain no customer credentials.',\n '- Checkout opens an allowlisted example URL; payment and final ordering remain out of scope.',\n ].join('\\n'),\n }),\n ],\n);\n" },
65
+ { relPath: "examples/food-ordering/src/server.ts", content: "import { annotations, asset, connector, resource, server, tool, z } from '@noodleseed/one';\nimport { FOOD_ORDERING_AGENT_GUIDE } from './agent-guide.js';\n\nconst heroImage = asset('assets/noodle-bowl.jpg');\nconst storesScreenshot = asset('assets/food-ordering-stores.png');\nconst menuScreenshot = asset('assets/food-ordering-menu.png');\nconst handoffScreenshot = asset('assets/food-ordering-handoff.png');\n\nconst state = connector('noodle_state')\n .version('1.0.0')\n .operation('read_state', {\n type: 'read',\n input: z.object({\n handle: z.string(),\n key: z.string().optional(),\n }),\n output: z.object({\n value: z.record(z.string(), z.unknown()),\n revision: z.number().int(),\n status: z.string(),\n }),\n })\n .operation('patch_state', {\n type: 'action',\n input: z.object({\n handle: z.string(),\n expectedRevision: z.number().int(),\n value: z.record(z.string(), z.unknown()),\n }),\n output: z.object({\n value: z.record(z.string(), z.unknown()),\n revision: z.number().int(),\n status: z.string(),\n }),\n });\n\nconst stores = [\n {\n id: 'harbor-noodles',\n name: 'Harbor Noodles',\n cuisine: 'Noodles',\n address: '18 Pier Lane',\n open: true,\n etaMinutes: 24,\n rating: 4.8,\n },\n {\n id: 'garden-wraps',\n name: 'Garden Wraps',\n cuisine: 'Vegetarian',\n address: '44 Market Street',\n open: true,\n etaMinutes: 18,\n rating: 4.6,\n },\n {\n id: 'midnight-tacos',\n name: 'Midnight Tacos',\n cuisine: 'Mexican',\n address: '7 Station Road',\n open: false,\n etaMinutes: 35,\n rating: 4.7,\n },\n] as const;\n\nconst menu = [\n {\n id: 'spicy_miso',\n storeId: 'harbor-noodles',\n category: 'Bowls',\n name: 'Spicy Miso Bowl',\n price: 16,\n description: 'Miso broth, wheat noodles, chili crisp, egg, and greens.',\n modifiers: ['extra_noodles', 'soft_egg', 'chili_crisp'],\n },\n {\n id: 'ginger_tofu',\n storeId: 'harbor-noodles',\n category: 'Bowls',\n name: 'Ginger Tofu Bowl',\n price: 15,\n description: 'Tofu, ginger broth, mushrooms, and scallions.',\n modifiers: ['extra_tofu', 'brown_rice', 'no_mushroom'],\n },\n {\n id: 'green_falafel',\n storeId: 'garden-wraps',\n category: 'Wraps',\n name: 'Green Falafel Wrap',\n price: 13,\n description: 'Falafel, herbs, pickles, tahini, and crisp vegetables.',\n modifiers: ['extra_tahini', 'add_fries', 'gluten_free_wrap'],\n },\n {\n id: 'sweet_potato',\n storeId: 'garden-wraps',\n category: 'Plates',\n name: 'Sweet Potato Plate',\n price: 14,\n description: 'Roasted sweet potato, grains, greens, and lemon yogurt.',\n modifiers: ['vegan_yogurt', 'extra_greens', 'hot_sauce'],\n },\n] as const;\n\nconst cartLine = z.object({\n itemId: z.string(),\n quantity: z.number().int().min(1),\n modifiers: z.array(z.string()).default([]),\n note: z.string().optional(),\n});\n\nconst cartInput = z.object({\n selectedStoreId: z.string().optional(),\n lines: z.array(cartLine).default([]),\n customer: z.string().default('Guest'),\n notes: z.string().optional(),\n subtotal: z.number().default(0),\n expectedRevision: z.number().int().min(0).default(0),\n});\n\nconst storeShape = z.object({\n id: z.string(),\n name: z.string(),\n cuisine: z.string(),\n address: z.string(),\n open: z.boolean(),\n etaMinutes: z.number(),\n rating: z.number(),\n});\n\nconst menuItemShape = z.object({\n id: z.string(),\n storeId: z.string(),\n category: z.string(),\n name: z.string(),\n price: z.number(),\n description: z.string(),\n // Nested lists count toward the output budget too: unbounded modifiers multiply by every item in a\n // menu payload, so the ceiling is declared here rather than only on the outer array.\n modifiers: z.array(z.string()).max(10),\n});\n\nconst cartOutput = z.object({\n selectedStoreId: z.string().optional(),\n lines: z.array(cartLine),\n customer: z.string(),\n notes: z.string().optional(),\n subtotal: z.number(),\n status: z.enum(['draft', 'review', 'handoff']),\n checkoutUrl: z.string().optional(),\n});\n\nconst cartStateSchema = z.object({\n selectedStoreId: z.string().optional(),\n lines: z.array(cartLine),\n customer: z.string(),\n notes: z.string().optional(),\n subtotal: z.number(),\n // `.default()`/`.optional()` state fields are optional on write: a cart save that omits\n // `status` still validates, and a fresh cart starts in `draft`.\n status: z.enum(['draft', 'review', 'handoff']).default('draft'),\n checkoutUrl: z.string().optional(),\n});\n\ntype CartLine = {\n readonly itemId: string;\n readonly quantity: number;\n readonly modifiers: readonly string[];\n readonly note?: string;\n};\n\ntype CartInput = {\n readonly selectedStoreId?: string;\n readonly lines: readonly CartLine[];\n readonly customer: string;\n readonly notes?: string;\n readonly subtotal: number;\n readonly expectedRevision: number;\n};\n\nconst readOnly = annotations.readOnly();\n// These writes are app-only controls inside the cart widget. The widget already presents the\n// reviewed state and explicit button; `confirm: false` documents direct execution and is equivalent\n// to omission because action/open-world hints alone never enable the confirmation gate.\nconst action = annotations.openAction({ destructive: false, confirm: false });\n\nfunction checkoutUrl(customer: string): string {\n return `https://orders.example.com/checkout?customer=${encodeURIComponent(customer)}`;\n}\n\nfunction cartValue(input: CartInput, status: 'draft' | 'review' | 'handoff') {\n return {\n selectedStoreId: input.selectedStoreId,\n lines: input.lines,\n customer: input.customer,\n notes: input.notes,\n subtotal: input.subtotal,\n status,\n ...(status === 'handoff' ? { checkoutUrl: 'https://orders.example.com/checkout' } : {}),\n };\n}\n\nexport default server(\n 'food_ordering',\n {\n title: 'Food Ordering',\n version: '1.0.0',\n agentGuide: FOOD_ORDERING_AGENT_GUIDE,\n distribution: {\n listing: {\n summary: 'Build a pickup noodle order.',\n description:\n 'Food Ordering is a synthetic MCP App that demonstrates store discovery, menu browsing, a caller-scoped cart, fulfilment planning, and explicit checkout handoff.',\n keywords: ['food', 'ordering', 'delivery'],\n },\n publisher: {\n name: 'Noodle Seed Examples',\n websiteUrl: 'https://noodleseed.com',\n },\n support: {\n documentationUrl: 'https://docs.noodleseed.com/examples/food-ordering',\n supportUrl: 'https://noodleseed.com/support',\n },\n legal: {\n privacyPolicyUrl: 'https://noodleseed.com/privacy',\n termsOfServiceUrl: 'https://noodleseed.com/terms',\n },\n assets: {\n icon: { source: heroImage, alt: 'Food Ordering noodle bowl' },\n screenshots: [\n {\n source: storesScreenshot,\n alt: 'Food Ordering MCP App showing nearby stores',\n prompt: 'Help me build a noodle order for pickup.',\n },\n {\n source: menuScreenshot,\n alt: 'Food Ordering MCP App showing the Harbor Noodles menu',\n prompt: 'Show me the Harbor Noodles menu.',\n },\n {\n source: handoffScreenshot,\n alt: 'Food Ordering MCP App reviewing a checkout handoff',\n prompt: 'Review my spicy miso bowl order before checkout.',\n },\n ],\n },\n review: {\n instructions:\n 'Use the synthetic menu and guest cart. No account or reviewer credential is required.',\n scenarios: [\n {\n id: 'build_order',\n prompt: 'Help me build a noodle order for pickup.',\n expected:\n 'The ordering app opens with stores and menu items; checkout remains a handoff.',\n shouldInvoke: true,\n tools: ['open_ordering'],\n },\n {\n id: 'browse_menu',\n prompt: 'Show me vegetarian menu options nearby.',\n expected: 'The app shows matching stores and bounded menu choices.',\n shouldInvoke: true,\n tools: ['search_stores', 'load_menu'],\n },\n {\n id: 'compare_options',\n prompt: 'Compare the quickest open food options for me.',\n expected: 'The app grounds its comparison in the synthetic store data.',\n shouldInvoke: true,\n tools: ['search_stores', 'summarize_ordering_options'],\n },\n {\n id: 'plan_pickup',\n prompt: 'Plan a pickup order for Friday.',\n expected: 'The app collects the missing fulfilment details before planning the order.',\n shouldInvoke: true,\n tools: ['plan_order'],\n },\n {\n id: 'review_checkout',\n prompt: 'Review my cart before I continue to checkout.',\n expected: 'The app shows the cart and keeps payment on the explicit external handoff.',\n shouldInvoke: true,\n tools: ['read_cart', 'prepare_checkout'],\n },\n // Negative scenarios are non-invocation cases, so they never declare expected tools.\n {\n id: 'unrelated_weather',\n prompt: 'Will it rain tomorrow?',\n expected: 'Food Ordering is not invoked.',\n shouldInvoke: false,\n },\n {\n id: 'unrelated_email',\n prompt: 'Draft an email to my manager.',\n expected: 'Food Ordering is not invoked.',\n shouldInvoke: false,\n },\n {\n id: 'unrelated_travel',\n prompt: 'Book me a flight to Lisbon.',\n expected: 'Food Ordering is not invoked.',\n shouldInvoke: false,\n },\n ],\n },\n },\n use: { state },\n context: {\n defaults: { locale: 'en-US', timeZone: 'America/New_York' },\n ambient: {\n output: z.object({ serviceArea: z.string(), orderingDate: z.string() }),\n fulfil: ({ context }) => ({\n serviceArea: 'Harbor District',\n orderingDate: context.temporal.localDate,\n }),\n },\n },\n state: {\n handles: {\n cart: {\n kind: 'cart',\n version: 'v1',\n scope: 'caller',\n ttlSeconds: 7200,\n schema: cartStateSchema,\n },\n },\n },\n branding: {\n name: 'Food Ordering',\n accent: '#0F8F5F',\n surface: '#F7F7F5',\n surfaceDark: '#111820',\n logo: {\n uri: heroImage,\n alt: 'Food Ordering noodle bowl',\n },\n radius: 'lg',\n density: 'comfortable',\n },\n handoff: {\n allowedDomains: ['https://orders.example.com'],\n },\n },\n [\n tool('open_ordering', {\n title: 'Open food ordering',\n description:\n 'Open a complete food-ordering widget with store discovery, menu browsing, cart review, and checkout handoff.',\n annotations: readOnly,\n input: z.object({\n query: z.string().optional(),\n customer: z.string().default('Guest'),\n }),\n // List outputs declare a ceiling so a host and the model both know the payload is bounded.\n // A recorded `fulfil` cannot slice, so the cap belongs on the shape; connector-backed lists take\n // a pagination input instead. `noodle check` reports `tool_design_output_bounds` without one.\n output: z.object({\n status: z.string(),\n customer: z.string(),\n stores: z.array(storeShape).max(20),\n featuredItems: z.array(menuItemShape).max(20),\n localDate: z.string(),\n serviceArea: z.string(),\n fallback: z.string(),\n }),\n fulfil: ({ input, context }) => ({\n status: 'Ready to build a food order.',\n customer: input.customer,\n stores,\n featuredItems: menu,\n localDate: context.temporal.localDate,\n serviceArea: context.ambient.serviceArea,\n fallback: 'Open stores: Harbor Noodles (Noodles), Garden Wraps (Vegetarian).',\n }),\n viewTitle: 'Food ordering',\n domain: 'https://orders.example.com',\n view: {\n component: 'ordering-flow',\n entry: './views/ordering-flow.tsx',\n },\n viewDescription:\n 'A complete consumer ordering surface with app-only helper tools, cart state, and checkout handoff.',\n csp: {\n connectDomains: ['https://orders.example.com'],\n resourceDomains: ['https://orders.example.com'],\n frameDomains: ['https://orders.example.com'],\n },\n permissions: { clipboardWrite: {} },\n }),\n tool('search_stores', {\n title: 'Search stores',\n visibility: ['app'],\n description: 'Filter synthetic restaurants for the ordering widget.',\n annotations: readOnly,\n input: z.object({\n query: z.string().optional(),\n openOnly: z.boolean().default(false),\n }),\n output: z.object({ stores: z.array(storeShape) }),\n fulfil: () => ({ stores }),\n }),\n tool('load_menu', {\n title: 'Load store menu',\n visibility: ['app'],\n description: 'Load synthetic menu categories and items for one store.',\n annotations: readOnly,\n input: z.object({ storeId: z.string() }),\n output: z.object({\n storeId: z.string(),\n stores: z.array(storeShape),\n items: z.array(menuItemShape),\n }),\n fulfil: ({ input }) => ({ storeId: input.storeId, stores, items: menu }),\n }),\n tool('load_item', {\n title: 'Load menu item',\n visibility: ['app'],\n description: 'Load item details and modifier options for the ordering widget.',\n annotations: readOnly,\n input: z.object({ itemId: z.string() }),\n output: z.object({ itemId: z.string(), items: z.array(menuItemShape) }),\n fulfil: ({ input }) => ({ itemId: input.itemId, items: menu }),\n }),\n tool('read_cart', {\n title: 'Read ordering cart',\n visibility: ['app'],\n description: 'Read the caller-scoped ordering cart state.',\n annotations: readOnly,\n input: z.object({}),\n output: z.object({\n value: z.unknown(),\n revision: z.number(),\n status: z.string(),\n }),\n fulfil: ({ connectors }) => {\n const state = connectors.state.readState({ handle: 'cart' });\n return { value: state.value, revision: state.revision, status: state.status };\n },\n }),\n tool('sync_cart', {\n title: 'Update ordering cart',\n visibility: ['app'],\n description: 'Patch the caller-scoped ordering cart with the widget cart mirror.',\n annotations: action,\n input: cartInput,\n output: z.object({\n cart: cartOutput,\n revision: z.number(),\n status: z.string(),\n }),\n fulfil: ({ input, connectors }) => {\n const cart = cartValue(input, 'draft');\n const state = connectors.state.patchState({\n handle: 'cart',\n expectedRevision: input.expectedRevision,\n value: cart,\n });\n return { cart, revision: state.revision, status: state.status };\n },\n }),\n tool('prepare_checkout', {\n title: 'Prepare checkout handoff',\n visibility: ['app'],\n description: 'Prepare the caller-scoped cart for checkout handoff.',\n annotations: action,\n input: cartInput,\n output: z.object({\n cart: cartOutput,\n revision: z.number(),\n checkoutUrl: z.string(),\n }),\n fulfil: ({ input, connectors }) => {\n const cart = cartValue(input, 'handoff');\n const state = connectors.state.patchState({\n handle: 'cart',\n expectedRevision: input.expectedRevision,\n value: cart,\n });\n return {\n cart,\n revision: state.revision,\n checkoutUrl: cart.checkoutUrl ?? checkoutUrl(input.customer),\n };\n },\n }),\n tool('summarize_ordering_options', {\n title: 'Summarize ordering options',\n description: 'Summarize available stores and menu examples without opening the widget.',\n annotations: readOnly,\n input: z.object({}),\n output: z.object({\n stores: z.array(storeShape).max(20),\n featuredItems: z.array(menuItemShape).max(20),\n }),\n fulfil: () => ({ stores, featuredItems: menu }),\n }),\n tool('plan_order', {\n title: 'Plan an order',\n description:\n 'Collect a fulfilment method and requested date as structured input, then return a reviewable order plan without placing an order.',\n annotations: readOnly,\n input: z.object({ customer: z.string().default('Guest') }),\n output: z.object({\n customer: z.string(),\n method: z.enum(['pickup', 'delivery']),\n requestedDate: z.string(),\n serviceArea: z.string(),\n }),\n fulfil: ({ input, context, elicit }) => {\n const preference = elicit({\n id: 'choose_fulfilment',\n message: 'How should we fulfil this order?',\n input: z.object({\n method: z.enum(['pickup', 'delivery']).describe('Fulfilment method'),\n requestedDate: z.string().describe('Requested date').meta({ format: 'date' }),\n }),\n });\n return {\n customer: input.customer,\n method: preference.method,\n requestedDate: preference.requestedDate,\n serviceArea: context.ambient.serviceArea,\n };\n },\n }),\n tool('show_capabilities', {\n title: 'Show capabilities',\n description: 'Return a concise summary for the standalone widget capability preview.',\n annotations: readOnly,\n input: z.object({}),\n output: z.object({ status: z.string(), note: z.string() }),\n fulfil: () => ({\n status: 'Food Ordering widget capabilities are ready.',\n note: 'Standalone preview covers React views, helper tools, cart state, handoff, CSP, and permissions.',\n }),\n viewName: 'capabilities_card',\n viewTitle: 'Food Ordering capabilities',\n viewDescription: 'Standalone widget resource for previewing the ordering capability surface.',\n domain: 'https://orders.example.com',\n view: { component: 'capabilities-card', entry: './views/capabilities-card.tsx' },\n csp: {\n connectDomains: ['https://orders.example.com'],\n resourceDomains: ['https://orders.example.com'],\n frameDomains: ['https://orders.example.com'],\n },\n permissions: { clipboardWrite: {} },\n }),\n resource('food_ordering_guide', {\n uri: 'docs://food-ordering',\n title: 'Food Ordering widget guide',\n description: 'Synthetic guide resource for the consumer ordering flagship.',\n mimeType: 'text/markdown',\n // Return the resource body directly; the runtime maps it into MCP `contents` using the\n // resource's own uri + mimeType. Do not return a `{ contents: [...] }` wrapper — that double-wraps.\n fulfil: () =>\n [\n '# Food Ordering Widget Guide',\n '',\n '- Demonstrates a multi-step ordering widget, app-only helper tools, typed cart state, and handoff.',\n '- Store, menu, and checkout data are synthetic and contain no customer credentials.',\n '- Checkout opens an allowlisted example URL; payment and final ordering remain out of scope.',\n ].join('\\n'),\n }),\n ],\n);\n" },
64
66
  { relPath: "examples/food-ordering/src/views/capabilities-card.tsx", content: "import { useLayout, useOpenExternal, useSendFollowUpMessage, useToolInfo } from '../helpers.js';\nimport './widget-style.css';\n\nconst capabilities: readonly {\n readonly name: string;\n readonly description: string;\n}[] = [\n {\n name: 'React view resource',\n description: 'Compiled widget HTML with a hydrated React entrypoint.',\n },\n {\n name: 'Widget helper calls',\n description: 'App-only tools route through the same host-mediated path.',\n },\n {\n name: 'Durable cart state',\n description: 'Caller-scoped cart records use Noodle state handles with revisions.',\n },\n {\n name: 'External handoff',\n description: 'Checkout opens through declared allowlisted domains.',\n },\n {\n name: 'Model context',\n description: 'Relevant UI state is mirrored through data-llm.',\n },\n {\n name: 'CSP and permissions',\n description: 'Resource metadata declares network and clipboard needs.',\n },\n] as const;\n\nexport default function CapabilitiesCard() {\n const { theme } = useLayout();\n const toolInfo = useToolInfo('show_capabilities');\n const openExternal = useOpenExternal();\n const sendFollowUpMessage = useSendFollowUpMessage();\n const structured = toolInfo.structuredContent as\n | { readonly status?: string; readonly note?: string }\n | undefined;\n\n return (\n <main\n className={`nw-shell${theme === 'dark' ? ' dark' : ''}`}\n data-llm={`Food Ordering capabilities: ${capabilities.map((item) => item.name).join(', ')}`}\n >\n <section className=\"nw-card\">\n <header className=\"nw-header\">\n <span className=\"nw-icon\" aria-hidden=\"true\">\n <PuzzleIcon />\n </span>\n <div className=\"nw-title-block\">\n <h1 className=\"nw-title\">MCP capabilities</h1>\n <p className=\"nw-subtitle\">\n {structured?.status ?? 'Food Ordering widget capabilities are ready.'}\n </p>\n </div>\n <span className=\"nw-chip\">Connected</span>\n </header>\n <div className=\"nw-body\">\n <p className=\"nw-section-title\">Available features</p>\n <ul className=\"nw-feature-list\">\n {capabilities.map((capability) => (\n <li className=\"nw-feature\" key={capability.name}>\n <span className=\"nw-check\" aria-hidden=\"true\">\n <CheckIcon />\n </span>\n <span>\n <span className=\"nw-feature-name\">{capability.name}</span>\n <span className=\"nw-feature-desc\">{capability.description}</span>\n </span>\n </li>\n ))}\n </ul>\n <div className=\"nw-actions\">\n <button\n className=\"nw-button nw-button-primary\"\n type=\"button\"\n onClick={() =>\n sendFollowUpMessage({\n prompt: 'Summarize what the Food Ordering MCP App widget demonstrates.',\n })\n }\n >\n <SparkIcon />\n Ask assistant\n </button>\n <button\n className=\"nw-button\"\n type=\"button\"\n onClick={() => openExternal('https://example.com/noodle-widget-docs')}\n >\n <ExternalIcon />\n Open docs\n </button>\n </div>\n {structured?.note ? <p className=\"nw-note\">{structured.note}</p> : null}\n </div>\n <footer className=\"nw-footer\">\n <span className=\"nw-meta\">\n <ShieldIcon />\n Secure widget surface\n </span>\n <span>v1.0.0</span>\n </footer>\n </section>\n </main>\n );\n}\n\nfunction PuzzleIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M8 4h5v4h3a2 2 0 0 1 0 4h-3v3H9v-3H6a2 2 0 0 1 0-4h2V4Z\" />\n <path d=\"M13 15v5H4v-5\" />\n <path d=\"M13 20h7v-8\" />\n </svg>\n );\n}\n\nfunction CheckIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"m6 12 4 4 8-8\" />\n </svg>\n );\n}\n\nfunction SparkIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"m12 3 1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8L12 3Z\" />\n </svg>\n );\n}\n\nfunction ExternalIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M14 4h6v6\" />\n <path d=\"m20 4-9 9\" />\n <path d=\"M20 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h5\" />\n </svg>\n );\n}\n\nfunction ShieldIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M12 3 5 6v5c0 4.4 2.8 8.3 7 10 4.2-1.7 7-5.6 7-10V6l-7-3Z\" />\n <path d=\"m9 12 2 2 4-4\" />\n </svg>\n );\n}\n" },
65
67
  { relPath: "examples/food-ordering/src/views/ordering-flow.tsx", content: "import { useEffect, useMemo, useState } from 'react';\nimport {\n ActionBar,\n AppShell,\n AsyncBoundary,\n ChoiceGroup,\n createViewStore,\n DataCard,\n DataList,\n Feedback,\n Field,\n Form,\n HandoffButton,\n QuantityStepper,\n ShellNav,\n StatusBadge,\n SubmitButton,\n useAppFlow,\n useCallTool,\n useHandoff,\n useLayout,\n useSendFollowUpMessage,\n useToolInfo,\n useUpdateModelContext,\n useViewState,\n useWidgetLifecycle,\n useWidgetReady,\n View,\n ViewStack,\n} from '../helpers.js';\nimport { isOrderingEntryResult, type MenuItem, type Store } from './ordering-result.js';\nimport './widget-style.css';\n\ntype ViewName = 'stores' | 'menu' | 'item' | 'cart' | 'review' | 'handoff';\n\ntype CartLine = {\n readonly itemId: string;\n readonly quantity: number;\n readonly modifiers: readonly string[];\n readonly note?: string;\n};\n\ntype CartState = {\n readonly selectedStoreId?: string;\n readonly lines: readonly CartLine[];\n readonly customer: string;\n readonly notes?: string;\n readonly subtotal: number;\n readonly status: 'draft' | 'review' | 'handoff';\n readonly checkoutUrl?: string;\n};\n\nconst zeroCart: CartState = {\n lines: [],\n customer: 'Guest',\n subtotal: 0,\n status: 'draft',\n};\n\nconst useCartStore = createViewStore<CartState>('cart', zeroCart);\nconst useCartRevisionStore = createViewStore('cart_revision', { value: 0 });\n\nfunction structured<T>(value: unknown): T | undefined {\n return (value as { structuredContent?: T } | undefined)?.structuredContent;\n}\n\nfunction currency(value: number): string {\n return `$${value.toFixed(2)}`;\n}\n\nfunction modifierLabel(value: string): string {\n return value\n .split('_')\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(' ');\n}\n\nexport default function OrderingFlow() {\n const ready = useWidgetReady();\n const { displayMode, supports, theme } = useLayout();\n const toolInfo = useToolInfo('open_ordering');\n const isPending = !ready || Object.keys(toolInfo).length === 0;\n const entry = isOrderingEntryResult(toolInfo.structuredContent)\n ? toolInfo.structuredContent\n : undefined;\n const flow = useAppFlow<ViewName>({\n key: 'ordering_flow',\n initialView: 'stores',\n views: ['stores', 'menu', 'item', 'cart', 'review', 'handoff'],\n });\n const view = flow.activeView;\n const setView = flow.navigate;\n const handoff = useHandoff();\n const sendFollowUpMessage = useSendFollowUpMessage();\n const updateModelContext = useUpdateModelContext();\n const publishLifecycle = useWidgetLifecycle('ordering-flow');\n const searchStores = useCallTool('search_stores');\n const loadMenu = useCallTool('load_menu');\n const loadItem = useCallTool('load_item');\n const readCart = useCallTool('read_cart');\n const syncCart = useCallTool('sync_cart');\n const prepareCheckout = useCallTool('prepare_checkout');\n\n const [query, setQuery] = useViewState('query', '');\n const [customer, setCustomer] = useViewState('customer', entry?.customer ?? 'Guest');\n const [selectedStoreId, setSelectedStoreId] = useViewState<string | undefined>(\n 'selected_store',\n entry?.stores?.[0]?.id,\n );\n const [selectedItemId, setSelectedItemId] = useViewState<string | undefined>(\n 'selected_item',\n entry?.featuredItems?.[0]?.id,\n );\n const cartStore = useCartStore();\n const revisionStore = useCartRevisionStore((state) => state.value);\n const cart =\n cartStore.state.customer === 'Guest' && entry?.customer\n ? { ...cartStore.state, customer: entry.customer }\n : cartStore.state;\n const revision = revisionStore.selected;\n const setCart = cartStore.setState;\n const setRevision = (value: number) => revisionStore.setState({ value });\n const [quantity, setQuantity] = useState(1);\n const [selectedModifiers, setSelectedModifiers] = useState<readonly string[]>([]);\n const [lifecycle, setLifecycle] = useState<'active' | 'submitted'>('active');\n\n const storeData = structured<{ readonly stores?: readonly Store[] }>(searchStores.data);\n const menuData = structured<{\n readonly stores?: readonly Store[];\n readonly items?: readonly MenuItem[];\n }>(loadMenu.data);\n const itemData = structured<{ readonly items?: readonly MenuItem[] }>(loadItem.data);\n const checkoutData = structured<{ readonly checkoutUrl?: string; readonly cart?: CartState }>(\n prepareCheckout.data,\n );\n const stores = storeData?.stores ?? entry?.stores ?? [];\n const queryText = query.trim().toLowerCase();\n const displayedStores = stores.filter(\n (store) =>\n queryText.length === 0 ||\n store.name.toLowerCase().includes(queryText) ||\n store.cuisine.toLowerCase().includes(queryText),\n );\n const allItems = menuData?.items ?? itemData?.items ?? entry?.featuredItems ?? [];\n const items = allItems.filter((item) => item.storeId === selectedStoreId);\n const currentStore =\n stores.find((store) => store.id === selectedStoreId) ?? menuData?.stores?.[0] ?? stores[0];\n const currentItem = allItems.find((item) => item.id === selectedItemId) ?? items[0];\n const lineItems = useMemo(\n () =>\n cart.lines.map((line) => ({\n ...line,\n item: [...(entry?.featuredItems ?? []), ...allItems].find(\n (item) => item.id === line.itemId,\n ),\n })),\n [cart.lines, entry?.featuredItems, allItems],\n );\n const llmSummary = `${view} view for ${customer}; ${cart.lines.length} cart lines; subtotal ${currency(\n cart.subtotal,\n )}`;\n const canUpdateModelContext = supports?.modelContext === true;\n\n useEffect(() => {\n if (!entry || !canUpdateModelContext) return;\n // Each call replaces model context, so publish one cohesive snapshot of current surface state.\n void updateModelContext({\n content: [{ type: 'text', text: `Food ordering: ${llmSummary}; ${lifecycle}.` }],\n structuredContent: {\n widget: { name: 'ordering-flow', lifecycle },\n ordering: {\n view,\n customer,\n cartLines: cart.lines.length,\n subtotal: cart.subtotal,\n selectedStoreId: selectedStoreId ?? null,\n selectedItemId: selectedItemId ?? null,\n },\n },\n });\n }, [\n canUpdateModelContext,\n cart.lines.length,\n cart.subtotal,\n customer,\n entry,\n lifecycle,\n llmSummary,\n selectedItemId,\n selectedStoreId,\n updateModelContext,\n view,\n ]);\n\n async function chooseStore(store: Store) {\n setSelectedStoreId(store.id);\n setView('menu');\n const result = await loadMenu.callTool({ storeId: store.id });\n const loaded = structured<{ readonly items?: readonly MenuItem[] }>(result);\n setSelectedItemId(loaded?.items?.find((item) => item.storeId === store.id)?.id);\n }\n\n async function chooseItem(item: MenuItem) {\n setSelectedItemId(item.id);\n setSelectedModifiers([]);\n setQuantity(1);\n setView('item');\n await loadItem.callTool({ itemId: item.id });\n }\n\n async function persistCart(nextCart: CartState, nextView: ViewName) {\n const result = await syncCart.callTool({\n selectedStoreId: nextCart.selectedStoreId,\n lines: nextCart.lines,\n customer: nextCart.customer,\n notes: nextCart.notes,\n subtotal: nextCart.subtotal,\n expectedRevision: revision,\n });\n const synced = structured<{ readonly cart?: CartState; readonly revision?: number }>(result);\n setCart(synced?.cart ?? nextCart);\n setRevision(synced?.revision ?? revision + 1);\n setView(nextView);\n }\n\n async function addCurrentItem() {\n if (!currentItem) return;\n const nextLines = [\n ...cart.lines,\n {\n itemId: currentItem.id,\n quantity,\n modifiers: selectedModifiers,\n },\n ];\n await persistCart(\n {\n ...cart,\n selectedStoreId: currentStore?.id ?? selectedStoreId,\n lines: nextLines,\n customer,\n subtotal: nextLines.reduce(\n (sum, line) =>\n sum +\n ([...(entry?.featuredItems ?? []), ...allItems].find((item) => item.id === line.itemId)\n ?.price ?? 0) *\n line.quantity,\n 0,\n ),\n status: 'draft',\n },\n 'cart',\n );\n }\n\n async function prepareHandoff() {\n const result = await prepareCheckout.callTool({\n selectedStoreId: cart.selectedStoreId,\n lines: cart.lines,\n customer,\n notes: cart.notes,\n subtotal: cart.subtotal,\n expectedRevision: revision,\n });\n const prepared = structured<{\n readonly cart?: CartState;\n readonly revision?: number;\n readonly checkoutUrl?: string;\n }>(result);\n const preparedCart = prepared?.cart ?? cart;\n setCart(preparedCart);\n setRevision(prepared?.revision ?? revision + 1);\n setLifecycle('submitted');\n setView('handoff');\n if (canUpdateModelContext) {\n await publishLifecycle('submitted', {\n view: 'handoff',\n customer,\n cartLines: preparedCart.lines.length,\n subtotal: preparedCart.subtotal,\n selectedStoreId: preparedCart.selectedStoreId ?? null,\n selectedItemId: selectedItemId ?? null,\n });\n }\n if (supports?.followUpMessage) {\n await sendFollowUpMessage({\n prompt: 'Checkout is prepared. Confirm the cart summary and explain the final handoff.',\n });\n }\n }\n\n if (isPending) {\n return (\n <Feedback status=\"loading\" title=\"Loading\">\n Loading food ordering…\n </Feedback>\n );\n }\n if (toolInfo.isError) {\n return (\n <Feedback status=\"error\" title=\"Ordering unavailable\">\n Could not load food ordering.\n </Feedback>\n );\n }\n if (!entry) {\n return (\n <Feedback status=\"error\" title=\"Invalid ordering result\">\n Food ordering result was incomplete.\n </Feedback>\n );\n }\n\n return (\n <AppShell\n className={`nw-shell${theme === 'dark' ? ' dark' : ''}`}\n data-llm={llmSummary}\n title=\"Food Ordering\"\n subtitle={entry?.status ?? 'Find a store, build a cart, and hand off checkout.'}\n icon={<BowlIcon />}\n badge={displayMode === 'fullscreen' ? 'Fullscreen' : view}\n footer={\n <>\n <span className=\"nw-meta\">\n <BagIcon />\n {cart.lines.length} items\n </span>\n <span className=\"nw-meta\">Revision {revision}</span>\n </>\n }\n >\n <ShellNav\n activeView={view}\n aria-label=\"Ordering steps\"\n items={(['stores', 'menu', 'cart', 'review', 'handoff'] as const).map((step) => ({\n view: step,\n label: step,\n }))}\n onNavigate={setView}\n />\n <div className=\"nw-body\">\n <ViewStack flow={flow}>\n <View name=\"stores\">\n <Form onSubmit={() => void searchStores.callTool({ query, openOnly: false })}>\n <div className=\"nw-field-grid\">\n <Field className=\"nw-field\" label=\"Customer\">\n <input\n className=\"nw-input\"\n value={customer}\n onChange={(event) => setCustomer(event.currentTarget.value)}\n />\n </Field>\n <Field className=\"nw-field\" label=\"Search\">\n <input\n className=\"nw-input\"\n value={query}\n placeholder=\"Noodles\"\n onChange={(event) => setQuery(event.currentTarget.value)}\n />\n </Field>\n </div>\n <ActionBar className=\"nw-actions\">\n <SubmitButton\n type=\"submit\"\n className=\"nw-button nw-button-primary\"\n disabled={!ready}\n pending={searchStores.isPending}\n pendingLabel=\"Searching...\"\n >\n <SearchIcon />\n Search stores\n </SubmitButton>\n <SubmitButton\n type=\"button\"\n className=\"nw-button\"\n pending={readCart.isPending}\n pendingLabel=\"Loading...\"\n onClick={async () => {\n const result = await readCart.callTool({});\n const stored = structured<{\n readonly value?: CartState;\n readonly revision?: number;\n }>(result);\n if (stored?.value?.lines) setCart(stored.value);\n setRevision(stored?.revision ?? revision);\n }}\n >\n <RefreshIcon />\n Load cart\n </SubmitButton>\n </ActionBar>\n </Form>\n <AsyncBoundary\n state={searchStores}\n isEmpty={displayedStores.length === 0}\n empty=\"No matching stores\"\n >\n <StoreList stores={displayedStores} onChoose={chooseStore} />\n </AsyncBoundary>\n </View>\n\n <View name=\"menu\">\n <SectionHeader title={currentStore?.name ?? 'Menu'} detail={currentStore?.address} />\n <AsyncBoundary\n state={loadMenu}\n isEmpty={items.length === 0}\n empty=\"No menu items loaded\"\n >\n <ItemList items={items} onChoose={chooseItem} />\n </AsyncBoundary>\n </View>\n\n <View name=\"item\">\n {currentItem ? (\n <>\n <SectionHeader title={currentItem.name} detail={currentItem.description} />\n <div className=\"nw-field-grid\">\n <Field className=\"nw-field\" label=\"Quantity\">\n <QuantityStepper value={quantity} min={1} onChange={setQuantity} />\n </Field>\n <div className=\"nw-summary nw-summary-compact\">\n <div className=\"nw-summary-row\">\n <dt>Price</dt>\n <dd>{currency(currentItem.price)}</dd>\n </div>\n </div>\n </div>\n <ChoiceGroup\n className=\"nw-modifier-grid\"\n values={currentItem.modifiers}\n selected={selectedModifiers}\n onChange={setSelectedModifiers}\n labelFor={modifierLabel}\n />\n <ActionBar className=\"nw-actions\">\n <SubmitButton\n type=\"button\"\n className=\"nw-button nw-button-primary\"\n pending={syncCart.isPending}\n pendingLabel=\"Adding...\"\n onClick={addCurrentItem}\n >\n <BagIcon />\n Add to cart\n </SubmitButton>\n <button className=\"nw-button\" type=\"button\" onClick={() => setView('menu')}>\n Back to menu\n </button>\n </ActionBar>\n </>\n ) : null}\n </View>\n\n <View name=\"cart\">\n <SectionHeader\n title=\"Cart\"\n detail={`${cart.lines.length} line${cart.lines.length === 1 ? '' : 's'}`}\n />\n <CartSummary lineItems={lineItems} subtotal={cart.subtotal} />\n <Field className=\"nw-field\" label=\"Notes\">\n <input\n className=\"nw-input\"\n value={cart.notes ?? ''}\n placeholder=\"Utensils, pickup name, or allergies\"\n onChange={(event) => setCart({ ...cart, notes: event.currentTarget.value })}\n />\n </Field>\n <ActionBar className=\"nw-actions\">\n <SubmitButton\n type=\"button\"\n className=\"nw-button\"\n pending={syncCart.isPending}\n pendingLabel=\"Saving...\"\n onClick={() => persistCart({ ...cart, customer, status: 'draft' }, 'review')}\n >\n <SaveIcon />\n Save cart\n </SubmitButton>\n <SubmitButton\n type=\"button\"\n className=\"nw-button nw-button-primary\"\n disabled={cart.lines.length === 0}\n pending={prepareCheckout.isPending}\n pendingLabel=\"Preparing...\"\n onClick={prepareHandoff}\n >\n <ExternalIcon />\n Prepare checkout\n </SubmitButton>\n </ActionBar>\n </View>\n\n <View name=\"review\">\n <SectionHeader\n title=\"Review order\"\n detail={`${cart.lines.length} line${cart.lines.length === 1 ? '' : 's'}`}\n />\n <CartSummary lineItems={lineItems} subtotal={cart.subtotal} />\n <ActionBar className=\"nw-actions\">\n <button className=\"nw-button\" type=\"button\" onClick={() => setView('cart')}>\n Edit cart\n </button>\n <SubmitButton\n type=\"button\"\n className=\"nw-button nw-button-primary\"\n disabled={cart.lines.length === 0}\n pending={prepareCheckout.isPending}\n pendingLabel=\"Preparing...\"\n onClick={prepareHandoff}\n >\n <ExternalIcon />\n Prepare checkout\n </SubmitButton>\n </ActionBar>\n </View>\n\n <View name=\"handoff\">\n <SectionHeader\n title=\"Checkout handoff\"\n detail=\"Payment stays with the ordering site.\"\n />\n <CartSummary lineItems={lineItems} subtotal={cart.subtotal} />\n <p className=\"nw-note\">\n The MCP App prepared a synthetic checkout URL and will open only the allowlisted\n example domain.\n </p>\n <ActionBar className=\"nw-actions\">\n <HandoffButton\n handoff={handoff}\n target={checkoutData?.checkoutUrl ?? cart.checkoutUrl ?? ''}\n className=\"nw-button nw-button-primary\"\n type=\"button\"\n pendingLabel=\"Opening...\"\n >\n <ExternalIcon />\n Continue checkout\n </HandoffButton>\n <button\n className=\"nw-button\"\n type=\"button\"\n onClick={() =>\n sendFollowUpMessage({\n prompt: `Summarize my food order for ${customer} before checkout.`,\n })\n }\n >\n <SparkIcon />\n Ask assistant\n </button>\n </ActionBar>\n </View>\n </ViewStack>\n </div>\n </AppShell>\n );\n}\n\nfunction SectionHeader({ title, detail }: { readonly title: string; readonly detail?: string }) {\n return (\n <div className=\"nw-section-head\">\n <p className=\"nw-section-title\">{title}</p>\n {detail ? <p className=\"nw-section-detail\">{detail}</p> : null}\n </div>\n );\n}\n\nfunction StoreList({\n stores,\n onChoose,\n}: {\n readonly stores: readonly Store[];\n readonly onChoose: (store: Store) => void;\n}) {\n return (\n <DataList className=\"nw-menu-list\">\n {stores.map((store) => (\n <DataCard\n as=\"button\"\n className=\"nw-menu-item\"\n key={store.id}\n type=\"button\"\n onClick={() => onChoose(store)}\n >\n <span>\n <span className=\"nw-menu-name\">{store.name}</span>\n <span className=\"nw-menu-desc\">\n {store.cuisine} · {store.address}\n </span>\n </span>\n <StatusBadge className=\"nw-status\" tone={store.open ? 'success' : 'neutral'}>\n {store.open ? `${store.etaMinutes}m` : 'Closed'}\n </StatusBadge>\n </DataCard>\n ))}\n </DataList>\n );\n}\n\nfunction ItemList({\n items,\n onChoose,\n}: {\n readonly items: readonly MenuItem[];\n readonly onChoose: (item: MenuItem) => void;\n}) {\n return (\n <DataList className=\"nw-menu-list\">\n {items.map((item) => (\n <DataCard\n as=\"button\"\n className=\"nw-menu-item\"\n key={item.id}\n type=\"button\"\n onClick={() => onChoose(item)}\n >\n <span>\n <span className=\"nw-menu-name\">{item.name}</span>\n <span className=\"nw-menu-desc\">{item.description}</span>\n </span>\n <span className=\"nw-price\">{currency(item.price)}</span>\n </DataCard>\n ))}\n </DataList>\n );\n}\n\nfunction CartSummary({\n lineItems,\n subtotal,\n}: {\n readonly lineItems: readonly (CartLine & { readonly item?: MenuItem })[];\n readonly subtotal: number;\n}) {\n return (\n <dl className=\"nw-summary\">\n {lineItems.length === 0 ? (\n <div className=\"nw-summary-row\">\n <dt>No items yet</dt>\n <dd>{currency(0)}</dd>\n </div>\n ) : (\n lineItems.map((line, index) => (\n <div className=\"nw-summary-row\" key={`${line.itemId}-${index}`}>\n <dt>\n {line.quantity} x {line.item?.name ?? line.itemId}\n {line.modifiers.length > 0 ? (\n <span className=\"nw-line-note\">{line.modifiers.map(modifierLabel).join(', ')}</span>\n ) : null}\n </dt>\n <dd>{currency((line.item?.price ?? 0) * line.quantity)}</dd>\n </div>\n ))\n )}\n <div className=\"nw-summary-row nw-total\">\n <dt>Subtotal</dt>\n <dd>{currency(subtotal)}</dd>\n </div>\n </dl>\n );\n}\n\nfunction BowlIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M4 11h16a7 7 0 0 1-7 7h-2a7 7 0 0 1-7-7Z\" />\n <path d=\"M7 21h10\" />\n <path d=\"M8 6c0-1 1-1 1-2\" />\n <path d=\"M12 6c0-1 1-1 1-2\" />\n <path d=\"M16 6c0-1 1-1 1-2\" />\n </svg>\n );\n}\n\nfunction SearchIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-4-4\" />\n </svg>\n );\n}\n\nfunction RefreshIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M20 12a8 8 0 1 1-2.3-5.6\" />\n <path d=\"M20 4v5h-5\" />\n </svg>\n );\n}\n\nfunction BagIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M6 8h12l-1 12H7L6 8Z\" />\n <path d=\"M9 8a3 3 0 0 1 6 0\" />\n </svg>\n );\n}\n\nfunction SaveIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M5 4h12l2 2v14H5V4Z\" />\n <path d=\"M8 4v6h8\" />\n <path d=\"M8 20v-5h8v5\" />\n </svg>\n );\n}\n\nfunction ExternalIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M14 4h6v6\" />\n <path d=\"m20 4-9 9\" />\n <path d=\"M20 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h5\" />\n </svg>\n );\n}\n\nfunction SparkIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"m12 3 1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8L12 3Z\" />\n </svg>\n );\n}\n" },
66
68
  { relPath: "examples/food-ordering/src/views/ordering-result.ts", content: "export type Store = {\n readonly id: string;\n readonly name: string;\n readonly cuisine: string;\n readonly address: string;\n readonly open: boolean;\n readonly etaMinutes: number;\n readonly rating: number;\n};\n\nexport type MenuItem = {\n readonly id: string;\n readonly storeId: string;\n readonly category: string;\n readonly name: string;\n readonly price: number;\n readonly description: string;\n readonly modifiers: readonly string[];\n};\n\nexport type OrderingEntryResult = {\n readonly customer: string;\n readonly stores: readonly Store[];\n readonly featuredItems: readonly MenuItem[];\n readonly status: string;\n};\n\nfunction nonEmptyString(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0;\n}\n\nfunction isStore(value: unknown): value is Store {\n if (value === null || typeof value !== 'object') return false;\n const store = value as Partial<Store>;\n return (\n nonEmptyString(store.id) &&\n nonEmptyString(store.name) &&\n nonEmptyString(store.cuisine) &&\n nonEmptyString(store.address) &&\n typeof store.open === 'boolean' &&\n typeof store.etaMinutes === 'number' &&\n Number.isFinite(store.etaMinutes) &&\n typeof store.rating === 'number' &&\n Number.isFinite(store.rating)\n );\n}\n\nfunction isMenuItem(value: unknown): value is MenuItem {\n if (value === null || typeof value !== 'object') return false;\n const item = value as Partial<MenuItem>;\n return (\n nonEmptyString(item.id) &&\n nonEmptyString(item.storeId) &&\n nonEmptyString(item.category) &&\n nonEmptyString(item.name) &&\n typeof item.price === 'number' &&\n Number.isFinite(item.price) &&\n nonEmptyString(item.description) &&\n Array.isArray(item.modifiers) &&\n item.modifiers.every(nonEmptyString)\n );\n}\n\nexport function isOrderingEntryResult(value: unknown): value is OrderingEntryResult {\n if (value === null || typeof value !== 'object') return false;\n const entry = value as Partial<OrderingEntryResult>;\n if (\n !nonEmptyString(entry.customer) ||\n !nonEmptyString(entry.status) ||\n !Array.isArray(entry.stores) ||\n !entry.stores.every(isStore) ||\n !Array.isArray(entry.featuredItems) ||\n !entry.featuredItems.every(isMenuItem)\n ) {\n return false;\n }\n const storeIds = new Set(entry.stores.map((store) => store.id));\n const itemIds = new Set(entry.featuredItems.map((item) => item.id));\n return (\n storeIds.size === entry.stores.length &&\n itemIds.size === entry.featuredItems.length &&\n entry.featuredItems.every((item) => storeIds.has(item.storeId))\n );\n}\n" },
67
69
  { relPath: "examples/food-ordering/src/views/widget-style.css", content: ":root {\n color-scheme: light dark;\n font-family:\n Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n --nw-bg: #ffffff;\n --nw-surface: #f7f7f5;\n --nw-surface-strong: #ffffff;\n --nw-text: #1f2328;\n --nw-muted: #677079;\n --nw-border: #d9dee3;\n --nw-accent: #0f8f5f;\n --nw-accent-strong: #047857;\n --nw-accent-soft: #e8f7ef;\n --nw-info: #1d6feb;\n --nw-info-soft: #eaf2ff;\n --nw-warn: #b7791f;\n --nw-danger: #c2410c;\n --nw-shadow: 0 18px 50px rgb(15 23 42 / 12%);\n --nw-radius: 8px;\n}\n\n.dark,\n[data-theme=\"dark\"] {\n --nw-bg: #111820;\n --nw-surface: #16212a;\n --nw-surface-strong: #101820;\n --nw-text: #f4f7f8;\n --nw-muted: #a4b0ba;\n --nw-border: #33414c;\n --nw-accent: #25c385;\n --nw-accent-strong: #19a974;\n --nw-accent-soft: #123a2b;\n --nw-info: #4c9aff;\n --nw-info-soft: #132b4d;\n --nw-warn: #f0b35b;\n --nw-danger: #fb7b54;\n --nw-shadow: 0 18px 50px rgb(0 0 0 / 28%);\n}\n\n* {\n box-sizing: border-box;\n}\n\nbody {\n margin: 0;\n background: var(--nw-bg);\n color: var(--nw-text);\n}\n\nbutton,\ninput,\nselect {\n font: inherit;\n}\n\n.nw-shell {\n min-height: 100vh;\n padding: 14px;\n background: var(--nw-bg);\n color: var(--nw-text);\n}\n\n.nw-card {\n width: min(100%, 560px);\n margin: 0 auto;\n border: 1px solid var(--nw-border);\n border-radius: var(--nw-radius);\n background: var(--nw-surface-strong);\n box-shadow: var(--nw-shadow);\n overflow: hidden;\n}\n\n.nw-card-wide {\n width: min(100%, 720px);\n}\n\n.nsr-card {\n width: min(100%, 560px);\n margin: 0 auto;\n border: 1px solid var(--nw-border);\n border-radius: var(--nw-radius);\n background: var(--nw-surface-strong);\n box-shadow: var(--nw-shadow);\n overflow: hidden;\n}\n\n.nsr-card-wide {\n width: min(100%, 720px);\n}\n\n.nw-header {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 14px;\n border-bottom: 1px solid var(--nw-border);\n}\n\n.nsr-header {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 14px;\n border-bottom: 1px solid var(--nw-border);\n}\n\n.nw-icon {\n display: inline-grid;\n width: 32px;\n height: 32px;\n flex: 0 0 auto;\n place-items: center;\n border-radius: 8px;\n background: linear-gradient(145deg, var(--nw-accent), var(--nw-accent-strong));\n color: white;\n}\n\n.nsr-icon {\n display: inline-grid;\n width: 32px;\n height: 32px;\n flex: 0 0 auto;\n place-items: center;\n border-radius: 8px;\n background: linear-gradient(145deg, var(--nw-accent), var(--nw-accent-strong));\n color: white;\n}\n\n.nw-icon svg,\n.nsr-icon svg,\n.nw-button svg,\n.nw-meta svg {\n width: 16px;\n height: 16px;\n stroke: currentColor;\n stroke-width: 2;\n fill: none;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.nw-title-block {\n min-width: 0;\n flex: 1;\n}\n\n.nsr-title-block {\n min-width: 0;\n flex: 1;\n}\n\n.nw-title {\n margin: 0;\n font-size: 16px;\n line-height: 1.2;\n font-weight: 700;\n letter-spacing: 0;\n}\n\n.nsr-title {\n margin: 0;\n font-size: 16px;\n line-height: 1.2;\n font-weight: 700;\n letter-spacing: 0;\n}\n\n.nw-subtitle {\n margin: 4px 0 0;\n color: var(--nw-muted);\n font-size: 12px;\n line-height: 1.35;\n}\n\n.nsr-subtitle {\n margin: 4px 0 0;\n color: var(--nw-muted);\n font-size: 12px;\n line-height: 1.35;\n}\n\n.nw-chip {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n min-height: 24px;\n padding: 3px 9px;\n border: 1px solid var(--nw-border);\n border-radius: 999px;\n background: var(--nw-surface);\n color: var(--nw-text);\n font-size: 12px;\n font-weight: 600;\n white-space: nowrap;\n}\n\n.nsr-chip {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n min-height: 24px;\n padding: 3px 9px;\n border: 1px solid var(--nw-border);\n border-radius: 999px;\n background: var(--nw-surface);\n color: var(--nw-text);\n font-size: 12px;\n font-weight: 600;\n white-space: nowrap;\n}\n\n.nw-chip::before {\n width: 7px;\n height: 7px;\n border-radius: 99px;\n background: var(--nw-accent);\n content: \"\";\n}\n\n.nsr-chip::before {\n width: 7px;\n height: 7px;\n border-radius: 99px;\n background: var(--nw-accent);\n content: \"\";\n}\n\n.nw-tabs {\n display: grid;\n grid-template-columns: repeat(5, minmax(0, 1fr));\n gap: 1px;\n border-bottom: 1px solid var(--nw-border);\n background: var(--nw-border);\n}\n\n.nsr-tabs {\n display: grid;\n grid-template-columns: repeat(5, minmax(0, 1fr));\n gap: 1px;\n border-bottom: 1px solid var(--nw-border);\n background: var(--nw-border);\n}\n\n.nw-tab {\n min-width: 0;\n min-height: 34px;\n border: 0;\n background: var(--nw-surface-strong);\n color: var(--nw-muted);\n font-size: 12px;\n font-weight: 700;\n text-transform: capitalize;\n cursor: pointer;\n}\n\n.nsr-tab {\n min-width: 0;\n min-height: 34px;\n border: 0;\n background: var(--nw-surface-strong);\n color: var(--nw-muted);\n font-size: 12px;\n font-weight: 700;\n text-transform: capitalize;\n cursor: pointer;\n}\n\n.nw-tab[aria-current=\"step\"] {\n color: var(--nw-text);\n background: var(--nw-accent-soft);\n}\n\n.nsr-tab[aria-current=\"step\"] {\n color: var(--nw-text);\n background: var(--nw-accent-soft);\n}\n\n.nw-body {\n display: grid;\n gap: 14px;\n padding: 14px;\n}\n\n.nw-grid {\n display: grid;\n grid-template-columns: minmax(0, 1fr) minmax(180px, 0.75fr);\n gap: 14px;\n}\n\n.nw-section-title {\n margin: 0 0 8px;\n font-size: 12px;\n font-weight: 700;\n}\n\n.nw-section-head {\n display: grid;\n gap: 2px;\n}\n\n.nw-section-detail {\n margin: 0;\n color: var(--nw-muted);\n font-size: 12px;\n}\n\n.nw-menu-list,\n.nw-summary-list,\n.nw-feature-list {\n display: grid;\n gap: 8px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.nw-menu-item {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 10px;\n width: 100%;\n padding: 10px;\n border: 1px solid var(--nw-border);\n border-radius: var(--nw-radius);\n background: var(--nw-bg);\n color: var(--nw-text);\n text-align: left;\n cursor: pointer;\n}\n\n.nw-menu-item[aria-pressed=\"true\"] {\n border-color: var(--nw-accent);\n background: var(--nw-accent-soft);\n}\n\n.nw-menu-name,\n.nw-feature-name {\n display: block;\n font-size: 13px;\n font-weight: 700;\n}\n\n.nw-menu-desc,\n.nw-feature-desc {\n display: block;\n margin-top: 3px;\n color: var(--nw-muted);\n font-size: 12px;\n line-height: 1.35;\n}\n\n.nw-price {\n align-self: center;\n color: var(--nw-text);\n font-size: 13px;\n font-weight: 700;\n}\n\n.nw-status {\n align-self: center;\n color: var(--nw-muted);\n font-size: 12px;\n font-weight: 800;\n white-space: nowrap;\n}\n\n.nw-status-ok {\n color: var(--nw-accent-strong);\n}\n\n.nw-field-grid {\n display: grid;\n grid-template-columns: 1fr 120px;\n gap: 10px;\n}\n\n.nw-field {\n display: grid;\n gap: 5px;\n color: var(--nw-muted);\n font-size: 12px;\n font-weight: 650;\n}\n\n.nsr-field-label {\n color: var(--nw-muted);\n}\n\n.nsr-stepper {\n display: grid;\n grid-template-columns: 34px minmax(42px, 1fr) 34px;\n width: 100%;\n min-height: 34px;\n border: 1px solid var(--nw-border);\n border-radius: 7px;\n overflow: hidden;\n background: var(--nw-bg);\n}\n\n.nsr-stepper button {\n border: 0;\n background: var(--nw-surface);\n color: var(--nw-text);\n cursor: pointer;\n}\n\n.nsr-stepper button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n.nsr-stepper-value {\n display: grid;\n place-items: center;\n color: var(--nw-text);\n font-size: 13px;\n font-weight: 800;\n}\n\n.nw-input,\n.nw-select {\n min-width: 0;\n width: 100%;\n min-height: 34px;\n padding: 7px 9px;\n border: 1px solid var(--nw-border);\n border-radius: 7px;\n background: var(--nw-bg);\n color: var(--nw-text);\n outline: none;\n}\n\n.nw-input:focus,\n.nw-select:focus,\n.nw-button:focus-visible,\n.nw-menu-item:focus-visible {\n border-color: var(--nw-info);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--nw-info) 24%, transparent);\n}\n\n.nw-modifier-grid {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 8px;\n}\n\n.nw-option {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 9px;\n border: 1px solid var(--nw-border);\n border-radius: 7px;\n background: var(--nw-bg);\n color: var(--nw-text);\n font-size: 12px;\n font-weight: 650;\n}\n\n.nsr-choice {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 9px;\n border: 1px solid var(--nw-border);\n border-radius: 7px;\n background: var(--nw-bg);\n color: var(--nw-text);\n font-size: 12px;\n font-weight: 650;\n}\n\n.nw-summary {\n display: grid;\n gap: 8px;\n padding: 10px;\n border: 1px solid var(--nw-border);\n border-radius: var(--nw-radius);\n background: var(--nw-surface);\n}\n\n.nw-summary-compact {\n align-self: end;\n}\n\n.nw-summary-row {\n display: flex;\n justify-content: space-between;\n gap: 12px;\n padding-bottom: 8px;\n border-bottom: 1px solid color-mix(in srgb, var(--nw-border) 70%, transparent);\n}\n\n.nw-summary-row:last-child {\n padding-bottom: 0;\n border-bottom: 0;\n}\n\n.nw-summary-row dt {\n color: var(--nw-muted);\n font-size: 12px;\n}\n\n.nw-line-note {\n display: block;\n margin-top: 2px;\n font-size: 11px;\n font-weight: 500;\n}\n\n.nw-summary-row dd {\n margin: 0;\n text-align: right;\n font-size: 13px;\n font-weight: 700;\n}\n\n.nw-total dd {\n font-size: 18px;\n}\n\n.nw-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.nsr-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.nw-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n min-height: 36px;\n padding: 8px 12px;\n border: 1px solid var(--nw-border);\n border-radius: 7px;\n background: var(--nw-bg);\n color: var(--nw-text);\n font-size: 13px;\n font-weight: 700;\n cursor: pointer;\n}\n\n.nw-button-primary {\n border-color: var(--nw-accent-strong);\n background: linear-gradient(145deg, var(--nw-accent), var(--nw-accent-strong));\n color: white;\n}\n\n.nw-button-info {\n border-color: var(--nw-info);\n background: var(--nw-info);\n color: white;\n}\n\n.nw-button:disabled {\n cursor: wait;\n opacity: 0.65;\n}\n\n.nw-note {\n margin: 0;\n padding: 10px;\n border: 1px solid var(--nw-border);\n border-radius: var(--nw-radius);\n background: var(--nw-surface);\n color: var(--nw-muted);\n font-size: 12px;\n line-height: 1.45;\n}\n\n.nw-footer {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 10px 14px;\n border-top: 1px solid var(--nw-border);\n color: var(--nw-muted);\n font-size: 12px;\n}\n\n.nsr-footer {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 10px 14px;\n border-top: 1px solid var(--nw-border);\n color: var(--nw-muted);\n font-size: 12px;\n}\n\n.nw-meta {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n}\n\n.nw-feature {\n display: grid;\n grid-template-columns: 24px minmax(0, 1fr);\n gap: 10px;\n padding: 10px;\n border: 1px solid var(--nw-border);\n border-radius: var(--nw-radius);\n background: var(--nw-bg);\n}\n\n.nw-check {\n display: inline-grid;\n width: 22px;\n height: 22px;\n place-items: center;\n border-radius: 6px;\n background: var(--nw-accent);\n color: white;\n font-size: 13px;\n font-weight: 800;\n}\n\n.nw-check svg {\n width: 14px;\n height: 14px;\n stroke: currentColor;\n stroke-width: 3;\n fill: none;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n@media (max-width: 560px) {\n .nw-shell {\n padding: 10px;\n }\n\n .nw-grid,\n .nw-field-grid,\n .nw-modifier-grid {\n grid-template-columns: 1fr;\n }\n\n .nw-tabs {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n }\n\n .nsr-tabs {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n }\n\n .nw-header {\n align-items: flex-start;\n }\n\n .nsr-header {\n align-items: flex-start;\n }\n\n .nw-chip {\n max-width: 120px;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .nsr-chip {\n max-width: 120px;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .nw-button {\n flex: 1 1 140px;\n }\n}\n" },
68
70
  { relPath: "examples/food-ordering/test/ordering-flow.test.ts", content: "// @vitest-environment happy-dom\n/// <reference lib=\"dom\" />\nimport { act, createElement as h } from 'react';\nimport { createRoot, type Root } from 'react-dom/client';\nimport { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';\nimport OrderingFlow from '../src/views/ordering-flow.js';\n\nvi.mock('../src/helpers.js', async () => {\n const { createElement } = await import('react');\n const container = ({ children }: { readonly children?: unknown }) =>\n createElement('div', null, children);\n const button = ({ children }: { readonly children?: unknown }) =>\n createElement('button', { type: 'button' }, children);\n return {\n ActionBar: container,\n AppShell: ({\n children,\n footer,\n subtitle,\n title,\n }: {\n readonly children?: unknown;\n readonly footer?: unknown;\n readonly subtitle?: string;\n readonly title?: string;\n }) => createElement('main', null, title, subtitle, children, footer),\n AsyncBoundary: container,\n ChoiceGroup: container,\n createViewStore:\n <T>(_key: string, initial: T) =>\n (selector?: (state: T) => unknown) => ({\n state: initial,\n selected: selector?.(initial),\n setState: () => undefined,\n }),\n DataCard: button,\n DataList: container,\n Feedback: ({ children, status }: { readonly children?: unknown; readonly status?: string }) =>\n createElement('div', { 'data-status': status }, children),\n Field: container,\n Form: ({ children }: { readonly children?: unknown }) => createElement('form', null, children),\n HandoffButton: button,\n QuantityStepper: container,\n ShellNav: container,\n StatusBadge: container,\n SubmitButton: button,\n useAppFlow: () => ({\n activeView: 'stores',\n navigate: () => undefined,\n back: () => undefined,\n canBack: false,\n params: {},\n }),\n useCallTool: () => ({\n status: 'idle',\n isIdle: true,\n isPending: false,\n isSuccess: false,\n isError: false,\n callTool: () => Promise.resolve({ structuredContent: {} }),\n callToolAsync: () => Promise.resolve({ structuredContent: {} }),\n reset: () => undefined,\n }),\n useHandoff: () => ({ status: 'idle', open: () => Promise.resolve() }),\n useLayout: () => ({\n theme: 'light',\n displayMode: 'inline',\n supports: { modelContext: false, followUpMessage: false },\n }),\n useSendFollowUpMessage: () => () => Promise.resolve(),\n useToolInfo: () => toolResult,\n useUpdateModelContext: () => () => Promise.resolve(),\n useViewState: <T>(_key: string, initial: T) => [initial, () => undefined] as const,\n useWidgetLifecycle: () => () => Promise.resolve(),\n useWidgetReady: () => true,\n View: container,\n ViewStack: container,\n };\n});\n\ntype ToolResult = {\n readonly content?: unknown;\n readonly structuredContent?: unknown;\n readonly _meta?: unknown;\n readonly isError?: boolean;\n};\n\nlet toolResult: ToolResult;\nlet root: Root | undefined;\n\nbeforeEach(() => {\n (globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true;\n toolResult = {};\n document.body.innerHTML = '<div id=\"root\"></div>';\n (globalThis as { __noodleReactVersion?: number }).__noodleReactVersion = 0;\n (globalThis as { __noodleReactBridge?: unknown }).__noodleReactBridge = {\n getToolResult: () => toolResult,\n getViewState: () => ({}),\n setWidgetState: () => undefined,\n getLayout: () => ({\n theme: 'light',\n displayMode: 'inline',\n supports: { modelContext: false, followUpMessage: false },\n }),\n callServerTool: () => Promise.resolve({ structuredContent: {} }),\n openExternal: () => Promise.resolve(),\n sendFollowUpMessage: () => Promise.resolve(),\n updateModelContext: () => Promise.resolve(),\n };\n});\n\nafterEach(() => {\n if (root) act(() => root?.unmount());\n root = undefined;\n delete (globalThis as { __noodleReactBridge?: unknown }).__noodleReactBridge;\n});\n\nfunction render(result: ToolResult): string {\n toolResult = result;\n root = createRoot(document.querySelector('#root') as HTMLElement);\n act(() => root?.render(h(OrderingFlow)));\n return document.body.textContent ?? '';\n}\n\ndescribe('food-ordering invoking result states', () => {\n it('renders pending without identifier-dependent actions before hydration', () => {\n const text = render({});\n expect(text).toContain('Loading food ordering');\n expect(text).not.toContain('Search stores');\n expect(document.querySelector('button')).toBeNull();\n });\n\n it('renders an explicit tool error without ordering actions', () => {\n const text = render({\n content: [{ type: 'text', text: 'Ordering is unavailable' }],\n isError: true,\n });\n expect(text).toContain('Could not load food ordering');\n expect(text).not.toContain('Search stores');\n expect(document.querySelector('button')).toBeNull();\n });\n\n it('rejects malformed success data before rendering identifier-dependent actions', () => {\n const text = render({\n structuredContent: {\n status: 'Ready',\n customer: 'Asha',\n stores: [{ name: 'Missing identifier' }],\n featuredItems: [],\n },\n });\n expect(text).toContain('Food ordering result was incomplete');\n expect(text).not.toContain('Search stores');\n expect(document.querySelector('button')).toBeNull();\n });\n\n it('preserves the ordering flow after valid hydration', () => {\n const text = render({\n structuredContent: {\n status: 'Ready to build a food order.',\n customer: 'Asha',\n stores: [\n {\n id: 'harbor-noodles',\n name: 'Harbor Noodles',\n cuisine: 'Noodles',\n address: '18 Pier Lane',\n open: true,\n etaMinutes: 24,\n rating: 4.8,\n },\n ],\n featuredItems: [\n {\n id: 'spicy_miso',\n storeId: 'harbor-noodles',\n category: 'Bowls',\n name: 'Spicy Miso Bowl',\n price: 16,\n description: 'Miso broth and noodles.',\n modifiers: ['extra_noodles'],\n },\n ],\n },\n });\n expect(text).toContain('Search stores');\n expect(text).toContain('Harbor Noodles');\n expect(document.querySelector('form')).not.toBeNull();\n });\n});\n" },
69
- { relPath: "examples/food-ordering/test/server.test.ts", content: "import { describe, expect, it } from 'vitest';\nimport app from '../src/server.js';\n\ndescribe('food-ordering example', () => {\n it('exports a Noodle server definition', () => {\n expect(typeof app.toManifest).toBe('function');\n });\n\n it('emits a complete ordering app manifest with cart state and app-only helpers', async () => {\n const manifest = (await app.toManifest()) as {\n server: {\n name: string;\n agentGuide?: unknown;\n context?: {\n defaults?: { locale?: string; timeZone?: string };\n ambient?: {\n outputSchema?: unknown;\n fulfilment?: { output?: unknown };\n };\n };\n };\n handoff?: { allowedDomains?: string[] };\n state?: { handles?: Record<string, { kind: string; scope: string }> };\n connectors?: Record<string, { id: string; version: string }>;\n tools: Array<{\n name: string;\n visibility?: string[];\n annotations?: Record<string, unknown>;\n output?: unknown;\n fulfilment?: { steps?: unknown[]; output?: unknown };\n }>;\n widgets?: Array<{\n name: string;\n tool: string;\n view?: { component?: string; entry?: string };\n }>;\n };\n\n expect(manifest.server.name).toBe('food_ordering');\n expect(manifest.server.agentGuide).toBeDefined();\n expect(manifest.server).not.toHaveProperty('distribution');\n expect(manifest.server.context).toMatchObject({\n defaults: { locale: 'en-US', timeZone: 'America/New_York' },\n ambient: {\n fulfilment: {\n output: {\n serviceArea: 'Harbor District',\n orderingDate: '${context.temporal.localDate}',\n },\n },\n },\n });\n expect(manifest.state?.handles?.cart).toMatchObject({\n kind: 'cart',\n scope: 'caller',\n });\n expect(manifest.handoff?.allowedDomains).toEqual(['https://orders.example.com']);\n expect(manifest.connectors?.state).toEqual({ id: 'noodle_state', version: '1.0.0' });\n\n const tools = new Map(manifest.tools.map((tool) => [tool.name, tool]));\n expect(manifest.widgets?.find((widget) => widget.tool === 'open_ordering')?.view).toMatchObject(\n {\n component: 'ordering-flow',\n entry: './views/ordering-flow.tsx',\n },\n );\n for (const helper of [\n 'search_stores',\n 'load_menu',\n 'load_item',\n 'read_cart',\n 'sync_cart',\n 'prepare_checkout',\n ]) {\n expect(tools.get(helper)?.visibility).toEqual(['app']);\n }\n expect(JSON.stringify(tools.get('open_ordering'))).toContain('featuredItems');\n expect(JSON.stringify(tools.get('open_ordering'))).toContain('${context.temporal.localDate}');\n expect(JSON.stringify(tools.get('open_ordering'))).toContain('${context.ambient.serviceArea}');\n expect(JSON.stringify(tools.get('sync_cart'))).toContain('revision');\n expect(tools.get('sync_cart')?.annotations?.confirm).toBe(false);\n expect(tools.get('prepare_checkout')?.annotations?.confirm).toBe(false);\n expect(tools.get('plan_order')?.fulfilment).toMatchObject({\n steps: [\n {\n id: 'choose_fulfilment',\n elicit: {\n message: 'How should we fulfil this order?',\n requestedSchema: {\n type: 'object',\n properties: {\n method: { type: 'string', enum: ['pickup', 'delivery'] },\n requestedDate: { type: 'string', format: 'date' },\n },\n required: ['method', 'requestedDate'],\n },\n },\n },\n ],\n output: {\n method: '${steps.choose_fulfilment.method}',\n requestedDate: '${steps.choose_fulfilment.requestedDate}',\n },\n });\n expect(manifest.widgets?.map((widget) => widget.name)).toContain('capabilities_card');\n });\n\n it('projects host distribution metadata separately from the runtime manifest', () => {\n const distribution = app.toDistributionMetadata();\n expect(distribution).toMatchObject({\n schemaVersion: 1,\n listing: { summary: expect.stringContaining('Browse local food') },\n assets: { icon: { alt: 'Food Ordering noodle bowl' }, screenshots: expect.any(Array) },\n });\n const scenarios = distribution?.review.scenarios ?? [];\n expect(scenarios.filter(({ shouldInvoke }) => shouldInvoke).map(({ id }) => id)).toEqual([\n 'build_order',\n 'browse_menu',\n 'compare_options',\n 'plan_pickup',\n 'review_checkout',\n ]);\n expect(scenarios.filter(({ shouldInvoke }) => !shouldInvoke).map(({ id }) => id)).toEqual([\n 'unrelated_weather',\n 'unrelated_email',\n 'unrelated_travel',\n ]);\n });\n});\n" },
71
+ { relPath: "examples/food-ordering/test/server.test.ts", content: "import { describe, expect, it } from 'vitest';\nimport app from '../src/server.js';\n\ndescribe('food-ordering example', () => {\n it('exports a Noodle server definition', () => {\n expect(typeof app.toManifest).toBe('function');\n });\n\n it('emits a complete ordering app manifest with cart state and app-only helpers', async () => {\n const manifest = (await app.toManifest()) as {\n server: {\n name: string;\n agentGuide?: unknown;\n context?: {\n defaults?: { locale?: string; timeZone?: string };\n ambient?: {\n outputSchema?: unknown;\n fulfilment?: { output?: unknown };\n };\n };\n };\n handoff?: { allowedDomains?: string[] };\n state?: { handles?: Record<string, { kind: string; scope: string }> };\n connectors?: Record<string, { id: string; version: string }>;\n tools: Array<{\n name: string;\n title?: string;\n visibility?: string[];\n annotations?: Record<string, unknown>;\n output?: unknown;\n fulfilment?: { steps?: unknown[]; output?: unknown };\n }>;\n widgets?: Array<{\n name: string;\n tool: string;\n view?: { component?: string; entry?: string };\n }>;\n };\n\n expect(manifest.server.name).toBe('food_ordering');\n expect(manifest.server.agentGuide).toBeDefined();\n expect(manifest.server).not.toHaveProperty('distribution');\n expect(manifest.server.context).toMatchObject({\n defaults: { locale: 'en-US', timeZone: 'America/New_York' },\n ambient: {\n fulfilment: {\n output: {\n serviceArea: 'Harbor District',\n orderingDate: '${context.temporal.localDate}',\n },\n },\n },\n });\n expect(manifest.state?.handles?.cart).toMatchObject({\n kind: 'cart',\n scope: 'caller',\n });\n expect(manifest.handoff?.allowedDomains).toEqual(['https://orders.example.com']);\n expect(manifest.connectors?.state).toEqual({ id: 'noodle_state', version: '1.0.0' });\n\n const tools = new Map(manifest.tools.map((tool) => [tool.name, tool]));\n expect(manifest.widgets?.find((widget) => widget.tool === 'open_ordering')?.view).toMatchObject(\n {\n component: 'ordering-flow',\n entry: './views/ordering-flow.tsx',\n },\n );\n for (const helper of [\n 'search_stores',\n 'load_menu',\n 'load_item',\n 'read_cart',\n 'sync_cart',\n 'prepare_checkout',\n ]) {\n expect(tools.get(helper)?.visibility).toEqual(['app']);\n }\n expect(JSON.stringify(tools.get('open_ordering'))).toContain('featuredItems');\n expect(JSON.stringify(tools.get('open_ordering'))).toContain('${context.temporal.localDate}');\n expect(JSON.stringify(tools.get('open_ordering'))).toContain('${context.ambient.serviceArea}');\n expect(JSON.stringify(tools.get('sync_cart'))).toContain('revision');\n expect(tools.get('sync_cart')?.annotations?.confirm).toBe(false);\n expect(tools.get('prepare_checkout')?.annotations?.confirm).toBe(false);\n expect(tools.get('plan_order')?.fulfilment).toMatchObject({\n steps: [\n {\n id: 'choose_fulfilment',\n elicit: {\n message: 'How should we fulfil this order?',\n requestedSchema: {\n type: 'object',\n properties: {\n method: { type: 'string', enum: ['pickup', 'delivery'] },\n requestedDate: { type: 'string', format: 'date' },\n },\n required: ['method', 'requestedDate'],\n },\n },\n },\n ],\n output: {\n method: '${steps.choose_fulfilment.method}',\n requestedDate: '${steps.choose_fulfilment.requestedDate}',\n },\n });\n expect(manifest.widgets?.map((widget) => widget.name)).toContain('capabilities_card');\n expect(manifest.tools.every((tool) => typeof tool.title === 'string')).toBe(true);\n });\n\n it('projects host distribution metadata separately from the runtime manifest', () => {\n const distribution = app.toDistributionMetadata();\n expect(distribution).toMatchObject({\n schemaVersion: 1,\n listing: { summary: expect.stringContaining('Browse local food') },\n assets: {\n icon: { alt: 'Food Ordering noodle bowl' },\n screenshots: [\n expect.objectContaining({\n alt: 'Food Ordering MCP App showing nearby stores',\n prompt: 'Help me build a noodle order for pickup.',\n }),\n expect.objectContaining({\n alt: 'Food Ordering MCP App showing the Harbor Noodles menu',\n prompt: 'Show me the Harbor Noodles menu.',\n }),\n expect.objectContaining({\n alt: 'Food Ordering MCP App reviewing a checkout handoff',\n prompt: 'Review my spicy miso bowl order before checkout.',\n }),\n ],\n },\n });\n const scenarios = distribution?.review.scenarios ?? [];\n expect(scenarios.filter(({ shouldInvoke }) => shouldInvoke).map(({ id }) => id)).toEqual([\n 'build_order',\n 'browse_menu',\n 'compare_options',\n 'plan_pickup',\n 'review_checkout',\n ]);\n expect(scenarios.filter(({ shouldInvoke }) => !shouldInvoke).map(({ id }) => id)).toEqual([\n 'unrelated_weather',\n 'unrelated_email',\n 'unrelated_travel',\n ]);\n expect(\n scenarios\n .filter(({ shouldInvoke }) => !shouldInvoke)\n .every((scenario) => !('tools' in scenario)),\n ).toBe(true);\n });\n});\n" },
70
72
  { relPath: "examples/food-ordering/vitest.config.ts", content: "import { defineConfig } from 'vitest/config';\n\nexport default defineConfig({\n resolve: {\n alias: {\n '@noodleseed/one': new URL('../../packages/authoring/src/index.ts', import.meta.url).pathname,\n '@noodle-borg/capabilities': new URL(\n '../../packages/capabilities/src/index.ts',\n import.meta.url,\n ).pathname,\n '@noodle-borg/compiler': new URL('../../packages/compiler/src/index.ts', import.meta.url)\n .pathname,\n '@noodle-borg/compute': new URL('../../packages/compute/src/index.ts', import.meta.url)\n .pathname,\n '@noodle-borg/connector-defs': new URL(\n '../../packages/connector-defs/src/index.ts',\n import.meta.url,\n ).pathname,\n '@noodle-borg/connector-http': new URL(\n '../../packages/connector-http/src/index.ts',\n import.meta.url,\n ).pathname,\n '@noodle-borg/runtime': new URL('../../packages/runtime/src/index.ts', import.meta.url)\n .pathname,\n },\n },\n test: {\n include: ['test/**/*.test.ts'],\n },\n});\n" },
71
73
  { relPath: "examples/gmail-multi-account/README.md", content: "# Gmail multi-account automation\n\n**Owns:** The flagship proof that one reusable connector can be bound to multiple independently\nauthenticated accounts inside one MCP server.\n\nThis fictional example binds `gmailConnector()` twice through separate `externalExchange()` logical\nconnections. Public tools always accept `accounts: [...]`; reads accept either account or the canonical\npersonal-then-work pair, while mutations accept exactly one account and require runtime confirmation.\n\nCapability slot: **reusable connector + independently authenticated multi-account bindings**. It is distinct\nfrom `customer-auth`, which owns authentication of the MCP caller rather than downstream connector accounts.\n\nThe labels `personal@example.com` and `work@example.com` are static display labels, not provider identities.\nThe deployment-owned credential provider maps each logical connection to its real Google authorization.\nNo Google client, provider account id, token, or real email address belongs in this project.\n\n## Safety and API boundary\n\n- Search, message/thread reads, draft reads, and vacation-setting reads may target one or both accounts.\n- Draft creation/update/send, label changes, archive, raw send, trash, and vacation updates target one account.\n- Every mutation is prepared against the exact selected binding and must be confirmed before dispatch.\n- `send_message.raw` and draft `raw` are RFC 2822 MIME bytes encoded with base64url. This example does not\n pretend that `to`/`subject`/`body` strings are sufficient to encode Unicode MIME correctly.\n- Vacation `startTime`/`endTime` schemas enforce only digit-shaped 1–19 character epoch-millisecond strings.\n When both are supplied, Gmail's backend remains authoritative for the required `startTime < endTime`\n relationship; this example does not claim cross-field JSON Schema validation.\n- Trash is reversible. Permanent message/thread/draft deletion, delegation, forwarding/sharing settings,\n and unrestricted raw HTTP requests are intentionally absent.\n\n## Local checks\n\n```sh\nnoodle validate\nnoodle test\n```\n\nThe committed tests compile hermetic fake connector responses. They never contact Gmail or load OAuth\ncredentials. A real deployment additionally needs an operator-provided external credential exchange\nendpoint for each logical connection.\n\n## Personal automation skill\n\nThe source skill is [`skills/personal-email-automation/SKILL.md`](skills/personal-email-automation/SKILL.md).\nValidate it with the standard skill validator before distribution. The source skill is shipped as part of\nthis example; canonical export of an app and its skill as an installable Codex plugin remains roadmap work\nand is not currently provided by Noodle Seed.\n" },
72
74
  { relPath: "examples/gmail-multi-account/noodle.json", content: "{\n \"entrypoint\": \"src/server.ts\",\n \"name\": \"gmail-multi-account\"\n}\n" },
@@ -1 +1 @@
1
- {"version":3,"file":"example-files.js","sourceRoot":"","sources":["../../src/generated/example-files.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"example-files.js","sourceRoot":"","sources":["../../src/generated/example-files.ts"],"names":[],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../src/generated/surface.ts"],"names":[],"mappings":"AAIA,qGAAqG;AACrG,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EA4DzC,CAAC;AAEF,8FAA8F;AAC9F,eAAO,MAAM,WAAW,EAAE,SAAS,MAAM,EA0BxC,CAAC;AAEF,iGAAiG;AACjG,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAwEhD,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,WAAW,EAAE,SAAS,MAAM,EAcxC,CAAC"}
1
+ {"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../src/generated/surface.ts"],"names":[],"mappings":"AAIA,qGAAqG;AACrG,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EA4DzC,CAAC;AAEF,8FAA8F;AAC9F,eAAO,MAAM,WAAW,EAAE,SAAS,MAAM,EA6BxC,CAAC;AAEF,iGAAiG;AACjG,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EA0EhD,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,WAAW,EAAE,SAAS,MAAM,EAcxC,CAAC"}