@requence/service 0.8.2-edge.1156 → 0.8.2-edge.1159

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,7 @@
1
1
  export * from './clientProperties.ts';
2
2
  export * from './command.ts';
3
3
  export * from './configurationScript.ts';
4
+ export * from './logicExecutionTime.ts';
4
5
  export * from './logicLanguages.ts';
5
6
  export * from './loopDetection.ts';
6
7
  export * from './nodeType.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,cAAc,CAAA;AAC5B,cAAc,0BAA0B,CAAA;AACxC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,cAAc,CAAA;AAC5B,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA"}
@@ -0,0 +1,22 @@
1
+ import type { TemplateTree } from './templateNodeTypes.ts';
2
+ /**
3
+ * Floor for a logic node's `maxExecutionTime`, in milliseconds. The ceiling is
4
+ * deployment-dependent (`env.MAX_LOGIC_EXECUTION_TIME`), so it is always passed
5
+ * in rather than declared here.
6
+ */
7
+ export declare const MIN_LOGIC_EXECUTION_TIME = 100;
8
+ export interface LogicExecutionTimeError {
9
+ detail: string;
10
+ nodeId: string;
11
+ }
12
+ /**
13
+ * Range check for every logic node's max execution time, shared by the backend
14
+ * save-time check (`validateTemplateTree`) and the frontend's live canvas
15
+ * monitor so the bound and the wording cannot drift apart.
16
+ *
17
+ * `max: null` means the ceiling is not known — the frontend before its meta
18
+ * query resolves — and only the floor is checked then; checking against the
19
+ * placeholder would flag every logic node in the graph.
20
+ */
21
+ export declare function validateLogicExecutionTime(templateTree: TemplateTree, max: number | null): LogicExecutionTimeError[];
22
+ //# sourceMappingURL=logicExecutionTime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logicExecutionTime.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/logicExecutionTime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAE1D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,MAAM,CAAA;AAE3C,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,MAAM,GAAG,IAAI,GACjB,uBAAuB,EAAE,CAmC3B"}
@@ -1,17 +1,167 @@
1
1
  import { z } from 'zod/v4';
2
- declare const callbackObjectSchema: z.ZodObject<{
3
- sourceId: z.ZodString;
2
+ /**
3
+ * The reference tag of a **callback** — a function a service emitted alongside
4
+ * its data, which a downstream node may invoke back at the emitting service.
5
+ *
6
+ * One tag, not one per lifetime: what a consumer receives is an invokable
7
+ * function either way, and the position it addresses in the node's declared
8
+ * output schema is the same. Deliberately still separate from a
9
+ * `RequenceHandler` (`surfaceHandler.ts` says why in both directions).
10
+ */
11
+ export declare const REQUENCE_CALLBACK_TAG = "RequenceCallback";
12
+ /**
13
+ * How long a callback can be reached, decided by **where the function was
14
+ * written** — the same rule surfaces established for handler props (#59), and
15
+ * the only thing that actually bounds the closure's life:
16
+ *
17
+ * - `connection` — a function written inline in the handler. It closes over the
18
+ * running message, so only that process can serve it and it dies when the
19
+ * delivery settles. Addressed by the registering connection plus an id in its
20
+ * registry.
21
+ * - `durable` — a function declared once at module scope with
22
+ * `createDurableCallback`, addressed by the stable name it was declared under
23
+ * and carrying the per-emission data the author *bound* to it instead of
24
+ * capturing. It names no connection at all, so any instance of the service
25
+ * version can run it, now or after a redeploy (#147).
26
+ *
27
+ * `outputName`/`propertyPath` ride on every arm. The durable arm does not need
28
+ * them to be *routed*, but they are what the operator's existing invocation-
29
+ * argument validation addresses — same reasoning as `uiId`/`path` on both
30
+ * surface-handler arms.
31
+ */
32
+ declare const callbackObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
33
+ __REQUENCE_type: z.ZodLiteral<"RequenceCallback">;
34
+ lifetime: z.ZodLiteral<"connection">;
4
35
  outputName: z.ZodNullable<z.ZodString>;
5
36
  propertyPath: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
37
+ sourceId: z.ZodString;
6
38
  callbackId: z.ZodUUID;
39
+ }, z.core.$strip>, z.ZodObject<{
7
40
  __REQUENCE_type: z.ZodLiteral<"RequenceCallback">;
8
- }, z.core.$strip>;
41
+ lifetime: z.ZodLiteral<"durable">;
42
+ outputName: z.ZodNullable<z.ZodString>;
43
+ propertyPath: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
44
+ name: z.ZodString;
45
+ nodeId: z.ZodString;
46
+ bound: z.ZodOptional<z.ZodUnknown>;
47
+ }, z.core.$strip>], "lifetime">;
9
48
  export type CallbackObject = z.infer<typeof callbackObjectSchema>;
49
+ export type CallbackLifetime = CallbackObject['lifetime'];
10
50
  export declare function isCallbackObject(data: unknown): data is CallbackObject;
11
51
  export type RequenceCallback<T> = (arg: T) => void;
12
52
  export type WrappedRequenceCallback<T> = RequenceCallback<T> & {
13
53
  response(): Promise<T>;
14
54
  };
15
55
  export declare function createCallback<T>(callback?: (arg: T) => void): WrappedRequenceCallback<T>;
56
+ /**
57
+ * What a `.for(bound)` reference carries before the boundary completes it: the
58
+ * declaration's name and the data bound to this emission. The position
59
+ * (`outputName`/`propertyPath`) is added where it is known — the value walk —
60
+ * exactly as it is for the connection arm.
61
+ */
62
+ export interface DurableCallbackBinding {
63
+ readonly name: string;
64
+ readonly bound: unknown;
65
+ }
66
+ /**
67
+ * Mints the value an author emits in place of a closure — the thing
68
+ * `createDurableCallback(...).for(bound)` returns (#147).
69
+ *
70
+ * It is a **function** carrying the binding on a symbol, rather than the wire
71
+ * object it will become, for two reasons that both come from the transformer:
72
+ *
73
+ * - The egress walk only offers *complex* values to a handler, and a plain
74
+ * object is traversable structure — a literal reference would be walked
75
+ * straight through and emitted without the `outputName`/`propertyPath` the
76
+ * operator validates against, which no schema parse downstream would accept.
77
+ * A function is complex, and the callback handler already claims every one.
78
+ * - The walk memoizes object-identity values at their *first* path, so one
79
+ * reference reused at two positions would carry the wrong `propertyPath` for
80
+ * the second. Functions bypass that memo by design.
81
+ *
82
+ * It also matches the type it is cast to: the property a consumer reads is
83
+ * declared `RequenceCallback<Arg>`, and a consumer calls it. Calling it *here*,
84
+ * in the emitting service, is the author's mistake — a durable callback runs
85
+ * where the invocation is delivered, never inline — so it says so rather than
86
+ * doing nothing.
87
+ */
88
+ export declare function createDurableCallbackReference<Arg>(binding: DurableCallbackBinding): RequenceCallback<Arg>;
89
+ /**
90
+ * The binding a value carries, or `undefined` when it is an ordinary function —
91
+ * which is how the callback handler tells the two lifetimes apart on egress.
92
+ */
93
+ export declare function readDurableCallbackBinding(value: unknown): DurableCallbackBinding | undefined;
94
+ /**
95
+ * The per-version **callbacks queue**: where a durable invocation waits until
96
+ * some instance of that service version consumes it.
97
+ *
98
+ * Derived from the version's dispatch queue rather than composed from the
99
+ * service and version names, for the reason `serviceHandlerQueueName` is: the
100
+ * two can then never drift, and a dev-overlay connection — which consumes a
101
+ * rewritten dispatch queue — gets a callbacks queue of its own for free.
102
+ */
103
+ export declare function serviceCallbackQueueName(dispatchQueue: string): string;
104
+ export declare function isDevOverlayCallbackQueue(queueName: string): boolean;
105
+ /**
106
+ * How long a durable invocation may wait in the callbacks queue before the
107
+ * broker drops it.
108
+ *
109
+ * The queue is **not a mailbox**. A callback invoked today and run whenever
110
+ * somebody next deploys is the silent-effect outcome #116 removed for surfaces,
111
+ * and it is worse here: nothing checks reachability before a graph calls
112
+ * `context.input.delete()`, so the TTL is the only bound there is. All it has to
113
+ * bridge is a rolling redeploy, a scale-to-zero that started a moment ago or a
114
+ * replica that took the invocation and died — the same seconds the surface
115
+ * handler queue bridges, hence the same number.
116
+ *
117
+ * Expiry is not a drop: the queue dead-letters to `error`, so an expired
118
+ * invocation comes back to the operator carrying its own task and is reported on
119
+ * the node the callback belongs to.
120
+ */
121
+ export declare const DURABLE_CALLBACK_INVOCATION_TTL_MS = 60000;
122
+ /**
123
+ * The callbacks queue's declaration arguments, as **one** object, because two
124
+ * parties declare that queue — ui/backend's provisioner and the service SDK on
125
+ * connect — and a broker answers a mismatch with a 406 that kills the declaring
126
+ * channel. Anything short of a shared literal is a service that will not start.
127
+ *
128
+ * Note for whoever changes this: declaring a queue with a dead-letter exchange
129
+ * needs WRITE permission on that exchange, so the service AMQP user is granted
130
+ * it (`assertService`). It costs nothing — `error` is an internal exchange and
131
+ * the broker refuses a client publish to one however the permissions read.
132
+ */
133
+ export declare const DURABLE_CALLBACK_QUEUE_ARGUMENTS: {
134
+ readonly messageTtl: 60000;
135
+ readonly deadLetterExchange: 'error';
136
+ };
137
+ /**
138
+ * The header a durable callback invocation is stamped with, for the same reason
139
+ * a durable surface handler invocation carries one
140
+ * (`SURFACE_HANDLER_INVOCATION_HEADER`): it is published `mandatory` into the
141
+ * `service` exchange, so one whose queue is gone comes back to the operator
142
+ * looking like any other undeliverable service message — and every other arm
143
+ * there fails the node.
144
+ *
145
+ * A callback the graph chose to call is not the node's failure, so this is what
146
+ * tells that consumer to *report* instead. A header rather than the routing key's
147
+ * `-callbacks` suffix, which a service actually named `…-callbacks` would forge.
148
+ */
149
+ export declare const DURABLE_CALLBACK_INVOCATION_HEADER = "durableCallbackInvocation";
150
+ /**
151
+ * One durable callback invocation, as it travels on the queue above.
152
+ *
153
+ * `name` is the whole address: the consuming instance looks it up in the
154
+ * process-global registry `createDurableCallback` writes and calls what it
155
+ * finds. Everything else is either the handler's arguments or the way back.
156
+ */
157
+ export declare const durableCallbackInvocationSchema: z.ZodObject<{
158
+ taskId: z.ZodUUID;
159
+ nodeId: z.ZodString;
160
+ name: z.ZodString;
161
+ bound: z.ZodOptional<z.ZodUnknown>;
162
+ arg: z.ZodOptional<z.ZodUnknown>;
163
+ configuration: z.ZodOptional<z.ZodUnknown>;
164
+ }, z.core.$strip>;
165
+ export type DurableCallbackInvocation = z.infer<typeof durableCallbackInvocationSchema>;
16
166
  export {};
17
167
  //# sourceMappingURL=requenceCallback.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"requenceCallback.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/utils/requenceCallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B,QAAA,MAAM,oBAAoB;;;;;;iBAMxB,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,cAAc,CAEtE;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,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,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CACxB;AAWD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAChD,OAAO,EAAE,sBAAsB,GAC9B,gBAAgB,CAAC,GAAG,CAAC,CAmBvB;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,GACb,sBAAsB,GAAG,SAAS,CAYpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEtE;AAiBD,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEpE;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kCAAkC,QAAS,CAAA;AAExD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gCAAgC;aAC3C,UAAU;aACV,kBAAkB,EAAE,OAAO;CACnB,CAAA;AAEV;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kCAAkC,8BAA8B,CAAA;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B;;;;;;;iBAkC1C,CAAA;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAA"}
@@ -21,6 +21,15 @@ export interface OutboundBoundaryOptions {
21
21
  * answer for the deferred path, which has no dispatch to echo.
22
22
  */
23
23
  wireCodec?: WireCodec;
24
+ /**
25
+ * The node this boundary emits for, as the operator dispatched it
26
+ * (`options.nodeId`, and the defer key on the `act()` path).
27
+ *
28
+ * Constant for the whole message, which is why it sits here rather than in
29
+ * `OutboundSendOptions`: it is the address a **durable** callback reference is
30
+ * routed and configured by (#150), not something one emission decides.
31
+ */
32
+ nodeId?: string;
24
33
  signal?: AbortSignal;
25
34
  fetch?: typeof globalThis.fetch;
26
35
  /** Sink for best-effort degradation notices. Defaults to `logger.warn`. */
@@ -1 +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,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAA;IACtC;;;;;OAKG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACxB;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,uBAAuB,GAC5B,gBAAgB,CAqGlB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;IAC/B,kEAAkE;IAClE,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;IAC7D;;;;OAIG;IACH,WAAW,CAAC,EAAE;QAAE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;KAAE,CAAA;CAC5E;AAED,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,CAAC,EAAE,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;CAC9D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,GAAE,sBAA2B,UAE7D,OAAO,SACP,qBAAqB,KAC1B,OAAO,CAAC,OAAO,CAAC,CAiBpB"}
@@ -0,0 +1,102 @@
1
+ import type { TransformPath } from '@requence/transformer';
2
+ /**
3
+ * Where the first warning lands under a **dev overlay**.
4
+ *
5
+ * Deliberately low, and that is the point of the whole feature (#151): a hundred
6
+ * emissions in a `bun run dev` session already means a generator is minting
7
+ * closures in a loop, and catching it there is worth far more than catching it in
8
+ * production. A one-shot fan-out never reaches it.
9
+ */
10
+ export declare const DEV_OVERLAY_FIRST_WARNING = 100;
11
+ /**
12
+ * Where the first warning lands for a **deployed** version.
13
+ *
14
+ * A thousand entries is ~200 KB of registry — well below any real concern, and
15
+ * far above any legitimate one-shot fan-out. It is the step count, not this
16
+ * number, that makes the growth visible.
17
+ */
18
+ export declare const DEPLOYED_FIRST_WARNING = 1000;
19
+ export interface CallbackGrowthOptions {
20
+ /**
21
+ * How this service names itself in a log line — `<service>@<version>`, the
22
+ * dispatch queue's own name, so the line matches what the deployment calls it.
23
+ */
24
+ readonly service: string;
25
+ /** A dev overlay warns ten times earlier. See {@link DEV_OVERLAY_FIRST_WARNING}. */
26
+ readonly devOverlay: boolean;
27
+ /**
28
+ * The live size of the **connection's** registry.
29
+ *
30
+ * Read rather than counted, so it includes everything the connection holds —
31
+ * other deliveries' callbacks and rendered handler props alike — and shrinks
32
+ * when a delivery settles. Read *after* the registration that prompted it, so
33
+ * the number in the warning is the number the process is holding.
34
+ */
35
+ readonly connectionCount: () => number;
36
+ /**
37
+ * Where a crossing goes: the running service's own log, and nothing else.
38
+ *
39
+ * This warning is for the person writing the service, in the terminal they are
40
+ * writing it in. It is not a task event — nobody watching a run can act on it,
41
+ * and the author is the only one who can.
42
+ */
43
+ readonly warn: (message: string) => void;
44
+ }
45
+ export interface DeliveryGrowthOptions {
46
+ /** The task this delivery belongs to, so the warning can be traced to a run. */
47
+ readonly taskId: string;
48
+ }
49
+ export interface DeliveryGrowth {
50
+ /**
51
+ * One **connection-bound** registration, at the position it was written.
52
+ * Called after the entry is in the registry, so the connection count a warning
53
+ * states is the number the process is holding.
54
+ *
55
+ * A durable reference never reaches it: it registers nothing, so there is
56
+ * nothing to count and nothing to warn about.
57
+ */
58
+ record(path: TransformPath): void;
59
+ }
60
+ export interface CallbackGrowthWatch {
61
+ /** A recorder for one delivery, whose counter is its own. */
62
+ forDelivery(options: DeliveryGrowthOptions): DeliveryGrowth;
63
+ }
64
+ /**
65
+ * Tells the author of a service whose inline closures are piling up — and tells
66
+ * them **which `yield`** is doing it (#151).
67
+ *
68
+ * Shipping `createDurableCallback` does not stop anyone writing an inline closure
69
+ * in a generator, and that is still the easier thing to write. This warning is
70
+ * therefore also the migration path: it is what moves existing services over,
71
+ * with no deprecation and no dual code path.
72
+ *
73
+ * It goes to the **service's own log** and nowhere else. It is not a task event:
74
+ * the only person who can act on it is the one writing the service, and putting
75
+ * it on a run would show it to everyone who cannot.
76
+ *
77
+ * **Two counters**, because they answer different questions and both are O(1):
78
+ *
79
+ * - **per delivery** — identifies the one generator doing it. This is the
80
+ * teaching signal, and it is what the property paths belong to.
81
+ * - **per connection** — what actually threatens the process: a worker holding
82
+ * fifty concurrent tasks at nine hundred callbacks each is at forty-five
83
+ * thousand without any single delivery tripping its own threshold.
84
+ *
85
+ * Both are stated in one warning, and a registration that crosses both emits it
86
+ * **once** — a fresh connection running one generator crosses them on the same
87
+ * registration, and two near-identical warnings would read as a bug in the
88
+ * warning rather than as a bug in the service.
89
+ *
90
+ * **Steps, not a line per registration**, which would be a line per email: the
91
+ * crossing, then each power of ten above it. A threshold jumps straight past a
92
+ * count it is already below, so a connection that arrives at forty-five thousand
93
+ * says so once rather than climbing there one decade per registration.
94
+ *
95
+ * **No cap and no eviction.** A hard cap is the rejected bounded-registry
96
+ * alternative wearing a different hat: it kills a legitimate long-lived handle at
97
+ * an arbitrary number, the author cannot exempt one, and it becomes a tuning knob
98
+ * nobody can set correctly. Loud and degrading beats silent and truncating — so
99
+ * nothing here refuses a registration or returns anything a caller could act on.
100
+ */
101
+ export declare function createCallbackGrowthWatch({ service, devOverlay, connectionCount, warn, }: CallbackGrowthOptions): CallbackGrowthWatch;
102
+ //# sourceMappingURL=callbackGrowth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callbackGrowth.d.ts","sourceRoot":"","sources":["../../../../src/callbackGrowth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAG1D;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAA;AAE5C;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,OAAQ,CAAA;AAK3C,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,oFAAoF;IACpF,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B;;;;;;;OAOG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,MAAM,CAAA;IACtC;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACzC;AAED,MAAM,WAAW,qBAAqB;IACpC,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,CAAA;CAClC;AAED,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,WAAW,CAAC,OAAO,EAAE,qBAAqB,GAAG,cAAc,CAAA;CAC5D;AAiED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,OAAO,EACP,UAAU,EACV,eAAe,EACf,IAAI,GACL,EAAE,qBAAqB,GAAG,mBAAmB,CA2C7C"}
@@ -90,6 +90,7 @@ export declare const messageKeySchema: z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString
90
90
  streamUrl: string | undefined;
91
91
  maxPayloadSize: number | undefined;
92
92
  maxFileSize: number | undefined;
93
+ nodeId: string | undefined;
93
94
  }, [string, string, ...string[]]>>;
94
95
  export declare const connectionOptionsSchema: z.ZodObject<{
95
96
  url: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<URL, string>>, z.ZodCustom<URL, URL>]>;
@@ -1 +1 @@
1
- {"version":3,"file":"createAmqpConnection.d.ts","sourceRoot":"","sources":["../../../../src/createAmqpConnection.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,YAAY,EAYlB,MAAM,mBAAmB,CAAA;AAiB1B,OAAO,EAAE,CAAC,EAAE,MAAM,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AAC,CAAC,MAAM,CAAC,SAAS,QAAQ,GACjD,sBAAsB,CAAC,CAAC,CAAC,GAErB,4BAA4B,CAAC,CAAC,CAAC,GAC/B,uBAAuB,CAAC,CAAC,CAAC,GAC1B,sBAAsB,CAAC,CAAC,CAAC,GAE3B,4BAA4B,CAAC,CAAC,CAAC,GAC/B,uBAAuB,CAAC,CAAC,CAAC,GAC1B,sBAAsB,CAAC,CAAC,CAAC,CAAA;AAmHjC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,CAAC,EACxC,EACE,GAAG,EACH,OAAO,EACP,QAAY,EACZ,MAAc,EACd,iBAAiB,EAKjB,iBAAkD,EAClD,iBAAiB,EACjB,IAAI,EACJ,UAAe,EACf,cAAc,EACd,uBAAuB,EACvB,GAAG,IAAI,EACR,EAAE,iBAAiB,GAAG;IAAE,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;CAAE,EAC5E,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,oBA4yDlC"}
@@ -0,0 +1,223 @@
1
+ import type { RequenceCallback } from '../../helpers/src/index.js';
2
+ /**
3
+ * The node configuration a durable callback is handed, named **either way**:
4
+ * write the type, or write the name of the service **version** it belongs to
5
+ * and have it looked up.
6
+ *
7
+ * ```ts
8
+ * ConfigurationOf<ImapOptions> // → ImapOptions
9
+ * ConfigurationOf<'receiver'> // → the `receiver` version's configuration
10
+ * ```
11
+ *
12
+ * The version-name form is the one to prefer: the type is generated into
13
+ * `requence-env.d.ts` beside the version it belongs to, so naming the version
14
+ * is the only form that cannot drift from what the node actually sends.
15
+ *
16
+ * A name that matches no version resolves to **itself**, which is deliberate
17
+ * rather than an oversight: a typo then fails at the first use with the
18
+ * misspelling quoted in the error (`Property 'host' does not exist on type
19
+ * '"recevier"'`), which says more than a `never` would — and it leaves a
20
+ * service whose configuration genuinely is a string alone.
21
+ *
22
+ * `Versions` exists only so this is testable. The SDK's own `global.d.ts`
23
+ * declares `RequenceService.Version` **empty** — a generated
24
+ * `requence-env.d.ts` is what fills it in a service's package — and merging a
25
+ * version into it from inside this package breaks the SDK's own generics, which
26
+ * only compile because the table has no keys. So the table is a defaulted
27
+ * parameter rather than a hard reference, and nobody passes it.
28
+ */
29
+ export type ConfigurationOf<T, Versions = RequenceService.Version> = T extends keyof Versions ? Versions[T] extends {
30
+ configuration: infer C;
31
+ } ? C : unknown : T;
32
+ /**
33
+ * The one key a durable callback may not bind, because the context already has
34
+ * it.
35
+ *
36
+ * There is exactly one, and it is checked rather than worked around: a
37
+ * precedence rule ("configuration wins", "bound wins") would mean an author's
38
+ * data silently disappearing or a node's credentials silently replaced, and
39
+ * neither is something a reader of the handler could see.
40
+ */
41
+ declare const RESERVED_CONTEXT_KEY = "configuration";
42
+ /**
43
+ * What a durable callback is told about the invocation it is running — and
44
+ * deliberately all of it (#147).
45
+ *
46
+ * There is no message here, no task, no connection. That is exactly what makes
47
+ * a durable callback durable: it may run in an instance that never saw the
48
+ * emission, started after the emitting process died. What it does get is the
49
+ * two things that survive that:
50
+ *
51
+ * - the bound data itself, spread across the context — what the emitting
52
+ * handler attached at `.for(…)` in place of capturing it.
53
+ * - `configuration` — the node's **static** configuration, so the callback can
54
+ * rebuild whatever the emitting handler had open (an IMAP connection, an API
55
+ * client) rather than hold it.
56
+ *
57
+ * The bound data is spread rather than parked under a field of its own, so
58
+ * there is no second word to keep consistent with `.for(…)`:
59
+ * `deleteMail.for({ uid })` is read as `{ uid }`. The cost is the one reserved
60
+ * key above, and it is a compile error and a throw rather than a shadow.
61
+ *
62
+ * Computed configuration (`configurationFunctions`, evaluated per dispatch) is
63
+ * not available: it is a property of one dispatch, and this call belongs to
64
+ * none.
65
+ */
66
+ export type DurableCallbackContext<Bound, Configuration> = Bound extends object ? Bound & {
67
+ readonly configuration: Configuration;
68
+ } : {
69
+ readonly configuration: Configuration;
70
+ };
71
+ /**
72
+ * The bound data as `.for(…)` takes it: the declared shape, minus the one key
73
+ * the context has already spent.
74
+ *
75
+ * A `void` binding passes through untouched rather than intersected, which is
76
+ * what keeps `notify.for()` callable with no argument at all.
77
+ */
78
+ export type Bindable<Bound> = Bound extends object ? Bound & {
79
+ [K in typeof RESERVED_CONTEXT_KEY]?: never;
80
+ } : Bound;
81
+ /**
82
+ * The author's function.
83
+ *
84
+ * `arg` comes first because it is the *consumer's* half — what a downstream
85
+ * node passed when it called `context.input.delete(…)`, and the only parameter
86
+ * the emitted `RequenceCallback<Arg>` declares. Everything the emitting service
87
+ * put there is the context, because from the running callback's point of view
88
+ * the bound data and the node's configuration are the same kind of thing: what
89
+ * this invocation was given, none of it written here.
90
+ */
91
+ export type DurableCallbackHandler<Arg, Bound, Configuration> = (arg: Arg, context: DurableCallbackContext<Bound, Configuration>) => unknown;
92
+ /**
93
+ * A callback declared once at module scope, and what to do with it.
94
+ */
95
+ export interface DurableCallbackHandle<Arg, Bound> {
96
+ /** The stable address this was declared under. */
97
+ readonly name: string;
98
+ /**
99
+ * Binds this emission's data and returns the value to emit — a reference
100
+ * naming the declaration and carrying the data, not a closure over it.
101
+ *
102
+ * Typed as the `RequenceCallback<Arg>` a consumer receives, because that is
103
+ * what the position in the node's output schema declares and what a downstream
104
+ * logic node holds. The value is not callable here: a durable callback runs
105
+ * where its invocation is delivered.
106
+ */
107
+ for(bound: Bindable<Bound>): RequenceCallback<Arg>;
108
+ }
109
+ /**
110
+ * What {@link createDurableCallback} hands back.
111
+ *
112
+ * With nothing to bind (`Bound` at its `void` default) the declaration **is**
113
+ * the value to emit, so `.for()` can be left off entirely:
114
+ *
115
+ * ```ts
116
+ * yield { subject: mail.subject, acknowledge } // no binding
117
+ * yield { delete: deleteMail.for({ uid: mail.uid }) } // a binding
118
+ * ```
119
+ *
120
+ * That is not a special case at runtime — the handle is a reference that bound
121
+ * nothing, which is exactly what `.for()` would have produced. It is the type
122
+ * that is careful: the call signature appears **only** when `Bound` is `void`,
123
+ * so a callback that needs a binding cannot be emitted without one. Without
124
+ * that gate the omission would compile and the handler would destructure
125
+ * `undefined` off a context that was never given its data.
126
+ */
127
+ export type DurableCallback<Arg, Bound> = Bound extends void ? DurableCallbackHandle<Arg, Bound> & RequenceCallback<Arg> : DurableCallbackHandle<Arg, Bound>;
128
+ interface Registration {
129
+ handler: DurableCallbackHandler<any, any, any>;
130
+ }
131
+ /**
132
+ * Declares a callback **once**, so what a service emits per message is a
133
+ * reference rather than a closure (#147).
134
+ *
135
+ * ```ts
136
+ * const deleteMail = createDurableCallback<void, { uid: string }, 'receiver'>(
137
+ * 'deleteMail',
138
+ * async (_arg, { uid, configuration }) => {
139
+ * const client = await connect(configuration) // rebuilt, never captured
140
+ * await client.messageDelete(uid)
141
+ * client.close()
142
+ * },
143
+ * )
144
+ *
145
+ * createService('receiver', async function* () {
146
+ * for await (const mail of mails) {
147
+ * yield { subject: mail.subject, delete: deleteMail.for({ uid: mail.uid }) }
148
+ * }
149
+ * })
150
+ * ```
151
+ *
152
+ * A callback with nothing to bind is emitted as itself — see
153
+ * {@link DurableCallback}:
154
+ *
155
+ * ```ts
156
+ * const acknowledge = createDurableCallback('acknowledge', async () => …)
157
+ *
158
+ * yield { subject: mail.subject, acknowledge }
159
+ * ```
160
+ *
161
+ * **Where you write the function decides how long it lives** — the rule surfaces
162
+ * established for handler props (#59). A function written inline in the handler
163
+ * closes over the running message: only that process can serve it, it dies when
164
+ * the delivery settles, and until then it is held in the connection's registry
165
+ * along with everything it captured. For a CONTINUOUS handler that is one
166
+ * delivery holding a generator for the life of the task, so the registry grows
167
+ * by one entry per emitted function per emission and nothing frees it for weeks.
168
+ * Declared here instead, there is one entry per declaration however many
169
+ * messages go by, and an invocation can be served by an instance started after
170
+ * the emitting one died.
171
+ *
172
+ * Write it inline when it genuinely needs the live process — a handle on an open
173
+ * stream, a client the handler is mid-conversation with. Declare it here when it
174
+ * needs only data, and bind that data with `.for(…)`.
175
+ *
176
+ * The three type arguments are the three things the two sides disagree about,
177
+ * in the order the *reader* meets them:
178
+ *
179
+ * 1. `Arg` — what a consumer passes. This is the emitted
180
+ * `RequenceCallback<Arg>`, so it is what the node's output schema declares.
181
+ * Defaults to `void`: a callback the graph calls with nothing.
182
+ * 2. `Bound` — what `.for(…)` attaches per emission, and what the handler's
183
+ * context is made of. An object (it is spread) or `void`, which lets the
184
+ * declaration be emitted with no `.for()` at all. A scalar is refused,
185
+ * because a spread has nowhere to put one.
186
+ * 3. `Configuration` — the node's configuration, given as a type **or** as the
187
+ * name of the version to look it up from ({@link ConfigurationOf}).
188
+ *
189
+ * `Configuration` does not infer from an annotated handler, because it is
190
+ * resolved through a conditional type. Naming the version is both shorter and
191
+ * the only form that cannot drift, so state all three.
192
+ *
193
+ * A second declaration under the same name **throws**, for the reason a
194
+ * duplicate `createUI` id does: the name is the whole address, so an ambiguous
195
+ * one is an invocation reaching the *wrong* handler — which reads like a bug in
196
+ * the handler — and that is worse than a service that refuses to start.
197
+ */
198
+ export declare function createDurableCallback<Arg = void, Bound extends object | void = void, Configuration = unknown>(name: string, handler: DurableCallbackHandler<Arg, Bound, ConfigurationOf<Configuration>>): DurableCallback<Arg, Bound>;
199
+ /**
200
+ * The callback a durable invocation names, or `undefined` when this process
201
+ * declared none under that name.
202
+ */
203
+ export declare function findDurableCallback(name: string): Registration | undefined;
204
+ /**
205
+ * The context an invocation runs against: its bound data, with the node's
206
+ * configuration beside it.
207
+ *
208
+ * Built here rather than at the consume site so the reserved-key check and the
209
+ * spread stay in one place — `bound` comes off the wire as `unknown`, so this is
210
+ * the second party that has to enforce what {@link DurableCallback.for} enforced
211
+ * on the way out. Another SDK, or a hand-published invocation, has not been
212
+ * through that.
213
+ */
214
+ export declare function durableCallbackContext(name: string, bound: unknown, configuration: unknown): Record<string, unknown>;
215
+ /**
216
+ * How many callbacks this process has declared.
217
+ *
218
+ * Not exported from the package: it exists so the invariant the feature is for —
219
+ * one entry per declaration, whatever the emission count — is assertable.
220
+ */
221
+ export declare function durableCallbackCount(): number;
222
+ export {};
223
+ //# sourceMappingURL=durableCallback.d.ts.map
@@ -0,0 +1 @@
1
+ {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K,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAA;CACnD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,eAAe,CAAC,GAAG,EAAE,KAAK,IAAI,KAAK,SAAS,IAAI,GACxD,qBAAqB,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,gBAAgB,CAAC,GAAG,CAAC,GACzD,qBAAqB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;AAErC,UAAU,YAAY;IACpB,OAAO,EAAE,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;CAC/C;AAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,GAAG,IAAI,EACV,KAAK,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI,EAClC,aAAa,GAAG,OAAO,EAEvB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,sBAAsB,CAAC,GAAG,EAAE,KAAK,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC,GAC1E,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,CAwB7B;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAE1E;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,OAAO,GACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGzB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C"}
@@ -50,11 +50,12 @@ export default function createContextHelper(options: {
50
50
  passthroughByteReferences?: boolean;
51
51
  onLog: (method: 'log' | 'warn' | 'info' | 'error', data: any[]) => void;
52
52
  onDefer: (reason?: string) => string;
53
- onCallback: (params: {
54
- sourceId: string;
55
- callbackId: string;
56
- outputName: string | null;
57
- propertyPath: (string | number)[];
53
+ /**
54
+ * Dispatches an invocation of a callback the handler received in its input.
55
+ * Takes the whole reference — both lifetimes ride the one tag (#147) and only
56
+ * the caller knows how to route each arm.
57
+ */
58
+ onCallback: (payload: CallbackObject & {
58
59
  arg: unknown;
59
60
  }) => void;
60
61
  onRender: (params: {