@requence/service 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/README.md +258 -0
- package/build/{chunk-974rc2jy.js → chunk-gpyt51xn.js} +164 -3
- package/build/{chunk-974rc2jy.js.map → chunk-gpyt51xn.js.map} +7 -4
- package/build/cli.js +17 -30
- package/build/cli.js.map +3 -3
- package/build/index.js +538 -94
- package/build/index.js.map +18 -10
- 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/service/src/boundary.d.ts +14 -1
- package/build/types/service/src/boundary.d.ts.map +1 -1
- package/build/types/service/src/createAmqpConnection.d.ts +55 -0
- package/build/types/service/src/createAmqpConnection.d.ts.map +1 -1
- package/build/types/service/src/errors.d.ts +11 -0
- package/build/types/service/src/errors.d.ts.map +1 -1
- package/build/types/service/src/helpers.d.ts +68 -0
- package/build/types/service/src/helpers.d.ts.map +1 -1
- package/build/types/service/src/index.d.ts +2 -0
- package/build/types/service/src/index.d.ts.map +1 -1
- package/build/types/service/src/surfaceHandler.d.ts +36 -0
- package/build/types/service/src/surfaceHandler.d.ts.map +1 -0
- package/build/types/service/src/surfaceUi.d.ts +141 -0
- package/build/types/service/src/surfaceUi.d.ts.map +1 -0
- package/build/types/service/src/transformer.d.ts +14 -0
- package/build/types/service/src/transformer.d.ts.map +1 -1
- package/build/types/service/src/ui.d.ts +247 -0
- package/build/types/service/src/ui.d.ts.map +1 -0
- package/build/types/service/src/uiWatch.d.ts +68 -0
- package/build/types/service/src/uiWatch.d.ts.map +1 -0
- package/package.json +10 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAG1B,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,QAAQ,EAEd,MAAM,gBAAgB,CAAA;AAGvB,eAAO,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAKxB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AACnD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA"}
|
|
@@ -4,6 +4,7 @@ export * from './configurationScript.ts';
|
|
|
4
4
|
export * from './logicLanguages.ts';
|
|
5
5
|
export * from './loopDetection.ts';
|
|
6
6
|
export * from './nodeType.ts';
|
|
7
|
+
export * from './sliceTreeList.ts';
|
|
7
8
|
export * from './update.ts';
|
|
8
9
|
export * from './treeNodes.ts';
|
|
9
10
|
export * from './validateTreeStructure.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,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,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,81 @@
|
|
|
1
|
+
import { type InputTreeList, type TreeList } from './treeNodes.ts';
|
|
2
|
+
import { type SliceOptions, type SliceStats } from '../utils/sliceClock.ts';
|
|
3
|
+
/**
|
|
4
|
+
* THE SLICED TREE-LIST VALIDATOR (#134).
|
|
5
|
+
*
|
|
6
|
+
* `treeListSchema.parse` is one uninterruptible call. It walks the main tree,
|
|
7
|
+
* every reference tree and every JSON schema, and each of those JSON schemas
|
|
8
|
+
* costs an AJV compile — measured at ~3.4 ms each, ~12 ms for a service node
|
|
9
|
+
* carrying three of them, ~4 s for a 1.2 MB tree list with 23 references. For
|
|
10
|
+
* that whole time NO callback can run, the AMQP heartbeat included. On
|
|
11
|
+
* 2026-08-07 that is exactly what happened: the loop went past the 30 s
|
|
12
|
+
* heartbeat, the broker closed the connection, and every publish issued inside
|
|
13
|
+
* the dead window was lost (#130).
|
|
14
|
+
*
|
|
15
|
+
* The caching of #132 bounds the REPEAT and the semaphore of #133 bounds how
|
|
16
|
+
* many parses interleave. Neither bounds a single cold parse. This is the one
|
|
17
|
+
* that does.
|
|
18
|
+
*
|
|
19
|
+
* WHAT IT DOES: the same validation, item by item, yielding to the event loop
|
|
20
|
+
* whenever the current slice has run longer than `budgetMs`. Total CPU is
|
|
21
|
+
* unchanged — slightly higher, in fact. The difference is that heartbeats,
|
|
22
|
+
* confirms and timers get through. Slow is acceptable; a stall is not.
|
|
23
|
+
*
|
|
24
|
+
* WHAT IT IS NOT: it is not incremental, not resumable and not cancellable, and
|
|
25
|
+
* it does not bound EVERY call — the structural pass over the finished graph is
|
|
26
|
+
* still one call, deliberately (see it below). A rejected tree list is rejected
|
|
27
|
+
* with exactly the issues `treeListSchema` would have produced, which
|
|
28
|
+
* `sliceTreeList.spec.ts` asserts case by case rather than against hand-written
|
|
29
|
+
* expectations.
|
|
30
|
+
*
|
|
31
|
+
* WHY NOT A WORKER THREAD (#135). The alternative to this module was to move the
|
|
32
|
+
* parse off the loop entirely, and that ticket set the test itself: if handing
|
|
33
|
+
* the parsed result back costs a large fraction of the parse, slicing wins.
|
|
34
|
+
* Measured on Node 24 over a 267 kB tree list — 23 references, 564 JSON
|
|
35
|
+
* schemas, the shape of the tree that caused #130 —
|
|
36
|
+
*
|
|
37
|
+
* whole-schema parse, one call ~2000 ms total ~2000 ms worst block
|
|
38
|
+
* sliced (this module) ~1900 ms total ~50-90 ms worst block
|
|
39
|
+
* one CREATE through a worker ~2000 ms total ~7-15 ms worst block
|
|
40
|
+
* burst of 4 cold, sliced ~7400-8100 ms total ~85-140 ms worst block
|
|
41
|
+
* burst of 4 cold, 2 workers ~4100 ms total ~5-17 ms worst block
|
|
42
|
+
*
|
|
43
|
+
* — the return trip is NOT that large fraction: 7 ms for a `structuredClone` of
|
|
44
|
+
* the result, 1.6 ms for a msgpack decode of it, against ~2000 ms of parse. So
|
|
45
|
+
* on the ticket's own terms the worker thread wins, and it is still the wrong
|
|
46
|
+
* build:
|
|
47
|
+
*
|
|
48
|
+
* 1. It improves a number that no longer has a problem. What took the
|
|
49
|
+
* connection down was the 30 s AMQP heartbeat, and the operator warns at
|
|
50
|
+
* `LAG_WARN_THRESHOLD` (1000 ms, its `utils/eventLoopLag.ts`). Slicing already
|
|
51
|
+
* sits an order of magnitude under the warn threshold and more than two under
|
|
52
|
+
* the heartbeat; cutting 90 ms to 15 ms prevents no incident this does not.
|
|
53
|
+
* 2. Its real win is wall clock on a COLD burst — 7.5 s to 4.1 s — and that is
|
|
54
|
+
* parallelism, bought with cores and ~270 MB of RSS for two warm workers, on
|
|
55
|
+
* a box #135 itself calls deliberately small. That is latency, not stall
|
|
56
|
+
* safety, and #130's rule is that slow is acceptable.
|
|
57
|
+
* 3. It cannot keep the guarantee the spec above asserts. A `ZodError` does not
|
|
58
|
+
* survive `postMessage`: it arrives as a plain `Error` with `issues` gone, so
|
|
59
|
+
* identical rejection would have to be rebuilt by hand-serialising issues —
|
|
60
|
+
* a second place for the two validators to drift, which is the whole reason
|
|
61
|
+
* the rules here are shared rather than copied. Nor is the ticket's zero-copy
|
|
62
|
+
* return available: a tree list may carry a `URL` (a service node's
|
|
63
|
+
* `configuration` is `z.any()`, and the msgpack codec supports a `URL`
|
|
64
|
+
* deliberately), and `structuredClone` throws `DataCloneError` on one.
|
|
65
|
+
*
|
|
66
|
+
* Closed as `wontfix`. What would re-open it is a change in the RATE of cold
|
|
67
|
+
* parses, not in their cost — `ColdParseStats.coldParses` against `parses` in
|
|
68
|
+
* `treeListCache.ts` is the number that would say so.
|
|
69
|
+
*/
|
|
70
|
+
export type SlicedTreeList = SliceStats & {
|
|
71
|
+
treeList: TreeList;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* `treeListSchema.parse`, sliced.
|
|
75
|
+
*
|
|
76
|
+
* Rejects with the `ZodError` that parse would have produced. Resolves with the
|
|
77
|
+
* validated tree list and what the walk cost, so the caller can log the stall it
|
|
78
|
+
* did not cause.
|
|
79
|
+
*/
|
|
80
|
+
export declare function parseTreeListSliced(input: InputTreeList, options?: SliceOptions): Promise<SlicedTreeList>;
|
|
81
|
+
//# sourceMappingURL=sliceTreeList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliceTreeList.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/sliceTreeList.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,QAAQ,EAMd,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AAEH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG;IACxC,QAAQ,EAAE,QAAQ,CAAA;CACnB,CAAA;AAuJD;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,aAAa,EACpB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,cAAc,CAAC,CA2GzB"}
|