@noodleseed/agent-kit 0.17.0 → 0.19.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.
- package/manifest.json +45 -45
- package/package.json +1 -1
- package/skills/claude-code/SKILL.md +1 -1
- package/skills/claude-code/examples/acme-bistro/README.md +1 -1
- package/skills/claude-code/examples/acme-bistro/design/UX-Document.md +4 -4
- package/skills/claude-code/examples/acme-bistro/design/api-contract.md +3 -3
- package/skills/claude-code/examples/acme-bistro/design/wireframe.html +3 -3
- package/skills/claude-code/examples/acme-bistro/src/server.ts +8 -6
- package/skills/claude-code/examples/acme-discovery/README.md +1 -1
- package/skills/claude-code/examples/acme-discovery/design/UX-Document.md +3 -3
- package/skills/claude-code/examples/acme-discovery/design/wireframe.html +2 -2
- package/skills/claude-code/examples/acme-discovery/src/server.ts +6 -5
- package/skills/claude-code/examples/acme-tasks/README.md +27 -1
- package/skills/claude-code/examples/acme-tasks/design/UX-Document.md +2 -2
- package/skills/claude-code/examples/acme-tasks/design/wireframe.html +6 -6
- package/skills/claude-code/examples/acme-tasks/src/server.ts +6 -5
- package/skills/claude-code/examples/food-ordering/src/server.ts +27 -37
- package/skills/claude-code/references/authoring-workflow.md +5 -0
- package/skills/claude-code/references/cli-commands.md +1 -0
- package/skills/claude-code/references/compile-errors.md +2 -2
- package/skills/claude-code/references/experience-design.md +1 -1
- package/skills/claude-code/references/sdk-surface.md +10 -10
- package/skills/claude-code/references/troubleshooting.md +2 -2
- package/skills/claude-code/references/widgets-and-apps.md +10 -8
- package/skills/codex/SKILL.md +1 -1
- package/skills/codex/examples/acme-bistro/README.md +1 -1
- package/skills/codex/examples/acme-bistro/design/UX-Document.md +4 -4
- package/skills/codex/examples/acme-bistro/design/api-contract.md +3 -3
- package/skills/codex/examples/acme-bistro/design/wireframe.html +3 -3
- package/skills/codex/examples/acme-bistro/src/server.ts +8 -6
- package/skills/codex/examples/acme-discovery/README.md +1 -1
- package/skills/codex/examples/acme-discovery/design/UX-Document.md +3 -3
- package/skills/codex/examples/acme-discovery/design/wireframe.html +2 -2
- package/skills/codex/examples/acme-discovery/src/server.ts +6 -5
- package/skills/codex/examples/acme-tasks/README.md +27 -1
- package/skills/codex/examples/acme-tasks/design/UX-Document.md +2 -2
- package/skills/codex/examples/acme-tasks/design/wireframe.html +6 -6
- package/skills/codex/examples/acme-tasks/src/server.ts +6 -5
- package/skills/codex/examples/food-ordering/src/server.ts +27 -37
- package/skills/codex/references/authoring-workflow.md +5 -0
- package/skills/codex/references/cli-commands.md +1 -0
- package/skills/codex/references/compile-errors.md +2 -2
- package/skills/codex/references/experience-design.md +1 -1
- package/skills/codex/references/sdk-surface.md +10 -10
- package/skills/codex/references/troubleshooting.md +2 -2
- package/skills/codex/references/widgets-and-apps.md +10 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { annotations, server, tool,
|
|
1
|
+
import { annotations, server, tool, z } from '@noodleseed/one';
|
|
2
2
|
|
|
3
3
|
// Acme Getaways is a fictional travel brand. This app is deliberately top-of-funnel: discovery and
|
|
4
4
|
// configuration happen inside ChatGPT; the booking/transaction happens off-app on Acme's own site,
|
|
@@ -115,7 +115,7 @@ export default server(
|
|
|
115
115
|
},
|
|
116
116
|
},
|
|
117
117
|
[
|
|
118
|
-
|
|
118
|
+
tool('discover_getaways', {
|
|
119
119
|
description:
|
|
120
120
|
'Suggest Acme Getaways destinations for a vibe and month and render a discovery carousel.',
|
|
121
121
|
annotations: readOnly,
|
|
@@ -136,7 +136,7 @@ export default server(
|
|
|
136
136
|
travelers: input.travelers,
|
|
137
137
|
options: catalog,
|
|
138
138
|
}),
|
|
139
|
-
|
|
139
|
+
viewTitle: 'Discover getaways',
|
|
140
140
|
// ChatGPT host status copy (openai/toolInvocation/*) — required for widget-opening tools.
|
|
141
141
|
invoking: 'Finding getaways…',
|
|
142
142
|
invoked: 'Getaways ready',
|
|
@@ -145,7 +145,7 @@ export default server(
|
|
|
145
145
|
component: 'discovery-carousel',
|
|
146
146
|
entry: './views/discovery-carousel.tsx',
|
|
147
147
|
},
|
|
148
|
-
|
|
148
|
+
viewDescription:
|
|
149
149
|
'A top-of-funnel discovery carousel: pick a destination, then hand off to Acme to book.',
|
|
150
150
|
csp: {
|
|
151
151
|
connectDomains: ['https://acme.example'],
|
|
@@ -180,7 +180,8 @@ export default server(
|
|
|
180
180
|
handoffUrl: `https://book.acme.example/plan?dest=${input.destination}&month=${input.month}&pax=${input.travelers}&src=chatgpt`,
|
|
181
181
|
}),
|
|
182
182
|
}),
|
|
183
|
-
|
|
183
|
+
tool('shortlist_getaway', {
|
|
184
|
+
visibility: ['app'],
|
|
184
185
|
description: 'Record the traveler’s shortlisted destination from the discovery widget.',
|
|
185
186
|
annotations: localWrite,
|
|
186
187
|
input: z.object({
|
|
@@ -7,7 +7,7 @@ in one `TaskList` widget. It shows the "identify and prioritize the flows first,
|
|
|
7
7
|
the `noodle-seed` skill's `references/experience-design.md` teaches.
|
|
8
8
|
|
|
9
9
|
Capability slots: prioritized multi-flow app design, a two-way (read + write) in-chat pattern, a task-list
|
|
10
|
-
widget with `
|
|
10
|
+
widget with `tool` helpers, and a worked **design-first** artifact (the flow spec + wireframe
|
|
11
11
|
below). A real deployment would connect the user's account with the end-user auth pattern — see
|
|
12
12
|
[`../customer-auth/README.md`](../customer-auth/README.md); this example seeds a list so the focus stays
|
|
13
13
|
on the flows.
|
|
@@ -76,5 +76,31 @@ noodle deploy --access owner-only
|
|
|
76
76
|
noodle open
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
+
## Optional in-product assistant
|
|
80
|
+
|
|
81
|
+
The same task tools can also sit inside Acme's authenticated web app. Add an `assistant` option to this
|
|
82
|
+
server without creating a second tool set:
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
assistant: embeddedAssistant({
|
|
86
|
+
model: openAICompatible({
|
|
87
|
+
baseUrl: variable('ASSISTANT_MODEL_BASE_URL'),
|
|
88
|
+
model: variable('ASSISTANT_MODEL'),
|
|
89
|
+
apiKey: secret('ASSISTANT_MODEL_API_KEY'),
|
|
90
|
+
}),
|
|
91
|
+
allowedOrigins: ['https://tasks.example.com'],
|
|
92
|
+
layout: { mode: 'floating', position: 'bottom-right' },
|
|
93
|
+
labels: { welcomeHeading: 'How can I help with Acme Tasks?' },
|
|
94
|
+
}),
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The assistant automatically inherits this server's existing `branding` block, so its name, accent,
|
|
98
|
+
light/dark surfaces, density, and radius match the `TaskList` widget without a second brand declaration.
|
|
99
|
+
|
|
100
|
+
The customer backend exchanges its authenticated user through `@noodleseed/assistant/server`; the browser
|
|
101
|
+
uses the Web Component or React wrapper and never receives the embed client or model secret. Validate with
|
|
102
|
+
`noodle check --target embedded-assistant`, then create the backend credential with
|
|
103
|
+
`noodle assistant clients create` after deployment.
|
|
104
|
+
|
|
79
105
|
This example has no connector secrets and does not include tokens, caller-key mechanisms, or
|
|
80
106
|
`.env.noodle` values. All tasks are fictional seed data.
|
|
@@ -155,7 +155,7 @@ All tools are atomic, model-fillable from natural language, and each returns a s
|
|
|
155
155
|
**★ `list_today`** *(read-only · renders `TaskList`)*
|
|
156
156
|
- **Input:** `{ focus: string = "today" }`
|
|
157
157
|
- **Output:** `{ status, focus, tasks: [{ id, title, priority, done }] }`
|
|
158
|
-
- **Notes:** `
|
|
158
|
+
- **Notes:** `tool` — the one tool that opens the widget. Host status copy: invoking "Loading your tasks…", invoked "Tasks ready".
|
|
159
159
|
|
|
160
160
|
**★ `add_task`** *(local write, non-destructive · model-visible)*
|
|
161
161
|
- **Input:** `{ title: string, priority: "high"|"medium"|"low" = "medium" }`
|
|
@@ -170,7 +170,7 @@ All tools are atomic, model-fillable from natural language, and each returns a s
|
|
|
170
170
|
**`set_priority`** *(local write, non-destructive · widget-only)*
|
|
171
171
|
- **Input:** `{ task: string (id), priority: "high"|"medium"|"low" }`
|
|
172
172
|
- **Output:** `{ status, task, priority }`
|
|
173
|
-
- **Notes:** `
|
|
173
|
+
- **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.
|
|
174
174
|
|
|
175
175
|
---
|
|
176
176
|
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
<div class="rationale">
|
|
218
218
|
<h4>How to read these wireframes</h4>
|
|
219
219
|
<p>Solid-border phones are the <strong>in-ChatGPT app</strong>. Acme Tasks is a <strong>two-way (read + write) app</strong>, not a discovery funnel: every widget reflects the user's real list, and each action — capture, re-prioritize, complete — is <strong>recorded through a tool call</strong> and confirmed in-chat. The single dashed phone is the <strong>one-time account link</strong> (<span class="mono">customerAuth</span>); there is no transactional off-app step.</p>
|
|
220
|
-
<p>Widgets are built with the Noodle Seed authoring SDK — <span class="mono">
|
|
220
|
+
<p>Widgets are built with the Noodle Seed authoring SDK — <span class="mono">tool + view</span> renders <span class="mono">TaskList</span>; <span class="mono">tool + app visibility</span> powers the in-widget re-prioritize. Styling uses host/Noodle Seed semantic tokens via CSS cascade layers; the brand accent (<span class="mono">#7C3AED</span>) is reserved for the logo, checks, primary CTA and <em>high</em> emphasis. Priority uses fixed semantic colors: high red · medium amber · low slate.</p>
|
|
221
221
|
<p><span class="r-tag ux">UX</span> flow rationale <span class="r-tag ui">UI</span> interface rationale <span class="r-tag acme">ACME</span> product-model fit <span class="r-tag trust">TRUST</span> write-safety / grounding guardrail</p>
|
|
222
222
|
</div>
|
|
223
223
|
</div>
|
|
@@ -401,11 +401,11 @@
|
|
|
401
401
|
<div class="section" id="prioritize">
|
|
402
402
|
<span class="section-label">Flow 2 · the hub</span>
|
|
403
403
|
<h2 class="section-title">Prioritize — read the day, then re-order it in place</h2>
|
|
404
|
-
<p class="section-subtitle"><span class="mono">list_today</span> renders the grounded list, highest priority first; the per-row priority control (a <span class="mono">
|
|
404
|
+
<p class="section-subtitle"><span class="mono">list_today</span> renders the grounded list, highest priority first; the per-row priority control (a <span class="mono">tool + app visibility</span> helper hidden from the model) lets the user re-rank without describing the task twice. This is the widget the other two flows write into.</p>
|
|
405
405
|
<div class="rationale">
|
|
406
406
|
<h4>Why it's built this way</h4>
|
|
407
407
|
<p><span class="r-tag ux">UX</span> "What's on my plate?" wants an answer <em>and</em> a next move. The list is grouped high → low so the triager sees the real order at a glance and adjusts with one tap.</p>
|
|
408
|
-
<p><span class="r-tag acme">ACME</span> Re-prioritize is <span class="mono">set_priority</span> as <span class="mono">
|
|
408
|
+
<p><span class="r-tag acme">ACME</span> Re-prioritize is <span class="mono">set_priority</span> as <span class="mono">tool + app visibility</span> — <strong>widget-only</strong>, hidden from the model's tool surface. The model reasons about three tools (list, add, complete); the fourth is pure UI plumbing, keeping the model's choices clean.</p>
|
|
409
409
|
<p><span class="r-tag trust">TRUST</span> The list only ever shows tasks that exist — the app never invents a task or a priority. Every re-rank echoes a confirmation ("Set review_pr to high priority").</p>
|
|
410
410
|
</div>
|
|
411
411
|
<div class="phones-row">
|
|
@@ -543,7 +543,7 @@
|
|
|
543
543
|
<div class="section" id="api">
|
|
544
544
|
<span class="section-label">Technical appendix</span>
|
|
545
545
|
<h2 class="section-title">MCP tools & call sequence</h2>
|
|
546
|
-
<p class="section-subtitle">The four tools behind the flows. <span class="mono">list_today</span> is the only widget-opening tool (<span class="mono">
|
|
546
|
+
<p class="section-subtitle">The four tools behind the flows. <span class="mono">list_today</span> is the only widget-opening tool (<span class="mono">tool + view</span>); <span class="mono">set_priority</span> is widget-only (<span class="mono">tool + app visibility</span>, hidden from the model); <span class="mono">add_task</span> and <span class="mono">complete_task</span> are model-visible.</p>
|
|
547
547
|
|
|
548
548
|
<div class="api-panel">
|
|
549
549
|
<h4>Read & render (Flow 2 · the hub)</h4>
|
|
@@ -559,7 +559,7 @@
|
|
|
559
559
|
|
|
560
560
|
<div class="api-panel">
|
|
561
561
|
<h4>Prioritize (Flow 2 helper) & Complete (Flow 3)</h4>
|
|
562
|
-
<div class="api-step"><span class="verb">WRITE</span><span><span class="tname">set_priority</span> — returns { status, task, priority } ·
|
|
562
|
+
<div class="api-step"><span class="verb">WRITE</span><span><span class="tname">set_priority</span> — returns { status, task, priority } · tool + app visibility, hidden from the model</span></div>
|
|
563
563
|
<div class="api-note">Input <span class="mono">{ task:id, priority }</span>. Called only by the priority ▾ in TaskList — keeps the model's tool surface to the three it should reason about.</div>
|
|
564
564
|
<div class="api-step"><span class="verb">WRITE</span><span><span class="tname">complete_task</span> — returns { status, task } · model-visible</span></div>
|
|
565
565
|
<div class="api-note">Input <span class="mono">{ task:id, title:"" }</span>. Model-visible so "I finished X" completes directly; local non-destructive write, confirmed with the remaining count.</div>
|
|
@@ -596,7 +596,7 @@
|
|
|
596
596
|
|
|
597
597
|
<div class="footer">
|
|
598
598
|
Acme Tasks × ChatGPT — Two-Way App Wireframes · Noodle Seed · v1 · July 2026<br>
|
|
599
|
-
Illustrative wireframes for a fictional app. Built with the Noodle Seed authoring SDK (
|
|
599
|
+
Illustrative wireframes for a fictional app. Built with the Noodle Seed authoring SDK (tool + view / tool + app visibility · customerAuth). This flagship seeds the task list; a production deployment connects the user's account. Task data shown is sample content.
|
|
600
600
|
</div>
|
|
601
601
|
|
|
602
602
|
</body>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { annotations, server, tool,
|
|
1
|
+
import { annotations, server, tool, z } from '@noodleseed/one';
|
|
2
2
|
|
|
3
3
|
// Acme Tasks is a fictional productivity app. It is a two-way (read + write) experience rather than a
|
|
4
4
|
// top-of-funnel handoff: the top-3 prioritized user flows all complete in chat — Capture, Prioritize,
|
|
@@ -52,7 +52,7 @@ export default server(
|
|
|
52
52
|
},
|
|
53
53
|
[
|
|
54
54
|
// Flow 2 — Prioritize / Today: render the list so the human triages and the model can speak to it.
|
|
55
|
-
|
|
55
|
+
tool('list_today', {
|
|
56
56
|
description: 'Show today’s Acme Tasks and render the task-list widget.',
|
|
57
57
|
annotations: readOnly,
|
|
58
58
|
input: z.object({ focus: z.string().default('today') }),
|
|
@@ -66,8 +66,8 @@ export default server(
|
|
|
66
66
|
focus: input.focus,
|
|
67
67
|
tasks: today,
|
|
68
68
|
}),
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
viewTitle: 'Today’s tasks',
|
|
70
|
+
viewDescription: 'A prioritized task list: capture, re-prioritize, and complete in place.',
|
|
71
71
|
// ChatGPT host status copy (openai/toolInvocation/*) — required for widget-opening tools.
|
|
72
72
|
invoking: 'Loading your tasks…',
|
|
73
73
|
invoked: 'Tasks ready',
|
|
@@ -119,7 +119,8 @@ export default server(
|
|
|
119
119
|
}),
|
|
120
120
|
}),
|
|
121
121
|
// Flow 2 helper (widget-only): re-prioritize a task from the list widget.
|
|
122
|
-
|
|
122
|
+
tool('set_priority', {
|
|
123
|
+
visibility: ['app'],
|
|
123
124
|
description: 'Re-prioritize a task from the list widget.',
|
|
124
125
|
annotations: localWrite,
|
|
125
126
|
input: z.object({
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
annotations,
|
|
3
|
-
asset,
|
|
4
|
-
connector,
|
|
5
|
-
resource,
|
|
6
|
-
server,
|
|
7
|
-
tool,
|
|
8
|
-
toolForWidget,
|
|
9
|
-
toolWithWidget,
|
|
10
|
-
widget,
|
|
11
|
-
z,
|
|
12
|
-
} from '@noodleseed/one';
|
|
1
|
+
import { annotations, asset, connector, resource, server, tool, z } from '@noodleseed/one';
|
|
13
2
|
|
|
14
3
|
const heroImage = asset('assets/noodle-bowl.jpg');
|
|
15
4
|
|
|
@@ -235,7 +224,7 @@ export default server(
|
|
|
235
224
|
},
|
|
236
225
|
},
|
|
237
226
|
[
|
|
238
|
-
|
|
227
|
+
tool('open_ordering', {
|
|
239
228
|
description:
|
|
240
229
|
'Open a complete food-ordering widget with store discovery, menu browsing, cart review, and checkout handoff.',
|
|
241
230
|
annotations: readOnly,
|
|
@@ -257,13 +246,13 @@ export default server(
|
|
|
257
246
|
featuredItems: menu,
|
|
258
247
|
fallback: 'Open stores: Harbor Noodles (Noodles), Garden Wraps (Vegetarian).',
|
|
259
248
|
}),
|
|
260
|
-
|
|
249
|
+
viewTitle: 'Food ordering',
|
|
261
250
|
domain: 'https://orders.example.com',
|
|
262
251
|
view: {
|
|
263
252
|
component: 'ordering-flow',
|
|
264
253
|
entry: './views/ordering-flow.tsx',
|
|
265
254
|
},
|
|
266
|
-
|
|
255
|
+
viewDescription:
|
|
267
256
|
'A complete consumer ordering surface with app-only helper tools, cart state, and checkout handoff.',
|
|
268
257
|
csp: {
|
|
269
258
|
connectDomains: ['https://orders.example.com'],
|
|
@@ -272,7 +261,8 @@ export default server(
|
|
|
272
261
|
},
|
|
273
262
|
permissions: { clipboardWrite: {} },
|
|
274
263
|
}),
|
|
275
|
-
|
|
264
|
+
tool('search_stores', {
|
|
265
|
+
visibility: ['app'],
|
|
276
266
|
description: 'Filter synthetic restaurants for the ordering widget.',
|
|
277
267
|
annotations: readOnly,
|
|
278
268
|
input: z.object({
|
|
@@ -282,7 +272,8 @@ export default server(
|
|
|
282
272
|
output: z.object({ stores: z.array(storeShape) }),
|
|
283
273
|
fulfil: () => ({ stores }),
|
|
284
274
|
}),
|
|
285
|
-
|
|
275
|
+
tool('load_menu', {
|
|
276
|
+
visibility: ['app'],
|
|
286
277
|
description: 'Load synthetic menu categories and items for one store.',
|
|
287
278
|
annotations: readOnly,
|
|
288
279
|
input: z.object({ storeId: z.string() }),
|
|
@@ -293,14 +284,16 @@ export default server(
|
|
|
293
284
|
}),
|
|
294
285
|
fulfil: ({ input }) => ({ storeId: input.storeId, stores, items: menu }),
|
|
295
286
|
}),
|
|
296
|
-
|
|
287
|
+
tool('load_item', {
|
|
288
|
+
visibility: ['app'],
|
|
297
289
|
description: 'Load item details and modifier options for the ordering widget.',
|
|
298
290
|
annotations: readOnly,
|
|
299
291
|
input: z.object({ itemId: z.string() }),
|
|
300
292
|
output: z.object({ itemId: z.string(), items: z.array(menuItemShape) }),
|
|
301
293
|
fulfil: ({ input }) => ({ itemId: input.itemId, items: menu }),
|
|
302
294
|
}),
|
|
303
|
-
|
|
295
|
+
tool('read_cart', {
|
|
296
|
+
visibility: ['app'],
|
|
304
297
|
description: 'Read the caller-scoped ordering cart state.',
|
|
305
298
|
annotations: readOnly,
|
|
306
299
|
input: z.object({}),
|
|
@@ -314,7 +307,8 @@ export default server(
|
|
|
314
307
|
return { value: state.value, revision: state.revision, status: state.status };
|
|
315
308
|
},
|
|
316
309
|
}),
|
|
317
|
-
|
|
310
|
+
tool('sync_cart', {
|
|
311
|
+
visibility: ['app'],
|
|
318
312
|
description: 'Patch the caller-scoped ordering cart with the widget cart mirror.',
|
|
319
313
|
annotations: action,
|
|
320
314
|
input: cartInput,
|
|
@@ -333,7 +327,8 @@ export default server(
|
|
|
333
327
|
return { cart, revision: state.revision, status: state.status };
|
|
334
328
|
},
|
|
335
329
|
}),
|
|
336
|
-
|
|
330
|
+
tool('prepare_checkout', {
|
|
331
|
+
visibility: ['app'],
|
|
337
332
|
description: 'Prepare the caller-scoped cart for checkout handoff.',
|
|
338
333
|
annotations: action,
|
|
339
334
|
input: cartInput,
|
|
@@ -375,6 +370,17 @@ export default server(
|
|
|
375
370
|
status: 'Food Ordering widget capabilities are ready.',
|
|
376
371
|
note: 'Standalone preview covers React views, helper tools, cart state, handoff, CSP, and permissions.',
|
|
377
372
|
}),
|
|
373
|
+
viewName: 'capabilities_card',
|
|
374
|
+
viewTitle: 'Food Ordering capabilities',
|
|
375
|
+
viewDescription: 'Standalone widget resource for previewing the ordering capability surface.',
|
|
376
|
+
domain: 'https://orders.example.com',
|
|
377
|
+
view: { component: 'capabilities-card', entry: './views/capabilities-card.tsx' },
|
|
378
|
+
csp: {
|
|
379
|
+
connectDomains: ['https://orders.example.com'],
|
|
380
|
+
resourceDomains: ['https://orders.example.com'],
|
|
381
|
+
frameDomains: ['https://orders.example.com'],
|
|
382
|
+
},
|
|
383
|
+
permissions: { clipboardWrite: {} },
|
|
378
384
|
}),
|
|
379
385
|
resource('food_ordering_guide', {
|
|
380
386
|
uri: 'docs://food-ordering',
|
|
@@ -392,21 +398,5 @@ export default server(
|
|
|
392
398
|
'- Checkout opens an allowlisted example URL; payment and final ordering remain out of scope.',
|
|
393
399
|
].join('\n'),
|
|
394
400
|
}),
|
|
395
|
-
widget('capabilities_card', {
|
|
396
|
-
tool: 'show_capabilities',
|
|
397
|
-
title: 'Food Ordering capabilities',
|
|
398
|
-
domain: 'https://orders.example.com',
|
|
399
|
-
description: 'Standalone widget resource for previewing the ordering capability surface.',
|
|
400
|
-
view: {
|
|
401
|
-
component: 'capabilities-card',
|
|
402
|
-
entry: './views/capabilities-card.tsx',
|
|
403
|
-
},
|
|
404
|
-
csp: {
|
|
405
|
-
connectDomains: ['https://orders.example.com'],
|
|
406
|
-
resourceDomains: ['https://orders.example.com'],
|
|
407
|
-
frameDomains: ['https://orders.example.com'],
|
|
408
|
-
},
|
|
409
|
-
permissions: { clipboardWrite: {} },
|
|
410
|
-
}),
|
|
411
401
|
],
|
|
412
402
|
);
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
- Compute connector example
|
|
12
12
|
- Tests
|
|
13
13
|
- Secrets and variables
|
|
14
|
+
- Embedded assistant
|
|
14
15
|
- Boundaries
|
|
15
16
|
|
|
16
17
|
## Input paths
|
|
@@ -197,6 +198,10 @@ After focused tests pass, run `noodle validate --json`, `noodle test --json`, an
|
|
|
197
198
|
|
|
198
199
|
Author managed config as `secret("NAME")` / `variable("NAME")` and operate it with `noodle secrets set` / `noodle variables set` (scoped org/app/env). Never inline secret values in `server.ts`, tests, or generated files.
|
|
199
200
|
|
|
201
|
+
## Embedded assistant
|
|
202
|
+
|
|
203
|
+
To place the same server tools inside the SaaS web app, declare the shared identity once with `branding: { name: "Acme", accent: "#3157D5", surface: "#FFFFFF", surfaceDark: "#161B26", theme: { dark: { accent: "#9FB4FF" } } }`, then add `assistant: embeddedAssistant({ model: openAICompatible({ baseUrl: variable("ASSISTANT_MODEL_BASE_URL"), model: variable("ASSISTANT_MODEL"), apiKey: secret("ASSISTANT_MODEL_API_KEY") }), allowedOrigins: ["https://app.example.com"], layout: { mode: "floating", position: "bottom-right" } })`. Widgets and the embed inherit the same brand kit. Keep origins exact. The customer backend uses `@noodleseed/assistant/server` to exchange its already-authenticated user for a short-lived browser session; client and model secrets never enter the browser. Run `noodle check --target embedded-assistant` before deploy, then manage backend credentials with `noodle assistant clients create|list|rotate|revoke`.
|
|
204
|
+
|
|
200
205
|
## Boundaries
|
|
201
206
|
|
|
202
207
|
Do not hand-author manifest JSON/YAML, runtime artifacts, connector IR, or hosted asset metadata. Do not read or copy secrets, bearer tokens, refresh tokens, static access keys, `.env.noodle`, or `~/.noodle/config.json`. Hosted access is identity-based — do not add static data-plane credential paths.
|
|
@@ -46,6 +46,7 @@ Every `noodle` command, grouped by area. Local authoring commands (`validate`, `
|
|
|
46
46
|
| Command | What it does |
|
|
47
47
|
| :-- | :-- |
|
|
48
48
|
| `noodle link` | Bind this directory to a Noodle Seed Cloud target (org/app/env). |
|
|
49
|
+
| `noodle assistant` | Manage backend credentials for customer-branded embedded assistant clients. |
|
|
49
50
|
| `noodle deploy` | Deploy the server to Noodle Seed Cloud. |
|
|
50
51
|
| `noodle open` | Open or print the latest deployment URL. |
|
|
51
52
|
| `noodle status` | Show hosted deployment status. |
|
|
@@ -38,8 +38,8 @@ Run `noodle validate` (add `--json` for the machine-readable envelope, `--fix-pr
|
|
|
38
38
|
| `duplicate_prompt` | Two prompts share a name; rename one `prompt(...)`. |
|
|
39
39
|
| `duplicate_resource_uri` | Two resources resolve to the same URI; make each resource URI unique. |
|
|
40
40
|
| `unsupported_uri_template` | Fix the resource URI template to a supported form at the cited `path`. |
|
|
41
|
-
| `duplicate_widget` | Two
|
|
42
|
-
| `unknown_widget_tool` | The widget references a tool that does not exist; point `
|
|
41
|
+
| `duplicate_widget` | Two tool views share an identity; give each `viewName` or `view.component` a unique name. |
|
|
42
|
+
| `unknown_widget_tool` | The widget references a tool that does not exist; point `tool`/`view` at a declared tool (see `didYouMean`). |
|
|
43
43
|
| `unknown_widget_action_tool` | A widget action calls a tool that is not declared; declare it or fix the action target name. |
|
|
44
44
|
| `duplicate_widget_tool` | A tool is bound to more than one widget; bind each tool to a single widget. |
|
|
45
45
|
| `invalid_widget_binding` | Fix the `data-bind`/binding expression in the widget; it does not resolve against the tool output. |
|
|
@@ -87,7 +87,7 @@ the widget**, and the widget filled with plausible, internally consistent data (
|
|
|
87
87
|
Label each widget with its component name so the wireframe, the spec, and the code share one
|
|
88
88
|
vocabulary; put the funnel boundary at the top; and render off-app destinations distinctly (they are
|
|
89
89
|
reached only after the handoff). Each wireframe screen maps directly to noodle: a screen with a widget
|
|
90
|
-
is a `
|
|
90
|
+
is a `tool` + a React `view`; a plain answer is a `tool`; an off-app destination is a
|
|
91
91
|
`handoff.allowedDomains` entry. A compact single screen, anonymized to a fictional "Acme" business:
|
|
92
92
|
|
|
93
93
|
```html
|
|
@@ -14,13 +14,10 @@ Platform helper connectors are explicit subpath imports from `@noodleseed/one/pl
|
|
|
14
14
|
### Server & tools
|
|
15
15
|
|
|
16
16
|
- `server(name, options, definitions)` — the server/app root.
|
|
17
|
-
- `tool(name,
|
|
18
|
-
- `toolWithWidget(name, { ..., view })` — a model-visible tool that renders an MCP Apps widget.
|
|
19
|
-
- `toolForWidget(name, { ... })` — a widget-only helper tool, hidden from the model.
|
|
17
|
+
- `tool(name, options)` — declare every tool; add `view` to render an MCP App or `visibility: ["app"]` for an app-only helper.
|
|
20
18
|
|
|
21
|
-
###
|
|
19
|
+
### Views & assets
|
|
22
20
|
|
|
23
|
-
- `widget(...)` — declare a widget/view component.
|
|
24
21
|
- `asset("./path")` — reference a packaged asset (e.g. an image).
|
|
25
22
|
- `annotations(...)` — tool/Apps annotation metadata.
|
|
26
23
|
|
|
@@ -51,14 +48,17 @@ Platform helper connectors are explicit subpath imports from `@noodleseed/one/pl
|
|
|
51
48
|
|
|
52
49
|
- `z` — Zod, for input/output schemas (compiles to JSON Schema 2020-12).
|
|
53
50
|
|
|
51
|
+
### Other
|
|
52
|
+
|
|
53
|
+
- `embeddedAssistant`
|
|
54
|
+
- `openAICompatible`
|
|
55
|
+
|
|
54
56
|
## Authoring signatures
|
|
55
57
|
|
|
56
|
-
- `server(name, options, definitions)` — `options` commonly includes `title`, `version`, `instructions`, `branding`, `auth`, `use`, `provides`, `state`, and `handoff`; `definitions` is the array of tools/resources/prompts
|
|
57
|
-
- `tool(name, { description, input, output, annotations?, fulfil })` — `input`/`output` are Zod schemas; `fulfil({ input, connectors, user })` returns data matching `output`.
|
|
58
|
-
- `toolWithWidget(name, { description, input, output, fulfil, view })` — same as `tool`, plus `view: { component, entry }` for a React widget.
|
|
59
|
-
- `toolForWidget(name, { input, output, fulfil })` — helper tool for widget actions; hidden from the model.
|
|
58
|
+
- `server(name, options, definitions)` — `options` commonly includes `title`, `version`, `instructions`, `branding`, `auth`, `use`, `provides`, `state`, and `handoff`; `definitions` is the array of tools/resources/prompts.
|
|
59
|
+
- `tool(name, { description, input, output, annotations?, visibility?, view?, fulfil })` — `input`/`output` are Zod schemas; `fulfil({ input, connectors, user })` returns data matching `output`. Add `view: { component, entry }` for a React widget; use `visibility: ["app"]` for an app-only helper.
|
|
60
60
|
- `resource(name, { uri, description?, mimeType?, fulfil })` and `prompt(name, { description?, arguments?, fulfil })` expose MCP resources/prompts.
|
|
61
|
-
-
|
|
61
|
+
- View metadata (`viewTitle`, `viewDescription`, `csp`, `domain`, `permissions`) belongs on the tool that renders it; `asset("./path")` packages local files.
|
|
62
62
|
- `customerAuth.*(...)` belongs in `server` options when deployed customer callers need verified identity; inspect `examples/customer-auth` or `examples/sharepoint` before using it.
|
|
63
63
|
- `state` defines durable widget state handles; `handoff` declares allowed external domains for safe host handoff.
|
|
64
64
|
|
|
@@ -19,9 +19,9 @@ For protocol/conformance checks, the headless harness is `@mcpjam/cli`, not a `n
|
|
|
19
19
|
| ChatGPT warns “Widget CSP is not set” | The widget declares no `csp` | Declare `csp` on the widget with the exact origins it uses |
|
|
20
20
|
| ChatGPT warns “Widget domain is not set” | No `domain` on the widget (required for app-store submission) | Set `domain: "https://…"` (one https origin per app) on each widget |
|
|
21
21
|
| External links do nothing, or show a safe-link warning | Link opened outside the host bridge, or the target origin is not allowlisted | Use `useOpenExternal()` (never `window.open`) and add the target origins to the server-level `handoff.allowedDomains` |
|
|
22
|
-
| Tool succeeds but no widget appears | The tool has no view, or the host surface doesn’t support MCP Apps | Use `
|
|
22
|
+
| Tool succeeds but no widget appears | The tool has no view, or the host surface doesn’t support MCP Apps | Use `tool`, run `noodle check`, preview with `noodle devtools`; on non-Apps surfaces only the text/structured result renders |
|
|
23
23
|
| Widget shows stale or missing data | The widget reads `structuredContent`, which must match the `output` schema | Make `fulfil` return exactly the `output` shape (arrays and nested objects are supported); inspect the live result with `noodle devtools` |
|
|
24
|
-
| `useCallTool` fails from the widget | Tool name mismatch, or the helper tool is model-visible | List names with `noodle tools`; widget-only helpers must be declared with `
|
|
24
|
+
| `useCallTool` fails from the widget | Tool name mismatch, or the helper tool is model-visible | List names with `noodle tools`; widget-only helpers must be declared with `tool` |
|
|
25
25
|
| `noodle validate` passes but React views fail to bundle (“requires Vite”) | Project dependencies are not installed — widget bundling uses the app-local Vite | Run the project’s package install, then retry `noodle dev` / `noodle deploy` |
|
|
26
26
|
| Hosted endpoint returns 401 to probes | Expected: hosted servers challenge unauthenticated calls with OAuth metadata | Sign in from the host when prompted; widen who may call with `noodle access set` if testers are outside the org |
|
|
27
27
|
| Tools error only after deploy | Runtime/config differences surface hosted (secrets, connector reachability) | Run `noodle smoke`, then `noodle metrics --agent-output` and `noodle events --tool <name> --status tool_error --json`; check `noodle secrets list` scope |
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
## Tools and views
|
|
14
14
|
|
|
15
|
-
Use `
|
|
15
|
+
Use `tool(name, { description, input, output, fulfil, view })` for a model-visible tool that renders a widget, and the same `tool(name, { ..., visibility: ["app"] })` for an app-only helper hidden from the model. A `view` is `{ component: "name", entry: "./views/name.tsx" }` — a React component the compiler bundles at validate/deploy time.
|
|
16
16
|
|
|
17
17
|
## React hook surface
|
|
18
18
|
|
|
@@ -21,9 +21,10 @@ Author views as React components. `generateHelpers<ServerDefinition>()` (from `@
|
|
|
21
21
|
| Hook | Use for |
|
|
22
22
|
| :-- | :-- |
|
|
23
23
|
| `useToolInfo` | Read the invoking tool result; `structuredContent` is the widget’s typed data payload. |
|
|
24
|
-
| `useCallTool` | Call a tool from the widget — returns `{ status, callTool, callToolAsync, data, structuredContent, error, reset }`; target a model-visible tool or a hidden `
|
|
24
|
+
| `useCallTool` | Call a tool from the widget — returns `{ status, callTool, callToolAsync, data, structuredContent, error, reset }`; target a model-visible tool or a hidden `tool` helper. |
|
|
25
25
|
| `useViewState` | Persist per-widget UI state across re-renders and restores: `const [value, setValue] = useViewState("key", initial)`. |
|
|
26
26
|
| `useLayout` | Read host layout: `{ theme, displayMode, locale?, host?, supports? }` (`displayMode` is `"inline"`/`"pip"`/`"fullscreen"`) — adapt styling to the host theme and mode. |
|
|
27
|
+
| `useBranding` | Read the server-level brand name and themed logo/mark/avatar URLs when widget content needs identity assets; CSS tokens are applied automatically. |
|
|
27
28
|
| `useRequestDisplayMode` | Request a host-mediated layout change such as fullscreen; treat it as best-effort and keep inline rendering useful. |
|
|
28
29
|
| `useOpenExternal` | Open an external link through the host (never `window.open`); the target origin must be listed in the server-level `handoff.allowedDomains`. |
|
|
29
30
|
| `useSendFollowUpMessage` | Send a follow-up prompt to the model from a user interaction: `send({ prompt })` — trigger only from an explicit user action. |
|
|
@@ -94,10 +95,10 @@ export default function OrderStatus() {
|
|
|
94
95
|
|
|
95
96
|
### 2. The tool declaration
|
|
96
97
|
|
|
97
|
-
`
|
|
98
|
+
`tool` declares both the model-visible tool that renders the view and app-only helpers the view calls. Put `visibility: ["app"]` on each helper. Wire `view: { component, entry }`, `csp`, a widget `domain`, and a real `output` schema so non-Apps hosts still receive structured data. Inside `fulfil`, `input` is a symbolic ref recorded into a flow — reference it in output/template strings, but never use it as an object key or `if` condition.
|
|
98
99
|
|
|
99
100
|
```ts
|
|
100
|
-
import { annotations, server,
|
|
101
|
+
import { annotations, server, tool, z } from '@noodleseed/one';
|
|
101
102
|
|
|
102
103
|
const item = z.enum(['falafel_wrap', 'lentil_soup', 'mint_lemonade']).default('falafel_wrap');
|
|
103
104
|
const checkoutUrl = (customer: string) =>
|
|
@@ -112,7 +113,7 @@ export default server(
|
|
|
112
113
|
handoff: { allowedDomains: ['https://orders.example.com'] },
|
|
113
114
|
},
|
|
114
115
|
[
|
|
115
|
-
|
|
116
|
+
tool('show_order', {
|
|
116
117
|
description: 'Show the pickup order and render the ordering widget.',
|
|
117
118
|
// Declare tool annotations — a ChatGPT-submission requirement. A read → `readOnly()`.
|
|
118
119
|
annotations: annotations.readOnly(),
|
|
@@ -129,8 +130,8 @@ export default server(
|
|
|
129
130
|
total: 12,
|
|
130
131
|
checkoutUrl: checkoutUrl(input.customer),
|
|
131
132
|
}),
|
|
132
|
-
|
|
133
|
-
|
|
133
|
+
viewTitle: 'Pickup order',
|
|
134
|
+
viewDescription: 'Pick an item and place a pickup order.',
|
|
134
135
|
// A ChatGPT App is this widget + a domain: one https origin per app.
|
|
135
136
|
domain: 'https://pickup.example.com',
|
|
136
137
|
view: { component: 'order-status', entry: './views/order-status.tsx' },
|
|
@@ -142,7 +143,8 @@ export default server(
|
|
|
142
143
|
},
|
|
143
144
|
}),
|
|
144
145
|
// Widget-only helper the view calls with useCallTool('place_order'); hidden from the model.
|
|
145
|
-
|
|
146
|
+
tool('place_order', {
|
|
147
|
+
visibility: ['app'],
|
|
146
148
|
description: 'Place a pickup order from the widget.',
|
|
147
149
|
// A write that reaches the outside world → `action()` (not read-only, not destructive).
|
|
148
150
|
annotations: annotations.action(),
|