@graphrefly/graphrefly 0.19.0 → 0.20.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-XUOY3YKN.js → chunk-2L5J6RPM.js} +2 -2
- package/dist/{chunk-JC2SN46B.js → chunk-3N2Y6PCR.js} +3 -3
- package/dist/{chunk-OO5QOAXI.js → chunk-5PSVTDNZ.js} +22 -9
- package/dist/chunk-5PSVTDNZ.js.map +1 -0
- package/dist/{chunk-BER7UYLM.js → chunk-BJAOEU4D.js} +10 -6
- package/dist/{chunk-BER7UYLM.js.map → chunk-BJAOEU4D.js.map} +1 -1
- package/dist/{chunk-UW77D7SP.js → chunk-IAPLC4NR.js} +3 -3
- package/dist/{chunk-IRZAGZUB.js → chunk-OOA2UTXF.js} +26 -2
- package/dist/chunk-OOA2UTXF.js.map +1 -0
- package/dist/{chunk-AHRKWMNI.js → chunk-PGEU5MEH.js} +3 -3
- package/dist/{chunk-YLR5JUJZ.js → chunk-R2LPZIY2.js} +3 -3
- package/dist/{chunk-YXR3WW3Q.js → chunk-XYL3GLB3.js} +3 -3
- package/dist/{chunk-YXR3WW3Q.js.map → chunk-XYL3GLB3.js.map} +1 -1
- package/dist/compat/nestjs/index.cjs +14 -5
- package/dist/compat/nestjs/index.cjs.map +1 -1
- package/dist/compat/nestjs/index.js +7 -7
- package/dist/core/index.cjs +2 -2
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +3 -3
- package/dist/extra/index.cjs +31 -5
- package/dist/extra/index.cjs.map +1 -1
- package/dist/extra/index.d.cts +1 -1
- package/dist/extra/index.d.ts +1 -1
- package/dist/extra/index.js +7 -3
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.js +4 -4
- package/dist/{index-CvKzv0AW.d.ts → index-BHfg_Ez3.d.ts} +1 -1
- package/dist/{index-BBUYZfJ1.d.cts → index-Bc_diYYJ.d.cts} +1 -1
- package/dist/{index-BnkMgNNa.d.ts → index-DuN3bhtm.d.ts} +47 -2
- package/dist/{index-Bjh5C1Tp.d.cts → index-SFzE_KTa.d.cts} +47 -2
- package/dist/index.cjs +153 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +75 -6
- package/dist/index.d.ts +75 -6
- package/dist/index.js +126 -90
- package/dist/index.js.map +1 -1
- package/dist/patterns/reactive-layout/index.cjs.map +1 -1
- package/dist/patterns/reactive-layout/index.js +4 -4
- package/package.json +2 -2
- package/dist/chunk-IRZAGZUB.js.map +0 -1
- package/dist/chunk-OO5QOAXI.js.map +0 -1
- /package/dist/{chunk-XUOY3YKN.js.map → chunk-2L5J6RPM.js.map} +0 -0
- /package/dist/{chunk-JC2SN46B.js.map → chunk-3N2Y6PCR.js.map} +0 -0
- /package/dist/{chunk-UW77D7SP.js.map → chunk-IAPLC4NR.js.map} +0 -0
- /package/dist/{chunk-AHRKWMNI.js.map → chunk-PGEU5MEH.js.map} +0 -0
- /package/dist/{chunk-YLR5JUJZ.js.map → chunk-R2LPZIY2.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -196,6 +196,7 @@ __export(index_exports, {
|
|
|
196
196
|
isTerminalMessage: () => isTerminalMessage,
|
|
197
197
|
isV1: () => isV1,
|
|
198
198
|
jotai: () => jotai_exports,
|
|
199
|
+
keepalive: () => keepalive,
|
|
199
200
|
knownMessageTypes: () => knownMessageTypes,
|
|
200
201
|
last: () => last,
|
|
201
202
|
layout: () => reactive_layout_exports,
|
|
@@ -238,6 +239,7 @@ __export(index_exports, {
|
|
|
238
239
|
rateLimiter: () => rateLimiter,
|
|
239
240
|
reachable: () => reachable,
|
|
240
241
|
react: () => react_exports,
|
|
242
|
+
reactiveCounter: () => reactiveCounter,
|
|
241
243
|
reactiveIndex: () => reactiveIndex,
|
|
242
244
|
reactiveList: () => reactiveList,
|
|
243
245
|
reactiveLog: () => reactiveLog,
|
|
@@ -1845,8 +1847,8 @@ function producer(fn, opts) {
|
|
|
1845
1847
|
function derived(deps, fn, opts) {
|
|
1846
1848
|
return node(deps, fn, { describeKind: "derived", ...opts });
|
|
1847
1849
|
}
|
|
1848
|
-
function effect(deps, fn) {
|
|
1849
|
-
return node(deps, fn, { describeKind: "effect" });
|
|
1850
|
+
function effect(deps, fn, opts) {
|
|
1851
|
+
return node(deps, fn, { describeKind: "effect", ...opts });
|
|
1850
1852
|
}
|
|
1851
1853
|
function pipe(source, ...ops) {
|
|
1852
1854
|
let current = source;
|
|
@@ -2842,6 +2844,28 @@ function firstWhere(source, predicate) {
|
|
|
2842
2844
|
});
|
|
2843
2845
|
}
|
|
2844
2846
|
var shareReplay = replay;
|
|
2847
|
+
function keepalive(n) {
|
|
2848
|
+
return n.subscribe(() => {
|
|
2849
|
+
});
|
|
2850
|
+
}
|
|
2851
|
+
function reactiveCounter(cap) {
|
|
2852
|
+
const counter = state(0);
|
|
2853
|
+
return {
|
|
2854
|
+
node: counter,
|
|
2855
|
+
increment() {
|
|
2856
|
+
const current = counter.get() ?? 0;
|
|
2857
|
+
if (current >= cap) return false;
|
|
2858
|
+
counter.down([[DIRTY], [DATA, current + 1]]);
|
|
2859
|
+
return true;
|
|
2860
|
+
},
|
|
2861
|
+
get() {
|
|
2862
|
+
return counter.get() ?? 0;
|
|
2863
|
+
},
|
|
2864
|
+
atCap() {
|
|
2865
|
+
return (counter.get() ?? 0) >= cap;
|
|
2866
|
+
}
|
|
2867
|
+
};
|
|
2868
|
+
}
|
|
2845
2869
|
|
|
2846
2870
|
// src/compat/nestjs/explorer.ts
|
|
2847
2871
|
var scheduleSeq = 0;
|
|
@@ -6069,6 +6093,18 @@ function replayWAL(entries) {
|
|
|
6069
6093
|
return result;
|
|
6070
6094
|
}
|
|
6071
6095
|
|
|
6096
|
+
// src/patterns/_internal.ts
|
|
6097
|
+
function domainMeta(domain, kind, extra) {
|
|
6098
|
+
return {
|
|
6099
|
+
[domain]: true,
|
|
6100
|
+
[`${domain}_type`]: kind,
|
|
6101
|
+
...extra ?? {}
|
|
6102
|
+
};
|
|
6103
|
+
}
|
|
6104
|
+
function trackingKey(item) {
|
|
6105
|
+
return item.relatedTo?.[0] ?? item.summary;
|
|
6106
|
+
}
|
|
6107
|
+
|
|
6072
6108
|
// src/patterns/cqrs.ts
|
|
6073
6109
|
var COMMAND_GUARD = policy((allow, deny) => {
|
|
6074
6110
|
allow("write");
|
|
@@ -6086,11 +6122,7 @@ var EVENT_GUARD = policy((allow, deny) => {
|
|
|
6086
6122
|
deny("write");
|
|
6087
6123
|
});
|
|
6088
6124
|
function cqrsMeta(kind, extra) {
|
|
6089
|
-
return
|
|
6090
|
-
}
|
|
6091
|
-
function keepalive(n) {
|
|
6092
|
-
return n.subscribe(() => {
|
|
6093
|
-
});
|
|
6125
|
+
return domainMeta("cqrs", kind, extra);
|
|
6094
6126
|
}
|
|
6095
6127
|
var MemoryEventStore = class {
|
|
6096
6128
|
_store = /* @__PURE__ */ new Map();
|
|
@@ -7150,6 +7182,7 @@ __export(extra_exports, {
|
|
|
7150
7182
|
fromWebhook: () => fromWebhook,
|
|
7151
7183
|
globToRegExp: () => globToRegExp,
|
|
7152
7184
|
interval: () => interval,
|
|
7185
|
+
keepalive: () => keepalive,
|
|
7153
7186
|
last: () => last,
|
|
7154
7187
|
linear: () => linear,
|
|
7155
7188
|
logSlice: () => logSlice,
|
|
@@ -7171,6 +7204,7 @@ __export(extra_exports, {
|
|
|
7171
7204
|
pubsub: () => pubsub,
|
|
7172
7205
|
race: () => race,
|
|
7173
7206
|
rateLimiter: () => rateLimiter,
|
|
7207
|
+
reactiveCounter: () => reactiveCounter,
|
|
7174
7208
|
reactiveIndex: () => reactiveIndex,
|
|
7175
7209
|
reactiveList: () => reactiveList,
|
|
7176
7210
|
reactiveLog: () => reactiveLog,
|
|
@@ -13572,16 +13606,8 @@ function requireNonNegativeInt(value, label) {
|
|
|
13572
13606
|
}
|
|
13573
13607
|
return value;
|
|
13574
13608
|
}
|
|
13575
|
-
function keepalive3(n) {
|
|
13576
|
-
return n.subscribe(() => {
|
|
13577
|
-
});
|
|
13578
|
-
}
|
|
13579
13609
|
function messagingMeta(kind, extra) {
|
|
13580
|
-
return
|
|
13581
|
-
messaging: true,
|
|
13582
|
-
messaging_type: kind,
|
|
13583
|
-
...extra ?? {}
|
|
13584
|
-
};
|
|
13610
|
+
return domainMeta("messaging", kind, extra);
|
|
13585
13611
|
}
|
|
13586
13612
|
var TopicGraph = class extends Graph {
|
|
13587
13613
|
_log;
|
|
@@ -13607,7 +13633,7 @@ var TopicGraph = class extends Graph {
|
|
|
13607
13633
|
);
|
|
13608
13634
|
this.add("latest", this.latest);
|
|
13609
13635
|
this.connect("events", "latest");
|
|
13610
|
-
this.addDisposer(
|
|
13636
|
+
this.addDisposer(keepalive(this.latest));
|
|
13611
13637
|
}
|
|
13612
13638
|
publish(value) {
|
|
13613
13639
|
this._log.append(value);
|
|
@@ -13656,8 +13682,8 @@ var SubscriptionGraph = class extends Graph {
|
|
|
13656
13682
|
this.connect("topic::events", "source");
|
|
13657
13683
|
this.connect("source", "available");
|
|
13658
13684
|
this.connect("cursor", "available");
|
|
13659
|
-
this.addDisposer(
|
|
13660
|
-
this.addDisposer(
|
|
13685
|
+
this.addDisposer(keepalive(this.source));
|
|
13686
|
+
this.addDisposer(keepalive(this.available));
|
|
13661
13687
|
}
|
|
13662
13688
|
ack(count) {
|
|
13663
13689
|
const available = this.available.get();
|
|
@@ -13699,7 +13725,7 @@ var JobQueueGraph = class extends Graph {
|
|
|
13699
13725
|
});
|
|
13700
13726
|
this.add("depth", this.depth);
|
|
13701
13727
|
this.connect("pending", "depth");
|
|
13702
|
-
this.addDisposer(
|
|
13728
|
+
this.addDisposer(keepalive(this.depth));
|
|
13703
13729
|
}
|
|
13704
13730
|
enqueue(payload, opts = {}) {
|
|
13705
13731
|
const id = opts.id ?? `${this.name}-${++this._seq}`;
|
|
@@ -13792,7 +13818,7 @@ var JobFlowGraph = class extends Graph {
|
|
|
13792
13818
|
);
|
|
13793
13819
|
this.add("completedCount", this.completedCount);
|
|
13794
13820
|
this.connect("completed", "completedCount");
|
|
13795
|
-
this.addDisposer(
|
|
13821
|
+
this.addDisposer(keepalive(this.completedCount));
|
|
13796
13822
|
const maxPerPump = Math.max(
|
|
13797
13823
|
1,
|
|
13798
13824
|
requireNonNegativeInt(opts.maxPerPump ?? DEFAULT_MAX_PER_PUMP, "job flow maxPerPump")
|
|
@@ -13832,7 +13858,7 @@ var JobFlowGraph = class extends Graph {
|
|
|
13832
13858
|
);
|
|
13833
13859
|
this.add(`pump_${stage}`, pump);
|
|
13834
13860
|
this.connect(`${stage}::pending`, `pump_${stage}`);
|
|
13835
|
-
this.addDisposer(
|
|
13861
|
+
this.addDisposer(keepalive(pump));
|
|
13836
13862
|
}
|
|
13837
13863
|
}
|
|
13838
13864
|
stages() {
|
|
@@ -13897,7 +13923,7 @@ var TopicBridgeGraph = class extends Graph {
|
|
|
13897
13923
|
);
|
|
13898
13924
|
this.add("pump", pump);
|
|
13899
13925
|
this.connect("subscription::available", "pump");
|
|
13900
|
-
this.addDisposer(
|
|
13926
|
+
this.addDisposer(keepalive(pump));
|
|
13901
13927
|
}
|
|
13902
13928
|
};
|
|
13903
13929
|
function topic(name, opts) {
|
|
@@ -13964,11 +13990,7 @@ function registerStep(graph, name, step, depPaths) {
|
|
|
13964
13990
|
}
|
|
13965
13991
|
}
|
|
13966
13992
|
function baseMeta(kind, meta) {
|
|
13967
|
-
return
|
|
13968
|
-
orchestration: true,
|
|
13969
|
-
orchestration_type: kind,
|
|
13970
|
-
...meta ?? {}
|
|
13971
|
-
};
|
|
13993
|
+
return domainMeta("orchestration", kind, meta);
|
|
13972
13994
|
}
|
|
13973
13995
|
function coerceLoopIterations(raw) {
|
|
13974
13996
|
const parseString = (value) => {
|
|
@@ -14414,14 +14436,7 @@ function onFailure(graph, name, source, recover, opts) {
|
|
|
14414
14436
|
|
|
14415
14437
|
// src/patterns/ai.ts
|
|
14416
14438
|
function aiMeta(kind, extra) {
|
|
14417
|
-
return
|
|
14418
|
-
ai: true,
|
|
14419
|
-
ai_type: kind,
|
|
14420
|
-
...extra ?? {}
|
|
14421
|
-
};
|
|
14422
|
-
}
|
|
14423
|
-
function keepalive4(n) {
|
|
14424
|
-
return n.subscribe(() => void 0);
|
|
14439
|
+
return domainMeta("ai", kind, extra);
|
|
14425
14440
|
}
|
|
14426
14441
|
function isPromiseLike(x) {
|
|
14427
14442
|
return x != null && typeof x.then === "function";
|
|
@@ -14555,7 +14570,7 @@ function streamingPromptNode(adapter, deps, prompt, opts) {
|
|
|
14555
14570
|
}
|
|
14556
14571
|
return fromAny(pumpAndCollect());
|
|
14557
14572
|
});
|
|
14558
|
-
const unsub =
|
|
14573
|
+
const unsub = keepalive(output);
|
|
14559
14574
|
return {
|
|
14560
14575
|
output,
|
|
14561
14576
|
stream: streamTopic,
|
|
@@ -14740,7 +14755,7 @@ function gatedStream(graph, name, adapter, deps, prompt, opts) {
|
|
|
14740
14755
|
}
|
|
14741
14756
|
return fromAny(pumpAndCollect());
|
|
14742
14757
|
});
|
|
14743
|
-
const unsub =
|
|
14758
|
+
const unsub = keepalive(output);
|
|
14744
14759
|
const nonNullOutput = derived(
|
|
14745
14760
|
[output],
|
|
14746
14761
|
([v]) => {
|
|
@@ -14871,7 +14886,7 @@ var ChatStreamGraph = class extends Graph {
|
|
|
14871
14886
|
);
|
|
14872
14887
|
this.add("latest", this.latest);
|
|
14873
14888
|
this.connect("messages", "latest");
|
|
14874
|
-
this.addDisposer(
|
|
14889
|
+
this.addDisposer(keepalive(this.latest));
|
|
14875
14890
|
this.messageCount = derived(
|
|
14876
14891
|
[this.messages],
|
|
14877
14892
|
([snapshot]) => snapshot.length,
|
|
@@ -14884,7 +14899,7 @@ var ChatStreamGraph = class extends Graph {
|
|
|
14884
14899
|
);
|
|
14885
14900
|
this.add("messageCount", this.messageCount);
|
|
14886
14901
|
this.connect("messages", "messageCount");
|
|
14887
|
-
this.addDisposer(
|
|
14902
|
+
this.addDisposer(keepalive(this.messageCount));
|
|
14888
14903
|
}
|
|
14889
14904
|
append(role, content, extra) {
|
|
14890
14905
|
this._log.append({ role, content, ...extra });
|
|
@@ -14925,7 +14940,7 @@ var ToolRegistryGraph = class extends Graph {
|
|
|
14925
14940
|
);
|
|
14926
14941
|
this.add("schemas", this.schemas);
|
|
14927
14942
|
this.connect("definitions", "schemas");
|
|
14928
|
-
this.addDisposer(
|
|
14943
|
+
this.addDisposer(keepalive(this.schemas));
|
|
14929
14944
|
}
|
|
14930
14945
|
register(tool) {
|
|
14931
14946
|
const current = this.definitions.get();
|
|
@@ -14967,7 +14982,7 @@ function systemPromptBuilder(sections, opts) {
|
|
|
14967
14982
|
initial: ""
|
|
14968
14983
|
}
|
|
14969
14984
|
);
|
|
14970
|
-
const unsub =
|
|
14985
|
+
const unsub = keepalive(prompt);
|
|
14971
14986
|
return Object.assign(prompt, { dispose: unsub });
|
|
14972
14987
|
}
|
|
14973
14988
|
function llmExtractor(systemPrompt, opts) {
|
|
@@ -16856,21 +16871,14 @@ __export(domain_templates_exports, {
|
|
|
16856
16871
|
var reduction_exports = {};
|
|
16857
16872
|
__export(reduction_exports, {
|
|
16858
16873
|
budgetGate: () => budgetGate,
|
|
16874
|
+
effectivenessTracker: () => effectivenessTracker,
|
|
16859
16875
|
feedback: () => feedback,
|
|
16860
16876
|
funnel: () => funnel,
|
|
16861
16877
|
scorer: () => scorer,
|
|
16862
16878
|
stratify: () => stratify
|
|
16863
16879
|
});
|
|
16864
16880
|
function baseMeta2(kind, meta) {
|
|
16865
|
-
return
|
|
16866
|
-
reduction: true,
|
|
16867
|
-
reduction_type: kind,
|
|
16868
|
-
...meta ?? {}
|
|
16869
|
-
};
|
|
16870
|
-
}
|
|
16871
|
-
function keepalive5(n) {
|
|
16872
|
-
return n.subscribe(() => {
|
|
16873
|
-
});
|
|
16881
|
+
return domainMeta("reduction", kind, meta);
|
|
16874
16882
|
}
|
|
16875
16883
|
function stratify(name, source, rules, opts) {
|
|
16876
16884
|
const g = new Graph(name, opts);
|
|
@@ -17008,7 +17016,7 @@ function funnel(name, sources, stages, opts) {
|
|
|
17008
17016
|
});
|
|
17009
17017
|
g.add(bridgeName, br);
|
|
17010
17018
|
g.connect(prevOutputPath, bridgeName);
|
|
17011
|
-
g.addDisposer(
|
|
17019
|
+
g.addDisposer(keepalive(br));
|
|
17012
17020
|
prevOutputPath = `${stage.name}::output`;
|
|
17013
17021
|
}
|
|
17014
17022
|
return g;
|
|
@@ -17060,7 +17068,7 @@ function feedback(graph, condition, reentry, opts) {
|
|
|
17060
17068
|
});
|
|
17061
17069
|
graph.add(feedbackEffectName, feedbackEffect);
|
|
17062
17070
|
graph.connect(condition, feedbackEffectName);
|
|
17063
|
-
graph.addDisposer(
|
|
17071
|
+
graph.addDisposer(keepalive(feedbackEffect));
|
|
17064
17072
|
return graph;
|
|
17065
17073
|
}
|
|
17066
17074
|
function budgetGate(source, constraints, opts) {
|
|
@@ -17194,14 +17202,55 @@ function scorer(sources, weights, opts) {
|
|
|
17194
17202
|
}
|
|
17195
17203
|
);
|
|
17196
17204
|
}
|
|
17197
|
-
|
|
17198
|
-
|
|
17199
|
-
|
|
17200
|
-
return n.subscribe(() => {
|
|
17205
|
+
function effectivenessTracker(opts) {
|
|
17206
|
+
const _map = reactiveMap({
|
|
17207
|
+
name: opts?.name ?? "effectiveness-entries"
|
|
17201
17208
|
});
|
|
17209
|
+
const snapshot = derived(
|
|
17210
|
+
[_map.entries],
|
|
17211
|
+
([mapSnap]) => {
|
|
17212
|
+
return new Map(mapSnap);
|
|
17213
|
+
},
|
|
17214
|
+
{
|
|
17215
|
+
name: `${opts?.name ?? "effectiveness"}-snapshot`,
|
|
17216
|
+
equals: (a, b) => {
|
|
17217
|
+
const am = a;
|
|
17218
|
+
const bm = b;
|
|
17219
|
+
if (am.size !== bm.size) return false;
|
|
17220
|
+
for (const [k, v] of am) {
|
|
17221
|
+
const bv = bm.get(k);
|
|
17222
|
+
if (!bv || v.attempts !== bv.attempts || v.successes !== bv.successes) return false;
|
|
17223
|
+
}
|
|
17224
|
+
return true;
|
|
17225
|
+
}
|
|
17226
|
+
}
|
|
17227
|
+
);
|
|
17228
|
+
function record(key, success) {
|
|
17229
|
+
const existing = _map.get(key);
|
|
17230
|
+
const attempts = (existing?.attempts ?? 0) + 1;
|
|
17231
|
+
const successes = (existing?.successes ?? 0) + (success ? 1 : 0);
|
|
17232
|
+
_map.set(key, {
|
|
17233
|
+
key,
|
|
17234
|
+
attempts,
|
|
17235
|
+
successes,
|
|
17236
|
+
successRate: successes / attempts
|
|
17237
|
+
});
|
|
17238
|
+
}
|
|
17239
|
+
function lookup(key) {
|
|
17240
|
+
return _map.get(key);
|
|
17241
|
+
}
|
|
17242
|
+
const _unsub = keepalive(snapshot);
|
|
17243
|
+
return {
|
|
17244
|
+
node: snapshot,
|
|
17245
|
+
record,
|
|
17246
|
+
lookup,
|
|
17247
|
+
dispose: () => _unsub()
|
|
17248
|
+
};
|
|
17202
17249
|
}
|
|
17250
|
+
|
|
17251
|
+
// src/patterns/domain-templates.ts
|
|
17203
17252
|
function baseMeta3(kind, extra) {
|
|
17204
|
-
return
|
|
17253
|
+
return domainMeta("domain_template", kind, extra);
|
|
17205
17254
|
}
|
|
17206
17255
|
function observabilityGraph(name, opts) {
|
|
17207
17256
|
const g = new Graph(name, opts);
|
|
@@ -17441,7 +17490,7 @@ function contentModerationGraph(name, opts) {
|
|
|
17441
17490
|
}
|
|
17442
17491
|
});
|
|
17443
17492
|
g.add("__review_accumulator", reviewAccumulator);
|
|
17444
|
-
g.addDisposer(
|
|
17493
|
+
g.addDisposer(keepalive(reviewAccumulator));
|
|
17445
17494
|
try {
|
|
17446
17495
|
g.connect("stratify::branch/review", "__review_accumulator");
|
|
17447
17496
|
} catch {
|
|
@@ -17552,7 +17601,7 @@ function dataQualityGraph(name, opts) {
|
|
|
17552
17601
|
});
|
|
17553
17602
|
g.add("__baseline_updater", baselineUpdater);
|
|
17554
17603
|
g.connect("validate", "__baseline_updater");
|
|
17555
|
-
|
|
17604
|
+
keepalive(baselineUpdater);
|
|
17556
17605
|
const detectDriftFn = opts.detectDrift ?? (() => ({ drift: false }));
|
|
17557
17606
|
const driftNode = derived(
|
|
17558
17607
|
[opts.source, baseline],
|
|
@@ -18642,6 +18691,7 @@ __export(harness_exports, {
|
|
|
18642
18691
|
DEFAULT_SEVERITY_WEIGHTS: () => DEFAULT_SEVERITY_WEIGHTS,
|
|
18643
18692
|
HarnessGraph: () => HarnessGraph,
|
|
18644
18693
|
QUEUE_NAMES: () => QUEUE_NAMES,
|
|
18694
|
+
createIntakeBridge: () => createIntakeBridge,
|
|
18645
18695
|
defaultErrorClassifier: () => defaultErrorClassifier,
|
|
18646
18696
|
evalIntakeBridge: () => evalIntakeBridge,
|
|
18647
18697
|
harnessLoop: () => harnessLoop,
|
|
@@ -18653,41 +18703,58 @@ __export(harness_exports, {
|
|
|
18653
18703
|
});
|
|
18654
18704
|
|
|
18655
18705
|
// src/patterns/harness/bridge.ts
|
|
18706
|
+
function createIntakeBridge(source, intakeTopic, parser, opts) {
|
|
18707
|
+
return effect(
|
|
18708
|
+
[source],
|
|
18709
|
+
([value]) => {
|
|
18710
|
+
if (value == null) return;
|
|
18711
|
+
const items = parser(value);
|
|
18712
|
+
for (const item of items) {
|
|
18713
|
+
intakeTopic.publish(item);
|
|
18714
|
+
}
|
|
18715
|
+
},
|
|
18716
|
+
{ name: opts?.name ?? "intake-bridge" }
|
|
18717
|
+
);
|
|
18718
|
+
}
|
|
18656
18719
|
function evalIntakeBridge(evalSource, intakeTopic, opts) {
|
|
18657
18720
|
const defaultSeverity = opts?.defaultSeverity ?? "medium";
|
|
18658
|
-
return effect(
|
|
18659
|
-
|
|
18660
|
-
|
|
18661
|
-
|
|
18662
|
-
|
|
18663
|
-
|
|
18664
|
-
|
|
18665
|
-
|
|
18666
|
-
|
|
18667
|
-
summary: `Task ${task2.task_id} invalid (model: ${run.model})`,
|
|
18668
|
-
evidence: `Run ${run.run_id}: task produced invalid output`,
|
|
18669
|
-
affectsAreas: ["graphspec"],
|
|
18670
|
-
affectsEvalTasks: [task2.task_id],
|
|
18671
|
-
severity: defaultSeverity
|
|
18672
|
-
});
|
|
18673
|
-
continue;
|
|
18674
|
-
}
|
|
18675
|
-
if (task2.judge_scores) {
|
|
18676
|
-
for (const score of task2.judge_scores) {
|
|
18677
|
-
if (score.pass) continue;
|
|
18721
|
+
return effect(
|
|
18722
|
+
[evalSource],
|
|
18723
|
+
([results]) => {
|
|
18724
|
+
if (results == null) return;
|
|
18725
|
+
const runs = Array.isArray(results) ? results : [results];
|
|
18726
|
+
for (const run of runs) {
|
|
18727
|
+
for (const task2 of run.tasks) {
|
|
18728
|
+
if (task2.valid && task2.judge_scores?.every((s) => s.pass)) continue;
|
|
18729
|
+
if (!task2.valid && (!task2.judge_scores || task2.judge_scores.length === 0)) {
|
|
18678
18730
|
intakeTopic.publish({
|
|
18679
18731
|
source: "eval",
|
|
18680
|
-
summary:
|
|
18681
|
-
evidence:
|
|
18732
|
+
summary: `Task ${task2.task_id} invalid (model: ${run.model})`,
|
|
18733
|
+
evidence: `Run ${run.run_id}: task produced invalid output`,
|
|
18682
18734
|
affectsAreas: ["graphspec"],
|
|
18683
18735
|
affectsEvalTasks: [task2.task_id],
|
|
18684
18736
|
severity: defaultSeverity
|
|
18685
18737
|
});
|
|
18738
|
+
continue;
|
|
18739
|
+
}
|
|
18740
|
+
if (task2.judge_scores) {
|
|
18741
|
+
for (const score of task2.judge_scores) {
|
|
18742
|
+
if (score.pass) continue;
|
|
18743
|
+
intakeTopic.publish({
|
|
18744
|
+
source: "eval",
|
|
18745
|
+
summary: `${task2.task_id}: ${score.claim} (model: ${run.model})`,
|
|
18746
|
+
evidence: score.reasoning,
|
|
18747
|
+
affectsAreas: ["graphspec"],
|
|
18748
|
+
affectsEvalTasks: [task2.task_id],
|
|
18749
|
+
severity: defaultSeverity
|
|
18750
|
+
});
|
|
18751
|
+
}
|
|
18686
18752
|
}
|
|
18687
18753
|
}
|
|
18688
18754
|
}
|
|
18689
|
-
}
|
|
18690
|
-
|
|
18755
|
+
},
|
|
18756
|
+
{ name: opts?.name ?? "eval-intake-bridge" }
|
|
18757
|
+
);
|
|
18691
18758
|
}
|
|
18692
18759
|
|
|
18693
18760
|
// src/patterns/harness/types.ts
|
|
@@ -18797,9 +18864,6 @@ function priorityScore(item, strategy, lastInteractionNs, urgency, signals) {
|
|
|
18797
18864
|
}
|
|
18798
18865
|
|
|
18799
18866
|
// src/patterns/harness/loop.ts
|
|
18800
|
-
function trackingKey(item) {
|
|
18801
|
-
return item.relatedTo?.[0] ?? item.summary;
|
|
18802
|
-
}
|
|
18803
18867
|
var DEFAULT_TRIAGE_PROMPT = `You are a triage classifier for a reactive collaboration harness.
|
|
18804
18868
|
|
|
18805
18869
|
Given an intake item, classify it and output JSON:
|
|
@@ -19806,6 +19870,7 @@ var version = "0.0.0";
|
|
|
19806
19870
|
isTerminalMessage,
|
|
19807
19871
|
isV1,
|
|
19808
19872
|
jotai,
|
|
19873
|
+
keepalive,
|
|
19809
19874
|
knownMessageTypes,
|
|
19810
19875
|
last,
|
|
19811
19876
|
layout,
|
|
@@ -19848,6 +19913,7 @@ var version = "0.0.0";
|
|
|
19848
19913
|
rateLimiter,
|
|
19849
19914
|
reachable,
|
|
19850
19915
|
react,
|
|
19916
|
+
reactiveCounter,
|
|
19851
19917
|
reactiveIndex,
|
|
19852
19918
|
reactiveList,
|
|
19853
19919
|
reactiveLog,
|