@noodleseed/agent-kit 0.54.0 → 0.55.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 (38) hide show
  1. package/manifest.json +249 -249
  2. package/package.json +1 -1
  3. package/skills/claude-code/SKILL.md +1 -1
  4. package/skills/claude-code/authoring-mcp-servers/SKILL.md +1 -1
  5. package/skills/claude-code/building-mcp-apps/SKILL.md +1 -1
  6. package/skills/claude-code/connecting-apis-to-mcp/SKILL.md +1 -1
  7. package/skills/claude-code/debugging-mcp-delivery/SKILL.md +1 -1
  8. package/skills/claude-code/deploying-mcp-services/SKILL.md +1 -1
  9. package/skills/claude-code/designing-mcp-products/SKILL.md +1 -1
  10. package/skills/claude-code/embedding-mcp-assistants/SKILL.md +1 -1
  11. package/skills/claude-code/examples/customer-auth/README.md +145 -155
  12. package/skills/claude-code/examples/customer-auth/src/server.ts +27 -20
  13. package/skills/claude-code/examples/customer-auth/test/server.test.ts +38 -9
  14. package/skills/claude-code/executing-noodle-plans/SKILL.md +1 -1
  15. package/skills/claude-code/publishing-mcp-integrations/SKILL.md +1 -1
  16. package/skills/claude-code/references/authoring-workflow.md +72 -3
  17. package/skills/claude-code/references/compile-errors.md +8 -0
  18. package/skills/claude-code/references/sdk-surface.md +1 -0
  19. package/skills/claude-code/reporting-noodle-feedback/SKILL.md +1 -1
  20. package/skills/claude-code/verifying-mcp-delivery/SKILL.md +1 -1
  21. package/skills/codex/SKILL.md +1 -1
  22. package/skills/codex/authoring-mcp-servers/SKILL.md +1 -1
  23. package/skills/codex/building-mcp-apps/SKILL.md +1 -1
  24. package/skills/codex/connecting-apis-to-mcp/SKILL.md +1 -1
  25. package/skills/codex/debugging-mcp-delivery/SKILL.md +1 -1
  26. package/skills/codex/deploying-mcp-services/SKILL.md +1 -1
  27. package/skills/codex/designing-mcp-products/SKILL.md +1 -1
  28. package/skills/codex/embedding-mcp-assistants/SKILL.md +1 -1
  29. package/skills/codex/examples/customer-auth/README.md +145 -155
  30. package/skills/codex/examples/customer-auth/src/server.ts +27 -20
  31. package/skills/codex/examples/customer-auth/test/server.test.ts +38 -9
  32. package/skills/codex/executing-noodle-plans/SKILL.md +1 -1
  33. package/skills/codex/publishing-mcp-integrations/SKILL.md +1 -1
  34. package/skills/codex/references/authoring-workflow.md +72 -3
  35. package/skills/codex/references/compile-errors.md +8 -0
  36. package/skills/codex/references/sdk-surface.md +1 -0
  37. package/skills/codex/reporting-noodle-feedback/SKILL.md +1 -1
  38. package/skills/codex/verifying-mcp-delivery/SKILL.md +1 -1
@@ -8,6 +8,7 @@
8
8
  - Connectors
9
9
  - HTTP connector example (full server)
10
10
  - Customer OAuth for remote MCP clients
11
+ - Auth-derived customer API endpoints
11
12
  - Per-tool authorization
12
13
  - Delegated downstream auth (call your API as the signed-in user)
13
14
  - Invocation context
@@ -109,6 +110,74 @@ For `customerAuth.oidc(...)` and `.federatedOidc(...)`, the application develope
109
110
 
110
111
  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.
111
112
 
113
+ ## Auth-derived customer API endpoints
114
+
115
+ Use a customer endpoint when the verified IdP selects a different API base URL for each SaaS customer. The claim contains the complete base URL; tool input and `${user}` do not select it. Declare one named policy, use that reference as the connector `baseUrl`, and map its claim path in direct OIDC or on every federated issuer:
116
+
117
+ ```ts
118
+ import { connector, customerAuth, customerEndpoint, secret, server, tool, variable, z } from '@noodleseed/one';
119
+
120
+ const customerApi = customerEndpoint('customer_api', {
121
+ allowedHttpsHostSuffixes: ['api.noodleseed.dev'],
122
+ });
123
+
124
+ const api = connector('customer_api_connector').version('1.0.0').http({
125
+ baseUrl: customerApi,
126
+ auth: {
127
+ kind: 'delegatedTokenExchange',
128
+ tokenUrl: 'https://id.noodleseed.dev/oauth/token',
129
+ clientId: variable('CUSTOMER_API_CLIENT_ID'),
130
+ clientSecret: secret('CUSTOMER_API_CLIENT_SECRET'),
131
+ },
132
+ operations: {
133
+ list_records: {
134
+ type: 'read',
135
+ method: 'GET',
136
+ path: '/records',
137
+ input: z.object({}),
138
+ output: z.object({ records: z.array(z.unknown()).max(100) }),
139
+ },
140
+ },
141
+ });
142
+
143
+ export default server(
144
+ 'customer_records',
145
+ {
146
+ title: 'Customer records',
147
+ version: '1.0.0',
148
+ use: { api },
149
+ auth: customerAuth.oidc({
150
+ issuer: 'https://id.noodleseed.dev',
151
+ audience: 'https://org.cloud.noodleseed.dev/app/mcp',
152
+ routing: {
153
+ endpoints: {
154
+ customer_api: { claim: 'tenant.api_base_url' },
155
+ },
156
+ },
157
+ }),
158
+ },
159
+ [
160
+ tool('list_records', {
161
+ description: 'List records for the signed-in customer.',
162
+ input: z.object({}),
163
+ output: z.object({ records: z.array(z.unknown()).max(100) }),
164
+ fulfil: ({ connectors }) => {
165
+ const result = connectors.api.listRecords();
166
+ return { records: result.records };
167
+ },
168
+ }),
169
+ ],
170
+ );
171
+ ```
172
+
173
+ `customerEndpoint` accepts exactly one non-empty policy arm: exact HTTPS origins, or HTTPS hostname suffixes. Exact policies may authorize an explicit non-default port; suffix policies allow port 443 and match only the exact host or dot-boundary subdomains. Do not add connector `allowedOrigins` to a customer-routed connector. Its fixed credential/token endpoints are validated independently and cannot come from caller claims.
174
+
175
+ Every federated issuer must repeat every endpoint key used by the app, although each issuer may choose a different claim path. Endpoint names use lowercase letters, numbers, and underscores. Resolved claims must be exact absolute HTTPS URLs of at most 2,048 UTF-8 bytes with no userinfo, query, fragment, IP literal, special-use host, or unsafe whitespace/control characters. The runtime preserves a canonical optional base path.
176
+
177
+ Resolved customer URLs are private routing authority: they never enter the manifest/artifact, `${user}`, logs, model output, widgets, confirmation review, cache keys, or delegated-token-exchange assertions. Routed read operations may be used by tools, including their declared nested connector calls. Customer-routed action operations fail compilation with `customer_endpoint_action_unsupported`; routed resources, prompts, and ambient context fail with `customer_endpoint_surface_unsupported` in this release.
178
+
179
+ At runtime, a missing, malformed, or disallowed claim returns the same safe `connector_route_unavailable` tool error before credential lookup or connector egress. `tools/list` remains based only on roles and scopes, so route availability neither reveals tenant topology nor changes the existing authorization filter.
180
+
112
181
  ## Per-tool authorization
113
182
 
114
183
  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.
@@ -135,7 +204,7 @@ Role values are trusted only from the explicitly configured claim path (or the p
135
204
 
136
205
  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:
137
206
 
138
- - **`delegatedTokenExchange`** — your own API. The platform signs a short-lived, verifiable assertion of the signed-in user and exchanges it at a token endpoint you implement (RFC 8693). Works with verified customer OIDC identities, the built-in Firebase/Microsoft adapters, and embedded-assistant sessions; no per-user OAuth enrollment.
207
+ - **`delegatedTokenExchange`** — your own API. The platform signs a short-lived, verifiable assertion of the signed-in user and exchanges it at a token endpoint you implement (RFC 8693). It works with verified customer OIDC identities and the built-in Firebase/Microsoft adapters; no per-user OAuth enrollment. Embedded-assistant sessions support this exchange for static connectors. Customer-routed connectors require a direct or federated MCP OIDC request and fail closed in embedded-assistant sessions because those sessions carry no IdP endpoint claim.
139
208
  - **`delegatedOAuth` with `provider: "firebase" | "microsoft"`** — Noodle-managed bridge providers using stored per-user refresh tokens. Requires the matching `customerAuth` bridge; any other provider string is the compile error `unsupported_delegated_provider`.
140
209
  - **`delegatedSessionCookie`** — Firebase-managed session-cookie apps only; not a generic mechanism.
141
210
 
@@ -144,7 +213,7 @@ Use delegated connector auth when the downstream API must enforce its own per-us
144
213
  ```ts
145
214
  auth: {
146
215
  kind: 'delegatedTokenExchange',
147
- tokenUrl: 'https://app.example.com/api/assistant/oauth/token', // origin must be in allowedOrigins
216
+ tokenUrl: 'https://app.example.com/api/assistant/oauth/token', // fixed HTTPS; static connectors also allowlist its origin
148
217
  clientId: variable('EXAMPLE_DELEG_CLIENT_ID'),
149
218
  clientSecret: secret('EXAMPLE_DELEG_CLIENT_SECRET'),
150
219
  scopes: ['time_off'], // optional
@@ -167,7 +236,7 @@ scope=time_off (space-joined, when configured)
167
236
  audience=example-api (when configured)
168
237
  ```
169
238
 
170
- The `subject_token` claims: `iss` (platform issuer; JWKS at `{iss}/.well-known/jwks.json`), `sub` (verified user id), `aud` (your configured audience or the tokenUrl), `email`, `name`, `claims` (declared session claims), `tenant` (`org/app/env`), `deployment`, `iat`, `exp` (about 120 s), `jti`. Respond with `{ "access_token": "...", "token_type": "Bearer", "expires_in": 900 }`; the broker caches per user + connector + scopes until `expires_in` minus 300 s and presents the token downstream as `Authorization: Bearer`.
239
+ The `subject_token` claims: `iss` (platform issuer; JWKS at `{iss}/.well-known/jwks.json`), `sub` (verified user id), `aud` (your configured audience or the tokenUrl), `email`, `name`, `claims` (declared session claims), `tenant` (`org/app/env`), `deployment`, `iat`, `exp` (about 120 s), `jti`. A routed exchange adds `route: { key, fingerprint }`, never the customer URL; credential cache and single-flight keys include that route binding. Respond with `{ "access_token": "...", "token_type": "Bearer", "expires_in": 900 }`; the broker caches per user + connector + scopes + route until `expires_in` minus 300 s and presents the token downstream as `Authorization: Bearer`.
171
240
 
172
241
  ### The downstream token endpoint (your backend)
173
242
 
@@ -63,5 +63,13 @@ Run `noodle validate` (add `--json` for the machine-readable envelope, `--fix-pr
63
63
  | `unsupported_credential_profile` | Select a credential profile declared by the connector and accepted by the operation; use the reported suggestions instead of inventing a profile name. |
64
64
  | `credential_scope_mismatch` | Declare a connection source whose scopes include every operation-required scope, or select an external exchange provider that can mint them. |
65
65
  | `credential_audience_mismatch` | Set the connection source audience to the operation-required audience exactly, or use an external exchange provider that can mint it. |
66
+ | `customer_endpoint_auth_required` | Protect the app with direct or federated `customerAuth` OIDC and map every reachable `customerEndpoint` key under auth routing. |
67
+ | `customer_endpoint_mapping_required` | Add the endpoint key at the cited auth routing path; every direct/federated issuer must map every customer endpoint used by the app. |
68
+ | `customer_endpoint_unknown_mapping` | Remove the unknown or unused auth routing key, or use that exact declared `customerEndpoint` key from a reachable connector operation. |
69
+ | `customer_endpoint_bridge_unsupported` | Replace the Firebase/Microsoft bridge with direct or federated OIDC before using auth-derived customer connector endpoints. |
70
+ | `customer_endpoint_action_unsupported` | Use a read operation for this customer-routed call until route-bound action confirmation support is available. |
71
+ | `customer_endpoint_surface_unsupported` | Move the customer-routed call into a tool fulfilment; routed resources, prompts, and ambient providers are unsupported. |
72
+ | `customer_endpoint_credential_source_unsupported` | Remove the manifest connection binding; a customer-routed connector uses its declared delegated token exchange auth or no auth. |
73
+ | `customer_endpoint_policy_conflict` | Give every reachable declaration of this endpoint key one identical policy, or rename keys whose allowed origins differ. |
66
74
  | `unused_connector_alias` | A declared connector alias is never called; remove the unused `use` entry or wire it into a tool. |
67
75
  | `arg_mismatch` | A connector call is missing or adds arguments; match the operation signature under `expected`/`got`. |
@@ -54,6 +54,7 @@ Platform helper connectors are explicit subpath imports from `@noodleseed/one/pl
54
54
  ### Other
55
55
 
56
56
  - `clientCredentials`
57
+ - `customerEndpoint`
57
58
  - `embeddedAssistant`
58
59
  - `externalExchange`
59
60
  - `gmailConnector`
@@ -3,7 +3,7 @@ name: reporting-noodle-feedback
3
3
  description: "Use when a Noodle Seed bug, misleading instruction, missing capability, or concrete product improvement should be proposed to the user."
4
4
  ---
5
5
 
6
- <!-- noodle-skill version:0.54.0 hash:0f404109f4845683 -->
6
+ <!-- noodle-skill version:0.55.0 hash:0f404109f4845683 -->
7
7
 
8
8
  # reporting-noodle-feedback
9
9
 
@@ -3,7 +3,7 @@ name: verifying-mcp-delivery
3
3
  description: "Use when proving a Noodle Seed MCP project works at a named compile, local, connector, App, host, deployment, or production evidence level."
4
4
  ---
5
5
 
6
- <!-- noodle-skill version:0.54.0 hash:6ef6ef551e26b78e -->
6
+ <!-- noodle-skill version:0.55.0 hash:6ef6ef551e26b78e -->
7
7
 
8
8
  # verifying-mcp-delivery
9
9