@noodleseed/one 0.140.0 → 0.141.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 (71) 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/skill-embedded-assistant-ref.js +9 -1
  3. package/node_modules/@noodle-borg/app-package/dist/index.d.ts +1 -0
  4. package/node_modules/@noodle-borg/app-package/dist/index.js +1 -0
  5. package/node_modules/@noodle-borg/{compiler → app-package}/dist/schema-validation.d.ts +2 -1
  6. package/node_modules/@noodle-borg/app-package/package.json +2 -0
  7. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-app-sandbox.d.ts +13 -0
  8. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-app-sandbox.js +204 -0
  9. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-store.d.ts +22 -0
  10. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-store.js +10 -7
  11. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-transcript.d.ts +18 -0
  12. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-transcript.js +6 -0
  13. package/node_modules/@noodle-borg/assistant-gateway/dist/elevation.d.ts +7 -0
  14. package/node_modules/@noodle-borg/assistant-gateway/dist/elevation.js +1 -0
  15. package/node_modules/@noodle-borg/assistant-gateway/dist/portable.d.ts +2 -0
  16. package/node_modules/@noodle-borg/assistant-gateway/dist/portable.js +2 -0
  17. package/node_modules/@noodle-borg/assistant-gateway/dist/public-surface.d.ts +21 -0
  18. package/node_modules/@noodle-borg/assistant-gateway/dist/public-surface.js +39 -0
  19. package/node_modules/@noodle-borg/assistant-gateway/dist/session-resume.d.ts +7 -0
  20. package/node_modules/@noodle-borg/assistant-gateway/dist/session-resume.js +12 -0
  21. package/node_modules/@noodle-borg/auth/dist/control-plane-token-exchange.d.ts +110 -0
  22. package/node_modules/@noodle-borg/auth/dist/control-plane-token-exchange.js +217 -0
  23. package/node_modules/@noodle-borg/auth/dist/index.d.ts +1 -0
  24. package/node_modules/@noodle-borg/auth/dist/index.js +1 -0
  25. package/node_modules/@noodle-borg/authoring/dist/assistant.d.ts +5 -0
  26. package/node_modules/@noodle-borg/compiler/dist/index.d.ts +1 -2
  27. package/node_modules/@noodle-borg/compiler/dist/index.js +1 -2
  28. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +16 -0
  29. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +19 -2
  30. package/node_modules/@noodle-borg/compiler/package.json +0 -2
  31. package/node_modules/@noodle-borg/compute/dist/code-connector.js +44 -1
  32. package/node_modules/@noodle-borg/compute/dist/quickjs-engine.js +82 -266
  33. package/node_modules/@noodle-borg/compute/dist/sandbox-eval.js +276 -0
  34. package/node_modules/@noodle-borg/compute/dist/worker-pool.js +262 -0
  35. package/node_modules/@noodle-borg/{service/dist/auth/deploy-gate.d.ts → control-plane/dist/deploy-gates.d.ts} +10 -6
  36. package/node_modules/@noodle-borg/control-plane/dist/deploy-gates.js +266 -0
  37. package/node_modules/@noodle-borg/control-plane/dist/portable.d.ts +1 -0
  38. package/node_modules/@noodle-borg/control-plane/dist/portable.js +1 -0
  39. package/node_modules/@noodle-borg/developer-mcp/dist/capabilities.js +11 -1
  40. package/node_modules/@noodle-borg/developer-mcp/dist/index.js +1 -1
  41. package/node_modules/@noodle-borg/protocol/dist/execution-error-mapping.js +13 -1
  42. package/node_modules/@noodle-borg/protocol/dist/observation.d.ts +2 -1
  43. package/node_modules/@noodle-borg/protocol/dist/observation.js +2 -1
  44. package/node_modules/@noodle-borg/runtime/dist/connector/failure-details.d.ts +1 -1
  45. package/node_modules/@noodle-borg/runtime/dist/connector/failure-details.js +5 -0
  46. package/node_modules/@noodle-borg/runtime/dist/connector/types.d.ts +15 -1
  47. package/node_modules/@noodle-borg/runtime/dist/connector/types.js +6 -0
  48. package/node_modules/@noodle-borg/runtime/dist/operation-execution.js +1 -0
  49. package/node_modules/@noodle-borg/service/dist/auth/developer-grant-guard.js +2 -1
  50. package/node_modules/@noodle-borg/service/dist/modules/route-dispatch.js +1 -1
  51. package/node_modules/@noodle-borg/service/dist/registry-types.d.ts +1 -1
  52. package/node_modules/@noodle-borg/service/dist/routes/assistant-agent.js +15 -3
  53. package/node_modules/@noodle-borg/service/dist/routes/assistant-clients.js +116 -0
  54. package/node_modules/@noodle-borg/service/dist/routes/assistant-dispatch.js +12 -3
  55. package/node_modules/@noodle-borg/service/dist/routes/assistant-elevation.js +1 -0
  56. package/node_modules/@noodle-borg/service/dist/routes/assistant-interaction-stream.js +4 -1
  57. package/node_modules/@noodle-borg/service/dist/routes/assistant-interactions.js +8 -1
  58. package/node_modules/@noodle-borg/service/dist/routes/assistant-public-session.js +3 -9
  59. package/node_modules/@noodle-borg/service/dist/routes/assistant-route-http.js +11 -0
  60. package/node_modules/@noodle-borg/service/dist/routes/assistant-sandbox.js +12 -47
  61. package/node_modules/@noodle-borg/service/dist/routes/assistant-session-target.js +34 -8
  62. package/node_modules/@noodle-borg/service/dist/routes/assistant-transcript.js +27 -0
  63. package/node_modules/@noodle-borg/service/dist/routes/assistant.js +28 -130
  64. package/node_modules/@noodle-borg/service/dist/routes/config-values.js +1 -1
  65. package/node_modules/@noodle-borg/service/dist/routes/control-plane.js +8 -2
  66. package/node_modules/@noodle-borg/service/dist/service.js +15 -1
  67. package/node_modules/@noodle-borg/wire-contracts/dist/assistant.d.ts +17 -0
  68. package/node_modules/@noodle-borg/wire-contracts/dist/assistant.js +25 -0
  69. package/node_modules/@noodleseed/assistant/README.md +4 -9
  70. package/package.json +1 -1
  71. /package/node_modules/@noodle-borg/{compiler → app-package}/dist/schema-validation.js +0 -0
@@ -1,5 +1,5 @@
1
1
  import { clientAddressBucket, } from '@noodle-borg/admission-limits/portable';
2
- import { ASSISTANT_SESSION_IDLE_MS, dispatchAssistantTool, parseAssistantContextPreferences, parseAssistantCustomerRouting, resumeTurnMessage, shouldAutoResume, withAssistantSessionExecutionAuthority, } from '@noodle-borg/assistant-gateway/portable';
2
+ import { ASSISTANT_SESSION_IDLE_MS, dispatchAssistantTool, parseAssistantContextPreferences, parseAssistantCustomerRouting, resumeTurnMessage, resumeUnavailableMessage, shouldAutoResume, surfaceBindingForOrigin, withAssistantSessionExecutionAuthority, } from '@noodle-borg/assistant-gateway/portable';
3
3
  import { canonicalizeAuthorizationClaimValues } from '@noodle-borg/auth';
4
4
  import { validateJsonSchemaWithDefaults } from '@noodle-borg/compiler';
5
5
  import { tenantMcpUrl } from '@noodle-borg/module';
@@ -14,7 +14,7 @@ import { assistantBrowserConfiguration } from './assistant-configuration.js';
14
14
  import { elevateAssistantSession } from './assistant-elevation.js';
15
15
  import { executeAssistantKnowledgeSearch, findAssistantKnowledgeComponent, resolveAssistantKnowledge, } from './assistant-knowledge.js';
16
16
  import { refusePublicTurn } from './assistant-public-turn.js';
17
- import { applyBrowserCors, authenticateSession, handleAssistantPreflight, now, } from './assistant-route-http.js';
17
+ import { applyBrowserCors, assistantSessionEndpoints, authenticateSession, handleAssistantPreflight, now, } from './assistant-route-http.js';
18
18
  import { sessionScopedTarget } from './assistant-session-target.js';
19
19
  import { authorizeControlPlane } from './control-plane.js';
20
20
  export { applyBrowserCors, authenticateSession, handleAssistantPreflight, now };
@@ -42,108 +42,6 @@ export async function handleConsoleApprovalNonce(req, res, deps) {
42
42
  const consumed = await deps.store.consumeConsoleApprovalNonce(nonce, identity.subject, expiry, current);
43
43
  return sendJson(res, consumed ? 201 : 409, consumed ? { ok: true } : { ok: false, error: 'already_used_or_expired' });
44
44
  }
45
- export async function handleAssistantClients(req, res, tenant, id, action, deps) {
46
- const identity = await authorizeControlPlane(req, res, deps.gate, { requireIdentity: false });
47
- if (identity === false)
48
- return;
49
- if (identity && !identity.superAdmin) {
50
- const member = await deps.controlPlane.isOrgMember({
51
- org: tenant.org,
52
- subject: identity.subject,
53
- });
54
- if (!member)
55
- return sendForbidden(res, 'forbidden');
56
- }
57
- if (action === 'collection' && req.method === 'GET') {
58
- const clients = await deps.store.listClients(tenant);
59
- return sendJson(res, 200, {
60
- ok: true,
61
- clients: clients.map(publicClient),
62
- });
63
- }
64
- if (action === 'collection' && req.method === 'POST') {
65
- const body = await readJsonBody(req, deps.maxBody);
66
- if (!body.ok)
67
- return sendJson(res, body.status, { error: body.error });
68
- const name = body.value.name;
69
- if (typeof name !== 'string' || name.trim().length < 1 || name.length > 80) {
70
- return sendJson(res, 400, { error: '"name" must be a non-empty string' });
71
- }
72
- const target = await deps.registry.getActiveByTenant(tenant);
73
- const assistant = target?.served.artifact.server.assistant;
74
- if (!target?.deploymentId || !assistant)
75
- return sendJson(res, 409, { error: 'deployment has no embedded assistant' });
76
- const created = await deps.store.createClient({
77
- name: name.trim(),
78
- tenant,
79
- deploymentId: target.deploymentId,
80
- allowedOrigins: assistant.allowedOrigins,
81
- now: now(deps),
82
- });
83
- await deps.audit.emit({
84
- eventType: 'assistant.client.created',
85
- org: tenant.org,
86
- app: tenant.app,
87
- env: tenant.env,
88
- deploymentId: target.deploymentId,
89
- decision: 'allow',
90
- status: 201,
91
- ...(identity ? { actorSubject: identity.subject } : {}),
92
- ...(identity?.email ? { actorEmail: identity.email } : {}),
93
- details: { clientId: created.client.id, name: created.client.name },
94
- });
95
- return sendJson(res, 201, {
96
- ok: true,
97
- ...publicClient(created.client),
98
- clientSecret: created.secret,
99
- });
100
- }
101
- if (!id)
102
- return sendJson(res, 404, { error: 'not found' });
103
- const owned = (await deps.store.listClients(tenant)).some((client) => client.id === id);
104
- if (!owned)
105
- return sendJson(res, 404, { error: 'not found' });
106
- if (action === 'rotate' && req.method === 'POST') {
107
- const rotated = await deps.store.rotateClient(id, now(deps));
108
- if (!rotated)
109
- return sendJson(res, 404, { error: 'not found' });
110
- await deps.audit.emit({
111
- eventType: 'assistant.client.rotated',
112
- org: tenant.org,
113
- app: tenant.app,
114
- env: tenant.env,
115
- deploymentId: rotated.client.deploymentId,
116
- decision: 'allow',
117
- status: 200,
118
- ...(identity ? { actorSubject: identity.subject } : {}),
119
- ...(identity?.email ? { actorEmail: identity.email } : {}),
120
- details: { clientId: rotated.client.id },
121
- });
122
- return sendJson(res, 200, {
123
- ok: true,
124
- ...publicClient(rotated.client),
125
- clientSecret: rotated.secret,
126
- });
127
- }
128
- if (action === 'item' && req.method === 'DELETE') {
129
- await deps.store.revokeClient(id, now(deps));
130
- await deps.audit.emit({
131
- eventType: 'assistant.client.revoked',
132
- org: tenant.org,
133
- app: tenant.app,
134
- env: tenant.env,
135
- decision: 'allow',
136
- status: 204,
137
- ...(identity ? { actorSubject: identity.subject } : {}),
138
- ...(identity?.email ? { actorEmail: identity.email } : {}),
139
- details: { clientId: id },
140
- });
141
- res.statusCode = 204;
142
- res.end();
143
- return;
144
- }
145
- sendJson(res, 405, { error: 'method not allowed' });
146
- }
147
45
  export async function handleAssistantSession(req, res, deps) {
148
46
  const usageStartedAt = performance.now();
149
47
  const credentials = basicCredentials(req);
@@ -173,6 +71,13 @@ export async function handleAssistantSession(req, res, deps) {
173
71
  if (!assistant.allowedOrigins.includes(parsed.origin)) {
174
72
  return sendForbidden(res, 'origin is not allowed');
175
73
  }
74
+ // Every session binds one exact authored surface (ADR 0201): the origin selects it, and an origin no
75
+ // surface owns is refused rather than admitted against the deployment-wide union. A pre-surfaces
76
+ // artifact has no surfaces to select from; its union remains its whole released contract.
77
+ const surfaceBinding = surfaceBindingForOrigin(assistant, parsed.origin);
78
+ if (surfaceBinding.kind === 'unowned') {
79
+ return sendForbidden(res, 'origin is not allowed');
80
+ }
176
81
  const customerRouting = parseAssistantCustomerRouting(target.served.artifact.customerEndpoints, parsed.routing);
177
82
  if (!customerRouting.ok) {
178
83
  return sendJson(res, 400, {
@@ -229,18 +134,15 @@ export async function handleAssistantSession(req, res, deps) {
229
134
  client,
230
135
  resume: shouldAutoResume(parsed.resume),
231
136
  origin: parsed.origin,
137
+ // The conversation lands on the surface owning the (validated) landing origin: signing in on
138
+ // the app surface continues under its projection (ADR 0201 amendment 2026-08-26).
139
+ ...(surfaceBinding.kind === 'pre-surfaces' ? {} : { boundSurface: surfaceBinding.kind }),
232
140
  ...(customerRouting.customerRouting
233
141
  ? { customerRouting: customerRouting.customerRouting }
234
142
  : {}),
235
143
  caller,
236
144
  configuration,
237
- endpoints: {
238
- turns: `${deps.serviceBase(req)}/v1/assistant/turns`,
239
- toolConfirmations: `${deps.serviceBase(req)}/v1/assistant/tool-confirmations`,
240
- interactions: `${deps.serviceBase(req)}/v1/assistant/interactions`,
241
- apps: `${deps.serviceBase(req)}/v1/assistant/apps`,
242
- sandbox: `${deps.serviceBase(req)}/v1/assistant/sandbox`,
243
- },
145
+ endpoints: assistantSessionEndpoints(deps.serviceBase(req), deps.sandboxBase?.(req)),
244
146
  });
245
147
  }
246
148
  const session = await deps.store.createSession({
@@ -249,6 +151,7 @@ export async function handleAssistantSession(req, res, deps) {
249
151
  deploymentId: target.deploymentId,
250
152
  modelSource: assistant.model.kind === 'noodle-managed' ? 'noodle-managed' : 'operator',
251
153
  origin: parsed.origin,
154
+ ...(surfaceBinding.kind === 'pre-surfaces' ? {} : { boundSurface: surfaceBinding.kind }),
252
155
  ...(customerRouting.customerRouting
253
156
  ? { customerRouting: customerRouting.customerRouting }
254
157
  : {}),
@@ -263,13 +166,7 @@ export async function handleAssistantSession(req, res, deps) {
263
166
  const sessionBody = {
264
167
  token: session.token,
265
168
  expiresAt: session.session.expiresAt,
266
- endpoints: {
267
- turns: `${deps.serviceBase(req)}/v1/assistant/turns`,
268
- toolConfirmations: `${deps.serviceBase(req)}/v1/assistant/tool-confirmations`,
269
- interactions: `${deps.serviceBase(req)}/v1/assistant/interactions`,
270
- apps: `${deps.serviceBase(req)}/v1/assistant/apps`,
271
- sandbox: `${deps.serviceBase(req)}/v1/assistant/sandbox`,
272
- },
169
+ endpoints: assistantSessionEndpoints(deps.serviceBase(req), deps.sandboxBase?.(req)),
273
170
  ...(configuration ? { configuration } : {}),
274
171
  };
275
172
  // Every published @noodleseed/assistant widget consumes this shape; parse (don't just test)
@@ -293,6 +190,7 @@ export async function handleAssistantTurn(req, res, deps) {
293
190
  const addressBucket = clientAddressBucket(typeof req.headers['x-forwarded-for'] === 'string' ? req.headers['x-forwarded-for'] : undefined);
294
191
  let turn;
295
192
  let message;
193
+ let resumedTool;
296
194
  if (isRecord(body.value) && 'resume' in body.value) {
297
195
  // The one-shot post-sign-in resume (issue #1177): no user text, the pending intent is server
298
196
  // state. Admission runs FIRST so a refused resume stays armed for a retry; the consume is a
@@ -313,6 +211,7 @@ export async function handleAssistantTurn(req, res, deps) {
313
211
  });
314
212
  }
315
213
  message = resumeTurnMessage(pending.tool);
214
+ resumedTool = pending.tool;
316
215
  await deps.audit.emit({
317
216
  eventType: 'assistant.session.resumed',
318
217
  org: session.tenant.org,
@@ -361,6 +260,12 @@ export async function handleAssistantTurn(req, res, deps) {
361
260
  const target = await sessionScopedTarget(deps.registry, session);
362
261
  if (!target)
363
262
  return sendJson(res, 409, { error: 'assistant deployment is unavailable' });
263
+ if (resumedTool !== undefined &&
264
+ !target.served.artifact.tools.some((tool) => tool.name === resumedTool)) {
265
+ // The elevation landed on a surface whose projection does not offer the intercepted tool: fail
266
+ // closed to an honest explanation instead of asking the model to call a tool it cannot see.
267
+ message = resumeUnavailableMessage(resumedTool);
268
+ }
364
269
  const clientContext = turn?.clientContext === undefined
365
270
  ? undefined
366
271
  : parseAssistantContextPreferences(turn.clientContext);
@@ -396,8 +301,11 @@ export async function handleAssistantTurn(req, res, deps) {
396
301
  .map((event) => String(event.data.delta ?? ''))
397
302
  .join('');
398
303
  await deps.store.appendHistory(session.id, [
399
- { role: 'user', content: message.trim() },
400
- ...(assistantContent ? [{ role: 'assistant', content: assistantContent }] : []),
304
+ // A resume turn's user row is the [platform] prompt the visitor never typed or saw.
305
+ { role: 'user', content: message.trim(), kind: turn ? 'visible' : 'narration' },
306
+ ...(assistantContent
307
+ ? [{ role: 'assistant', content: assistantContent, kind: 'visible' }]
308
+ : []),
401
309
  ]);
402
310
  }
403
311
  catch {
@@ -559,14 +467,4 @@ function isContext(value) {
559
467
  typeof item === 'boolean' ||
560
468
  (typeof item === 'string' && item.length <= 2_000))));
561
469
  }
562
- function publicClient(client) {
563
- return {
564
- id: client.id,
565
- name: client.name,
566
- createdAt: client.createdAt,
567
- // Audit data only: sessions follow the tenant's active deployment, not this snapshot.
568
- createdAgainstDeploymentId: client.deploymentId,
569
- ...(client.revokedAt ? { revokedAt: client.revokedAt } : {}),
570
- };
571
- }
572
470
  //# sourceMappingURL=assistant.js.map
@@ -94,7 +94,7 @@ function developerConfigAccess(grants, controlPlane, ref, method) {
94
94
  controlPlane,
95
95
  org: ref.scope.org,
96
96
  capability: method === 'GET' ? 'cloud:read' : 'config:write',
97
- resourcePath: DEVELOPER_CLI_PATH,
97
+ resourcePaths: new Set([DEVELOPER_CLI_PATH]),
98
98
  },
99
99
  };
100
100
  }
@@ -1,6 +1,6 @@
1
1
  import { cspFaultsInManifest } from '@noodle-borg/compiler';
2
2
  import { ensurePersonalWorkspace } from '@noodle-borg/control-plane/portable';
3
- import { DEVELOPER_CLI_PATH } from '@noodle-borg/developer-mcp';
3
+ import { DEVELOPER_ASSISTANT_PATH, DEVELOPER_CLI_PATH, } from '@noodle-borg/developer-mcp';
4
4
  import { normalizeServerVersion } from '@noodle-borg/module';
5
5
  import { noopLogger } from '@noodle-borg/transport-http';
6
6
  import { deployRequestSchema, formatWireError, } from '@noodle-borg/wire-contracts';
@@ -504,9 +504,15 @@ export async function handleDeploymentStatus(req, res, registry, gate, controlPl
504
504
  }
505
505
  }
506
506
  export function developerGrantRouteAccess(grants, capability) {
507
+ // Control-plane routes serve the CLI resource and the assistant resource (ADR 0218); the grant's
508
+ // own capability ceiling — never this set — decides what each may actually do.
507
509
  return grants === undefined
508
510
  ? undefined
509
- : { grants, capability, resourcePath: DEVELOPER_CLI_PATH };
511
+ : {
512
+ grants,
513
+ capability,
514
+ resourcePaths: new Set([DEVELOPER_CLI_PATH, DEVELOPER_ASSISTANT_PATH]),
515
+ };
510
516
  }
511
517
  async function authorizeHumanDeploy(req, res, options, gate, controlPlane, org) {
512
518
  const developerAccess = developerGrantAccess(options.developerGrantStore, controlPlane, org, 'deployments:write');
@@ -1,4 +1,4 @@
1
- import { InMemoryAssistantStore } from '@noodle-borg/assistant-gateway/portable';
1
+ import { InMemoryAssistantStore, isAssistantSandboxHost, validateAssistantSandboxBaseUrl, } from '@noodle-borg/assistant-gateway/portable';
2
2
  import { allowAllGate, InMemoryControlPlaneStore } from '@noodle-borg/control-plane/portable';
3
3
  import { dispatchKnowledgeRequest } from '@noodle-borg/knowledge-operations/portable';
4
4
  import { OPENAI_APPS_CHALLENGE_PATH } from '@noodle-borg/module';
@@ -50,6 +50,9 @@ const DEFAULT_MAX_BODY = 1 << 20;
50
50
  const DEFAULT_MAX_DEPLOY_BODY = 32 * 1024 * 1024;
51
51
  /** The combined service listener: tenant-scoped deploy management plus the multi-tenant MCP router. */
52
52
  export function createServiceHandler(registry, options = {}) {
53
+ const assistantSandboxBaseUrl = options.assistantSandboxBaseUrl === undefined
54
+ ? undefined
55
+ : validateAssistantSandboxBaseUrl(options.assistantSandboxBaseUrl, options.publicBaseUrl);
53
56
  const logger = options.logger ?? noopLogger;
54
57
  const tls = options.tls ?? {};
55
58
  const buildInfo = options.buildInfo ?? resolveBuildInfo();
@@ -155,6 +158,14 @@ export function createServiceHandler(registry, options = {}) {
155
158
  };
156
159
  return (req, res) => {
157
160
  const url = new URL(req.url ?? '/', 'http://localhost');
161
+ const onAssistantSandboxHost = isAssistantSandboxHost(req.headers.host, assistantSandboxBaseUrl);
162
+ if (onAssistantSandboxHost && url.pathname !== '/v1/assistant/sandbox') {
163
+ applySecurityHeaders(res, tls);
164
+ if (enforceHttps(req, res, tls))
165
+ return;
166
+ sendJson(res, 404, { error: 'not found' });
167
+ return;
168
+ }
158
169
  // Liveness/readiness probes: un-gated and **not** HTTPS-enforced — Cloud Run's internal probe is plain
159
170
  // HTTP, so enforcing HTTPS here would `426` the probe and the revision would never go healthy (ADR 0034).
160
171
  // `/healthz` is a pure liveness 200 (no store touch); `/readyz` reflects the injected readiness probe.
@@ -250,6 +261,9 @@ export function createServiceHandler(registry, options = {}) {
250
261
  audit: activeAudit,
251
262
  maxBody,
252
263
  serviceBase: (request) => options.publicBaseUrl ?? baseFromRequest(request, tls),
264
+ ...(assistantSandboxBaseUrl === undefined
265
+ ? {}
266
+ : { sandboxBase: () => assistantSandboxBaseUrl }),
253
267
  ...(options.assistantModelFetch !== undefined
254
268
  ? { modelFetch: options.assistantModelFetch }
255
269
  : {}),
@@ -20,6 +20,7 @@ export declare const assistantSessionResponseSchema: z.ZodObject<{
20
20
  interactions: z.ZodOptional<z.ZodURL>;
21
21
  apps: z.ZodOptional<z.ZodURL>;
22
22
  sandbox: z.ZodOptional<z.ZodURL>;
23
+ transcript: z.ZodOptional<z.ZodURL>;
23
24
  }, z.core.$strip>;
24
25
  configuration: z.ZodOptional<z.ZodObject<{
25
26
  branding: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -30,6 +31,22 @@ export declare const assistantSessionResponseSchema: z.ZodObject<{
30
31
  }, z.core.$strip>>;
31
32
  }, z.core.$strip>;
32
33
  export type AssistantSessionResponse = z.infer<typeof assistantSessionResponseSchema>;
34
+ /**
35
+ * The bounded visible transcript (ADR 0141/0201 amendments 2026-08-26): only rows that actually
36
+ * appeared in the panel — never tool internals, tickets, or model-facing scaffolding. Bounded by the
37
+ * session history window (40 messages); a read spends no turn budget. Strict, because the service
38
+ * parses its own response before sending, like the session exchange.
39
+ */
40
+ export declare const assistantTranscriptResponseSchema: z.ZodObject<{
41
+ entries: z.ZodArray<z.ZodObject<{
42
+ role: z.ZodEnum<{
43
+ assistant: "assistant";
44
+ user: "user";
45
+ }>;
46
+ text: z.ZodString;
47
+ }, z.core.$strict>>;
48
+ }, z.core.$strict>;
49
+ export type AssistantTranscriptResponse = z.infer<typeof assistantTranscriptResponseSchema>;
33
50
  /** MCP-Apps-shaped, author-selected renderer summary included on one assistant turn. */
34
51
  export declare const assistantModelContextUpdateSchema: z.ZodObject<{
35
52
  content: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -42,6 +42,13 @@ export const assistantSessionResponseSchema = z.object({
42
42
  * published client falls back to the srcdoc proxy.
43
43
  */
44
44
  sandbox: z.url().optional(),
45
+ /**
46
+ * Additive bounded visible-transcript endpoint (ADR 0141/0201 amendments 2026-08-26): a
47
+ * session-token-authenticated POST returning what the panel may repaint after a full-page
48
+ * navigation — the sign-in redirect above all. Absent on older services; the widget then
49
+ * starts visually fresh exactly as before.
50
+ */
51
+ transcript: z.url().optional(),
45
52
  }),
46
53
  configuration: assistantSessionConfigurationSchema.optional(),
47
54
  /**
@@ -51,6 +58,24 @@ export const assistantSessionResponseSchema = z.object({
51
58
  */
52
59
  resume: z.object({ tool: z.string().min(1) }).optional(),
53
60
  });
61
+ /**
62
+ * The bounded visible transcript (ADR 0141/0201 amendments 2026-08-26): only rows that actually
63
+ * appeared in the panel — never tool internals, tickets, or model-facing scaffolding. Bounded by the
64
+ * session history window (40 messages); a read spends no turn budget. Strict, because the service
65
+ * parses its own response before sending, like the session exchange.
66
+ */
67
+ export const assistantTranscriptResponseSchema = z
68
+ .object({
69
+ entries: z
70
+ .array(z
71
+ .object({
72
+ role: z.enum(['user', 'assistant']),
73
+ text: z.string(),
74
+ })
75
+ .strict())
76
+ .max(40),
77
+ })
78
+ .strict();
54
79
  const assistantModelContentPartSchema = z
55
80
  .object({ type: z.literal('text'), text: z.string() })
56
81
  .strict();
@@ -35,8 +35,8 @@ troubleshooting) lives at <https://docs.noodleseed.dev/guides/embedded-assistant
35
35
  the server itself is `@noodleseed/one` (`npm install -g @noodleseed/one`).
36
36
 
37
37
  If your page sends a `Content-Security-Policy`, allow the Noodle service origin in `connect-src` (turns and
38
- event streams) **and** `frame-src` (app widgets render inside a hosted sandbox document served from the
39
- service origin, `endpoints.sandbox`, so your `script-src` can stay strict). Details are in the guide's
38
+ event streams) and the exact session-advertised `endpoints.sandbox` origin in `frame-src` (it may be a
39
+ dedicated sandbox origin, so your `script-src` can stay strict). Details are in the guide's
40
40
  "Content-Security-Policy on your page" section.
41
41
 
42
42
  ## Quick start
@@ -410,13 +410,8 @@ import "@noodleseed/assistant/app-view";
410
410
  </template>
411
411
  ```
412
412
 
413
- Configure Vue's `isCustomElement` for `noodle-app-view`. Angular uses the same element with `[client]`,
414
- `[view]`, and `[theme]` property bindings. Do not serialize `client` or `view` into attributes.
415
-
416
- `<noodle-app-view>` is the canonical host; `NoodleAppView` delegates to it. Both use the
417
- service-advertised sandbox URL, route App calls through the supplied client, publish theme changes without
418
- replacing the iframe, and request standard teardown on semantic replacement, disconnect, or an App teardown
419
- request.
413
+ Framework setup, lifecycle ownership, sandbox/CSP behavior, and staged diagnostics are owned by the
414
+ [Bring your own UI guide](https://docs.noodleseed.dev/docs/guides/bring-your-own-ui).
420
415
 
421
416
  The App document owns its action intent: it calls standard `tools/call` after connecting and never relies on
422
417
  native form navigation. If that call needs input or confirmation, the same `client` publishes the normal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noodleseed/one",
3
- "version": "0.140.0",
3
+ "version": "0.141.0",
4
4
  "private": false,
5
5
  "description": "Noodle CLI by Noodle Seed — author, run, and deploy declarative MCP servers. Embedding the assistant in your own web app is @noodleseed/assistant.",
6
6
  "license": "Apache-2.0",