@kynver-app/runtime 0.1.108 → 0.1.116
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/bootstrap.d.ts +1 -0
- package/dist/cleanup-git-rev-cache.d.ts +5 -0
- package/dist/cleanup-git-status-cache.d.ts +5 -0
- package/dist/cleanup-guards.d.ts +2 -0
- package/dist/cleanup-index-status.d.ts +8 -1
- package/dist/cleanup-run-liveness.d.ts +8 -1
- package/dist/cli.js +1929 -468
- package/dist/cli.js.map +4 -4
- package/dist/daemon-heartbeat.d.ts +20 -0
- package/dist/daemon-keeper.d.ts +21 -0
- package/dist/daemon-platform-guard.d.ts +2 -0
- package/dist/device-login.d.ts +8 -0
- package/dist/index.js +2636 -1151
- package/dist/index.js.map +4 -4
- package/dist/landing/cli-auth.d.ts +5 -1
- package/dist/landing/land-pr.d.ts +8 -0
- package/dist/provider-evidence/collect.d.ts +18 -0
- package/dist/provider-evidence/exec.d.ts +5 -0
- package/dist/provider-evidence/index.d.ts +7 -0
- package/dist/provider-evidence/recipes-github.d.ts +4 -0
- package/dist/provider-evidence/recipes-vercel.d.ts +2 -0
- package/dist/provider-evidence/registry.d.ts +6 -0
- package/dist/provider-evidence/types.d.ts +48 -0
- package/dist/provider-evidence/wanted-store.d.ts +5 -0
- package/dist/providers/codex.d.ts +7 -2
- package/dist/providers/hermes-codex.d.ts +5 -2
- package/dist/server/cleanup.js +560 -164
- package/dist/server/cleanup.js.map +4 -4
- package/dist/server/default-repo.js +298 -68
- package/dist/server/default-repo.js.map +4 -4
- package/dist/server/memory-cost-enforce.js +11 -1
- package/dist/server/memory-cost-enforce.js.map +3 -3
- package/dist/server/monitor.js +356 -128
- package/dist/server/monitor.js.map +4 -4
- package/dist/server/worker-policy.js +304 -49
- package/dist/server/worker-policy.js.map +4 -4
- package/dist/status.d.ts +18 -0
- package/dist/worker-ops.d.ts +4 -0
- package/package.json +1 -1
package/dist/server/monitor.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
+
var __esm = (fn, res) => function __init() {
|
|
3
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
4
|
+
};
|
|
3
5
|
|
|
4
6
|
// src/heartbeat-final-result.ts
|
|
5
7
|
function tryParseJsonObject(text) {
|
|
@@ -50,6 +52,11 @@ function terminalFinalResultFromHeartbeatRow(row) {
|
|
|
50
52
|
if (embedded) return embedded;
|
|
51
53
|
return summary;
|
|
52
54
|
}
|
|
55
|
+
var init_heartbeat_final_result = __esm({
|
|
56
|
+
"src/heartbeat-final-result.ts"() {
|
|
57
|
+
"use strict";
|
|
58
|
+
}
|
|
59
|
+
});
|
|
53
60
|
|
|
54
61
|
// src/util.ts
|
|
55
62
|
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
@@ -57,6 +64,10 @@ function fail(message) {
|
|
|
57
64
|
console.error(message);
|
|
58
65
|
process.exit(1);
|
|
59
66
|
}
|
|
67
|
+
function hiddenSpawnOptions(opts) {
|
|
68
|
+
if (process.platform !== "win32") return opts;
|
|
69
|
+
return { windowsHide: true, ...opts };
|
|
70
|
+
}
|
|
60
71
|
function safeJson(line) {
|
|
61
72
|
try {
|
|
62
73
|
return JSON.parse(line);
|
|
@@ -108,9 +119,14 @@ function latestIso(values) {
|
|
|
108
119
|
function secsAgo(ms) {
|
|
109
120
|
return Math.max(0, Math.round((Date.now() - ms) / 1e3));
|
|
110
121
|
}
|
|
122
|
+
var init_util = __esm({
|
|
123
|
+
"src/util.ts"() {
|
|
124
|
+
"use strict";
|
|
125
|
+
}
|
|
126
|
+
});
|
|
111
127
|
|
|
112
128
|
// src/heartbeat.ts
|
|
113
|
-
|
|
129
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
|
|
114
130
|
function isTerminalHeartbeatPhase(phase) {
|
|
115
131
|
return phase === "complete";
|
|
116
132
|
}
|
|
@@ -173,29 +189,17 @@ function parseHeartbeat(file) {
|
|
|
173
189
|
}
|
|
174
190
|
return result;
|
|
175
191
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
192
|
+
var HEARTBEAT_FUTURE_SKEW_MS;
|
|
193
|
+
var init_heartbeat = __esm({
|
|
194
|
+
"src/heartbeat.ts"() {
|
|
195
|
+
"use strict";
|
|
196
|
+
init_heartbeat_final_result();
|
|
197
|
+
init_util();
|
|
198
|
+
HEARTBEAT_FUTURE_SKEW_MS = 6e4;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
179
201
|
|
|
180
202
|
// src/repo-search.ts
|
|
181
|
-
var RG_BINARIES = /* @__PURE__ */ new Set(["rg", "ripgrep", "grep"]);
|
|
182
|
-
var RG_OPTS_WITH_VALUE = /* @__PURE__ */ new Set([
|
|
183
|
-
"-e",
|
|
184
|
-
"--regexp",
|
|
185
|
-
"-f",
|
|
186
|
-
"--file",
|
|
187
|
-
"-m",
|
|
188
|
-
"--max-count",
|
|
189
|
-
"-A",
|
|
190
|
-
"--after-context",
|
|
191
|
-
"-B",
|
|
192
|
-
"--before-context",
|
|
193
|
-
"-C",
|
|
194
|
-
"--context",
|
|
195
|
-
"-g",
|
|
196
|
-
"--glob",
|
|
197
|
-
"--iglob"
|
|
198
|
-
]);
|
|
199
203
|
function binaryName(token) {
|
|
200
204
|
if (!token) return null;
|
|
201
205
|
const base = token.split("/").pop() ?? token;
|
|
@@ -394,11 +398,32 @@ function diagnoseRepoSearchFailure(input) {
|
|
|
394
398
|
}
|
|
395
399
|
return null;
|
|
396
400
|
}
|
|
401
|
+
var RG_BINARIES, RG_OPTS_WITH_VALUE;
|
|
402
|
+
var init_repo_search = __esm({
|
|
403
|
+
"src/repo-search.ts"() {
|
|
404
|
+
"use strict";
|
|
405
|
+
RG_BINARIES = /* @__PURE__ */ new Set(["rg", "ripgrep", "grep"]);
|
|
406
|
+
RG_OPTS_WITH_VALUE = /* @__PURE__ */ new Set([
|
|
407
|
+
"-e",
|
|
408
|
+
"--regexp",
|
|
409
|
+
"-f",
|
|
410
|
+
"--file",
|
|
411
|
+
"-m",
|
|
412
|
+
"--max-count",
|
|
413
|
+
"-A",
|
|
414
|
+
"--after-context",
|
|
415
|
+
"-B",
|
|
416
|
+
"--before-context",
|
|
417
|
+
"-C",
|
|
418
|
+
"--context",
|
|
419
|
+
"-g",
|
|
420
|
+
"--glob",
|
|
421
|
+
"--iglob"
|
|
422
|
+
]);
|
|
423
|
+
}
|
|
424
|
+
});
|
|
397
425
|
|
|
398
426
|
// src/shell-command-outcome.ts
|
|
399
|
-
var NPM_AUDIT_RE = /\bnpm\s+audit\b/i;
|
|
400
|
-
var RG_CMD_RE = /\b(rg|ripgrep)\b/i;
|
|
401
|
-
var RG_REAL_ERROR_RE = /\b(error|invalid|unknown|panic|not found)\b/i;
|
|
402
427
|
function tidy(text, max = 200) {
|
|
403
428
|
const one = text.replace(/\s+/g, " ").trim();
|
|
404
429
|
return one.length > max ? `${one.slice(0, max - 1)}\u2026` : one;
|
|
@@ -602,8 +627,19 @@ function classifyShellCommandOutcome(input) {
|
|
|
602
627
|
summary: `command failed (exit ${input.exitCode}): ${tail}`
|
|
603
628
|
};
|
|
604
629
|
}
|
|
630
|
+
var NPM_AUDIT_RE, RG_CMD_RE, RG_REAL_ERROR_RE;
|
|
631
|
+
var init_shell_command_outcome = __esm({
|
|
632
|
+
"src/shell-command-outcome.ts"() {
|
|
633
|
+
"use strict";
|
|
634
|
+
init_repo_search();
|
|
635
|
+
NPM_AUDIT_RE = /\bnpm\s+audit\b/i;
|
|
636
|
+
RG_CMD_RE = /\b(rg|ripgrep)\b/i;
|
|
637
|
+
RG_REAL_ERROR_RE = /\b(error|invalid|unknown|panic|not found)\b/i;
|
|
638
|
+
}
|
|
639
|
+
});
|
|
605
640
|
|
|
606
641
|
// src/stream.ts
|
|
642
|
+
import { existsSync as existsSync3, readFileSync as readFileSync3 } from "node:fs";
|
|
607
643
|
function eventTimestampIso(event) {
|
|
608
644
|
const tsMs = event.timestamp_ms;
|
|
609
645
|
return event.timestamp || event.ts || (tsMs ? new Date(tsMs).toISOString() : void 0);
|
|
@@ -704,38 +740,15 @@ function parseHarnessStream(file) {
|
|
|
704
740
|
}
|
|
705
741
|
return result;
|
|
706
742
|
}
|
|
743
|
+
var init_stream = __esm({
|
|
744
|
+
"src/stream.ts"() {
|
|
745
|
+
"use strict";
|
|
746
|
+
init_shell_command_outcome();
|
|
747
|
+
init_util();
|
|
748
|
+
}
|
|
749
|
+
});
|
|
707
750
|
|
|
708
751
|
// src/exit-classify.ts
|
|
709
|
-
var FAILURE_PATTERNS = [
|
|
710
|
-
{
|
|
711
|
-
test: /\b(?:invalid|unknown|unsupported|unrecognized)\b[^.\n]*\bmodel\b/i,
|
|
712
|
-
label: "provider rejected the requested model"
|
|
713
|
-
},
|
|
714
|
-
{
|
|
715
|
-
test: /\bmodel\b[^.\n]*\b(?:not\s+(?:found|supported|available|recognized|valid)|is\s+not\s+valid|does\s+not\s+exist)/i,
|
|
716
|
-
label: "provider rejected the requested model"
|
|
717
|
-
},
|
|
718
|
-
{
|
|
719
|
-
test: /\b(?:did you mean|available models|choose (?:a|one of)|supported models)\b/i,
|
|
720
|
-
label: "provider rejected the requested model"
|
|
721
|
-
},
|
|
722
|
-
{
|
|
723
|
-
test: /model preflight failed/i,
|
|
724
|
-
label: "model/provider preflight failed"
|
|
725
|
-
},
|
|
726
|
-
{
|
|
727
|
-
test: /\b(?:command not found|ENOENT|is the .*CLI on PATH|executable not found|no such file or directory)\b/i,
|
|
728
|
-
label: "provider CLI is missing or not on PATH"
|
|
729
|
-
},
|
|
730
|
-
{
|
|
731
|
-
test: /\bfailed to spawn\b/i,
|
|
732
|
-
label: "provider failed to spawn the worker process"
|
|
733
|
-
},
|
|
734
|
-
{
|
|
735
|
-
test: /\b(?:not logged in|unauthorized|authentication (?:failed|required)|invalid api key|missing api key|401)\b/i,
|
|
736
|
-
label: "provider authentication failed"
|
|
737
|
-
}
|
|
738
|
-
];
|
|
739
752
|
function tidy2(errorText, max = 240) {
|
|
740
753
|
const oneLine2 = errorText.replace(/\s+/g, " ").trim();
|
|
741
754
|
return oneLine2.length > max ? `${oneLine2.slice(0, max - 1)}\u2026` : oneLine2;
|
|
@@ -750,6 +763,42 @@ function classifyExitFailure(errorText) {
|
|
|
750
763
|
}
|
|
751
764
|
return null;
|
|
752
765
|
}
|
|
766
|
+
var FAILURE_PATTERNS;
|
|
767
|
+
var init_exit_classify = __esm({
|
|
768
|
+
"src/exit-classify.ts"() {
|
|
769
|
+
"use strict";
|
|
770
|
+
FAILURE_PATTERNS = [
|
|
771
|
+
{
|
|
772
|
+
test: /\b(?:invalid|unknown|unsupported|unrecognized)\b[^.\n]*\bmodel\b/i,
|
|
773
|
+
label: "provider rejected the requested model"
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
test: /\bmodel\b[^.\n]*\b(?:not\s+(?:found|supported|available|recognized|valid)|is\s+not\s+valid|does\s+not\s+exist)/i,
|
|
777
|
+
label: "provider rejected the requested model"
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
test: /\b(?:did you mean|available models|choose (?:a|one of)|supported models)\b/i,
|
|
781
|
+
label: "provider rejected the requested model"
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
test: /model preflight failed/i,
|
|
785
|
+
label: "model/provider preflight failed"
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
test: /\b(?:command not found|ENOENT|is the .*CLI on PATH|executable not found|no such file or directory)\b/i,
|
|
789
|
+
label: "provider CLI is missing or not on PATH"
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
test: /\bfailed to spawn\b/i,
|
|
793
|
+
label: "provider failed to spawn the worker process"
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
test: /\b(?:not logged in|unauthorized|authentication (?:failed|required)|invalid api key|missing api key|401)\b/i,
|
|
797
|
+
label: "provider authentication failed"
|
|
798
|
+
}
|
|
799
|
+
];
|
|
800
|
+
}
|
|
801
|
+
});
|
|
753
802
|
|
|
754
803
|
// src/exited-salvage.ts
|
|
755
804
|
function trimOrNull(value) {
|
|
@@ -808,48 +857,61 @@ function assessExitedWorkerSalvage(input) {
|
|
|
808
857
|
attentionReason: buildAttentionReason(kind, uncommittedCount, headCommit)
|
|
809
858
|
};
|
|
810
859
|
}
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
860
|
+
var init_exited_salvage = __esm({
|
|
861
|
+
"src/exited-salvage.ts"() {
|
|
862
|
+
"use strict";
|
|
863
|
+
}
|
|
864
|
+
});
|
|
814
865
|
|
|
815
866
|
// src/worker-env.ts
|
|
816
|
-
var FORBIDDEN_WORKER_ENV_KEYS
|
|
817
|
-
|
|
818
|
-
"
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
867
|
+
var FORBIDDEN_WORKER_ENV_KEYS, FORBIDDEN_KEY_SET;
|
|
868
|
+
var init_worker_env = __esm({
|
|
869
|
+
"src/worker-env.ts"() {
|
|
870
|
+
"use strict";
|
|
871
|
+
FORBIDDEN_WORKER_ENV_KEYS = [
|
|
872
|
+
"ANTHROPIC_API_KEY",
|
|
873
|
+
"ANALYST_API_KEY",
|
|
874
|
+
"RECRUITER_API_KEY",
|
|
875
|
+
"AUTH_SECRET",
|
|
876
|
+
"NEXTAUTH_SECRET",
|
|
877
|
+
"DATABASE_URL",
|
|
878
|
+
"PRODUCTION_DATABASE_URL",
|
|
879
|
+
"KYNVER_PRODUCTION_DATABASE_URL",
|
|
880
|
+
"REDIS_URL",
|
|
881
|
+
"GOOGLE_CLIENT_SECRET",
|
|
882
|
+
"GITHUB_CLIENT_SECRET",
|
|
883
|
+
"KYNVER_API_KEY",
|
|
884
|
+
"KYNVER_SERVICE_SECRET",
|
|
885
|
+
"KYNVER_RUNTIME_SECRET",
|
|
886
|
+
"KYNVER_CRON_SECRET",
|
|
887
|
+
"OPENCLAW_CRON_SECRET",
|
|
888
|
+
"QSTASH_TOKEN",
|
|
889
|
+
"QSTASH_CURRENT_SIGNING_KEY",
|
|
890
|
+
"QSTASH_NEXT_SIGNING_KEY",
|
|
891
|
+
"TOOL_SECRETS_KEK",
|
|
892
|
+
"TOOL_EXECUTOR_DISPATCH_SECRET",
|
|
893
|
+
"CLOUDFLARE_API_TOKEN",
|
|
894
|
+
"STRIPE_SECRET_KEY",
|
|
895
|
+
"STRIPE_WEBHOOK_SECRET",
|
|
896
|
+
"STRIPE_IDENTITY_WEBHOOK_SECRET",
|
|
897
|
+
"VOYAGE_API_KEY",
|
|
898
|
+
"PERPLEXITY_API_KEY",
|
|
899
|
+
"FRED_API_KEY",
|
|
900
|
+
"FMP_API_KEY",
|
|
901
|
+
"CURSOR_API_KEY"
|
|
902
|
+
];
|
|
903
|
+
FORBIDDEN_KEY_SET = new Set(FORBIDDEN_WORKER_ENV_KEYS);
|
|
904
|
+
}
|
|
905
|
+
});
|
|
849
906
|
|
|
850
907
|
// src/git.ts
|
|
908
|
+
import { spawnSync } from "node:child_process";
|
|
851
909
|
function git(cwd, args, options = {}) {
|
|
852
|
-
const res = spawnSync(
|
|
910
|
+
const res = spawnSync(
|
|
911
|
+
"git",
|
|
912
|
+
args,
|
|
913
|
+
hiddenSpawnOptions({ cwd, encoding: "utf8" })
|
|
914
|
+
);
|
|
853
915
|
if (res.status !== 0 && !options.allowFailure) {
|
|
854
916
|
const message = `git ${args.join(" ")} failed: ${res.stderr || res.stdout}`;
|
|
855
917
|
if (options.throwError) throw new Error(message);
|
|
@@ -862,7 +924,11 @@ function gitStatusShort(worktreePath) {
|
|
|
862
924
|
}
|
|
863
925
|
function gitCapture(cwd, args) {
|
|
864
926
|
try {
|
|
865
|
-
const res = spawnSync(
|
|
927
|
+
const res = spawnSync(
|
|
928
|
+
"git",
|
|
929
|
+
args,
|
|
930
|
+
hiddenSpawnOptions({ cwd, encoding: "utf8" })
|
|
931
|
+
);
|
|
866
932
|
return {
|
|
867
933
|
status: res.status,
|
|
868
934
|
stdout: res.stdout || "",
|
|
@@ -960,6 +1026,13 @@ function unknownAncestry(base, error, head = null) {
|
|
|
960
1026
|
error
|
|
961
1027
|
};
|
|
962
1028
|
}
|
|
1029
|
+
var init_git = __esm({
|
|
1030
|
+
"src/git.ts"() {
|
|
1031
|
+
"use strict";
|
|
1032
|
+
init_util();
|
|
1033
|
+
init_worker_env();
|
|
1034
|
+
}
|
|
1035
|
+
});
|
|
963
1036
|
|
|
964
1037
|
// src/landing-gate.ts
|
|
965
1038
|
function trimOrNull2(value) {
|
|
@@ -1005,6 +1078,11 @@ function landingAttentionReason(verdict) {
|
|
|
1005
1078
|
if (!verdict.blocked) return void 0;
|
|
1006
1079
|
return verdict.detail ?? verdict.reason ?? "dirty_worktree_no_pr";
|
|
1007
1080
|
}
|
|
1081
|
+
var init_landing_gate = __esm({
|
|
1082
|
+
"src/landing-gate.ts"() {
|
|
1083
|
+
"use strict";
|
|
1084
|
+
}
|
|
1085
|
+
});
|
|
1008
1086
|
|
|
1009
1087
|
// src/worker-final-result-embed.ts
|
|
1010
1088
|
function tryParseJsonObject2(text) {
|
|
@@ -1054,6 +1132,11 @@ function extractEmbeddedWorkerFinalResultRecord(value) {
|
|
|
1054
1132
|
}
|
|
1055
1133
|
return best;
|
|
1056
1134
|
}
|
|
1135
|
+
var init_worker_final_result_embed = __esm({
|
|
1136
|
+
"src/worker-final-result-embed.ts"() {
|
|
1137
|
+
"use strict";
|
|
1138
|
+
}
|
|
1139
|
+
});
|
|
1057
1140
|
|
|
1058
1141
|
// src/landing-contract-gate.ts
|
|
1059
1142
|
function trimOrNull3(value) {
|
|
@@ -1213,10 +1296,14 @@ function landingContractAttentionReason(verdict) {
|
|
|
1213
1296
|
if (!verdict.blocked) return void 0;
|
|
1214
1297
|
return verdict.detail ?? verdict.reason;
|
|
1215
1298
|
}
|
|
1299
|
+
var init_landing_contract_gate = __esm({
|
|
1300
|
+
"src/landing-contract-gate.ts"() {
|
|
1301
|
+
"use strict";
|
|
1302
|
+
init_worker_final_result_embed();
|
|
1303
|
+
}
|
|
1304
|
+
});
|
|
1216
1305
|
|
|
1217
1306
|
// src/status.ts
|
|
1218
|
-
var NO_START_MS = 18e4;
|
|
1219
|
-
var STALE_MS = 6e5;
|
|
1220
1307
|
function computeAttention(input) {
|
|
1221
1308
|
const now = Date.now();
|
|
1222
1309
|
if (input.completionBlocker && !isSkippedTerminalCompletionBlocker(input.completionBlocker)) {
|
|
@@ -1408,7 +1495,15 @@ function computeWorkerStatus(worker, options = {}) {
|
|
|
1408
1495
|
changedFiles,
|
|
1409
1496
|
gitAncestry,
|
|
1410
1497
|
instructionPolicyFingerprint: worker.instructionPolicyFingerprint ?? null,
|
|
1411
|
-
instructionPolicyEvidence: worker.instructionPolicyEvidence ?? null
|
|
1498
|
+
instructionPolicyEvidence: worker.instructionPolicyEvidence ?? null,
|
|
1499
|
+
model: worker.model ?? worker.orchestrationAudit?.model ?? null,
|
|
1500
|
+
provider: worker.orchestrationAudit?.provider ?? null,
|
|
1501
|
+
boxKind: worker.boxKind ?? null,
|
|
1502
|
+
boxId: worker.boxId ?? null,
|
|
1503
|
+
runtimeId: worker.runtimeId ?? null,
|
|
1504
|
+
personaSlug: worker.personaSlug ?? null,
|
|
1505
|
+
dispatched: worker.dispatched ?? null,
|
|
1506
|
+
localOnly: worker.localOnly ?? null
|
|
1412
1507
|
};
|
|
1413
1508
|
}
|
|
1414
1509
|
function isFinishedWorkerStatus(status) {
|
|
@@ -1421,6 +1516,165 @@ function isLandingBlockedWorkerStatus(status) {
|
|
|
1421
1516
|
if (!status.finalResult) return false;
|
|
1422
1517
|
return status.attention.state === "needs_attention" || status.attention.state === "blocked";
|
|
1423
1518
|
}
|
|
1519
|
+
var NO_START_MS, STALE_MS;
|
|
1520
|
+
var init_status = __esm({
|
|
1521
|
+
"src/status.ts"() {
|
|
1522
|
+
"use strict";
|
|
1523
|
+
init_heartbeat();
|
|
1524
|
+
init_stream();
|
|
1525
|
+
init_exit_classify();
|
|
1526
|
+
init_exited_salvage();
|
|
1527
|
+
init_git();
|
|
1528
|
+
init_landing_gate();
|
|
1529
|
+
init_landing_contract_gate();
|
|
1530
|
+
init_worker_final_result_embed();
|
|
1531
|
+
init_util();
|
|
1532
|
+
NO_START_MS = 18e4;
|
|
1533
|
+
STALE_MS = 6e5;
|
|
1534
|
+
}
|
|
1535
|
+
});
|
|
1536
|
+
|
|
1537
|
+
// src/path-values.ts
|
|
1538
|
+
var init_path_values = __esm({
|
|
1539
|
+
"src/path-values.ts"() {
|
|
1540
|
+
"use strict";
|
|
1541
|
+
}
|
|
1542
|
+
});
|
|
1543
|
+
|
|
1544
|
+
// src/default-repo-discovery.ts
|
|
1545
|
+
var init_default_repo_discovery = __esm({
|
|
1546
|
+
"src/default-repo-discovery.ts"() {
|
|
1547
|
+
"use strict";
|
|
1548
|
+
init_git();
|
|
1549
|
+
init_path_values();
|
|
1550
|
+
}
|
|
1551
|
+
});
|
|
1552
|
+
|
|
1553
|
+
// src/box-identity.ts
|
|
1554
|
+
var init_box_identity = __esm({
|
|
1555
|
+
"src/box-identity.ts"() {
|
|
1556
|
+
"use strict";
|
|
1557
|
+
}
|
|
1558
|
+
});
|
|
1559
|
+
|
|
1560
|
+
// src/bounded-build/meminfo.ts
|
|
1561
|
+
var init_meminfo = __esm({
|
|
1562
|
+
"src/bounded-build/meminfo.ts"() {
|
|
1563
|
+
"use strict";
|
|
1564
|
+
}
|
|
1565
|
+
});
|
|
1566
|
+
|
|
1567
|
+
// src/wsl-host.ts
|
|
1568
|
+
var DEFAULT_WSL_HOST_WARN_FREE_BYTES, DEFAULT_WSL_HOST_CRITICAL_FREE_BYTES;
|
|
1569
|
+
var init_wsl_host = __esm({
|
|
1570
|
+
"src/wsl-host.ts"() {
|
|
1571
|
+
"use strict";
|
|
1572
|
+
DEFAULT_WSL_HOST_WARN_FREE_BYTES = 25 * 1024 * 1024 * 1024;
|
|
1573
|
+
DEFAULT_WSL_HOST_CRITICAL_FREE_BYTES = 12 * 1024 * 1024 * 1024;
|
|
1574
|
+
}
|
|
1575
|
+
});
|
|
1576
|
+
|
|
1577
|
+
// src/disk-gate.ts
|
|
1578
|
+
var DEFAULT_WARN_FREE_BYTES, DEFAULT_CRITICAL_FREE_BYTES;
|
|
1579
|
+
var init_disk_gate = __esm({
|
|
1580
|
+
"src/disk-gate.ts"() {
|
|
1581
|
+
"use strict";
|
|
1582
|
+
init_wsl_host();
|
|
1583
|
+
DEFAULT_WARN_FREE_BYTES = 30 * 1024 * 1024 * 1024;
|
|
1584
|
+
DEFAULT_CRITICAL_FREE_BYTES = 15 * 1024 * 1024 * 1024;
|
|
1585
|
+
}
|
|
1586
|
+
});
|
|
1587
|
+
|
|
1588
|
+
// src/run-worker-index.ts
|
|
1589
|
+
var init_run_worker_index = __esm({
|
|
1590
|
+
"src/run-worker-index.ts"() {
|
|
1591
|
+
"use strict";
|
|
1592
|
+
init_run_store();
|
|
1593
|
+
init_util();
|
|
1594
|
+
}
|
|
1595
|
+
});
|
|
1596
|
+
|
|
1597
|
+
// src/harness-worker-active.ts
|
|
1598
|
+
var init_harness_worker_active = __esm({
|
|
1599
|
+
"src/harness-worker-active.ts"() {
|
|
1600
|
+
"use strict";
|
|
1601
|
+
init_status();
|
|
1602
|
+
}
|
|
1603
|
+
});
|
|
1604
|
+
|
|
1605
|
+
// src/resource-gate.ts
|
|
1606
|
+
var DEFAULT_PER_WORKER_MEM_BYTES, DEFAULT_MEM_RESERVE_BYTES;
|
|
1607
|
+
var init_resource_gate = __esm({
|
|
1608
|
+
"src/resource-gate.ts"() {
|
|
1609
|
+
"use strict";
|
|
1610
|
+
init_meminfo();
|
|
1611
|
+
init_config();
|
|
1612
|
+
init_box_identity();
|
|
1613
|
+
init_worker_cap_source();
|
|
1614
|
+
init_disk_gate();
|
|
1615
|
+
init_run_store();
|
|
1616
|
+
init_run_worker_index();
|
|
1617
|
+
init_harness_worker_active();
|
|
1618
|
+
init_util();
|
|
1619
|
+
DEFAULT_PER_WORKER_MEM_BYTES = 500 * 1024 * 1024;
|
|
1620
|
+
DEFAULT_MEM_RESERVE_BYTES = 4 * 1024 * 1024 * 1024;
|
|
1621
|
+
}
|
|
1622
|
+
});
|
|
1623
|
+
|
|
1624
|
+
// src/worker-cap-source.ts
|
|
1625
|
+
var init_worker_cap_source = __esm({
|
|
1626
|
+
"src/worker-cap-source.ts"() {
|
|
1627
|
+
"use strict";
|
|
1628
|
+
init_resource_gate();
|
|
1629
|
+
}
|
|
1630
|
+
});
|
|
1631
|
+
|
|
1632
|
+
// src/config.ts
|
|
1633
|
+
import { homedir, totalmem } from "node:os";
|
|
1634
|
+
import path from "node:path";
|
|
1635
|
+
var CONFIG_DIR, CONFIG_FILE, CREDENTIALS_FILE, SETUP_PER_WORKER_MEM_BYTES, SETUP_MEM_RESERVE_BYTES;
|
|
1636
|
+
var init_config = __esm({
|
|
1637
|
+
"src/config.ts"() {
|
|
1638
|
+
"use strict";
|
|
1639
|
+
init_default_repo_discovery();
|
|
1640
|
+
init_path_values();
|
|
1641
|
+
init_util();
|
|
1642
|
+
init_box_identity();
|
|
1643
|
+
init_worker_cap_source();
|
|
1644
|
+
init_disk_gate();
|
|
1645
|
+
CONFIG_DIR = path.join(homedir(), ".kynver");
|
|
1646
|
+
CONFIG_FILE = path.join(CONFIG_DIR, "config.json");
|
|
1647
|
+
CREDENTIALS_FILE = path.join(CONFIG_DIR, "credentials");
|
|
1648
|
+
SETUP_PER_WORKER_MEM_BYTES = 500 * 1024 * 1024;
|
|
1649
|
+
SETUP_MEM_RESERVE_BYTES = 4 * 1024 * 1024 * 1024;
|
|
1650
|
+
}
|
|
1651
|
+
});
|
|
1652
|
+
|
|
1653
|
+
// src/paths.ts
|
|
1654
|
+
import { homedir as homedir2 } from "node:os";
|
|
1655
|
+
import path2 from "node:path";
|
|
1656
|
+
var LEGACY_ROOT;
|
|
1657
|
+
var init_paths = __esm({
|
|
1658
|
+
"src/paths.ts"() {
|
|
1659
|
+
"use strict";
|
|
1660
|
+
init_config();
|
|
1661
|
+
init_path_values();
|
|
1662
|
+
init_util();
|
|
1663
|
+
LEGACY_ROOT = path2.join(homedir2(), ".openclaw", "harness");
|
|
1664
|
+
}
|
|
1665
|
+
});
|
|
1666
|
+
|
|
1667
|
+
// src/run-store.ts
|
|
1668
|
+
var init_run_store = __esm({
|
|
1669
|
+
"src/run-store.ts"() {
|
|
1670
|
+
"use strict";
|
|
1671
|
+
init_paths();
|
|
1672
|
+
init_util();
|
|
1673
|
+
}
|
|
1674
|
+
});
|
|
1675
|
+
|
|
1676
|
+
// src/server/monitor.ts
|
|
1677
|
+
init_status();
|
|
1424
1678
|
|
|
1425
1679
|
// src/harness-lease-owner.ts
|
|
1426
1680
|
var HARNESS_LEASE_PREFIX = "kynver-harness:";
|
|
@@ -1444,6 +1698,8 @@ function harnessLeaseOwnerMatchesRun(leaseOwner, runId) {
|
|
|
1444
1698
|
}
|
|
1445
1699
|
|
|
1446
1700
|
// src/monitor/monitor.classify.ts
|
|
1701
|
+
init_status();
|
|
1702
|
+
init_util();
|
|
1447
1703
|
function classifyWorkerHealth(input) {
|
|
1448
1704
|
const { worker, status, taskLease } = input;
|
|
1449
1705
|
const leaseOwner = taskLease?.leaseOwner ?? null;
|
|
@@ -1492,42 +1748,14 @@ function classifyWorkerHealth(input) {
|
|
|
1492
1748
|
};
|
|
1493
1749
|
}
|
|
1494
1750
|
|
|
1495
|
-
// src/paths.ts
|
|
1496
|
-
import { homedir as homedir2 } from "node:os";
|
|
1497
|
-
import path2 from "node:path";
|
|
1498
|
-
|
|
1499
|
-
// src/config.ts
|
|
1500
|
-
import { homedir, totalmem } from "node:os";
|
|
1501
|
-
import path from "node:path";
|
|
1502
|
-
|
|
1503
|
-
// src/wsl-host.ts
|
|
1504
|
-
var DEFAULT_WSL_HOST_WARN_FREE_BYTES = 25 * 1024 * 1024 * 1024;
|
|
1505
|
-
var DEFAULT_WSL_HOST_CRITICAL_FREE_BYTES = 12 * 1024 * 1024 * 1024;
|
|
1506
|
-
|
|
1507
|
-
// src/disk-gate.ts
|
|
1508
|
-
var DEFAULT_WARN_FREE_BYTES = 30 * 1024 * 1024 * 1024;
|
|
1509
|
-
var DEFAULT_CRITICAL_FREE_BYTES = 15 * 1024 * 1024 * 1024;
|
|
1510
|
-
|
|
1511
|
-
// src/resource-gate.ts
|
|
1512
|
-
var DEFAULT_PER_WORKER_MEM_BYTES = 500 * 1024 * 1024;
|
|
1513
|
-
var DEFAULT_MEM_RESERVE_BYTES = 4 * 1024 * 1024 * 1024;
|
|
1514
|
-
|
|
1515
|
-
// src/config.ts
|
|
1516
|
-
var CONFIG_DIR = path.join(homedir(), ".kynver");
|
|
1517
|
-
var CONFIG_FILE = path.join(CONFIG_DIR, "config.json");
|
|
1518
|
-
var CREDENTIALS_FILE = path.join(CONFIG_DIR, "credentials");
|
|
1519
|
-
var SETUP_PER_WORKER_MEM_BYTES = 500 * 1024 * 1024;
|
|
1520
|
-
var SETUP_MEM_RESERVE_BYTES = 4 * 1024 * 1024 * 1024;
|
|
1521
|
-
|
|
1522
|
-
// src/paths.ts
|
|
1523
|
-
var LEGACY_ROOT = path2.join(homedir2(), ".openclaw", "harness");
|
|
1524
|
-
|
|
1525
1751
|
// src/completion-ack.ts
|
|
1752
|
+
init_run_store();
|
|
1526
1753
|
function hasCompletionAck(worker) {
|
|
1527
1754
|
return Boolean(worker.completionReportedAt?.trim());
|
|
1528
1755
|
}
|
|
1529
1756
|
|
|
1530
1757
|
// src/monitor/monitor.terminal.ts
|
|
1758
|
+
init_status();
|
|
1531
1759
|
function assessAutoCompleteEligibility(input) {
|
|
1532
1760
|
const { worker, status } = input;
|
|
1533
1761
|
const blockers = [];
|