@requence/task 0.8.2-edge.1151 → 0.8.2-edge.1155
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.
- package/build/chunk-vnx9bdvh.js +181 -0
- package/build/chunk-vnx9bdvh.js.map +14 -0
- package/build/cli.js +11 -13
- package/build/cli.js.map +3 -3
- package/build/index.js +11 -11
- package/build/index.js.map +6 -6
- package/build/types/helpers/src/index.d.ts +5 -0
- package/build/types/helpers/src/index.d.ts.map +1 -1
- package/build/types/helpers/src/protocol/NodeTree.d.ts +29 -0
- package/build/types/helpers/src/protocol/NodeTree.d.ts.map +1 -1
- package/build/types/helpers/src/protocol/command.d.ts +859 -7
- package/build/types/helpers/src/protocol/command.d.ts.map +1 -1
- package/build/types/helpers/src/protocol/index.d.ts +1 -0
- package/build/types/helpers/src/protocol/index.d.ts.map +1 -1
- package/build/types/helpers/src/protocol/sliceTreeList.d.ts +81 -0
- package/build/types/helpers/src/protocol/sliceTreeList.d.ts.map +1 -0
- package/build/types/helpers/src/protocol/treeNodes.d.ts +577 -2
- package/build/types/helpers/src/protocol/treeNodes.d.ts.map +1 -1
- package/build/types/helpers/src/protocol/update.d.ts +128 -10
- package/build/types/helpers/src/protocol/update.d.ts.map +1 -1
- package/build/types/helpers/src/utils/amqpPublishRetry.d.ts +113 -18
- package/build/types/helpers/src/utils/amqpPublishRetry.d.ts.map +1 -1
- package/build/types/helpers/src/utils/matchSchema.d.ts +14 -0
- package/build/types/helpers/src/utils/matchSchema.d.ts.map +1 -1
- package/build/types/helpers/src/utils/serviceRender.d.ts +73 -0
- package/build/types/helpers/src/utils/serviceRender.d.ts.map +1 -0
- package/build/types/helpers/src/utils/sliceClock.d.ts +61 -0
- package/build/types/helpers/src/utils/sliceClock.d.ts.map +1 -0
- package/build/types/helpers/src/utils/surfaceComponent.d.ts +116 -0
- package/build/types/helpers/src/utils/surfaceComponent.d.ts.map +1 -0
- package/build/types/helpers/src/utils/surfaceHandler.d.ts +171 -0
- package/build/types/helpers/src/utils/surfaceHandler.d.ts.map +1 -0
- package/build/types/helpers/src/utils/uiRebuild.d.ts +48 -0
- package/build/types/helpers/src/utils/uiRebuild.d.ts.map +1 -0
- package/build/types/task/src/createTask.d.ts.map +1 -1
- package/build/types/task/src/getTask.d.ts.map +1 -1
- package/build/types/task/src/types.d.ts +4 -4
- package/build/types/task/src/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/build/chunk-f7g9gsa0.js +0 -65
- package/build/chunk-f7g9gsa0.js.map +0 -11
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a **surface component** is handed, declared once (#113).
|
|
3
|
+
*
|
|
4
|
+
* These types have three readers and no natural owner among them: the service
|
|
5
|
+
* SDK ships them to the component author (`@requence/service`), the frame
|
|
6
|
+
* protocol describes the object the bootstrap actually builds
|
|
7
|
+
* (`ui/frontend/src/routes/tasks/Show/surface/protocol.ts`), and the shared
|
|
8
|
+
* runtime's facade *implements* them in `createSurface`
|
|
9
|
+
* (`ui/frontend/surface-runtime/ui.tsx`). They lived in the SDK and were mirrored
|
|
10
|
+
* in the protocol, which was survivable while the mirror was two fields wide; a
|
|
11
|
+
* third copy in the facade is not, because the drift would land as a helper whose
|
|
12
|
+
* signature promises state the frame does not deliver — and the author's types
|
|
13
|
+
* would be the last thing to find out.
|
|
14
|
+
*
|
|
15
|
+
* So they live here, beside the render wire shape (`serviceRender.ts`) and the
|
|
16
|
+
* handler reference (`surfaceHandler.ts`), which is the seam both verticals
|
|
17
|
+
* already share for exactly this reason.
|
|
18
|
+
*
|
|
19
|
+
* Nothing here has a runtime half: the props themselves cross as
|
|
20
|
+
* `serviceRender`'s payload, and the rest is the browser's own object.
|
|
21
|
+
*/
|
|
22
|
+
/** The viewer's app theme, as the surface host reports it. */
|
|
23
|
+
export type SurfaceTheme = 'dark' | 'light';
|
|
24
|
+
/**
|
|
25
|
+
* Everything about a surface that can change while the component is mounted —
|
|
26
|
+
* what `ctx` carries at mount and what `onUpdate` hands over afterwards. Named
|
|
27
|
+
* once so the two cannot drift.
|
|
28
|
+
*
|
|
29
|
+
* There is no surface-wide liveness flag on it (#106). Reachability rides on
|
|
30
|
+
* each handler prop instead — `props.onSubmit.reachable` — because a surface can
|
|
31
|
+
* carry a durable handler and a connection-bound one at once and one flag over
|
|
32
|
+
* both necessarily lies about one of them.
|
|
33
|
+
*
|
|
34
|
+
* It is also what a component written with `createSurface` receives as its own
|
|
35
|
+
* props (#113), which is why the three fields are named for a component and not
|
|
36
|
+
* for the message that carries them.
|
|
37
|
+
*/
|
|
38
|
+
export interface SurfaceState<Props> {
|
|
39
|
+
props: Props;
|
|
40
|
+
canInvoke: boolean;
|
|
41
|
+
theme: SurfaceTheme;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The context a mounted component is handed. `props` is the object the service
|
|
45
|
+
* sent (handlers invokable, each carrying its own `reachable`); `canInvoke` is
|
|
46
|
+
* the viewer's `task: UPDATE` verdict; `theme` is the viewer's app theme;
|
|
47
|
+
* `onUpdate` fires on every re-render and returns an unsubscribe.
|
|
48
|
+
*
|
|
49
|
+
* A React component rarely touches this: `createSurface` subscribes for it and
|
|
50
|
+
* hands the state down as props. It is the layer underneath — what a component
|
|
51
|
+
* written without the helper, or in another framework, works against.
|
|
52
|
+
*
|
|
53
|
+
* `canInvoke` is an **affordance signal only** — disable the control, label it
|
|
54
|
+
* read-only. It is not the check: a viewer without the permission has their
|
|
55
|
+
* invocation refused by the parent frame, and ui/backend enforces it again on
|
|
56
|
+
* the mutation, so a component that ignores the flag cannot grant anything.
|
|
57
|
+
*
|
|
58
|
+
* **Reachability is separate, and per prop.** AND the two: `canInvoke` says
|
|
59
|
+
* whether this viewer may drive the surface, `reachable` says whether there is
|
|
60
|
+
* anything at the other end of that particular prop. The flag a form used to get
|
|
61
|
+
* this wrong with — one `live` for the whole surface — is gone, because a
|
|
62
|
+
* **durable** handler is reachable with no live message at all (which is the whole
|
|
63
|
+
* point of the kind: the service renders a form and exits within seconds while
|
|
64
|
+
* the node waits for days) while a connection-bound one on the same surface is
|
|
65
|
+
* not.
|
|
66
|
+
*
|
|
67
|
+
* There is no `submit` here. A form answers its node by calling a handler its own
|
|
68
|
+
* service put in the props — an ordinary function like every other interaction —
|
|
69
|
+
* rather than through a channel Requence defines. Write that handler in the UI's
|
|
70
|
+
* **defaults** so it is durable, and let it `act()` on the key the props carry.
|
|
71
|
+
*
|
|
72
|
+
* **A failed interaction is not reported here either** (#143). Calling a handler
|
|
73
|
+
* prop is *accepted* and nothing more: no return value, no promise, no request.
|
|
74
|
+
* When one could not run — it threw, nothing was registered under it, the version
|
|
75
|
+
* is gone — Requence records a generic sentence and renders it itself, beside the
|
|
76
|
+
* surface, in the same place as a refused click. Nothing arrives in this context,
|
|
77
|
+
* and a component must not try to render it.
|
|
78
|
+
*
|
|
79
|
+
* To say something better than the generic sentence, catch the error **in the
|
|
80
|
+
* handler** and **re-render** the surface with a prop of your own
|
|
81
|
+
* (`{ error: 'unknown address' }`). That statement is in the props, so no generic
|
|
82
|
+
* report can overwrite it, and both can be shown at once — the handler said
|
|
83
|
+
* something *and* it threw.
|
|
84
|
+
*
|
|
85
|
+
* **A `<form>` works, and it must call `preventDefault()`** (D31). The frame is
|
|
86
|
+
* sandboxed with `allow-scripts allow-forms`, so `<form onSubmit>` fires normally
|
|
87
|
+
* and Enter-to-submit comes with it. What the sandbox does *not* grant is
|
|
88
|
+
* `allow-top-navigation` or `allow-popups`, so a submission can only ever navigate
|
|
89
|
+
* **this frame** — which unloads the component. Call `preventDefault()` and invoke
|
|
90
|
+
* the handler prop instead. Forget it and the frame reloads; the surface
|
|
91
|
+
* re-initialises and remounts with its current props rather than going blank, but
|
|
92
|
+
* whatever the component held in local state is gone. A plain `onClick` button is
|
|
93
|
+
* still fine and needs none of this.
|
|
94
|
+
*
|
|
95
|
+
* A component that paints its own colours can follow a theme switch through
|
|
96
|
+
* `onUpdate` — but it rarely has to: the surface host also writes the theme onto
|
|
97
|
+
* `<html data-theme>`, which is what the shared runtime's CSS keys off, so a
|
|
98
|
+
* component drawn with the primitives facade follows the app for free.
|
|
99
|
+
*/
|
|
100
|
+
export interface SurfaceContext<Props> {
|
|
101
|
+
readonly props: Props;
|
|
102
|
+
readonly canInvoke: boolean;
|
|
103
|
+
readonly theme: SurfaceTheme;
|
|
104
|
+
onUpdate(callback: (next: SurfaceState<Props>) => void): () => void;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The component contract: one default-exported `mount(element, ctx)` that
|
|
108
|
+
* optionally returns a teardown. Typing the export with `Mount<PropsOf<typeof
|
|
109
|
+
* ui>>` checks the component against exactly what the service sends.
|
|
110
|
+
*
|
|
111
|
+
* A React component does not write one by hand — `createSurface` returns one
|
|
112
|
+
* (#113) — but it is still what the frame calls, and what any other framework
|
|
113
|
+
* exports.
|
|
114
|
+
*/
|
|
115
|
+
export type Mount<Props> = (element: HTMLElement, ctx: SurfaceContext<Props>) => (() => void) | void;
|
|
116
|
+
//# sourceMappingURL=surfaceComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surfaceComponent.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/utils/surfaceComponent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,8DAA8D;AAC9D,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAA;AAE3C;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,YAAY,CAAC,KAAK;IACjC,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,YAAY,CAAA;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,MAAM,WAAW,cAAc,CAAC,KAAK;IACnC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;IACrB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;IAC5B,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAAA;CACpE;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,KAAK,CAAC,KAAK,IAAI,CACzB,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,cAAc,CAAC,KAAK,CAAC,KACvB,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAA"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
/**
|
|
3
|
+
* The reference tag of a **surface handler** — a function a service put in a
|
|
4
|
+
* surface's props, which a viewer's interaction runs back in the service that
|
|
5
|
+
* issued the render (#103).
|
|
6
|
+
*
|
|
7
|
+
* Deliberately not a `RequenceCallback`, even though the connection-bound arm
|
|
8
|
+
* is routed the same way today. The two answer different questions and address
|
|
9
|
+
* different things: a callback reference is a peer-to-peer control-flow handle
|
|
10
|
+
* whose `outputName`/`propertyPath` address a position in the node's declared
|
|
11
|
+
* *output schema*, while a handler reference addresses a **prop of a UI**, has
|
|
12
|
+
* no output behind it, and — in its durable arm — names no connection at all.
|
|
13
|
+
* Merging them would put a lifetime on every callback in the fabric and make a
|
|
14
|
+
* durable reference look like something the operator should route by `sourceId`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SURFACE_HANDLER_TAG = "RequenceHandler";
|
|
17
|
+
/**
|
|
18
|
+
* How long a handler can be reached, decided by **where the function was
|
|
19
|
+
* written** — which is the only thing that actually bounds the closure's life:
|
|
20
|
+
*
|
|
21
|
+
* - `durable` — a function in the UI's default props. It closes over module
|
|
22
|
+
* scope, so *any* instance of the service version can run it, now or after a
|
|
23
|
+
* redeploy, and an invocation waits in the version's handler queue when none
|
|
24
|
+
* is running. Addressed by `(uiId, path)`, because that pair is what survives
|
|
25
|
+
* a rebuild and a restart; the component's content hash does not.
|
|
26
|
+
* - `connection` — a function written inline at `context.render(...)`. It closes
|
|
27
|
+
* over the running handler, so only that process can serve it and it dies when
|
|
28
|
+
* the handler returns. Addressed by the registering connection plus an id in
|
|
29
|
+
* its registry, exactly as a callback is.
|
|
30
|
+
*
|
|
31
|
+
* `uiId`/`path` ride on both arms: the connection-bound arm does not need them
|
|
32
|
+
* to be *routed*, but they are what says which prop of which component this
|
|
33
|
+
* handle belongs to, which is what the row-level `live` flag could never say
|
|
34
|
+
* (#106).
|
|
35
|
+
*/
|
|
36
|
+
export declare const surfaceHandlerObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
37
|
+
__REQUENCE_type: z.ZodLiteral<"RequenceHandler">;
|
|
38
|
+
lifetime: z.ZodLiteral<"durable">;
|
|
39
|
+
uiId: z.ZodString;
|
|
40
|
+
path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
|
|
41
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
42
|
+
__REQUENCE_type: z.ZodLiteral<"RequenceHandler">;
|
|
43
|
+
lifetime: z.ZodLiteral<"connection">;
|
|
44
|
+
uiId: z.ZodString;
|
|
45
|
+
path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
|
|
46
|
+
connectionId: z.ZodString;
|
|
47
|
+
handlerId: z.ZodUUID;
|
|
48
|
+
}, z.core.$strip>], "lifetime">;
|
|
49
|
+
export type SurfaceHandlerObject = z.infer<typeof surfaceHandlerObjectSchema>;
|
|
50
|
+
export type SurfaceHandlerLifetime = SurfaceHandlerObject['lifetime'];
|
|
51
|
+
export declare function isSurfaceHandlerObject(data: unknown): data is SurfaceHandlerObject;
|
|
52
|
+
/**
|
|
53
|
+
* The per-version **handler queue**: where a durable invocation waits until
|
|
54
|
+
* some instance of that service version consumes it.
|
|
55
|
+
*
|
|
56
|
+
* Derived from the version's dispatch queue rather than composed from the
|
|
57
|
+
* service and version names, so the two can never drift and a dev-overlay
|
|
58
|
+
* connection — which consumes a rewritten dispatch queue — gets a handler queue
|
|
59
|
+
* of its own for free.
|
|
60
|
+
*/
|
|
61
|
+
export declare function serviceHandlerQueueName(dispatchQueue: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* How long a durable invocation may wait in the handler queue before the broker
|
|
64
|
+
* drops it (#116).
|
|
65
|
+
*
|
|
66
|
+
* The queue is **not a mailbox**. Reachability is checked before the click — a
|
|
67
|
+
* version with no consumers reports `reachable: false` and the control is
|
|
68
|
+
* withheld — so all this has to bridge is the seconds between that check and the
|
|
69
|
+
* consume: a rolling redeploy, a scale-to-zero that started a moment ago, a
|
|
70
|
+
* replica that took the invocation and died. Long enough that a normal restart
|
|
71
|
+
* still serves the click, short enough that nobody is surprised by an effect
|
|
72
|
+
* they pressed for hours ago.
|
|
73
|
+
*
|
|
74
|
+
* That is the half the flag cannot do on its own: the flag only makes the click
|
|
75
|
+
* harder to fire, and a click that IS fired into an empty queue must expire and
|
|
76
|
+
* be *reported* rather than sit there waiting for whoever deploys next.
|
|
77
|
+
*
|
|
78
|
+
* Expiry is not a drop: the queue dead-letters to `error`, so an expired
|
|
79
|
+
* invocation comes back to the operator carrying its own `taskId` and surface
|
|
80
|
+
* row, and is recorded as an `interactionError` (#107).
|
|
81
|
+
*/
|
|
82
|
+
export declare const SURFACE_HANDLER_INVOCATION_TTL_MS = 60000;
|
|
83
|
+
/**
|
|
84
|
+
* The handler queue's declaration arguments, as **one** object, because two
|
|
85
|
+
* parties declare that queue — ui/backend's provisioner and the service SDK on
|
|
86
|
+
* connect — and a broker answers a mismatch with a 406 that kills the declaring
|
|
87
|
+
* channel. Anything short of a shared literal is a service that will not start.
|
|
88
|
+
*
|
|
89
|
+
* `deadLetterExchange` is what turns expiry into a *report*: `error` fans back
|
|
90
|
+
* into the operator's own shard family, so an expired invocation arrives at the
|
|
91
|
+
* error consumer still carrying its `taskId`, its surface row and its
|
|
92
|
+
* `surfaceHandlerInvocation` marker. Without it the broker would simply drop the
|
|
93
|
+
* message, which is the silent outcome #116 replaced.
|
|
94
|
+
*
|
|
95
|
+
* Note for whoever changes this: declaring a queue with a dead-letter exchange
|
|
96
|
+
* needs WRITE permission on that exchange, so the service AMQP user is granted
|
|
97
|
+
* it (`assertService`). It costs nothing — `error` is an internal exchange and
|
|
98
|
+
* the broker refuses a client publish to one however the permissions read.
|
|
99
|
+
*/
|
|
100
|
+
export declare const SURFACE_HANDLER_QUEUE_ARGUMENTS: {
|
|
101
|
+
readonly messageTtl: 60000;
|
|
102
|
+
readonly deadLetterExchange: 'error';
|
|
103
|
+
};
|
|
104
|
+
export declare function isDevOverlayHandlerQueue(queueName: string): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* The header a durable invocation is stamped with, so the party that has to
|
|
107
|
+
* answer an **unroutable** one can tell it from a dispatch (#104).
|
|
108
|
+
*
|
|
109
|
+
* A durable invocation is published `mandatory` into the `service` exchange, so
|
|
110
|
+
* one whose queue is gone comes back to the operator looking like any other
|
|
111
|
+
* undeliverable service message — and every other arm there fails the task's
|
|
112
|
+
* node, which a viewer's click must never do.
|
|
113
|
+
*
|
|
114
|
+
* A header rather than the routing key's `-handlers` suffix, which is *nearly*
|
|
115
|
+
* unambiguous and therefore worse: a version named `…-handlers` gives a dispatch
|
|
116
|
+
* queue that ends the same way, and the failure that buys is a real service
|
|
117
|
+
* dispatch silently swallowed instead of failing its node. This is exact, and it
|
|
118
|
+
* is set by the only publisher there is.
|
|
119
|
+
*/
|
|
120
|
+
export declare const SURFACE_HANDLER_INVOCATION_HEADER = "surfaceHandlerInvocation";
|
|
121
|
+
/**
|
|
122
|
+
* One durable handler invocation, as it travels on the queue above.
|
|
123
|
+
*
|
|
124
|
+
* The pair `(uiId, path)` is the whole address: the consuming instance looks the
|
|
125
|
+
* UI up in its own registry and resolves the path against that UI's default
|
|
126
|
+
* props. `taskId` is not part of the address — it is what makes the failure of
|
|
127
|
+
* an invocation that names nothing say *which run* it belonged to.
|
|
128
|
+
*/
|
|
129
|
+
export declare const surfaceHandlerInvocationSchema: z.ZodObject<{
|
|
130
|
+
taskId: z.ZodUUID;
|
|
131
|
+
surface: z.ZodUUID;
|
|
132
|
+
uiId: z.ZodString;
|
|
133
|
+
path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
|
|
134
|
+
arg: z.ZodOptional<z.ZodUnknown>;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
export type SurfaceHandlerInvocation = z.infer<typeof surfaceHandlerInvocationSchema>;
|
|
137
|
+
/**
|
|
138
|
+
* How long a recorded interaction failure may be (#107).
|
|
139
|
+
*
|
|
140
|
+
* A thrown error's message is author-supplied text of no bounded length, and it
|
|
141
|
+
* ends up on a row that is pushed to every viewer of the task on every render.
|
|
142
|
+
* Truncated rather than rejected: a long message is still the most useful thing
|
|
143
|
+
* anyone has about the failure, and its first characters are where the cause is.
|
|
144
|
+
*/
|
|
145
|
+
export declare const MAX_SURFACE_INTERACTION_ERROR_CHARS = 500;
|
|
146
|
+
/**
|
|
147
|
+
* The header a **surface interaction failure report** is stamped with (#107), so
|
|
148
|
+
* the operator can tell it from an ordinary service result.
|
|
149
|
+
*
|
|
150
|
+
* A report carries no message id and no index: the handler that failed was not
|
|
151
|
+
* running for any message of the operator's — that is the whole of what makes a
|
|
152
|
+
* durable handler durable — so it cannot ride the ordered dispatch buffer, and
|
|
153
|
+
* every other arm of the result path would fail the node the surface is painted
|
|
154
|
+
* on. It names a task, a surface row and what went wrong, and the operator
|
|
155
|
+
* forwards it as a task update.
|
|
156
|
+
*/
|
|
157
|
+
export declare const SURFACE_INTERACTION_ERROR_HEADER = "surfaceInteractionError";
|
|
158
|
+
/**
|
|
159
|
+
* One interaction failure, as a service reports it back to the operator (#107).
|
|
160
|
+
*
|
|
161
|
+
* The failing party writes the sentence: only it knows whether the component was
|
|
162
|
+
* unregistered, the prop held nothing invokable, or the handler threw — and only
|
|
163
|
+
* it can quote the error. The operator forwards the text verbatim; ui/backend
|
|
164
|
+
* masks it and stores it on the row.
|
|
165
|
+
*/
|
|
166
|
+
export declare const surfaceInteractionErrorReportSchema: z.ZodObject<{
|
|
167
|
+
surface: z.ZodUUID;
|
|
168
|
+
message: z.ZodString;
|
|
169
|
+
}, z.core.$strip>;
|
|
170
|
+
export type SurfaceInteractionErrorReport = z.infer<typeof surfaceInteractionErrorReportSchema>;
|
|
171
|
+
//# sourceMappingURL=surfaceHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surfaceHandler.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/utils/surfaceHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,oBAAoB,CAAA;AAIpD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;+BAiBrC,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAC7E,MAAM,MAAM,sBAAsB,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAA;AAErE,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,oBAAoB,CAE9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,iCAAiC,QAAS,CAAA;AAEvD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,+BAA+B;aAC1C,UAAU;aACV,kBAAkB,EAAE,OAAO;CACnB,CAAA;AAmBV,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEnE;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iCAAiC,6BAA6B,CAAA;AAE3E;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B;;;;;;iBA0BzC,CAAA;AAEF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,mCAAmC,MAAM,CAAA;AAEtD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gCAAgC,4BAA4B,CAAA;AAEzE;;;;;;;GAOG;AACH,eAAO,MAAM,mCAAmC;;;iBAG9C,CAAA;AAEF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,mCAAmC,CAC3C,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
/**
|
|
3
|
+
* Marks a service message as a **dev-loop bundle swap** (#108) rather than a
|
|
4
|
+
* result for one of the operator's dispatches.
|
|
5
|
+
*
|
|
6
|
+
* A rebuild changes which bytes the frame imports and nothing else — not the
|
|
7
|
+
* props, not the handlers, not the node — so it is deliberately not a render. A
|
|
8
|
+
* render would need the registering message to be unsettled and its registry
|
|
9
|
+
* alive, which is what took the dev loop away from a deferred form: the handler
|
|
10
|
+
* that drew it returned at the defer, so there is nothing left to re-render
|
|
11
|
+
* through. A swap needs none of that, and so works identically for a live panel,
|
|
12
|
+
* a deferred form, and a surface on a task that has already finished.
|
|
13
|
+
*
|
|
14
|
+
* Read on the same path as a result, and answered before it — like
|
|
15
|
+
* `SURFACE_INTERACTION_ERROR_HEADER`, this message has no correlation id, no
|
|
16
|
+
* index and no place in the ordered dispatch buffer, because it belongs to no
|
|
17
|
+
* message of the operator's.
|
|
18
|
+
*/
|
|
19
|
+
export declare const UI_REBUILD_HEADER = "uiRebuild";
|
|
20
|
+
/**
|
|
21
|
+
* What a rebuild says: *this component of this dev session is now these bytes*.
|
|
22
|
+
*
|
|
23
|
+
* `devSession` is opaque here and produced by the service SDK, which is the only
|
|
24
|
+
* party that can: it is the one identity that survives the process being
|
|
25
|
+
* restarted (a dev token plus the service version it is overlaying), so the
|
|
26
|
+
* surfaces a session drew before a restart are still the same session's
|
|
27
|
+
* afterwards. It deliberately carries no dev token in the clear — the token is
|
|
28
|
+
* hashed into it — because it comes to rest in `task_surface`.
|
|
29
|
+
*
|
|
30
|
+
* `uiId` is the component's stable id (#103), which is what makes the swap
|
|
31
|
+
* addressable at all: the hash is the thing that changed, so it cannot be the
|
|
32
|
+
* thing looked up. A surface repoints when it belongs to this session AND shows
|
|
33
|
+
* this component, whatever hash it is currently on — which is why a swap reaches
|
|
34
|
+
* a surface that has sat through several rebuilds unseen.
|
|
35
|
+
*
|
|
36
|
+
* `source` always travels. The render payload's per-task dedup does not apply: a
|
|
37
|
+
* swap is the first anyone has heard of this hash, and the surfaces it repoints
|
|
38
|
+
* are precisely the ones that would otherwise be left naming a bundle nobody
|
|
39
|
+
* stored.
|
|
40
|
+
*/
|
|
41
|
+
export declare const uiRebuildSchema: z.ZodObject<{
|
|
42
|
+
devSession: z.ZodString;
|
|
43
|
+
uiId: z.ZodString;
|
|
44
|
+
hash: z.ZodString;
|
|
45
|
+
source: z.ZodString;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export type UiRebuild = z.infer<typeof uiRebuildSchema>;
|
|
48
|
+
//# sourceMappingURL=uiRebuild.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uiRebuild.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/utils/uiRebuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,cAAc,CAAA;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,eAAe;;;;;iBAK1B,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,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GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,EACzD,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CA0ezE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTask.d.ts","sourceRoot":"","sources":["../../../../src/getTask.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getTask.d.ts","sourceRoot":"","sources":["../../../../src/getTask.ts"],"names":[],"mappings":"AAmCA,UAAU,cAAc;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,wBAAsB,OAAO,CAAC,eAAe,EAAE,MAAM,GAAG,cAAc;;;;;;;;;;;;;;;;;;;GA0DrE"}
|
|
@@ -35,7 +35,7 @@ declare const updateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
35
35
|
name: z.ZodString;
|
|
36
36
|
updateId: z.ZodUUID;
|
|
37
37
|
type: z.ZodLiteral<"taskStart">;
|
|
38
|
-
input: z.ZodUnknown
|
|
38
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
39
39
|
rootTaskId: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
|
|
40
40
|
}, z.core.$strip>, z.ZodObject<{
|
|
41
41
|
timestamp: z.ZodCoercedDate<unknown>;
|
|
@@ -84,7 +84,7 @@ declare const updateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
84
84
|
type: z.ZodLiteral<"logic" | "or" | "reference" | "service">;
|
|
85
85
|
alias: z.ZodOptional<z.ZodString>;
|
|
86
86
|
}, z.core.$strip>;
|
|
87
|
-
data: z.ZodUnknown
|
|
87
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
88
88
|
output: z.ZodUnion<readonly [z.ZodNull, z.ZodString]>;
|
|
89
89
|
}, z.core.$strip>, z.ZodObject<{
|
|
90
90
|
timestamp: z.ZodCoercedDate<unknown>;
|
|
@@ -151,7 +151,7 @@ export declare const eventSchema: z.ZodPipe<z.ZodPipe<z.ZodObject<{
|
|
|
151
151
|
name: z.ZodString;
|
|
152
152
|
updateId: z.ZodUUID;
|
|
153
153
|
type: z.ZodLiteral<"taskStart">;
|
|
154
|
-
input: z.ZodUnknown
|
|
154
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
155
155
|
rootTaskId: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
|
|
156
156
|
}, z.core.$strip>, z.ZodObject<{
|
|
157
157
|
timestamp: z.ZodCoercedDate<unknown>;
|
|
@@ -200,7 +200,7 @@ export declare const eventSchema: z.ZodPipe<z.ZodPipe<z.ZodObject<{
|
|
|
200
200
|
type: z.ZodLiteral<"logic" | "or" | "reference" | "service">;
|
|
201
201
|
alias: z.ZodOptional<z.ZodString>;
|
|
202
202
|
}, z.core.$strip>;
|
|
203
|
-
data: z.ZodUnknown
|
|
203
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
204
204
|
output: z.ZodUnion<readonly [z.ZodNull, z.ZodString]>;
|
|
205
205
|
}, z.core.$strip>, z.ZodObject<{
|
|
206
206
|
timestamp: z.ZodCoercedDate<unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B,KAAK,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI,OAAO,SAAS,CAAC,GAC7C,CAAC,SAAS,OAAO,GACf,IAAI,GACJ,IAAI,GACN,IAAI,CAAA;AAER,KAAK,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,SAAS,IAAI,GACvC,IAAI,SAAS,CAAC,G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CAAC,CAAC,CAAA;CAAE,CAAC,CACvE,CAAA;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAGH,CAAA;AAErB,eAAO,MAAM,cAAc,mEAMgC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@requence/task",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.8.2-edge.
|
|
4
|
+
"version": "0.8.2-edge.1155",
|
|
5
5
|
"bin": {
|
|
6
6
|
"requence-task": "build/cli.js"
|
|
7
7
|
},
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"ajv": "^8.17.1",
|
|
24
|
-
"chalk": "^5.6.2",
|
|
25
24
|
"eventsource-client": "^1.2.0",
|
|
26
25
|
"mime-types": "^3.0.1",
|
|
27
26
|
"yargs": "^17.7.2",
|
|
@@ -31,6 +30,7 @@
|
|
|
31
30
|
"@requence/callbacks": "workspace:*",
|
|
32
31
|
"@requence/files": "workspace:*",
|
|
33
32
|
"@requence/helpers": "workspace:*",
|
|
33
|
+
"@requence/logger": "workspace:*",
|
|
34
34
|
"@requence/transformer": "workspace:*",
|
|
35
35
|
"@requence/utils": "workspace:*",
|
|
36
36
|
"@types/bun": "^1.2.23",
|
package/build/chunk-f7g9gsa0.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// ../helpers/src/utils/obfuscate.ts
|
|
2
|
-
var separator = "";
|
|
3
|
-
var base65Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$";
|
|
4
|
-
var base65CharToIndex = {};
|
|
5
|
-
for (let i = 0;i < base65Chars.length; i++) {
|
|
6
|
-
base65CharToIndex[base65Chars[i]] = i;
|
|
7
|
-
}
|
|
8
|
-
function deobfuscate(str) {
|
|
9
|
-
const paddingCount = parseInt(str.slice(-1), 10);
|
|
10
|
-
str = str.slice(0, -1);
|
|
11
|
-
let binaryString = "";
|
|
12
|
-
for (let i = 0;i < str.length; i++) {
|
|
13
|
-
const decimalValue = base65CharToIndex[str[i]];
|
|
14
|
-
const binaryChunk = decimalValue.toString(2).padStart(6, "0");
|
|
15
|
-
binaryString += binaryChunk;
|
|
16
|
-
}
|
|
17
|
-
if (paddingCount > 0) {
|
|
18
|
-
binaryString = binaryString.slice(0, -paddingCount);
|
|
19
|
-
}
|
|
20
|
-
let decodedString = "";
|
|
21
|
-
const charSize = 16;
|
|
22
|
-
for (let i = 0;i < binaryString.length; i += charSize) {
|
|
23
|
-
const byte = binaryString.substring(i, i + charSize);
|
|
24
|
-
if (byte.length === 16) {
|
|
25
|
-
const charCode = parseInt(byte, 2);
|
|
26
|
-
decodedString += String.fromCharCode(charCode);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return decodedString.split(separator);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// src/errors.ts
|
|
33
|
-
var UNREACHABLE_STATUS = new Set([502, 503, 504]);
|
|
34
|
-
|
|
35
|
-
class RequenceUnreachableError extends Error {
|
|
36
|
-
status;
|
|
37
|
-
constructor(status, options) {
|
|
38
|
-
super("The requence system is currently not reachable. Please retry later.", options);
|
|
39
|
-
this.status = status;
|
|
40
|
-
this.name = "RequenceUnreachableError";
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function isUnreachableStatus(status) {
|
|
44
|
-
return UNREACHABLE_STATUS.has(status);
|
|
45
|
-
}
|
|
46
|
-
function assertReachable(response) {
|
|
47
|
-
if (isUnreachableStatus(response.status)) {
|
|
48
|
-
throw new RequenceUnreachableError(response.status);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
async function reachableFetch(input, init) {
|
|
52
|
-
let response;
|
|
53
|
-
try {
|
|
54
|
-
response = await fetch(input, init);
|
|
55
|
-
} catch (error) {
|
|
56
|
-
throw new RequenceUnreachableError(undefined, { cause: error });
|
|
57
|
-
}
|
|
58
|
-
assertReachable(response);
|
|
59
|
-
return response;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export { deobfuscate, RequenceUnreachableError, isUnreachableStatus, reachableFetch };
|
|
63
|
-
|
|
64
|
-
//# debugId=BB37885AF7B09DA164756E2164756E21
|
|
65
|
-
//# sourceMappingURL=chunk-f7g9gsa0.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../helpers/src/utils/obfuscate.ts", "../src/errors.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"const separator = '\\u{f6ee}'\n\nconst base65Chars =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$'\n\nconst base65CharToIndex: Record<string, number> = {}\nfor (let i = 0; i < base65Chars.length; i++) {\n base65CharToIndex[base65Chars[i]] = i\n}\n\nexport function obfuscate(...parts: Array<string>) {\n const str = parts.join(separator)\n let binaryString = ''\n\n for (let i = 0; i < str.length; i++) {\n const charCode = str.charCodeAt(i)\n binaryString += charCode.toString(2).padStart(16, '0')\n }\n\n let encodedString = ''\n const chunkSize = 6\n let paddingCount = 0\n\n for (let i = 0; i < binaryString.length; i += chunkSize) {\n let chunk = binaryString.substring(i, i + chunkSize)\n\n if (chunk.length < chunkSize) {\n paddingCount = chunkSize - chunk.length\n chunk = chunk.padEnd(chunkSize, '0')\n }\n\n const decimalValue = parseInt(chunk, 2)\n encodedString += base65Chars[decimalValue]\n }\n\n return encodedString + paddingCount.toString()\n}\n\nexport function randomString(length: number) {\n const randomValues = new Uint8Array(length)\n crypto.getRandomValues(randomValues)\n\n let randomString = ''\n for (let i = 0; i < length; i++) {\n randomString += base65Chars[randomValues[i] % base65Chars.length]\n }\n\n return randomString\n}\n\nexport function deobfuscate(str: string) {\n const paddingCount = parseInt(str.slice(-1), 10)\n str = str.slice(0, -1)\n\n let binaryString = ''\n\n for (let i = 0; i < str.length; i++) {\n const decimalValue = base65CharToIndex[str[i]]\n const binaryChunk = decimalValue.toString(2).padStart(6, '0')\n binaryString += binaryChunk\n }\n\n if (paddingCount > 0) {\n binaryString = binaryString.slice(0, -paddingCount)\n }\n\n let decodedString = ''\n const charSize = 16\n\n for (let i = 0; i < binaryString.length; i += charSize) {\n const byte = binaryString.substring(i, i + charSize)\n if (byte.length === 16) {\n const charCode = parseInt(byte, 2)\n decodedString += String.fromCharCode(charCode)\n }\n }\n\n return decodedString.split(separator)\n}\n",
|
|
6
|
-
"// Gateway statuses an ingress/load balancer emits when no healthy backend is\n// available (maintenance window, deploy, cutover). The task endpoints never\n// return these themselves, so treating them as \"unreachable\" is unambiguous.\nconst UNREACHABLE_STATUS = new Set([502, 503, 504])\n\n/**\n * Signals that the requence system could not be reached — e.g. during a\n * maintenance window or deploy, when the ui backend is unreachable (connection\n * refused / timeout / DNS failure) or an ingress returns a gateway error\n * (502/503/504). Callers should treat this as transient and retry later.\n */\nexport class RequenceUnreachableError extends Error {\n constructor(\n public readonly status?: number,\n options?: { cause?: unknown },\n ) {\n super(\n 'The requence system is currently not reachable. Please retry later.',\n options,\n )\n this.name = 'RequenceUnreachableError'\n }\n}\n\nexport function isUnreachableStatus(status: number): boolean {\n return UNREACHABLE_STATUS.has(status)\n}\n\n/**\n * Throws a {@link RequenceUnreachableError} when the response carries a gateway\n * status indicating the system is unreachable. Call right after a fetch, before\n * inspecting `response.ok`.\n */\nexport function assertReachable(response: Response): void {\n if (isUnreachableStatus(response.status)) {\n throw new RequenceUnreachableError(response.status)\n }\n}\n\n/**\n * Wraps `fetch` so a transport-level failure (connection refused, DNS failure,\n * timeout) surfaces as a {@link RequenceUnreachableError} instead of a raw\n * TypeError, and gateway statuses (502/503/504) do the same. The returned\n * response is guaranteed not to be a gateway-error response.\n */\nexport async function reachableFetch(\n input: Parameters<typeof fetch>[0],\n init?: Parameters<typeof fetch>[1],\n): Promise<Response> {\n let response: Response\n try {\n response = await fetch(input, init)\n } catch (error) {\n throw new RequenceUnreachableError(undefined, { cause: error })\n }\n assertReachable(response)\n return response\n}\n"
|
|
7
|
-
],
|
|
8
|
-
"mappings": ";AAAA,IAAM,YAAY;AAElB,IAAM,cACJ;AAEF,IAAM,oBAA4C,CAAC;AACnD,SAAS,IAAI,EAAG,IAAI,YAAY,QAAQ,KAAK;AAAA,EAC3C,kBAAkB,YAAY,MAAM;AACtC;AA0CO,SAAS,WAAW,CAAC,KAAa;AAAA,EACvC,MAAM,eAAe,SAAS,IAAI,MAAM,EAAE,GAAG,EAAE;AAAA,EAC/C,MAAM,IAAI,MAAM,GAAG,EAAE;AAAA,EAErB,IAAI,eAAe;AAAA,EAEnB,SAAS,IAAI,EAAG,IAAI,IAAI,QAAQ,KAAK;AAAA,IACnC,MAAM,eAAe,kBAAkB,IAAI;AAAA,IAC3C,MAAM,cAAc,aAAa,SAAS,CAAC,EAAE,SAAS,GAAG,GAAG;AAAA,IAC5D,gBAAgB;AAAA,EAClB;AAAA,EAEA,IAAI,eAAe,GAAG;AAAA,IACpB,eAAe,aAAa,MAAM,GAAG,CAAC,YAAY;AAAA,EACpD;AAAA,EAEA,IAAI,gBAAgB;AAAA,EACpB,MAAM,WAAW;AAAA,EAEjB,SAAS,IAAI,EAAG,IAAI,aAAa,QAAQ,KAAK,UAAU;AAAA,IACtD,MAAM,OAAO,aAAa,UAAU,GAAG,IAAI,QAAQ;AAAA,IACnD,IAAI,KAAK,WAAW,IAAI;AAAA,MACtB,MAAM,WAAW,SAAS,MAAM,CAAC;AAAA,MACjC,iBAAiB,OAAO,aAAa,QAAQ;AAAA,IAC/C;AAAA,EACF;AAAA,EAEA,OAAO,cAAc,MAAM,SAAS;AAAA;;;AC1EtC,IAAM,qBAAqB,IAAI,IAAI,CAAC,KAAK,KAAK,GAAG,CAAC;AAAA;AAQ3C,MAAM,iCAAiC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