@lynn123411/dsh-subagent-judge-dispatch 0.6.13 → 0.6.14
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 +2 -0
- package/cordis.patch.yml +0 -8
- package/lib/client.js +0 -88
- package/lib/client.js.map +2 -2
- package/lib/index.js +6 -18
- package/lib/index.js.map +2 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -168,7 +168,6 @@ var JudgeBudget = class {
|
|
|
168
168
|
this.expired();
|
|
169
169
|
this.signal.throwIfAborted();
|
|
170
170
|
}
|
|
171
|
-
/** Stop waiting at the deadline even if the operation ignores its signal. */
|
|
172
171
|
async run(operation) {
|
|
173
172
|
this.check();
|
|
174
173
|
let onAbort;
|
|
@@ -407,32 +406,20 @@ function resolveEndpointUrl(input) {
|
|
|
407
406
|
// src/server/config.ts
|
|
408
407
|
var TypeRowSchema = z.object({
|
|
409
408
|
stableId: z.string().default(""),
|
|
410
|
-
/** Whether this type takes part in judgements; a row written before the switch existed counts as on. */
|
|
411
409
|
enabled: z.boolean().default(true),
|
|
412
|
-
/** Criterion text the judge reads for this type. */
|
|
413
410
|
description: z.string().default(""),
|
|
414
|
-
/** Provider route of the model this type runs on. */
|
|
415
411
|
provider: z.string().default(""),
|
|
416
|
-
/** Model id interpreted by that provider. */
|
|
417
412
|
model: z.string().default(""),
|
|
418
|
-
/** Reasoning effort id this type runs at. */
|
|
419
413
|
effort: z.string().default(""),
|
|
420
|
-
/** An explicit choice to let the Host supply the model's default. */
|
|
421
414
|
useDefaultEffort: z.const(true)
|
|
422
415
|
});
|
|
423
416
|
var Config = z.object({
|
|
424
|
-
/** Default for conversations without their own choice. */
|
|
425
417
|
enabled: z.boolean().default(DEFAULT_ENABLED).volatile(),
|
|
426
418
|
sessionOverrides: z.dict(z.boolean()).default({}).volatile(),
|
|
427
|
-
/** Whether judgements are written to the plugin's own log. */
|
|
428
419
|
logEnabled: z.boolean().default(true).volatile(),
|
|
429
|
-
/** Whether new log entries may retain bounded copies of task text and type descriptions. */
|
|
430
420
|
logDetails: z.boolean().default(true).volatile(),
|
|
431
|
-
/** Judge service address, as the reader typed it; the path is appended when a call is made. */
|
|
432
421
|
endpointUrl: z.string().default("").volatile(),
|
|
433
|
-
/** Judge model id. */
|
|
434
422
|
judgeModel: z.string().default("").volatile(),
|
|
435
|
-
/** The task-type list, in page order. */
|
|
436
423
|
rows: z.array(TypeRowSchema).default([]).volatile()
|
|
437
424
|
});
|
|
438
425
|
function readConfigRows(stored) {
|
|
@@ -954,9 +941,11 @@ var LogStore = class {
|
|
|
954
941
|
return this.snapshot(this.entries);
|
|
955
942
|
}
|
|
956
943
|
async readLatest() {
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
944
|
+
while (true) {
|
|
945
|
+
const previous = this.entries;
|
|
946
|
+
const disk = await this.readDisk();
|
|
947
|
+
if (this.entries === previous) return this.snapshot(disk);
|
|
948
|
+
}
|
|
960
949
|
}
|
|
961
950
|
snapshot(entries) {
|
|
962
951
|
return newest([...this.pending, ...entries]).map((entry) => structuredClone(entry));
|
|
@@ -1090,14 +1079,12 @@ var inject = ["credentials", "sessions"];
|
|
|
1090
1079
|
var JUDGED_LIMIT = 500;
|
|
1091
1080
|
var JudgedChildren = class {
|
|
1092
1081
|
seen = /* @__PURE__ */ new Set();
|
|
1093
|
-
/** Record a child as judged, forgetting the oldest entry past the cap. */
|
|
1094
1082
|
add(id) {
|
|
1095
1083
|
this.seen.add(id);
|
|
1096
1084
|
if (this.seen.size <= JUDGED_LIMIT) return;
|
|
1097
1085
|
const oldest = this.seen.values().next();
|
|
1098
1086
|
if (!oldest.done) this.seen.delete(oldest.value);
|
|
1099
1087
|
}
|
|
1100
|
-
/** Whether this child has already been judged. */
|
|
1101
1088
|
has(id) {
|
|
1102
1089
|
return this.seen.has(id);
|
|
1103
1090
|
}
|
|
@@ -1154,6 +1141,7 @@ function apply(ctx, config) {
|
|
|
1154
1141
|
let settings = policy.settings();
|
|
1155
1142
|
const hasOverrides = Object.keys(settings.sessionOverrides ?? {}).length > 0;
|
|
1156
1143
|
if (!hasOverrides && !settings.enabled) return;
|
|
1144
|
+
if (resumed && hasRecordedRoute(agent.session, resumed)) return;
|
|
1157
1145
|
const lookup = (id) => ctx.sessions.get(id);
|
|
1158
1146
|
const parentId = agent.session.header.parentSession;
|
|
1159
1147
|
if (hasOverrides && parentId) {
|