@noodleseed/agent-kit 0.94.0 → 0.95.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 +565 -357
- package/package.json +1 -1
- package/skills/claude-code/SKILL.md +1 -1
- package/skills/claude-code/authoring-mcp-servers/SKILL.md +1 -1
- package/skills/claude-code/authoring-mcp-servers/references/authoring-workflow.md +5 -11
- package/skills/claude-code/authoring-mcp-servers/references/build-an-mcp-server.md +2 -2
- package/skills/claude-code/building-mcp-apps/SKILL.md +1 -1
- package/skills/claude-code/building-mcp-apps/references/build-an-mcp-app.md +2 -2
- package/skills/claude-code/connecting-apis-to-mcp/SKILL.md +1 -1
- package/skills/claude-code/connecting-apis-to-mcp/references/authoring-workflow.md +5 -11
- package/skills/claude-code/connecting-apis-to-mcp/references/connect-an-api.md +2 -2
- package/skills/claude-code/creating-product-agent-guides/SKILL.md +1 -1
- package/skills/claude-code/debugging-mcp-delivery/SKILL.md +1 -1
- package/skills/claude-code/debugging-mcp-delivery/references/verify-and-recover.md +2 -1
- package/skills/claude-code/deploying-mcp-services/SKILL.md +1 -1
- package/skills/claude-code/designing-mcp-products/SKILL.md +1 -1
- package/skills/claude-code/designing-mcp-products/references/authoring-workflow.md +5 -11
- package/skills/claude-code/embedding-mcp-assistants/SKILL.md +1 -1
- package/skills/claude-code/embedding-mcp-assistants/references/authoring-workflow.md +5 -11
- package/skills/claude-code/embedding-mcp-assistants/references/embedded-assistant.md +33 -27
- package/skills/claude-code/examples/acme-tasks/README.md +14 -4
- package/skills/claude-code/examples/customer-auth/README.md +3 -0
- package/skills/claude-code/examples/hello/README.md +4 -2
- package/skills/claude-code/examples/stateful-draft/README.md +115 -0
- package/skills/claude-code/examples/stateful-draft/noodle.json +5 -0
- package/skills/claude-code/examples/stateful-draft/package.json +22 -0
- package/skills/claude-code/examples/stateful-draft/site/client.js +44 -0
- package/skills/claude-code/examples/stateful-draft/site/demo.mjs +158 -0
- package/skills/claude-code/examples/stateful-draft/site/index.html +41 -0
- package/skills/claude-code/examples/stateful-draft/src/helpers.ts +6 -0
- package/skills/claude-code/examples/stateful-draft/src/server.ts +159 -0
- package/skills/claude-code/examples/stateful-draft/src/views/draft-card.tsx +152 -0
- package/skills/claude-code/examples/stateful-draft/src/views/widget-style.css +93 -0
- package/skills/claude-code/examples/stateful-draft/test/draft-card.test.tsx +88 -0
- package/skills/claude-code/examples/stateful-draft/test/server.test.ts +58 -0
- package/skills/claude-code/examples/stateful-draft/vitest.config.ts +6 -0
- package/skills/claude-code/executing-noodle-plans/SKILL.md +1 -1
- package/skills/claude-code/publishing-mcp-integrations/SKILL.md +1 -1
- package/skills/claude-code/references/authoring-workflow.md +5 -11
- package/skills/claude-code/references/build-an-mcp-app.md +2 -2
- package/skills/claude-code/references/build-an-mcp-server.md +2 -2
- package/skills/claude-code/references/connect-an-api.md +2 -2
- package/skills/claude-code/references/embedded-assistant.md +33 -27
- package/skills/claude-code/references/examples.md +1 -1
- package/skills/claude-code/references/verify-and-recover.md +2 -1
- package/skills/claude-code/reporting-noodle-feedback/SKILL.md +1 -1
- package/skills/claude-code/verifying-mcp-delivery/SKILL.md +1 -1
- package/skills/claude-code/verifying-mcp-delivery/references/verify-and-recover.md +2 -1
- package/skills/claude-code/wrapping-existing-applications/SKILL.md +1 -1
- package/skills/claude-code/wrapping-existing-applications/references/authoring-workflow.md +5 -11
- package/skills/codex/SKILL.md +1 -1
- package/skills/codex/authoring-mcp-servers/SKILL.md +1 -1
- package/skills/codex/authoring-mcp-servers/references/authoring-workflow.md +5 -11
- package/skills/codex/authoring-mcp-servers/references/build-an-mcp-server.md +2 -2
- package/skills/codex/building-mcp-apps/SKILL.md +1 -1
- package/skills/codex/building-mcp-apps/references/build-an-mcp-app.md +2 -2
- package/skills/codex/connecting-apis-to-mcp/SKILL.md +1 -1
- package/skills/codex/connecting-apis-to-mcp/references/authoring-workflow.md +5 -11
- package/skills/codex/connecting-apis-to-mcp/references/connect-an-api.md +2 -2
- package/skills/codex/creating-product-agent-guides/SKILL.md +1 -1
- package/skills/codex/debugging-mcp-delivery/SKILL.md +1 -1
- package/skills/codex/debugging-mcp-delivery/references/verify-and-recover.md +2 -1
- package/skills/codex/deploying-mcp-services/SKILL.md +1 -1
- package/skills/codex/designing-mcp-products/SKILL.md +1 -1
- package/skills/codex/designing-mcp-products/references/authoring-workflow.md +5 -11
- package/skills/codex/embedding-mcp-assistants/SKILL.md +1 -1
- package/skills/codex/embedding-mcp-assistants/references/authoring-workflow.md +5 -11
- package/skills/codex/embedding-mcp-assistants/references/embedded-assistant.md +33 -27
- package/skills/codex/examples/acme-tasks/README.md +14 -4
- package/skills/codex/examples/customer-auth/README.md +3 -0
- package/skills/codex/examples/hello/README.md +4 -2
- package/skills/codex/examples/stateful-draft/README.md +115 -0
- package/skills/codex/examples/stateful-draft/noodle.json +5 -0
- package/skills/codex/examples/stateful-draft/package.json +22 -0
- package/skills/codex/examples/stateful-draft/site/client.js +44 -0
- package/skills/codex/examples/stateful-draft/site/demo.mjs +158 -0
- package/skills/codex/examples/stateful-draft/site/index.html +41 -0
- package/skills/codex/examples/stateful-draft/src/helpers.ts +6 -0
- package/skills/codex/examples/stateful-draft/src/server.ts +159 -0
- package/skills/codex/examples/stateful-draft/src/views/draft-card.tsx +152 -0
- package/skills/codex/examples/stateful-draft/src/views/widget-style.css +93 -0
- package/skills/codex/examples/stateful-draft/test/draft-card.test.tsx +88 -0
- package/skills/codex/examples/stateful-draft/test/server.test.ts +58 -0
- package/skills/codex/examples/stateful-draft/vitest.config.ts +6 -0
- package/skills/codex/executing-noodle-plans/SKILL.md +1 -1
- package/skills/codex/publishing-mcp-integrations/SKILL.md +1 -1
- package/skills/codex/references/authoring-workflow.md +5 -11
- package/skills/codex/references/build-an-mcp-app.md +2 -2
- package/skills/codex/references/build-an-mcp-server.md +2 -2
- package/skills/codex/references/connect-an-api.md +2 -2
- package/skills/codex/references/embedded-assistant.md +33 -27
- package/skills/codex/references/examples.md +1 -1
- package/skills/codex/references/verify-and-recover.md +2 -1
- package/skills/codex/reporting-noodle-feedback/SKILL.md +1 -1
- package/skills/codex/verifying-mcp-delivery/SKILL.md +1 -1
- package/skills/codex/verifying-mcp-delivery/references/verify-and-recover.md +2 -1
- package/skills/codex/wrapping-existing-applications/SKILL.md +1 -1
- package/skills/codex/wrapping-existing-applications/references/authoring-workflow.md +5 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noodleseed/agent-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.95.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Self-checking, self-updating agent skills for the Noodle Seed CLI. Authored in this repo by @noodle-borg/agent-kit; this is the published, independently-versioned canonical skills artifact the CLI fetches and verifies.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -3,7 +3,7 @@ name: noodle-seed
|
|
|
3
3
|
description: "Use when building, validating, testing, deploying, or operating a local or hosted Noodle Seed MCP server or app authored in TypeScript with the noodle CLI."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- noodle-skill version:0.
|
|
6
|
+
<!-- noodle-skill version:0.95.0 hash:13ddce01769caae4 -->
|
|
7
7
|
|
|
8
8
|
# Noodle Seed
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ name: authoring-mcp-servers
|
|
|
3
3
|
description: "Use when creating or extending a headless Noodle Seed MCP server, tool, resource, prompt, or typed model-facing capability."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- noodle-skill version:0.
|
|
6
|
+
<!-- noodle-skill version:0.95.0 hash:dd57a15df15d10b2 -->
|
|
7
7
|
|
|
8
8
|
# authoring-mcp-servers
|
|
9
9
|
|
|
@@ -393,20 +393,14 @@ Compute `run` functions are serialized and sandboxed: no imports, no closure cap
|
|
|
393
393
|
|
|
394
394
|
## Tests
|
|
395
395
|
|
|
396
|
-
|
|
396
|
+
Start from the generated `test/server.test.ts`, not a blank test file. `npm test` runs `vitest run --dir test` over the project-owned `test/` directory; skill-local example tests are reference material. The generated suite compiles the actual source/view, lists tools, asserts a representative result and rejects invalid input. It copies source into temporary fixture storage and uses synthetic configuration, never customer secrets or saved hosted targets. The HTTP profile proves one local backend read and zero extra calls for invalid input.
|
|
397
397
|
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
describe('server', () => {
|
|
403
|
-
it('declares the expected tool surface', () => {
|
|
404
|
-
expect(app.name).toBe('support_assistant');
|
|
405
|
-
});
|
|
406
|
-
});
|
|
398
|
+
```sh
|
|
399
|
+
npm test
|
|
400
|
+
npm run agent:check
|
|
407
401
|
```
|
|
408
402
|
|
|
409
|
-
|
|
403
|
+
Adapt the representative arguments and assertions when business contracts change; keep invalid-input and authorization cases. A name/export assertion or `noodle test --json` without `--tool` proves no useful call. After fixture tests pass, bind the real local configuration, run an authorized representative read, and use `noodle dev` for interactive checks. Never use a production mutation or fixture success as customer-readiness evidence.
|
|
410
404
|
|
|
411
405
|
## Secrets and variables
|
|
412
406
|
|
|
@@ -26,7 +26,7 @@ Establish only the inputs needed for the requested stopping point. Follow `refer
|
|
|
26
26
|
5. **Author in TypeScript.** Follow `references/authoring-workflow.md` for connector and flow patterns, `references/tool-design.md` for the model-facing tool surface, and `references/sdk-surface.md` for exact builders. These are this route’s complete canonical support set; use the router lookup catalog only when observed evidence names a different concern.
|
|
27
27
|
MCP protocol versions are platform-owned and negotiated automatically at the serving endpoint. Do not add protocol-version settings to server options, `noodle.json`, app manifests, or deployment configuration.
|
|
28
28
|
6. **Validate and repair.** Run `noodle validate --json`. Parse `error.errors[]`, repair the cited `path`, and rerun validation. Consult the lookup catalog only for the specific reported error code; do not open another reference speculatively.
|
|
29
|
-
7. **Run
|
|
29
|
+
7. **Run local behavior.** Start from the generated tests and run `npm test`: compile, tools/list, representative result and invalid-input rejection. `noodle test --json` without `--tool` is registration-only; repair failures before claiming a working capability.
|
|
30
30
|
8. **Prove external behavior.** For connector-backed reads, set credentials through the effective local target and run a safe representative `noodle tools call`. Confirm populated mapped fields from real output, not merely successful registration.
|
|
31
31
|
9. **Stop at the requested boundary.** Do not add an App, host test, hosted environment, publication work, or deployment unless the user requested that outcome. Deploy only when the selected route or the user explicitly requires it.
|
|
32
32
|
|
|
@@ -36,7 +36,7 @@ Report evidence as a ladder and claim only levels actually exercised:
|
|
|
36
36
|
|
|
37
37
|
- **Authoring:** the requested TypeScript behavior exists with typed inputs and outputs, and the product-guide decision and reason are recorded.
|
|
38
38
|
- **Compilation:** `noodle validate --json` returned success.
|
|
39
|
-
- **Local
|
|
39
|
+
- **Local behavior:** the generated/adapted suite passed a representative call and a negative case. Synthetic fixtures prove only their configured behavior.
|
|
40
40
|
- **Connector reality:** a representative safe read via `noodle tools call` returned populated mapped fields. This is required for connector-backed work.
|
|
41
41
|
- **Higher levels:** explicitly report host, deployment, and production checks as not run unless they were separately requested and evidenced.
|
|
42
42
|
|
|
@@ -3,7 +3,7 @@ name: building-mcp-apps
|
|
|
3
3
|
description: "Use when a Noodle Seed MCP App, widget, interactive card, visual interaction, or host-visible UI is the primary requested outcome."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- noodle-skill version:0.
|
|
6
|
+
<!-- noodle-skill version:0.95.0 hash:98c7b07c82a7d7ce -->
|
|
7
7
|
|
|
8
8
|
# building-mcp-apps
|
|
9
9
|
|
|
@@ -25,14 +25,14 @@ Before implementation, capture a short design spec: target user, conversational
|
|
|
25
25
|
4. **Preserve fallback.** Every tool that launches a widget must still return useful text without the widget, so unsupported hosts and failed rendering remain usable.
|
|
26
26
|
5. **Decide product-guide coverage.** Record the required product-guide decision and its reason, then use `references/product-agent-guides.md` as the canonical selection and authoring guidance.
|
|
27
27
|
6. **Author and wire the App contract.** Follow `references/widgets-and-apps.md` for the canonical component guidance, view registration, hooks, state, CSP, tool visibility, and output shaping. Keep tool effects and confirmation semantics correct independently of the UI.
|
|
28
|
-
7. **Validate the local artifact.** Run `
|
|
28
|
+
7. **Validate the local artifact.** Run the generated/adapted `npm test`, `noodle validate --json` and `noodle check --json`. Prove a representative result and negative case, not just registration. Synthetic preference previews do not save; replace their backend seam and verify the authorized effect before showing success.
|
|
29
29
|
8. **Inspect the experience.** Run `noodle devtools` and verify loading, empty, error, success, responsive layout, focus/keyboard behavior, and the text fallback.
|
|
30
30
|
9. **Escalate evidence only on request.** Run a host test only when the user requested host verification. Run host-specific compliance only when preparing that host submission; select the exact host-testing or compliance entry from the router lookup catalog only after that evidence level is explicitly requested.
|
|
31
31
|
|
|
32
32
|
## Verification evidence
|
|
33
33
|
|
|
34
34
|
- **Product:** the design spec states the user benefit, UI fit decision, and product-guide decision with its reason.
|
|
35
|
-
- **Server:**
|
|
35
|
+
- **Server:** compilation, a representative call and negative input/authorization cases passed; report whether fixtures or a real authorized backend were used.
|
|
36
36
|
- **App contract:** `noodle check --json` succeeded.
|
|
37
37
|
- **Local UX:** `noodle devtools` exercised the relevant states and the useful text fallback without the widget.
|
|
38
38
|
- **Host/compliance:** report each requested host or compliance check with its evidence; report every unperformed higher level as not run.
|
|
@@ -3,7 +3,7 @@ name: connecting-apis-to-mcp
|
|
|
3
3
|
description: "Use when all four API-evidence inputs exist—and only then: API base URL, authentication scheme, representative safe read, and observed response."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- noodle-skill version:0.
|
|
6
|
+
<!-- noodle-skill version:0.95.0 hash:8020811f1769c538 -->
|
|
7
7
|
|
|
8
8
|
# connecting-apis-to-mcp
|
|
9
9
|
|
|
@@ -393,20 +393,14 @@ Compute `run` functions are serialized and sandboxed: no imports, no closure cap
|
|
|
393
393
|
|
|
394
394
|
## Tests
|
|
395
395
|
|
|
396
|
-
|
|
396
|
+
Start from the generated `test/server.test.ts`, not a blank test file. `npm test` runs `vitest run --dir test` over the project-owned `test/` directory; skill-local example tests are reference material. The generated suite compiles the actual source/view, lists tools, asserts a representative result and rejects invalid input. It copies source into temporary fixture storage and uses synthetic configuration, never customer secrets or saved hosted targets. The HTTP profile proves one local backend read and zero extra calls for invalid input.
|
|
397
397
|
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
describe('server', () => {
|
|
403
|
-
it('declares the expected tool surface', () => {
|
|
404
|
-
expect(app.name).toBe('support_assistant');
|
|
405
|
-
});
|
|
406
|
-
});
|
|
398
|
+
```sh
|
|
399
|
+
npm test
|
|
400
|
+
npm run agent:check
|
|
407
401
|
```
|
|
408
402
|
|
|
409
|
-
|
|
403
|
+
Adapt the representative arguments and assertions when business contracts change; keep invalid-input and authorization cases. A name/export assertion or `noodle test --json` without `--tool` proves no useful call. After fixture tests pass, bind the real local configuration, run an authorized representative read, and use `noodle dev` for interactive checks. Never use a production mutation or fixture success as customer-readiness evidence.
|
|
410
404
|
|
|
411
405
|
## Secrets and variables
|
|
412
406
|
|
|
@@ -198,7 +198,7 @@ model" section of `references/authoring-workflow.md`.
|
|
|
198
198
|
|
|
199
199
|
### Set the secret for local runs
|
|
200
200
|
|
|
201
|
-
Local
|
|
201
|
+
Local authoring resolves explicit coordinates, then the complete project link, then deterministic local defaults; saved global coordinates do not redirect an unlinked project. Follow the diagnostic’s exact-target commands from the project directory for every missing secret and variable:
|
|
202
202
|
|
|
203
203
|
```sh
|
|
204
204
|
# Canonical: writes to the effective local environment used by dev/test/devtools:
|
|
@@ -215,7 +215,7 @@ Scoped local values live in `./.env.noodle`; the exact project-root `.env` is a
|
|
|
215
215
|
|
|
216
216
|
### Prove real output
|
|
217
217
|
|
|
218
|
-
`noodle validate` / `noodle test` prove a connector tool *compiles and registers* — not that its
|
|
218
|
+
`noodle validate` / `noodle test` without `--tool` prove a connector tool *compiles and registers* — not that its
|
|
219
219
|
mapping returns data. With the secret set, run a live read: `noodle tools call <read_tool> --args
|
|
220
220
|
'{…}'` executes the connector against the real API in-process. Confirm the mapped fields are populated,
|
|
221
221
|
not `undefined`; if they are empty, distinguish a legitimate empty result from a missing or incorrect mapping, fix `${response…}` paths against the real payload when needed, and re-run.
|
|
@@ -3,7 +3,7 @@ name: creating-product-agent-guides
|
|
|
3
3
|
description: "Use when a Noodle Seed MCP server needs a new or revised product agent guide, App Package skill, or explicit product-skill regeneration."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- noodle-skill version:0.
|
|
6
|
+
<!-- noodle-skill version:0.95.0 hash:0e06e11254563b6a -->
|
|
7
7
|
|
|
8
8
|
# creating-product-agent-guides
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ name: debugging-mcp-delivery
|
|
|
3
3
|
description: "Use when an existing Noodle Seed MCP project has a concrete validation, runtime, connector, App, host, deployment, or production failure."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- noodle-skill version:0.
|
|
6
|
+
<!-- noodle-skill version:0.95.0 hash:8d75ad13f4b3120a -->
|
|
7
7
|
|
|
8
8
|
# debugging-mcp-delivery
|
|
9
9
|
|
|
@@ -23,6 +23,7 @@ Use this ordered evidence ladder. Start at the last known passing layer or the l
|
|
|
23
23
|
1. **Compile** — the TypeScript build and authoring import surface are valid.
|
|
24
24
|
2. **Validate** — `noodle validate --json` accepts the Noodle contract.
|
|
25
25
|
3. **Local smoke** — `noodle test --json` starts the local runtime. Open apps exercise MCP registration; customer-auth apps must instead pass the anonymous 401 plus exact protected-resource metadata boundary and report `interactiveRequired: true`.
|
|
26
|
+
To prove a safe read, explicitly supply `--tool <read_tool> --args <json>` or use `noodle tools call <read_tool> --args <json> --json`. These commands fail on protocol/tool errors, missing or incomplete results, and a declared output-schema mismatch. `input_required` is not completion: use Devtools for interactive input, never fabricate approval or retry an uncertain write.
|
|
26
27
|
4. **Customer auth** — when customer auth is declared, run `noodle auth doctor src/server.ts --json` for metadata and JWKS readiness, then run `noodle devtools src/server.ts`, complete sign-in, and make one authenticated `tools/list` request or representative safe read. The doctor does not prove that registration or token issuance succeeds; the authenticated request proves issuer, signature, stable audience, and exact-resource binding together.
|
|
27
28
|
5. **Real API** — a representative safe `noodle tools call` proves connector credentials, transport, observed mapping, and populated data.
|
|
28
29
|
6. **App compliance** — `noodle check --json` and local devtools prove the App contract and intended states.
|
|
@@ -53,7 +54,7 @@ Report a compact ledger for every exercised layer: command/action, target, resul
|
|
|
53
54
|
## Recovery paths
|
|
54
55
|
|
|
55
56
|
- Compile/validation: repair the exact import, schema, or reported path, then rerun that command without freeform changes.
|
|
56
|
-
- Local boot/smoke: use the
|
|
57
|
+
- Local boot/smoke: use all reported missing variable and secret names and the exact-target recovery commands together. Values stay outside the diagnostic. `error.detail.reason` identifies incomplete/failed operation evidence; RPC message/data and continuation state are deliberately not copied. A failed response does not prove a write was rolled back.
|
|
57
58
|
- Real API: distinguish authentication, reachability, legitimate empty results, and broken response mappings before changing code.
|
|
58
59
|
- App: repair the cited contract or state in `noodle check --json`, then confirm it in devtools before attempting a host.
|
|
59
60
|
- Host/deployment/production: confirm revision, target, identity, and configuration independently; do not infer one from another.
|
|
@@ -3,7 +3,7 @@ name: deploying-mcp-services
|
|
|
3
3
|
description: "Use when the user explicitly requests a Noodle Seed hosted link, configuration write, deployment, access change, rollback, or connection write."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- noodle-skill version:0.
|
|
6
|
+
<!-- noodle-skill version:0.95.0 hash:3a1e14ff9b98ddbd -->
|
|
7
7
|
|
|
8
8
|
# deploying-mcp-services
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ name: designing-mcp-products
|
|
|
3
3
|
description: "Use when a Noodle Seed MCP product idea needs conversational fit, user benefit, scope, interaction, or evidence design before implementation."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- noodle-skill version:0.
|
|
6
|
+
<!-- noodle-skill version:0.95.0 hash:a21b2ed9997f9454 -->
|
|
7
7
|
|
|
8
8
|
# designing-mcp-products
|
|
9
9
|
|
|
@@ -393,20 +393,14 @@ Compute `run` functions are serialized and sandboxed: no imports, no closure cap
|
|
|
393
393
|
|
|
394
394
|
## Tests
|
|
395
395
|
|
|
396
|
-
|
|
396
|
+
Start from the generated `test/server.test.ts`, not a blank test file. `npm test` runs `vitest run --dir test` over the project-owned `test/` directory; skill-local example tests are reference material. The generated suite compiles the actual source/view, lists tools, asserts a representative result and rejects invalid input. It copies source into temporary fixture storage and uses synthetic configuration, never customer secrets or saved hosted targets. The HTTP profile proves one local backend read and zero extra calls for invalid input.
|
|
397
397
|
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
describe('server', () => {
|
|
403
|
-
it('declares the expected tool surface', () => {
|
|
404
|
-
expect(app.name).toBe('support_assistant');
|
|
405
|
-
});
|
|
406
|
-
});
|
|
398
|
+
```sh
|
|
399
|
+
npm test
|
|
400
|
+
npm run agent:check
|
|
407
401
|
```
|
|
408
402
|
|
|
409
|
-
|
|
403
|
+
Adapt the representative arguments and assertions when business contracts change; keep invalid-input and authorization cases. A name/export assertion or `noodle test --json` without `--tool` proves no useful call. After fixture tests pass, bind the real local configuration, run an authorized representative read, and use `noodle dev` for interactive checks. Never use a production mutation or fixture success as customer-readiness evidence.
|
|
410
404
|
|
|
411
405
|
## Secrets and variables
|
|
412
406
|
|
|
@@ -3,7 +3,7 @@ name: embedding-mcp-assistants
|
|
|
3
3
|
description: "Use when embedding a Noodle assistant into an existing SaaS or web application with browser, identity, session, and credential boundaries."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- noodle-skill version:0.
|
|
6
|
+
<!-- noodle-skill version:0.95.0 hash:d554d661ed7ac7be -->
|
|
7
7
|
|
|
8
8
|
# embedding-mcp-assistants
|
|
9
9
|
|
|
@@ -393,20 +393,14 @@ Compute `run` functions are serialized and sandboxed: no imports, no closure cap
|
|
|
393
393
|
|
|
394
394
|
## Tests
|
|
395
395
|
|
|
396
|
-
|
|
396
|
+
Start from the generated `test/server.test.ts`, not a blank test file. `npm test` runs `vitest run --dir test` over the project-owned `test/` directory; skill-local example tests are reference material. The generated suite compiles the actual source/view, lists tools, asserts a representative result and rejects invalid input. It copies source into temporary fixture storage and uses synthetic configuration, never customer secrets or saved hosted targets. The HTTP profile proves one local backend read and zero extra calls for invalid input.
|
|
397
397
|
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
describe('server', () => {
|
|
403
|
-
it('declares the expected tool surface', () => {
|
|
404
|
-
expect(app.name).toBe('support_assistant');
|
|
405
|
-
});
|
|
406
|
-
});
|
|
398
|
+
```sh
|
|
399
|
+
npm test
|
|
400
|
+
npm run agent:check
|
|
407
401
|
```
|
|
408
402
|
|
|
409
|
-
|
|
403
|
+
Adapt the representative arguments and assertions when business contracts change; keep invalid-input and authorization cases. A name/export assertion or `noodle test --json` without `--tool` proves no useful call. After fixture tests pass, bind the real local configuration, run an authorized representative read, and use `noodle dev` for interactive checks. Never use a production mutation or fixture success as customer-readiness evidence.
|
|
410
404
|
|
|
411
405
|
## Secrets and variables
|
|
412
406
|
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
- Architecture
|
|
6
6
|
- Select the architecture before code
|
|
7
|
+
- Install into the existing application
|
|
7
8
|
- Author and validate
|
|
8
9
|
- Product workflow guidance
|
|
9
10
|
- Customize the presentation
|
|
@@ -63,6 +64,20 @@ Use the existing host framework and its package manager. Recommend the managed r
|
|
|
63
64
|
|
|
64
65
|
The architecture brief must state the selected topology, why it fits the named user and job, the two code owners and two local processes, credential and identity flow, routing authority, model owner, files expected to change, and the first requested evidence boundary. If identity/session ownership, exact origin, tenant-routing authority, model ownership, or evidence target is unavailable, return a blocked architecture brief naming the missing owner or decision and do not edit either codebase.
|
|
65
66
|
|
|
67
|
+
## Install into the existing application
|
|
68
|
+
|
|
69
|
+
Configure or reuse an existing capability before generating files. Public embedding uses the existing script or embed ID and needs no customer backend session/config route. Reuse application APIs and business functions; generate a thin handler only where the approved architecture identifies a missing stable boundary.
|
|
70
|
+
|
|
71
|
+
For a supported host, first run `noodle assistant embed --framework nextjs --surface public --dry-run --json` in the customer application, substituting `authenticated` or `mixed` only for the selected surface. Read the returned recipe applicability, applicationSeams, generated contents/hashes, skipped conflicts and nextSteps. The output is an installation plan, not permission to change the repository.
|
|
72
|
+
|
|
73
|
+
For the documented non-Node backend/static-frontend authenticated profile, discover the framework choice through `noodle commands --json` and follow the linked framework guide below. The installer supplies a session view, a fail-closed identity seam, real CSRF-enforced request tests, a browser wrapper and exact-destination CSRF transport tests. Keep the existing package managers, authentication middleware and same-origin proxy. Pass the existing CSRF token and user/tenant principalKey to the wrapper; the managed element supports injected fetch, so preserving CSRF does not require a custom renderer or Node production server. Unsupported combinations use the neutral contract, not a claimed qualified profile.
|
|
74
|
+
|
|
75
|
+
Once local changes are authorized, rerun without `--dry-run`; never add `--force` to resolve a conflict automatically. Read the installed `NOODLE-INTEGRATION.md` and newly installed project skill before editing. Implement only the named session/business/mount seams and preserve the host framework, package manager, login and authorization. Mixed mode also requires an application-owned login transaction; the generated callback does not implement or verify that transaction.
|
|
76
|
+
|
|
77
|
+
Use generated tests and independently maintained acceptance cases at the actual customer boundary. A static host check, a mock test or installed files cannot prove application authorization or production browser behavior. Missing identities, sandbox access, customer approval or a reachable service remain unverified. Record the exact application/Noodle revisions, package versions and environment for observed evidence; rerun affected checks after changes.
|
|
78
|
+
|
|
79
|
+
Unsupported hosts use the framework-neutral integration contract below; do not claim they received a generated, qualified framework profile. Keep direct MCP and headless projections on the same TypeScript source, and preserve their separate identity requirements.
|
|
80
|
+
|
|
66
81
|
## Author and validate
|
|
67
82
|
|
|
68
83
|
`noodle init` and `noodle init --template widget` deliberately produce credential-free MCP Apps. Add an assistant declaration only when the product explicitly includes a customer-hosted assistant; do not make ordinary external-host widgets depend on model-provider settings.
|
|
@@ -143,6 +158,16 @@ The sign-in card renders on the same themed chrome as every proposal card and fo
|
|
|
143
158
|
|
|
144
159
|
#### Complete mixed-mode handoff
|
|
145
160
|
|
|
161
|
+
For a small SaaS onboarding flow, first read the bundled [stateful-draft example](../examples/stateful-draft/README.md). Compose the existing capabilities; do not introduce an onboarding platform API, workflow engine, research pipeline, or second identity provider.
|
|
162
|
+
|
|
163
|
+
Start from one useful result the visitor can see before signup. Ask only for missing information, one short question at a time. Show an editable preview, and offer an account only when it unlocks a meaningful next step. Keep the ordinary signup route available. Research and document parsing are optional enrichment, never required because the flow is conversational.
|
|
164
|
+
|
|
165
|
+
Use a finite-TTL caller state handle only if the draft needs server persistence. Opt it into `claimOnAuthentication` when it should move to the verified account. An explicit typed read tool supplies the current revision; a typed patch tool sends that revision and the complete reviewed value. Widget state is a display cache, never proof of a save. A failed or missing result must not increment the revision, mark the draft saved, or silently retry a conflicting write.
|
|
166
|
+
|
|
167
|
+
Keep the final business action in the customer API. Map the reviewed draft to its existing create/update operation after authentication, with confirmation and the backend’s existing authorization and idempotency. Ticket adoption transfers temporary state, not a CRM record or completed onboarding.
|
|
168
|
+
|
|
169
|
+
Prove this journey before calling it ready: useful anonymous preview; actual saved state; cancelled/expired signup; verified signup with the same draft; a destination conflict without an automatic merge; and no business write merely because login succeeded. A synthetic login demonstrates the integration shape but is not evidence that the customer identity system is connected.
|
|
170
|
+
|
|
146
171
|
1. **Capture the ticket.** The widget raises `assistant-sign-in-requested` with a single-use `signInTicket`. POST it to the host application same-origin backend and bind it to the short-lived login transaction; keep it out of query strings, logs, analytics, and durable browser storage.
|
|
147
172
|
2. **Use the existing login.** Send the visitor through the host application full-page redirect for sign-in or sign-up. Noodle never becomes the customer identity provider.
|
|
148
173
|
3. **Elevate on the backend.** After authentication, recover the bound ticket and call `createAssistantSession({ ..., signInTicket })` with the verified user, server-owned routing, backend client credentials, and the exact **origin the conversation will continue on**. The allowed destination may differ from the anonymous marketing origin; successful elevation rebinds the session to it.
|
|
@@ -246,39 +271,20 @@ The doctor reads `NOODLE_ASSISTANT_CLIENT_ID` / `NOODLE_ASSISTANT_CLIENT_SECRET`
|
|
|
246
271
|
|
|
247
272
|
Read the customer repository lockfile or `packageManager` field and install `@noodleseed/assistant` with that existing package manager; never introduce a second lockfile.
|
|
248
273
|
|
|
249
|
-
|
|
274
|
+
Use the installed same-origin route and `createAssistantSessionHandler` from `@noodleseed/assistant/server`; do not regenerate guards, JSON parsing or token-exchange infrastructure. The only identity seam is `authenticateAssistantRequest` in `lib/noodle-assistant-auth.ts`.
|
|
250
275
|
|
|
251
|
-
The route must return a JSON `401` for a signed-out caller rather than an HTML login redirect, require JSON, and compare the request against the exact configured Origin before exchange. The managed renderer sends same-origin cookies but does not invent an application CSRF token.
|
|
276
|
+
The route must return a JSON `401` for a signed-out caller rather than an HTML login redirect, require JSON, and compare the request against the exact configured Origin before exchange. The managed renderer sends same-origin cookies but does not invent an application CSRF token. Preserve the host token-based CSRF middleware: inject a same-origin-only token fetch into the managed element before mounting, as the Django/Vue profile does; a custom renderer is not required. Invalid CSRF may correctly fail before authentication. Resolve claims and connector routes from the authenticated user and server-owned membership only.
|
|
252
277
|
|
|
253
278
|
For the complete framework-neutral server-to-server HTTP exchange in a non-Node host, link to the [Django and Vue guide](https://docs.noodleseed.dev/docs/guides/embedded-assistant-django-vue); keep its framework-specific middleware and mounting mechanics there rather than copying them into agent instructions.
|
|
254
279
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
export async function POST(request: Request) {
|
|
259
|
-
const user = await requireCurrentUser(request);
|
|
260
|
-
const { context } = await request.json();
|
|
261
|
-
const session = await createAssistantSession({
|
|
262
|
-
serviceUrl: process.env.NOODLE_SERVICE_URL!,
|
|
263
|
-
clientId: process.env.NOODLE_ASSISTANT_CLIENT_ID!,
|
|
264
|
-
clientSecret: process.env.NOODLE_ASSISTANT_CLIENT_SECRET!,
|
|
265
|
-
origin: process.env.PUBLIC_APP_ORIGIN!,
|
|
266
|
-
user: {
|
|
267
|
-
id: user.id,
|
|
268
|
-
email: user.email,
|
|
269
|
-
roles: user.roles,
|
|
270
|
-
scopes: user.scopes,
|
|
271
|
-
},
|
|
272
|
-
context,
|
|
273
|
-
// Saved, backend-verified user preferences outrank browser hints.
|
|
274
|
-
preferences: { locale: user.locale, timeZone: user.timeZone },
|
|
275
|
-
});
|
|
276
|
-
return Response.json(session);
|
|
277
|
-
}
|
|
278
|
-
```
|
|
280
|
+
Return `AssistantSessionIdentity | null` from the adapter. Null means signed out; service failure must throw rather than masquerade as signed out. Derive `user`, claims, preferences and routes from the existing verified session/membership. The maintained handler owns exact-Origin/JSON checks, bounded flat context, no-store JSON failures, a 15-second deadline, no redirects and no exchange retries. For mixed-mode continuation, return a `signInTicket` only from the backend-bound login transaction; never take it directly from browser JSON.
|
|
281
|
+
|
|
282
|
+
For saved presentation preferences, return `preferences: { locale: user.locale, timeZone: user.timeZone }` beside the verified `user`. Omit unknown values; browser hints are not verified account preferences.
|
|
279
283
|
|
|
280
284
|
Authenticate before exchange. Pass backend-verified `user.roles` and OAuth-style `user.scopes` separately; they govern the same per-tool authorization rules as verified MCP bearer claims. Source `origin` from trusted server configuration or strictly match the request origin against the same exact allowlist; never accept an arbitrary request header. Treat page context as untrusted model context, never authorization. Forward the helper response unchanged.
|
|
281
285
|
|
|
286
|
+
Run the generated `test/noodle-assistant.test.ts` with the application's Vitest runner (add the dev dependency using its existing package manager if absent). It tests the real generated route with synthetic identities. Separately exercise the real session function with signed-out, tenant-A, tenant-B and authorized fixtures before claiming integration proof. A green mock suite does not prove customer authorization.
|
|
287
|
+
|
|
282
288
|
`serviceUrl` is the Noodle Seed control-plane base URL: the value `noodle assistant clients create` prints, also stored as `serviceUrl` in `deployment.json`. It is NOT the deployment MCP endpoint (`url`, which ends in `/v1/mcp` and rejects session exchange). Never probe or guess endpoints with real credentials.
|
|
283
289
|
|
|
284
290
|
### Route customer endpoints from the backend
|
|
@@ -765,7 +771,7 @@ noodle assistant embed --check --json
|
|
|
765
771
|
noodle assistant embed --check --json --require-env EXAMPLE_DELEG_CLIENT_SECRET
|
|
766
772
|
```
|
|
767
773
|
|
|
768
|
-
The check reports
|
|
774
|
+
The check reports required and missing environment names, never their values. Use the exact command in an installed NOODLE-INTEGRATION.md, including its aliases and additional names, with the host environment exported; the CLI does not load application dotenv files. Pass `--surface public|mixed|authenticated` to match the deployment: `public` needs no backend client credentials. Public script-tag mounts need the service in `script-src`; the generated bundled React mount needs only `connect-src` and `frame-src` for that service. Unknown public mounts retain the conservative script check. CSP verifies an exact service origin, an env placeholder or a covering wildcard; dynamic expressions stay unverified. `--require-env` adds application-owned names and `--env-alias NAME=HOST_NAME` follows existing host naming.
|
|
769
775
|
|
|
770
776
|
Read `evidence.levels` in order and stop at `evidence.firstUnproven`:
|
|
771
777
|
|
|
@@ -116,7 +116,7 @@ assistant: embeddedAssistant({
|
|
|
116
116
|
model: variable('ASSISTANT_MODEL'),
|
|
117
117
|
apiKey: secret('ASSISTANT_MODEL_API_KEY'),
|
|
118
118
|
}),
|
|
119
|
-
|
|
119
|
+
access: authenticatedWebsite({ origins: [variable('APP_ORIGIN')] }),
|
|
120
120
|
layout: { mode: 'floating', position: 'bottom-right' },
|
|
121
121
|
labels: { welcomeHeading: 'How can I help with Acme Tasks?' },
|
|
122
122
|
}),
|
|
@@ -125,9 +125,19 @@ assistant: embeddedAssistant({
|
|
|
125
125
|
The assistant automatically inherits this server's existing `branding` block, so its name, accent,
|
|
126
126
|
light/dark surfaces, density, and radius match the `TaskList` widget without a second brand declaration.
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
Bind `APP_ORIGIN` to the exact website origin. Production uses HTTPS; local development may use an exact
|
|
129
|
+
loopback HTTP origin. The customer application runs its own development server beside `noodle dev`.
|
|
130
|
+
|
|
131
|
+
In the existing application, preview the adapter with
|
|
132
|
+
`noodle assistant embed --framework nextjs --surface authenticated --dry-run --json`. Review the recipe,
|
|
133
|
+
generated contents/hashes and conflicts before rerunning without `--dry-run`. Implement the named
|
|
134
|
+
`authenticateAssistantRequest` seam with the application's existing login and server-owned membership.
|
|
135
|
+
Follow the installed `NOODLE-INTEGRATION.md` for signed-out, wrong-origin, cross-tenant and browser checks.
|
|
136
|
+
Installed files are not integration proof; missing sandbox identities or backend evidence remain unverified.
|
|
137
|
+
The generated session route delegates guards, bounded parsing and exchange to
|
|
138
|
+
`createAssistantSessionHandler` in `@noodleseed/assistant/server`. Implement the existing-session adapter;
|
|
139
|
+
do not copy token-exchange infrastructure. Run the supplied `test/noodle-assistant.test.ts` with Vitest,
|
|
140
|
+
then test the adapter against the host application's signed-out and cross-tenant membership fixtures.
|
|
131
141
|
|
|
132
142
|
The customer backend exchanges its authenticated user through `@noodleseed/assistant/server`; the browser
|
|
133
143
|
uses the Web Component or React wrapper and never receives the embed client or model secret. Validate with
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Customer Auth - OIDC identity and customer-routed APIs
|
|
2
2
|
|
|
3
|
+
For a visitor who starts before signup, use the [Stateful Draft reference](../stateful-draft/README.md)
|
|
4
|
+
alongside this authenticated backend integration.
|
|
5
|
+
|
|
3
6
|
This curated example owns the customer/end-user authentication capability slot. It proves that a SaaS app
|
|
4
7
|
can protect an MCP endpoint with direct OIDC, retain role/scope-based tool authorization, and route ordinary
|
|
5
8
|
reads and confirmed actions to the API origin selected by the verified customer's identity provider.
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
The smallest deployable Noodle app: a single `greet` tool authored in TypeScript with no
|
|
4
4
|
connectors, secrets, flows, widgets, or handoff policy. It still uses the current server options form
|
|
5
|
-
so new authors see where server-level branding belongs. Use it
|
|
6
|
-
|
|
5
|
+
so new authors see where server-level branding belongs. Use it for a local read or first deploy.
|
|
6
|
+
For a new project, `noodle init --template hello` also supplies isolated behavior tests: compilation,
|
|
7
|
+
tool discovery, an expected greeting and invalid-input rejection. Run `npm install` then `npm test`.
|
|
7
8
|
|
|
8
9
|
Protocol negotiation deliberately does not appear in `src/server.ts` or `noodle.json`. MCP versions
|
|
9
10
|
are platform-owned: the same deployed app automatically serves compatible legacy clients and modern
|
|
@@ -30,6 +31,7 @@ empty. One-shot commands write one envelope; streaming commands write NDJSON sna
|
|
|
30
31
|
terminal-failure envelopes so agents can parse each line independently.
|
|
31
32
|
|
|
32
33
|
```sh
|
|
34
|
+
noodle test examples/hello/src/server.ts --tool greet --args '{"name":"Ada"}' --json
|
|
33
35
|
noodle dev examples/hello/src/server.ts --app hello
|
|
34
36
|
noodle deploy examples/hello/src/server.ts --org acme --app hello
|
|
35
37
|
```
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Stateful Draft
|
|
2
|
+
|
|
3
|
+
**Owns:** The flagship for a useful brief before signup, authoritative caller state, and account continuation.
|
|
4
|
+
**Read when:** You want to compose a small conversational onboarding flow from existing platform capabilities.
|
|
5
|
+
**Do not put here:** Customer credentials, a new identity provider, or business-system records.
|
|
6
|
+
**Update when:** The reference tools, state schema, or runnable journey changes.
|
|
7
|
+
|
|
8
|
+
Start with the visitor's goal. Help them produce something useful before asking for an account. This
|
|
9
|
+
synthetic example collects a project title, audience, and desired outcome; those fields are illustrative,
|
|
10
|
+
not requirements for any particular SaaS product.
|
|
11
|
+
|
|
12
|
+
## The journey
|
|
13
|
+
|
|
14
|
+
1. The visitor describes a goal. The assistant asks only for missing information and proposes a brief.
|
|
15
|
+
2. `open_draft` opens an editable review and reads authoritative state, including its current revision.
|
|
16
|
+
3. `save_draft` saves the reviewed brief after confirmation. It sends the current revision and the complete
|
|
17
|
+
value to the state API. Failed or missing responses do not appear as successful saves.
|
|
18
|
+
4. The visitor may choose `continue_draft`. This read requires identity, so an anonymous visitor sees the
|
|
19
|
+
sign-in/signup card. Your host application completes its existing login and spends the bound ticket.
|
|
20
|
+
5. The authenticated assistant reads the same adopted draft. No project, subscription, or business record
|
|
21
|
+
is created by signing in.
|
|
22
|
+
|
|
23
|
+
The widget's Continue button requests the identity-dependent tool through the conversation. The ordinary
|
|
24
|
+
signup route should remain available on the embedding page.
|
|
25
|
+
|
|
26
|
+
## Run the reference
|
|
27
|
+
|
|
28
|
+
From this repository:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
pnpm install
|
|
32
|
+
pnpm build
|
|
33
|
+
noodle validate examples/stateful-draft/src/server.ts
|
|
34
|
+
noodle test examples/stateful-draft/src/server.ts
|
|
35
|
+
noodle dev examples/stateful-draft/src/server.ts --org demo --app stateful-draft
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The local runtime and widget preview exercise the typed tools. A complete mixed-assistant journey also
|
|
39
|
+
requires two host pages and a backend that verifies the user. The declared development origins are
|
|
40
|
+
`http://localhost:3001` for the public page and `http://localhost:3002` for the authenticated page; replace
|
|
41
|
+
these with your exact deployment origins. The assistant uses `noodleManaged()`, whose hosted availability
|
|
42
|
+
and budget belong to the operator. Local tool tests do not require a model key.
|
|
43
|
+
|
|
44
|
+
Use the SDK version declared in this example's package file. Older published SDKs may omit the state
|
|
45
|
+
adoption flag when compiling; the example's tests check that the flag reaches the compiled declaration.
|
|
46
|
+
|
|
47
|
+
Use [signup continuity](https://docs.noodleseed.dev/docs/guides/signup-continuity) for the complete host
|
|
48
|
+
integration and [customer-auth](../customer-auth/README.md) for customer-owned API authentication.
|
|
49
|
+
|
|
50
|
+
### Loopback demonstration with a hosted assistant
|
|
51
|
+
|
|
52
|
+
The included host serves the public page on port 3001 and a **simulated** account page on port 3002.
|
|
53
|
+
It binds to loopback and must not be published as a production authentication implementation.
|
|
54
|
+
After deploying this app, copy this directory outside the monorepo and run the commands below from that
|
|
55
|
+
copy. This keeps published dependencies from shadowing the monorepo's workspace SDK.
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
pnpm install --ignore-workspace --lockfile=false
|
|
59
|
+
export NOODLE_EMBED_ID=<embed-id-printed-by-deploy>
|
|
60
|
+
pnpm site
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
This is enough to test the anonymous conversation and saved brief. To exercise the synthetic account
|
|
64
|
+
handoff, create an assistant backend client for the same org/app/env with
|
|
65
|
+
`noodle assistant clients create --name first-brief-demo --org <org> --app <app> --env <env> --json`.
|
|
66
|
+
Set `NOODLE_ASSISTANT_CREDENTIALS_FILE` to the returned `secretFile` path and restart `pnpm site`.
|
|
67
|
+
The host consumes that private file without printing it or sending its contents to the browser.
|
|
68
|
+
Override `NOODLE_SERVICE_URL` only when deploying to a different hosted service.
|
|
69
|
+
|
|
70
|
+
The simulated signup chooses a random temporary demo identity and spends the ticket through the real
|
|
71
|
+
backend session helper. The host's login transaction lasts ten minutes; it is local process memory and
|
|
72
|
+
is lost on restart. A production integration replaces it with the customer's existing verified login and
|
|
73
|
+
login transaction. Do not copy the synthetic identity branch into a real application.
|
|
74
|
+
|
|
75
|
+
## Customer integration map
|
|
76
|
+
|
|
77
|
+
| Reference | Adaptation in the customer's application |
|
|
78
|
+
| :--- | :--- |
|
|
79
|
+
| Three-field brief | Select the smallest useful outcome and collect only its missing inputs |
|
|
80
|
+
| Public mixed surface | Mount the public embed on the unauthenticated website with an exact allowlist |
|
|
81
|
+
| Expiring `draft` handle | Keep only temporary, bounded coordination state; omit persistence if unnecessary |
|
|
82
|
+
| `continue_draft` | Trigger the existing signup/login at the point the visitor chooses an account |
|
|
83
|
+
| Host session endpoint | Verify the logged-in user, spend the bound ticket, return the SDK session response |
|
|
84
|
+
| Final business action | Add a typed connector to the existing authorized, idempotent create/update API |
|
|
85
|
+
|
|
86
|
+
The final business action belongs in the customer backend. Show the resulting record or its identifier
|
|
87
|
+
only after that API confirms success. Signup and state adoption alone are not completed onboarding.
|
|
88
|
+
Research or document parsing can be added later when they remove a demonstrated user burden; they are not
|
|
89
|
+
prerequisites for this reference.
|
|
90
|
+
|
|
91
|
+
## State and failure behavior
|
|
92
|
+
|
|
93
|
+
The draft uses caller scope, a finite 24-hour TTL, and `claimOnAuthentication: true`. Its `v2` schema
|
|
94
|
+
replaces the earlier title/stage illustration. Widget state is only a display cache. Reads, validation,
|
|
95
|
+
revision checks, expiry, and persistence belong to the runtime.
|
|
96
|
+
|
|
97
|
+
A stale edit requires an explicit reload and review before another save. Spending the single-use sign-in
|
|
98
|
+
ticket moves only opted-in state to the backend-verified account, preserving its revision and expiry.
|
|
99
|
+
Destination conflicts fail rather than merging two drafts. Abandoned or expired signup leaves the
|
|
100
|
+
anonymous state under its original limits. A 24-hour state TTL does not promise cross-device recovery or
|
|
101
|
+
that an arbitrary new anonymous visit can recover the conversation.
|
|
102
|
+
|
|
103
|
+
The save is a connector-backed side effect on a public/mixed surface, so it has `confirm: true`. Previewing
|
|
104
|
+
the brief has no side effect and needs neither signup nor confirmation. Do not add a confirmation to each
|
|
105
|
+
conversational answer or treat confirmation as proof of identity.
|
|
106
|
+
|
|
107
|
+
## Validate before a customer pilot
|
|
108
|
+
|
|
109
|
+
- Show useful value with no account and without repeating already supplied information.
|
|
110
|
+
- Save, reopen, and edit the actual record; test a stale revision and an unconfirmed save.
|
|
111
|
+
- Verify the same draft after the customer's real signup and login, including cancellation and expiry.
|
|
112
|
+
- Test an existing-account draft conflict and ensure it is not silently overwritten.
|
|
113
|
+
- Ensure signup triggers no unintended business write and account A cannot read account B's draft.
|
|
114
|
+
- Compare onboarding completion and first useful product outcome with the existing flow; count signups
|
|
115
|
+
separately. A demo is not evidence of improved conversion.
|