@requence/service 0.8.2-edge.1165 → 0.8.2-edge.1169

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../node_modules/.bun/dlv@1.1.3/node_modules/dlv/dist/dlv.js", "../src/index.ts", "../../helpers/src/utils/guards.ts", "../../helpers/src/utils/mapData.ts", "../../helpers/src/utils/fileObject.ts", "../../helpers/src/utils/streamObject.ts", "../../helpers/src/utils/claimCheckObject.ts", "../../helpers/src/utils/requenceCallback.ts", "../../helpers/src/utils/serviceRender.ts", "../../helpers/src/utils/surfaceHandler.ts", "../../helpers/src/utils/uiRebuild.ts", "../../helpers/src/utils/obj.ts", "../../helpers/src/utils/amqpHeartbeat.ts", "../src/createAmqpConnection.ts", "../../helpers/src/msgpack/index.ts", "../../files/src/errors.ts", "../../files/src/streamFraming.ts", "../../files/src/remoteBody.ts", "../../files/src/RequenceFile.ts", "../../files/src/RequenceStream.ts", "../../files/src/handlers/transport.ts", "../../files/src/handlers/fileHandler.ts", "../../files/src/withRequenceStreams.ts", "../../files/src/handlers/streamHandler.ts", "../../files/src/handlers/claimCheckHandler.ts", "../../files/src/sanitizeLogData.ts", "../../callbacks/src/handler.ts", "../../transformer/src/errors.ts", "../../transformer/src/guards.ts", "../../transformer/src/walk.ts", "../../transformer/src/transform.ts", "../src/surfaceHandler.ts", "../src/transformer.ts", "../src/boundary.ts", "../src/callbackGrowth.ts", "../src/durableCallback.ts", "../src/helpers.ts", "../../store/src/address.ts", "../../store/src/capability.ts", "../../store/src/errors.ts", "../../store/src/client.ts", "../src/store.ts", "../src/uiWatch.ts", "../src/ui.ts", "../src/utils.ts"],
3
+ "sources": ["../../../node_modules/.bun/dlv@1.1.3/node_modules/dlv/dist/dlv.js", "../src/index.ts", "../../helpers/src/utils/guards.ts", "../../helpers/src/utils/mapData.ts", "../../helpers/src/utils/fileObject.ts", "../../helpers/src/utils/streamObject.ts", "../../helpers/src/utils/claimCheckObject.ts", "../../helpers/src/utils/requenceCallback.ts", "../../helpers/src/utils/serviceRender.ts", "../../helpers/src/utils/surfaceHandler.ts", "../../helpers/src/utils/uiRebuild.ts", "../../helpers/src/utils/nodeResume.ts", "../../helpers/src/utils/obj.ts", "../../helpers/src/utils/amqpHeartbeat.ts", "../src/createAmqpConnection.ts", "../../helpers/src/msgpack/index.ts", "../../files/src/errors.ts", "../../files/src/streamFraming.ts", "../../files/src/remoteBody.ts", "../../files/src/RequenceFile.ts", "../../files/src/RequenceStream.ts", "../../files/src/handlers/transport.ts", "../../files/src/handlers/fileHandler.ts", "../../files/src/withRequenceStreams.ts", "../../files/src/handlers/streamHandler.ts", "../../files/src/handlers/claimCheckHandler.ts", "../../files/src/sanitizeLogData.ts", "../../callbacks/src/handler.ts", "../../transformer/src/errors.ts", "../../transformer/src/guards.ts", "../../transformer/src/walk.ts", "../../transformer/src/transform.ts", "../src/surfaceHandler.ts", "../src/transformer.ts", "../src/boundary.ts", "../src/callbackGrowth.ts", "../src/durableCallback.ts", "../src/helpers.ts", "../../store/src/address.ts", "../../store/src/capability.ts", "../../store/src/errors.ts", "../../store/src/client.ts", "../src/store.ts", "../src/uiWatch.ts", "../src/ui.ts", "../src/utils.ts"],
4
4
  "sourcesContent": [
5
5
  "module.exports=function(t,e,l,n,o){for(e=e.split?e.split(\".\"):e,n=0;n<e.length;n++)t=t?t[e[n]]:o;return t===o?l:t};\n//# sourceMappingURL=dlv.js.map\n",
6
6
  "import fs from 'node:fs'\nimport type { ConnectionOptions as TlsConnectionOptions } from 'node:tls'\n\nimport { deobfuscate } from '@requence/helpers'\nimport logger from '@requence/logger/simple'\nimport type { AmqpConnectionManagerOptions } from 'amqp-connection-manager'\n\nimport createAmqpConnection, {\n type ConnectionApi,\n type ConnectionStateListener,\n type MessageHandler,\n connectionOptionsSchema,\n} from './createAmqpConnection.ts'\n\nexport { RequenceFile, RequenceStream } from '@requence/files'\n// The store's named errors, re-exported beside `RequenceFile` for the same\n// reason: they are raised inside a handler, and `@requence/store` is not a\n// package a service author can reach. A store call is an HTTP call and fails\n// like one — every refusal has a class, so a caller that wants to handle one\n// reads it off the class rather than off a status.\nexport {\n StoreAddressFullError,\n StoreError,\n StoreRequestError,\n StoreTaskNotAllowedError,\n StoreUnauthorizedError,\n StoreUnavailableError,\n StoreValueNotStorableError,\n StoreValueTooLargeError,\n type StoreBinding,\n} from '@requence/store'\nexport {\n createCallback,\n type RequenceCallback,\n type WrappedRequenceCallback,\n} from '@requence/helpers'\nexport {\n type Bindable,\n type ConfigurationOf,\n type DurableCallback,\n type DurableCallbackContext,\n type DurableCallbackHandle,\n type DurableCallbackHandler,\n createDurableCallback,\n} from './durableCallback.ts'\nexport * from './errors.ts'\n// Types only: the facade's components are declarations of a runtime the *host*\n// provides, so re-exporting them as values here would emit a runtime re-export\n// of bindings that do not exist. A component author reaches them through the\n// `@requence/service/surface-ui` subpath instead — see `surfaceUi.ts`.\nexport type {\n ButtonProps,\n CheckboxProps,\n SelectOption,\n SelectProps,\n StackProps,\n SurfaceSpace,\n TextFieldProps,\n TextProps,\n} from './surfaceUi.ts'\nexport type { RequenceStore, StoreSlot } from './store.ts'\nexport * from './ui.ts'\nexport * from './utils.ts'\n\nexport {\n type ConnectionState,\n type ConnectionStateListener,\n MessageHandler,\n} from './createAmqpConnection.ts'\n// Undocumented — privileged consumers (the reserved requence-logic runtime)\n// cast their handler context to this; see helpers.ts.\nexport type { PrivilegedContext, PrivilegedSends } from './helpers.ts'\nexport type ServiceApi<\n V extends keyof RequenceService.Version | (string & {}),\n> = ConnectionApi<V>\n\ninterface ServiceOptions<V extends string> {\n accessToken?: string\n devToken?: string\n version: V\n /**\n * Optional, author-chosen label announced in the AMQP client properties and\n * shown in the Requence UI next to the online count — \"which of my three\n * deployments is this?\".\n *\n * A DEBUGGING LABEL, not an identifier: it is not unique, nothing keys off\n * it, and no behaviour depends on it. Capped at 64 characters (longer labels\n * are truncated, never rejected).\n */\n name?: string\n prefetch?: number\n connectionTimeout?: number\n /** heartbeat interval in seconds — defaults to 30 */\n heartbeatInterval?: number\n silent?: boolean\n connectionOptions?: AmqpConnectionManagerOptions['connectionOptions']\n /** Max serialized body size in bytes before a PayloadTooLargeError is thrown. */\n maxMessageSize?: number\n // Undocumented (privileged consumers): skip file/stream/callback\n // rehydration on ingress; claim-checks still resolve. See helpers.ts.\n passthroughByteReferences?: boolean\n /**\n * Notified whenever the underlying AMQP connection is lost or (re)established.\n * amqp-connection-manager auto-reconnects, so this is the only observable\n * signal of a mid-life outage — use it to drive liveness/health reporting.\n */\n onConnectionStateChange?: ConnectionStateListener\n}\n\n// TLS connection options overridable via the environment. These are a\n// fallback only: a value supplied in code through `connectionOptions` always\n// wins (see resolveConnectionOptions). `CA` carries inline PEM, `CA_FILE` a\n// path to a PEM file (inline wins when both are set); `REJECT_UNAUTHORIZED`\n// disables certificate verification when falsy (\"false\"/\"0\"/\"no\").\nfunction resolveConnectionOptions(\n connectionOptions: AmqpConnectionManagerOptions['connectionOptions'],\n): AmqpConnectionManagerOptions['connectionOptions'] {\n const rejectEnv = process.env.REJECT_UNAUTHORIZED\n const caEnv = process.env.CA\n const caFileEnv = process.env.CA_FILE\n\n const tlsDefaults: TlsConnectionOptions = {}\n if (rejectEnv !== undefined) {\n tlsDefaults.rejectUnauthorized = !/^(false|0|no)$/i.test(rejectEnv.trim())\n }\n if (caEnv) {\n tlsDefaults.ca = caEnv\n } else if (caFileEnv) {\n tlsDefaults.ca = fs.readFileSync(caFileEnv)\n }\n\n if (Object.keys(tlsDefaults).length === 0) {\n return connectionOptions\n }\n\n // Env defaults first, code-supplied options last → code overrides env.\n return { ...tlsDefaults, ...connectionOptions }\n}\n\nlet pkgJson: any | null\nfunction loadPkgJson() {\n if (!pkgJson) {\n pkgJson = JSON.parse(fs.readFileSync('package.json', 'utf-8'))\n }\n return pkgJson\n}\n\n// The dev-token warning is about the process, not about one version: a worker\n// serving several versions would otherwise repeat it once per createService().\nlet didWarnDevToken = false\n\nexport function createService<\n V extends keyof RequenceService.Version | (string & {}),\n>(version: V, messageHandler: MessageHandler<V>): ServiceApi<V>\nexport function createService<\n V extends keyof RequenceService.Version | (string & {}),\n>(options: ServiceOptions<V>, messageHandler: MessageHandler<V>): ServiceApi<V>\nexport function createService<\n V extends keyof RequenceService.Version | (string & {}),\n>(\n optionsOrVersion: ServiceOptions<V> | string,\n optionalMessageHandler?: MessageHandler<V>,\n) {\n let options: ServiceOptions<V>\n let messageHandler: MessageHandler<V>\n if (typeof optionsOrVersion === 'string') {\n options = {\n version: optionsOrVersion as V,\n }\n messageHandler = optionalMessageHandler as MessageHandler<V>\n } else {\n options = optionsOrVersion\n messageHandler = optionalMessageHandler as MessageHandler<V>\n }\n\n let token =\n options.accessToken ??\n process.env.REQUENCE_SERVICE_ACCESS_TOKEN ??\n process.env.REQUENCE_ACCESS_TOKEN\n\n if (!token) {\n try {\n const pkgJson = loadPkgJson()\n token =\n pkgJson.requence?.service?.accessToken ?? pkgJson.requence?.accessToken\n } catch {\n //\n }\n }\n\n let devToken =\n options.devToken ??\n process.env.REQUENCE_SERVICE_DEV_TOKEN ??\n process.env.REQUENCE_DEV_TOKEN\n\n if (!devToken) {\n try {\n const pkgJson = loadPkgJson()\n devToken =\n pkgJson.requence?.service?.devToken ?? pkgJson.requence?.devToken\n } catch {\n //\n }\n }\n\n if (!token) {\n throw new Error('no access token provided')\n }\n\n const parts = deobfuscate(token)\n\n if (parts.length < 2 || parts[0] !== 'service') {\n throw new Error('invalid access token')\n }\n const url = parts[1]\n let devOverlay: string | undefined\n\n if (devToken) {\n const devParts = deobfuscate(devToken)\n if (devParts[0] !== 'api') {\n throw new Error(\n 'invalid dev token: please provide a personal access token',\n )\n }\n if (devParts[2] !== parts[2]) {\n throw new Error(\n 'invalid dev token: access token and dev token belong to different requence instances',\n )\n }\n devOverlay = devParts[1]\n\n // A dev token is not a mode this process announces anywhere else: it\n // quietly moves the worker off the deployed version's queue and onto a\n // personal overlay queue that the broker deletes once the process stops.\n // Deployed with one set, the service looks healthy and serves nothing.\n if (!didWarnDevToken) {\n didWarnDevToken = true\n logger.warn(\n 'Requence: started with a |dev token| — this worker consumes a personal dev-overlay queue instead of the deployed version, and that queue is deleted shortly after the process stops. Do not deploy with one: unset |REQUENCE_DEV_TOKEN| / |REQUENCE_SERVICE_DEV_TOKEN|, or remove |requence.devToken| from package.json.',\n )\n }\n }\n\n const envMaxMessageSize = process.env.REQUENCE_MAX_MESSAGE_SIZE\n ? Number(process.env.REQUENCE_MAX_MESSAGE_SIZE)\n : undefined\n\n return createAmqpConnection<V>(\n {\n // The schema strips unknown keys (and cannot carry a function), so the\n // listener is merged onto the parsed options rather than passed through it.\n ...connectionOptionsSchema.parse({\n ...options,\n connectionOptions: resolveConnectionOptions(options.connectionOptions),\n maxMessageSize: options.maxMessageSize ?? envMaxMessageSize,\n url,\n devOverlay,\n }),\n onConnectionStateChange: options.onConnectionStateChange,\n },\n messageHandler,\n )\n}\n",
@@ -13,9 +13,10 @@
13
13
  "import { z } from 'zod/v4'\n\n/**\n * The render payload a service publishes when a handler calls\n * `context.render(ui, props)` — the wire shape shared by the service SDK\n * (which composes it) and the operator (which parses it before emitting the\n * render as a task update). See `knowledge/service-ui-surfaces.md`.\n *\n * `component.source` travels only on the **first** render of a given hash into a\n * given task; later renders carry the hash alone, because ui/backend stores the\n * bundle hash-addressed and that row outlives every render. A hash arriving\n * without a source that ui/backend has never seen is an error state on the\n * surface, not a silent fallback (D16).\n *\n * Per task rather than per connection because bundle retention is per task\n * (D19): the last-referent sweep removes a bundle once no task references it, and\n * a connection can outlive every task that referenced its component.\n *\n * Every field is deliberately a *top-level* key, because that is the granularity\n * the size-triggered claim-check works at: it offloads a record body's largest\n * top-level values first, and the publisher pins every one of these inline except\n * `props`. So an oversized render always offloads `props` — the one value whose\n * loss is a named error state rather than a broken surface. The source is capped\n * at {@link MAX_UI_SOURCE_BYTES} anyway, well under the offload threshold, so the\n * bundle always travels inline (D4).\n */\nexport const serviceRenderSchema = z.object({\n component: z.object({\n /**\n * The component's stable id (#103) — what a durable handler reference names,\n * and since #108 what a dev-loop bundle swap addresses.\n *\n * Recorded on the surface row, because the hash cannot serve as the\n * component's identity there either: a rebuild is precisely the event that\n * changes it, so a swap has to find the surfaces by the one field it leaves\n * alone.\n */\n id: z.string(),\n hash: z.string(),\n source: z.string().nullable().default(null),\n }),\n props: z.unknown(),\n /**\n * The UI's default props as `createUI(url, defaults)` recorded them — restated\n * on every render of that component, and folded UNDER the surface's stored\n * props at ingestion (#102).\n *\n * A separate field rather than merged into `props` by the SDK, which is what\n * the first cut did (#101), because the two are ranked differently and only\n * the receiver can rank them: a default is the weakest layer, overridden by\n * anything any render of this surface ever said, while `props` is the strongest\n * — the statement this render is making now. Merged before publishing, a\n * default would arrive indistinguishable from a fresh prop and would clobber an\n * override an earlier render made, on every render that stayed silent about it.\n *\n * Travels on EVERY render, not only the source-carrying one: the surface row\n * is last-write-wins and holds no memory of the UI itself, so a render that\n * omitted them would fold against nothing. They pass through the outbound\n * boundary like any other props, so a function among them becomes a callback of\n * whichever message published the render.\n *\n * Optional, unlike `props`: a component that declared none sends the key not\n * at all, so the fold reads \"no base layer\" rather than \"an empty one\".\n */\n defaults: z.unknown().optional(),\n surfaceId: z.string(),\n /**\n * The dev session that drew this surface (#108), or `null` for every render a\n * deployed service makes — which is all of them outside a dev overlay.\n *\n * Recorded on the surface row so a rebuild can repoint exactly the surfaces of\n * the session that produced it, and no others: a developer's edit must not\n * reach into a production surface of the same component. Opaque, and stable\n * across a restart of the dev process — see `uiRebuild.ts`.\n */\n devSession: z.string().nullable().default(null),\n})\n\nexport type ServiceRender = z.infer<typeof serviceRenderSchema>\n\n/**\n * Hard cap on a UI component bundle, enforced when the component is registered\n * (D4). Fits a self-contained React component, stays storable inline in\n * Postgres, and fails fast on an accidental whole-app bundle.\n */\nexport const MAX_UI_SOURCE_BYTES = 1024 * 1024\n\n/**\n * The surface a render targets when it names none (D3). A node's surfaces are\n * keyed by this id, so the default is a single surface per node/trace.\n */\nexport const DEFAULT_SURFACE_ID = 'default'\n\n/**\n * Hard cap on one value a browser sends into a surface — a callback\n * invocation's argument, or a deferred form's submitted response — enforced in\n * ui/backend before either is published (D7).\n *\n * One number for both because they are the same thing arriving by two routes:\n * viewer-authored bytes that reach service code, bounded before they enter the\n * fabric. A response additionally has to fit the node's own output, which the\n * operator enforces on the way in as it does for any service result.\n *\n * An interaction is exactly that — a click, a form submit, an approval — not\n * a data transfer, and unlike a service's own publishes it crosses no outbound\n * boundary: nothing offloads it, so its bytes reach the broker as they are. The\n * cap is what keeps that true, and it is deliberately far below any message\n * limit rather than tuned to one, so a task's `maxPayloadSize` can never make\n * the difference between a usable synchronous rejection and a dropped AMQP\n * connection.\n *\n * Lives here, next to {@link MAX_UI_SOURCE_BYTES}, rather than inside ui/backend:\n * the browser is the other party that has to respect it, and when the surface\n * host starts refusing an oversized argument before the round trip it should\n * read the number from where the server enforces it, not restate it.\n */\nexport const MAX_SURFACE_INTERACTION_BYTES = 64 * 1024\n",
14
14
  "import { z } from 'zod/v4'\n\n/**\n * The reference tag of a **surface handler** — a function a service put in a\n * surface's props, which a viewer's interaction runs back in the service that\n * issued the render (#103).\n *\n * Deliberately not a `RequenceCallback`, even though the connection-bound arm\n * is routed the same way today. The two answer different questions and address\n * different things: a callback reference is a peer-to-peer control-flow handle\n * whose `outputName`/`propertyPath` address a position in the node's declared\n * *output schema*, while a handler reference addresses a **prop of a UI**, has\n * no output behind it, and — in its durable arm — names no connection at all.\n * Merging them would put a lifetime on every callback in the fabric and make a\n * durable reference look like something the operator should route by `sourceId`.\n */\nexport const SURFACE_HANDLER_TAG = 'RequenceHandler'\n\nconst handlerPathSchema = z.array(z.union([z.string(), z.int()]))\n\n/**\n * How long a handler can be reached, decided by **where the function was\n * written** — which is the only thing that actually bounds the closure's life:\n *\n * - `durable` — a function in the UI's default props. It closes over module\n * scope, so *any* instance of the service version can run it, now or after a\n * redeploy, and an invocation waits in the version's handler queue when none\n * is running. Addressed by `(uiId, path)`, because that pair is what survives\n * a rebuild and a restart; the component's content hash does not.\n * - `connection` — a function written inline at `context.render(...)`. It closes\n * over the running handler, so only that process can serve it and it dies when\n * the handler returns. Addressed by the registering connection plus an id in\n * its registry, exactly as a callback is.\n *\n * `uiId`/`path` ride on both arms: the connection-bound arm does not need them\n * to be *routed*, but they are what says which prop of which component this\n * handle belongs to, which is what the row-level `live` flag could never say\n * (#106).\n */\nexport const surfaceHandlerObjectSchema = z.discriminatedUnion('lifetime', [\n z.object({\n __REQUENCE_type: z.literal(SURFACE_HANDLER_TAG),\n lifetime: z.literal('durable'),\n uiId: z.string(),\n path: handlerPathSchema,\n }),\n z.object({\n __REQUENCE_type: z.literal(SURFACE_HANDLER_TAG),\n lifetime: z.literal('connection'),\n uiId: z.string(),\n path: handlerPathSchema,\n /** The connection that registered it; delivery routes by this. */\n connectionId: z.string(),\n /** Its id in that connection's registry. */\n handlerId: z.uuid(),\n }),\n])\n\nexport type SurfaceHandlerObject = z.infer<typeof surfaceHandlerObjectSchema>\nexport type SurfaceHandlerLifetime = SurfaceHandlerObject['lifetime']\n\nexport function isSurfaceHandlerObject(\n data: unknown,\n): data is SurfaceHandlerObject {\n return surfaceHandlerObjectSchema.safeParse(data).success\n}\n\n/**\n * The per-version **handler queue**: where a durable invocation waits until\n * some instance of that service version consumes it.\n *\n * Derived from the version's dispatch queue rather than composed from the\n * service and version names, so the two can never drift and a dev-overlay\n * connection — which consumes a rewritten dispatch queue — gets a handler queue\n * of its own for free.\n */\nexport function serviceHandlerQueueName(dispatchQueue: string): string {\n return `${dispatchQueue}-handlers`\n}\n\n/**\n * How long a durable invocation may wait in the handler queue before the broker\n * drops it (#116).\n *\n * The queue is **not a mailbox**. Reachability is checked before the click — a\n * version with no consumers reports `reachable: false` and the control is\n * withheld — so all this has to bridge is the seconds between that check and the\n * consume: a rolling redeploy, a scale-to-zero that started a moment ago, a\n * replica that took the invocation and died. Long enough that a normal restart\n * still serves the click, short enough that nobody is surprised by an effect\n * they pressed for hours ago.\n *\n * That is the half the flag cannot do on its own: the flag only makes the click\n * harder to fire, and a click that IS fired into an empty queue must expire and\n * be *reported* rather than sit there waiting for whoever deploys next.\n *\n * Expiry is not a drop: the queue dead-letters to `error`, so an expired\n * invocation comes back to the operator carrying its own `taskId` and surface\n * row, and is recorded as an `interactionError` (#107).\n */\nexport const SURFACE_HANDLER_INVOCATION_TTL_MS = 60_000\n\n/**\n * The handler queue's declaration arguments, as **one** object, because two\n * parties declare that queue — ui/backend's provisioner and the service SDK on\n * connect — and a broker answers a mismatch with a 406 that kills the declaring\n * channel. Anything short of a shared literal is a service that will not start.\n *\n * `deadLetterExchange` is what turns expiry into a *report*: `error` fans back\n * into the operator's own shard family, so an expired invocation arrives at the\n * error consumer still carrying its `taskId`, its surface row and its\n * `surfaceHandlerInvocation` marker. Without it the broker would simply drop the\n * message, which is the silent outcome #116 replaced.\n *\n * Note for whoever changes this: declaring a queue with a dead-letter exchange\n * needs WRITE permission on that exchange, so the service AMQP user is granted\n * it (`assertService`). It costs nothing — `error` is an internal exchange and\n * the broker refuses a client publish to one however the permissions read.\n */\nexport const SURFACE_HANDLER_QUEUE_ARGUMENTS = {\n messageTtl: SURFACE_HANDLER_INVOCATION_TTL_MS,\n deadLetterExchange: 'error',\n} as const\n\n/**\n * Whether a handler queue belongs to a **dev overlay** rather than to a deployed\n * service version — which decides what a failed interaction is allowed to say.\n *\n * A developer's overlay queue expires ~5s after the process disconnects\n * (`dev-overlay-auto-delete`), so an invocation into it is unroutable exactly as\n * one into a deleted version is, and the two are indistinguishable by outcome.\n * They are not the same event: telling an author their *service version is no\n * longer deployed* when they simply stopped `bun run dev` sends them looking at\n * the deployment (#116).\n *\n * Mirrors the `dev-overlay-auto-delete` policy's own pattern — the 32-character\n * key segment stays `.{32}`, because dev keys are access-token values and\n * contain non-word characters.\n */\nconst DEV_OVERLAY_HANDLER_QUEUE = /-dev-overlay-.{32}-handlers$/\n\nexport function isDevOverlayHandlerQueue(queueName: string): boolean {\n return DEV_OVERLAY_HANDLER_QUEUE.test(queueName)\n}\n\n/**\n * The header a durable invocation is stamped with, so the party that has to\n * answer an **unroutable** one can tell it from a dispatch (#104).\n *\n * A durable invocation is published `mandatory` into the `service` exchange, so\n * one whose queue is gone comes back to the operator looking like any other\n * undeliverable service message — and every other arm there fails the task's\n * node, which a viewer's click must never do.\n *\n * A header rather than the routing key's `-handlers` suffix, which is *nearly*\n * unambiguous and therefore worse: a version named `…-handlers` gives a dispatch\n * queue that ends the same way, and the failure that buys is a real service\n * dispatch silently swallowed instead of failing its node. This is exact, and it\n * is set by the only publisher there is.\n */\nexport const SURFACE_HANDLER_INVOCATION_HEADER = 'surfaceHandlerInvocation'\n\n/**\n * One durable handler invocation, as it travels on the queue above.\n *\n * The pair `(uiId, path)` is the whole address: the consuming instance looks the\n * UI up in its own registry and resolves the path against that UI's default\n * props. `taskId` is not part of the address — it is what makes the failure of\n * an invocation that names nothing say *which run* it belonged to.\n */\nexport const surfaceHandlerInvocationSchema = z.object({\n taskId: z.uuid(),\n /**\n * The **surface row** this interaction came from (#107) — `task_surface.id`,\n * not the author's `surfaceId`, which under-keys the (task, node, trace,\n * surface) state.\n *\n * Carried for one reason: it is the only way back. A failing invocation has no\n * request left to fail — the mutation returned *accepted* long before, possibly\n * to a viewer who has since closed the page — so the failure is recorded on the\n * surface itself, and the row is what names it. Nothing about the *delivery*\n * needs it, which is why it sits beside the address rather than in it.\n */\n surface: z.uuid(),\n uiId: z.string(),\n path: handlerPathSchema,\n /**\n * `.optional()` because an invocation with no argument is ordinary — a handler\n * may take none — and this rides a JSON queue, where `JSON.stringify` DELETES\n * an `undefined` value instead of encoding one. Under zod 4 an `unknown` field\n * is not optional by itself, so the key's absence would fail the parse and the\n * click would be dropped with only a line in the consuming instance's stderr.\n * The publisher normalises to `null`; this covers one that has not been rolled\n * forward.\n */\n arg: z.unknown().optional(),\n})\n\nexport type SurfaceHandlerInvocation = z.infer<\n typeof surfaceHandlerInvocationSchema\n>\n\n/**\n * How long a recorded interaction failure may be (#107).\n *\n * A thrown error's message is author-supplied text of no bounded length, and it\n * ends up on a row that is pushed to every viewer of the task on every render.\n * Truncated rather than rejected: a long message is still the most useful thing\n * anyone has about the failure, and its first characters are where the cause is.\n */\nexport const MAX_SURFACE_INTERACTION_ERROR_CHARS = 500\n\n/**\n * The header a **surface interaction failure report** is stamped with (#107), so\n * the operator can tell it from an ordinary service result.\n *\n * A report carries no message id and no index: the handler that failed was not\n * running for any message of the operator's — that is the whole of what makes a\n * durable handler durable — so it cannot ride the ordered dispatch buffer, and\n * every other arm of the result path would fail the node the surface is painted\n * on. It names a task, a surface row and what went wrong, and the operator\n * forwards it as a task update.\n */\nexport const SURFACE_INTERACTION_ERROR_HEADER = 'surfaceInteractionError'\n\n/**\n * One interaction failure, as a service reports it back to the operator (#107).\n *\n * The failing party writes the sentence: only it knows whether the component was\n * unregistered, the prop held nothing invokable, or the handler threw — and only\n * it can quote the error. The operator forwards the text verbatim; ui/backend\n * masks it and stores it on the row.\n */\nexport const surfaceInteractionErrorReportSchema = z.object({\n surface: z.uuid(),\n message: z.string(),\n})\n\nexport type SurfaceInteractionErrorReport = z.infer<\n typeof surfaceInteractionErrorReportSchema\n>\n",
15
15
  "import { z } from 'zod/v4'\n\n/**\n * Marks a service message as a **dev-loop bundle swap** (#108) rather than a\n * result for one of the operator's dispatches.\n *\n * A rebuild changes which bytes the frame imports and nothing else — not the\n * props, not the handlers, not the node — so it is deliberately not a render. A\n * render would need the registering message to be unsettled and its registry\n * alive, which is what took the dev loop away from a deferred form: the handler\n * that drew it returned at the defer, so there is nothing left to re-render\n * through. A swap needs none of that, and so works identically for a live panel,\n * a deferred form, and a surface on a task that has already finished.\n *\n * Read on the same path as a result, and answered before it — like\n * `SURFACE_INTERACTION_ERROR_HEADER`, this message has no correlation id, no\n * index and no place in the ordered dispatch buffer, because it belongs to no\n * message of the operator's.\n */\nexport const UI_REBUILD_HEADER = 'uiRebuild'\n\n/**\n * What a rebuild says: *this component of this dev session is now these bytes*.\n *\n * `devSession` is opaque here and produced by the service SDK, which is the only\n * party that can: it is the one identity that survives the process being\n * restarted (a dev token plus the service version it is overlaying), so the\n * surfaces a session drew before a restart are still the same session's\n * afterwards. It deliberately carries no dev token in the clear — the token is\n * hashed into it — because it comes to rest in `task_surface`.\n *\n * `uiId` is the component's stable id (#103), which is what makes the swap\n * addressable at all: the hash is the thing that changed, so it cannot be the\n * thing looked up. A surface repoints when it belongs to this session AND shows\n * this component, whatever hash it is currently on — which is why a swap reaches\n * a surface that has sat through several rebuilds unseen.\n *\n * `source` always travels. The render payload's per-task dedup does not apply: a\n * swap is the first anyone has heard of this hash, and the surfaces it repoints\n * are precisely the ones that would otherwise be left naming a bundle nobody\n * stored.\n */\nexport const uiRebuildSchema = z.object({\n devSession: z.string(),\n uiId: z.string(),\n hash: z.string(),\n source: z.string(),\n})\n\nexport type UiRebuild = z.infer<typeof uiRebuildSchema>\n",
16
+ "import { z } from 'zod/v4'\n\n/**\n * Marks a service message as **`act()` announcing that it has re-attached** to a\n * deferred node (#271), rather than a result for one of the operator's\n * dispatches.\n *\n * Nothing used to be emitted when a deferred node resumed: `act()` publishes no\n * `begin`, and `context.defer()` is not on its actor API — so the only rows a\n * deferred run had were its start, its defer and its end, and the work done after\n * the resume could not be told apart from the wait in front of it. A form\n * deferred three days whose handler then spends four minutes building a PDF\n * reported `work 1s, defer 3d 4m`.\n *\n * Read on the same path as a result, and answered before one is looked for —\n * like `SURFACE_INTERACTION_ERROR_HEADER` and `UI_REBUILD_HEADER`, and for the\n * one reason those two share: it carries **no index** and so has no place in the\n * message's ordered output stream. Making it a `begin` instead was rejected for\n * exactly that reason: a begin lands on the begin-rewind that resets a deferred\n * message's index space, which is what stops a re-attach's render being\n * discarded as a duplicate.\n */\nexport const NODE_RESUME_HEADER = 'nodeResume'\n\n/**\n * What a resume says, and the whole of it: *this message is being acted on\n * again*.\n *\n * The message id and nothing else. An acting process knows no more than that —\n * it holds a defer key, not a dispatch — and it does not have to: the operator\n * owns the message record, so the node and the trace lineage the update is filed\n * under are read there rather than travelling on the wire and risking a second\n * answer.\n */\nexport const nodeResumeReportSchema = z.object({\n messageId: z.uuid(),\n})\n\nexport type NodeResumeReport = z.infer<typeof nodeResumeReportSchema>\n",
16
17
  "import dlv from 'dlv'\nimport { dset } from 'dset'\n\nexport function setByPath<T extends Record<string, unknown>, U = T>(\n obj: T,\n keys: string | ArrayLike<string | number>,\n value: unknown,\n) {\n const clonedObj = structuredClone(obj)\n dset(clonedObj, keys, value)\n return clonedObj as unknown as U\n}\n\nexport const getByPath = dlv\n",
17
18
  "// The negotiated AMQP heartbeat is the CLIENT's choice: the broker sets no\n// `heartbeat` in `deploy/swarm/rabbitmq/rabbitmq.conf`, so its own 60s default\n// is only a ceiling. `amqp-connection-manager` defaults to 5s, which makes any\n// event-loop stall longer than 10s (two missed intervals) fatal to every\n// connection in the deployment at once — that is what dropped eight connections\n// simultaneously in the 2026-07-30 incident.\n//\n// 30s tolerates ~60s of stall: longer than any GC/IO pause that does not already\n// mean the process is dead, short enough that a genuinely wedged client is still\n// reaped.\nexport const DEFAULT_AMQP_HEARTBEAT_SECONDS = 30\n\n// Sets the heartbeat as a URL query parameter, which is the one mechanism every\n// client understands: plain `amqplib` reads it during negotiation, and\n// `amqp-connection-manager` appends its own 5s default only when the param is\n// absent (`dist/cjs/AmqpConnectionManager.js`), so this wins there too.\n//\n// Non-destructive by design — an explicit `?heartbeat=` in the configured URL\n// always wins, and the input URL is never mutated.\nexport function withAmqpHeartbeat(url: URL): URL {\n const next = new URL(url.toString())\n if (!next.searchParams.has('heartbeat')) {\n next.searchParams.set('heartbeat', String(DEFAULT_AMQP_HEARTBEAT_SECONDS))\n }\n return next\n}\n",
18
- "import { createHash } from 'node:crypto'\n\nimport type { CallbackIngressContext } from '@requence/callbacks'\nimport {\n type CallbackObject,\n DEFAULT_AMQP_HEARTBEAT_SECONDS,\n DEFAULT_SURFACE_ID,\n DURABLE_CALLBACK_QUEUE_ARGUMENTS,\n MAX_SURFACE_INTERACTION_ERROR_CHARS,\n type MaybePromise,\n SURFACE_HANDLER_QUEUE_ARGUMENTS,\n SURFACE_HANDLER_TAG,\n SURFACE_INTERACTION_ERROR_HEADER,\n type SurfaceHandlerObject,\n UI_REBUILD_HEADER,\n type UiRebuild,\n deobfuscate,\n durableCallbackInvocationSchema,\n getByPath,\n obfuscate,\n serviceCallbackQueueName,\n serviceHandlerQueueName,\n surfaceHandlerInvocationSchema,\n} from '@requence/helpers'\nimport type { WireCodec } from '@requence/helpers/msgpack'\nimport {\n decodeWireBody,\n encodeWireBody,\n wireCodecFromContentType,\n} from '@requence/helpers/msgpack'\nimport {\n CAPABILITY_HEADER_KEYS,\n buildServiceClientProperties,\n buildServiceIdentityHeaders,\n readRequiredCapabilities,\n unsupportedCapabilities,\n} from '@requence/helpers/protocol'\nimport logger from '@requence/logger/simple'\nimport { type Options, connect } from 'amqp-connection-manager'\nimport type { ConfirmChannel, ConsumeMessage } from 'amqplib'\nimport { z } from 'zod/v4'\n\nimport {\n type OutboundBoundary,\n createInboundBoundary,\n createOutboundBoundary,\n} from './boundary.ts'\nimport { createCallbackGrowthWatch } from './callbackGrowth.ts'\nimport {\n durableCallbackContext,\n findDurableCallback,\n} from './durableCallback.ts'\nimport {\n PayloadTooLargeError,\n RequenceConnectionError,\n UnsupportedCapabilityError,\n} from './errors.ts'\nimport createContextHelper, {\n AbortError,\n type ContextHelper,\n type JSONValue,\n RetryError,\n SkipError,\n handlerStorage,\n unwrapOutputValue,\n} from './helpers.ts'\nimport { libVersion } from './macro.ts' with { type: 'macro' }\nimport { createStore } from './store.ts'\nimport { passthroughInboundTransformer } from './transformer.ts'\nimport type { RenderProps, RequenceUI } from './ui.ts'\nimport {\n type MutableRequenceUI,\n findUIById,\n watchUIRebuilds,\n} from './uiWatch.ts'\n\ntype InternalNamedOutput = '__internal_named_output__'\n\n/**\n * A thrown value as a sentence a viewer can read — the text a recorded\n * interaction failure quotes (#107).\n *\n * The message and not the stack: the stack goes to this process's stderr, where\n * the author is, while the row is served to whoever is looking at the surface.\n */\nfunction errorText(error: unknown): string {\n return error instanceof Error ? error.message : String(error)\n}\n\ntype Input<V extends keyof RequenceService.Version> =\n RequenceService.Version[V]['input']\ntype Configuration<V extends keyof RequenceService.Version> =\n RequenceService.Version[V]['configuration']\ntype OutputName<\n V extends keyof RequenceService.Version,\n K = keyof RequenceService.Version[V]['outputs'],\n> = K extends '__default__' ? null : K\n\ntype OutputValue<\n V extends keyof RequenceService.Version,\n O extends OutputName<V>,\n ON = O extends null ? '__default__' : O,\n> = ON extends keyof RequenceService.Version[V]['outputs']\n ? RequenceService.Version[V]['outputs'][ON]\n : never\n\ninterface ServiceContextHelper<\n V extends keyof RequenceService.Version,\n> extends Omit<\n ContextHelper,\n 'input' | 'configuration' | 'getData' | 'getConfiguration' | 'toOutput'\n> {\n input: Input<V>\n configuration: Configuration<V>\n\n toOutput<O extends OutputName<V>>(\n name: O,\n value: OutputValue<V, O>,\n ): InternalNamedOutput\n}\n\ntype ApiOutputName<V> = V extends keyof RequenceService.Version\n ? OutputName<V>\n : string | null\ntype ApiOutputValue<V, O> = V extends keyof RequenceService.Version\n ? O extends OutputName<V>\n ? OutputValue<V, O>\n : unknown\n : unknown\n\ninterface ActorApi<V> {\n sendToOutput<O extends ApiOutputName<V>>(\n outputName: O,\n data: ApiOutputValue<V, O>,\n options?: { overwrite?: boolean },\n ): void\n send(data: ApiOutputValue<V, null>, options?: { overwrite?: boolean }): void\n /**\n * Renders a UI component on the deferred node, for as long as this `act()`\n * call runs — the `act()` re-attach of\n * `knowledge/service-ui-surfaces.md`.\n *\n * Identical in contract to `context.render`: `props` is a plain object, and\n * functions inside it arrive in the component as invokable callbacks. The\n * difference is *whose* they are — they register in this `act()` call's own\n * registry, so they live exactly as long as the call. A deferring LINEAR\n * handler cannot hold one at all (its callbacks die when it returns), which is\n * why a live surface on a deferred node has to be rendered from here.\n *\n * That is also what makes it survive a restart: reload the pending keys,\n * `act()` again, and this render — fresh connection, fresh callbacks —\n * replaces the stale surface through the last-write-wins surface row. Nothing\n * about the component or the browser has to know it happened.\n *\n * **You own the double-attach lock.** See {@link ConnectionApi.act}: two\n * replicas that both load the same pending key will both render, and the\n * second one silently takes the surface over. Requence cannot hold that lock\n * for you — it warns loudly instead.\n *\n * A render is a patch here exactly as on the main path (#102), which is what\n * makes a re-attach cheap: restate what this process knows and let the fold\n * keep the rest.\n *\n * A function written *here* is connection-bound: it closes over this `act()`\n * call, so it dies with it. A function in the UI's own defaults is durable\n * whoever renders it (#103) — which is what an actor should reach for when it\n * wants a control to keep working after it has gone.\n */\n render<Props>(\n ui: RequenceUI<Props>,\n props: RenderProps<Props>,\n options?: { surfaceId?: string },\n ): void\n abort(error: string | Error): void\n}\n\nexport interface ConnectionApi<V> {\n close(): Promise<void>\n open(): Promise<ConnectionApi<V>>\n /**\n * Deliver the result of a deferred message, later and from anywhere: pass the\n * key `context.defer()` returned and the actor runs with a send API for that\n * message. It is also the only live window a deferred node has — see\n * {@link ActorApi.render}.\n *\n * **Double-attach is YOUR lock to hold.** You own the pending-key storage, so\n * you own the exclusivity. This connection refuses a key it is already acting\n * on, but that check is per-connection and in memory: two replicas that both\n * load the pending keys on boot will both `act()` the same key, both register\n * callbacks, and both render — and the second render replaces the first one's\n * surface, so clicks silently go to whichever instance rendered last. Requence\n * does not arbitrate this (that would need cross-replica holder state plus a\n * takeover path so a dead holder cannot block a key forever); it makes the\n * symptom loud instead, by warning when a render replaces a surface that is\n * still live on another connection.\n *\n * Take a lease on the key in your own store before acting, and only act on\n * keys you hold.\n */\n act(\n messageKey: string,\n actor: (\n api: ActorApi<V>,\n ) =>\n | ApiOutputValue<V, null>\n | Promise<ApiOutputValue<V, null>>\n | void\n | Promise<void>\n | AsyncGenerator<ApiOutputValue<V, null>>\n | Generator<ApiOutputValue<V, null>>,\n ): Promise<void>\n}\n\nexport const messageKeySchema = z\n .string()\n .transform((str) => deobfuscate(str))\n .pipe(z.tuple([z.uuid(), z.uuid()]).rest(z.string()))\n .transform((arr) => ({\n taskId: arr[0],\n messageId: arr[1],\n uploadUrl: arr[2] || undefined,\n streamUrl: arr[3] || undefined,\n // Byte limits appended to the defer key alongside the transport URLs.\n // Old 4-part keys (pre-limits) parse with both absent → consumer defaults.\n maxPayloadSize:\n arr[4] && Number.isFinite(Number(arr[4])) ? Number(arr[4]) : undefined,\n maxFileSize:\n arr[5] && Number.isFinite(Number(arr[5])) ? Number(arr[5]) : undefined,\n // Appended for #150, so an `act()` call can emit a durable callback\n // reference: the node is the reference's whole address, and an acting process\n // has no dispatch to read it off. Absent in a key minted before this, which\n // then behaves exactly as it did — that path could not emit one either.\n nodeId: arr[6] || undefined,\n }))\n\nconst headerSchema = z\n .object({\n properties: z.object({\n correlationId: z.uuid(),\n headers: z.object({\n taskId: z.uuid(),\n mode: z.enum(['LINEAR', 'CONTINUOUS']).default('LINEAR'),\n }),\n }),\n })\n .transform((msg) => ({\n messageId: msg.properties.correlationId,\n taskId: msg.properties.headers.taskId,\n mode: msg.properties.headers.mode,\n }))\n\nconst payloadSchema = z\n .object({\n content: z.instanceof(Buffer),\n properties: z.object({ contentType: z.string().optional() }),\n })\n // The dispatch codec is whatever the operator declared, never an assumption:\n // `ui/backend` bakes the choice per service node, so two nodes of one task can\n // legitimately arrive under different codecs, and a replica that has just been\n // rolled forward still receives JSON for tasks created before it attached.\n .transform((msg) => decodeWireBody(msg.content, msg.properties.contentType))\n .pipe(\n z.object({\n // Optional because a dispatch may carry no input at all, and the JSON\n // codec drops an `undefined` value rather than encoding one — under zod 4\n // that absence would throw here and fail the node with a message about the\n // envelope. The msgpack codec keeps the key (as nil), so this only ever\n // shows on the JSON wire.\n input: z.unknown().optional(),\n configuration: z.unknown().optional(),\n // Which node of the graph this dispatch is for — the address a durable\n // callback reference carries out with it (#150). Optional like the rest of\n // this envelope: a dispatch minted before it existed simply cannot emit\n // one, and the callback handler says exactly that.\n nodeId: z.string().optional(),\n // Set only when this dispatch is a configuration-function evaluation\n // (#224). `nodeId` is then the HOST node's — the node being configured —\n // and the store composes `private` slots into that node's configuration\n // box rather than into the host service's own.\n //\n // Not spelled `configuration`: that key is already this envelope's\n // configuration VALUE. The operator's own word for the phase is the\n // config eval, so that is the name on the wire.\n configurationEval: z.boolean().optional(),\n options: z.object({\n uploadUrl: z.url().optional(),\n streamUrl: z.url().optional(),\n maxPayloadSize: z.number().optional(),\n maxFileSize: z.number().optional(),\n // The store capability (#210), copied onto every dispatch by the\n // operator, which reads neither field. `z.string()` rather than\n // `z.url()` deliberately: it must accept exactly what\n // `taskOptionsSchema` accepts, or a dispatch the protocol calls valid\n // fails the whole envelope here.\n storeUrl: z.string().optional(),\n storeSignature: z.string().optional(),\n }),\n }),\n )\n\nconst backchannelMessageSchema = z\n .object({\n content: z.instanceof(Buffer),\n properties: z.object({\n correlationId: z.string(),\n contentType: z.string().optional(),\n // The task, for the failure report below. Every backchannel publish stamps\n // it (the operator needs it to hash the unroutable copy onto the task's own\n // shard), so it is here rather than in the payload.\n //\n // `catch` so this can never reject a delivery: the headers are a *reporting*\n // input, and a malformed one must cost the report, not the invocation the\n // message was carrying.\n headers: z\n .object({ taskId: z.uuid().optional() })\n .optional()\n .catch(undefined),\n }),\n })\n // Header-driven like every other decoder on these wires. The backchannel itself\n // stays JSON — it is a low-volume control wire — but reading the header means it\n // is not the one consumer a later codec change has to remember to visit.\n .transform((message) => ({\n ...message,\n content: decodeWireBody(message.content, message.properties.contentType),\n }))\n .pipe(\n z.object({\n content: z.discriminatedUnion('type', [\n z.object({\n type: z.literal('stop'),\n }),\n z.object({\n type: z.literal('callback'),\n callbackId: z.uuid(),\n /**\n * `.optional()` is load-bearing, and it is not decoration: under zod 4\n * an `any` field is NOT optional, so a body with no `arg` key fails to\n * parse — and the parse failure here is a bare `return`, the one path\n * on this consumer that says nothing at all.\n *\n * A body without the key is ordinary: the wire is JSON, and a handler\n * invoked with no argument (`onInject(): void`) serializes to a key\n * `JSON.stringify` deletes. The publisher normalises to `null` now, so\n * this covers a publisher that has not been rolled forward rather than\n * the everyday case.\n */\n arg: z.any().optional(),\n /**\n * Present exactly when this callback IS a connection-bound surface\n * handler invocation (#107): the surface row it came from, so a\n * failure can be stated on the surface the viewer is looking at.\n *\n * A peer callback carries none, and must not: it belongs to a live\n * message that can fail in the ordinary way.\n */\n surface: z.uuid().optional(),\n }),\n ]),\n properties: z.object({\n correlationId: z.string(),\n headers: z\n .object({ taskId: z.uuid().optional() })\n .optional()\n .catch(undefined),\n }),\n }),\n )\n .transform((message) => ({\n payload: message.content,\n messageId: message.properties.correlationId,\n taskId: message.properties.headers?.taskId,\n }))\n\nconst abortSymbol = Symbol()\n\nexport const connectionOptionsSchema = z.object({\n url: z.union([\n z\n .string()\n .regex(/^amqps?:\\/\\/(.+):(.+)@(.+)$/)\n .transform((str) => new URL(str)),\n z\n .instanceof(URL)\n .refine((url) => url.protocol.match(/^amqps?:/), 'Wrong protocol'),\n ]),\n version: z.string(),\n // Author-chosen debugging label announced in the AMQP client properties.\n // Not length-validated on purpose — an over-long label is capped, never a\n // startup failure. Nothing keys off it.\n name: z.string().optional(),\n devOverlay: z.string().optional(),\n silent: z.boolean().optional(),\n prefetch: z.number().int().optional(),\n connectionTimeout: z.number().positive().default(3_000),\n heartbeatInterval: z.number().int().positive().optional(),\n connectionOptions: z.any().optional(),\n // Hard cap on the serialized message body. A body above this is rejected with a\n // clear PayloadTooLargeError *before* it reaches the broker — the broker itself\n // only signals oversize by tearing down the connection, which amqplib surfaces\n // as an opaque \"channel closed\". Set to match the broker's max_message_size.\n maxMessageSize: z\n .number()\n .int()\n .positive()\n .default(128 * 1024 * 1024), // RabbitMQ's historical default max_message_size\n // Undocumented (privileged consumers): skip file/stream/callback rehydration\n // on ingress — claim-checks still resolve; byte references reach the handler\n // as raw `__REQUENCE_type` wire objects. See helpers.ts.\n passthroughByteReferences: z.boolean().optional(),\n})\n\nexport type PrivilegedConnectionOptions = z.output<\n typeof connectionOptionsSchema\n>\nexport type ConnectionOptions = Omit<\n PrivilegedConnectionOptions,\n 'passthroughByteReferences'\n>\n\n// Live connection state, surfaced so a caller (e.g. the logic runtime's health\n// probe) can react to loss/recovery instead of trusting a one-shot startup\n// signal. `connected: false` carries the disconnect error when the broker\n// supplied one; `connected: true` fires on the initial connect and on every\n// subsequent auto-reconnect.\nexport interface ConnectionState {\n connected: boolean\n err?: Error\n}\nexport type ConnectionStateListener = (state: ConnectionState) => void\n\ntype MessageHandlerContext<V> = V extends keyof RequenceService.Version\n ? ServiceContextHelper<V>\n : ContextHelper\ntype MessageHandlerReturnValue<\n V,\n O = null,\n> = V extends keyof RequenceService.Version\n ? O extends OutputName<V>\n ? OutputValue<V, O> | InternalNamedOutput\n : void\n : JSONValue\n\ntype MessageHandlerFunction<V> = (\n context: MessageHandlerContext<V>,\n) => MaybePromise<MessageHandlerReturnValue<V> | void>\n\ntype MessageHandlerGenerator<V> = (\n context: MessageHandlerContext<V>,\n) => Generator<\n MessageHandlerReturnValue<V>,\n MessageHandlerReturnValue<V> | void,\n void\n>\ntype MessageHandlerAsyncGenerator<V> = (\n context: MessageHandlerContext<V>,\n) => AsyncGenerator<\n MessageHandlerReturnValue<V>,\n MessageHandlerReturnValue<V> | void,\n void\n>\n\nexport type MessageHandler<V> = V extends keyof RequenceService.Version\n ? RequenceService.Version[V]['mode'] extends 'LINEAR'\n ? MessageHandlerFunction<V>\n :\n | MessageHandlerAsyncGenerator<V>\n | MessageHandlerGenerator<V>\n | MessageHandlerFunction<V>\n :\n | MessageHandlerAsyncGenerator<V>\n | MessageHandlerGenerator<V>\n | MessageHandlerFunction<V>\n\nfunction isMessageHandlerGenerator<V extends keyof RequenceService.Version>(\n // oxlint-disable-next-line typescript/no-unsafe-function-type\n handler: Function,\n): handler is MessageHandlerGenerator<V> | MessageHandlerAsyncGenerator<V> {\n return (\n handler.constructor.name === 'GeneratorFunction' ||\n handler.constructor.name === 'AsyncGeneratorFunction'\n )\n}\n\nconst activeMessages = new Map<string, Promise<void>>()\n\n/**\n * The codec each in-flight dispatch arrived under, keyed by messageId.\n *\n * **A reply echoes the codec of its dispatch.** That is what keeps this direction\n * of the wire free of any capability logic: the service never chooses, never\n * configures and never negotiates a codec — it answers in the language it was\n * addressed in. The operator's result consumer then reads the content type back\n * off the reply, so the round trip needs no field anywhere in the protocol.\n *\n * A messageId absent from this map means JSON, which is both the pre-migration\n * status quo and the right answer for an operator loopback that never went\n * through a dispatch.\n */\nconst messageCodecs = new Map<string, WireCodec>()\n\n// A delivery tag belongs to the exact channel that delivered the message. When\n// that channel closes (e.g. the connection dropped mid-processing), amqplib\n// turns ack/nack into a synchronous `IllegalOperationError: Channel closed`.\n// The broker has already requeued the delivery for redelivery, so there is\n// nothing left to acknowledge — and we must NOT route this through the\n// reconnecting channelWrapper, which would send the stale tag on the new\n// channel and trip a 406 PRECONDITION_FAILED that kills the fresh channel.\nfunction isChannelClosedError(error: unknown): boolean {\n return error instanceof Error && error.name === 'IllegalOperationError'\n}\n\nfunction safeAck(channel: ConfirmChannel, message: ConsumeMessage) {\n try {\n channel.ack(message)\n } catch (error) {\n if (!isChannelClosedError(error)) {\n throw error\n }\n }\n}\n\n/**\n * The addressing half of an invocation, as the *headers* of the publish that\n * carries it to the operator — which is what differs between the two lifetimes\n * and the whole of what differs.\n *\n * A service publishes an invocation onto its own results stream either way: it\n * cannot reach a backchannel or a callbacks queue itself, and it should not try.\n * The operator is the party that knows where each arm goes — one live\n * connection's backchannel, or the emitting node's *version* (#150) — so both are\n * stated in a form it can route and neither is dropped here.\n */\nfunction invocationHeaders(\n payload: CallbackObject,\n // The node this invocation is published FROM — the graph node whose message is\n // running right now. On both arms, and not part of the address: the operator\n // needs it only to name the invoking node in the record, and it says so here\n // because the record it used to be looked up in can already be gone. An\n // invocation carries no publish index (by design — `done` must not wait on its\n // slot), so nothing serialises it against the `done` of this very node, and a\n // bookkeeping miss used to discard the invocation itself (#147).\n //\n // Absent where the publisher genuinely cannot know it: a defer key minted\n // before #150 carries no node, and that path behaves exactly as it did.\n invokingNodeId: string | undefined,\n): {\n connectionId?: string\n callbackId?: string\n callbackName?: string\n callbackNodeId?: string\n invokingNodeId?: string\n} {\n return {\n ...(invokingNodeId ? { invokingNodeId } : {}),\n ...(payload.lifetime === 'connection'\n ? // The EMITTER's connection, not this one: on this arm the header names the\n // backchannel to deliver to.\n { connectionId: payload.sourceId, callbackId: payload.callbackId }\n : { callbackName: payload.name, callbackNodeId: payload.nodeId }),\n }\n}\n\n/**\n * The body of that publish: the consumer's argument, and — on the durable arm —\n * the data the emitting service bound to this reference beside it.\n *\n * `bound` makes the round trip through the invoking service because that is the\n * only place it exists: the operator never held it (a claim-checked emission is\n * opaque to it) and the emitting version is where it is going. It travels\n * VERBATIM, exactly as the emitter minted it — only `arg` goes through this\n * boundary, since only `arg` was written here.\n */\nfunction invocationPayload(payload: CallbackObject, arg: unknown): unknown {\n return payload.lifetime === 'connection' ? arg : { arg, bound: payload.bound }\n}\n\nfunction safeNack(channel: ConfirmChannel, message: ConsumeMessage) {\n try {\n channel.nack(message)\n } catch (error) {\n if (!isChannelClosedError(error)) {\n throw error\n }\n }\n}\n\nexport default function createConnection<V>(\n {\n url,\n version,\n prefetch = 1,\n silent = false,\n connectionTimeout,\n // Without a default this is `undefined` and amqp-connection-manager falls\n // back to 5s, which makes any event-loop stall >10s fatal to the connection.\n // Defaulted here rather than per service so every deployed service converges\n // on the same interval on its next release.\n heartbeatInterval = DEFAULT_AMQP_HEARTBEAT_SECONDS,\n connectionOptions,\n name,\n devOverlay = '',\n maxMessageSize,\n onConnectionStateChange,\n ...rest\n }: ConnectionOptions & { onConnectionStateChange?: ConnectionStateListener },\n messageHandler: MessageHandler<V>,\n) {\n const passthroughByteReferences =\n (rest as PrivilegedConnectionOptions).passthroughByteReferences ?? false\n // A property of the HANDLER, evaluated once at connection scope. Two\n // independent things are decided by it, so it is hoisted under its own name\n // rather than either of them borrowing the other's: whether a callback\n // registration can outlive the call that made it, and whether a CONTINUOUS run\n // holds a task slot. (Kept separate from the narrowing call in the consume\n // loop, whose job is to type the handler.)\n const isGeneratorHandler = isMessageHandlerGenerator(messageHandler)\n // A non-generator handler's result path already refuses callbacks: its\n // registry entries are deleted the moment the message settles, which for a\n // returning handler is immediately. Same rule for render props — this is the\n // one place it is decided, and it is a property of the handler, not of a\n // message.\n const canRegisterCallbacks = isGeneratorHandler\n // Minted BEFORE the connect so it can be announced in the client properties\n // alongside every other per-connection fact. A bare `crypto.randomUUID()` with\n // no inputs, so nothing about it depends on the connection existing yet.\n //\n // Once per `createAmqpConnection`, NOT per broker connection: this id survives\n // an amqp-connection-manager reconnect. (The Python SDK deliberately differs —\n // it mints per broker connection. Both give a correct join at any instant.)\n const connectionId = crypto.randomUUID()\n const baseQueue = `${url.username}@${version}`\n const queue = devOverlay\n ? `${baseQueue}-dev-overlay-${devOverlay}`\n : baseQueue\n const exchange = url.username\n const connection = connect(url.toString(), {\n connectionOptions: {\n ...connectionOptions,\n // Who we are, what we run, what we can decode — declared in the AMQP\n // connection frame so `ui/backend` knows it BEFORE the first dispatch.\n // amqp-connection-manager reuses these options on every reconnect, so\n // the announcement re-lands automatically. Merged LAST: the requence_*\n // keys are the contract and a caller may not shadow them.\n clientProperties: {\n ...connectionOptions?.clientProperties,\n ...buildServiceClientProperties({\n libVersion: libVersion(),\n serviceVersion: version,\n connectionId,\n prefetch,\n name,\n devOverlay: Boolean(devOverlay),\n }),\n },\n },\n heartbeatIntervalInSeconds: heartbeatInterval,\n })\n\n // amqp-connection-manager auto-reconnects, but without a listener a mid-\n // processing disconnect is completely silent: the raw amqplib channel that an\n // in-flight handler closed over is torn down, and the broker requeues every\n // unacked delivery. Surface it so the drop is at least observable.\n connection.on('disconnect', ({ err }: { err?: Error }) => {\n if (!silent && err) {\n logger.error('Requence AMQP connection lost:', err.message)\n }\n onConnectionStateChange?.({ connected: false, err })\n })\n\n // A reconnect fires 'connect' again, but the connectedPromise's listener has\n // already unsubscribed, so recovery was previously invisible. Track whether\n // we have connected before to distinguish the initial connect from a\n // reconnect: log the recovery (mirroring the loss above) and surface it so\n // the caller can flip its state back. Fires for the initial connect too;\n // callers treat `connected: true` idempotently.\n let hasConnected = false\n connection.on('connect', () => {\n if (hasConnected && !silent) {\n logger.info('Requence AMQP reconnected')\n }\n hasConnected = true\n onConnectionStateChange?.({ connected: true })\n })\n\n const connectedPromise = new Promise<void>((resolve, reject) => {\n const unsubscribe = () => {\n clearTimeout(timeout)\n connection.removeListener('connect', handleConnect)\n connection.removeListener('connectFailed', handleConnectFailed)\n }\n\n const timeout = setTimeout(() => {\n handleConnectFailed({\n err: new RequenceConnectionError('Requence connection timeout'),\n })\n }, connectionTimeout)\n\n const handleConnect = () => {\n unsubscribe()\n resolve()\n }\n\n const handleConnectFailed = ({ err }: { err: Error }) => {\n unsubscribe()\n if (\n err.message.startsWith(\n 'Handshake terminated by server: 403 (ACCESS-REFUSED)',\n )\n ) {\n reject(new RequenceConnectionError('Invalid service credentials'))\n } else {\n reject(err)\n }\n }\n\n connection.addListener('connect', handleConnect)\n connection.addListener('connectFailed', handleConnectFailed)\n })\n\n // The dev session this connection belongs to (#108), or `''` outside dev mode.\n //\n // What every surface this connection draws is stamped with, and what a rebuild\n // names to find them again. Scoped to the **session** rather than the\n // connection precisely so it survives the dev process being restarted: the\n // service, the version it overlays and the developer's token are all still the\n // same afterwards, so the surfaces drawn a moment before the restart are still\n // this session's.\n //\n // The token is hashed rather than carried, because this id comes to rest in\n // ui/backend's `task_surface` and a dev overlay key is a personal access token.\n // The service and version stay readable, which is what makes a stored session\n // id diagnosable at all.\n const devSession = devOverlay\n ? `${baseQueue}#${createHash('sha256').update(devOverlay).digest('hex').slice(0, 16)}`\n : ''\n // Derived from the queue this connection actually consumes, overlay suffix\n // included — NOT from the base name. The operator builds the routing key as\n // `service-<node.name>@<node.version>-backchannel-<connectionId>`, and in a\n // dev session ui/backend has rewritten that node's version to\n // `<version>-dev-overlay-<devKey>` (which is how the dispatch reaches this\n // worker in the first place). Anchoring to the base name instead made every\n // inbound backchannel message of a dev-mode service unroutable — the `stop`\n // that terminates a CONTINUOUS generator and, since surfaces, every callback\n // invocation. The unroutable publish then came back through the alternate\n // exchange and was read as a dead connection, so a click on a perfectly live\n // surface killed it (D5's detect-on-interaction, on a false premise).\n const backchannelQueue = `${queue}-backchannel-${connectionId}`\n // Components whose source has already left this connection, keyed\n // `<taskId>:<hash>`. ui/backend stores bundles hash-addressed and that row\n // outlives every render, so only the first render of a component **into a\n // given task** carries the ≤1 MiB source; later ones carry the hash alone.\n // There is no channel to ask ui/backend what it already has (D16: an unknown\n // hash-only render is an error state), so this set is the whole answer.\n //\n // The task is in the key, and not just the hash, because bundle retention is\n // per-task (D19): the last-referent sweep removes a bundle once NO task\n // references it, and a worker that stays connected for days can outlive every\n // task that referenced its component. Keyed by hash alone, every later render\n // from that connection would carry the hash of a bundle nobody stores —\n // permanently, self-healing only on reconnect, with nothing in the retention\n // path able to fix it (at the moment of the sweep the bundle genuinely has no\n // referents). Keyed by task, the first render into any task always carries the\n // source, so the state the sweep can produce is exactly the state a fresh key\n // repairs. It costs one ≤1 MiB transfer per task per component rather than one\n // per connection.\n //\n // Residual, accepted with D16: this records that the source was *published*,\n // not that it was ingested. If the operator discards that render (a\n // superseded epoch after a re-dispatch), a later render of the same component\n // into the same task carries no source and its surface stays an error state\n // until the process reconnects.\n const sentComponents = new Set<string>()\n const generatorTerminators = new Map<string, (reason: string) => void>()\n // Each registry entry keeps the invocation dispatcher of the message that\n // registered the callback. Entries are deleted when that message settles,\n // so a stored dispatcher is live exactly as long as its callback is — this\n // is what lets a nested function in a callback argument reconstruct as\n // invokable (chaining): its invocations egress through the registering\n // message's context (results stream → operator → peer backchannel).\n const callbacks = new Map<\n string,\n {\n callback: (...args: any[]) => void\n onCallbackInvoke: CallbackIngressContext['onCallbackInvoke']\n }\n >()\n\n // What tells an author their registry is growing, and which `yield` is doing\n // it (#151). Connection-scoped because one of its two counters is: a worker\n // holding fifty tasks at nine hundred callbacks each is the case no single\n // delivery can see. `callbacks.size` rather than a count of its own, so\n // rendered handler props — the same registry, the same growth — are in it.\n const callbackGrowth = createCallbackGrowthWatch({\n service: baseQueue,\n devOverlay: Boolean(devOverlay),\n connectionCount: () => callbacks.size,\n // The service's own log, like every other author mistake in this file. Not a\n // task update: the only person who can fix this is the one writing the\n // service, and they are reading this process's output.\n warn: (text) => logger.warn(text),\n })\n\n // Backchannel ingress (concept invariant 2): a callback argument was\n // egress-transformed by the invoking side (files/streams → references,\n // oversized values → claim-checks), so it must rehydrate here before\n // reaching user code. Connection-scoped: the callback owner is typically a\n // CONTINUOUS service whose lifetime differs from any single message, so no\n // per-message signal applies. `onCallbackInvoke` is supplied per call from\n // the registry entry, so nested functions reconstruct invokable.\n // Passthrough consumers (the logic runtime's guest channel) keep byte/callback\n // references raw here too — claim-checks still resolve, but files/streams/\n // callbacks reach the registered callback as their JSON-safe wire objects so\n // they can cross the guest's process boundary.\n const backchannelInbound = createInboundBoundary(\n passthroughByteReferences\n ? { transformer: passthroughInboundTransformer }\n : {},\n )\n\n const channelWrapper = connection.createChannel({\n async setup(channel: ConfirmChannel) {\n if (devOverlay) {\n await channel.assertQueue(queue)\n await channel.bindQueue(queue, 'service', queue)\n }\n await channel.checkExchange(exchange)\n await channel.checkExchange(`${exchange}-retry`)\n await channel.checkQueue(queue)\n await channel.prefetch(prefetch)\n\n await channel.assertQueue(backchannelQueue, {\n exclusive: true,\n })\n\n await channel.bindQueue(backchannelQueue, 'service', backchannelQueue)\n\n await channel.consume(\n backchannelQueue,\n async (message) => {\n const result = backchannelMessageSchema.safeParse(message)\n\n if (!result.success) {\n return\n }\n\n const backchannelMessage = result.data\n\n switch (backchannelMessage.payload.type) {\n case 'stop': {\n generatorTerminators.get(backchannelMessage.messageId)?.(\n 'task stopped',\n )\n break\n }\n case 'callback': {\n const { surface } = backchannelMessage.payload\n const { taskId } = backchannelMessage\n // Reportable only when both halves are here: an interaction names\n // the surface it came from, and a report needs the task to be\n // routed. A peer callback names neither, and its failures belong to\n // its own live message.\n const report =\n surface && taskId\n ? (message: string) =>\n reportInteractionFailure({ taskId, surface, message })\n : () => {}\n\n const entry = callbacks.get(backchannelMessage.payload.callbackId)\n if (!entry) {\n // Said out loud rather than dropped (#106). This is where a\n // connection-bound surface handler lands, and an entry that is\n // gone means the message that registered it has settled — so the\n // click behind it did nothing and nobody was told. Unconditional\n // for the reason the durable arm's misses are: `silent`\n // suppresses connection noise, not a lost interaction. There is\n // no request left to fail (the mutation returned *accepted* long\n // before) and no failure channel here — the backchannel consumes\n // with noAck, outside any message context. For an *interaction*\n // there is now one more place to put it (#107): the surface.\n logger.warn(\n `Requence: dropped an invocation of callback |${backchannelMessage.payload.callbackId}| — nothing is registered under it, so the message that registered it has settled`,\n )\n report(\n 'the process that drew this surface has finished with it, so nothing ran the handler',\n )\n break\n }\n let arg: unknown\n try {\n arg = await backchannelInbound(backchannelMessage.payload.arg, {\n onCallbackInvoke: entry.onCallbackInvoke,\n })\n } catch (error) {\n // The backchannel consumes with noAck and outside any message\n // context, so a failed rehydration has no failure channel.\n // Never hand user code a raw reference — log and drop the\n // invocation instead.\n logger.warn(\n `dropped callback invocation |${backchannelMessage.payload.callbackId}|: argument rehydration failed`,\n error instanceof Error ? error.message : error,\n )\n report(\n 'the interaction could not be delivered: its argument could not be read',\n )\n break\n }\n try {\n // Awaited so an async handler's rejection is caught here rather\n // than becoming an unhandled rejection in the consume callback —\n // which, `noAck` and outside any message context, was the one way\n // a thrown handler could take the whole process down.\n await entry.callback(arg)\n } catch (error) {\n logger.error(\n `Requence: callback |${backchannelMessage.payload.callbackId}| threw:`,\n error instanceof Error\n ? (error.stack ?? error.message)\n : error,\n )\n report(`the handler failed: ${errorText(error)}`)\n }\n break\n }\n }\n },\n {\n noAck: true,\n },\n )\n },\n })\n\n // ChannelWrapper is an EventEmitter; an unhandled 'error' would otherwise\n // propagate. Observe it rather than letting it surface as an uncaught error.\n channelWrapper.on('error', (err: Error) => {\n if (!silent) {\n logger.error('Requence AMQP channel error:', err.message)\n }\n })\n\n /**\n * Say on the surface that this process could not run an interaction (#107).\n *\n * The only feedback channel an interaction has once it has been accepted. The\n * mutation behind a click returns *accepted* long before the invocation reaches\n * here — for a durable handler, possibly a redeploy before — so there is no\n * request to fail, no message to abort, and for a durable handler no connection\n * the viewer ever had. What is left is the surface itself, which the viewer is\n * still looking at.\n *\n * Published on the ordinary result exchange with a marker header and **no**\n * correlation id or index: a handler invocation is not a dispatch of the\n * operator's, so it has no message to be a result FOR, which is exactly why the\n * operator answers this header before everything else on that path.\n *\n * Fire-and-forget, and never fatal: this is the report of a failure, and a\n * failure to report it must not become a second one. Unconditional, `silent`\n * included, for the reason every miss here is logged unconditionally — `silent`\n * suppresses connection noise, not a lost interaction.\n */\n const reportInteractionFailure = (params: {\n taskId: string\n surface: string\n message: string\n }) => {\n void channelWrapper\n .publish(\n exchange,\n '',\n Buffer.from(\n JSON.stringify({\n surface: params.surface,\n // Truncated at the source as well as in the update schema: what keeps\n // this publish bounded is the cut made before it, and a thrown error's\n // message is author text of no bounded length.\n message: params.message.slice(\n 0,\n MAX_SURFACE_INTERACTION_ERROR_CHARS,\n ),\n }),\n ),\n {\n contentType: 'application/json',\n persistent: true,\n headers: {\n taskId: params.taskId,\n [SURFACE_INTERACTION_ERROR_HEADER]: true,\n },\n },\n )\n .catch((error: unknown) => {\n logger.error(\n `Requence: could not report a failed surface interaction on |${params.surface}|:`,\n error instanceof Error ? error.message : error,\n )\n })\n }\n\n /**\n * The dev loop (#108): a rebuilt component is a **bundle swap**, not a render.\n *\n * A rebuild changes which bytes the frame imports and nothing else, so nothing\n * about the render that drew a surface is an input here — not its props, not\n * its handlers, not whether the message that published it is still unsettled.\n * That last one is what the re-issue this replaced could never get past: a\n * deferring handler returns at the defer, taking its callback registry with it,\n * so a deferred form could not be iterated on without starting a new task for\n * every edit. Now the notice names the session and the component, ui/backend\n * repoints the rows, and every surface — a live panel, a deferred form, one\n * on a task that finished last week — swaps identically.\n *\n * Published on the ordinary result exchange with a marker header and **no**\n * correlation id, index or task: a rebuild is not a result for any dispatch of\n * the operator's, which is why the operator answers this header before it looks\n * for either.\n *\n * Fire-and-forget and never fatal, like the failure report above: the dev loop\n * is an addition to a running service, not a reason for one to fall over.\n */\n const publishBundleSwap = (ui: MutableRequenceUI) => {\n const swap: UiRebuild = {\n devSession,\n uiId: ui.id,\n hash: ui.hash,\n // Always, unlike a render's: this hash is new to everyone by definition,\n // and the surfaces this repoints are exactly the ones that would otherwise\n // name a bundle nobody stored.\n source: ui.source,\n }\n\n void channelWrapper\n .publish(exchange, '', Buffer.from(JSON.stringify(swap)), {\n contentType: 'application/json',\n persistent: true,\n headers: { [UI_REBUILD_HEADER]: true },\n })\n .then(() => {\n if (!silent) {\n logger.info(\n `Requence: component |${ui.id}| rebuilt (${ui.hash.slice(0, 12)}) — swapped on every surface of this dev session`,\n )\n }\n })\n .catch((error: unknown) => {\n logger.error(\n `Requence: could not publish the rebuild of |${ui.id}|:`,\n error instanceof Error ? error.message : error,\n )\n })\n }\n\n // Only a dev-mode connection turns the watch on; `createUI` itself registers\n // unconditionally and starts nothing.\n const stopUIWatch = devSession\n ? watchUIRebuilds({\n onRebuild: publishBundleSwap,\n // The watch is process-global; `silent` is this connection's. It\n // reports, we decide.\n onWarning: (warning) => {\n if (!silent) {\n logger.warn(warning)\n }\n },\n })\n : undefined\n\n /**\n * Runs one durable handler invocation (#103): resolve `(uiId, path)` against\n * the components this process registered at module scope, and call the\n * function sitting there in that UI's default props.\n *\n * No context is injected, deliberately — a durable handler reaches whatever it\n * needs (`service.act()`, its own stores) through its own closure, which is\n * the same closure a module-scope function has in any other process of this\n * version. That is what \"durable\" means here.\n *\n * Every miss is **said out loud** rather than dropped: the click that produced\n * it is long gone, the mutation behind it returned *accepted*, and this\n * process is the only party that can tell an author their component named\n * something that does not exist. Unconditional, `silent` included: `silent`\n * suppresses connection noise, not a lost interaction.\n *\n * And every miss that can name a surface is also **recorded on it** (#107),\n * which is the half a viewer can see: this process's stderr is nowhere near the\n * person who pressed the button, least of all for the case that motivated it — a\n * durable handler running minutes later, in an instance the viewer never had a\n * connection to. A malformed payload is the one exception, and necessarily: it\n * is the only miss that cannot say which surface it was for.\n */\n const runHandlerInvocation = async (raw: unknown) => {\n const parsed = surfaceHandlerInvocationSchema.safeParse(raw)\n if (!parsed.success) {\n logger.error(\n 'Requence: dropped a malformed surface handler invocation:',\n parsed.error.message,\n )\n return\n }\n const { taskId, surface, uiId, path, arg } = parsed.data\n const where = `UI |${uiId}| prop |${path.join('.') || '<root>'}| (task |${taskId}|)`\n const report = (message: string) =>\n reportInteractionFailure({ taskId, surface, message })\n\n const ui = findUIById(uiId)\n if (!ui) {\n logger.error(\n `Requence: no component registered as |${uiId}| — dropped a handler invocation for ${where}`,\n )\n report(\n `the service has no component registered as \"${uiId}\", so nothing ran the handler`,\n )\n return\n }\n\n // Resolved against the DEFAULTS, because that is the only place a durable\n // handler can have been written: a function in a render's own props closes\n // over that render's process and never gets a durable reference. An empty\n // path would name the defaults object itself, which is never a function.\n const handler: unknown = getByPath(\n ui.defaults as Record<string, unknown> | undefined,\n path,\n )\n if (typeof handler !== 'function') {\n logger.error(\n `Requence: no handler at ${where} — the component's defaults have ${\n handler === undefined ? 'nothing' : typeof handler\n } there`,\n )\n report(\n `this component has no handler at \"${path.join('.') || '<root>'}\", so nothing ran`,\n )\n return\n }\n\n try {\n await (handler as (value: unknown) => unknown)(arg)\n } catch (error) {\n // Caught here rather than left to the consumer's own catch, which is one\n // frame too far out to know which surface this was: the *report* needs the\n // parsed invocation. Rethrown so that frame still logs the stack and acks.\n report(`the handler failed: ${errorText(error)}`)\n throw error\n }\n }\n\n // The per-version handler queue, consumed alongside the dispatch queue and on\n // a channel of its own: a durable invocation is not a dispatch, and sharing\n // the dispatch channel would put it behind that channel's prefetch — so one\n // long-running LINEAR message would stall every click on the version.\n //\n // Competing consumers by design: a durable handler belongs to the service\n // VERSION, so whichever instance is free serves it, and an invocation with no\n // instance running waits in the queue instead of being lost.\n const handlerQueue = serviceHandlerQueueName(queue)\n const handlerChannelWrapper = connection.createChannel({\n async setup(channel: ConfirmChannel) {\n // Asserted rather than checked, unlike the dispatch queue: ui/backend's\n // provisioner asserts it too (which is what makes it exist BEFORE any\n // instance runs, so an invocation can wait out a redeploy), but a service\n // must not fail to start against a broker whose version assert has not\n // caught up. Both sides declare the same shared literal, because a\n // mismatch is a 406 that kills this channel. In a dev session the queue is\n // this overlay's own, so nobody else asserts it at all, and these\n // arguments are the only ones it ever gets.\n //\n // The TTL is what stops the queue being a mailbox (#116): an invocation\n // nobody consumes expires instead of running whenever someone next\n // deploys, and dead-letters back to the operator so the viewer is told.\n await channel.assertQueue(handlerQueue, SURFACE_HANDLER_QUEUE_ARGUMENTS)\n await channel.bindQueue(handlerQueue, 'service', handlerQueue)\n await channel.prefetch(prefetch)\n await channel.consume(handlerQueue, async (message) => {\n if (!message) {\n return\n }\n try {\n await runHandlerInvocation(JSON.parse(message.content.toString()))\n } catch (error) {\n // A throwing handler is the author's bug and there is no request left\n // to fail (#107 puts it back on the surface). Reported and acked: a\n // requeue would rerun a side-effecting handler forever.\n logger.error(\n 'Requence: surface handler threw:',\n error instanceof Error ? (error.stack ?? error.message) : error,\n )\n }\n safeAck(channel, message)\n })\n },\n })\n\n /**\n * Runs the callback a durable invocation names (#147).\n *\n * It is given the bound data, the graph's argument and the node's static\n * configuration, and nothing else — no message, no connection, no task\n * context. That is the whole of what makes it durable: this instance may have\n * been started long after the one that emitted the reference exited.\n */\n async function runDurableCallbackInvocation(payload: unknown) {\n const parsed = durableCallbackInvocationSchema.safeParse(payload)\n if (!parsed.success) {\n // Unconditional, like the misses below: `silent` suppresses connection\n // noise, not an invocation nobody will ever hear about again.\n logger.error(\n 'Requence: dropped a malformed durable callback invocation — it does not name a callback this build can run',\n )\n return\n }\n\n const { name, bound, arg, configuration, taskId, nodeId } = parsed.data\n const registration = findDurableCallback(name)\n if (!registration) {\n // Loud, and it says which run is affected: there is no request left to\n // fail — the graph called the callback and moved on — so the only way this\n // is ever seen is if somebody says it. A name that resolves to nothing is\n // a deployed version that no longer declares what an emitted reference\n // names, which is exactly the case worth hearing about.\n throw new Error(\n `no durable callback registered as \"${name}\" — a reference naming it was emitted by node ${nodeId} of task ${taskId}, and this version declares none`,\n )\n }\n\n await registration.handler(\n arg,\n durableCallbackContext(name, bound, configuration),\n )\n }\n\n // The per-version callbacks queue, alongside the handler queue and for the\n // same reasons (#147): its own channel, so a durable invocation never queues\n // behind a long-running LINEAR dispatch; competing consumers, so whichever\n // instance of the version is free serves it; and a queue rather than a live\n // connection, so an invocation waits out a redeploy instead of dying with the\n // process that emitted the reference.\n const callbackQueue = serviceCallbackQueueName(queue)\n const callbackChannelWrapper = connection.createChannel({\n async setup(channel: ConfirmChannel) {\n // Asserted, not checked, and from the literal both parties share — see the\n // handler queue above: the provisioner's assert is what makes the queue\n // exist before any instance runs, this one is what keeps a service\n // startable against a broker that assert has not reached, and a mismatch\n // between the two is a 406 that kills this channel.\n await channel.assertQueue(callbackQueue, DURABLE_CALLBACK_QUEUE_ARGUMENTS)\n await channel.bindQueue(callbackQueue, 'service', callbackQueue)\n await channel.prefetch(prefetch)\n await channel.consume(callbackQueue, async (message) => {\n if (!message) {\n return\n }\n try {\n await runDurableCallbackInvocation(\n JSON.parse(message.content.toString()),\n )\n } catch (error) {\n // Acked either way: a requeue would rerun a side-effecting callback\n // forever, and a callback is the one thing a graph asked for\n // explicitly.\n logger.error(\n 'Requence: durable callback threw:',\n error instanceof Error ? (error.stack ?? error.message) : error,\n )\n }\n safeAck(channel, message)\n })\n },\n })\n\n callbackChannelWrapper.on('error', (err: Error) => {\n if (!silent) {\n logger.error('Requence AMQP callback channel error:', err.message)\n }\n })\n\n handlerChannelWrapper.on('error', (err: Error) => {\n if (!silent) {\n logger.error('Requence AMQP handler channel error:', err.message)\n }\n })\n\n const publish = ({\n data,\n outputName,\n messageId,\n priority,\n ...headers\n }: {\n index: number\n data?: unknown\n outputName?: string | null\n messageId: string\n taskId: string\n priority?: number\n version: string\n debugMethod?: 'log' | 'warn' | 'info' | 'error'\n debug?: boolean\n // Marks a `context.render` payload (component + props + surface). Like\n // `debug`, it is a side-channel the operator forwards as a task update\n // rather than graph output — but it rides the ordered dispatch buffer, so\n // two renders of one surface can never be re-ordered into a stale one.\n render?: boolean\n connectionId?: string\n callbackId?: string\n // The durable arm's address (#150): the declared name and the node whose\n // version serves it, in place of the connection pair above. The operator\n // routes on which of the two is present.\n callbackName?: string\n callbackNodeId?: string\n // Which node published an invocation — see `invocationHeaders`. Not an\n // address: it is what lets the operator name the invoking node without a\n // message record that may already be gone.\n invokingNodeId?: string\n propertyPath?: (string | number)[]\n begin?: boolean\n deferred?: boolean\n done?: boolean\n // Privileged result protocol: `overwrite` marks a data message whose\n // value replaces (instead of merges into) downstream aggregation. The\n // operator honors it only for privileged nodes. Flows through via\n // `...headers`.\n overwrite?: boolean\n // Per-attempt id: identifies this consume-handler invocation so the\n // operator can fence a superseded attempt's stragglers on the same\n // messageId. Flows through via `...headers`.\n epoch?: string\n // Who ran this node, stamped on the `begin` publish ONLY (see\n // `buildServiceIdentityHeaders`). The operator freezes these into the\n // NODE_START update; they are display-only and nothing branches on them.\n libVersion?: string\n serviceName?: string\n capabilities?: string\n // `'1'` / `'0'`, always present on a begin publish: does this run occupy one\n // of the dispatch channel's prefetch slots? Never omitted, so \"holds no\n // slot\" cannot be read as \"too old to report\".\n holdsSlot?: string\n }) => {\n const { body, contentType } = encodeWireBody(\n data ?? null,\n messageCodecs.get(messageId) ?? 'json',\n )\n\n // Guard the body size before it hits the broker. An oversized publish makes\n // RabbitMQ drop the whole connection, which amqplib reports as a generic\n // \"channel closed\" for every in-flight message — impossible to attribute to\n // size after the fact. Rejecting here yields a precise, catchable error and\n // leaves the connection intact for other messages.\n if (body.byteLength > maxMessageSize) {\n return Promise.reject(\n new PayloadTooLargeError(body.byteLength, maxMessageSize),\n )\n }\n\n return channelWrapper.publish(exchange, '', body, {\n correlationId: messageId,\n contentType,\n persistent: true,\n priority,\n headers: {\n outputName: outputName ?? null,\n connectionId,\n ...headers,\n },\n })\n }\n\n /**\n * Everything a publish on behalf of one message needs, and the whole of what\n * differs between the two publish paths — the main path's consume handler and an\n * `act()` call. Shared by {@link buildSendApi} and {@link buildRender} so the\n * two cannot drift apart: they publish for the same message, through the same\n * boundary, on the same index counter.\n *\n * `epoch`/`priority` are main-path-only (an `act()` call is not a consume\n * attempt) and are omitted from the published headers when absent, keeping the\n * deferred path's output byte-identical to what it always was.\n */\n type PublishDeps = {\n outbound: OutboundBoundary\n registerCallback: (\n callback: (...args: any[]) => void,\n // Where the function was written, for the growth warning (#151) — the\n // walk's path for a callback, the payload path for a handler prop.\n path: ReadonlyArray<string | number>,\n ) => {\n sourceId: string\n callbackId: string\n }\n taskId: string\n messageId: string\n nextIndex: () => number\n epoch?: string\n priority?: number\n // act() only: wait for the deferring message's own processing to finish.\n gate?: () => Promise<void>\n }\n\n // The privileged send API (unit 05 headers), shared by the main-path handler\n // context and act()'s ActorApi: imperative data publishes through the\n // caller's outbound boundary, enrolled in its ledger so `settle()` gates the\n // done marker on them — a final emission mechanically flushes before `done`.\n const buildSendApi = (deps: PublishDeps) => {\n const base = {\n ...(deps.epoch === undefined ? {} : { epoch: deps.epoch }),\n ...(deps.priority === undefined ? {} : { priority: deps.priority }),\n }\n return {\n async sendToOutput(\n outputName: string,\n data: unknown,\n options?: { overwrite?: boolean },\n ) {\n await deps.gate?.()\n deps.outbound.track(\n publish({\n index: deps.nextIndex(),\n version,\n messageId: deps.messageId,\n taskId: deps.taskId,\n data: await deps.outbound.send(data, {\n outputName: outputName as string | null,\n onCallback: deps.registerCallback,\n }),\n outputName: outputName as string | null,\n // only set when requested — omitted publishes stay identical\n ...(options?.overwrite ? { overwrite: true } : {}),\n ...base,\n }),\n )\n },\n async send(data: unknown, options?: { overwrite?: boolean }) {\n await deps.gate?.()\n deps.outbound.track(\n publish({\n index: deps.nextIndex(),\n version,\n messageId: deps.messageId,\n taskId: deps.taskId,\n data: await deps.outbound.send(data, {\n outputName: null,\n onCallback: deps.registerCallback,\n }),\n ...(options?.overwrite ? { overwrite: true } : {}),\n ...base,\n }),\n )\n },\n }\n }\n\n // The render publish, shared by `context.render` on the main path and\n // `send.render` inside `act()` (#70). Everything that differs between the two\n // paths is a dep — the index counter, the callback registrar, the attempt\n // headers, and act()'s gate on the deferring message's own processing — so a\n // surface behaves identically whoever published it, which is what makes the\n // dev loop, the hash bookkeeping and the liveness rule path-agnostic.\n const buildRender = (deps: PublishDeps) => {\n /**\n * One function prop → one handler reference (#103). The **path decides the\n * lifetime**, because the path is where the function was written:\n *\n * - `defaults.*` — module scope. Any instance of this version can run it,\n * now or after a redeploy, so the reference names only the UI and the prop\n * and the invocation goes to the version's handler queue. Nothing is\n * registered here: there is nothing to keep alive, and that is the point.\n * - `props.*` — written at this render call, closing over the running\n * handler. Only this process can run it, so it registers in the publishing\n * message's own registry and dies with it, exactly as a callback does —\n * including the refusal on a LINEAR handler, whose registry entries are\n * gone the moment it returns.\n *\n * The path the reference carries is relative to the **props the component\n * receives**, not to the payload: the two layers fold into one object at\n * ingestion (#102), and the browser names a path in what it was served.\n */\n const registerSurfaceHandler = (\n ui: RequenceUI,\n handler: (...args: unknown[]) => void,\n payloadPath: ReadonlyArray<string | number>,\n ): SurfaceHandlerObject => {\n const [layer, ...path] = payloadPath\n if (layer === 'defaults') {\n return {\n __REQUENCE_type: SURFACE_HANDLER_TAG,\n lifetime: 'durable',\n uiId: ui.id,\n path,\n }\n }\n if (layer !== 'props') {\n // Only the two author-supplied layers can hold a function; anything\n // else is the SDK's own payload and a function there is a bug here.\n throw new Error(\n `a function in a render payload is only a handler under props or defaults (found at \"${payloadPath.join('.')}\")`,\n )\n }\n // Counted like a callback, under its full payload path: it is the same\n // registry and the same growth, and a render in a loop is the same mistake.\n // The `props.` prefix is what tells the author it was a handler prop (#151).\n const { sourceId, callbackId } = deps.registerCallback(\n handler,\n payloadPath,\n )\n return {\n __REQUENCE_type: SURFACE_HANDLER_TAG,\n lifetime: 'connection',\n uiId: ui.id,\n path,\n connectionId: sourceId,\n handlerId: callbackId,\n }\n }\n\n const renderSurface = (params: {\n ui: RequenceUI\n props: unknown\n surfaceId: string\n }): void => {\n // The index is taken NOW, not when the serialization resolves: the\n // operator dispatches a message's results in index order, so\n // allocating here is what makes two renders of one surface arrive\n // in call order. The cost is a hole in the buffer if the\n // serialization fails — moot for a message that settles: the publish is\n // tracked, so the same failure fails the node at the caller's settle gate.\n const index = deps.nextIndex()\n // Per (task, component), never per component: see `sentComponents`. The\n // hash is read at call time, not at registration, because the dev loop\n // rewrites it in place (D10).\n const sentKey = `${deps.taskId}:${params.ui.hash}`\n const withSource = !sentComponents.has(sentKey)\n if (withSource) {\n sentComponents.add(sentKey)\n }\n\n const issue = () =>\n deps.outbound\n .send(\n {\n // `id` rides along on every render, source-carrying or not: it is\n // what a dev-loop bundle swap addresses the surface by (#108), and\n // the surface row it lands on is last-write-wins.\n component: withSource\n ? {\n id: params.ui.id,\n hash: params.ui.hash,\n source: params.ui.source,\n }\n : { id: params.ui.id, hash: params.ui.hash },\n props: params.props,\n // Restated on every render, and deliberately NOT merged into the\n // props above (#102): the receiver folds them *under* the surface's\n // stored props, so a default is overridden by anything any render\n // of that surface ever said, while this render's props override\n // everything. Merging here — what #101 did — would collapse the two\n // ranks into one and let a default clobber an earlier override.\n //\n // Read off the handle at call time, like the hash, so the next\n // render after a rebuild carries whatever it changed them to.\n // Omitted entirely when the component declared none, keeping that\n // payload byte-identical to what it always was.\n ...(params.ui.defaults === undefined\n ? {}\n : { defaults: params.ui.defaults }),\n surfaceId: params.surfaceId,\n // Stamped on every surface this connection draws, so a rebuild can\n // find them again and repoint them (#108) — and find only them: a\n // developer's edit must never reach a production surface of the\n // same component. `null` outside a dev overlay, which is every\n // render a deployed service makes.\n devSession: devSession || null,\n },\n {\n outputName: null,\n // The claim-check may offload an oversized render — but\n // never the bundle: the operator parses `component.hash`\n // out of the body, so a reference there is unreadable.\n // Pinned rather than left to the sizes falling the right\n // way (props larger than the ≤1 MiB source), which only\n // holds while the task's threshold is the 4 MiB default.\n //\n // `defaults` is pinned because it is the base layer of the\n // surface's fold — offloaded, it would silently take every prop\n // the service never restates out of the surface, and every\n // durable handler with them. `props` stays the only candidate,\n // which is what makes an oversized render a named error state\n // rather than a broken surface.\n inlineKeys: ['component', 'defaults'],\n // Switches this send onto the render egress chain, where a\n // function is a surface handler rather than a peer callback\n // (#103). Which of the two lifetimes it gets is decided by where\n // it was written, which the walk reports as the path.\n onSurfaceHandler: (handler, path) =>\n registerSurfaceHandler(params.ui, handler, path),\n },\n )\n .then((data) =>\n publish({\n index,\n version,\n messageId: deps.messageId,\n taskId: deps.taskId,\n data,\n render: true,\n // Omitted rather than passed as `undefined` when absent, so\n // act()'s publishes keep the header set they always had.\n ...(deps.priority === undefined\n ? {}\n : { priority: deps.priority }),\n ...(deps.epoch === undefined ? {} : { epoch: deps.epoch }),\n }),\n )\n\n // The gate is awaited before the payload is built, never before the index\n // is taken — the slot has to be reserved in call order even when the\n // publish itself has to wait.\n const gated = deps.gate?.()\n deps.outbound.track(\n (gated ? gated.then(issue) : issue()).catch((error: unknown) => {\n // The source never left, so the next render of this component into\n // this task must carry it again — otherwise ui/backend would receive a\n // hash it has never seen and show an error state.\n if (withSource) {\n sentComponents.delete(sentKey)\n }\n throw error\n }),\n )\n }\n\n return renderSurface\n }\n\n channelWrapper.addSetup(async (channel: ConfirmChannel) => {\n channel.consume(queue, async (message) => {\n if (!message) {\n return\n }\n\n let publishIndex = 0\n let acked = false\n let terminated = false\n const registeredCallbackIds = new Set<string>()\n let resolveActiveMessage = () => {}\n // Captured for the finally block; header parsing now happens inside the\n // try so a malformed header goes through the error handling below instead\n // of throwing out of this async consumer as an unhandled rejection.\n let messageIdForCleanup: string | undefined\n // One epoch per consume-handler invocation (declared out here so the\n // catch-branch republishes can stamp it too). On redelivery/reconnect a\n // second invocation gets a fresh epoch, letting the operator tell the\n // attempts apart and fence the superseded one.\n const epoch = crypto.randomUUID()\n\n try {\n const { messageId, taskId, mode } = headerSchema.parse(message)\n messageIdForCleanup = messageId\n\n // The capability gate, ahead of everything the dispatch could ask of\n // this build — including its own decoding. A requirement stated in the\n // body would be unreadable exactly when it matters, so it rides in the\n // headers and is checked here, before `payloadSchema` touches the bytes.\n //\n // An empty requirement (every message published before this existed)\n // passes untouched.\n const unsupported = unsupportedCapabilities(\n readRequiredCapabilities(message.properties.headers),\n )\n if (unsupported.length > 0) {\n throw new UnsupportedCapabilityError(unsupported)\n }\n\n // Recorded before anything can publish, so every reply on this message —\n // including one from an error path — echoes the codec it arrived under.\n const dispatchCodec = wireCodecFromContentType(\n message.properties.contentType,\n )\n messageCodecs.set(messageId, dispatchCodec)\n\n let deferred = false\n let deferredReason: string | null = null\n\n const messageExecution = Promise.withResolvers<void>()\n activeMessages.set(messageId, messageExecution.promise)\n messageExecution.promise.then(() => {\n activeMessages.delete(messageId)\n })\n resolveActiveMessage = () => {\n messageExecution.resolve()\n }\n\n const payload = payloadSchema.parse(message)\n\n // The per-message abort controller is hoisted out of\n // createContextHelper so the outbound boundary can share its signal.\n const abortController = new AbortController()\n\n // Names the run in the warning (#151), so an author with several tasks\n // open knows which one to go and look at.\n const growth = callbackGrowth.forDelivery({ taskId })\n\n // One callback registrar for every egress sub-path (result, deferred\n // send, callback arg). Registered callbacks carry this message's\n // dispatcher so nested functions in their invocation arguments\n // reconstruct invokable (chaining).\n const registerCallback = (\n callback: (...args: any[]) => void,\n path: ReadonlyArray<string | number>,\n ) => {\n const callbackId = crypto.randomUUID()\n registeredCallbackIds.add(callbackId)\n callbacks.set(callbackId, {\n callback,\n onCallbackInvoke: dispatchInvocation,\n })\n // After the entry is in, so the connection count the warning states is\n // the number this process is holding. Never refuses and never evicts:\n // a cap kills a legitimate long-lived handle at an arbitrary number\n // that nobody can set correctly.\n growth.record(path)\n return { sourceId: connectionId, callbackId }\n }\n\n // The component's single outbound boundary: owns ctx construction,\n // the background-upload ledger (done-gate) and the fail policy.\n // Fail-hard sends surface via outbound.settle() before the done\n // marker + ack; best-effort (log) sends degrade to warnings.\n const outbound = createOutboundBoundary({\n uploadUrl: payload.options.uploadUrl,\n streamUrl: payload.options.streamUrl,\n maxPayloadSize: payload.options.maxPayloadSize,\n maxFileSize: payload.options.maxFileSize,\n // What a durable callback reference emitted on this message is\n // addressed by (#150).\n nodeId: payload.nodeId,\n // Replies echo the dispatch codec, so the claim-check must measure\n // with it too — measured size == published size.\n wireCodec: dispatchCodec,\n signal: abortController.signal,\n warn: (msg, error) =>\n logger.warn(\n `${msg} (task ${taskId})`,\n error instanceof Error ? error.message : (error ?? ''),\n ),\n })\n\n // This message's single invocation egress: callback arguments are\n // real node output (they carry an outputName), so they go through the\n // same boundary as results — nested files offload, nested functions\n // become callbacks. The send + publish are tracked in the boundary's\n // ledger, so a failure fails the task at the settle gate. Used both\n // for callbacks arriving in this message's input (via\n // createContextHelper) and for callbacks this message registers\n // (chained invocations dispatched from the backchannel).\n const dispatchInvocation = (\n invocation: CallbackObject & { arg: unknown },\n ) => {\n outbound.track(\n outbound\n .send(invocation.arg, {\n outputName: invocation.outputName,\n onCallback: registerCallback,\n })\n .then((data) =>\n publish({\n index: 0,\n version,\n taskId,\n messageId,\n data: invocationPayload(invocation, data),\n outputName: invocation.outputName,\n propertyPath: invocation.propertyPath,\n ...invocationHeaders(invocation, payload.nodeId),\n epoch,\n }),\n ),\n )\n }\n\n // This message's publish context: one index counter, one boundary, one\n // attempt. Shared by the privileged send API below and by the render.\n const publishDeps: PublishDeps = {\n outbound,\n registerCallback,\n taskId,\n messageId,\n nextIndex: () => publishIndex++,\n epoch,\n priority: message.properties.priority,\n }\n\n const onRender = buildRender({\n ...publishDeps,\n // The one deliberate difference on this path: a function written at\n // the render call becomes a reference to THIS message's registry, so\n // it is live exactly as long as the message — and a non-generator\n // handler cannot hold one at all, because its registry entries go the\n // moment it returns.\n //\n // A function in the UI's DEFAULTS never reaches here: it is durable,\n // registers nothing, and is therefore the one handler a LINEAR\n // handler can publish — which is exactly what lets a form outlive the\n // process that drew it (#103).\n //\n // Worded for the surface author rather than reusing the result path's\n // callback wording: what this catches is a function in RENDER PROPS,\n // and naming the fix matters more than naming the rule. The tempting\n // shape is a promise the render's own handler resolves — which would\n // hold the message open for a human-speed wait, on an unacked\n // delivery a redeploy hands to another instance. `defer` plus a\n // durable default is that same form, written so it survives.\n registerCallback: canRegisterCallbacks\n ? registerCallback\n : () => {\n throw new Error(\n 'A LINEAR version handler may not register function props — the registration dies when the handler returns. To wait for a viewer, call context.defer() and declare the handler in the UI defaults instead: a durable handler outlives this process.',\n )\n },\n })\n\n const [extendedContext, terminatePromise] = (await createContextHelper({\n taskId,\n // Rehydration (FileObject/StreamObject -> RequenceFile/RequenceStream)\n // happens inside createContextHelper via its inbound boundary — the\n // signal-aware pass whose instances reach the handler.\n input: payload.input,\n configuration: payload.configuration,\n abortController,\n passthroughByteReferences,\n // The whole of what a node needs to address a slot (#210): the two\n // opaque fields ui/backend minted for this tree, plus the two ids the\n // dispatch already carries. The service composes no address and holds\n // no store password — the store builds the address from the\n // capability.\n store: createStore({\n url: payload.options.storeUrl,\n signature: payload.options.storeSignature,\n taskId,\n nodeId: payload.nodeId,\n configuration: payload.configurationEval,\n }),\n // Privileged send API on the handler ctx (runtime-only, hidden from\n // the ContextHelper type): shares this message's outbound boundary,\n // publishIndex counter, epoch and priority.\n sends: {\n ...buildSendApi(publishDeps),\n // Passthrough consumers hold raw callback wire refs — this is\n // their invocation egress, routed through the same\n // dispatchInvocation as a rehydrated callback call (fire-and-\n // forget; the outbound ledger settles the publish).\n invokeCallback: (ref, arg) => dispatchInvocation({ ...ref, arg }),\n options: payload.options,\n },\n onLog(debugMethod, data) {\n // Best-effort: a debug log must never fail the task. The boundary\n // sanitizes the payload (functions/opaque instances → labels),\n // degrades offload failures to warnings, and keeps the done-gate\n // waiting for the upload without letting it fail the task. On a\n // transform error it resolves `undefined` and nothing is published.\n void outbound.send(data, { bestEffort: true }).then((mapped) => {\n if (mapped === undefined) {\n return\n }\n publish({\n index: publishIndex++,\n version,\n messageId,\n taskId,\n data: mapped,\n debugMethod,\n priority: message.properties.priority,\n debug: true,\n epoch,\n })\n })\n },\n onRender,\n onDefer(reason) {\n deferred = true\n deferredReason = reason || null\n\n return obfuscate(\n taskId,\n messageId,\n payload.options.uploadUrl ?? '',\n payload.options.streamUrl ?? '',\n payload.options.maxPayloadSize?.toString() ?? '',\n payload.options.maxFileSize?.toString() ?? '',\n payload.nodeId ?? '',\n )\n },\n onCallback: dispatchInvocation,\n })) as unknown as [\n MessageHandlerContext<V>,\n PromiseWithResolvers<string>,\n ]\n\n await publish({\n index: publishIndex++,\n version,\n messageId,\n taskId,\n priority: message.properties.priority,\n begin: true,\n epoch,\n // The one stamp per node execution: this build, this box. It becomes\n // the NODE_START update's `service`, which is written once and never\n // re-derived — so anything absent here is lost for that run.\n ...buildServiceIdentityHeaders({\n libVersion: libVersion(),\n name,\n // Read the ack decision immediately below: a CONTINUOUS generator\n // acks straight away and frees its slot, so its run holds none.\n // Every other combination stays unacked until the work is done.\n // ui/backend cannot derive this — it knows the mode from the node\n // but not whether the author wrote a generator.\n holdsSlot: !(isGeneratorHandler && mode === 'CONTINUOUS'),\n }),\n })\n\n if (isMessageHandlerGenerator(messageHandler)) {\n if (mode === 'CONTINUOUS') {\n // CONTINUOUS: ACK immediately, operator watchdog supervises. A\n // LINEAR message stays unacked until done — prefetch keeps\n // bounding concurrent work and the broker redelivers on a crash.\n safeAck(channel, message)\n acked = true\n }\n\n const generator = messageHandler(extendedContext)\n const terminationPromise = Promise.withResolvers<typeof abortSymbol>()\n generatorTerminators.set(messageId, (reason) => {\n terminated = true\n // Suppress native AbortError that may reject generator.return() when\n // context.terminated.signal fires and cancels a pending await inside\n // the generator (e.g. node:timers/promises setTimeout with { signal }).\n ;(generator.return() as Promise<unknown>).catch(\n (error: unknown) => {\n if (\n terminated &&\n error instanceof Error &&\n error.name === 'AbortError' &&\n !(error instanceof AbortError)\n ) {\n return\n }\n throw error\n },\n )\n terminationPromise.resolve(abortSymbol)\n terminatePromise.resolve(reason)\n })\n\n await handlerStorage.run(\n extendedContext as ContextHelper,\n async () => {\n while (true) {\n type IterResult = IteratorResult<\n MessageHandlerReturnValue<V, null>,\n void | MessageHandlerReturnValue<V, null>\n >\n // Catch native AbortError from context.terminated.signal so\n // generator implementations don't need their own try/catch.\n const nextPromise = Promise.resolve(generator.next()).then(\n (r) => r,\n (error: unknown) => {\n if (\n terminated &&\n error instanceof Error &&\n error.name === 'AbortError' &&\n !(error instanceof AbortError)\n ) {\n return { value: undefined, done: true } as IterResult\n }\n throw error\n },\n )\n const next = await Promise.race([\n terminationPromise.promise,\n nextPromise,\n ])\n if (next === abortSymbol) {\n break\n }\n\n const { value: result, done } = next\n\n if (deferred) {\n deferred = false\n logger.warn(\n 'returning a value in a deferred message resets the deferred status',\n )\n }\n\n const { value: rawValue, outputName } =\n unwrapOutputValue(result)\n const value = await outbound.send(rawValue, {\n outputName,\n onCallback: registerCallback,\n })\n\n if (!done || typeof value !== 'undefined') {\n await publish({\n index: publishIndex++,\n version,\n messageId,\n taskId,\n data: value,\n priority: message.properties.priority,\n outputName,\n epoch,\n })\n }\n\n if (done) {\n break\n }\n }\n },\n )\n } else {\n const result = await handlerStorage.run(\n extendedContext as ContextHelper,\n () => messageHandler(extendedContext),\n )\n const { value: rawValue, outputName } = unwrapOutputValue(result)\n const value = await outbound.send(rawValue, {\n outputName,\n onCallback: () => {\n throw new Error(\n 'callbacks can only be used in generator functions',\n )\n },\n })\n if (deferred && value) {\n logger.warn(\n 'returning a value in a deferred message resets the deferred status',\n )\n deferred = false\n }\n\n if (!deferred || value) {\n await publish({\n index: publishIndex++,\n version,\n messageId,\n taskId,\n data: value,\n priority: message.properties.priority,\n outputName,\n epoch,\n })\n }\n }\n\n await new Promise<void>((resolve, reject) => {\n setImmediate(async () => {\n try {\n // The boundary's settle gate: waits for every tracked background\n // upload/publish, then throws an AggregateError on any fail-hard\n // failure — which surfaces here and reaches the outer catch ->\n // exception republish -> throwServiceError -> failNode. The done\n // marker + ack only happen once every upload succeeded.\n if (!deferred) {\n await outbound.settle()\n }\n\n await publish({\n index: publishIndex++,\n version,\n messageId,\n taskId,\n data: deferredReason,\n priority: message.properties.priority,\n deferred,\n done: !deferred,\n epoch,\n })\n\n if (!acked) {\n safeAck(channel, message)\n }\n resolve()\n } catch (error) {\n reject(error)\n }\n })\n })\n } catch (error) {\n if (error instanceof SkipError) {\n if (!acked) {\n safeNack(channel, message)\n }\n return\n }\n if (error instanceof RetryError) {\n if (!acked) {\n safeAck(channel, message)\n }\n const properties: Options.Publish = {\n ...message.properties,\n expiration: error.delay || 1_000, // 1s\n }\n channelWrapper\n .publish(\n `${exchange}-retry`,\n version, // to other services\n message.content,\n properties,\n )\n .catch((publishError: unknown) => {\n if (!silent) {\n logger.error(\n 'Failed to republish message for retry:',\n publishError,\n )\n }\n })\n\n return\n }\n\n // A refusal, not a failure: this box is the wrong one, the message is\n // fine. It goes back by REPUBLISHING to `<exchange>-retry`, never by\n // nacking, because a nack can carry no rejection count and a classic\n // queue offers none either — see `CAPABILITY_HEADER_KEYS.mismatch` in\n // `@requence/helpers/protocol` for the full argument, and this file's\n // spec, which pins it. The republish reaches the operator's error\n // consumer, which already counts attempts, delays and fails the node.\n if (error instanceof UnsupportedCapabilityError) {\n if (!silent) {\n logger.error(error.message)\n }\n\n if (!acked) {\n safeAck(channel, message)\n }\n channelWrapper\n .publish(\n `${exchange}-retry`,\n 'operator', // back to operator\n // The dispatch verbatim: a reroute re-dispatches these bytes, and\n // this build never decoded them.\n message.content,\n {\n ...message.properties,\n headers: {\n ...message.properties.headers,\n version,\n [CAPABILITY_HEADER_KEYS.mismatch]: true,\n index: publishIndex++,\n 'error-message': error.message,\n },\n },\n )\n .catch((publishError: unknown) => {\n if (!silent) {\n logger.error(\n 'Failed to publish capability mismatch message:',\n publishError,\n )\n }\n })\n\n return\n }\n\n if (error instanceof AbortError && error.message.length > 0) {\n if (!acked) {\n safeAck(channel, message)\n }\n channelWrapper\n .publish(\n `${exchange}-retry`,\n 'operator', //back to operator\n error.message,\n {\n ...message.properties,\n contentType: 'text/plain',\n headers: {\n ...message.properties.headers,\n index: publishIndex++,\n abort: true,\n },\n },\n )\n .catch((publishError: unknown) => {\n if (!silent) {\n logger.error('Failed to publish abort message:', publishError)\n }\n })\n\n return\n }\n\n // Native AbortError thrown when context.terminated.signal fires\n // (e.g. node:timers/promises setTimeout with { signal: context.terminated.signal }).\n // Only suppress when actually in a terminated state — otherwise a\n // different AbortSignal caused the error and it should propagate.\n if (\n terminated &&\n error instanceof Error &&\n error.name === 'AbortError' &&\n !(error instanceof AbortError)\n ) {\n if (!acked) {\n safeAck(channel, message)\n }\n return\n }\n\n if (error instanceof Error) {\n if (!silent) {\n logger.error('Encountered an error inside service handler:')\n logger.error(error)\n }\n\n if (!acked) {\n safeAck(channel, message)\n }\n channelWrapper\n .publish(\n `${exchange}-retry`,\n 'operator', // back to operator\n message.content,\n {\n ...message.properties,\n headers: {\n ...message.properties.headers,\n version,\n exception: true,\n index: publishIndex++,\n 'error-message': error.message || 'error in service handler',\n },\n },\n )\n .catch((publishError: unknown) => {\n if (!silent) {\n logger.error(\n 'Failed to publish exception message:',\n publishError,\n )\n }\n })\n\n return\n }\n } finally {\n if (messageIdForCleanup) {\n generatorTerminators.delete(messageIdForCleanup)\n // Bounded with the delivery rather than left to accumulate. A publish\n // that outlives the handler — a deferred message's later send — then\n // falls back to JSON, which the operator decodes correctly off the\n // header. It loses the size win for that one message and nothing else:\n // degrading to JSON is always safe, which is why the fallback is JSON\n // and not \"the last codec we saw\".\n messageCodecs.delete(messageIdForCleanup)\n }\n registeredCallbackIds.forEach((id) => callbacks.delete(id))\n resolveActiveMessage()\n }\n })\n })\n\n const activeMessageKeys = new Set<string>()\n const api: ConnectionApi<V> = {\n close: async () => {\n stopUIWatch?.()\n await callbackChannelWrapper.close()\n await handlerChannelWrapper.close()\n await channelWrapper.close()\n await connection.close()\n },\n open: () => connectedPromise.then(() => api),\n\n async act(messageKey, actor) {\n if (activeMessageKeys.has(messageKey)) {\n throw new Error('a defer key can only be used once')\n }\n\n activeMessageKeys.add(messageKey)\n\n let publishIndex = 0\n const { taskId, messageId, ...options } =\n messageKeySchema.parse(messageKey)\n\n const activeMessage = async () => {\n if (activeMessages.has(messageId)) {\n await activeMessages.get(messageId)\n }\n }\n\n const registeredCallbackIds = new Set<string>()\n // The deferred path's own outbound boundary: its ledger replaces the\n // old donePromises/uploadErrors pair — errors are caught at\n // registration time (nothing sits unhandled during long generator\n // iteration) and surfaced by settle() after the loop.\n const outbound = createOutboundBoundary(options)\n // The same growth warning as the main path (#151): an `act()` call holds\n // its own registry and may iterate a generator of its own, so it can grow\n // one the same way.\n const growth = callbackGrowth.forDelivery({ taskId })\n const registerCallback = (\n callback: (...args: any[]) => void,\n path: ReadonlyArray<string | number>,\n ) => {\n const callbackId = crypto.randomUUID()\n registeredCallbackIds.add(callbackId)\n callbacks.set(callbackId, {\n callback,\n onCallbackInvoke: dispatchInvocation,\n })\n growth.record(path)\n return { sourceId: connectionId, callbackId }\n }\n\n // Deferred-path analogue of the main path's dispatchInvocation: chained\n // invocations of callbacks registered here egress through this deferred\n // message's context (no epoch, matching its other publishes).\n const dispatchInvocation = (\n invocation: CallbackObject & { arg: unknown },\n ) => {\n outbound.track(\n outbound\n .send(invocation.arg, {\n outputName: invocation.outputName,\n onCallback: registerCallback,\n })\n .then((data) =>\n publish({\n index: 0,\n version,\n taskId,\n messageId,\n data: invocationPayload(invocation, data),\n outputName: invocation.outputName,\n propertyPath: invocation.propertyPath,\n ...invocationHeaders(invocation, options.nodeId),\n }),\n ),\n )\n }\n\n // This act() call's publish context: its own index counter, its own\n // callback registry, its own active-message gate, and no attempt headers —\n // an acting process is not a consume attempt. Both the send API and the\n // render read it, so the two cannot disagree about which message they\n // publish for.\n const publishDeps: PublishDeps = {\n outbound,\n registerCallback,\n taskId,\n messageId,\n nextIndex: () => publishIndex++,\n gate: activeMessage,\n }\n\n const renderSurface = buildRender(publishDeps)\n\n const sendApi = {\n ...buildSendApi(publishDeps),\n // The live window a deferred node gets (#70): the same render as the\n // main path, publishing into the same last-write-wins surface — so a\n // re-attach after a restart replaces the stale one, with fresh callbacks\n // registered here rather than in a message context that no longer\n // exists. The lock against a second instance doing this concurrently is\n // the author's (D9); see `ConnectionApi.act`.\n render(\n ui: RequenceUI,\n props: unknown,\n renderOptions?: { surfaceId?: string },\n ) {\n // The default mirrors `context.render` in helpers.ts — the public\n // shape of a render is the same on both paths.\n renderSurface({\n ui,\n props,\n surfaceId: renderOptions?.surfaceId ?? DEFAULT_SURFACE_ID,\n })\n },\n async abort(error: string | Error) {\n await activeMessage()\n channelWrapper.publish(\n `${exchange}-retry`,\n 'operator',\n error instanceof Error ? error.message : error,\n {\n persistent: true,\n correlationId: messageId,\n expiration: 0,\n priority: 0,\n contentType: 'text/plain',\n headers: {\n taskId,\n index: publishIndex++,\n abort: true,\n },\n },\n )\n },\n }\n\n const result = await actor(sendApi as ActorApi<V>)\n\n if (\n result != null &&\n typeof result === 'object' &&\n (Symbol.asyncIterator in result || Symbol.iterator in result)\n ) {\n // Generator: iterate and send each yielded value\n const iterable = result as AsyncIterable<unknown> | Iterable<unknown>\n for await (const value of iterable) {\n if (value !== undefined) {\n await sendApi.send(value)\n }\n }\n } else if (result !== undefined) {\n await sendApi.send(result)\n }\n\n await new Promise((resolve) => setImmediate(resolve))\n await activeMessage()\n\n try {\n // Settle gate: waits while sends enqueue more sends, then throws an\n // AggregateError on any failed background upload or publish.\n await outbound.settle()\n } catch (error) {\n // Do not mark the message done with a dangling reference. Signal\n // failure over the deferred-path error channel (abort -> operator\n // fails the node) and throw so act()'s caller sees it too.\n registeredCallbackIds.forEach((id) => callbacks.delete(id))\n const first =\n error instanceof AggregateError && error.errors[0] instanceof Error\n ? error.errors[0]\n : error instanceof Error\n ? error\n : new Error(String(error))\n await sendApi.abort(first)\n activeMessageKeys.delete(messageKey)\n throw error\n }\n\n registeredCallbackIds.forEach((id) => callbacks.delete(id))\n\n await publish({\n index: publishIndex++,\n version,\n messageId,\n taskId,\n done: true,\n })\n\n activeMessageKeys.delete(messageKey)\n },\n }\n\n return api\n}\n",
19
+ "import { createHash } from 'node:crypto'\n\nimport type { CallbackIngressContext } from '@requence/callbacks'\nimport {\n type CallbackObject,\n DEFAULT_AMQP_HEARTBEAT_SECONDS,\n DEFAULT_SURFACE_ID,\n DURABLE_CALLBACK_QUEUE_ARGUMENTS,\n MAX_SURFACE_INTERACTION_ERROR_CHARS,\n type MaybePromise,\n NODE_RESUME_HEADER,\n SURFACE_HANDLER_QUEUE_ARGUMENTS,\n SURFACE_HANDLER_TAG,\n SURFACE_INTERACTION_ERROR_HEADER,\n type SurfaceHandlerObject,\n UI_REBUILD_HEADER,\n type UiRebuild,\n deobfuscate,\n durableCallbackInvocationSchema,\n getByPath,\n obfuscate,\n serviceCallbackQueueName,\n serviceHandlerQueueName,\n surfaceHandlerInvocationSchema,\n} from '@requence/helpers'\nimport type { WireCodec } from '@requence/helpers/msgpack'\nimport {\n decodeWireBody,\n encodeWireBody,\n wireCodecFromContentType,\n} from '@requence/helpers/msgpack'\nimport {\n CAPABILITY_HEADER_KEYS,\n buildServiceClientProperties,\n buildServiceIdentityHeaders,\n readRequiredCapabilities,\n unsupportedCapabilities,\n} from '@requence/helpers/protocol'\nimport logger from '@requence/logger/simple'\nimport { type Options, connect } from 'amqp-connection-manager'\nimport type { ConfirmChannel, ConsumeMessage } from 'amqplib'\nimport { z } from 'zod/v4'\n\nimport {\n type OutboundBoundary,\n createInboundBoundary,\n createOutboundBoundary,\n} from './boundary.ts'\nimport { createCallbackGrowthWatch } from './callbackGrowth.ts'\nimport {\n durableCallbackContext,\n findDurableCallback,\n} from './durableCallback.ts'\nimport {\n PayloadTooLargeError,\n RequenceConnectionError,\n UnsupportedCapabilityError,\n} from './errors.ts'\nimport createContextHelper, {\n AbortError,\n type ContextHelper,\n type JSONValue,\n RetryError,\n SkipError,\n handlerStorage,\n unwrapOutputValue,\n} from './helpers.ts'\nimport { libVersion } from './macro.ts' with { type: 'macro' }\nimport { createStore } from './store.ts'\nimport { passthroughInboundTransformer } from './transformer.ts'\nimport type { RenderProps, RequenceUI } from './ui.ts'\nimport {\n type MutableRequenceUI,\n findUIById,\n watchUIRebuilds,\n} from './uiWatch.ts'\n\ntype InternalNamedOutput = '__internal_named_output__'\n\n/**\n * A thrown value as a sentence a viewer can read — the text a recorded\n * interaction failure quotes (#107).\n *\n * The message and not the stack: the stack goes to this process's stderr, where\n * the author is, while the row is served to whoever is looking at the surface.\n */\nfunction errorText(error: unknown): string {\n return error instanceof Error ? error.message : String(error)\n}\n\ntype Input<V extends keyof RequenceService.Version> =\n RequenceService.Version[V]['input']\ntype Configuration<V extends keyof RequenceService.Version> =\n RequenceService.Version[V]['configuration']\ntype OutputName<\n V extends keyof RequenceService.Version,\n K = keyof RequenceService.Version[V]['outputs'],\n> = K extends '__default__' ? null : K\n\ntype OutputValue<\n V extends keyof RequenceService.Version,\n O extends OutputName<V>,\n ON = O extends null ? '__default__' : O,\n> = ON extends keyof RequenceService.Version[V]['outputs']\n ? RequenceService.Version[V]['outputs'][ON]\n : never\n\ninterface ServiceContextHelper<\n V extends keyof RequenceService.Version,\n> extends Omit<\n ContextHelper,\n 'input' | 'configuration' | 'getData' | 'getConfiguration' | 'toOutput'\n> {\n input: Input<V>\n configuration: Configuration<V>\n\n toOutput<O extends OutputName<V>>(\n name: O,\n value: OutputValue<V, O>,\n ): InternalNamedOutput\n}\n\ntype ApiOutputName<V> = V extends keyof RequenceService.Version\n ? OutputName<V>\n : string | null\ntype ApiOutputValue<V, O> = V extends keyof RequenceService.Version\n ? O extends OutputName<V>\n ? OutputValue<V, O>\n : unknown\n : unknown\n\ninterface ActorApi<V> {\n sendToOutput<O extends ApiOutputName<V>>(\n outputName: O,\n data: ApiOutputValue<V, O>,\n options?: { overwrite?: boolean },\n ): void\n send(data: ApiOutputValue<V, null>, options?: { overwrite?: boolean }): void\n /**\n * Renders a UI component on the deferred node, for as long as this `act()`\n * call runs — the `act()` re-attach of\n * `knowledge/service-ui-surfaces.md`.\n *\n * Identical in contract to `context.render`: `props` is a plain object, and\n * functions inside it arrive in the component as invokable callbacks. The\n * difference is *whose* they are — they register in this `act()` call's own\n * registry, so they live exactly as long as the call. A deferring LINEAR\n * handler cannot hold one at all (its callbacks die when it returns), which is\n * why a live surface on a deferred node has to be rendered from here.\n *\n * That is also what makes it survive a restart: reload the pending keys,\n * `act()` again, and this render — fresh connection, fresh callbacks —\n * replaces the stale surface through the last-write-wins surface row. Nothing\n * about the component or the browser has to know it happened.\n *\n * **You own the double-attach lock.** See {@link ConnectionApi.act}: two\n * replicas that both load the same pending key will both render, and the\n * second one silently takes the surface over. Requence cannot hold that lock\n * for you — it warns loudly instead.\n *\n * A render is a patch here exactly as on the main path (#102), which is what\n * makes a re-attach cheap: restate what this process knows and let the fold\n * keep the rest.\n *\n * A function written *here* is connection-bound: it closes over this `act()`\n * call, so it dies with it. A function in the UI's own defaults is durable\n * whoever renders it (#103) — which is what an actor should reach for when it\n * wants a control to keep working after it has gone.\n */\n render<Props>(\n ui: RequenceUI<Props>,\n props: RenderProps<Props>,\n options?: { surfaceId?: string },\n ): void\n abort(error: string | Error): void\n}\n\nexport interface ConnectionApi<V> {\n close(): Promise<void>\n open(): Promise<ConnectionApi<V>>\n /**\n * Deliver the result of a deferred message, later and from anywhere: pass the\n * key `context.defer()` returned and the actor runs with a send API for that\n * message. It is also the only live window a deferred node has — see\n * {@link ActorApi.render}.\n *\n * **Double-attach is YOUR lock to hold.** You own the pending-key storage, so\n * you own the exclusivity. This connection refuses a key it is already acting\n * on, but that check is per-connection and in memory: two replicas that both\n * load the pending keys on boot will both `act()` the same key, both register\n * callbacks, and both render — and the second render replaces the first one's\n * surface, so clicks silently go to whichever instance rendered last. Requence\n * does not arbitrate this (that would need cross-replica holder state plus a\n * takeover path so a dead holder cannot block a key forever); it makes the\n * symptom loud instead, by warning when a render replaces a surface that is\n * still live on another connection.\n *\n * Take a lease on the key in your own store before acting, and only act on\n * keys you hold.\n */\n act(\n messageKey: string,\n actor: (\n api: ActorApi<V>,\n ) =>\n | ApiOutputValue<V, null>\n | Promise<ApiOutputValue<V, null>>\n | void\n | Promise<void>\n | AsyncGenerator<ApiOutputValue<V, null>>\n | Generator<ApiOutputValue<V, null>>,\n ): Promise<void>\n}\n\nexport const messageKeySchema = z\n .string()\n .transform((str) => deobfuscate(str))\n .pipe(z.tuple([z.uuid(), z.uuid()]).rest(z.string()))\n .transform((arr) => ({\n taskId: arr[0],\n messageId: arr[1],\n uploadUrl: arr[2] || undefined,\n streamUrl: arr[3] || undefined,\n // Byte limits appended to the defer key alongside the transport URLs.\n // Old 4-part keys (pre-limits) parse with both absent → consumer defaults.\n maxPayloadSize:\n arr[4] && Number.isFinite(Number(arr[4])) ? Number(arr[4]) : undefined,\n maxFileSize:\n arr[5] && Number.isFinite(Number(arr[5])) ? Number(arr[5]) : undefined,\n // Appended for #150, so an `act()` call can emit a durable callback\n // reference: the node is the reference's whole address, and an acting process\n // has no dispatch to read it off. Absent in a key minted before this, which\n // then behaves exactly as it did — that path could not emit one either.\n nodeId: arr[6] || undefined,\n }))\n\nconst headerSchema = z\n .object({\n properties: z.object({\n correlationId: z.uuid(),\n headers: z.object({\n taskId: z.uuid(),\n mode: z.enum(['LINEAR', 'CONTINUOUS']).default('LINEAR'),\n }),\n }),\n })\n .transform((msg) => ({\n messageId: msg.properties.correlationId,\n taskId: msg.properties.headers.taskId,\n mode: msg.properties.headers.mode,\n }))\n\nconst payloadSchema = z\n .object({\n content: z.instanceof(Buffer),\n properties: z.object({ contentType: z.string().optional() }),\n })\n // The dispatch codec is whatever the operator declared, never an assumption:\n // `ui/backend` bakes the choice per service node, so two nodes of one task can\n // legitimately arrive under different codecs, and a replica that has just been\n // rolled forward still receives JSON for tasks created before it attached.\n .transform((msg) => decodeWireBody(msg.content, msg.properties.contentType))\n .pipe(\n z.object({\n // Optional because a dispatch may carry no input at all, and the JSON\n // codec drops an `undefined` value rather than encoding one — under zod 4\n // that absence would throw here and fail the node with a message about the\n // envelope. The msgpack codec keeps the key (as nil), so this only ever\n // shows on the JSON wire.\n input: z.unknown().optional(),\n configuration: z.unknown().optional(),\n // Which node of the graph this dispatch is for — the address a durable\n // callback reference carries out with it (#150). Optional like the rest of\n // this envelope: a dispatch minted before it existed simply cannot emit\n // one, and the callback handler says exactly that.\n nodeId: z.string().optional(),\n // Set only when this dispatch is a configuration-function evaluation\n // (#224). `nodeId` is then the HOST node's — the node being configured —\n // and the store composes `private` slots into that node's configuration\n // box rather than into the host service's own.\n //\n // Not spelled `configuration`: that key is already this envelope's\n // configuration VALUE. The operator's own word for the phase is the\n // config eval, so that is the name on the wire.\n configurationEval: z.boolean().optional(),\n options: z.object({\n uploadUrl: z.url().optional(),\n streamUrl: z.url().optional(),\n maxPayloadSize: z.number().optional(),\n maxFileSize: z.number().optional(),\n // The store capability (#210), copied onto every dispatch by the\n // operator, which reads neither field. `z.string()` rather than\n // `z.url()` deliberately: it must accept exactly what\n // `taskOptionsSchema` accepts, or a dispatch the protocol calls valid\n // fails the whole envelope here.\n storeUrl: z.string().optional(),\n storeSignature: z.string().optional(),\n }),\n }),\n )\n\nconst backchannelMessageSchema = z\n .object({\n content: z.instanceof(Buffer),\n properties: z.object({\n correlationId: z.string(),\n contentType: z.string().optional(),\n // The task, for the failure report below. Every backchannel publish stamps\n // it (the operator needs it to hash the unroutable copy onto the task's own\n // shard), so it is here rather than in the payload.\n //\n // `catch` so this can never reject a delivery: the headers are a *reporting*\n // input, and a malformed one must cost the report, not the invocation the\n // message was carrying.\n headers: z\n .object({ taskId: z.uuid().optional() })\n .optional()\n .catch(undefined),\n }),\n })\n // Header-driven like every other decoder on these wires. The backchannel itself\n // stays JSON — it is a low-volume control wire — but reading the header means it\n // is not the one consumer a later codec change has to remember to visit.\n .transform((message) => ({\n ...message,\n content: decodeWireBody(message.content, message.properties.contentType),\n }))\n .pipe(\n z.object({\n content: z.discriminatedUnion('type', [\n z.object({\n type: z.literal('stop'),\n }),\n z.object({\n type: z.literal('callback'),\n callbackId: z.uuid(),\n /**\n * `.optional()` is load-bearing, and it is not decoration: under zod 4\n * an `any` field is NOT optional, so a body with no `arg` key fails to\n * parse — and the parse failure here is a bare `return`, the one path\n * on this consumer that says nothing at all.\n *\n * A body without the key is ordinary: the wire is JSON, and a handler\n * invoked with no argument (`onInject(): void`) serializes to a key\n * `JSON.stringify` deletes. The publisher normalises to `null` now, so\n * this covers a publisher that has not been rolled forward rather than\n * the everyday case.\n */\n arg: z.any().optional(),\n /**\n * Present exactly when this callback IS a connection-bound surface\n * handler invocation (#107): the surface row it came from, so a\n * failure can be stated on the surface the viewer is looking at.\n *\n * A peer callback carries none, and must not: it belongs to a live\n * message that can fail in the ordinary way.\n */\n surface: z.uuid().optional(),\n }),\n ]),\n properties: z.object({\n correlationId: z.string(),\n headers: z\n .object({ taskId: z.uuid().optional() })\n .optional()\n .catch(undefined),\n }),\n }),\n )\n .transform((message) => ({\n payload: message.content,\n messageId: message.properties.correlationId,\n taskId: message.properties.headers?.taskId,\n }))\n\nconst abortSymbol = Symbol()\n\nexport const connectionOptionsSchema = z.object({\n url: z.union([\n z\n .string()\n .regex(/^amqps?:\\/\\/(.+):(.+)@(.+)$/)\n .transform((str) => new URL(str)),\n z\n .instanceof(URL)\n .refine((url) => url.protocol.match(/^amqps?:/), 'Wrong protocol'),\n ]),\n version: z.string(),\n // Author-chosen debugging label announced in the AMQP client properties.\n // Not length-validated on purpose — an over-long label is capped, never a\n // startup failure. Nothing keys off it.\n name: z.string().optional(),\n devOverlay: z.string().optional(),\n silent: z.boolean().optional(),\n prefetch: z.number().int().optional(),\n connectionTimeout: z.number().positive().default(3_000),\n heartbeatInterval: z.number().int().positive().optional(),\n connectionOptions: z.any().optional(),\n // Hard cap on the serialized message body. A body above this is rejected with a\n // clear PayloadTooLargeError *before* it reaches the broker — the broker itself\n // only signals oversize by tearing down the connection, which amqplib surfaces\n // as an opaque \"channel closed\". Set to match the broker's max_message_size.\n maxMessageSize: z\n .number()\n .int()\n .positive()\n .default(128 * 1024 * 1024), // RabbitMQ's historical default max_message_size\n // Undocumented (privileged consumers): skip file/stream/callback rehydration\n // on ingress — claim-checks still resolve; byte references reach the handler\n // as raw `__REQUENCE_type` wire objects. See helpers.ts.\n passthroughByteReferences: z.boolean().optional(),\n})\n\nexport type PrivilegedConnectionOptions = z.output<\n typeof connectionOptionsSchema\n>\nexport type ConnectionOptions = Omit<\n PrivilegedConnectionOptions,\n 'passthroughByteReferences'\n>\n\n// Live connection state, surfaced so a caller (e.g. the logic runtime's health\n// probe) can react to loss/recovery instead of trusting a one-shot startup\n// signal. `connected: false` carries the disconnect error when the broker\n// supplied one; `connected: true` fires on the initial connect and on every\n// subsequent auto-reconnect.\nexport interface ConnectionState {\n connected: boolean\n err?: Error\n}\nexport type ConnectionStateListener = (state: ConnectionState) => void\n\ntype MessageHandlerContext<V> = V extends keyof RequenceService.Version\n ? ServiceContextHelper<V>\n : ContextHelper\ntype MessageHandlerReturnValue<\n V,\n O = null,\n> = V extends keyof RequenceService.Version\n ? O extends OutputName<V>\n ? OutputValue<V, O> | InternalNamedOutput\n : void\n : JSONValue\n\ntype MessageHandlerFunction<V> = (\n context: MessageHandlerContext<V>,\n) => MaybePromise<MessageHandlerReturnValue<V> | void>\n\ntype MessageHandlerGenerator<V> = (\n context: MessageHandlerContext<V>,\n) => Generator<\n MessageHandlerReturnValue<V>,\n MessageHandlerReturnValue<V> | void,\n void\n>\ntype MessageHandlerAsyncGenerator<V> = (\n context: MessageHandlerContext<V>,\n) => AsyncGenerator<\n MessageHandlerReturnValue<V>,\n MessageHandlerReturnValue<V> | void,\n void\n>\n\nexport type MessageHandler<V> = V extends keyof RequenceService.Version\n ? RequenceService.Version[V]['mode'] extends 'LINEAR'\n ? MessageHandlerFunction<V>\n :\n | MessageHandlerAsyncGenerator<V>\n | MessageHandlerGenerator<V>\n | MessageHandlerFunction<V>\n :\n | MessageHandlerAsyncGenerator<V>\n | MessageHandlerGenerator<V>\n | MessageHandlerFunction<V>\n\nfunction isMessageHandlerGenerator<V extends keyof RequenceService.Version>(\n // oxlint-disable-next-line typescript/no-unsafe-function-type\n handler: Function,\n): handler is MessageHandlerGenerator<V> | MessageHandlerAsyncGenerator<V> {\n return (\n handler.constructor.name === 'GeneratorFunction' ||\n handler.constructor.name === 'AsyncGeneratorFunction'\n )\n}\n\nconst activeMessages = new Map<string, Promise<void>>()\n\n/**\n * The codec each in-flight dispatch arrived under, keyed by messageId.\n *\n * **A reply echoes the codec of its dispatch.** That is what keeps this direction\n * of the wire free of any capability logic: the service never chooses, never\n * configures and never negotiates a codec — it answers in the language it was\n * addressed in. The operator's result consumer then reads the content type back\n * off the reply, so the round trip needs no field anywhere in the protocol.\n *\n * A messageId absent from this map means JSON, which is both the pre-migration\n * status quo and the right answer for an operator loopback that never went\n * through a dispatch.\n */\nconst messageCodecs = new Map<string, WireCodec>()\n\n// A delivery tag belongs to the exact channel that delivered the message. When\n// that channel closes (e.g. the connection dropped mid-processing), amqplib\n// turns ack/nack into a synchronous `IllegalOperationError: Channel closed`.\n// The broker has already requeued the delivery for redelivery, so there is\n// nothing left to acknowledge — and we must NOT route this through the\n// reconnecting channelWrapper, which would send the stale tag on the new\n// channel and trip a 406 PRECONDITION_FAILED that kills the fresh channel.\nfunction isChannelClosedError(error: unknown): boolean {\n return error instanceof Error && error.name === 'IllegalOperationError'\n}\n\nfunction safeAck(channel: ConfirmChannel, message: ConsumeMessage) {\n try {\n channel.ack(message)\n } catch (error) {\n if (!isChannelClosedError(error)) {\n throw error\n }\n }\n}\n\n/**\n * The addressing half of an invocation, as the *headers* of the publish that\n * carries it to the operator — which is what differs between the two lifetimes\n * and the whole of what differs.\n *\n * A service publishes an invocation onto its own results stream either way: it\n * cannot reach a backchannel or a callbacks queue itself, and it should not try.\n * The operator is the party that knows where each arm goes — one live\n * connection's backchannel, or the emitting node's *version* (#150) — so both are\n * stated in a form it can route and neither is dropped here.\n */\nfunction invocationHeaders(\n payload: CallbackObject,\n // The node this invocation is published FROM — the graph node whose message is\n // running right now. On both arms, and not part of the address: the operator\n // needs it only to name the invoking node in the record, and it says so here\n // because the record it used to be looked up in can already be gone. An\n // invocation carries no publish index (by design — `done` must not wait on its\n // slot), so nothing serialises it against the `done` of this very node, and a\n // bookkeeping miss used to discard the invocation itself (#147).\n //\n // Absent where the publisher genuinely cannot know it: a defer key minted\n // before #150 carries no node, and that path behaves exactly as it did.\n invokingNodeId: string | undefined,\n): {\n connectionId?: string\n callbackId?: string\n callbackName?: string\n callbackNodeId?: string\n invokingNodeId?: string\n} {\n return {\n ...(invokingNodeId ? { invokingNodeId } : {}),\n ...(payload.lifetime === 'connection'\n ? // The EMITTER's connection, not this one: on this arm the header names the\n // backchannel to deliver to.\n { connectionId: payload.sourceId, callbackId: payload.callbackId }\n : { callbackName: payload.name, callbackNodeId: payload.nodeId }),\n }\n}\n\n/**\n * The body of that publish: the consumer's argument, and — on the durable arm —\n * the data the emitting service bound to this reference beside it.\n *\n * `bound` makes the round trip through the invoking service because that is the\n * only place it exists: the operator never held it (a claim-checked emission is\n * opaque to it) and the emitting version is where it is going. It travels\n * VERBATIM, exactly as the emitter minted it — only `arg` goes through this\n * boundary, since only `arg` was written here.\n */\nfunction invocationPayload(payload: CallbackObject, arg: unknown): unknown {\n return payload.lifetime === 'connection' ? arg : { arg, bound: payload.bound }\n}\n\nfunction safeNack(channel: ConfirmChannel, message: ConsumeMessage) {\n try {\n channel.nack(message)\n } catch (error) {\n if (!isChannelClosedError(error)) {\n throw error\n }\n }\n}\n\nexport default function createConnection<V>(\n {\n url,\n version,\n prefetch = 1,\n silent = false,\n connectionTimeout,\n // Without a default this is `undefined` and amqp-connection-manager falls\n // back to 5s, which makes any event-loop stall >10s fatal to the connection.\n // Defaulted here rather than per service so every deployed service converges\n // on the same interval on its next release.\n heartbeatInterval = DEFAULT_AMQP_HEARTBEAT_SECONDS,\n connectionOptions,\n name,\n devOverlay = '',\n maxMessageSize,\n onConnectionStateChange,\n ...rest\n }: ConnectionOptions & { onConnectionStateChange?: ConnectionStateListener },\n messageHandler: MessageHandler<V>,\n) {\n const passthroughByteReferences =\n (rest as PrivilegedConnectionOptions).passthroughByteReferences ?? false\n // A property of the HANDLER, evaluated once at connection scope. Two\n // independent things are decided by it, so it is hoisted under its own name\n // rather than either of them borrowing the other's: whether a callback\n // registration can outlive the call that made it, and whether a CONTINUOUS run\n // holds a task slot. (Kept separate from the narrowing call in the consume\n // loop, whose job is to type the handler.)\n const isGeneratorHandler = isMessageHandlerGenerator(messageHandler)\n // A non-generator handler's result path already refuses callbacks: its\n // registry entries are deleted the moment the message settles, which for a\n // returning handler is immediately. Same rule for render props — this is the\n // one place it is decided, and it is a property of the handler, not of a\n // message.\n const canRegisterCallbacks = isGeneratorHandler\n // Minted BEFORE the connect so it can be announced in the client properties\n // alongside every other per-connection fact. A bare `crypto.randomUUID()` with\n // no inputs, so nothing about it depends on the connection existing yet.\n //\n // Once per `createAmqpConnection`, NOT per broker connection: this id survives\n // an amqp-connection-manager reconnect. (The Python SDK deliberately differs —\n // it mints per broker connection. Both give a correct join at any instant.)\n const connectionId = crypto.randomUUID()\n const baseQueue = `${url.username}@${version}`\n const queue = devOverlay\n ? `${baseQueue}-dev-overlay-${devOverlay}`\n : baseQueue\n const exchange = url.username\n const connection = connect(url.toString(), {\n connectionOptions: {\n ...connectionOptions,\n // Who we are, what we run, what we can decode — declared in the AMQP\n // connection frame so `ui/backend` knows it BEFORE the first dispatch.\n // amqp-connection-manager reuses these options on every reconnect, so\n // the announcement re-lands automatically. Merged LAST: the requence_*\n // keys are the contract and a caller may not shadow them.\n clientProperties: {\n ...connectionOptions?.clientProperties,\n ...buildServiceClientProperties({\n libVersion: libVersion(),\n serviceVersion: version,\n connectionId,\n prefetch,\n name,\n devOverlay: Boolean(devOverlay),\n }),\n },\n },\n heartbeatIntervalInSeconds: heartbeatInterval,\n })\n\n // amqp-connection-manager auto-reconnects, but without a listener a mid-\n // processing disconnect is completely silent: the raw amqplib channel that an\n // in-flight handler closed over is torn down, and the broker requeues every\n // unacked delivery. Surface it so the drop is at least observable.\n connection.on('disconnect', ({ err }: { err?: Error }) => {\n if (!silent && err) {\n logger.error('Requence AMQP connection lost:', err.message)\n }\n onConnectionStateChange?.({ connected: false, err })\n })\n\n // A reconnect fires 'connect' again, but the connectedPromise's listener has\n // already unsubscribed, so recovery was previously invisible. Track whether\n // we have connected before to distinguish the initial connect from a\n // reconnect: log the recovery (mirroring the loss above) and surface it so\n // the caller can flip its state back. Fires for the initial connect too;\n // callers treat `connected: true` idempotently.\n let hasConnected = false\n connection.on('connect', () => {\n if (hasConnected && !silent) {\n logger.info('Requence AMQP reconnected')\n }\n hasConnected = true\n onConnectionStateChange?.({ connected: true })\n })\n\n const connectedPromise = new Promise<void>((resolve, reject) => {\n const unsubscribe = () => {\n clearTimeout(timeout)\n connection.removeListener('connect', handleConnect)\n connection.removeListener('connectFailed', handleConnectFailed)\n }\n\n const timeout = setTimeout(() => {\n handleConnectFailed({\n err: new RequenceConnectionError('Requence connection timeout'),\n })\n }, connectionTimeout)\n\n const handleConnect = () => {\n unsubscribe()\n resolve()\n }\n\n const handleConnectFailed = ({ err }: { err: Error }) => {\n unsubscribe()\n if (\n err.message.startsWith(\n 'Handshake terminated by server: 403 (ACCESS-REFUSED)',\n )\n ) {\n reject(new RequenceConnectionError('Invalid service credentials'))\n } else {\n reject(err)\n }\n }\n\n connection.addListener('connect', handleConnect)\n connection.addListener('connectFailed', handleConnectFailed)\n })\n\n // The dev session this connection belongs to (#108), or `''` outside dev mode.\n //\n // What every surface this connection draws is stamped with, and what a rebuild\n // names to find them again. Scoped to the **session** rather than the\n // connection precisely so it survives the dev process being restarted: the\n // service, the version it overlays and the developer's token are all still the\n // same afterwards, so the surfaces drawn a moment before the restart are still\n // this session's.\n //\n // The token is hashed rather than carried, because this id comes to rest in\n // ui/backend's `task_surface` and a dev overlay key is a personal access token.\n // The service and version stay readable, which is what makes a stored session\n // id diagnosable at all.\n const devSession = devOverlay\n ? `${baseQueue}#${createHash('sha256').update(devOverlay).digest('hex').slice(0, 16)}`\n : ''\n // Derived from the queue this connection actually consumes, overlay suffix\n // included — NOT from the base name. The operator builds the routing key as\n // `service-<node.name>@<node.version>-backchannel-<connectionId>`, and in a\n // dev session ui/backend has rewritten that node's version to\n // `<version>-dev-overlay-<devKey>` (which is how the dispatch reaches this\n // worker in the first place). Anchoring to the base name instead made every\n // inbound backchannel message of a dev-mode service unroutable — the `stop`\n // that terminates a CONTINUOUS generator and, since surfaces, every callback\n // invocation. The unroutable publish then came back through the alternate\n // exchange and was read as a dead connection, so a click on a perfectly live\n // surface killed it (D5's detect-on-interaction, on a false premise).\n const backchannelQueue = `${queue}-backchannel-${connectionId}`\n // Components whose source has already left this connection, keyed\n // `<taskId>:<hash>`. ui/backend stores bundles hash-addressed and that row\n // outlives every render, so only the first render of a component **into a\n // given task** carries the ≤1 MiB source; later ones carry the hash alone.\n // There is no channel to ask ui/backend what it already has (D16: an unknown\n // hash-only render is an error state), so this set is the whole answer.\n //\n // The task is in the key, and not just the hash, because bundle retention is\n // per-task (D19): the last-referent sweep removes a bundle once NO task\n // references it, and a worker that stays connected for days can outlive every\n // task that referenced its component. Keyed by hash alone, every later render\n // from that connection would carry the hash of a bundle nobody stores —\n // permanently, self-healing only on reconnect, with nothing in the retention\n // path able to fix it (at the moment of the sweep the bundle genuinely has no\n // referents). Keyed by task, the first render into any task always carries the\n // source, so the state the sweep can produce is exactly the state a fresh key\n // repairs. It costs one ≤1 MiB transfer per task per component rather than one\n // per connection.\n //\n // Residual, accepted with D16: this records that the source was *published*,\n // not that it was ingested. If the operator discards that render (a\n // superseded epoch after a re-dispatch), a later render of the same component\n // into the same task carries no source and its surface stays an error state\n // until the process reconnects.\n const sentComponents = new Set<string>()\n const generatorTerminators = new Map<string, (reason: string) => void>()\n // Each registry entry keeps the invocation dispatcher of the message that\n // registered the callback. Entries are deleted when that message settles,\n // so a stored dispatcher is live exactly as long as its callback is — this\n // is what lets a nested function in a callback argument reconstruct as\n // invokable (chaining): its invocations egress through the registering\n // message's context (results stream → operator → peer backchannel).\n const callbacks = new Map<\n string,\n {\n callback: (...args: any[]) => void\n onCallbackInvoke: CallbackIngressContext['onCallbackInvoke']\n }\n >()\n\n // What tells an author their registry is growing, and which `yield` is doing\n // it (#151). Connection-scoped because one of its two counters is: a worker\n // holding fifty tasks at nine hundred callbacks each is the case no single\n // delivery can see. `callbacks.size` rather than a count of its own, so\n // rendered handler props — the same registry, the same growth — are in it.\n const callbackGrowth = createCallbackGrowthWatch({\n service: baseQueue,\n devOverlay: Boolean(devOverlay),\n connectionCount: () => callbacks.size,\n // The service's own log, like every other author mistake in this file. Not a\n // task update: the only person who can fix this is the one writing the\n // service, and they are reading this process's output.\n warn: (text) => logger.warn(text),\n })\n\n // Backchannel ingress (concept invariant 2): a callback argument was\n // egress-transformed by the invoking side (files/streams → references,\n // oversized values → claim-checks), so it must rehydrate here before\n // reaching user code. Connection-scoped: the callback owner is typically a\n // CONTINUOUS service whose lifetime differs from any single message, so no\n // per-message signal applies. `onCallbackInvoke` is supplied per call from\n // the registry entry, so nested functions reconstruct invokable.\n // Passthrough consumers (the logic runtime's guest channel) keep byte/callback\n // references raw here too — claim-checks still resolve, but files/streams/\n // callbacks reach the registered callback as their JSON-safe wire objects so\n // they can cross the guest's process boundary.\n const backchannelInbound = createInboundBoundary(\n passthroughByteReferences\n ? { transformer: passthroughInboundTransformer }\n : {},\n )\n\n const channelWrapper = connection.createChannel({\n async setup(channel: ConfirmChannel) {\n if (devOverlay) {\n await channel.assertQueue(queue)\n await channel.bindQueue(queue, 'service', queue)\n }\n await channel.checkExchange(exchange)\n await channel.checkExchange(`${exchange}-retry`)\n await channel.checkQueue(queue)\n await channel.prefetch(prefetch)\n\n await channel.assertQueue(backchannelQueue, {\n exclusive: true,\n })\n\n await channel.bindQueue(backchannelQueue, 'service', backchannelQueue)\n\n await channel.consume(\n backchannelQueue,\n async (message) => {\n const result = backchannelMessageSchema.safeParse(message)\n\n if (!result.success) {\n return\n }\n\n const backchannelMessage = result.data\n\n switch (backchannelMessage.payload.type) {\n case 'stop': {\n generatorTerminators.get(backchannelMessage.messageId)?.(\n 'task stopped',\n )\n break\n }\n case 'callback': {\n const { surface } = backchannelMessage.payload\n const { taskId } = backchannelMessage\n // Reportable only when both halves are here: an interaction names\n // the surface it came from, and a report needs the task to be\n // routed. A peer callback names neither, and its failures belong to\n // its own live message.\n const report =\n surface && taskId\n ? (message: string) =>\n reportInteractionFailure({ taskId, surface, message })\n : () => {}\n\n const entry = callbacks.get(backchannelMessage.payload.callbackId)\n if (!entry) {\n // Said out loud rather than dropped (#106). This is where a\n // connection-bound surface handler lands, and an entry that is\n // gone means the message that registered it has settled — so the\n // click behind it did nothing and nobody was told. Unconditional\n // for the reason the durable arm's misses are: `silent`\n // suppresses connection noise, not a lost interaction. There is\n // no request left to fail (the mutation returned *accepted* long\n // before) and no failure channel here — the backchannel consumes\n // with noAck, outside any message context. For an *interaction*\n // there is now one more place to put it (#107): the surface.\n logger.warn(\n `Requence: dropped an invocation of callback |${backchannelMessage.payload.callbackId}| — nothing is registered under it, so the message that registered it has settled`,\n )\n report(\n 'the process that drew this surface has finished with it, so nothing ran the handler',\n )\n break\n }\n let arg: unknown\n try {\n arg = await backchannelInbound(backchannelMessage.payload.arg, {\n onCallbackInvoke: entry.onCallbackInvoke,\n })\n } catch (error) {\n // The backchannel consumes with noAck and outside any message\n // context, so a failed rehydration has no failure channel.\n // Never hand user code a raw reference — log and drop the\n // invocation instead.\n logger.warn(\n `dropped callback invocation |${backchannelMessage.payload.callbackId}|: argument rehydration failed`,\n error instanceof Error ? error.message : error,\n )\n report(\n 'the interaction could not be delivered: its argument could not be read',\n )\n break\n }\n try {\n // Awaited so an async handler's rejection is caught here rather\n // than becoming an unhandled rejection in the consume callback —\n // which, `noAck` and outside any message context, was the one way\n // a thrown handler could take the whole process down.\n await entry.callback(arg)\n } catch (error) {\n logger.error(\n `Requence: callback |${backchannelMessage.payload.callbackId}| threw:`,\n error instanceof Error\n ? (error.stack ?? error.message)\n : error,\n )\n report(`the handler failed: ${errorText(error)}`)\n }\n break\n }\n }\n },\n {\n noAck: true,\n },\n )\n },\n })\n\n // ChannelWrapper is an EventEmitter; an unhandled 'error' would otherwise\n // propagate. Observe it rather than letting it surface as an uncaught error.\n channelWrapper.on('error', (err: Error) => {\n if (!silent) {\n logger.error('Requence AMQP channel error:', err.message)\n }\n })\n\n /**\n * Say on the surface that this process could not run an interaction (#107).\n *\n * The only feedback channel an interaction has once it has been accepted. The\n * mutation behind a click returns *accepted* long before the invocation reaches\n * here — for a durable handler, possibly a redeploy before — so there is no\n * request to fail, no message to abort, and for a durable handler no connection\n * the viewer ever had. What is left is the surface itself, which the viewer is\n * still looking at.\n *\n * Published on the ordinary result exchange with a marker header and **no**\n * correlation id or index: a handler invocation is not a dispatch of the\n * operator's, so it has no message to be a result FOR, which is exactly why the\n * operator answers this header before everything else on that path.\n *\n * Fire-and-forget, and never fatal: this is the report of a failure, and a\n * failure to report it must not become a second one. Unconditional, `silent`\n * included, for the reason every miss here is logged unconditionally — `silent`\n * suppresses connection noise, not a lost interaction.\n */\n const reportInteractionFailure = (params: {\n taskId: string\n surface: string\n message: string\n }) => {\n void channelWrapper\n .publish(\n exchange,\n '',\n Buffer.from(\n JSON.stringify({\n surface: params.surface,\n // Truncated at the source as well as in the update schema: what keeps\n // this publish bounded is the cut made before it, and a thrown error's\n // message is author text of no bounded length.\n message: params.message.slice(\n 0,\n MAX_SURFACE_INTERACTION_ERROR_CHARS,\n ),\n }),\n ),\n {\n contentType: 'application/json',\n persistent: true,\n headers: {\n taskId: params.taskId,\n [SURFACE_INTERACTION_ERROR_HEADER]: true,\n },\n },\n )\n .catch((error: unknown) => {\n logger.error(\n `Requence: could not report a failed surface interaction on |${params.surface}|:`,\n error instanceof Error ? error.message : error,\n )\n })\n }\n\n /**\n * Say that this process has re-attached to a deferred node (#271) — the moment\n * the node starts working again.\n *\n * Nobody else can say it. The operator dispatched this message days ago and\n * hears nothing when someone picks it up: `act()` publishes no `begin`, and\n * `context.defer()` is not on its actor API, so a run defers at most once and\n * without this the defer runs to the end of the run. A form deferred three days\n * whose handler then spends four minutes building a PDF reported one second of\n * work.\n *\n * Published on the ordinary result exchange with a marker header and **no\n * index**, the route the failure report above and the bundle swap below already\n * use — because it takes no place in the message's ordered output stream. The\n * other way to say this, a `begin`, lands on the operator's begin-rewind, which\n * resets a deferred message's index space; that rewind is what keeps a\n * re-attach's render from being discarded as a duplicate. It carries the\n * correlation id anyway, since unlike those two it does belong to a message.\n *\n * Enqueued before the actor runs, so it is ordered ahead of everything the actor\n * publishes and ahead of the `done`. Fire-and-forget and never fatal: an\n * announcement that could fail the work it announces would be worse than no\n * announcement.\n */\n const announceResume = (params: { taskId: string; messageId: string }) => {\n void channelWrapper\n .publish(\n exchange,\n '',\n Buffer.from(JSON.stringify({ messageId: params.messageId })),\n {\n correlationId: params.messageId,\n contentType: 'application/json',\n persistent: true,\n headers: {\n taskId: params.taskId,\n [NODE_RESUME_HEADER]: true,\n },\n },\n )\n .catch((error: unknown) => {\n logger.error(\n `Requence: could not announce the resume of message |${params.messageId}|:`,\n error instanceof Error ? error.message : error,\n )\n })\n }\n\n /**\n * The dev loop (#108): a rebuilt component is a **bundle swap**, not a render.\n *\n * A rebuild changes which bytes the frame imports and nothing else, so nothing\n * about the render that drew a surface is an input here — not its props, not\n * its handlers, not whether the message that published it is still unsettled.\n * That last one is what the re-issue this replaced could never get past: a\n * deferring handler returns at the defer, taking its callback registry with it,\n * so a deferred form could not be iterated on without starting a new task for\n * every edit. Now the notice names the session and the component, ui/backend\n * repoints the rows, and every surface — a live panel, a deferred form, one\n * on a task that finished last week — swaps identically.\n *\n * Published on the ordinary result exchange with a marker header and **no**\n * correlation id, index or task: a rebuild is not a result for any dispatch of\n * the operator's, which is why the operator answers this header before it looks\n * for either.\n *\n * Fire-and-forget and never fatal, like the failure report above: the dev loop\n * is an addition to a running service, not a reason for one to fall over.\n */\n const publishBundleSwap = (ui: MutableRequenceUI) => {\n const swap: UiRebuild = {\n devSession,\n uiId: ui.id,\n hash: ui.hash,\n // Always, unlike a render's: this hash is new to everyone by definition,\n // and the surfaces this repoints are exactly the ones that would otherwise\n // name a bundle nobody stored.\n source: ui.source,\n }\n\n void channelWrapper\n .publish(exchange, '', Buffer.from(JSON.stringify(swap)), {\n contentType: 'application/json',\n persistent: true,\n headers: { [UI_REBUILD_HEADER]: true },\n })\n .then(() => {\n if (!silent) {\n logger.info(\n `Requence: component |${ui.id}| rebuilt (${ui.hash.slice(0, 12)}) — swapped on every surface of this dev session`,\n )\n }\n })\n .catch((error: unknown) => {\n logger.error(\n `Requence: could not publish the rebuild of |${ui.id}|:`,\n error instanceof Error ? error.message : error,\n )\n })\n }\n\n // Only a dev-mode connection turns the watch on; `createUI` itself registers\n // unconditionally and starts nothing.\n const stopUIWatch = devSession\n ? watchUIRebuilds({\n onRebuild: publishBundleSwap,\n // The watch is process-global; `silent` is this connection's. It\n // reports, we decide.\n onWarning: (warning) => {\n if (!silent) {\n logger.warn(warning)\n }\n },\n })\n : undefined\n\n /**\n * Runs one durable handler invocation (#103): resolve `(uiId, path)` against\n * the components this process registered at module scope, and call the\n * function sitting there in that UI's default props.\n *\n * No context is injected, deliberately — a durable handler reaches whatever it\n * needs (`service.act()`, its own stores) through its own closure, which is\n * the same closure a module-scope function has in any other process of this\n * version. That is what \"durable\" means here.\n *\n * Every miss is **said out loud** rather than dropped: the click that produced\n * it is long gone, the mutation behind it returned *accepted*, and this\n * process is the only party that can tell an author their component named\n * something that does not exist. Unconditional, `silent` included: `silent`\n * suppresses connection noise, not a lost interaction.\n *\n * And every miss that can name a surface is also **recorded on it** (#107),\n * which is the half a viewer can see: this process's stderr is nowhere near the\n * person who pressed the button, least of all for the case that motivated it — a\n * durable handler running minutes later, in an instance the viewer never had a\n * connection to. A malformed payload is the one exception, and necessarily: it\n * is the only miss that cannot say which surface it was for.\n */\n const runHandlerInvocation = async (raw: unknown) => {\n const parsed = surfaceHandlerInvocationSchema.safeParse(raw)\n if (!parsed.success) {\n logger.error(\n 'Requence: dropped a malformed surface handler invocation:',\n parsed.error.message,\n )\n return\n }\n const { taskId, surface, uiId, path, arg } = parsed.data\n const where = `UI |${uiId}| prop |${path.join('.') || '<root>'}| (task |${taskId}|)`\n const report = (message: string) =>\n reportInteractionFailure({ taskId, surface, message })\n\n const ui = findUIById(uiId)\n if (!ui) {\n logger.error(\n `Requence: no component registered as |${uiId}| — dropped a handler invocation for ${where}`,\n )\n report(\n `the service has no component registered as \"${uiId}\", so nothing ran the handler`,\n )\n return\n }\n\n // Resolved against the DEFAULTS, because that is the only place a durable\n // handler can have been written: a function in a render's own props closes\n // over that render's process and never gets a durable reference. An empty\n // path would name the defaults object itself, which is never a function.\n const handler: unknown = getByPath(\n ui.defaults as Record<string, unknown> | undefined,\n path,\n )\n if (typeof handler !== 'function') {\n logger.error(\n `Requence: no handler at ${where} — the component's defaults have ${\n handler === undefined ? 'nothing' : typeof handler\n } there`,\n )\n report(\n `this component has no handler at \"${path.join('.') || '<root>'}\", so nothing ran`,\n )\n return\n }\n\n try {\n await (handler as (value: unknown) => unknown)(arg)\n } catch (error) {\n // Caught here rather than left to the consumer's own catch, which is one\n // frame too far out to know which surface this was: the *report* needs the\n // parsed invocation. Rethrown so that frame still logs the stack and acks.\n report(`the handler failed: ${errorText(error)}`)\n throw error\n }\n }\n\n // The per-version handler queue, consumed alongside the dispatch queue and on\n // a channel of its own: a durable invocation is not a dispatch, and sharing\n // the dispatch channel would put it behind that channel's prefetch — so one\n // long-running LINEAR message would stall every click on the version.\n //\n // Competing consumers by design: a durable handler belongs to the service\n // VERSION, so whichever instance is free serves it, and an invocation with no\n // instance running waits in the queue instead of being lost.\n const handlerQueue = serviceHandlerQueueName(queue)\n const handlerChannelWrapper = connection.createChannel({\n async setup(channel: ConfirmChannel) {\n // Asserted rather than checked, unlike the dispatch queue: ui/backend's\n // provisioner asserts it too (which is what makes it exist BEFORE any\n // instance runs, so an invocation can wait out a redeploy), but a service\n // must not fail to start against a broker whose version assert has not\n // caught up. Both sides declare the same shared literal, because a\n // mismatch is a 406 that kills this channel. In a dev session the queue is\n // this overlay's own, so nobody else asserts it at all, and these\n // arguments are the only ones it ever gets.\n //\n // The TTL is what stops the queue being a mailbox (#116): an invocation\n // nobody consumes expires instead of running whenever someone next\n // deploys, and dead-letters back to the operator so the viewer is told.\n await channel.assertQueue(handlerQueue, SURFACE_HANDLER_QUEUE_ARGUMENTS)\n await channel.bindQueue(handlerQueue, 'service', handlerQueue)\n await channel.prefetch(prefetch)\n await channel.consume(handlerQueue, async (message) => {\n if (!message) {\n return\n }\n try {\n await runHandlerInvocation(JSON.parse(message.content.toString()))\n } catch (error) {\n // A throwing handler is the author's bug and there is no request left\n // to fail (#107 puts it back on the surface). Reported and acked: a\n // requeue would rerun a side-effecting handler forever.\n logger.error(\n 'Requence: surface handler threw:',\n error instanceof Error ? (error.stack ?? error.message) : error,\n )\n }\n safeAck(channel, message)\n })\n },\n })\n\n /**\n * Runs the callback a durable invocation names (#147).\n *\n * It is given the bound data, the graph's argument and the node's static\n * configuration, and nothing else — no message, no connection, no task\n * context. That is the whole of what makes it durable: this instance may have\n * been started long after the one that emitted the reference exited.\n */\n async function runDurableCallbackInvocation(payload: unknown) {\n const parsed = durableCallbackInvocationSchema.safeParse(payload)\n if (!parsed.success) {\n // Unconditional, like the misses below: `silent` suppresses connection\n // noise, not an invocation nobody will ever hear about again.\n logger.error(\n 'Requence: dropped a malformed durable callback invocation — it does not name a callback this build can run',\n )\n return\n }\n\n const { name, bound, arg, configuration, taskId, nodeId } = parsed.data\n const registration = findDurableCallback(name)\n if (!registration) {\n // Loud, and it says which run is affected: there is no request left to\n // fail — the graph called the callback and moved on — so the only way this\n // is ever seen is if somebody says it. A name that resolves to nothing is\n // a deployed version that no longer declares what an emitted reference\n // names, which is exactly the case worth hearing about.\n throw new Error(\n `no durable callback registered as \"${name}\" — a reference naming it was emitted by node ${nodeId} of task ${taskId}, and this version declares none`,\n )\n }\n\n await registration.handler(\n arg,\n durableCallbackContext(name, bound, configuration),\n )\n }\n\n // The per-version callbacks queue, alongside the handler queue and for the\n // same reasons (#147): its own channel, so a durable invocation never queues\n // behind a long-running LINEAR dispatch; competing consumers, so whichever\n // instance of the version is free serves it; and a queue rather than a live\n // connection, so an invocation waits out a redeploy instead of dying with the\n // process that emitted the reference.\n const callbackQueue = serviceCallbackQueueName(queue)\n const callbackChannelWrapper = connection.createChannel({\n async setup(channel: ConfirmChannel) {\n // Asserted, not checked, and from the literal both parties share — see the\n // handler queue above: the provisioner's assert is what makes the queue\n // exist before any instance runs, this one is what keeps a service\n // startable against a broker that assert has not reached, and a mismatch\n // between the two is a 406 that kills this channel.\n await channel.assertQueue(callbackQueue, DURABLE_CALLBACK_QUEUE_ARGUMENTS)\n await channel.bindQueue(callbackQueue, 'service', callbackQueue)\n await channel.prefetch(prefetch)\n await channel.consume(callbackQueue, async (message) => {\n if (!message) {\n return\n }\n try {\n await runDurableCallbackInvocation(\n JSON.parse(message.content.toString()),\n )\n } catch (error) {\n // Acked either way: a requeue would rerun a side-effecting callback\n // forever, and a callback is the one thing a graph asked for\n // explicitly.\n logger.error(\n 'Requence: durable callback threw:',\n error instanceof Error ? (error.stack ?? error.message) : error,\n )\n }\n safeAck(channel, message)\n })\n },\n })\n\n callbackChannelWrapper.on('error', (err: Error) => {\n if (!silent) {\n logger.error('Requence AMQP callback channel error:', err.message)\n }\n })\n\n handlerChannelWrapper.on('error', (err: Error) => {\n if (!silent) {\n logger.error('Requence AMQP handler channel error:', err.message)\n }\n })\n\n const publish = ({\n data,\n outputName,\n messageId,\n priority,\n ...headers\n }: {\n index: number\n data?: unknown\n outputName?: string | null\n messageId: string\n taskId: string\n priority?: number\n version: string\n debugMethod?: 'log' | 'warn' | 'info' | 'error'\n debug?: boolean\n // Marks a `context.render` payload (component + props + surface). Like\n // `debug`, it is a side-channel the operator forwards as a task update\n // rather than graph output — but it rides the ordered dispatch buffer, so\n // two renders of one surface can never be re-ordered into a stale one.\n render?: boolean\n connectionId?: string\n callbackId?: string\n // The durable arm's address (#150): the declared name and the node whose\n // version serves it, in place of the connection pair above. The operator\n // routes on which of the two is present.\n callbackName?: string\n callbackNodeId?: string\n // Which node published an invocation — see `invocationHeaders`. Not an\n // address: it is what lets the operator name the invoking node without a\n // message record that may already be gone.\n invokingNodeId?: string\n propertyPath?: (string | number)[]\n begin?: boolean\n deferred?: boolean\n done?: boolean\n // Privileged result protocol: `overwrite` marks a data message whose\n // value replaces (instead of merges into) downstream aggregation. The\n // operator honors it only for privileged nodes. Flows through via\n // `...headers`.\n overwrite?: boolean\n // Per-attempt id: identifies this consume-handler invocation so the\n // operator can fence a superseded attempt's stragglers on the same\n // messageId. Flows through via `...headers`.\n epoch?: string\n // Who ran this node, stamped on the `begin` publish ONLY (see\n // `buildServiceIdentityHeaders`). The operator freezes these into the\n // NODE_START update; they are display-only and nothing branches on them.\n libVersion?: string\n serviceName?: string\n capabilities?: string\n // `'1'` / `'0'`, always present on a begin publish: does this run occupy one\n // of the dispatch channel's prefetch slots? Never omitted, so \"holds no\n // slot\" cannot be read as \"too old to report\".\n holdsSlot?: string\n }) => {\n const { body, contentType } = encodeWireBody(\n data ?? null,\n messageCodecs.get(messageId) ?? 'json',\n )\n\n // Guard the body size before it hits the broker. An oversized publish makes\n // RabbitMQ drop the whole connection, which amqplib reports as a generic\n // \"channel closed\" for every in-flight message — impossible to attribute to\n // size after the fact. Rejecting here yields a precise, catchable error and\n // leaves the connection intact for other messages.\n if (body.byteLength > maxMessageSize) {\n return Promise.reject(\n new PayloadTooLargeError(body.byteLength, maxMessageSize),\n )\n }\n\n return channelWrapper.publish(exchange, '', body, {\n correlationId: messageId,\n contentType,\n persistent: true,\n priority,\n headers: {\n outputName: outputName ?? null,\n connectionId,\n ...headers,\n },\n })\n }\n\n /**\n * Everything a publish on behalf of one message needs, and the whole of what\n * differs between the two publish paths — the main path's consume handler and an\n * `act()` call. Shared by {@link buildSendApi} and {@link buildRender} so the\n * two cannot drift apart: they publish for the same message, through the same\n * boundary, on the same index counter.\n *\n * `epoch`/`priority` are main-path-only (an `act()` call is not a consume\n * attempt) and are omitted from the published headers when absent, keeping the\n * deferred path's output byte-identical to what it always was.\n */\n type PublishDeps = {\n outbound: OutboundBoundary\n registerCallback: (\n callback: (...args: any[]) => void,\n // Where the function was written, for the growth warning (#151) — the\n // walk's path for a callback, the payload path for a handler prop.\n path: ReadonlyArray<string | number>,\n ) => {\n sourceId: string\n callbackId: string\n }\n taskId: string\n messageId: string\n nextIndex: () => number\n epoch?: string\n priority?: number\n // act() only: wait for the deferring message's own processing to finish.\n gate?: () => Promise<void>\n }\n\n // The privileged send API (unit 05 headers), shared by the main-path handler\n // context and act()'s ActorApi: imperative data publishes through the\n // caller's outbound boundary, enrolled in its ledger so `settle()` gates the\n // done marker on them — a final emission mechanically flushes before `done`.\n const buildSendApi = (deps: PublishDeps) => {\n const base = {\n ...(deps.epoch === undefined ? {} : { epoch: deps.epoch }),\n ...(deps.priority === undefined ? {} : { priority: deps.priority }),\n }\n return {\n async sendToOutput(\n outputName: string,\n data: unknown,\n options?: { overwrite?: boolean },\n ) {\n await deps.gate?.()\n deps.outbound.track(\n publish({\n index: deps.nextIndex(),\n version,\n messageId: deps.messageId,\n taskId: deps.taskId,\n data: await deps.outbound.send(data, {\n outputName: outputName as string | null,\n onCallback: deps.registerCallback,\n }),\n outputName: outputName as string | null,\n // only set when requested — omitted publishes stay identical\n ...(options?.overwrite ? { overwrite: true } : {}),\n ...base,\n }),\n )\n },\n async send(data: unknown, options?: { overwrite?: boolean }) {\n await deps.gate?.()\n deps.outbound.track(\n publish({\n index: deps.nextIndex(),\n version,\n messageId: deps.messageId,\n taskId: deps.taskId,\n data: await deps.outbound.send(data, {\n outputName: null,\n onCallback: deps.registerCallback,\n }),\n ...(options?.overwrite ? { overwrite: true } : {}),\n ...base,\n }),\n )\n },\n }\n }\n\n // The render publish, shared by `context.render` on the main path and\n // `send.render` inside `act()` (#70). Everything that differs between the two\n // paths is a dep — the index counter, the callback registrar, the attempt\n // headers, and act()'s gate on the deferring message's own processing — so a\n // surface behaves identically whoever published it, which is what makes the\n // dev loop, the hash bookkeeping and the liveness rule path-agnostic.\n const buildRender = (deps: PublishDeps) => {\n /**\n * One function prop → one handler reference (#103). The **path decides the\n * lifetime**, because the path is where the function was written:\n *\n * - `defaults.*` — module scope. Any instance of this version can run it,\n * now or after a redeploy, so the reference names only the UI and the prop\n * and the invocation goes to the version's handler queue. Nothing is\n * registered here: there is nothing to keep alive, and that is the point.\n * - `props.*` — written at this render call, closing over the running\n * handler. Only this process can run it, so it registers in the publishing\n * message's own registry and dies with it, exactly as a callback does —\n * including the refusal on a LINEAR handler, whose registry entries are\n * gone the moment it returns.\n *\n * The path the reference carries is relative to the **props the component\n * receives**, not to the payload: the two layers fold into one object at\n * ingestion (#102), and the browser names a path in what it was served.\n */\n const registerSurfaceHandler = (\n ui: RequenceUI,\n handler: (...args: unknown[]) => void,\n payloadPath: ReadonlyArray<string | number>,\n ): SurfaceHandlerObject => {\n const [layer, ...path] = payloadPath\n if (layer === 'defaults') {\n return {\n __REQUENCE_type: SURFACE_HANDLER_TAG,\n lifetime: 'durable',\n uiId: ui.id,\n path,\n }\n }\n if (layer !== 'props') {\n // Only the two author-supplied layers can hold a function; anything\n // else is the SDK's own payload and a function there is a bug here.\n throw new Error(\n `a function in a render payload is only a handler under props or defaults (found at \"${payloadPath.join('.')}\")`,\n )\n }\n // Counted like a callback, under its full payload path: it is the same\n // registry and the same growth, and a render in a loop is the same mistake.\n // The `props.` prefix is what tells the author it was a handler prop (#151).\n const { sourceId, callbackId } = deps.registerCallback(\n handler,\n payloadPath,\n )\n return {\n __REQUENCE_type: SURFACE_HANDLER_TAG,\n lifetime: 'connection',\n uiId: ui.id,\n path,\n connectionId: sourceId,\n handlerId: callbackId,\n }\n }\n\n const renderSurface = (params: {\n ui: RequenceUI\n props: unknown\n surfaceId: string\n }): void => {\n // The index is taken NOW, not when the serialization resolves: the\n // operator dispatches a message's results in index order, so\n // allocating here is what makes two renders of one surface arrive\n // in call order. The cost is a hole in the buffer if the\n // serialization fails — moot for a message that settles: the publish is\n // tracked, so the same failure fails the node at the caller's settle gate.\n const index = deps.nextIndex()\n // Per (task, component), never per component: see `sentComponents`. The\n // hash is read at call time, not at registration, because the dev loop\n // rewrites it in place (D10).\n const sentKey = `${deps.taskId}:${params.ui.hash}`\n const withSource = !sentComponents.has(sentKey)\n if (withSource) {\n sentComponents.add(sentKey)\n }\n\n const issue = () =>\n deps.outbound\n .send(\n {\n // `id` rides along on every render, source-carrying or not: it is\n // what a dev-loop bundle swap addresses the surface by (#108), and\n // the surface row it lands on is last-write-wins.\n component: withSource\n ? {\n id: params.ui.id,\n hash: params.ui.hash,\n source: params.ui.source,\n }\n : { id: params.ui.id, hash: params.ui.hash },\n props: params.props,\n // Restated on every render, and deliberately NOT merged into the\n // props above (#102): the receiver folds them *under* the surface's\n // stored props, so a default is overridden by anything any render\n // of that surface ever said, while this render's props override\n // everything. Merging here — what #101 did — would collapse the two\n // ranks into one and let a default clobber an earlier override.\n //\n // Read off the handle at call time, like the hash, so the next\n // render after a rebuild carries whatever it changed them to.\n // Omitted entirely when the component declared none, keeping that\n // payload byte-identical to what it always was.\n ...(params.ui.defaults === undefined\n ? {}\n : { defaults: params.ui.defaults }),\n surfaceId: params.surfaceId,\n // Stamped on every surface this connection draws, so a rebuild can\n // find them again and repoint them (#108) — and find only them: a\n // developer's edit must never reach a production surface of the\n // same component. `null` outside a dev overlay, which is every\n // render a deployed service makes.\n devSession: devSession || null,\n },\n {\n outputName: null,\n // The claim-check may offload an oversized render — but\n // never the bundle: the operator parses `component.hash`\n // out of the body, so a reference there is unreadable.\n // Pinned rather than left to the sizes falling the right\n // way (props larger than the ≤1 MiB source), which only\n // holds while the task's threshold is the 4 MiB default.\n //\n // `defaults` is pinned because it is the base layer of the\n // surface's fold — offloaded, it would silently take every prop\n // the service never restates out of the surface, and every\n // durable handler with them. `props` stays the only candidate,\n // which is what makes an oversized render a named error state\n // rather than a broken surface.\n inlineKeys: ['component', 'defaults'],\n // Switches this send onto the render egress chain, where a\n // function is a surface handler rather than a peer callback\n // (#103). Which of the two lifetimes it gets is decided by where\n // it was written, which the walk reports as the path.\n onSurfaceHandler: (handler, path) =>\n registerSurfaceHandler(params.ui, handler, path),\n },\n )\n .then((data) =>\n publish({\n index,\n version,\n messageId: deps.messageId,\n taskId: deps.taskId,\n data,\n render: true,\n // Omitted rather than passed as `undefined` when absent, so\n // act()'s publishes keep the header set they always had.\n ...(deps.priority === undefined\n ? {}\n : { priority: deps.priority }),\n ...(deps.epoch === undefined ? {} : { epoch: deps.epoch }),\n }),\n )\n\n // The gate is awaited before the payload is built, never before the index\n // is taken — the slot has to be reserved in call order even when the\n // publish itself has to wait.\n const gated = deps.gate?.()\n deps.outbound.track(\n (gated ? gated.then(issue) : issue()).catch((error: unknown) => {\n // The source never left, so the next render of this component into\n // this task must carry it again — otherwise ui/backend would receive a\n // hash it has never seen and show an error state.\n if (withSource) {\n sentComponents.delete(sentKey)\n }\n throw error\n }),\n )\n }\n\n return renderSurface\n }\n\n channelWrapper.addSetup(async (channel: ConfirmChannel) => {\n channel.consume(queue, async (message) => {\n if (!message) {\n return\n }\n\n let publishIndex = 0\n let acked = false\n let terminated = false\n const registeredCallbackIds = new Set<string>()\n let resolveActiveMessage = () => {}\n // Captured for the finally block; header parsing now happens inside the\n // try so a malformed header goes through the error handling below instead\n // of throwing out of this async consumer as an unhandled rejection.\n let messageIdForCleanup: string | undefined\n // One epoch per consume-handler invocation (declared out here so the\n // catch-branch republishes can stamp it too). On redelivery/reconnect a\n // second invocation gets a fresh epoch, letting the operator tell the\n // attempts apart and fence the superseded one.\n const epoch = crypto.randomUUID()\n\n try {\n const { messageId, taskId, mode } = headerSchema.parse(message)\n messageIdForCleanup = messageId\n\n // The capability gate, ahead of everything the dispatch could ask of\n // this build — including its own decoding. A requirement stated in the\n // body would be unreadable exactly when it matters, so it rides in the\n // headers and is checked here, before `payloadSchema` touches the bytes.\n //\n // An empty requirement (every message published before this existed)\n // passes untouched.\n const unsupported = unsupportedCapabilities(\n readRequiredCapabilities(message.properties.headers),\n )\n if (unsupported.length > 0) {\n throw new UnsupportedCapabilityError(unsupported)\n }\n\n // Recorded before anything can publish, so every reply on this message —\n // including one from an error path — echoes the codec it arrived under.\n const dispatchCodec = wireCodecFromContentType(\n message.properties.contentType,\n )\n messageCodecs.set(messageId, dispatchCodec)\n\n let deferred = false\n let deferredReason: string | null = null\n\n const messageExecution = Promise.withResolvers<void>()\n activeMessages.set(messageId, messageExecution.promise)\n messageExecution.promise.then(() => {\n activeMessages.delete(messageId)\n })\n resolveActiveMessage = () => {\n messageExecution.resolve()\n }\n\n const payload = payloadSchema.parse(message)\n\n // The per-message abort controller is hoisted out of\n // createContextHelper so the outbound boundary can share its signal.\n const abortController = new AbortController()\n\n // Names the run in the warning (#151), so an author with several tasks\n // open knows which one to go and look at.\n const growth = callbackGrowth.forDelivery({ taskId })\n\n // One callback registrar for every egress sub-path (result, deferred\n // send, callback arg). Registered callbacks carry this message's\n // dispatcher so nested functions in their invocation arguments\n // reconstruct invokable (chaining).\n const registerCallback = (\n callback: (...args: any[]) => void,\n path: ReadonlyArray<string | number>,\n ) => {\n const callbackId = crypto.randomUUID()\n registeredCallbackIds.add(callbackId)\n callbacks.set(callbackId, {\n callback,\n onCallbackInvoke: dispatchInvocation,\n })\n // After the entry is in, so the connection count the warning states is\n // the number this process is holding. Never refuses and never evicts:\n // a cap kills a legitimate long-lived handle at an arbitrary number\n // that nobody can set correctly.\n growth.record(path)\n return { sourceId: connectionId, callbackId }\n }\n\n // The component's single outbound boundary: owns ctx construction,\n // the background-upload ledger (done-gate) and the fail policy.\n // Fail-hard sends surface via outbound.settle() before the done\n // marker + ack; best-effort (log) sends degrade to warnings.\n const outbound = createOutboundBoundary({\n uploadUrl: payload.options.uploadUrl,\n streamUrl: payload.options.streamUrl,\n maxPayloadSize: payload.options.maxPayloadSize,\n maxFileSize: payload.options.maxFileSize,\n // What a durable callback reference emitted on this message is\n // addressed by (#150).\n nodeId: payload.nodeId,\n // Replies echo the dispatch codec, so the claim-check must measure\n // with it too — measured size == published size.\n wireCodec: dispatchCodec,\n signal: abortController.signal,\n warn: (msg, error) =>\n logger.warn(\n `${msg} (task ${taskId})`,\n error instanceof Error ? error.message : (error ?? ''),\n ),\n })\n\n // This message's single invocation egress: callback arguments are\n // real node output (they carry an outputName), so they go through the\n // same boundary as results — nested files offload, nested functions\n // become callbacks. The send + publish are tracked in the boundary's\n // ledger, so a failure fails the task at the settle gate. Used both\n // for callbacks arriving in this message's input (via\n // createContextHelper) and for callbacks this message registers\n // (chained invocations dispatched from the backchannel).\n const dispatchInvocation = (\n invocation: CallbackObject & { arg: unknown },\n ) => {\n outbound.track(\n outbound\n .send(invocation.arg, {\n outputName: invocation.outputName,\n onCallback: registerCallback,\n })\n .then((data) =>\n publish({\n index: 0,\n version,\n taskId,\n messageId,\n data: invocationPayload(invocation, data),\n outputName: invocation.outputName,\n propertyPath: invocation.propertyPath,\n ...invocationHeaders(invocation, payload.nodeId),\n epoch,\n }),\n ),\n )\n }\n\n // This message's publish context: one index counter, one boundary, one\n // attempt. Shared by the privileged send API below and by the render.\n const publishDeps: PublishDeps = {\n outbound,\n registerCallback,\n taskId,\n messageId,\n nextIndex: () => publishIndex++,\n epoch,\n priority: message.properties.priority,\n }\n\n const onRender = buildRender({\n ...publishDeps,\n // The one deliberate difference on this path: a function written at\n // the render call becomes a reference to THIS message's registry, so\n // it is live exactly as long as the message — and a non-generator\n // handler cannot hold one at all, because its registry entries go the\n // moment it returns.\n //\n // A function in the UI's DEFAULTS never reaches here: it is durable,\n // registers nothing, and is therefore the one handler a LINEAR\n // handler can publish — which is exactly what lets a form outlive the\n // process that drew it (#103).\n //\n // Worded for the surface author rather than reusing the result path's\n // callback wording: what this catches is a function in RENDER PROPS,\n // and naming the fix matters more than naming the rule. The tempting\n // shape is a promise the render's own handler resolves — which would\n // hold the message open for a human-speed wait, on an unacked\n // delivery a redeploy hands to another instance. `defer` plus a\n // durable default is that same form, written so it survives.\n registerCallback: canRegisterCallbacks\n ? registerCallback\n : () => {\n throw new Error(\n 'A LINEAR version handler may not register function props — the registration dies when the handler returns. To wait for a viewer, call context.defer() and declare the handler in the UI defaults instead: a durable handler outlives this process.',\n )\n },\n })\n\n const [extendedContext, terminatePromise] = (await createContextHelper({\n taskId,\n // Rehydration (FileObject/StreamObject -> RequenceFile/RequenceStream)\n // happens inside createContextHelper via its inbound boundary — the\n // signal-aware pass whose instances reach the handler.\n input: payload.input,\n configuration: payload.configuration,\n abortController,\n passthroughByteReferences,\n // The whole of what a node needs to address a slot (#210): the two\n // opaque fields ui/backend minted for this tree, plus the two ids the\n // dispatch already carries. The service composes no address and holds\n // no store password — the store builds the address from the\n // capability.\n store: createStore({\n url: payload.options.storeUrl,\n signature: payload.options.storeSignature,\n taskId,\n nodeId: payload.nodeId,\n configuration: payload.configurationEval,\n }),\n // Privileged send API on the handler ctx (runtime-only, hidden from\n // the ContextHelper type): shares this message's outbound boundary,\n // publishIndex counter, epoch and priority.\n sends: {\n ...buildSendApi(publishDeps),\n // Passthrough consumers hold raw callback wire refs — this is\n // their invocation egress, routed through the same\n // dispatchInvocation as a rehydrated callback call (fire-and-\n // forget; the outbound ledger settles the publish).\n invokeCallback: (ref, arg) => dispatchInvocation({ ...ref, arg }),\n options: payload.options,\n },\n onLog(debugMethod, data) {\n // Best-effort: a debug log must never fail the task. The boundary\n // sanitizes the payload (functions/opaque instances → labels),\n // degrades offload failures to warnings, and keeps the done-gate\n // waiting for the upload without letting it fail the task. On a\n // transform error it resolves `undefined` and nothing is published.\n void outbound.send(data, { bestEffort: true }).then((mapped) => {\n if (mapped === undefined) {\n return\n }\n publish({\n index: publishIndex++,\n version,\n messageId,\n taskId,\n data: mapped,\n debugMethod,\n priority: message.properties.priority,\n debug: true,\n epoch,\n })\n })\n },\n onRender,\n onDefer(reason) {\n deferred = true\n deferredReason = reason || null\n\n return obfuscate(\n taskId,\n messageId,\n payload.options.uploadUrl ?? '',\n payload.options.streamUrl ?? '',\n payload.options.maxPayloadSize?.toString() ?? '',\n payload.options.maxFileSize?.toString() ?? '',\n payload.nodeId ?? '',\n )\n },\n onCallback: dispatchInvocation,\n })) as unknown as [\n MessageHandlerContext<V>,\n PromiseWithResolvers<string>,\n ]\n\n await publish({\n index: publishIndex++,\n version,\n messageId,\n taskId,\n priority: message.properties.priority,\n begin: true,\n epoch,\n // The one stamp per node execution: this build, this box. It becomes\n // the NODE_START update's `service`, which is written once and never\n // re-derived — so anything absent here is lost for that run.\n ...buildServiceIdentityHeaders({\n libVersion: libVersion(),\n name,\n // Read the ack decision immediately below: a CONTINUOUS generator\n // acks straight away and frees its slot, so its run holds none.\n // Every other combination stays unacked until the work is done.\n // ui/backend cannot derive this — it knows the mode from the node\n // but not whether the author wrote a generator.\n holdsSlot: !(isGeneratorHandler && mode === 'CONTINUOUS'),\n }),\n })\n\n if (isMessageHandlerGenerator(messageHandler)) {\n if (mode === 'CONTINUOUS') {\n // CONTINUOUS: ACK immediately, operator watchdog supervises. A\n // LINEAR message stays unacked until done — prefetch keeps\n // bounding concurrent work and the broker redelivers on a crash.\n safeAck(channel, message)\n acked = true\n }\n\n const generator = messageHandler(extendedContext)\n const terminationPromise = Promise.withResolvers<typeof abortSymbol>()\n generatorTerminators.set(messageId, (reason) => {\n terminated = true\n // Suppress native AbortError that may reject generator.return() when\n // context.terminated.signal fires and cancels a pending await inside\n // the generator (e.g. node:timers/promises setTimeout with { signal }).\n ;(generator.return() as Promise<unknown>).catch(\n (error: unknown) => {\n if (\n terminated &&\n error instanceof Error &&\n error.name === 'AbortError' &&\n !(error instanceof AbortError)\n ) {\n return\n }\n throw error\n },\n )\n terminationPromise.resolve(abortSymbol)\n terminatePromise.resolve(reason)\n })\n\n await handlerStorage.run(\n extendedContext as ContextHelper,\n async () => {\n while (true) {\n type IterResult = IteratorResult<\n MessageHandlerReturnValue<V, null>,\n void | MessageHandlerReturnValue<V, null>\n >\n // Catch native AbortError from context.terminated.signal so\n // generator implementations don't need their own try/catch.\n const nextPromise = Promise.resolve(generator.next()).then(\n (r) => r,\n (error: unknown) => {\n if (\n terminated &&\n error instanceof Error &&\n error.name === 'AbortError' &&\n !(error instanceof AbortError)\n ) {\n return { value: undefined, done: true } as IterResult\n }\n throw error\n },\n )\n const next = await Promise.race([\n terminationPromise.promise,\n nextPromise,\n ])\n if (next === abortSymbol) {\n break\n }\n\n const { value: result, done } = next\n\n if (deferred) {\n deferred = false\n logger.warn(\n 'returning a value in a deferred message resets the deferred status',\n )\n }\n\n const { value: rawValue, outputName } =\n unwrapOutputValue(result)\n const value = await outbound.send(rawValue, {\n outputName,\n onCallback: registerCallback,\n })\n\n if (!done || typeof value !== 'undefined') {\n await publish({\n index: publishIndex++,\n version,\n messageId,\n taskId,\n data: value,\n priority: message.properties.priority,\n outputName,\n epoch,\n })\n }\n\n if (done) {\n break\n }\n }\n },\n )\n } else {\n const result = await handlerStorage.run(\n extendedContext as ContextHelper,\n () => messageHandler(extendedContext),\n )\n const { value: rawValue, outputName } = unwrapOutputValue(result)\n const value = await outbound.send(rawValue, {\n outputName,\n onCallback: () => {\n throw new Error(\n 'callbacks can only be used in generator functions',\n )\n },\n })\n if (deferred && value) {\n logger.warn(\n 'returning a value in a deferred message resets the deferred status',\n )\n deferred = false\n }\n\n if (!deferred || value) {\n await publish({\n index: publishIndex++,\n version,\n messageId,\n taskId,\n data: value,\n priority: message.properties.priority,\n outputName,\n epoch,\n })\n }\n }\n\n await new Promise<void>((resolve, reject) => {\n setImmediate(async () => {\n try {\n // The boundary's settle gate: waits for every tracked background\n // upload/publish, then throws an AggregateError on any fail-hard\n // failure — which surfaces here and reaches the outer catch ->\n // exception republish -> throwServiceError -> failNode. The done\n // marker + ack only happen once every upload succeeded.\n if (!deferred) {\n await outbound.settle()\n }\n\n await publish({\n index: publishIndex++,\n version,\n messageId,\n taskId,\n data: deferredReason,\n priority: message.properties.priority,\n deferred,\n done: !deferred,\n epoch,\n })\n\n if (!acked) {\n safeAck(channel, message)\n }\n resolve()\n } catch (error) {\n reject(error)\n }\n })\n })\n } catch (error) {\n if (error instanceof SkipError) {\n if (!acked) {\n safeNack(channel, message)\n }\n return\n }\n if (error instanceof RetryError) {\n if (!acked) {\n safeAck(channel, message)\n }\n const properties: Options.Publish = {\n ...message.properties,\n expiration: error.delay || 1_000, // 1s\n }\n channelWrapper\n .publish(\n `${exchange}-retry`,\n version, // to other services\n message.content,\n properties,\n )\n .catch((publishError: unknown) => {\n if (!silent) {\n logger.error(\n 'Failed to republish message for retry:',\n publishError,\n )\n }\n })\n\n return\n }\n\n // A refusal, not a failure: this box is the wrong one, the message is\n // fine. It goes back by REPUBLISHING to `<exchange>-retry`, never by\n // nacking, because a nack can carry no rejection count and a classic\n // queue offers none either — see `CAPABILITY_HEADER_KEYS.mismatch` in\n // `@requence/helpers/protocol` for the full argument, and this file's\n // spec, which pins it. The republish reaches the operator's error\n // consumer, which already counts attempts, delays and fails the node.\n if (error instanceof UnsupportedCapabilityError) {\n if (!silent) {\n logger.error(error.message)\n }\n\n if (!acked) {\n safeAck(channel, message)\n }\n channelWrapper\n .publish(\n `${exchange}-retry`,\n 'operator', // back to operator\n // The dispatch verbatim: a reroute re-dispatches these bytes, and\n // this build never decoded them.\n message.content,\n {\n ...message.properties,\n headers: {\n ...message.properties.headers,\n version,\n [CAPABILITY_HEADER_KEYS.mismatch]: true,\n index: publishIndex++,\n 'error-message': error.message,\n },\n },\n )\n .catch((publishError: unknown) => {\n if (!silent) {\n logger.error(\n 'Failed to publish capability mismatch message:',\n publishError,\n )\n }\n })\n\n return\n }\n\n if (error instanceof AbortError && error.message.length > 0) {\n if (!acked) {\n safeAck(channel, message)\n }\n channelWrapper\n .publish(\n `${exchange}-retry`,\n 'operator', //back to operator\n error.message,\n {\n ...message.properties,\n contentType: 'text/plain',\n headers: {\n ...message.properties.headers,\n index: publishIndex++,\n abort: true,\n },\n },\n )\n .catch((publishError: unknown) => {\n if (!silent) {\n logger.error('Failed to publish abort message:', publishError)\n }\n })\n\n return\n }\n\n // Native AbortError thrown when context.terminated.signal fires\n // (e.g. node:timers/promises setTimeout with { signal: context.terminated.signal }).\n // Only suppress when actually in a terminated state — otherwise a\n // different AbortSignal caused the error and it should propagate.\n if (\n terminated &&\n error instanceof Error &&\n error.name === 'AbortError' &&\n !(error instanceof AbortError)\n ) {\n if (!acked) {\n safeAck(channel, message)\n }\n return\n }\n\n if (error instanceof Error) {\n if (!silent) {\n logger.error('Encountered an error inside service handler:')\n logger.error(error)\n }\n\n if (!acked) {\n safeAck(channel, message)\n }\n channelWrapper\n .publish(\n `${exchange}-retry`,\n 'operator', // back to operator\n message.content,\n {\n ...message.properties,\n headers: {\n ...message.properties.headers,\n version,\n exception: true,\n index: publishIndex++,\n 'error-message': error.message || 'error in service handler',\n },\n },\n )\n .catch((publishError: unknown) => {\n if (!silent) {\n logger.error(\n 'Failed to publish exception message:',\n publishError,\n )\n }\n })\n\n return\n }\n } finally {\n if (messageIdForCleanup) {\n generatorTerminators.delete(messageIdForCleanup)\n // Bounded with the delivery rather than left to accumulate. A publish\n // that outlives the handler — a deferred message's later send — then\n // falls back to JSON, which the operator decodes correctly off the\n // header. It loses the size win for that one message and nothing else:\n // degrading to JSON is always safe, which is why the fallback is JSON\n // and not \"the last codec we saw\".\n messageCodecs.delete(messageIdForCleanup)\n }\n registeredCallbackIds.forEach((id) => callbacks.delete(id))\n resolveActiveMessage()\n }\n })\n })\n\n const activeMessageKeys = new Set<string>()\n const api: ConnectionApi<V> = {\n close: async () => {\n stopUIWatch?.()\n await callbackChannelWrapper.close()\n await handlerChannelWrapper.close()\n await channelWrapper.close()\n await connection.close()\n },\n open: () => connectedPromise.then(() => api),\n\n async act(messageKey, actor) {\n if (activeMessageKeys.has(messageKey)) {\n throw new Error('a defer key can only be used once')\n }\n\n activeMessageKeys.add(messageKey)\n\n let publishIndex = 0\n const { taskId, messageId, ...options } =\n messageKeySchema.parse(messageKey)\n\n const activeMessage = async () => {\n if (activeMessages.has(messageId)) {\n await activeMessages.get(messageId)\n }\n }\n\n const registeredCallbackIds = new Set<string>()\n // The deferred path's own outbound boundary: its ledger replaces the\n // old donePromises/uploadErrors pair — errors are caught at\n // registration time (nothing sits unhandled during long generator\n // iteration) and surfaced by settle() after the loop.\n const outbound = createOutboundBoundary(options)\n // The same growth warning as the main path (#151): an `act()` call holds\n // its own registry and may iterate a generator of its own, so it can grow\n // one the same way.\n const growth = callbackGrowth.forDelivery({ taskId })\n const registerCallback = (\n callback: (...args: any[]) => void,\n path: ReadonlyArray<string | number>,\n ) => {\n const callbackId = crypto.randomUUID()\n registeredCallbackIds.add(callbackId)\n callbacks.set(callbackId, {\n callback,\n onCallbackInvoke: dispatchInvocation,\n })\n growth.record(path)\n return { sourceId: connectionId, callbackId }\n }\n\n // Deferred-path analogue of the main path's dispatchInvocation: chained\n // invocations of callbacks registered here egress through this deferred\n // message's context (no epoch, matching its other publishes).\n const dispatchInvocation = (\n invocation: CallbackObject & { arg: unknown },\n ) => {\n outbound.track(\n outbound\n .send(invocation.arg, {\n outputName: invocation.outputName,\n onCallback: registerCallback,\n })\n .then((data) =>\n publish({\n index: 0,\n version,\n taskId,\n messageId,\n data: invocationPayload(invocation, data),\n outputName: invocation.outputName,\n propertyPath: invocation.propertyPath,\n ...invocationHeaders(invocation, options.nodeId),\n }),\n ),\n )\n }\n\n // This act() call's publish context: its own index counter, its own\n // callback registry, its own active-message gate, and no attempt headers —\n // an acting process is not a consume attempt. Both the send API and the\n // render read it, so the two cannot disagree about which message they\n // publish for.\n const publishDeps: PublishDeps = {\n outbound,\n registerCallback,\n taskId,\n messageId,\n nextIndex: () => publishIndex++,\n gate: activeMessage,\n }\n\n const renderSurface = buildRender(publishDeps)\n\n const sendApi = {\n ...buildSendApi(publishDeps),\n // The live window a deferred node gets (#70): the same render as the\n // main path, publishing into the same last-write-wins surface — so a\n // re-attach after a restart replaces the stale one, with fresh callbacks\n // registered here rather than in a message context that no longer\n // exists. The lock against a second instance doing this concurrently is\n // the author's (D9); see `ConnectionApi.act`.\n render(\n ui: RequenceUI,\n props: unknown,\n renderOptions?: { surfaceId?: string },\n ) {\n // The default mirrors `context.render` in helpers.ts — the public\n // shape of a render is the same on both paths.\n renderSurface({\n ui,\n props,\n surfaceId: renderOptions?.surfaceId ?? DEFAULT_SURFACE_ID,\n })\n },\n async abort(error: string | Error) {\n await activeMessage()\n channelWrapper.publish(\n `${exchange}-retry`,\n 'operator',\n error instanceof Error ? error.message : error,\n {\n persistent: true,\n correlationId: messageId,\n expiration: 0,\n priority: 0,\n contentType: 'text/plain',\n headers: {\n taskId,\n index: publishIndex++,\n abort: true,\n },\n },\n )\n },\n }\n\n // Before the actor, so the row that closes the defer segment sits ahead of\n // everything the actor publishes — including work it does before its first\n // send, which is the whole stretch this exists to make measurable.\n announceResume({ taskId, messageId })\n\n const result = await actor(sendApi as ActorApi<V>)\n\n if (\n result != null &&\n typeof result === 'object' &&\n (Symbol.asyncIterator in result || Symbol.iterator in result)\n ) {\n // Generator: iterate and send each yielded value\n const iterable = result as AsyncIterable<unknown> | Iterable<unknown>\n for await (const value of iterable) {\n if (value !== undefined) {\n await sendApi.send(value)\n }\n }\n } else if (result !== undefined) {\n await sendApi.send(result)\n }\n\n await new Promise((resolve) => setImmediate(resolve))\n await activeMessage()\n\n try {\n // Settle gate: waits while sends enqueue more sends, then throws an\n // AggregateError on any failed background upload or publish.\n await outbound.settle()\n } catch (error) {\n // Do not mark the message done with a dangling reference. Signal\n // failure over the deferred-path error channel (abort -> operator\n // fails the node) and throw so act()'s caller sees it too.\n registeredCallbackIds.forEach((id) => callbacks.delete(id))\n const first =\n error instanceof AggregateError && error.errors[0] instanceof Error\n ? error.errors[0]\n : error instanceof Error\n ? error\n : new Error(String(error))\n await sendApi.abort(first)\n activeMessageKeys.delete(messageKey)\n throw error\n }\n\n registeredCallbackIds.forEach((id) => callbacks.delete(id))\n\n await publish({\n index: publishIndex++,\n version,\n messageId,\n taskId,\n done: true,\n })\n\n activeMessageKeys.delete(messageKey)\n },\n }\n\n return api\n}\n",
19
20
  "import { Buffer } from 'node:buffer'\n\nimport { Packr, addExtension } from 'msgpackr'\n\n/**\n * THE SHARED MSGPACK LAYER.\n *\n * Three things live here, and only these three:\n *\n * 1. `MSGPACK_EXTENSION_IDS` — the ONE allocation table for msgpack extension\n * type ids used anywhere in this repo.\n * 2. `packCommand` / `unpackCommand` — the AMQP task-command codec, shared by its\n * two parties: `@requence/task-builder` publishes, `@requence/operator`\n * consumes.\n * 3. `packWire` / `unpackWire` / `wireByteLength` — the high-volume AMQP wire\n * codec (service dispatch, service results, task updates). Its parties span\n * two languages, so unlike (2) it is a deliberately narrow, portable subset.\n *\n * It is its own subpath export (`@requence/helpers/msgpack`) so the msgpackr\n * dependency reaches only the packages that actually encode. Twelve packages\n * depend on `@requence/helpers`; most of them do not touch either codec and must\n * not carry a msgpack library into their bundle.\n *\n * Both codecs live in ONE module because `addExtension` is process-global (see\n * `MSGPACK_EXTENSION_IDS`). Splitting them would put the allocation table out of\n * sight of one of its two users, which is exactly the failure the table exists\n * to prevent.\n */\n\n/**\n * Extension type ids, allocated ONCE for the whole repo.\n *\n * **`addExtension` is process-global, not per-`Packr`.** Every instance in a\n * process shares one registry, so two codecs that pick the same id do not get two\n * namespaces — the second registration WINS and the first class silently decodes\n * as the second one. No error, no warning: a `NodeTree` comes back as a\n * `ReferenceCounter` and fails much later, somewhere unrelated. That is why the\n * numbers live in one table instead of next to each `addExtension` call.\n *\n * Ids 1 and 2 are also part of the stored Redis snapshot format, so renumbering\n * either one invalidates every live snapshot (a fleet-wide loud discard and\n * restart — there is no migration path, per the repo no-legacy-support policy).\n * Treat all of these as frozen; allocate a NEW number for anything new.\n */\nexport const MSGPACK_EXTENSION_IDS = {\n /** `@requence/operator`'s `ReferenceCounter` — snapshot path only. */\n referenceCounter: 1,\n /** `NodeTree` — snapshot path only; a command carries a `treeList`. */\n nodeTree: 2,\n /**\n * `URL` — registered below, because BOTH paths need it, and they need OPPOSITE\n * behaviour. See the registration for how one id serves both.\n */\n url: 3,\n} as const\n\n/**\n * Set for the duration of a `packWire` call, so the process-global `URL` extension\n * below can tell which codec is asking. `pack` is synchronous, so this cannot\n * interleave with another encode.\n *\n * Declared above the registration because `addExtension` reads `type` immediately.\n */\nlet packingForWire = false\n\n// THIS EXTENSION BELONGS TO THE SNAPSHOT AND COMMAND CODECS, NOT TO THE WIRE CODEC.\n// It exists because those two replaced superjson, which carried a `URL`;\n// structured-clone mode does not, so without this a `URL` in task input silently\n// becomes a string in transit — the same defect the `Date` handling prevents.\n//\n// The wire codec replaced `JSON.stringify`, which HAS no concept of a `URL` and\n// renders one as its href string. So it wants the opposite answer — and it cannot\n// simply decline this extension, because `addExtension` writes into module-level\n// arrays that every `Packr` in the process reads. There is no per-instance registry.\n//\n// Hence the getter, which is the wire codec's ONLY intrusion here. msgpackr's two\n// halves read `type` differently, and that is what lets one registration serve both:\n//\n// - `pack` reads it on EVERY call — `if (extension.type)` decides whether the ext\n// tag is written. `undefined` skips the tag, so `write`'s return value is encoded\n// as an ordinary string: exactly `JSON.stringify`'s output, with no pre-pack walk.\n// - `unpack` reads it ONCE, at registration (`currentExtensions[type] = …`), so the\n// decoder always knows id 3 and a command still round-trips to a real `URL`.\n//\n// Nothing about the snapshot or command format changes. `index.spec.ts` pins that:\n// a command still emits `d40300` and decodes to a `URL`, `packWire` never latches the\n// flag, and no ext tag reaches the wire — so a msgpackr release that started caching\n// `type` fails there rather than shipping undecodable bytes to a Python service.\naddExtension({\n Class: URL,\n get type() {\n return packingForWire ? undefined : MSGPACK_EXTENSION_IDS.url\n },\n write: (v: URL) => v.href,\n read: (href: string) => new URL(href),\n} as Parameters<typeof addExtension>[0])\n\n// `structuredClone: true` carries `Map`, `Set`, `Date`, `RegExp`, `Error`,\n// `BigInt`, typed arrays and `undefined` in the format itself, so there is no\n// annotation pass — which is the whole reason this beats superjson. `Map`\n// insertion order survives.\n//\n// Known and accepted difference from superjson: msgpack has no signed zero, so\n// `-0` arrives as `0`. No extension can fix it — the format has one zero.\nconst packr = new Packr({ structuredClone: true })\n\n/**\n * Encodes a task command (`CREATE` / `ABORT`) for the AMQP command queue.\n *\n * **Both parties must agree, and there is no negotiation on this queue.** A\n * command encoded by one codec and read by another does not degrade — it fails to\n * parse, and `consumers/tasks.ts` terminally fails that task. So a deploy that\n * changes this format has to move `task-builder` and the operator together;\n * anything in flight across the cutover is lost. That is the repo's\n * no-legacy-support policy applied deliberately: no dual-read, no format sniffing,\n * no version byte.\n */\nexport function packCommand(value: unknown) {\n return packr.pack(value)\n}\n\n/**\n * Decodes a task command off the AMQP command queue.\n *\n * Throws on anything that is not this codec's output — including a\n * superjson-shaped command from a pre-msgpack build, whose leading `{` decodes as\n * a positive fixint and whose trailing JSON text trips msgpack's end-of-buffer\n * check. The caller turns that into a terminal task failure; see `packCommand`\n * on why there is no fallback path.\n */\nexport function unpackCommand<T = unknown>(buffer: Buffer) {\n return packr.unpack(buffer) as T\n}\n\n/**\n * THE HIGH-VOLUME WIRE CODEC — a drop-in replacement for `JSON.stringify` /\n * `JSON.parse` on the three hot AMQP wires (service dispatch, service results,\n * task updates).\n *\n * **It is a codec swap, not a richer data model.** These wires are a\n * cross-language contract (TS service SDK, Python service SDK, `task-builder`),\n * so the format is a portable msgpack subset that any language's msgpack library\n * decodes — NOT the msgpackr dialect `packCommand` uses. Concretely:\n *\n * - `useRecords: false` — record structures are a msgpackr extension. They are\n * the single largest size win on the wide uniform arrays ETL moves (measured\n * -53% vs -17% without), and giving them up is the price of Python being able\n * to read the bytes at all.\n * - `structuredClone: false` — no reference/cycle extension, and no ext-type-0\n * `undefined`.\n * - `encodeUndefinedAsNil` — msgpackr's default `undefined` is ext type 0, which\n * is msgpackr-only. See `packWire` on why nil is still not free.\n * - `mapAsEmptyObject` / `setAsEmptyObject` — `JSON.stringify` renders a `Map` and\n * a `Set` as `{}`; without these msgpack would encode their contents and\n * silently start carrying data the JSON wire never did.\n * - `int64AsType: 'number'` — JSON has one number type, so a 64-bit integer from\n * the Python side must arrive as a `number`, not a `bigint`.\n *\n * A `URL` degrades to its href string, exactly as `JSON.stringify` does — see the\n * `URL` extension above for how it declines its own ext tag on this path.\n */\nconst wirePackr = new Packr({\n useRecords: false,\n structuredClone: false,\n encodeUndefinedAsNil: true,\n mapAsEmptyObject: true,\n setAsEmptyObject: true,\n int64AsType: 'number',\n})\n\n/**\n * **THE CONTRACT: this wire carries the JSON data model, and nothing else.**\n *\n * It replaced `JSON.stringify`, so by construction every value that reaches it is\n * already JSON-representable — task input arrives as JSON over HTTP, a node's output\n * arrives back over this same wire, and the envelope fields the operator adds are\n * strings and numbers. Nothing here has to carry a class.\n *\n * That is what makes the encoding usable from any language: it emits only msgpack's\n * CORE types, so a decoder needs no extension registered and no configuration.\n * `index.spec.ts` enforces this structurally — it walks the emitted bytes and fails\n * on any `ext` marker, over the JSON data model, real dispatch bodies, update\n * envelopes and `__REQUENCE_type` references.\n *\n * Two things to know about the encoding itself:\n *\n * 1. **`undefined` in a record becomes `null` instead of vanishing.** JSON drops the\n * key; msgpack has no way to express \"absent\" for a key it is already writing.\n * This is the one difference that can break a receiver: a Zod `.optional()`\n * accepts an absent key and rejects `null`. Envelope objects assembled on the\n * encode side must therefore omit undefined keys rather than assign them —\n * `omitUndefined` below is the shared way to do it. Values that came through JSON\n * cannot contain `undefined`, so only envelopes need the treatment.\n * 2. **`Uint8Array` becomes msgpack `bin`.** `bin` is a core type, not an extension,\n * so this costs nothing in portability — and it is the one place the wire is\n * denser than the JSON it replaced, which had to base64 (a 1.33x inflation).\n *\n * OUT OF CONTRACT, and deliberately not engineered around: `Date`, `RegExp`, `Error`\n * and any class registered via `addExtension` are not JSON, so they must not be put\n * on this wire. A `Date` in particular would emit msgpack's timestamp ext (-1) —\n * standard, but still an ext, which forfeits the \"decodes anywhere with no setup\"\n * guarantee above. The structural scan in the spec is what catches it if one ever\n * does slip in.\n */\nexport function packWire(value: unknown) {\n packingForWire = true\n try {\n return wirePackr.pack(value)\n } finally {\n packingForWire = false\n }\n}\n\n/** Decodes a body off one of the three high-volume wires. */\nexport function unpackWire<T = unknown>(buffer: Uint8Array) {\n return wirePackr.unpack(buffer) as T\n}\n\n/**\n * The encoded size of `value` under this codec, in bytes.\n *\n * The claim-check decides what to offload by measuring the serialized body, so\n * the codec and the size measurement are coupled: the invariant is **measured\n * size == published size**. A measurement taken with the wrong codec does not\n * fail loudly — it offloads too eagerly (a needless S3 round-trip on the hot\n * path) or too late (`PayloadTooLarge` at the broker). This is the only sanctioned\n * way to measure a body destined for this codec.\n *\n * Which is why it measures THROUGH `packWire` rather than reaching for the same\n * `Packr` itself: `packingForWire` is what makes the process-global `URL`\n * extension stand down, so a bare `wirePackr.pack` here would measure a `URL` as\n * an ext-tagged value and then publish it as a bare href string — the two numbers\n * this function exists to keep equal, unequal. `packCommand` deliberately carries\n * real `URL`s, so task input can put one in a body that is measured here.\n */\nexport function wireByteLength(value: unknown) {\n return packWire(value).length\n}\n\n/**\n * Drops keys whose value is `undefined`, so a record survives `packWire`\n * byte-equivalently to `JSON.stringify`.\n *\n * Needed only for envelope objects assembled right at an encode site (a dispatch\n * body's `options`, an update's optional fields): those are the only places an\n * `undefined` can still be present, per divergence (1) on `packWire`.\n */\nexport function omitUndefined<T extends Record<string, unknown>>(value: T): T {\n const out: Record<string, unknown> = {}\n for (const key of Object.keys(value)) {\n if (value[key] !== undefined) {\n out[key] = value[key]\n }\n }\n return out as T\n}\n\n/**\n * Which codec a body on one of the three high-volume wires is encoded with.\n *\n * `json` is the floor and never goes away: it is what an SDK that has not claimed\n * the `wire:msgpack1` capability speaks, and what every task keeps until it is\n * recreated. A rolling deploy therefore has both live at once, by design.\n */\nexport type WireCodec = 'json' | 'msgpack'\n\nexport const WIRE_CONTENT_TYPES = {\n json: 'application/json',\n msgpack: 'application/msgpack',\n} as const satisfies Record<WireCodec, string>\n\n/**\n * Maps an AMQP `content-type` to the codec that wrote the body.\n *\n * **Every decoder on these wires must go through here rather than assume.** An\n * absent or unrecognised content type is treated as `json`: that is the status\n * quo for anything published before this codec existed, and for any hop that\n * forwards a body without restating the header.\n */\nexport function wireCodecFromContentType(\n contentType: string | undefined,\n): WireCodec {\n return contentType === WIRE_CONTENT_TYPES.msgpack ? 'msgpack' : 'json'\n}\n\n/** Encodes a body for one of the three high-volume wires, with its content type. */\nexport function encodeWireBody(value: unknown, codec: WireCodec) {\n return {\n body:\n codec === 'msgpack'\n ? packWire(value)\n : Buffer.from(JSON.stringify(value ?? null)),\n contentType: WIRE_CONTENT_TYPES[codec],\n }\n}\n\n/**\n * Decodes a body off one of the three high-volume wires, switching on the codec\n * the publisher declared.\n *\n * This is what makes the migration rolling instead of a synchronised cutover: a\n * message already in flight when a deploy lands decodes under whichever codec\n * wrote it, so no queue has to be drained.\n */\nexport function decodeWireBody<T = unknown>(\n content: Uint8Array,\n contentType: string | undefined,\n): T {\n return wireCodecFromContentType(contentType) === 'msgpack'\n ? unpackWire<T>(content)\n : (JSON.parse(Buffer.from(content).toString()) as T)\n}\n\n/**\n * The encoded size of `value` under `codec`, in bytes — the claim-check's sizer.\n *\n * Both codecs are live at once (the choice is baked per service node), so the\n * threshold has to be measured with whichever codec this particular dispatch\n * uses. See `wireByteLength` on why a drifting measurement fails quietly.\n */\nexport function wireBodyByteLength(value: unknown, codec: WireCodec) {\n if (codec === 'msgpack') {\n return wireByteLength(value)\n }\n const json = JSON.stringify(value)\n return json === undefined ? 0 : Buffer.byteLength(json)\n}\n",
20
21
  "/**\n * Thrown by a `RequenceStream` remote read when the producer terminated\n * abnormally (or vanished) mid-stream — the explicit alternative to the\n * clean-looking EOF a truncated live relay used to produce. Surfaced through\n * the framed consumer-GET protocol (see `streamFraming.ts`): a TRUNCATED\n * terminal frame, or an EOF with no terminal frame at all.\n */\nexport class RequenceStreamTruncatedError extends Error {\n constructor(message = 'stream truncated') {\n super(message)\n this.name = 'RequenceStreamTruncatedError'\n }\n}\n",
21
22
  "import { RequenceStreamTruncatedError } from './errors.ts'\n\n/**\n * Opt-in framed protocol for the consumer stream GET, closing the\n * silent-truncation gap: the server *decides* complete-vs-truncated (Redis\n * EOS/ERR markers) but a plain HTTP body cannot state it — a mid-stream\n * producer abort and a clean end both look like EOF. A client that sends\n * `x-requence-stream-protocol: framed` receives length-prefixed frames ending\n * in an explicit terminal frame; the server echoes the header only when it\n * actually frames. Clients that don't send the header (Python SDK, older TS)\n * get today's raw bytes — compatible in both directions.\n *\n * Frame layout: `type u8 | length u32 BE | payload[length]`.\n */\nexport const STREAM_PROTOCOL_HEADER = 'x-requence-stream-protocol'\nexport const STREAM_PROTOCOL_FRAMED = 'framed'\n\nconst DATA = 0x00\n/** Terminal: the stream is complete. Nothing may follow. */\nconst END = 0x01\n/** Terminal: the producer aborted / vanished. Payload = UTF-8 reason. */\nconst TRUNCATED = 0x02\n\nconst HEADER_BYTES = 5\n\n/** 5-byte DATA frame header; write it, then the chunk itself (no copy). */\nexport function dataFrameHeader(byteLength: number): Uint8Array {\n const header = new Uint8Array(HEADER_BYTES)\n new DataView(header.buffer).setUint32(1, byteLength, false)\n header[0] = DATA\n return header\n}\n\nexport const END_FRAME: Uint8Array = new Uint8Array([END, 0, 0, 0, 0])\n\nexport function truncatedFrame(reason: string): Uint8Array {\n const payload = new TextEncoder().encode(reason)\n const frame = new Uint8Array(HEADER_BYTES + payload.byteLength)\n new DataView(frame.buffer).setUint32(1, payload.byteLength, false)\n frame[0] = TRUNCATED\n frame.set(payload, HEADER_BYTES)\n return frame\n}\n\n/**\n * Decode a framed body back into raw chunks. DATA payloads are re-emitted;\n * END terminates cleanly; TRUNCATED — and an EOF without any terminal frame\n * (transport drop, proxy cut) — error the stream with a typed\n * `RequenceStreamTruncatedError`. Frames may be split across chunk boundaries.\n */\nexport function createFrameDecoder(): TransformStream<Uint8Array, Uint8Array> {\n let buffer: Uint8Array = new Uint8Array(0)\n let terminal = false\n\n return new TransformStream<Uint8Array, Uint8Array>({\n transform(chunk, controller) {\n if (terminal) {\n if (chunk.byteLength > 0) {\n throw new Error('stream protocol error: bytes after terminal frame')\n }\n return\n }\n\n if (buffer.byteLength === 0) {\n buffer = chunk\n } else {\n const merged = new Uint8Array(buffer.byteLength + chunk.byteLength)\n merged.set(buffer, 0)\n merged.set(chunk, buffer.byteLength)\n buffer = merged\n }\n\n while (buffer.byteLength >= HEADER_BYTES) {\n const type = buffer[0]\n const length = new DataView(\n buffer.buffer,\n buffer.byteOffset,\n buffer.byteLength,\n ).getUint32(1, false)\n if (buffer.byteLength < HEADER_BYTES + length) {\n break\n }\n // slice (copy): the emitted chunk must not pin the merge buffer\n const payload = buffer.slice(HEADER_BYTES, HEADER_BYTES + length)\n buffer = buffer.subarray(HEADER_BYTES + length)\n\n switch (type) {\n case DATA: {\n if (payload.byteLength > 0) {\n controller.enqueue(payload)\n }\n break\n }\n case END: {\n terminal = true\n if (buffer.byteLength > 0) {\n throw new Error(\n 'stream protocol error: bytes after terminal frame',\n )\n }\n controller.terminate()\n return\n }\n case TRUNCATED: {\n terminal = true\n controller.error(\n new RequenceStreamTruncatedError(\n new TextDecoder().decode(payload) || undefined,\n ),\n )\n return\n }\n default: {\n throw new Error(`stream protocol error: unknown frame type ${type}`)\n }\n }\n }\n },\n flush(controller) {\n if (!terminal) {\n controller.error(\n new RequenceStreamTruncatedError(\n 'connection closed before terminal frame',\n ),\n )\n }\n },\n })\n}\n",
@@ -48,7 +49,7 @@
48
49
  "import { createHash } from 'node:crypto'\nimport fs from 'node:fs'\nimport { basename } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nimport type { WrappedRequenceCallback } from '@requence/helpers'\nimport { MAX_UI_SOURCE_BYTES } from '@requence/helpers'\n\nimport { UITooLargeError } from './errors.ts'\nimport { type MutableRequenceUI, registerUI } from './uiWatch.ts'\n\n/**\n * A registered UI component: the built module's source plus its content hash.\n * Opaque to the author at the value level — the only thing to do with it is pass\n * it to `context.render(ui, props)`.\n *\n * `Props` is a phantom type parameter (never present at runtime) carrying the\n * shape the service sends to this component. It is what makes `render(ui, props)`\n * type-check against the service's own TypeScript, and what the component author\n * reads back with {@link PropsOf} to type `mount`. Declare it once, at\n * `createUI<Props>(url)`.\n */\nexport interface RequenceUI<Props = unknown> {\n /**\n * This component's **stable identity** — what a durable handler reference\n * names (#103), and the one thing about a UI that a rebuild must not change.\n *\n * The content hash cannot serve: a rebuild changes it while the module-scope\n * function in the defaults stays the same function, so a durable reference\n * keyed on the hash would stop resolving the moment the component was rebuilt\n * — and would never resolve at all in a process that started after the render.\n * Defaults to the built module's **file name**, which survives both a rebuild\n * and a restart; {@link CreateUIOptions.id} overrides it.\n *\n * Unique per process, enforced at registration: two components sharing an id\n * would make a durable invocation ambiguous, and the failure would be a click\n * reaching the wrong handler rather than anything visible.\n */\n readonly id: string\n /**\n * The bundle's content hash. `readonly` to the author but not immutable: in\n * service dev mode a rebuild of the watched file rewrites this and `source`\n * in place (D10), which is what makes the next ordinary render carry the new\n * bundle. Read it at use, never cache it.\n */\n readonly hash: string\n readonly source: string\n /**\n * The props this component always has, as declared at `createUI` — restated on\n * every render of it, so a service states once what does not change per\n * message and a render carries only what differs.\n *\n * Sent as their own field of the render payload rather than merged into the\n * render's props, because the receiver ranks them **lowest** (#102): a default\n * is what a surface shows until some render says otherwise, and it never\n * overrides what one already did. Merging them here would rank them highest\n * instead, which is the one thing a default must not be.\n *\n * Absent rather than empty when none were declared, so the payload of a\n * component without defaults is exactly what it always was.\n *\n * Deliberately **not** part of the hash: they are what the service sends, not\n * what the browser loads, so two registrations of one built file still dedupe\n * on the same bundle.\n */\n readonly defaults?: Partial<Props>\n /**\n * Phantom carrier for the props type — optional and never assigned, so it\n * adds no runtime surface. Only `render`/{@link PropsOf} read it at the type\n * level.\n */\n readonly __props?: Props\n}\n\n/**\n * What every invokable prop carries in the component, beside being callable.\n *\n * `reachable` is the answer to \"would pressing this do anything\", **per prop**\n * (#106) — because one surface can carry handlers of both lifetimes at once and\n * a surface-wide flag necessarily lies about one of them:\n *\n * ```\n * reachable(durable) = the task is still running\n * reachable(connection) = …and this surface's own connection is alive, with the\n * reference belonging to its current render\n * ```\n *\n * Read it *with* `ctx.canInvoke`, never instead of it: that one is permission,\n * this one is whether there is anything at the other end. A control should be\n * offered when both hold.\n *\n * Calling an unreachable handler **throws** (D32), naming the prop and the reason,\n * and sends nothing. Catch it on `error.name === 'RequenceUnreachableHandlerError'`\n * — the frame and your component share a realm but no module, so the name is the\n * whole contract:\n *\n * ```js\n * try {\n * props.onSubmit(answer)\n * } catch (error) {\n * if (error.name === 'RequenceUnreachableHandlerError') showNotice(error.message)\n * else throw error\n * }\n * ```\n *\n * It used to warn instead, which could not be handled: a component had no signal\n * that the click went nowhere, and `reachable` — readable before the call — races\n * a flip that lands between the render and the press. Reading `reachable` to\n * withhold the control is still right; the throw is what covers the race and the\n * component that does not check.\n *\n * **The viewer is told either way.** The frame also reports the refusal to the\n * canvas, which shows it beneath the surface in the same strip a permission or\n * byte-cap refusal uses. So catching is about saying something *better* in your\n * own words and your own layout — not about whether the failure is visible.\n */\nexport type HandlerReachability = {\n readonly reachable: boolean\n}\n\n/**\n * An invokable prop as the component holds it: the function the service put in\n * the props, plus {@link HandlerReachability}.\n */\nexport type RequenceHandler<Arg> = ((arg: Arg) => void) & HandlerReachability\n\n/**\n * How a single prop value looks to the component.\n *\n * Every function among the props is a **handler** the browser can invoke, so it\n * arrives callable and carrying its own `reachable` flag. A callback sent by the\n * service arrives rehydrated the same way (the browser is one more consumer of\n * the same inbound transform a peer service uses), so the service-only\n * `WrappedRequenceCallback` — its extra `.response()` — is reduced to what the\n * component actually holds. Everything else passes through untouched, so branded\n * values (`RequenceFile`, `RequenceStream`) and plain data keep their type\n * exactly.\n *\n * The parameter list is preserved rather than collapsed to `RequenceHandler`'s\n * single `Arg`, so a prop declared `onClose(): void` stays callable with no\n * argument.\n */\ntype ComponentPropValue<V> =\n V extends WrappedRequenceCallback<infer Arg>\n ? RequenceHandler<Arg>\n : V extends (...args: infer Args) => unknown\n ? ((...args: Args) => void) & HandlerReachability\n : V\n\n/**\n * The props as the component receives them: the service-declared props with\n * every top-level callback presented in its invokable form.\n */\nexport type ComponentProps<Props> = Props extends object\n ? { [K in keyof Props]: ComponentPropValue<Props[K]> }\n : Props\n\n/**\n * Extracts the component-facing props type from a `ui` handle, so a component\n * author can type `mount` straight off the value they imported:\n * `SurfaceContext<PropsOf<typeof ui>>`.\n */\nexport type PropsOf<U> =\n U extends RequenceUI<infer Props> ? ComponentProps<Props> : never\n\n/**\n * The props one render may supply: **any subset** of the component's props.\n *\n * A render is a patch, not a whole value (#102) — what the surface shows is the\n * fold of the UI's defaults, everything previously rendered onto that surface,\n * and this render — so omitting a prop is the normal case and cannot be an\n * error. A handler that redraws one field is the reason the fold exists, and the\n * clearest instance of it is a handler that *cannot* restate the rest: a durable\n * one, running in a process that never saw the original render.\n *\n * The accepted cost, and it is a real one: TypeScript cannot see the accumulated\n * state, so it can no longer tell a legitimate patch from a first render that\n * forgot half its props. `PropsOf` — the component's side — stays whole and\n * required, because the component genuinely does receive the folded object; it\n * is the service's responsibility that the fold covers it.\n */\nexport type RenderProps<Props> = Partial<Props>\n\n/**\n * What a component is handed, re-exported from the one place all three readers\n * share (#113): the SDK, the frame protocol and the shared runtime's\n * `createSurface`. Declared in `@requence/helpers/utils/surfaceComponent.ts`,\n * which is where the documentation lives — an author reads them from here.\n */\nexport type {\n Mount,\n SurfaceContext,\n SurfaceState,\n SurfaceTheme,\n} from '@requence/helpers'\n\nexport interface CreateUIOptions {\n /**\n * Where the built module is — `new URL('./component.js', import.meta.url)`.\n *\n * A URL rather than a path because it is the one form that resolves against\n * the *module that wrote it*: a relative path resolves against the process's\n * working directory, so a service started from anywhere but its own package\n * silently failed to find its own component.\n */\n url: URL\n /**\n * Override this component's stable id ({@link RequenceUI.id}), which defaults\n * to the built module's file name.\n *\n * Three reasons to set it, and the first two are about the default being a\n * file name: two components in different directories that build to `index.js`\n * collide, and renaming a built file silently retires every durable handler\n * reference already sitting in a queue or stored on a surface. The third is\n * registering **one** file twice — two handles with different defaults — which\n * is a collision like any other.\n *\n * A collision throws at registration, at module scope, so it is a startup\n * error rather than a click resolving against the wrong component's defaults.\n */\n id?: string\n}\n\n/**\n * Registers a UI component from an already-built ES module — one default export\n * `mount(element, ctx)`. Requence never bundles: the author builds with their\n * own toolchain, and this only reads the result and hashes it, which is what\n * keeps the contract portable across SDKs.\n *\n * Called at module scope, next to `createService`, so an oversized bundle fails\n * at registration rather than on the first render in production\n * (knowledge/service-ui-surfaces.md D4).\n *\n * ```ts\n * const askUI = createUI<{ question: string }>(\n * new URL('./ask.mount.js', import.meta.url), // or { url, id: 'ask' }\n * )\n * ```\n *\n * Nothing here declares how the bundle was built. A component may leave `react`,\n * `react-dom/client`, `react/jsx-runtime` and `@requence/surface-ui` **external**\n * and let the surface host's shared runtime resolve them — the import map is\n * installed for every surface, so importing the facade is the whole opt-in, and\n * its price is stated where that import is declared\n * (`@requence/service/surface-ui`). A bundle that ships its own framework has no\n * bare specifier left for the map to bind and is unaffected either way.\n *\n * Declare the props the service will send as the `Props` type argument: it is\n * erased at runtime but flows to `render(ui, props)` and back to the component\n * through {@link PropsOf}.\n *\n * `defaults` is any subset of `Props`, restated on every render of this\n * component, so a service declares once what does not change per message:\n *\n * ```ts\n * const panelUI = createUI<{ title: string; dense: boolean }>(\n * new URL('./panel.js', import.meta.url),\n * { dense: true },\n * )\n *\n * context.render(panelUI, { title: 'Processing' }) // dense comes along\n * ```\n *\n * They are the **weakest** layer of the surface's fold (#102): a render that\n * names a defaulted prop overrides it, and it stays overridden for every later\n * render that stays silent about it. A default answers \"what does this surface\n * show until something says otherwise\", not \"what does it show unless this\n * render says otherwise\".\n *\n * A function among them is a **durable** handler (D24): written at module scope, it\n * closes over nothing one message owns, so any instance of the version can run it —\n * including one started after the process that rendered has exited. That is the\n * opposite of a function written inline at `context.render`, which dies with the\n * message that published it. Where you write it is the whole decision.\n */\nexport function createUI<Props = unknown>(\n target: URL | CreateUIOptions,\n defaults?: Partial<Props>,\n): RequenceUI<Props> {\n const options = target instanceof URL ? { url: target } : target\n\n // The one thing `createUI` validates at run time, and it covers every way the\n // argument can be wrong at once: a path string (what it used to take), an\n // options object without a `url`, and a URL that names something other than a\n // file (`http://…` to a hosted bundle — Requence reads the bytes here, it does\n // not fetch them). Said here rather than left to `fileURLToPath`, whose\n // complaint is about an argument the author never wrote.\n if (!(options?.url instanceof URL) || options.url.protocol !== 'file:') {\n throw new Error(\n \"createUI needs a file URL to the built component: new URL('./component.js', import.meta.url)\",\n )\n }\n\n const path = fileURLToPath(options.url)\n const bundle = fs.readFileSync(path)\n\n if (bundle.byteLength > MAX_UI_SOURCE_BYTES) {\n throw new UITooLargeError(path, bundle.byteLength, MAX_UI_SOURCE_BYTES)\n }\n\n const ui: MutableRequenceUI = {\n // The stable half of the identity (#103), and the deliberate opposite of\n // the hash below: taken off the file's NAME, which a rebuild leaves alone.\n id: options.id ?? basename(path),\n // Content-addressed, so identical bundles dedupe across renders, replicas\n // and tasks — and so a rebuild yields a new identity by construction.\n hash: createHash('sha256').update(bundle).digest('hex'),\n source: bundle.toString('utf-8'),\n // Copied, so the object the author passed cannot change what a render sends\n // after registration. One level only — a nested default value stays shared,\n // exactly like any other prop value a service reuses across renders.\n ...(defaults === undefined ? {} : { defaults: { ...defaults } }),\n }\n\n // Recorded in every mode, watched in none of them by itself: this runs at\n // module scope, long before anything knows whether the service will connect\n // with a dev token, so the decision belongs to the connection (D10).\n registerUI(ui, path)\n\n return ui as RequenceUI<Props>\n}\n",
49
50
  "import { handlerStorage } from './helpers.ts'\n\nfunction isAsyncIterable<T>(\n iterable: Iterable<T> | AsyncIterable<T>,\n): iterable is AsyncIterable<T> {\n return typeof (iterable as any)[Symbol.asyncIterator] === 'function'\n}\n\nexport function wrapIterable<T extends Iterable<any> | AsyncIterable<any>>(\n iterable: T,\n): T {\n const context = handlerStorage.getStore()\n\n if (!context) {\n return iterable\n }\n\n let terminated = false\n\n context.terminated.then(() => {\n terminated = true\n })\n\n if (isAsyncIterable(iterable)) {\n return {\n [Symbol.asyncIterator]() {\n const iterator = iterable[Symbol.asyncIterator]()\n\n return {\n async next() {\n const result = await Promise.race([\n context.terminated,\n iterator.next(),\n ])\n\n if (terminated) {\n return { done: true, value: undefined }\n }\n\n return result\n },\n }\n },\n } as T\n }\n\n return {\n [Symbol.iterator]() {\n const iterator = iterable[Symbol.iterator]()\n\n return {\n next() {\n if (terminated) {\n return { done: true, value: undefined }\n }\n const result = iterator.next()\n return result\n },\n }\n },\n } as T\n}\n\nexport function asyncEventEmitter<T>(initial: Array<T> = []) {\n const context = handlerStorage.getStore()\n\n let terminated = false\n context?.terminated.then(() => {\n terminated = true\n })\n\n // ONE queue for everything not yet pulled, and a waiter that exists only\n // while `next()` is actually parked on it.\n //\n // Keeping those two apart is the whole of it. The waiter used to be a single\n // slot that was set on the first pull and never cleared, so every later push\n // took the \"hand it over\" branch and called a resolve whose promise had\n // already settled — a silent no-op. Anything arriving while the consumer was\n // between pulls was therefore DROPPED, and a consumer between pulls is the\n // normal state of a CONTINUOUS handler: between two yields it publishes a\n // message and waits for the operator. A producer running at any real rate lost\n // roughly every other value, with no error and nothing in the update log.\n const queue = structuredClone(initial)\n let waiting: ((value: T) => void) | null = null\n\n return {\n push: (value: T) => {\n if (waiting) {\n // Retired in the same breath as it is used, so it can never be called\n // twice — that second call was the drop.\n const resolve = waiting\n waiting = null\n resolve(value)\n return\n }\n queue.push(value)\n },\n [Symbol.asyncIterator](): AsyncIterator<T> {\n return {\n async next() {\n if (queue.length > 0) {\n return { value: queue.shift()!, done: false }\n }\n const defer = Promise.withResolvers<T>()\n waiting = defer.resolve\n\n if (context) {\n const value = await Promise.race([\n defer.promise,\n context.terminated,\n ])\n\n if (terminated) {\n // Nobody is on this end any more, so leaving the waiter in place\n // would hand the next push to a consumer that has gone.\n waiting = null\n return { done: true, value: undefined }\n }\n\n return { done: false, value: value as Awaited<T> }\n }\n\n return { value: await defer.promise, done: false }\n },\n }\n },\n }\n}\n"
50
51
  ],
51
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;EAAA,OAAO,UAAQ,QAAQ,CAAC,GAAE,GAAE,GAAE,GAAE,GAAE;AAAA,IAAC,KAAI,IAAE,EAAE,QAAM,EAAE,MAAM,GAAG,IAAE,GAAE,IAAE,EAAE,IAAE,EAAE,QAAO;AAAA,MAAI,IAAE,IAAE,EAAE,EAAE,MAAI;AAAA,IAAE,OAAO,MAAI,IAAE,IAAE;AAAA;AAAA;;;ACAhH;;;ACAA;AAEA,IAAM,eAAe,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC;AAC9C,SAAS,QAAQ,CAAC,MAAgD;AAAA,EACvE,OAAO,aAAa,UAAU,IAAI,EAAE;AAAA;AAGtC,IAAM,aAAa,EAAE,KAAK;;;ACmB1B,SAAS,OAAU,CAAC,OAAuB,WAA+B;AAAA,EACxE,IAAI,iBAAiB,SAAS;AAAA,IAC5B,OAAO,QAAQ,QAAQ,EACpB,KAAK,MAAM,KAAK,EAChB,KAAK,SAAS;AAAA,EACnB;AAAA,EACA,OAAO,UAAU,KAAK;AAAA;AAGxB,SAAS,YAAY,CAAC,OAAgB,UAAmB;AAAA,EACvD,OAAO,QAAQ,OAAO,CAAC,kBACrB,OAAO,kBAAkB,cAAc,WAAW,aACpD;AAAA;AAAA;AAGF,MAAM,qBAAqB,MAAM;AAAC;AAE3B,SAAS,OAIf,CACC,MACA,UAKA;AAAA,EACA,IAAI,UAAU;AAAA,EACd,MAAM,eAAe,CAAC,OAAW,SAAs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