@noodleseed/one 0.86.1 → 0.87.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 (130) hide show
  1. package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +3 -3
  2. package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js.map +1 -1
  3. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.d.ts.map +1 -1
  4. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js +23 -0
  5. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js.map +1 -1
  6. package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.d.ts.map +1 -1
  7. package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js +14 -3
  8. package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js.map +1 -1
  9. package/node_modules/@noodle-borg/auth/dist/claims.d.ts +22 -0
  10. package/node_modules/@noodle-borg/auth/dist/claims.d.ts.map +1 -0
  11. package/node_modules/@noodle-borg/auth/dist/claims.js +70 -0
  12. package/node_modules/@noodle-borg/auth/dist/claims.js.map +1 -0
  13. package/node_modules/@noodle-borg/auth/dist/index.d.ts +1 -0
  14. package/node_modules/@noodle-borg/auth/dist/index.d.ts.map +1 -1
  15. package/node_modules/@noodle-borg/auth/dist/index.js +1 -0
  16. package/node_modules/@noodle-borg/auth/dist/index.js.map +1 -1
  17. package/node_modules/@noodle-borg/auth/dist/jwt-issuer.d.ts +2 -0
  18. package/node_modules/@noodle-borg/auth/dist/jwt-issuer.d.ts.map +1 -1
  19. package/node_modules/@noodle-borg/auth/dist/jwt-issuer.js +1 -0
  20. package/node_modules/@noodle-borg/auth/dist/jwt-issuer.js.map +1 -1
  21. package/node_modules/@noodle-borg/auth/dist/metadata.d.ts +3 -0
  22. package/node_modules/@noodle-borg/auth/dist/metadata.d.ts.map +1 -1
  23. package/node_modules/@noodle-borg/auth/dist/metadata.js +3 -0
  24. package/node_modules/@noodle-borg/auth/dist/metadata.js.map +1 -1
  25. package/node_modules/@noodle-borg/auth/dist/verify.d.ts +7 -0
  26. package/node_modules/@noodle-borg/auth/dist/verify.d.ts.map +1 -1
  27. package/node_modules/@noodle-borg/auth/dist/verify.js +11 -13
  28. package/node_modules/@noodle-borg/auth/dist/verify.js.map +1 -1
  29. package/node_modules/@noodle-borg/authoring/dist/annotations.d.ts +45 -0
  30. package/node_modules/@noodle-borg/authoring/dist/annotations.d.ts.map +1 -0
  31. package/node_modules/@noodle-borg/authoring/dist/annotations.js +40 -0
  32. package/node_modules/@noodle-borg/authoring/dist/annotations.js.map +1 -0
  33. package/node_modules/@noodle-borg/authoring/dist/index.d.ts +1 -1
  34. package/node_modules/@noodle-borg/authoring/dist/index.d.ts.map +1 -1
  35. package/node_modules/@noodle-borg/authoring/dist/index.js.map +1 -1
  36. package/node_modules/@noodle-borg/authoring/dist/server.d.ts +9 -45
  37. package/node_modules/@noodle-borg/authoring/dist/server.d.ts.map +1 -1
  38. package/node_modules/@noodle-borg/authoring/dist/server.js +13 -39
  39. package/node_modules/@noodle-borg/authoring/dist/server.js.map +1 -1
  40. package/node_modules/@noodle-borg/compiler/dist/artifact/types.d.ts +11 -1
  41. package/node_modules/@noodle-borg/compiler/dist/artifact/types.d.ts.map +1 -1
  42. package/node_modules/@noodle-borg/compiler/dist/artifact/types.js +4 -1
  43. package/node_modules/@noodle-borg/compiler/dist/artifact/types.js.map +1 -1
  44. package/node_modules/@noodle-borg/compiler/dist/compile.d.ts.map +1 -1
  45. package/node_modules/@noodle-borg/compiler/dist/compile.js +19 -0
  46. package/node_modules/@noodle-borg/compiler/dist/compile.js.map +1 -1
  47. package/node_modules/@noodle-borg/compiler/dist/index.d.ts +1 -1
  48. package/node_modules/@noodle-borg/compiler/dist/index.d.ts.map +1 -1
  49. package/node_modules/@noodle-borg/compiler/dist/index.js.map +1 -1
  50. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +9 -0
  51. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts.map +1 -1
  52. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +31 -0
  53. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js.map +1 -1
  54. package/node_modules/@noodle-borg/module/dist/contract.d.ts +4 -0
  55. package/node_modules/@noodle-borg/module/dist/contract.d.ts.map +1 -1
  56. package/node_modules/@noodle-borg/module/dist/contract.js.map +1 -1
  57. package/node_modules/@noodle-borg/protocol/dist/index.d.ts +1 -0
  58. package/node_modules/@noodle-borg/protocol/dist/index.d.ts.map +1 -1
  59. package/node_modules/@noodle-borg/protocol/dist/index.js +1 -0
  60. package/node_modules/@noodle-borg/protocol/dist/index.js.map +1 -1
  61. package/node_modules/@noodle-borg/protocol/dist/mapping.d.ts +2 -1
  62. package/node_modules/@noodle-borg/protocol/dist/mapping.d.ts.map +1 -1
  63. package/node_modules/@noodle-borg/protocol/dist/mapping.js +3 -2
  64. package/node_modules/@noodle-borg/protocol/dist/mapping.js.map +1 -1
  65. package/node_modules/@noodle-borg/protocol/dist/sdk-server.d.ts.map +1 -1
  66. package/node_modules/@noodle-borg/protocol/dist/sdk-server.js +14 -1
  67. package/node_modules/@noodle-borg/protocol/dist/sdk-server.js.map +1 -1
  68. package/node_modules/@noodle-borg/protocol/dist/tool-authorization.d.ts +25 -0
  69. package/node_modules/@noodle-borg/protocol/dist/tool-authorization.d.ts.map +1 -0
  70. package/node_modules/@noodle-borg/protocol/dist/tool-authorization.js +51 -0
  71. package/node_modules/@noodle-borg/protocol/dist/tool-authorization.js.map +1 -0
  72. package/node_modules/@noodle-borg/runtime/dist/connector/types.d.ts +2 -0
  73. package/node_modules/@noodle-borg/runtime/dist/connector/types.d.ts.map +1 -1
  74. package/node_modules/@noodle-borg/runtime/dist/connector/types.js.map +1 -1
  75. package/node_modules/@noodle-borg/service/dist/assistant-interactive.d.ts.map +1 -1
  76. package/node_modules/@noodle-borg/service/dist/assistant-interactive.js +8 -0
  77. package/node_modules/@noodle-borg/service/dist/assistant-interactive.js.map +1 -1
  78. package/node_modules/@noodle-borg/service/dist/customer-verifier.d.ts +2 -2
  79. package/node_modules/@noodle-borg/service/dist/customer-verifier.d.ts.map +1 -1
  80. package/node_modules/@noodle-borg/service/dist/customer-verifier.js +37 -7
  81. package/node_modules/@noodle-borg/service/dist/customer-verifier.js.map +1 -1
  82. package/node_modules/@noodle-borg/service/dist/oauth/microsoft.d.ts +1 -1
  83. package/node_modules/@noodle-borg/service/dist/oauth/microsoft.d.ts.map +1 -1
  84. package/node_modules/@noodle-borg/service/dist/oauth/microsoft.js +8 -1
  85. package/node_modules/@noodle-borg/service/dist/oauth/microsoft.js.map +1 -1
  86. package/node_modules/@noodle-borg/service/dist/oauth/provider.d.ts.map +1 -1
  87. package/node_modules/@noodle-borg/service/dist/oauth/provider.js +60 -7
  88. package/node_modules/@noodle-borg/service/dist/oauth/provider.js.map +1 -1
  89. package/node_modules/@noodle-borg/service/dist/oauth/service-bootstrap.d.ts.map +1 -1
  90. package/node_modules/@noodle-borg/service/dist/oauth/service-bootstrap.js +7 -1
  91. package/node_modules/@noodle-borg/service/dist/oauth/service-bootstrap.js.map +1 -1
  92. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.d.ts.map +1 -1
  93. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.js +8 -0
  94. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.js.map +1 -1
  95. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.d.ts.map +1 -1
  96. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.js +34 -11
  97. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.js.map +1 -1
  98. package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts +8 -0
  99. package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts.map +1 -1
  100. package/node_modules/@noodle-borg/service/dist/oauth/store.js +6 -0
  101. package/node_modules/@noodle-borg/service/dist/oauth/store.js.map +1 -1
  102. package/node_modules/@noodle-borg/service/dist/oauth/token-issuer.d.ts +4 -0
  103. package/node_modules/@noodle-borg/service/dist/oauth/token-issuer.d.ts.map +1 -1
  104. package/node_modules/@noodle-borg/service/dist/oauth/token-issuer.js +30 -4
  105. package/node_modules/@noodle-borg/service/dist/oauth/token-issuer.js.map +1 -1
  106. package/node_modules/@noodle-borg/service/dist/registry-targets.d.ts +4 -0
  107. package/node_modules/@noodle-borg/service/dist/registry-targets.d.ts.map +1 -1
  108. package/node_modules/@noodle-borg/service/dist/registry-targets.js +14 -3
  109. package/node_modules/@noodle-borg/service/dist/registry-targets.js.map +1 -1
  110. package/node_modules/@noodle-borg/service/dist/routes/assistant-agent.d.ts.map +1 -1
  111. package/node_modules/@noodle-borg/service/dist/routes/assistant-agent.js +11 -5
  112. package/node_modules/@noodle-borg/service/dist/routes/assistant-agent.js.map +1 -1
  113. package/node_modules/@noodle-borg/service/dist/routes/assistant.d.ts.map +1 -1
  114. package/node_modules/@noodle-borg/service/dist/routes/assistant.js +26 -16
  115. package/node_modules/@noodle-borg/service/dist/routes/assistant.js.map +1 -1
  116. package/node_modules/@noodle-borg/service/dist/routes/protected-resource-metadata.d.ts.map +1 -1
  117. package/node_modules/@noodle-borg/service/dist/routes/protected-resource-metadata.js +7 -5
  118. package/node_modules/@noodle-borg/service/dist/routes/protected-resource-metadata.js.map +1 -1
  119. package/node_modules/@noodle-borg/transport-http/dist/handler.d.ts.map +1 -1
  120. package/node_modules/@noodle-borg/transport-http/dist/handler.js +19 -120
  121. package/node_modules/@noodle-borg/transport-http/dist/handler.js.map +1 -1
  122. package/node_modules/@noodle-borg/transport-http/dist/identity-authorization.d.ts +33 -0
  123. package/node_modules/@noodle-borg/transport-http/dist/identity-authorization.d.ts.map +1 -0
  124. package/node_modules/@noodle-borg/transport-http/dist/identity-authorization.js +133 -0
  125. package/node_modules/@noodle-borg/transport-http/dist/identity-authorization.js.map +1 -0
  126. package/node_modules/@noodle-borg/transport-http/dist/tool-authorization.d.ts +25 -0
  127. package/node_modules/@noodle-borg/transport-http/dist/tool-authorization.d.ts.map +1 -0
  128. package/node_modules/@noodle-borg/transport-http/dist/tool-authorization.js +64 -0
  129. package/node_modules/@noodle-borg/transport-http/dist/tool-authorization.js.map +1 -0
  130. package/package.json +1 -1
@@ -49,11 +49,11 @@ export const BUNDLED_EXAMPLE_FILES = [
49
49
  { relPath: "examples/acme-tasks/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: #f7f5ff;\n --nw-text: #1c1830;\n --nw-muted: #635d80;\n --nw-border: #e2ddf5;\n --nw-accent: #7c3aed;\n --nw-accent-strong: #6d28d9;\n --nw-accent-soft: #efe9ff;\n --nw-high: #dc2626;\n --nw-medium: #b45309;\n --nw-low: #2563eb;\n --nw-radius: 10px;\n --nw-shadow: 0 18px 50px rgb(30 20 60 / 12%);\n}\n\n.dark,\n[data-theme=\"dark\"] {\n --nw-bg: #161228;\n --nw-surface: #1d1735;\n --nw-text: #f2eeff;\n --nw-muted: #a99fce;\n --nw-border: #342a54;\n --nw-accent: #a78bfa;\n --nw-accent-strong: #8b5cf6;\n --nw-accent-soft: #2a2148;\n --nw-high: #f87171;\n --nw-medium: #fbbf24;\n --nw-low: #60a5fa;\n --nw-shadow: 0 18px 50px rgb(0 0 0 / 32%);\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 max-width: 620px;\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: 24px;\n height: 24px;\n fill: none;\n stroke: var(--nw-accent);\n stroke-width: 2;\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-capture {\n display: flex;\n gap: 8px;\n padding: 14px 16px 4px;\n}\n\n.nw-input {\n flex: 1;\n padding: 9px 12px;\n border: 1px solid var(--nw-border);\n border-radius: 10px;\n background: var(--nw-bg);\n color: var(--nw-text);\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-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-list {\n list-style: none;\n margin: 0;\n padding: 8px 16px 4px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.nw-task {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 10px 12px;\n border: 1px solid var(--nw-border);\n border-radius: 12px;\n background: var(--nw-bg);\n}\n\n.nw-task-title {\n flex: 1;\n min-width: 0;\n}\n\n.nw-task-done {\n opacity: 0.55;\n}\n\n.nw-task-done .nw-task-title {\n text-decoration: line-through;\n}\n\n.nw-check {\n width: 22px;\n height: 22px;\n border: 1.5px solid var(--nw-border);\n border-radius: 999px;\n background: transparent;\n color: #ffffff;\n cursor: pointer;\n flex: none;\n}\n\n.nw-check-on {\n background: var(--nw-accent);\n border-color: var(--nw-accent);\n}\n\n.nw-priority {\n padding: 5px 8px;\n border: 1px solid var(--nw-border);\n border-radius: 8px;\n background: var(--nw-bg);\n color: var(--nw-text);\n font-size: 12px;\n font-weight: 600;\n}\n\n.nw-priority-high {\n color: var(--nw-high);\n}\n\n.nw-priority-medium {\n color: var(--nw-medium);\n}\n\n.nw-priority-low {\n color: var(--nw-low);\n}\n\n.nw-note {\n margin: 0;\n padding: 8px 16px 16px;\n font-size: 12px;\n color: var(--nw-muted);\n}\n" },
50
50
  { relPath: "examples/acme-tasks/test/server.test.ts", content: "import { describe, expect, it } from 'vitest';\nimport app from '../src/server.js';\n\ndescribe('acme-tasks example', () => {\n it('exports a Noodle server definition', () => {\n expect(typeof app.toManifest).toBe('function');\n });\n\n it('exposes a tool for each of the top-3 prioritized flows', async () => {\n // Capture → add_task, Prioritize → list_today (+ set_priority helper), Complete → complete_task.\n const text = JSON.stringify(await app.toManifest());\n expect(text).toContain('add_task');\n expect(text).toContain('list_today');\n expect(text).toContain('complete_task');\n expect(text).toContain('set_priority');\n });\n\n it('seeds today’s list highest-priority first', async () => {\n const text = JSON.stringify(await app.toManifest());\n expect(text).toMatch(/\"tasks\":\\[\\{\"id\":\"email_vendor\".*\"priority\":\"high\"/);\n });\n\n it('opts the conversational completion action into runtime confirmation', async () => {\n const manifest = await app.toManifest();\n const completeTask = manifest.tools.find((candidate) => candidate.name === 'complete_task');\n const addTask = manifest.tools.find((candidate) => candidate.name === 'add_task');\n\n expect(completeTask?.annotations?.confirm).toBe(true);\n expect(addTask?.annotations).not.toHaveProperty('confirm');\n });\n});\n" },
51
51
  { relPath: "examples/acme-tasks/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" },
52
- { relPath: "examples/customer-auth/README.md", content: "# Customer Auth - NoodleSeed.com Firebase customer identity\n\nThis curated example owns the customer/end-user authentication with Firebase bridge capability slot. It is\nthe NoodleSeed.com dogfood app for proving that a SaaS app can protect an MCP endpoint with its own customer\nidentity provider while still using the generic Noodle Seed authoring API.\n\nIt also owns the embedded-assistant showcase: the same authenticated MCP surface can be dropped into the\nSaaS web application as a fully customer-branded assistant with independent light and dark themes. The\nassistant loads the active deployment's instructions and model-visible tools rather than installing a stale\nsecond skill bundle. The standard embedded element also hosts linked MCP Apps behind its sandbox bridge.\n\nThe public developer entrypoint is [`src/server.ts`](src/server.ts). It declares `customerAuth.firebase(...)` with\nthe NoodleSeed.com Firebase project and Firebase Web App public config. It exposes a deliberately small MCP\nsurface for org discovery:\n\n- `list_my_organizations` lists the NoodleSeed.com organizations the signed-in customer belongs to (no\n arguments — the org set comes from the verified customer session).\n- `list_org_apps` lists apps for one of those organizations through the dev app API.\n\nThe two tools chain: `list_my_organizations` surfaces the `org_id`s the customer can act on, and\n`list_org_apps` takes one of those `org_id`s. There is no NoodleSeed-specific SDK helper. The downstream API\nis an ordinary authored HTTP connector.\n\n## Direct or federated OIDC instead of the built-in adapter\n\nThis flagship uses the managed Firebase adapter. If an app replaces it with `customerAuth.oidc(...)` or\n`customerAuth.federatedOidc(...)`, the app developer owns the authorization server. It must publish the\nprimary path-inserted RFC 8414 URL as direct HTTP 200 JSON with the exact issuer, HTTPS authorization/token/\nregistration/JWKS endpoints, authorization-code and refresh grants, PKCE S256, public-client auth method\n`none`, RFC 8707 resource handling, an access-token `aud` equal to the exact MCP URL, and public signing keys.\n\nRun `noodle auth doctor src/server.ts` before sharing the endpoint. Its issuer-readiness probes perform\nbounded read-only GET checks and never register a client. A successful\n`noodle deploy --access customers` reports the same findings as nonblocking warnings; the application team\nrepairs the issuer rather than adding a Noodle OAuth proxy.\n\nAdding the embedded assistant does not choose or rewrite MCP customer auth. Inspect the exact active\ndeployment before changing configuration:\n\n```sh\nnoodle deployments list --org <org> --app <app> --env <env> --json\n```\n\nThis Firebase bridge intentionally advertises the Noodle authorization server. A direct or federated\nreplacement must advertise its configured tenant issuer. If the exact active direct/federated `customers`\ndeployment instead advertises the platform issuer, report `customer_auth_state_inconsistent` with only the\nendpoint, deployment ID, server version, and sanitized protected-resource metadata. Do not share tokens or\nsecrets, proxy or rewrite metadata, rotate credentials, or redeploy repeatedly to conceal the mismatch.\n\nDuring MCP OAuth login, Noodle Cloud hosts the Firebase bridge page at\n`https://cloud.noodleseed.dev/oauth/customer/firebase/authorize`. The customer app does not add an\nauthorization route. The SaaS operator only configures Firebase Auth to allow the Noodle Cloud origin, and\nNoodle Cloud signs the customer in with Firebase before posting the Firebase ID token back to its own bridge\ncallback.\n\n## How delegated customer credentials are used\n\nThis flagship uses the legacy Firebase provider bridge because it is runnable today. That is distinct from\nCore-v2 account-selecting connector aliases: those declare catalog `credentialProfiles` and bind each alias\nwith `bind(connector, { profile, connection })`. Hosted bound `managedSecret(...)` connections are runnable;\nbound `externalExchange()` and `clientCredentials(...)` currently compile as portable metadata but fail\nclosed before secret or network access until their provider slice lands. Do not replace this example's\nworking delegated-session-cookie path with either unsupported bound exchange source.\n\nThe example has two declarations that work together:\n\n```ts\nauth: customerAuth.firebase({\n projectId: variable('FIREBASE_PROJECT_ID'),\n apiKey: variable('FIREBASE_WEB_API_KEY'),\n authDomain: variable('FIREBASE_AUTH_DOMAIN'),\n user: {\n id: 'sub',\n email: 'email',\n name: 'name',\n tenant: 'firebase.tenant',\n orgs: 'claims.orgs',\n roles: 'claims.roles',\n },\n}),\n```\n\nThat protects the MCP endpoint with the SaaS customer's Firebase identity. The connector then opts into\ndelegated customer credentials:\n\n```ts\nauth: {\n kind: 'delegatedSessionCookie',\n provider: 'firebase',\n sessionUrl: `${noodleseedApiOrigin}/api/auth/session`,\n tokenField: 'idToken',\n},\n```\n\nTool code calls the connector normally:\n\n```ts\nfulfil({ 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\n return { result: apps.result };\n}\n```\n\nAt runtime, Noodle Seed verifies the Firebase customer during MCP OAuth, stores that customer's delegated\nFirebase refresh token in the credential broker, and refreshes a short-lived Firebase ID token only when a\nconnector-backed tool calls the NoodleSeed.com API. For this app API, the broker exchanges that ID token at\nthe existing Next.js `/api/auth/session` route and sends the resulting session cookie to the API. The MCP\naccess token remains a Noodle-issued resource-bound token and is never sent to the downstream API.\n\n## Delegated downstream auth for your own API (token exchange)\n\nThe Firebase path above only works for Firebase-session downstreams. When the downstream is **your own\nAPI** with its own token issuance, use `delegatedTokenExchange` instead\n([ADR 0152](../../docs/decisions/0152-delegated-token-exchange-connector-auth.md)): the platform signs a\nshort-lived, JWKS-verifiable assertion of the signed-in user and exchanges it (RFC 8693) at a token\nendpoint you implement, which mints your own user-scoped token — so your API enforces its own per-user\nauthorization on every call. It works for verified direct/federated OIDC, built-in provider identities, and\nembedded assistant sessions, with no per-user OAuth enrollment.\n\n```ts\nauth: {\n kind: 'delegatedTokenExchange',\n tokenUrl: 'https://app.example.com/api/assistant/oauth/token', // origin must be in allowedOrigins\n clientId: variable('EXAMPLE_DELEG_CLIENT_ID'),\n clientSecret: secret('EXAMPLE_DELEG_CLIENT_SECRET'),\n scopes: ['time_off'],\n},\n```\n\nYour endpoint authenticates the broker's client credential, verifies the `subject_token` JWT against the\nplatform issuer JWKS (claims include the verified `sub`, `email`, `name`, declared session `claims`,\n`tenant`, and `deployment`), mints a short-lived user-scoped token, and returns the standard\n`{ access_token, token_type, expires_in }` response. The exact wire contract and a copyable endpoint\nimplementation live in [docs/spec/connectors.md](../../docs/spec/connectors.md) and the Agent Kit\nauthoring-workflow reference (\"Delegated downstream auth\"). `noodle auth doctor` reports each declared\nexchange endpoint.\n\n## Validate\n\n```bash\nnoodle auth doctor examples/customer-auth/src/server.ts\nnoodle validate examples/customer-auth/src/server.ts\n```\n\nAgainst a deployed customer-protected environment, set a short-lived real customer token only in\n`NOODLE_CUSTOMER_TOKEN` and add `--live --org <org> --app <app> --env <env>`. The live doctor performs\ncredential exchanges without invoking either business tool.\n\n## Run locally\n\n```bash\nnoodle dev examples/customer-auth/src/server.ts --app noodleseed-customer-auth\n```\n\n## Configuration\n\nThe embedded assistant uses a customer-supplied OpenAI Chat Completions-compatible endpoint. Configure its\nmanaged values at the Noodle deployment environment; none of these values belongs in the customer web\napplication environment, and the API key never reaches the browser:\n\n```bash\nnoodle variables set ASSISTANT_MODEL_BASE_URL https://model.example.com/v1 --scope env\nnoodle variables set ASSISTANT_MODEL your-model --scope env\nnoodle secrets set ASSISTANT_MODEL_API_KEY --scope env\nnoodle variables set FIREBASE_PROJECT_ID your-firebase-project --scope env\nnoodle variables set FIREBASE_WEB_API_KEY your-firebase-web-api-key --scope env\nnoodle variables set FIREBASE_AUTH_DOMAIN your-firebase-project.firebaseapp.com --scope env\nnoodle check --target embedded-assistant src/server.ts\n```\n\nAssistant origins are exact. Production embedding origins must use HTTPS; plain HTTP is accepted only for\nloopback development origins such as `http://localhost:3000`, `http://127.0.0.1:3000`, or\n`http://[::1]:3000`. `noodle dev` serves the MCP project, not that separate embedding application.\n\nThe assistant's panel, launcher, status header, composer, and message treatment are configured through the\nbounded `presentation` object in `src/server.ts`. The Atlas-style product treatment is the supported\ncustomization ceiling. These primitives derive their colors from the shared server `branding` block and\nrequire no edits to `@noodleseed/assistant`; raw HTML, CSS, inline SVG, renderer class names, and callbacks\nare intentionally not accepted in deployment configuration.\n\nCreate the backend credential after deployment. The CLI writes it to a mode-0600 file and never prints the\nsecret:\n\n```bash\nnoodle assistant clients create --name web --org noodleseed --app customer-auth --env prod\n```\n\nOnly the Noodle service URL, assistant client ID, and assistant client secret belong in the authenticated\ncustomer backend. The model URL, model name, and model API key remain managed by the Noodle deployment.\n\nThe customer's authenticated backend calls `createAssistantSession(...)` from\n`@noodleseed/assistant/server`, passing the already-verified user and browser origin. The browser then uses\nthe returned short-lived session through the managed Web Component/React renderer or a customer-owned UI:\n\n```bash\npnpm add @noodleseed/assistant\n```\n\n```tsx\nimport { NoodleAssistant } from '@noodleseed/assistant/react';\n\n<NoodleAssistant\n sessionEndpoint=\"/api/noodle-assistant/session\"\n theme={resolvedTheme}\n onSessionExpired={() => console.info('Assistant session renewed')}\n/>;\n```\n\n`resolvedTheme` is the application's current `'light' | 'dark'` value. Use `theme=\"auto\"` only when the\nbrowser operating-system preference is intentionally authoritative.\n\nFor an entirely application-owned React renderer, use the renderer-free hook. It creates no custom element\nand returns the AI SDK transcript plus the canonical client commands:\n\n```tsx\n'use client';\n\nimport { useEffect, useState } from 'react';\nimport { NoodleAppView } from '@noodleseed/assistant/react';\nimport { useNoodleAssistant } from '@noodleseed/assistant/react/client';\n\nexport function CustomerAssistant({\n principalKey,\n resolvedTheme,\n}: {\n principalKey: string;\n resolvedTheme: 'light' | 'dark';\n}) {\n const [draft, setDraft] = useState('');\n const { client, messages, status, error } = useNoodleAssistant({\n sessionEndpoint: '/api/noodle-assistant/session',\n principalKey,\n });\n const busy = status === 'submitted' || status === 'streaming';\n const settle = (operation: Promise<void>) => {\n void operation.catch(() => {\n // The hook exposes this same structured failure through `error`.\n });\n };\n\n return (\n <section aria-label=\"Assistant\" aria-busy={busy}>\n {messages.map((message) => (\n <article key={message.id} data-role={message.role}>\n {message.parts.map((part, index) => {\n if (part.type === 'text') return <p key={index}>{part.text}</p>;\n if (part.type === 'data-confirmation') {\n const review = part.data;\n return (\n <section key={review.id} aria-label=\"Review proposed action\">\n <h3>{review.title ?? 'Review proposed action'}</h3>\n {review.description ? <p>{review.description}</p> : null}\n <pre aria-label=\"Proposed action arguments\">\n {JSON.stringify(review.arguments ?? {}, null, 2)}\n </pre>\n <button\n disabled={busy || review.status !== 'pending'}\n onClick={() => settle(client.respond(review.id, { action: 'accept' }))}\n >\n Confirm\n </button>\n <button\n disabled={busy || review.status !== 'pending'}\n onClick={() => settle(client.respond(review.id, { action: 'decline' }))}\n >\n Don't proceed\n </button>\n </section>\n );\n }\n if (part.type === 'data-input-request') {\n const request = part.data;\n return (\n <section key={request.id} aria-label=\"Assistant needs input\">\n <p>{request.message}</p>\n <p>This renderer has not implemented the requested form.</p>\n <button\n disabled={busy || request.status !== 'pending'}\n onClick={() => settle(client.respond(request.id, { action: 'decline' }))}\n >\n Cancel request\n </button>\n </section>\n );\n }\n if (part.type === 'data-tool-result') {\n return (\n <pre key={part.data.id} aria-label={`${part.data.tool} result`}>\n {JSON.stringify(part.data.result, null, 2)}\n </pre>\n );\n }\n if (part.type === 'data-view') {\n return (\n <NoodleAppView\n key={`${part.data.id}:${part.data.resourceUri}`}\n client={client}\n view={part.data}\n theme={resolvedTheme}\n />\n );\n }\n return <p key={index}>Unsupported assistant content.</p>;\n })}\n </article>\n ))}\n {error ? <p role=\"alert\">{error.message}</p> : null}\n <form\n onSubmit={(event) => {\n event.preventDefault();\n const message = draft.trim();\n if (!message) return;\n setDraft('');\n settle(client.sendMessage(message));\n }}\n >\n <input\n aria-label=\"Message\"\n value={draft}\n onChange={(event) => setDraft(event.currentTarget.value)}\n />\n {busy ? (\n <button type=\"button\" onClick={() => client.abort()}>\n Stop\n </button>\n ) : (\n <button type=\"submit\">Send</button>\n )}\n </form>\n </section>\n );\n}\n```\n\n`principalKey` stays in the browser. Change it whenever the authenticated user or tenant changes; the hook\nthen aborts and clears the prior session and transcript. The sample fails closed on input requests until its\nfallback is replaced with a form generated from `requestedSchema`. A production renderer must show the\ncomplete confirmation review and both decisions. For `data-view`, map `resourceUri` or `tool` and the\nbounded/redacted result to a component already trusted by this application only when intentionally replacing\nthe linked App with a native UI. Otherwise use `NoodleAppView`; JSON result data is not the App UI. Its\nsemantic lifecycle identity is the client plus `view.id` plus `view.resourceUri`, so parent payload/callback\nrerenders keep the iframe and only a different view or unmount tears down the bridge.\nNever inject `part.data.html`, assign it to `srcdoc`, fetch a `ui://` URI, or reproduce the bridge directly. Pages with a\nContent-Security-Policy must include the Noodle service origin in both `connect-src` and `frame-src`.\n\nBefore the production-equivalent host build, run the presence-only handoff check:\n\n```sh\nnoodle assistant embed --check --json\n```\n\nAdd application-owned delegated-exchange requirements with repeatable `--require-env NAME` flags. The JSON\nreports required and missing names, CSP status, and post-deploy probes without returning environment values\nor writing scaffold files. Map the names through the production secret manager, CI environment, and any\nsecret allowlist; regenerate existing framework-owned environment binding types before the build. Default\nDevtools/model exercises to synthetic data, and obtain approval before sending real connector data to an\nexternal model.\n\nAfter deployment, verify the public delegated exchange without extracting a customer bearer token or invoking\na business operation:\n\n```sh\nnoodle assistant doctor --user-id <real-test-user> --origin \"$PUBLIC_APP_ORIGIN\" --org <org> --app <app> --env <env>\n```\n\nIf the application deliberately sends a first turn on mount, do not combine a persistent \"sent\" ref with a\nmount effect. React Strict Mode can abort that provisional request and then suppress the stable remount.\nSchedule the send after the provisional cleanup and settle its promise:\n\n```tsx\nuseEffect(() => {\n let active = true;\n queueMicrotask(() => {\n if (active) settle(client.sendMessage(initialMessage));\n });\n return () => {\n active = false;\n };\n}, [client, initialMessage]);\n```\n\nFor a chat-first custom host, raw `tool_started` supplies the direct call `id` and technical tool name. Map\nknown tools to concise application copy and use a neutral fallback. Reserve a stable `role=\"status\"` region\nfor thinking, tool activity, and the view skeleton; switch to the ready `NoodleAppView` on `view_available`\nor to `role=\"alert\"` on error. Decorative skeleton shapes stay hidden from assistive technology, and shimmer\nor transition motion is disabled under `prefers-reduced-motion`.\n\nUse `${view.id}:${view.resourceUri}` as transport identity. Different call IDs are distinct invocations and\nmust not be deduplicated generically. If this application intentionally owns one current panel for a known\nresource, declare an application-owned slot for that resource and replace only that slot.\n\nOutside React, subscribe to the DOM-free client directly. It exposes the same conversation as headless AI\nSDK `UIMessage` state, including typed confirmation, input, tool-result, and linked-view parts:\n\n```ts\nimport { createAssistantClient } from '@noodleseed/assistant/client';\n\nconst assistant = createAssistantClient({\n sessionEndpoint: '/api/noodle-assistant/session',\n});\n\nassistant.subscribeChat((state) => {\n renderUIMessageState(state);\n for (const message of state.messages) {\n for (const part of message.parts) {\n if (part.type === 'data-confirmation' && part.data.status === 'pending') {\n renderConfirmation(part.data, (response) => assistant.respond(part.data.id, response));\n }\n }\n }\n});\n```\n\n`theme=\"auto\"` follows the browser operating-system preference, not a SaaS-owned theme toggle. Pass the\napplication's resolved `light`/`dark` theme to both `NoodleAssistant` and `NoodleAppView`; later updates\nreach mounted MCP Apps without remounting them. CSS custom properties inherit through the assistant host, so\ntyped appearance roles may reuse existing application tokens with `var(--app-token)`. The server-level\n`branding` block is inherited by both MCP App widgets and the assistant; documented `--ns-assistant-*`\nsemantic CSS variables remain the final integration escape hatch. There is no second assistant branding\ndeclaration.\nThe end-user UI contains only customer branding.\nText streams progressively. Expired turns re-exchange through the authenticated backend and retry once;\nconsent-bound tool confirmations never replay automatically.\n\nThe Firebase project ID is required because Firebase ID tokens use the project ID as the token audience and\nissuer suffix. The runtime verifies `aud` against the project ID and `iss` against\n`https://securetoken.google.com/<projectId>`.\n\nThe Firebase Web API key and auth domain are public Firebase browser configuration. They let the Noodle\nCloud-hosted bridge initialize Firebase Auth for this customer project; they are not server secrets. Keep\nthem out of source with `variable(...)`, restrict the Firebase key to the expected browser origins and APIs,\nand use `secret(...)` only for credentials that must never reach a browser.\n\nThe `noodleseed_app_api` connector currently points at the NoodleSeed.com dev app surface:\n\n```text\nhttps://dev.noodleseed.com\n```\n\nWhen the customer app moves from `dev.noodleseed.com` to `app.noodleseed.com`, update the connector's\n`noodleseedApiOrigin` constant to the production API origin that serves the same paths.\n\nThe connector uses delegated Firebase customer credentials. During the customer OAuth bridge, Noodle Seed\nverifies the Firebase ID token, stores the Firebase refresh token through the credential broker, and refreshes\na Firebase ID token when the connector calls the NoodleSeed.com app API. The broker then exchanges that ID\ntoken for the app's existing Next.js session cookie. There is no shared `NOODLESEED_APP_API_TOKEN` for this\nexample.\n\nFirebase Auth must list `cloud.noodleseed.dev` as an authorized domain before browser sign-in works in\nproduction.\n\n## Deploy customer-protected to Noodle Seed Cloud\n\n```bash\nnoodle deploy examples/customer-auth/src/server.ts \\\n --org noodleseed \\\n --app customer-auth \\\n --env prod \\\n --access customers\n```\n\nEndpoint:\n\n```text\nhttps://cloud.noodleseed.dev/o/noodleseed/customer-auth/mcp\n```\n\n## MCP Primitives\n\n- Tool `list_my_organizations`: calls `GET /api/organizations` and returns the organizations the signed-in\n customer is a member of. Takes no arguments; the org set is scoped by the verified customer session.\n- Tool `list_org_apps`: calls `GET /api/organizations/{org_id}/apps` for one organization `org_id`.\n\n## Auth boundary\n\nFirebase ID-token verification is handled by Noodle Seed's generic Firebase bridge adapter during OAuth\nissuance. The MCP client receives a Noodle-issued, resource-bound access token marked as a Firebase customer\nidentity; raw Firebase tokens and inbound MCP bearer tokens are never forwarded to tools, connectors,\nwidgets, or downstream systems.\n\nThe connector-backed tools use the credential broker to turn the signed-in Firebase customer session into the\nsame session-cookie credential that the existing NoodleSeed.com Next.js API already expects. The inbound MCP\nbearer token is never used as an app API credential.\n" },
52
+ { relPath: "examples/customer-auth/README.md", content: "# Customer Auth - NoodleSeed.com Firebase customer identity\n\nThis curated example owns the customer/end-user authentication with Firebase bridge capability slot. It is\nthe NoodleSeed.com dogfood app for proving that a SaaS app can protect an MCP endpoint with its own customer\nidentity provider while still using the generic Noodle Seed authoring API.\n\nIt also owns the embedded-assistant showcase: the same authenticated MCP surface can be dropped into the\nSaaS web application as a fully customer-branded assistant with independent light and dark themes. The\nassistant loads the active deployment's instructions and model-visible tools rather than installing a stale\nsecond skill bundle. The standard embedded element also hosts linked MCP Apps behind its sandbox bridge.\n\nThe public developer entrypoint is [`src/server.ts`](src/server.ts). It declares `customerAuth.firebase(...)` with\nthe NoodleSeed.com Firebase project and Firebase Web App public config. It exposes a deliberately small MCP\nsurface for org discovery:\n\n- `list_my_organizations` lists the NoodleSeed.com organizations the signed-in customer belongs to (no\n arguments — the org set comes from the verified customer session).\n- `list_org_apps` lists apps for one of those organizations through the dev app API. It is visible and\n callable only when the verified customer has the `org_apps:read` scope and either the `org_admin` or\n `org_member` role.\n\nThe two tools chain: `list_my_organizations` surfaces the `org_id`s the customer can act on, and\n`list_org_apps` takes one of those `org_id`s. There is no NoodleSeed-specific SDK helper. The downstream API\nis an ordinary authored HTTP connector.\n\n## Direct or federated OIDC instead of the built-in adapter\n\nThis flagship uses the managed Firebase adapter. If an app replaces it with `customerAuth.oidc(...)` or\n`customerAuth.federatedOidc(...)`, the app developer owns the authorization server. It must publish the\nprimary path-inserted RFC 8414 URL as direct HTTP 200 JSON with the exact issuer, HTTPS authorization/token/\nregistration/JWKS endpoints, authorization-code and refresh grants, PKCE S256, public-client auth method\n`none`, RFC 8707 resource handling, an access-token `aud` equal to the exact MCP URL, and public signing keys.\n\nRun `noodle auth doctor src/server.ts` before sharing the endpoint. Its issuer-readiness probes perform\nbounded read-only GET checks and never register a client. A successful\n`noodle deploy --access customers` reports the same findings as nonblocking warnings; the application team\nrepairs the issuer rather than adding a Noodle OAuth proxy.\n\nAdding the embedded assistant does not choose or rewrite MCP customer auth. Inspect the exact active\ndeployment before changing configuration:\n\n```sh\nnoodle deployments list --org <org> --app <app> --env <env> --json\n```\n\nThis Firebase bridge intentionally advertises the Noodle authorization server. A direct or federated\nreplacement must advertise its configured tenant issuer. If the exact active direct/federated `customers`\ndeployment instead advertises the platform issuer, report `customer_auth_state_inconsistent` with only the\nendpoint, deployment ID, server version, and sanitized protected-resource metadata. Do not share tokens or\nsecrets, proxy or rewrite metadata, rotate credentials, or redeploy repeatedly to conceal the mismatch.\n\nDuring MCP OAuth login, Noodle Cloud hosts the Firebase bridge page at\n`https://cloud.noodleseed.dev/oauth/customer/firebase/authorize`. The customer app does not add an\nauthorization route. The SaaS operator only configures Firebase Auth to allow the Noodle Cloud origin, and\nNoodle Cloud signs the customer in with Firebase before posting the Firebase ID token back to its own bridge\ncallback.\n\n## How delegated customer credentials are used\n\nThis flagship uses the legacy Firebase provider bridge because it is runnable today. That is distinct from\nCore-v2 account-selecting connector aliases: those declare catalog `credentialProfiles` and bind each alias\nwith `bind(connector, { profile, connection })`. Hosted bound `managedSecret(...)` connections are runnable;\nbound `externalExchange()` and `clientCredentials(...)` currently compile as portable metadata but fail\nclosed before secret or network access until their provider slice lands. Do not replace this example's\nworking delegated-session-cookie path with either unsupported bound exchange source.\n\nThe example has two declarations that work together:\n\n```ts\nauth: customerAuth.firebase({\n projectId: variable('FIREBASE_PROJECT_ID'),\n apiKey: variable('FIREBASE_WEB_API_KEY'),\n authDomain: variable('FIREBASE_AUTH_DOMAIN'),\n user: {\n id: 'sub',\n email: 'email',\n name: 'name',\n tenant: 'firebase.tenant',\n orgs: 'claims.orgs',\n roles: 'claims.roles',\n scopes: 'claims.scopes',\n },\n}),\n```\n\nThat protects the MCP endpoint with the SaaS customer's Firebase identity. The connector then opts into\ndelegated customer credentials:\n\n```ts\nauth: {\n kind: 'delegatedSessionCookie',\n provider: 'firebase',\n sessionUrl: `${noodleseedApiOrigin}/api/auth/session`,\n tokenField: 'idToken',\n},\n```\n\nThe mapped `roles` and `scopes` paths are read only after Firebase verifies the ID token. The restricted\ntool declares its rule beside the rest of its public contract:\n\n```ts\ntool('list_org_apps', {\n authorization: {\n requiredScopes: ['org_apps:read'],\n allowedRoles: ['org_admin', 'org_member'],\n },\n // input, output, and fulfilment...\n});\n```\n\nEvery required scope must be present and at least one allowed role must match. When both lists are declared,\nboth conditions apply. A restricted tool is omitted from `tools/list` for an ineligible customer and a\ndirect `tools/call` still fails closed. Do not use unverified page context, request arguments, connector\nresponses, or an arbitrary generic `roles` claim as authorization input.\n\nTool code calls the connector normally:\n\n```ts\nfulfil({ 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\n return { result: apps.result };\n}\n```\n\nAt runtime, Noodle Seed verifies the Firebase customer during MCP OAuth, stores that customer's delegated\nFirebase refresh token in the credential broker, and refreshes a short-lived Firebase ID token only when a\nconnector-backed tool calls the NoodleSeed.com API. For this app API, the broker exchanges that ID token at\nthe existing Next.js `/api/auth/session` route and sends the resulting session cookie to the API. The MCP\naccess token remains a Noodle-issued resource-bound token and is never sent to the downstream API.\n\n## Delegated downstream auth for your own API (token exchange)\n\nThe Firebase path above only works for Firebase-session downstreams. When the downstream is **your own\nAPI** with its own token issuance, use `delegatedTokenExchange` instead\n([ADR 0152](../../docs/decisions/0152-delegated-token-exchange-connector-auth.md)): the platform signs a\nshort-lived, JWKS-verifiable assertion of the signed-in user and exchanges it (RFC 8693) at a token\nendpoint you implement, which mints your own user-scoped token — so your API enforces its own per-user\nauthorization on every call. It works for verified direct/federated OIDC, built-in provider identities, and\nembedded assistant sessions, with no per-user OAuth enrollment.\n\n```ts\nauth: {\n kind: 'delegatedTokenExchange',\n tokenUrl: 'https://app.example.com/api/assistant/oauth/token', // origin must be in allowedOrigins\n clientId: variable('EXAMPLE_DELEG_CLIENT_ID'),\n clientSecret: secret('EXAMPLE_DELEG_CLIENT_SECRET'),\n scopes: ['time_off'],\n},\n```\n\nYour endpoint authenticates the broker's client credential, verifies the `subject_token` JWT against the\nplatform issuer JWKS (claims include the verified `sub`, `email`, `name`, declared session `claims`,\n`tenant`, and `deployment`), mints a short-lived user-scoped token, and returns the standard\n`{ access_token, token_type, expires_in }` response. The exact wire contract and a copyable endpoint\nimplementation live in [docs/spec/connectors.md](../../docs/spec/connectors.md) and the Agent Kit\nauthoring-workflow reference (\"Delegated downstream auth\"). `noodle auth doctor` reports each declared\nexchange endpoint.\n\n## Validate\n\n```bash\nnoodle auth doctor examples/customer-auth/src/server.ts\nnoodle validate examples/customer-auth/src/server.ts\n```\n\nAgainst a deployed customer-protected environment, set a short-lived real customer token only in\n`NOODLE_CUSTOMER_TOKEN` and add `--live --org <org> --app <app> --env <env>`. The live doctor performs\ncredential exchanges without invoking either business tool.\n\n## Run locally\n\n```bash\nnoodle dev examples/customer-auth/src/server.ts --app noodleseed-customer-auth\n```\n\n## Configuration\n\nThe embedded assistant uses a customer-supplied OpenAI Chat Completions-compatible endpoint. Configure its\nmanaged values at the Noodle deployment environment; none of these values belongs in the customer web\napplication environment, and the API key never reaches the browser:\n\n```bash\nnoodle variables set ASSISTANT_MODEL_BASE_URL https://model.example.com/v1 --scope env\nnoodle variables set ASSISTANT_MODEL your-model --scope env\nnoodle secrets set ASSISTANT_MODEL_API_KEY --scope env\nnoodle variables set FIREBASE_PROJECT_ID your-firebase-project --scope env\nnoodle variables set FIREBASE_WEB_API_KEY your-firebase-web-api-key --scope env\nnoodle variables set FIREBASE_AUTH_DOMAIN your-firebase-project.firebaseapp.com --scope env\nnoodle check --target embedded-assistant src/server.ts\n```\n\nAssistant origins are exact. Production embedding origins must use HTTPS; plain HTTP is accepted only for\nloopback development origins such as `http://localhost:3000`, `http://127.0.0.1:3000`, or\n`http://[::1]:3000`. `noodle dev` serves the MCP project, not that separate embedding application.\n\nThe assistant's panel, launcher, status header, composer, and message treatment are configured through the\nbounded `presentation` object in `src/server.ts`. The Atlas-style product treatment is the supported\ncustomization ceiling. These primitives derive their colors from the shared server `branding` block and\nrequire no edits to `@noodleseed/assistant`; raw HTML, CSS, inline SVG, renderer class names, and callbacks\nare intentionally not accepted in deployment configuration.\n\nCreate the backend credential after deployment. The CLI writes it to a mode-0600 file and never prints the\nsecret:\n\n```bash\nnoodle assistant clients create --name web --org noodleseed --app customer-auth --env prod\n```\n\nOnly the Noodle service URL, assistant client ID, and assistant client secret belong in the authenticated\ncustomer backend. The model URL, model name, and model API key remain managed by the Noodle deployment.\n\nThe customer's authenticated backend calls `createAssistantSession(...)` from\n`@noodleseed/assistant/server`, passing the already-verified user and browser origin. The browser then uses\nthe returned short-lived session through the managed Web Component/React renderer or a customer-owned UI:\n\n```bash\npnpm add @noodleseed/assistant\n```\n\n```tsx\nimport { NoodleAssistant } from '@noodleseed/assistant/react';\n\n<NoodleAssistant\n sessionEndpoint=\"/api/noodle-assistant/session\"\n theme={resolvedTheme}\n onSessionExpired={() => console.info('Assistant session renewed')}\n/>;\n```\n\n`resolvedTheme` is the application's current `'light' | 'dark'` value. Use `theme=\"auto\"` only when the\nbrowser operating-system preference is intentionally authoritative.\n\nFor an entirely application-owned React renderer, use the renderer-free hook. It creates no custom element\nand returns the AI SDK transcript plus the canonical client commands:\n\n```tsx\n'use client';\n\nimport { useEffect, useState } from 'react';\nimport { NoodleAppView } from '@noodleseed/assistant/react';\nimport { useNoodleAssistant } from '@noodleseed/assistant/react/client';\n\nexport function CustomerAssistant({\n principalKey,\n resolvedTheme,\n}: {\n principalKey: string;\n resolvedTheme: 'light' | 'dark';\n}) {\n const [draft, setDraft] = useState('');\n const { client, messages, status, error } = useNoodleAssistant({\n sessionEndpoint: '/api/noodle-assistant/session',\n principalKey,\n });\n const busy = status === 'submitted' || status === 'streaming';\n const settle = (operation: Promise<void>) => {\n void operation.catch(() => {\n // The hook exposes this same structured failure through `error`.\n });\n };\n\n return (\n <section aria-label=\"Assistant\" aria-busy={busy}>\n {messages.map((message) => (\n <article key={message.id} data-role={message.role}>\n {message.parts.map((part, index) => {\n if (part.type === 'text') return <p key={index}>{part.text}</p>;\n if (part.type === 'data-confirmation') {\n const review = part.data;\n return (\n <section key={review.id} aria-label=\"Review proposed action\">\n <h3>{review.title ?? 'Review proposed action'}</h3>\n {review.description ? <p>{review.description}</p> : null}\n <pre aria-label=\"Proposed action arguments\">\n {JSON.stringify(review.arguments ?? {}, null, 2)}\n </pre>\n <button\n disabled={busy || review.status !== 'pending'}\n onClick={() => settle(client.respond(review.id, { action: 'accept' }))}\n >\n Confirm\n </button>\n <button\n disabled={busy || review.status !== 'pending'}\n onClick={() => settle(client.respond(review.id, { action: 'decline' }))}\n >\n Don't proceed\n </button>\n </section>\n );\n }\n if (part.type === 'data-input-request') {\n const request = part.data;\n return (\n <section key={request.id} aria-label=\"Assistant needs input\">\n <p>{request.message}</p>\n <p>This renderer has not implemented the requested form.</p>\n <button\n disabled={busy || request.status !== 'pending'}\n onClick={() => settle(client.respond(request.id, { action: 'decline' }))}\n >\n Cancel request\n </button>\n </section>\n );\n }\n if (part.type === 'data-tool-result') {\n return (\n <pre key={part.data.id} aria-label={`${part.data.tool} result`}>\n {JSON.stringify(part.data.result, null, 2)}\n </pre>\n );\n }\n if (part.type === 'data-view') {\n return (\n <NoodleAppView\n key={`${part.data.id}:${part.data.resourceUri}`}\n client={client}\n view={part.data}\n theme={resolvedTheme}\n />\n );\n }\n return <p key={index}>Unsupported assistant content.</p>;\n })}\n </article>\n ))}\n {error ? <p role=\"alert\">{error.message}</p> : null}\n <form\n onSubmit={(event) => {\n event.preventDefault();\n const message = draft.trim();\n if (!message) return;\n setDraft('');\n settle(client.sendMessage(message));\n }}\n >\n <input\n aria-label=\"Message\"\n value={draft}\n onChange={(event) => setDraft(event.currentTarget.value)}\n />\n {busy ? (\n <button type=\"button\" onClick={() => client.abort()}>\n Stop\n </button>\n ) : (\n <button type=\"submit\">Send</button>\n )}\n </form>\n </section>\n );\n}\n```\n\n`principalKey` stays in the browser. Change it whenever the authenticated user or tenant changes; the hook\nthen aborts and clears the prior session and transcript. The sample fails closed on input requests until its\nfallback is replaced with a form generated from `requestedSchema`. A production renderer must show the\ncomplete confirmation review and both decisions. For `data-view`, map `resourceUri` or `tool` and the\nbounded/redacted result to a component already trusted by this application only when intentionally replacing\nthe linked App with a native UI. Otherwise use `NoodleAppView`; JSON result data is not the App UI. Its\nsemantic lifecycle identity is the client plus `view.id` plus `view.resourceUri`, so parent payload/callback\nrerenders keep the iframe and only a different view or unmount tears down the bridge.\nNever inject `part.data.html`, assign it to `srcdoc`, fetch a `ui://` URI, or reproduce the bridge directly. Pages with a\nContent-Security-Policy must include the Noodle service origin in both `connect-src` and `frame-src`.\n\nBefore the production-equivalent host build, run the presence-only handoff check:\n\n```sh\nnoodle assistant embed --check --json\n```\n\nAdd application-owned delegated-exchange requirements with repeatable `--require-env NAME` flags. The JSON\nreports required and missing names, CSP status, and post-deploy probes without returning environment values\nor writing scaffold files. Map the names through the production secret manager, CI environment, and any\nsecret allowlist; regenerate existing framework-owned environment binding types before the build. Default\nDevtools/model exercises to synthetic data, and obtain approval before sending real connector data to an\nexternal model.\n\nAfter deployment, verify the public delegated exchange without extracting a customer bearer token or invoking\na business operation:\n\n```sh\nnoodle assistant doctor --user-id <real-test-user> --origin \"$PUBLIC_APP_ORIGIN\" --org <org> --app <app> --env <env>\n```\n\nIf the application deliberately sends a first turn on mount, do not combine a persistent \"sent\" ref with a\nmount effect. React Strict Mode can abort that provisional request and then suppress the stable remount.\nSchedule the send after the provisional cleanup and settle its promise:\n\n```tsx\nuseEffect(() => {\n let active = true;\n queueMicrotask(() => {\n if (active) settle(client.sendMessage(initialMessage));\n });\n return () => {\n active = false;\n };\n}, [client, initialMessage]);\n```\n\nFor a chat-first custom host, raw `tool_started` supplies the direct call `id` and technical tool name. Map\nknown tools to concise application copy and use a neutral fallback. Reserve a stable `role=\"status\"` region\nfor thinking, tool activity, and the view skeleton; switch to the ready `NoodleAppView` on `view_available`\nor to `role=\"alert\"` on error. Decorative skeleton shapes stay hidden from assistive technology, and shimmer\nor transition motion is disabled under `prefers-reduced-motion`.\n\nUse `${view.id}:${view.resourceUri}` as transport identity. Different call IDs are distinct invocations and\nmust not be deduplicated generically. If this application intentionally owns one current panel for a known\nresource, declare an application-owned slot for that resource and replace only that slot.\n\nOutside React, subscribe to the DOM-free client directly. It exposes the same conversation as headless AI\nSDK `UIMessage` state, including typed confirmation, input, tool-result, and linked-view parts:\n\n```ts\nimport { createAssistantClient } from '@noodleseed/assistant/client';\n\nconst assistant = createAssistantClient({\n sessionEndpoint: '/api/noodle-assistant/session',\n});\n\nassistant.subscribeChat((state) => {\n renderUIMessageState(state);\n for (const message of state.messages) {\n for (const part of message.parts) {\n if (part.type === 'data-confirmation' && part.data.status === 'pending') {\n renderConfirmation(part.data, (response) => assistant.respond(part.data.id, response));\n }\n }\n }\n});\n```\n\n`theme=\"auto\"` follows the browser operating-system preference, not a SaaS-owned theme toggle. Pass the\napplication's resolved `light`/`dark` theme to both `NoodleAssistant` and `NoodleAppView`; later updates\nreach mounted MCP Apps without remounting them. CSS custom properties inherit through the assistant host, so\ntyped appearance roles may reuse existing application tokens with `var(--app-token)`. The server-level\n`branding` block is inherited by both MCP App widgets and the assistant; documented `--ns-assistant-*`\nsemantic CSS variables remain the final integration escape hatch. There is no second assistant branding\ndeclaration.\nThe end-user UI contains only customer branding.\nText streams progressively. Expired turns re-exchange through the authenticated backend and retry once;\nconsent-bound tool confirmations never replay automatically.\n\nThe Firebase project ID is required because Firebase ID tokens use the project ID as the token audience and\nissuer suffix. The runtime verifies `aud` against the project ID and `iss` against\n`https://securetoken.google.com/<projectId>`.\n\nThe Firebase Web API key and auth domain are public Firebase browser configuration. They let the Noodle\nCloud-hosted bridge initialize Firebase Auth for this customer project; they are not server secrets. Keep\nthem out of source with `variable(...)`, restrict the Firebase key to the expected browser origins and APIs,\nand use `secret(...)` only for credentials that must never reach a browser.\n\nThe `noodleseed_app_api` connector currently points at the NoodleSeed.com dev app surface:\n\n```text\nhttps://dev.noodleseed.com\n```\n\nWhen the customer app moves from `dev.noodleseed.com` to `app.noodleseed.com`, update the connector's\n`noodleseedApiOrigin` constant to the production API origin that serves the same paths.\n\nThe connector uses delegated Firebase customer credentials. During the customer OAuth bridge, Noodle Seed\nverifies the Firebase ID token, stores the Firebase refresh token through the credential broker, and refreshes\na Firebase ID token when the connector calls the NoodleSeed.com app API. The broker then exchanges that ID\ntoken for the app's existing Next.js session cookie. There is no shared `NOODLESEED_APP_API_TOKEN` for this\nexample.\n\nFirebase Auth must list `cloud.noodleseed.dev` as an authorized domain before browser sign-in works in\nproduction.\n\n## Deploy customer-protected to Noodle Seed Cloud\n\n```bash\nnoodle deploy examples/customer-auth/src/server.ts \\\n --org noodleseed \\\n --app customer-auth \\\n --env prod \\\n --access customers\n```\n\nEndpoint:\n\n```text\nhttps://cloud.noodleseed.dev/o/noodleseed/customer-auth/mcp\n```\n\n## MCP Primitives\n\n- Tool `list_my_organizations`: calls `GET /api/organizations` and returns the organizations the signed-in\n customer is a member of. Takes no arguments; the org set is scoped by the verified customer session.\n- Tool `list_org_apps`: calls `GET /api/organizations/{org_id}/apps` for one organization `org_id`.\n\n## Auth boundary\n\nFirebase ID-token verification is handled by Noodle Seed's generic Firebase bridge adapter during OAuth\nissuance. The MCP client receives a Noodle-issued, resource-bound access token marked as a Firebase customer\nidentity; raw Firebase tokens and inbound MCP bearer tokens are never forwarded to tools, connectors,\nwidgets, or downstream systems.\n\nThe connector-backed tools use the credential broker to turn the signed-in Firebase customer session into the\nsame session-cookie credential that the existing NoodleSeed.com Next.js API already expects. The inbound MCP\nbearer token is never used as an app API credential.\n" },
53
53
  { relPath: "examples/customer-auth/noodle.json", content: "{\n \"entrypoint\": \"src/server.ts\",\n \"name\": \"customer-auth\"\n}\n" },
54
54
  { 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" },
55
- { relPath: "examples/customer-auth/src/server.ts", content: "import {\n annotations,\n connector,\n customerAuth,\n embeddedAssistant,\n openAICompatible,\n secret,\n server,\n tool,\n variable,\n z,\n} from '@noodleseed/one';\n\nconst noodleseedApiOrigin = 'https://dev.noodleseed.com';\n\nconst noodleseedApi = connector('noodleseed_app_api')\n .version('1.0.0')\n .http({\n baseUrl: noodleseedApiOrigin,\n allowedOrigins: [noodleseedApiOrigin],\n auth: {\n kind: 'delegatedSessionCookie',\n provider: 'firebase',\n sessionUrl: `${noodleseedApiOrigin}/api/auth/session`,\n tokenField: 'idToken',\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 },\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 auth: customerAuth.firebase({\n projectId: variable('FIREBASE_PROJECT_ID'),\n apiKey: variable('FIREBASE_WEB_API_KEY'),\n authDomain: variable('FIREBASE_AUTH_DOMAIN'),\n user: {\n id: 'sub',\n email: 'email',\n name: 'name',\n tenant: 'firebase.tenant',\n orgs: 'claims.orgs',\n roles: 'claims.roles',\n },\n }),\n instructions:\n 'Customer-authenticated demo. Firebase proves the customer identity, while read-only NoodleSeed.com API calls use broker-managed delegated Firebase customer credentials.',\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 allowedOrigins: [\n 'https://app.noodleseed.com',\n 'https://dev.noodleseed.com',\n 'http://localhost:3000',\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: ['Show my organizations', 'List the apps in my organization'],\n }),\n },\n [\n tool('list_org_apps', {\n title: 'List organization apps',\n description: 'List NoodleSeed.com apps for an organization from the dev app API.',\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 dev app 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 ],\n);\n" },
56
- { 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).toMatchObject({\n kind: 'bridge',\n provider: 'firebase',\n projectId: '${env.FIREBASE_PROJECT_ID}',\n apiKey: '${env.FIREBASE_WEB_API_KEY}',\n authDomain: '${env.FIREBASE_AUTH_DOMAIN}',\n });\n });\n});\n" },
55
+ { relPath: "examples/customer-auth/src/server.ts", content: "import {\n annotations,\n connector,\n customerAuth,\n embeddedAssistant,\n openAICompatible,\n secret,\n server,\n tool,\n variable,\n z,\n} from '@noodleseed/one';\n\nconst noodleseedApiOrigin = 'https://dev.noodleseed.com';\n\nconst noodleseedApi = connector('noodleseed_app_api')\n .version('1.0.0')\n .http({\n baseUrl: noodleseedApiOrigin,\n allowedOrigins: [noodleseedApiOrigin],\n auth: {\n kind: 'delegatedSessionCookie',\n provider: 'firebase',\n sessionUrl: `${noodleseedApiOrigin}/api/auth/session`,\n tokenField: 'idToken',\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 },\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 auth: customerAuth.firebase({\n projectId: variable('FIREBASE_PROJECT_ID'),\n apiKey: variable('FIREBASE_WEB_API_KEY'),\n authDomain: variable('FIREBASE_AUTH_DOMAIN'),\n user: {\n id: 'sub',\n email: 'email',\n name: 'name',\n tenant: 'firebase.tenant',\n orgs: 'claims.orgs',\n roles: 'claims.roles',\n scopes: 'claims.scopes',\n },\n }),\n instructions:\n 'Customer-authenticated demo. Firebase proves the customer identity, while read-only NoodleSeed.com API calls use broker-managed delegated Firebase customer credentials.',\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 allowedOrigins: [\n 'https://app.noodleseed.com',\n 'https://dev.noodleseed.com',\n 'http://localhost:3000',\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: ['Show my organizations', 'List the apps in my organization'],\n }),\n },\n [\n tool('list_org_apps', {\n title: 'List organization apps',\n description: 'List NoodleSeed.com apps for an organization from the dev app 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 dev app 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 ],\n);\n" },
56
+ { 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).toMatchObject({\n kind: 'bridge',\n provider: 'firebase',\n projectId: '${env.FIREBASE_PROJECT_ID}',\n apiKey: '${env.FIREBASE_WEB_API_KEY}',\n authDomain: '${env.FIREBASE_AUTH_DOMAIN}',\n user: {\n roles: 'claims.roles',\n scopes: 'claims.scopes',\n },\n });\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 });\n});\n" },
57
57
  { 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,\nand 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| 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\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\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## 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 link --org demo --app food-ordering\nnoodle deploy --access owner-only\nnoodle open\n```\n\nUse `--access org-members` for an org-wide internal demo. This example has no connector secrets and does not\ninclude 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\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" },
58
58
  { relPath: "examples/food-ordering/noodle.json", content: "{\n \"entrypoint\": \"src/server.ts\",\n \"name\": \"food-ordering\",\n \"template\": \"widget\"\n}\n" },
59
59
  { 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" },
@@ -1 +1 @@
1
- {"version":3,"file":"example-files.js","sourceRoot":"","sources":["../../src/generated/example-files.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,kFAAkF;A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E,2qBAA2qB,EAAE;IAC9uB,EAAE,OAAO,EAAE,0BAA0B,EAAE,OAAO,EAAE,wmEAAwmE,EAAE;IAC1pE,EAAE,OAAO,EAAE,4BAA4B,EAAE,OAAO,EAAE,iGAAiG,EAAE;IACrJ,EAAE,OAAO,EAAE,6BAA6B,EAAE,OAAO,EAAE,2WAA2W,EAAE;IACha,EAAE,OAAO,EAAE,8BAA8B,EAAE,OAAO,EAAE,oiCAAoiC,EAAE;IAC1lC,EAAE,OAAO,EAAE,oCAAoC,EAAE,OAAO,EAAE,msBAAmsB,EAAE;IAC/vB,EAAE,OAAO,EAAE,4BAA4B,EAAE,OAAO,EAAE,q3JAAq3J,EAAE;IACz6J,EAAE,OAAO,EAAE,8BAA8B,EAAE,OAAO,EAAE,uEAAuE,EAAE;IAC7H,EAAE,OAAO,EAAE,+BAA+B,EAAE,OAAO,EAAE,6WAA6W,EAAE;IACpa,EAAE,OAAO,EAAE,gCAAgC,EAAE,OAAO,EAAE,uiUAAuiU,EAAE;IAC/lU,EAAE,OAAO,EAAE,sCAAsC,EAAE,OAAO,EAAE,gzCAAgzC,EAAE;CAC/2C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"skill-authoring-refs.d.ts","sourceRoot":"","sources":["../src/skill-authoring-refs.ts"],"names":[],"mappings":"AAgBA,wBAAgB,gCAAgC,IAAI,MAAM,CAmRzD;AAWD,wBAAgB,6BAA6B,IAAI,MAAM,CA0QtD;AAmDD,wBAAgB,uBAAuB,IAAI,MAAM,CA0DhD"}
1
+ {"version":3,"file":"skill-authoring-refs.d.ts","sourceRoot":"","sources":["../src/skill-authoring-refs.ts"],"names":[],"mappings":"AAgBA,wBAAgB,gCAAgC,IAAI,MAAM,CA0SzD;AAWD,wBAAgB,6BAA6B,IAAI,MAAM,CA0QtD;AAmDD,wBAAgB,uBAAuB,IAAI,MAAM,CA0DhD"}
@@ -24,6 +24,7 @@ export function renderAuthoringWorkflowReference() {
24
24
  '- Connectors',
25
25
  '- HTTP connector example (full server)',
26
26
  '- Customer OAuth for remote MCP clients',
27
+ '- Per-tool authorization',
27
28
  '- Delegated downstream auth (call your API as the signed-in user)',
28
29
  '- Invocation context',
29
30
  '- Compute connector example',
@@ -124,6 +125,28 @@ export function renderAuthoringWorkflowReference() {
124
125
  '',
125
126
  'That metadata must expose HTTPS `authorization_endpoint`, `token_endpoint`, `jwks_uri`, and RFC 7591 `registration_endpoint`; advertise authorization-code and refresh-token grants, Dynamic Client Registration, PKCE with `code_challenge_methods_supported: ["S256"]`, and public clients with `token_endpoint_auth_methods_supported: ["none"]`. Implement RFC 8707 `resource`, mint access-token `aud` for the exact MCP resource URL, and publish only public signing keys in JWKS. Run `noodle auth doctor src/server.ts`; its issuer-readiness probes perform bounded read-only GET checks and never register a client. A successful `noodle deploy --access customers` reports the same readiness without turning a diagnostic failure into a failed deployment.',
126
127
  '',
128
+ '## Per-tool authorization',
129
+ '',
130
+ 'Keep endpoint authentication in `customerAuth.*(...)`, then narrow individual tools with the optional typed `authorization` rule. Every `requiredScopes` value is required; any one `allowedRoles` value is sufficient; when both lists are present, both conditions apply. Omit `authorization` for an unrestricted tool. Do not invent a policy expression language or infer authorization from tool arguments, page context, connector output, email domains, or other unverified data.',
131
+ '',
132
+ '```ts',
133
+ 'auth: customerAuth.oidc({',
134
+ " issuer: 'https://id.example.com',",
135
+ " audience: 'https://api.example.com/mcp',",
136
+ " claims: { roles: 'permissions.roles', scopes: 'permissions.scopes' },",
137
+ '}),',
138
+ '',
139
+ "tool('list_org_apps', {",
140
+ ' authorization: {',
141
+ " requiredScopes: ['org_apps:read'],",
142
+ " allowedRoles: ['org_admin', 'org_member'],",
143
+ ' },',
144
+ ' // input, output, and fulfilment...',
145
+ '})',
146
+ '```',
147
+ '',
148
+ 'Role values are trusted only from the explicitly configured claim path (or the platform-private bridge role claim). Direct OIDC scopes default to standard `scope`, `scp`, or `scopes` claims unless `claims.scopes` is configured. Embedded-assistant backends pass verified `user.roles` and `user.scopes` separately during `createAssistantSession(...)`; page context never grants either. Claim values must be a string or string array; malformed or oversized values fail closed. Eligible tools remain in authored order in `tools/list`; ineligible tools are omitted and a guessed direct call is still denied before argument validation or connector execution. Scope denials use MCP OAuth step-up metadata without disclosing role names.',
149
+ '',
127
150
  '## Delegated downstream auth (call your API as the signed-in user)',
128
151
  '',
129
152
  'Use delegated connector auth when the downstream API must enforce its own per-user authorization — a shared service credential plus a forwarded user id would bypass it. Three shapes exist; pick by who owns the downstream:',
@@ -1 +1 @@
1
- {"version":3,"file":"skill-authoring-refs.js","sourceRoot":"","sources":["../src/skill-authoring-refs.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,8FAA8F;AAC9F,4FAA4F;AAC5F,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,+EAA+E;AAC/E,6CAA6C;AAC7C,EAAE;AACF,iGAAiG;AACjG,qGAAqG;AACrG,gGAAgG;AAChG,+EAA+E;AAE/E,MAAM,UAAU,gCAAgC;IAC9C,OAAO;QACL,sBAAsB;QACtB,EAAE;QACF,aAAa;QACb,EAAE;QACF,eAAe;QACf,aAAa;QACb,eAAe;QACf,cAAc;QACd,wCAAwC;QACxC,yCAAyC;QACzC,mEAAmE;QACnE,sBAAsB;QACtB,6BAA6B;QAC7B,SAAS;QACT,yBAAyB;QACzB,sBAAsB;QACtB,cAAc;QACd,EAAE;QACF,gBAAgB;QAChB,EAAE;QACF,oUAAoU;QACpU,oJAAoJ;QACpJ,+TAA+T;QAC/T,EAAE;QACF,cAAc;QACd,EAAE;QACF,gVAAgV;QAChV,EAAE;QACF,gBAAgB;QAChB,EAAE;QACF,gLAAgL;QAChL,EAAE;QACF,eAAe;QACf,EAAE;QACF,kDAAk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b,OAAO;QACP,cAAc,IAAI,mBAAmB,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE;KAC7E,CACF,CAAC;IACF,MAAM,QAAQ,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAC3E,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,EAAE,OAAO,CAAC,CAC9C,CAAC;IAEF,OAAO;QACL,YAAY;QACZ,EAAE;QACF,0YAA0Y;QAC1Y,EAAE;QACF,yCAAyC;QACzC,EAAE;QACF,+OAA+O;QAC/O,EAAE;QACF,OAAO,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,WAAW,CAAC;QACrD,EAAE;QACF,0DAA0D;QAC1D,EAAE;QACF,OAAO,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,QAAQ,CAAC;QAC1C,EAAE;QACF,wBAAwB;QACxB,EAAE;QACF,yEAAyE;QACzE,EAAE;QACF,OAAO;QACP,oDAAoD;QACpD,EAAE;QACF,wEAAwE;QACxE,mBAAmB;QACnB,4CAA4C;QAC5C,4CAA4C;QAC5C,iDAAiD;QACjD,qEAAqE;QACrE,OAAO;QACP,KAAK;QACL,KAAK;KACN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"skill-embedded-assistant-ref.d.ts","sourceRoot":"","sources":["../src/skill-embedded-assistant-ref.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,wBAAgB,gCAAgC,IAAI,MAAM,CA8hBzD"}
1
+ {"version":3,"file":"skill-embedded-assistant-ref.d.ts","sourceRoot":"","sources":["../src/skill-embedded-assistant-ref.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,wBAAgB,gCAAgC,IAAI,MAAM,CAyiBzD"}
@@ -159,7 +159,12 @@ export function renderEmbeddedAssistantReference() {
159
159
  ' clientId: process.env.NOODLE_ASSISTANT_CLIENT_ID!,',
160
160
  ' clientSecret: process.env.NOODLE_ASSISTANT_CLIENT_SECRET!,',
161
161
  ' origin: process.env.PUBLIC_APP_ORIGIN!,',
162
- ' user: { id: user.id, email: user.email, roles: user.roles },',
162
+ ' user: {',
163
+ ' id: user.id,',
164
+ ' email: user.email,',
165
+ ' roles: user.roles,',
166
+ ' scopes: user.scopes,',
167
+ ' },',
163
168
  ' context,',
164
169
  ' // Saved, backend-verified user preferences outrank browser hints.',
165
170
  ' preferences: { locale: user.locale, timeZone: user.timeZone },',
@@ -168,7 +173,7 @@ export function renderEmbeddedAssistantReference() {
168
173
  '}',
169
174
  '```',
170
175
  '',
171
- 'Authenticate before exchange. 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.',
176
+ '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.',
172
177
  '',
173
178
  '`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.',
174
179
  '',
@@ -209,7 +214,13 @@ export function renderEmbeddedAssistantReference() {
209
214
  '```ts',
210
215
  'const session = await createAssistantSession({',
211
216
  ' serviceUrl, clientId, clientSecret, origin,',
212
- ' user: { id: user.id, email: user.email, name: user.name },',
217
+ ' user: {',
218
+ ' id: user.id,',
219
+ ' email: user.email,',
220
+ ' name: user.name,',
221
+ ' roles: user.roles,',
222
+ ' scopes: user.scopes,',
223
+ ' },',
213
224
  ' claims: { displayName: user.name, accountTier: account.tier, region: account.region },',
214
225
  '});',
215
226
  '```',
@@ -1 +1 @@
1
- {"version":3,"file":"skill-embedded-assistant-ref.js","sourceRoot":"","sources":["../src/skill-embedded-assistant-ref.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,MAAM,UAAU,gCAAgC;IAC9C,OAAO;QACL,sBAAsB;QACtB,EAAE;QACF,aAAa;QACb,EAAE;QACF,gBAAgB;QAChB,8BAA8B;QAC9B,uBAAuB;QACvB,8BAA8B;QAC9B,wBAAwB;QACxB,kCAAkC;QAClC,6BAA6B;QAC7B,kCAAkC;QAClC,iCAAiC;QACjC,kDAAkD;QAClD,wBAAwB;QACxB,6BAA6B;QAC7B,gCAAgC;QAChC,0BAA0B;QAC1B,uBAAuB;QACvB,yCAAyC;QACzC,EAAE;QACF,iBAAiB;QACjB,EAAE;QACF,4SAA4S;QAC5S,EAAE;QACF,oDAAoD;QACpD,EAAE;QACF,kCAAkC;QAClC,qBAAqB;QACrB,4HAA4H;QAC5H,8KAA8K;QAC9K,wLAAwL;QACxL,4NAA4N;QAC5N,kJAAkJ;QAClJ,EAAE;QACF,+BAA+B;QAC/B,EAAE;QACF,kbAAkb;QAClb,EAAE;QACF,wBAAwB;QACxB,EAAE;QACF,6IAA6I;QAC7I,EAAE;QACF,OAAO;QACP,gDAAgD;QAChD,wEAAwE;QACxE,gCAAgC;QAChC,6BAA6B;QAC7B,oDAAoD;QACpD,yCAAyC;QACzC,gDAAgD;QAChD,OAAO;QACP,yEAAyE;QACzE,2DAA2D;QAC3D,KAAK;QACL,KAAK;QACL,EAAE;QACF,qUAAqU;QACrU,EAAE;QACF,MAAM;QACN,EAAE;QACF,OAAO;QACP,wBAAwB;QACxB,iDAAiD;QACjD,KAAK;QACL,EAAE;QACF,+FAA+F;QAC/F,EAAE;QACF,+BAA+B;QAC/B,EAAE;QACF,6PAA6P;QAC7P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;QAChN,4JAA4J;QAC5J,yHAAyH;QACzH,oOAAoO;QACpO,mRAAmR;QACnR,mMAAmM;QACnM,6LAA6L;QAC7L,gbAAgb;QAChb,iPAAiP;KAClP,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"skill-embedded-assistant-ref.js","sourceRoot":"","sources":["../src/skill-embedded-assistant-ref.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,MAAM,UAAU,gCAAgC;IAC9C,OAAO;QACL,sBAAsB;QACtB,EAAE;QACF,aAAa;QACb,EAAE;QACF,gBAAgB;QAChB,8BAA8B;QAC9B,uBAAuB;QACvB,8BAA8B;QAC9B,wBAAwB;QACxB,kCAAkC;QAClC,6BAA6B;QAC7B,kCAAkC;QAClC,iCAAiC;QACjC,kDAAkD;QAClD,wBAAwB;QACxB,6BAA6B;QAC7B,gCAAgC;QAChC,0BAA0B;QAC1B,uBAAuB;QACvB,yCAAyC;QACzC,EAAE;QACF,iBAAiB;QACjB,EAAE;QACF,4SAA4S;QAC5S,EAAE;QACF,oDAAoD;QACpD,EAAE;QACF,kCAAkC;QAClC,qBAAqB;QACrB,4HAA4H;QAC5H,8KAA8K;QAC9K,wLAAwL;QACxL,4NAA4N;QAC5N,kJAAkJ;QAClJ,EAAE;QACF,+BAA+B;QAC/B,EAAE;QACF,kbAAkb;QAClb,EAAE;QACF,wBAAwB;QACxB,EAAE;QACF,6IAA6I;QAC7I,EAAE;QACF,OAAO;QACP,gDAAgD;QAChD,wEAAwE;QACxE,gCAAgC;QAChC,6BAA6B;QAC7B,oDAAoD;QACpD,yCAAyC;QACzC,gDAAgD;QAChD,OAAO;QACP,yEAAyE;QACzE,2DAA2D;QAC3D,KAAK;QACL,KAAK;QACL,EAAE;QACF,qUAAqU;QACrU,EAAE;QACF,MAAM;QACN,EAAE;QACF,OAAO;QACP,wBAAwB;QACxB,iDAAiD;QACjD,KAAK;QACL,EAAE;QACF,+FAA+F;QAC/F,EAAE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e;QAC5e,6NAA6N;QAC7N,iMAAiM;QACjM,gKAAgK;QAChK,iKAAiK;QACjK,wKAAwK;QACxK,+LAA+L;QAC/L,oOAAoO;QACpO,8RAA8R;QAC9R,0NAA0N;QAC1N,wPAAwP;QACxP,+KAA+K;QAC/K,uRAAuR;QACvR,gNAAgN;QAChN,4JAA4J;QAC5J,yHAAyH;QACzH,oOAAoO;QACpO,mRAAmR;QACnR,mMAAmM;QACnM,6LAA6L;QAC7L,gbAAgb;QAChb,iPAAiP;KAClP,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { JWTPayload } from 'jose';
2
+ export declare const MAX_AUTHORIZATION_CLAIM_VALUES = 128;
3
+ export declare const MAX_SCOPE_LENGTH = 512;
4
+ export declare const MAX_ROLE_LENGTH = 200;
5
+ export interface AuthorizationClaimMap {
6
+ readonly roles?: string;
7
+ readonly scopes?: string;
8
+ }
9
+ type AuthorizationClaimKind = 'role' | 'scope';
10
+ /**
11
+ * Project one explicitly configured nested claim into a bounded canonical set. A malformed value fails
12
+ * closed as an empty set; mixed arrays are never partially accepted.
13
+ */
14
+ export declare function projectMappedAuthorizationClaim(payload: Readonly<Record<string, unknown>>, path: string | undefined, kind: AuthorizationClaimKind): readonly string[];
15
+ /** Project the Noodle-owned private role claim used by customer-auth bridge access tokens. */
16
+ export declare function projectNoodleRoles(payload: Readonly<Record<string, unknown>>): readonly string[];
17
+ /** Project standard OAuth scope claims (`scope`, `scp`, then `scopes`) into one canonical set. */
18
+ export declare function projectStandardScopes(payload: JWTPayload): readonly string[];
19
+ /** Canonicalize an already selected claim value at a trusted non-JWT boundary. */
20
+ export declare function canonicalizeAuthorizationClaimValues(raw: unknown, kind: AuthorizationClaimKind): readonly string[];
21
+ export {};
22
+ //# sourceMappingURL=claims.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claims.d.ts","sourceRoot":"","sources":["../src/claims.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvC,eAAO,MAAM,8BAA8B,MAAM,CAAC;AAClD,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,KAAK,sBAAsB,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAC1C,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,sBAAsB,GAC3B,SAAS,MAAM,EAAE,CAGnB;AAED,8FAA8F;AAC9F,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,MAAM,EAAE,CAEhG;AAED,kGAAkG;AAClG,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,MAAM,EAAE,CAO5E;AAED,kFAAkF;AAClF,wBAAgB,oCAAoC,CAClD,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,sBAAsB,GAC3B,SAAS,MAAM,EAAE,CAEnB"}
@@ -0,0 +1,70 @@
1
+ export const MAX_AUTHORIZATION_CLAIM_VALUES = 128;
2
+ export const MAX_SCOPE_LENGTH = 512;
3
+ export const MAX_ROLE_LENGTH = 200;
4
+ /**
5
+ * Project one explicitly configured nested claim into a bounded canonical set. A malformed value fails
6
+ * closed as an empty set; mixed arrays are never partially accepted.
7
+ */
8
+ export function projectMappedAuthorizationClaim(payload, path, kind) {
9
+ if (path === undefined)
10
+ return [];
11
+ return canonicalAuthorizationClaimValues(resolveClaimPath(payload, path), kind, kind === 'scope');
12
+ }
13
+ /** Project the Noodle-owned private role claim used by customer-auth bridge access tokens. */
14
+ export function projectNoodleRoles(payload) {
15
+ return canonicalAuthorizationClaimValues(payload.noodle_roles, 'role', false);
16
+ }
17
+ /** Project standard OAuth scope claims (`scope`, `scp`, then `scopes`) into one canonical set. */
18
+ export function projectStandardScopes(payload) {
19
+ const claims = payload;
20
+ return canonicalAuthorizationClaimValues(claims.scope ?? claims.scp ?? claims.scopes, 'scope', true);
21
+ }
22
+ /** Canonicalize an already selected claim value at a trusted non-JWT boundary. */
23
+ export function canonicalizeAuthorizationClaimValues(raw, kind) {
24
+ return canonicalAuthorizationClaimValues(raw, kind, false);
25
+ }
26
+ function resolveClaimPath(payload, path) {
27
+ const segments = path.split('.');
28
+ if (segments.some((segment) => segment.length === 0))
29
+ return undefined;
30
+ let value = payload;
31
+ for (const segment of segments) {
32
+ if (!isRecord(value) || !Object.hasOwn(value, segment))
33
+ return undefined;
34
+ value = value[segment];
35
+ }
36
+ return value;
37
+ }
38
+ function canonicalAuthorizationClaimValues(raw, kind, splitScopeString) {
39
+ const values = typeof raw === 'string'
40
+ ? splitScopeString && kind === 'scope'
41
+ ? raw.split(' ').filter((value) => value.length > 0)
42
+ : [raw]
43
+ : Array.isArray(raw) && raw.every((value) => typeof value === 'string')
44
+ ? raw
45
+ : undefined;
46
+ if (values === undefined || values.length > MAX_AUTHORIZATION_CLAIM_VALUES)
47
+ return [];
48
+ const canonical = new Set();
49
+ for (const value of values) {
50
+ const normalized = value.trim();
51
+ if (!isValidAuthorizationClaim(normalized, kind))
52
+ return [];
53
+ canonical.add(normalized);
54
+ }
55
+ return [...canonical].sort();
56
+ }
57
+ function isValidAuthorizationClaim(value, kind) {
58
+ if (value.length === 0)
59
+ return false;
60
+ if (kind === 'scope') {
61
+ return (value.length <= MAX_SCOPE_LENGTH &&
62
+ // RFC 6749 scope-token = %x21 / %x23-5B / %x5D-7E.
63
+ /^[\x21\x23-\x5B\x5D-\x7E]+$/.test(value));
64
+ }
65
+ return value.length <= MAX_ROLE_LENGTH && !/\p{Cc}/u.test(value);
66
+ }
67
+ function isRecord(value) {
68
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
69
+ }
70
+ //# sourceMappingURL=claims.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claims.js","sourceRoot":"","sources":["../src/claims.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,CAAC;AAClD,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AACpC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AASnC;;;GAGG;AACH,MAAM,UAAU,+BAA+B,CAC7C,OAA0C,EAC1C,IAAwB,EACxB,IAA4B;IAE5B,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IAClC,OAAO,iCAAiC,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;AACpG,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,kBAAkB,CAAC,OAA0C;IAC3E,OAAO,iCAAiC,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAChF,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,qBAAqB,CAAC,OAAmB;IACvD,MAAM,MAAM,GAAG,OAA4C,CAAC;IAC5D,OAAO,iCAAiC,CACtC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,MAAM,EAC3C,OAAO,EACP,IAAI,CACL,CAAC;AACJ,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,oCAAoC,CAClD,GAAY,EACZ,IAA4B;IAE5B,OAAO,iCAAiC,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,gBAAgB,CAAC,OAA0C,EAAE,IAAY;IAChF,M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,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAChC,IAAI,CAAC,yBAAyB,CAAC,UAAU,EAAE,IAAI,CAAC;YAAE,OAAO,EAAE,CAAC;QAC5D,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC;AAED,SAAS,yBAAyB,CAAC,KAAa,EAAE,IAA4B;IAC5E,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACrC,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACrB,OAAO,CACL,KAAK,CAAC,MAAM,IAAI,gBAAgB;YAChC,mDAAmD;YACnD,6BAA6B,CAAC,IAAI,CAAC,KAAK,CAAC,CAC1C,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,IAAI,eAAe,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
@@ -7,6 +7,7 @@
7
7
  * Express-typed `OAuthServerProvider` shell and Google-federation routes live in `packages/service` so this
8
8
  * package stays Express-free.
9
9
  */
10
+ export { type AuthorizationClaimMap, canonicalizeAuthorizationClaimValues, MAX_AUTHORIZATION_CLAIM_VALUES, MAX_ROLE_LENGTH, MAX_SCOPE_LENGTH, projectMappedAuthorizationClaim, projectNoodleRoles, projectStandardScopes, } from './claims.js';
10
11
  export { type DiscoveredIssuerMetadata, discoverIssuerMetadata, type IssuerMetadataCandidate, type IssuerMetadataKind, issuerMetadataCandidates, } from './discovery.js';
11
12
  export { type AccessTokenClaims, mintAccessToken } from './jwt-issuer.js';
12
13
  export { type ProtectedResourceMetadata, protectedResourceMetadata, protectedResourceMetadataUrl, } from './metadata.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,KAAK,wBAAwB,EAC7B,sBAAsB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EACL,KAAK,yBAAyB,EAC9B,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,8BAA8B,EAC9B,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,EACjB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,KAAK,qBAAqB,EAC1B,oCAAoC,EACpC,8BAA8B,EAC9B,eAAe,EACf,gBAAgB,EAChB,+BAA+B,EAC/B,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,wBAAwB,EAC7B,sBAAsB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EACL,KAAK,yBAAyB,EAC9B,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,8BAA8B,EAC9B,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,EACjB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC"}
@@ -7,6 +7,7 @@
7
7
  * Express-typed `OAuthServerProvider` shell and Google-federation routes live in `packages/service` so this
8
8
  * package stays Express-free.
9
9
  */
10
+ export { canonicalizeAuthorizationClaimValues, MAX_AUTHORIZATION_CLAIM_VALUES, MAX_ROLE_LENGTH, MAX_SCOPE_LENGTH, projectMappedAuthorizationClaim, projectNoodleRoles, projectStandardScopes, } from './claims.js';
10
11
  export { discoverIssuerMetadata, issuerMetadataCandidates, } from './discovery.js';
11
12
  export { mintAccessToken } from './jwt-issuer.js';
12
13
  export { protectedResourceMetadata, protectedResourceMetadataUrl, } from './metadata.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEL,sBAAsB,EAGtB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAA0B,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAEL,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,8BAA8B,GAI/B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,GAIlB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEL,oCAAoC,EACpC,8BAA8B,EAC9B,eAAe,EACf,gBAAgB,EAChB,+BAA+B,EAC/B,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,sBAAsB,EAGtB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAA0B,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAEL,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,8BAA8B,GAI/B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,GAIlB,MAAM,aAAa,CAAC"}
@@ -14,6 +14,8 @@ export interface AccessTokenClaims {
14
14
  readonly timeZone?: string;
15
15
  /** Space-delimited scopes, when any. */
16
16
  readonly scope?: string;
17
+ /** Canonical customer roles verified by a configured bridge claim mapping. */
18
+ readonly roles?: readonly string[];
17
19
  /** Verified upstream authentication event time as a JWT NumericDate in integer seconds. */
18
20
  readonly authTime?: number;
19
21
  /** Boundary represented by the token. Absent means the normal Noodle platform identity boundary. */
@@ -1 +1 @@
1
- {"version":3,"file":"jwt-issuer.d.ts","sourceRoot":"","sources":["../src/jwt-issuer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,iBAAiB;IAChC,0FAA0F;IAC1F,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qGAAqG;IACrG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gFAAgF;IAChF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,sCAAsC;IACtC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,wCAAwC;IACxC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,2FAA2F;IAC3F,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,oGAAoG;IACpG,QAAQ,CAAC,YAAY,CAAC,EAAE,UA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,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,gGAAgG;IAChG,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,mDAAmD;IACnD,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,kBAAkB,EAC5B,MAAM,EAAE,iBAAiB,EACzB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAwBjB"}
@@ -13,6 +13,7 @@ export async function mintAccessToken(provider, claims, ttlSeconds) {
13
13
  ...(claims.locale !== undefined ? { locale: claims.locale } : {}),
14
14
  ...(claims.timeZone !== undefined ? { zoneinfo: claims.timeZone } : {}),
15
15
  ...(claims.scope !== undefined ? { scope: claims.scope } : {}),
16
+ ...(claims.roles !== undefined ? { noodle_roles: [...claims.roles] } : {}),
16
17
  ...(claims.authTime !== undefined ? { auth_time: claims.authTime } : {}),
17
18
  ...(claims.identityKind !== undefined ? { noodle_identity: claims.identityKind } : {}),
18
19
  ...(claims.identityProvider !== undefined
@@ -1 +1 @@
1
- {"version":3,"file":"jwt-issuer.js","sourceRoot":"","sources":["../src/jwt-issuer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AA8B/B;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,QAA4B,EAC5B,MAAyB,EACzB,UAAkB;IAElB,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC;IACxC,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC;QACtB,GAAG,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9D,GAAG,CAAC,MAA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,GAAG,UAAU,GAAG,CAAC,CAAC;IACvC,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAClC,CAAC"}
@@ -11,11 +11,14 @@ export interface ProtectedResourceMetadata {
11
11
  readonly authorization_servers?: readonly string[];
12
12
  /** How the bearer token may be presented. Noodle accepts the `Authorization` header only. */
13
13
  readonly bearer_methods_supported?: readonly string[];
14
+ /** Deterministic union of OAuth scopes used by protected operations on this resource. */
15
+ readonly scopes_supported?: readonly string[];
14
16
  }
15
17
  /** Build the protected-resource-metadata document for one resource. */
16
18
  export declare function protectedResourceMetadata(input: {
17
19
  readonly resource: string;
18
20
  readonly authorizationServers?: readonly string[];
21
+ readonly scopesSupported?: readonly string[];
19
22
  }): ProtectedResourceMetadata;
20
23
  /**
21
24
  * Construct the RFC 9728 protected-resource-metadata URL for a resource URL: the well-known prefix is