@graphrefly/graphrefly 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-RLVFZDCE.js → chunk-76YPZQTW.js} +3 -9
- package/dist/{chunk-RLVFZDCE.js.map → chunk-76YPZQTW.js.map} +1 -1
- package/dist/{chunk-VZY2B2LU.js → chunk-BV3TPSBK.js} +1 -2
- package/dist/chunk-BV3TPSBK.js.map +1 -0
- package/dist/{chunk-YX263TXI.js → chunk-F6ORUNO7.js} +19 -52
- package/dist/chunk-F6ORUNO7.js.map +1 -0
- package/dist/chunk-FCLROC4Q.js +231 -0
- package/dist/chunk-FCLROC4Q.js.map +1 -0
- package/dist/{chunk-ITDVOCFO.js → chunk-J7S54G7I.js} +2 -3
- package/dist/{chunk-26A4E7J7.js → chunk-KJGUP35I.js} +4 -10
- package/dist/chunk-KJGUP35I.js.map +1 -0
- package/dist/{chunk-3BLRREFM.js → chunk-LB3RYLSC.js} +207 -174
- package/dist/chunk-LB3RYLSC.js.map +1 -0
- package/dist/{chunk-LKP7IWRV.js → chunk-TNKODJ6E.js} +3 -7
- package/dist/chunk-TNKODJ6E.js.map +1 -0
- package/dist/{chunk-RZSQ7P2C.js → chunk-UVWEKTYC.js} +3 -3
- package/dist/compat/nestjs/index.cjs +221 -225
- package/dist/compat/nestjs/index.cjs.map +1 -1
- package/dist/compat/nestjs/index.d.cts +4 -4
- package/dist/compat/nestjs/index.d.ts +4 -4
- package/dist/compat/nestjs/index.js +7 -13
- package/dist/core/index.cjs +0 -84
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +3 -7
- package/dist/extra/index.cjs +17 -54
- package/dist/extra/index.cjs.map +1 -1
- package/dist/extra/index.d.cts +4 -4
- package/dist/extra/index.d.ts +4 -4
- package/dist/extra/index.js +3 -9
- package/dist/graph/index.cjs +329 -174
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.d.cts +3 -3
- package/dist/graph/index.d.ts +3 -3
- package/dist/graph/index.js +10 -6
- package/dist/{graph-fCsaaVIa.d.cts → graph-BYFlyNpX.d.cts} +47 -45
- package/dist/{graph-Dc-P9BVm.d.ts → graph-gISB9n3n.d.ts} +47 -45
- package/dist/{index-N704txAA.d.ts → index-7WnwgjMu.d.ts} +5 -7
- package/dist/{index-DWq0P9T6.d.ts → index-B43mC7uY.d.cts} +5 -7
- package/dist/{index-BmoUvOGN.d.ts → index-B80mMeuf.d.ts} +2 -4
- package/dist/{index-DlGMf_Qe.d.cts → index-BqOWSFhr.d.cts} +2 -2
- package/dist/{index-BBVBYPxr.d.cts → index-CEDaJaYE.d.ts} +5 -7
- package/dist/{index-DhXznWyH.d.ts → index-CgKPpiu8.d.ts} +2 -2
- package/dist/{index-Db27z6Ki.d.cts → index-Ci_vPaVm.d.cts} +90 -7
- package/dist/{index-BR19vQME.d.ts → index-DKaB2x0T.d.ts} +90 -7
- package/dist/{index-ClaKZFPl.d.cts → index-D_tUMcpz.d.cts} +5 -7
- package/dist/{index-YlOH1Gw6.d.cts → index-EmzYk-TG.d.cts} +2 -4
- package/dist/index.cjs +503 -282
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +99 -18
- package/dist/index.d.ts +99 -18
- package/dist/index.js +170 -63
- package/dist/index.js.map +1 -1
- package/dist/{meta-BV4pj9ML.d.cts → meta-npl5b97j.d.cts} +1 -53
- package/dist/{meta-BV4pj9ML.d.ts → meta-npl5b97j.d.ts} +1 -53
- package/dist/observable-DFBCBELR.d.cts +36 -0
- package/dist/observable-oAGygKvc.d.ts +36 -0
- package/dist/patterns/reactive-layout/index.cjs +204 -172
- package/dist/patterns/reactive-layout/index.cjs.map +1 -1
- package/dist/patterns/reactive-layout/index.d.cts +3 -3
- package/dist/patterns/reactive-layout/index.d.ts +3 -3
- package/dist/patterns/reactive-layout/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-26A4E7J7.js.map +0 -1
- package/dist/chunk-3BLRREFM.js.map +0 -1
- package/dist/chunk-LKP7IWRV.js.map +0 -1
- package/dist/chunk-SHRJH2DN.js +0 -107
- package/dist/chunk-SHRJH2DN.js.map +0 -1
- package/dist/chunk-VZY2B2LU.js.map +0 -1
- package/dist/chunk-YX263TXI.js.map +0 -1
- package/dist/observable-Cz-AWhwR.d.cts +0 -42
- package/dist/observable-DCqlwGyl.d.ts +0 -42
- /package/dist/{chunk-ITDVOCFO.js.map → chunk-J7S54G7I.js.map} +0 -0
- /package/dist/{chunk-RZSQ7P2C.js.map → chunk-UVWEKTYC.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -137,24 +137,26 @@ import {
|
|
|
137
137
|
workerBridge,
|
|
138
138
|
workerSelf,
|
|
139
139
|
zip
|
|
140
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-76YPZQTW.js";
|
|
141
141
|
import {
|
|
142
142
|
cqrs_exports,
|
|
143
143
|
nestjs_exports
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-KJGUP35I.js";
|
|
145
145
|
import {
|
|
146
146
|
DEFAULT_DOWN,
|
|
147
147
|
bridge,
|
|
148
148
|
core_exports
|
|
149
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-TNKODJ6E.js";
|
|
150
150
|
import {
|
|
151
151
|
JsonCodec,
|
|
152
152
|
createDagCborCodec,
|
|
153
153
|
createDagCborZstdCodec,
|
|
154
|
+
graphProfile,
|
|
154
155
|
graph_exports,
|
|
155
156
|
negotiateCodec,
|
|
156
|
-
replayWAL
|
|
157
|
-
|
|
157
|
+
replayWAL,
|
|
158
|
+
sizeof
|
|
159
|
+
} from "./chunk-FCLROC4Q.js";
|
|
158
160
|
import {
|
|
159
161
|
cached,
|
|
160
162
|
createWatermarkController,
|
|
@@ -175,8 +177,6 @@ import {
|
|
|
175
177
|
matchesAnyPattern,
|
|
176
178
|
matchesCron,
|
|
177
179
|
never,
|
|
178
|
-
observeGraph$,
|
|
179
|
-
observeNode$,
|
|
180
180
|
of,
|
|
181
181
|
parseCron,
|
|
182
182
|
reactiveLog,
|
|
@@ -185,9 +185,8 @@ import {
|
|
|
185
185
|
shareReplay,
|
|
186
186
|
throwError,
|
|
187
187
|
toArray,
|
|
188
|
-
toMessages$,
|
|
189
188
|
toObservable
|
|
190
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-F6ORUNO7.js";
|
|
191
190
|
import {
|
|
192
191
|
ResettableTimer
|
|
193
192
|
} from "./chunk-WZ2Z2CRV.js";
|
|
@@ -195,17 +194,16 @@ import {
|
|
|
195
194
|
analyzeAndMeasure,
|
|
196
195
|
computeLineBreaks,
|
|
197
196
|
reactive_layout_exports
|
|
198
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-UVWEKTYC.js";
|
|
199
198
|
import {
|
|
200
199
|
GRAPH_META_SEGMENT,
|
|
201
200
|
Graph,
|
|
202
201
|
reachable
|
|
203
|
-
} from "./chunk-
|
|
202
|
+
} from "./chunk-LB3RYLSC.js";
|
|
204
203
|
import {
|
|
205
204
|
describeNode,
|
|
206
|
-
metaSnapshot,
|
|
207
205
|
resolveDescribeFields
|
|
208
|
-
} from "./chunk-
|
|
206
|
+
} from "./chunk-J7S54G7I.js";
|
|
209
207
|
import {
|
|
210
208
|
CLEANUP_RESULT,
|
|
211
209
|
COMPLETE,
|
|
@@ -249,7 +247,7 @@ import {
|
|
|
249
247
|
propagatesToMeta,
|
|
250
248
|
state,
|
|
251
249
|
wallClockNs
|
|
252
|
-
} from "./chunk-
|
|
250
|
+
} from "./chunk-BV3TPSBK.js";
|
|
253
251
|
|
|
254
252
|
// src/compat/index.ts
|
|
255
253
|
var compat_exports = {};
|
|
@@ -1489,36 +1487,33 @@ function firstDataFromNode(resolved, opts) {
|
|
|
1489
1487
|
}
|
|
1490
1488
|
const timeoutMs = opts?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
1491
1489
|
return new Promise((resolve, reject) => {
|
|
1492
|
-
|
|
1493
|
-
const cleanup = () => {
|
|
1494
|
-
if (timer !== void 0) clearTimeout(timer);
|
|
1495
|
-
};
|
|
1490
|
+
const timer = new ResettableTimer();
|
|
1496
1491
|
const unsub = resolved.subscribe((messages) => {
|
|
1497
1492
|
for (const msg of messages) {
|
|
1498
1493
|
if (msg[0] === DATA) {
|
|
1499
|
-
|
|
1494
|
+
timer.cancel();
|
|
1500
1495
|
unsub();
|
|
1501
1496
|
resolve(msg[1]);
|
|
1502
1497
|
return;
|
|
1503
1498
|
}
|
|
1504
1499
|
if (msg[0] === ERROR) {
|
|
1505
|
-
|
|
1500
|
+
timer.cancel();
|
|
1506
1501
|
unsub();
|
|
1507
1502
|
reject(msg[1]);
|
|
1508
1503
|
return;
|
|
1509
1504
|
}
|
|
1510
1505
|
if (msg[0] === COMPLETE) {
|
|
1511
|
-
|
|
1506
|
+
timer.cancel();
|
|
1512
1507
|
unsub();
|
|
1513
1508
|
reject(new Error("firstDataFromNode: completed without producing a value"));
|
|
1514
1509
|
return;
|
|
1515
1510
|
}
|
|
1516
1511
|
}
|
|
1517
1512
|
});
|
|
1518
|
-
timer
|
|
1513
|
+
timer.start(timeoutMs, () => {
|
|
1519
1514
|
unsub();
|
|
1520
1515
|
reject(new Error(`firstDataFromNode: timed out after ${timeoutMs}ms`));
|
|
1521
|
-
}
|
|
1516
|
+
});
|
|
1522
1517
|
});
|
|
1523
1518
|
}
|
|
1524
1519
|
async function resolveToolHandlerResult(value) {
|
|
@@ -2938,7 +2933,7 @@ function demoShell(opts) {
|
|
|
2938
2933
|
([ref, _tick]) => {
|
|
2939
2934
|
const demo = ref;
|
|
2940
2935
|
if (!demo) return [];
|
|
2941
|
-
return demo.
|
|
2936
|
+
return demo.trace();
|
|
2942
2937
|
},
|
|
2943
2938
|
{ name: "inspect/trace-log" }
|
|
2944
2939
|
);
|
|
@@ -4884,9 +4879,12 @@ __export(harness_exports, {
|
|
|
4884
4879
|
DEFAULT_QUEUE_CONFIGS: () => DEFAULT_QUEUE_CONFIGS,
|
|
4885
4880
|
DEFAULT_SEVERITY_WEIGHTS: () => DEFAULT_SEVERITY_WEIGHTS,
|
|
4886
4881
|
HarnessGraph: () => HarnessGraph,
|
|
4882
|
+
QUEUE_NAMES: () => QUEUE_NAMES,
|
|
4887
4883
|
defaultErrorClassifier: () => defaultErrorClassifier,
|
|
4888
4884
|
evalIntakeBridge: () => evalIntakeBridge,
|
|
4889
4885
|
harnessLoop: () => harnessLoop,
|
|
4886
|
+
harnessProfile: () => harnessProfile,
|
|
4887
|
+
harnessTrace: () => harnessTrace,
|
|
4890
4888
|
priorityScore: () => priorityScore,
|
|
4891
4889
|
strategyKey: () => strategyKey,
|
|
4892
4890
|
strategyModel: () => strategyModel
|
|
@@ -5787,6 +5785,12 @@ function onFailure(graph, name, source, recover, opts) {
|
|
|
5787
5785
|
}
|
|
5788
5786
|
|
|
5789
5787
|
// src/patterns/harness/types.ts
|
|
5788
|
+
var QUEUE_NAMES = [
|
|
5789
|
+
"auto-fix",
|
|
5790
|
+
"needs-decision",
|
|
5791
|
+
"investigation",
|
|
5792
|
+
"backlog"
|
|
5793
|
+
];
|
|
5790
5794
|
function strategyKey(rootCause, intervention) {
|
|
5791
5795
|
return `${rootCause}\u2192${intervention}`;
|
|
5792
5796
|
}
|
|
@@ -5887,8 +5891,8 @@ function priorityScore(item, strategy, lastInteractionNs, urgency, signals) {
|
|
|
5887
5891
|
}
|
|
5888
5892
|
|
|
5889
5893
|
// src/patterns/harness/loop.ts
|
|
5890
|
-
function
|
|
5891
|
-
return
|
|
5894
|
+
function trackingKey(item) {
|
|
5895
|
+
return item.relatedTo?.[0] ?? item.summary;
|
|
5892
5896
|
}
|
|
5893
5897
|
var DEFAULT_TRIAGE_PROMPT = `You are a triage classifier for a reactive collaboration harness.
|
|
5894
5898
|
|
|
@@ -5934,12 +5938,6 @@ Output JSON:
|
|
|
5934
5938
|
"findings": ["<finding1>", ...],
|
|
5935
5939
|
"errorClass": "self-correctable" | "structural" // only if verified=false
|
|
5936
5940
|
}`;
|
|
5937
|
-
var QUEUE_NAMES = [
|
|
5938
|
-
"auto-fix",
|
|
5939
|
-
"needs-decision",
|
|
5940
|
-
"investigation",
|
|
5941
|
-
"backlog"
|
|
5942
|
-
];
|
|
5943
5941
|
var HarnessGraph = class extends Graph {
|
|
5944
5942
|
/** Intake topic — publish items here to enter the loop. */
|
|
5945
5943
|
intake;
|
|
@@ -5951,19 +5949,19 @@ var HarnessGraph = class extends Graph {
|
|
|
5951
5949
|
strategy;
|
|
5952
5950
|
/** Verify results topic — subscribe to see verification outcomes. */
|
|
5953
5951
|
verifyResults;
|
|
5954
|
-
/**
|
|
5955
|
-
|
|
5956
|
-
/**
|
|
5957
|
-
|
|
5958
|
-
constructor(name, intake, queues, gates, strategy, verifyResults,
|
|
5952
|
+
/** Global retry count across all items (circuit breaker). Reactive — subscribable. */
|
|
5953
|
+
totalRetries;
|
|
5954
|
+
/** Global reingestion count across all items (circuit breaker). Reactive — subscribable. */
|
|
5955
|
+
totalReingestions;
|
|
5956
|
+
constructor(name, intake, queues, gates, strategy, verifyResults, totalRetries, totalReingestions) {
|
|
5959
5957
|
super(name);
|
|
5960
5958
|
this.intake = intake;
|
|
5961
5959
|
this.queues = queues;
|
|
5962
5960
|
this.gates = gates;
|
|
5963
5961
|
this.strategy = strategy;
|
|
5964
5962
|
this.verifyResults = verifyResults;
|
|
5965
|
-
this.
|
|
5966
|
-
this.
|
|
5963
|
+
this.totalRetries = totalRetries;
|
|
5964
|
+
this.totalReingestions = totalReingestions;
|
|
5967
5965
|
}
|
|
5968
5966
|
};
|
|
5969
5967
|
function harnessLoop(name, opts) {
|
|
@@ -6005,11 +6003,14 @@ function harnessLoop(name, opts) {
|
|
|
6005
6003
|
for (const route of QUEUE_NAMES) {
|
|
6006
6004
|
queueTopics.set(route, new TopicGraph(`queue/${route}`, { retainedLimit }));
|
|
6007
6005
|
}
|
|
6008
|
-
const
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6006
|
+
const routerInput = withLatestFrom(triageNode, triageInput);
|
|
6007
|
+
const router = effect([routerInput], ([pair]) => {
|
|
6008
|
+
const [classification, triagePair] = pair;
|
|
6009
|
+
if (!classification || !classification.route) return;
|
|
6010
|
+
const intakeItem = triagePair?.[0];
|
|
6011
|
+
const merged = { ...intakeItem, ...classification };
|
|
6012
|
+
const topic2 = queueTopics.get(merged.route);
|
|
6013
|
+
if (topic2) topic2.publish(merged);
|
|
6013
6014
|
});
|
|
6014
6015
|
const routerUnsub = router.subscribe(() => {
|
|
6015
6016
|
});
|
|
@@ -6069,8 +6070,10 @@ function harnessLoop(name, opts) {
|
|
|
6069
6070
|
executeInput
|
|
6070
6071
|
);
|
|
6071
6072
|
const maxReingestions = opts.maxReingestions ?? 1;
|
|
6072
|
-
const
|
|
6073
|
-
const
|
|
6073
|
+
const maxTotalRetries = Math.min(opts.maxTotalRetries ?? maxRetries * 10, 100);
|
|
6074
|
+
const maxTotalReingestions = Math.min(opts.maxTotalReingestions ?? maxReingestions * 10, 100);
|
|
6075
|
+
const totalRetries = state(0);
|
|
6076
|
+
const totalReingestions = state(0);
|
|
6074
6077
|
const fastRetry = effect([verifyContext], ([ctx]) => {
|
|
6075
6078
|
const [[vo, execRaw], item] = ctx;
|
|
6076
6079
|
if (!vo || !item) return;
|
|
@@ -6096,29 +6099,33 @@ function harnessLoop(name, opts) {
|
|
|
6096
6099
|
outcome: "failure",
|
|
6097
6100
|
detail: vr.findings.join("; ")
|
|
6098
6101
|
});
|
|
6099
|
-
const
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6102
|
+
const itemRetries = item._retries ?? 0;
|
|
6103
|
+
if (errClass === "self-correctable" && itemRetries < maxRetries && (totalRetries.get() ?? 0) < maxTotalRetries) {
|
|
6104
|
+
totalRetries.down([[DIRTY], [DATA, (totalRetries.get() ?? 0) + 1]]);
|
|
6105
|
+
const key = trackingKey(item);
|
|
6103
6106
|
const retryItem = {
|
|
6104
6107
|
...item,
|
|
6105
|
-
|
|
6108
|
+
_retries: itemRetries + 1,
|
|
6109
|
+
summary: `[RETRY ${itemRetries + 1}/${maxRetries}] ${key} \u2014 Previous attempt failed: ${vr.findings.join("; ")}`,
|
|
6110
|
+
relatedTo: [key]
|
|
6106
6111
|
};
|
|
6107
6112
|
retryTopic.publish(retryItem);
|
|
6108
6113
|
} else {
|
|
6109
6114
|
strategy.record(item.rootCause, item.intervention, false);
|
|
6110
6115
|
verifyResults.publish(vr);
|
|
6111
|
-
const
|
|
6112
|
-
|
|
6113
|
-
|
|
6116
|
+
const key = trackingKey(item);
|
|
6117
|
+
const itemReingestions = item._reingestions ?? 0;
|
|
6118
|
+
if (itemReingestions < maxReingestions && (totalReingestions.get() ?? 0) < maxTotalReingestions) {
|
|
6119
|
+
totalReingestions.down([[DIRTY], [DATA, (totalReingestions.get() ?? 0) + 1]]);
|
|
6114
6120
|
intake.publish({
|
|
6115
6121
|
source: "eval",
|
|
6116
|
-
summary: `Verification failed for: ${
|
|
6122
|
+
summary: `Verification failed for: ${key}`,
|
|
6117
6123
|
evidence: vr.findings.join("\n"),
|
|
6118
6124
|
affectsAreas: item.affectsAreas,
|
|
6119
6125
|
affectsEvalTasks: item.affectsEvalTasks,
|
|
6120
6126
|
severity: "high",
|
|
6121
|
-
relatedTo: [
|
|
6127
|
+
relatedTo: [key],
|
|
6128
|
+
_reingestions: itemReingestions + 1
|
|
6122
6129
|
});
|
|
6123
6130
|
}
|
|
6124
6131
|
}
|
|
@@ -6132,12 +6139,16 @@ function harnessLoop(name, opts) {
|
|
|
6132
6139
|
gateControllers,
|
|
6133
6140
|
strategy,
|
|
6134
6141
|
verifyResults,
|
|
6135
|
-
|
|
6136
|
-
|
|
6142
|
+
totalRetries,
|
|
6143
|
+
totalReingestions
|
|
6137
6144
|
);
|
|
6138
6145
|
harness.addDisposer(routerUnsub);
|
|
6139
6146
|
harness.addDisposer(fastRetryUnsub);
|
|
6140
6147
|
harness.addDisposer(strategy.dispose);
|
|
6148
|
+
harness.add("triage", triageNode);
|
|
6149
|
+
harness.add("execute", executeNode);
|
|
6150
|
+
harness.add("verify", verifyNode);
|
|
6151
|
+
harness.add("strategy", strategy.node);
|
|
6141
6152
|
harness.mount("intake", intake);
|
|
6142
6153
|
for (const [route, topic2] of queueTopics) {
|
|
6143
6154
|
harness.mount(`queue/${route}`, topic2);
|
|
@@ -6148,6 +6159,105 @@ function harnessLoop(name, opts) {
|
|
|
6148
6159
|
return harness;
|
|
6149
6160
|
}
|
|
6150
6161
|
|
|
6162
|
+
// src/patterns/harness/profile.ts
|
|
6163
|
+
function harnessProfile(harness, opts) {
|
|
6164
|
+
const base = graphProfile(harness, opts);
|
|
6165
|
+
const queueDepths = {};
|
|
6166
|
+
for (const [route, topic2] of harness.queues) {
|
|
6167
|
+
queueDepths[route] = topic2.retained().length;
|
|
6168
|
+
}
|
|
6169
|
+
return {
|
|
6170
|
+
...base,
|
|
6171
|
+
queueDepths,
|
|
6172
|
+
strategyEntries: harness.strategy.node.get()?.size ?? 0,
|
|
6173
|
+
totalRetries: harness.totalRetries.get() ?? 0,
|
|
6174
|
+
totalReingestions: harness.totalReingestions.get() ?? 0
|
|
6175
|
+
};
|
|
6176
|
+
}
|
|
6177
|
+
|
|
6178
|
+
// src/patterns/harness/trace.ts
|
|
6179
|
+
var STAGE_LABELS = {
|
|
6180
|
+
"intake::latest": "INTAKE",
|
|
6181
|
+
triage: "TRIAGE",
|
|
6182
|
+
execute: "EXECUTE",
|
|
6183
|
+
"verify-results::latest": "VERIFY",
|
|
6184
|
+
strategy: "STRATEGY"
|
|
6185
|
+
};
|
|
6186
|
+
for (const route of QUEUE_NAMES) {
|
|
6187
|
+
STAGE_LABELS[`queue/${route}::latest`] = "QUEUE";
|
|
6188
|
+
}
|
|
6189
|
+
function harnessTrace(harness, opts) {
|
|
6190
|
+
const logger = opts?.logger ?? console.log;
|
|
6191
|
+
const startNs = monotonicNs();
|
|
6192
|
+
const observations = [];
|
|
6193
|
+
function elapsed() {
|
|
6194
|
+
const deltaNs = monotonicNs() - startNs;
|
|
6195
|
+
const secs = deltaNs / 1e9;
|
|
6196
|
+
return secs.toFixed(3);
|
|
6197
|
+
}
|
|
6198
|
+
for (const [path, stage] of Object.entries(STAGE_LABELS)) {
|
|
6199
|
+
try {
|
|
6200
|
+
const obs = harness.observe(path, {
|
|
6201
|
+
format: "json",
|
|
6202
|
+
logger: (_line, event) => {
|
|
6203
|
+
if (event.type === "data") {
|
|
6204
|
+
const dataStr = event.data !== void 0 ? ` ${summarize(event.data)}` : "";
|
|
6205
|
+
logger(`[${elapsed()}s] ${stage.padEnd(9)} \u2190${dataStr}`);
|
|
6206
|
+
} else if (event.type === "error") {
|
|
6207
|
+
const errStr = event.data !== void 0 ? ` ${summarize(event.data)}` : "";
|
|
6208
|
+
logger(`[${elapsed()}s] ${stage.padEnd(9)} \u2717${errStr}`);
|
|
6209
|
+
} else if (event.type === "complete") {
|
|
6210
|
+
logger(`[${elapsed()}s] ${stage.padEnd(9)} \u25A0 complete`);
|
|
6211
|
+
}
|
|
6212
|
+
},
|
|
6213
|
+
includeTypes: ["data", "error", "complete"]
|
|
6214
|
+
});
|
|
6215
|
+
observations.push(obs);
|
|
6216
|
+
} catch {
|
|
6217
|
+
}
|
|
6218
|
+
}
|
|
6219
|
+
for (const [gatedRoute] of harness.gates) {
|
|
6220
|
+
const gatePath = `gates::${gatedRoute}/gate`;
|
|
6221
|
+
try {
|
|
6222
|
+
const obs = harness.observe(gatePath, {
|
|
6223
|
+
format: "json",
|
|
6224
|
+
logger: (_line, event) => {
|
|
6225
|
+
if (event.type === "data") {
|
|
6226
|
+
const dataStr = event.data !== void 0 ? ` ${summarize(event.data)}` : "";
|
|
6227
|
+
logger(`[${elapsed()}s] GATE \u25B6${dataStr}`);
|
|
6228
|
+
} else if (event.type === "error") {
|
|
6229
|
+
logger(`[${elapsed()}s] GATE \u2717 ${summarize(event.data)}`);
|
|
6230
|
+
}
|
|
6231
|
+
},
|
|
6232
|
+
includeTypes: ["data", "error", "complete"]
|
|
6233
|
+
});
|
|
6234
|
+
observations.push(obs);
|
|
6235
|
+
} catch {
|
|
6236
|
+
}
|
|
6237
|
+
}
|
|
6238
|
+
return {
|
|
6239
|
+
dispose() {
|
|
6240
|
+
for (const obs of observations) obs.dispose();
|
|
6241
|
+
observations.length = 0;
|
|
6242
|
+
}
|
|
6243
|
+
};
|
|
6244
|
+
}
|
|
6245
|
+
function summarize(value) {
|
|
6246
|
+
if (value == null) return "null";
|
|
6247
|
+
if (typeof value === "string") return truncate(value, 80);
|
|
6248
|
+
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
6249
|
+
if (typeof value === "bigint") return String(value);
|
|
6250
|
+
try {
|
|
6251
|
+
const json = JSON.stringify(value);
|
|
6252
|
+
return truncate(json, 120);
|
|
6253
|
+
} catch {
|
|
6254
|
+
return String(value);
|
|
6255
|
+
}
|
|
6256
|
+
}
|
|
6257
|
+
function truncate(s, max) {
|
|
6258
|
+
return s.length > max ? `${s.slice(0, max - 1)}\u2026` : s;
|
|
6259
|
+
}
|
|
6260
|
+
|
|
6151
6261
|
// src/index.ts
|
|
6152
6262
|
var version = "0.0.0";
|
|
6153
6263
|
export {
|
|
@@ -6215,7 +6325,6 @@ export {
|
|
|
6215
6325
|
delay,
|
|
6216
6326
|
demo_shell_exports as demoShell,
|
|
6217
6327
|
derived,
|
|
6218
|
-
describeNode,
|
|
6219
6328
|
deserializeError,
|
|
6220
6329
|
distill,
|
|
6221
6330
|
distinctUntilChanged,
|
|
@@ -6270,6 +6379,7 @@ export {
|
|
|
6270
6379
|
fromWebhook,
|
|
6271
6380
|
globToRegExp,
|
|
6272
6381
|
graph_exports as graph,
|
|
6382
|
+
graphProfile,
|
|
6273
6383
|
graphspec_exports as graphspec,
|
|
6274
6384
|
harness_exports as harness,
|
|
6275
6385
|
interval,
|
|
@@ -6293,7 +6403,6 @@ export {
|
|
|
6293
6403
|
mergeMap,
|
|
6294
6404
|
messageTier,
|
|
6295
6405
|
messaging_exports as messaging,
|
|
6296
|
-
metaSnapshot,
|
|
6297
6406
|
monotonicNs,
|
|
6298
6407
|
nameToSignal,
|
|
6299
6408
|
nanostores_exports as nanostores,
|
|
@@ -6302,8 +6411,6 @@ export {
|
|
|
6302
6411
|
never,
|
|
6303
6412
|
node,
|
|
6304
6413
|
normalizeActor,
|
|
6305
|
-
observeGraph$,
|
|
6306
|
-
observeNode$,
|
|
6307
6414
|
of,
|
|
6308
6415
|
orchestration_exports as orchestration,
|
|
6309
6416
|
pairwise,
|
|
@@ -6348,6 +6455,7 @@ export {
|
|
|
6348
6455
|
shareReplay,
|
|
6349
6456
|
signalToName,
|
|
6350
6457
|
signals_exports as signals,
|
|
6458
|
+
sizeof,
|
|
6351
6459
|
skip,
|
|
6352
6460
|
solid_exports as solid,
|
|
6353
6461
|
startWith,
|
|
@@ -6369,7 +6477,6 @@ export {
|
|
|
6369
6477
|
toFile,
|
|
6370
6478
|
toKafka,
|
|
6371
6479
|
toLoki,
|
|
6372
|
-
toMessages$,
|
|
6373
6480
|
toMongo,
|
|
6374
6481
|
toNATS,
|
|
6375
6482
|
toObservable,
|