@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.
Files changed (39) hide show
  1. package/dist/bootstrap.d.ts +1 -0
  2. package/dist/cleanup-git-rev-cache.d.ts +5 -0
  3. package/dist/cleanup-git-status-cache.d.ts +5 -0
  4. package/dist/cleanup-guards.d.ts +2 -0
  5. package/dist/cleanup-index-status.d.ts +8 -1
  6. package/dist/cleanup-run-liveness.d.ts +8 -1
  7. package/dist/cli.js +1929 -468
  8. package/dist/cli.js.map +4 -4
  9. package/dist/daemon-heartbeat.d.ts +20 -0
  10. package/dist/daemon-keeper.d.ts +21 -0
  11. package/dist/daemon-platform-guard.d.ts +2 -0
  12. package/dist/device-login.d.ts +8 -0
  13. package/dist/index.js +2636 -1151
  14. package/dist/index.js.map +4 -4
  15. package/dist/landing/cli-auth.d.ts +5 -1
  16. package/dist/landing/land-pr.d.ts +8 -0
  17. package/dist/provider-evidence/collect.d.ts +18 -0
  18. package/dist/provider-evidence/exec.d.ts +5 -0
  19. package/dist/provider-evidence/index.d.ts +7 -0
  20. package/dist/provider-evidence/recipes-github.d.ts +4 -0
  21. package/dist/provider-evidence/recipes-vercel.d.ts +2 -0
  22. package/dist/provider-evidence/registry.d.ts +6 -0
  23. package/dist/provider-evidence/types.d.ts +48 -0
  24. package/dist/provider-evidence/wanted-store.d.ts +5 -0
  25. package/dist/providers/codex.d.ts +7 -2
  26. package/dist/providers/hermes-codex.d.ts +5 -2
  27. package/dist/server/cleanup.js +560 -164
  28. package/dist/server/cleanup.js.map +4 -4
  29. package/dist/server/default-repo.js +298 -68
  30. package/dist/server/default-repo.js.map +4 -4
  31. package/dist/server/memory-cost-enforce.js +11 -1
  32. package/dist/server/memory-cost-enforce.js.map +3 -3
  33. package/dist/server/monitor.js +356 -128
  34. package/dist/server/monitor.js.map +4 -4
  35. package/dist/server/worker-policy.js +304 -49
  36. package/dist/server/worker-policy.js.map +4 -4
  37. package/dist/status.d.ts +18 -0
  38. package/dist/worker-ops.d.ts +4 -0
  39. package/package.json +1 -1
@@ -1,59 +1,69 @@
1
- // src/default-repo.ts
2
- import path5 from "node:path";
3
-
4
- // src/config.ts
5
- import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, writeFileSync } from "node:fs";
6
- import { homedir as homedir4, totalmem } from "node:os";
7
- import path4 from "node:path";
8
-
9
- // src/default-repo-discovery.ts
10
- import { existsSync, readFileSync } from "node:fs";
11
- import { homedir as homedir2 } from "node:os";
12
- import path2 from "node:path";
13
- import { fileURLToPath } from "node:url";
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
+ };
14
5
 
15
- // src/git.ts
16
- import { spawnSync } from "node:child_process";
6
+ // src/util.ts
7
+ function hiddenSpawnOptions(opts) {
8
+ if (process.platform !== "win32") return opts;
9
+ return { windowsHide: true, ...opts };
10
+ }
11
+ var init_util = __esm({
12
+ "src/util.ts"() {
13
+ "use strict";
14
+ }
15
+ });
17
16
 
18
17
  // src/worker-env.ts
19
- var FORBIDDEN_WORKER_ENV_KEYS = [
20
- "ANTHROPIC_API_KEY",
21
- "ANALYST_API_KEY",
22
- "RECRUITER_API_KEY",
23
- "AUTH_SECRET",
24
- "NEXTAUTH_SECRET",
25
- "DATABASE_URL",
26
- "PRODUCTION_DATABASE_URL",
27
- "KYNVER_PRODUCTION_DATABASE_URL",
28
- "REDIS_URL",
29
- "GOOGLE_CLIENT_SECRET",
30
- "GITHUB_CLIENT_SECRET",
31
- "KYNVER_API_KEY",
32
- "KYNVER_SERVICE_SECRET",
33
- "KYNVER_RUNTIME_SECRET",
34
- "KYNVER_CRON_SECRET",
35
- "OPENCLAW_CRON_SECRET",
36
- "QSTASH_TOKEN",
37
- "QSTASH_CURRENT_SIGNING_KEY",
38
- "QSTASH_NEXT_SIGNING_KEY",
39
- "TOOL_SECRETS_KEK",
40
- "TOOL_EXECUTOR_DISPATCH_SECRET",
41
- "CLOUDFLARE_API_TOKEN",
42
- "STRIPE_SECRET_KEY",
43
- "STRIPE_WEBHOOK_SECRET",
44
- "STRIPE_IDENTITY_WEBHOOK_SECRET",
45
- "VOYAGE_API_KEY",
46
- "PERPLEXITY_API_KEY",
47
- "FRED_API_KEY",
48
- "FMP_API_KEY",
49
- "CURSOR_API_KEY"
50
- ];
51
- var FORBIDDEN_KEY_SET = new Set(FORBIDDEN_WORKER_ENV_KEYS);
18
+ var FORBIDDEN_WORKER_ENV_KEYS, FORBIDDEN_KEY_SET;
19
+ var init_worker_env = __esm({
20
+ "src/worker-env.ts"() {
21
+ "use strict";
22
+ FORBIDDEN_WORKER_ENV_KEYS = [
23
+ "ANTHROPIC_API_KEY",
24
+ "ANALYST_API_KEY",
25
+ "RECRUITER_API_KEY",
26
+ "AUTH_SECRET",
27
+ "NEXTAUTH_SECRET",
28
+ "DATABASE_URL",
29
+ "PRODUCTION_DATABASE_URL",
30
+ "KYNVER_PRODUCTION_DATABASE_URL",
31
+ "REDIS_URL",
32
+ "GOOGLE_CLIENT_SECRET",
33
+ "GITHUB_CLIENT_SECRET",
34
+ "KYNVER_API_KEY",
35
+ "KYNVER_SERVICE_SECRET",
36
+ "KYNVER_RUNTIME_SECRET",
37
+ "KYNVER_CRON_SECRET",
38
+ "OPENCLAW_CRON_SECRET",
39
+ "QSTASH_TOKEN",
40
+ "QSTASH_CURRENT_SIGNING_KEY",
41
+ "QSTASH_NEXT_SIGNING_KEY",
42
+ "TOOL_SECRETS_KEK",
43
+ "TOOL_EXECUTOR_DISPATCH_SECRET",
44
+ "CLOUDFLARE_API_TOKEN",
45
+ "STRIPE_SECRET_KEY",
46
+ "STRIPE_WEBHOOK_SECRET",
47
+ "STRIPE_IDENTITY_WEBHOOK_SECRET",
48
+ "VOYAGE_API_KEY",
49
+ "PERPLEXITY_API_KEY",
50
+ "FRED_API_KEY",
51
+ "FMP_API_KEY",
52
+ "CURSOR_API_KEY"
53
+ ];
54
+ FORBIDDEN_KEY_SET = new Set(FORBIDDEN_WORKER_ENV_KEYS);
55
+ }
56
+ });
52
57
 
53
58
  // src/git.ts
59
+ import { spawnSync } from "node:child_process";
54
60
  function gitCapture(cwd, args) {
55
61
  try {
56
- const res = spawnSync("git", args, { cwd, encoding: "utf8" });
62
+ const res = spawnSync(
63
+ "git",
64
+ args,
65
+ hiddenSpawnOptions({ cwd, encoding: "utf8" })
66
+ );
57
67
  return {
58
68
  status: res.status,
59
69
  stdout: res.stdout || "",
@@ -69,6 +79,13 @@ function gitCapture(cwd, args) {
69
79
  };
70
80
  }
71
81
  }
82
+ var init_git = __esm({
83
+ "src/git.ts"() {
84
+ "use strict";
85
+ init_util();
86
+ init_worker_env();
87
+ }
88
+ });
72
89
 
73
90
  // src/path-values.ts
74
91
  import { homedir } from "node:os";
@@ -83,15 +100,17 @@ function expandHomePath(value) {
83
100
  function resolveUserPath(value) {
84
101
  return path.resolve(expandHomePath(value));
85
102
  }
103
+ var init_path_values = __esm({
104
+ "src/path-values.ts"() {
105
+ "use strict";
106
+ }
107
+ });
86
108
 
87
109
  // src/default-repo-discovery.ts
88
- var WELL_KNOWN_REPO_DIRS = [
89
- "Kynver",
90
- "repos/Kynver",
91
- "repos/kynver-source-main",
92
- "code/Kynver",
93
- "projects/Kynver"
94
- ];
110
+ import { existsSync, readFileSync } from "node:fs";
111
+ import { homedir as homedir2 } from "node:os";
112
+ import path2 from "node:path";
113
+ import { fileURLToPath } from "node:url";
95
114
  function readPackageName(repoRoot) {
96
115
  const pkgPath = path2.join(repoRoot, "package.json");
97
116
  if (!existsSync(pkgPath)) return null;
@@ -156,28 +175,220 @@ function discoverDefaultRepoCandidates(opts) {
156
175
  function discoverDefaultRepo(opts) {
157
176
  return discoverDefaultRepoCandidates(opts)[0] ?? null;
158
177
  }
178
+ var WELL_KNOWN_REPO_DIRS;
179
+ var init_default_repo_discovery = __esm({
180
+ "src/default-repo-discovery.ts"() {
181
+ "use strict";
182
+ init_git();
183
+ init_path_values();
184
+ WELL_KNOWN_REPO_DIRS = [
185
+ "Kynver",
186
+ "repos/Kynver",
187
+ "repos/kynver-source-main",
188
+ "code/Kynver",
189
+ "projects/Kynver"
190
+ ];
191
+ }
192
+ });
193
+
194
+ // src/box-identity.ts
195
+ var init_box_identity = __esm({
196
+ "src/box-identity.ts"() {
197
+ "use strict";
198
+ }
199
+ });
200
+
201
+ // src/bounded-build/meminfo.ts
202
+ var init_meminfo = __esm({
203
+ "src/bounded-build/meminfo.ts"() {
204
+ "use strict";
205
+ }
206
+ });
159
207
 
160
208
  // src/wsl-host.ts
161
- var DEFAULT_WSL_HOST_WARN_FREE_BYTES = 25 * 1024 * 1024 * 1024;
162
- var DEFAULT_WSL_HOST_CRITICAL_FREE_BYTES = 12 * 1024 * 1024 * 1024;
209
+ var DEFAULT_WSL_HOST_WARN_FREE_BYTES, DEFAULT_WSL_HOST_CRITICAL_FREE_BYTES;
210
+ var init_wsl_host = __esm({
211
+ "src/wsl-host.ts"() {
212
+ "use strict";
213
+ DEFAULT_WSL_HOST_WARN_FREE_BYTES = 25 * 1024 * 1024 * 1024;
214
+ DEFAULT_WSL_HOST_CRITICAL_FREE_BYTES = 12 * 1024 * 1024 * 1024;
215
+ }
216
+ });
163
217
 
164
218
  // src/disk-gate.ts
165
- var DEFAULT_WARN_FREE_BYTES = 30 * 1024 * 1024 * 1024;
166
- var DEFAULT_CRITICAL_FREE_BYTES = 15 * 1024 * 1024 * 1024;
219
+ var DEFAULT_WARN_FREE_BYTES, DEFAULT_CRITICAL_FREE_BYTES;
220
+ var init_disk_gate = __esm({
221
+ "src/disk-gate.ts"() {
222
+ "use strict";
223
+ init_wsl_host();
224
+ DEFAULT_WARN_FREE_BYTES = 30 * 1024 * 1024 * 1024;
225
+ DEFAULT_CRITICAL_FREE_BYTES = 15 * 1024 * 1024 * 1024;
226
+ }
227
+ });
167
228
 
168
229
  // src/paths.ts
169
230
  import { homedir as homedir3 } from "node:os";
170
231
  import path3 from "node:path";
171
- var LEGACY_ROOT = path3.join(homedir3(), ".openclaw", "harness");
232
+ var LEGACY_ROOT;
233
+ var init_paths = __esm({
234
+ "src/paths.ts"() {
235
+ "use strict";
236
+ init_config();
237
+ init_path_values();
238
+ init_util();
239
+ LEGACY_ROOT = path3.join(homedir3(), ".openclaw", "harness");
240
+ }
241
+ });
242
+
243
+ // src/run-store.ts
244
+ var init_run_store = __esm({
245
+ "src/run-store.ts"() {
246
+ "use strict";
247
+ init_paths();
248
+ init_util();
249
+ }
250
+ });
251
+
252
+ // src/run-worker-index.ts
253
+ var init_run_worker_index = __esm({
254
+ "src/run-worker-index.ts"() {
255
+ "use strict";
256
+ init_run_store();
257
+ init_util();
258
+ }
259
+ });
260
+
261
+ // src/heartbeat-final-result.ts
262
+ var init_heartbeat_final_result = __esm({
263
+ "src/heartbeat-final-result.ts"() {
264
+ "use strict";
265
+ }
266
+ });
267
+
268
+ // src/heartbeat.ts
269
+ var init_heartbeat = __esm({
270
+ "src/heartbeat.ts"() {
271
+ "use strict";
272
+ init_heartbeat_final_result();
273
+ init_util();
274
+ }
275
+ });
276
+
277
+ // src/repo-search.ts
278
+ var init_repo_search = __esm({
279
+ "src/repo-search.ts"() {
280
+ "use strict";
281
+ }
282
+ });
283
+
284
+ // src/shell-command-outcome.ts
285
+ var init_shell_command_outcome = __esm({
286
+ "src/shell-command-outcome.ts"() {
287
+ "use strict";
288
+ init_repo_search();
289
+ }
290
+ });
291
+
292
+ // src/stream.ts
293
+ var init_stream = __esm({
294
+ "src/stream.ts"() {
295
+ "use strict";
296
+ init_shell_command_outcome();
297
+ init_util();
298
+ }
299
+ });
300
+
301
+ // src/exit-classify.ts
302
+ var init_exit_classify = __esm({
303
+ "src/exit-classify.ts"() {
304
+ "use strict";
305
+ }
306
+ });
307
+
308
+ // src/exited-salvage.ts
309
+ var init_exited_salvage = __esm({
310
+ "src/exited-salvage.ts"() {
311
+ "use strict";
312
+ }
313
+ });
314
+
315
+ // src/landing-gate.ts
316
+ var init_landing_gate = __esm({
317
+ "src/landing-gate.ts"() {
318
+ "use strict";
319
+ }
320
+ });
321
+
322
+ // src/worker-final-result-embed.ts
323
+ var init_worker_final_result_embed = __esm({
324
+ "src/worker-final-result-embed.ts"() {
325
+ "use strict";
326
+ }
327
+ });
328
+
329
+ // src/landing-contract-gate.ts
330
+ var init_landing_contract_gate = __esm({
331
+ "src/landing-contract-gate.ts"() {
332
+ "use strict";
333
+ init_worker_final_result_embed();
334
+ }
335
+ });
336
+
337
+ // src/status.ts
338
+ var init_status = __esm({
339
+ "src/status.ts"() {
340
+ "use strict";
341
+ init_heartbeat();
342
+ init_stream();
343
+ init_exit_classify();
344
+ init_exited_salvage();
345
+ init_git();
346
+ init_landing_gate();
347
+ init_landing_contract_gate();
348
+ init_worker_final_result_embed();
349
+ init_util();
350
+ }
351
+ });
352
+
353
+ // src/harness-worker-active.ts
354
+ var init_harness_worker_active = __esm({
355
+ "src/harness-worker-active.ts"() {
356
+ "use strict";
357
+ init_status();
358
+ }
359
+ });
172
360
 
173
361
  // src/resource-gate.ts
174
- var DEFAULT_PER_WORKER_MEM_BYTES = 500 * 1024 * 1024;
175
- var DEFAULT_MEM_RESERVE_BYTES = 4 * 1024 * 1024 * 1024;
362
+ var DEFAULT_PER_WORKER_MEM_BYTES, DEFAULT_MEM_RESERVE_BYTES;
363
+ var init_resource_gate = __esm({
364
+ "src/resource-gate.ts"() {
365
+ "use strict";
366
+ init_meminfo();
367
+ init_config();
368
+ init_box_identity();
369
+ init_worker_cap_source();
370
+ init_disk_gate();
371
+ init_run_store();
372
+ init_run_worker_index();
373
+ init_harness_worker_active();
374
+ init_util();
375
+ DEFAULT_PER_WORKER_MEM_BYTES = 500 * 1024 * 1024;
376
+ DEFAULT_MEM_RESERVE_BYTES = 4 * 1024 * 1024 * 1024;
377
+ }
378
+ });
379
+
380
+ // src/worker-cap-source.ts
381
+ var init_worker_cap_source = __esm({
382
+ "src/worker-cap-source.ts"() {
383
+ "use strict";
384
+ init_resource_gate();
385
+ }
386
+ });
176
387
 
177
388
  // src/config.ts
178
- var CONFIG_DIR = path4.join(homedir4(), ".kynver");
179
- var CONFIG_FILE = path4.join(CONFIG_DIR, "config.json");
180
- var CREDENTIALS_FILE = path4.join(CONFIG_DIR, "credentials");
389
+ import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, writeFileSync } from "node:fs";
390
+ import { homedir as homedir4, totalmem } from "node:os";
391
+ import path4 from "node:path";
181
392
  function loadUserConfig() {
182
393
  if (!existsSync2(CONFIG_FILE)) return {};
183
394
  try {
@@ -186,10 +397,29 @@ function loadUserConfig() {
186
397
  return {};
187
398
  }
188
399
  }
189
- var SETUP_PER_WORKER_MEM_BYTES = 500 * 1024 * 1024;
190
- var SETUP_MEM_RESERVE_BYTES = 4 * 1024 * 1024 * 1024;
400
+ var CONFIG_DIR, CONFIG_FILE, CREDENTIALS_FILE, SETUP_PER_WORKER_MEM_BYTES, SETUP_MEM_RESERVE_BYTES;
401
+ var init_config = __esm({
402
+ "src/config.ts"() {
403
+ "use strict";
404
+ init_default_repo_discovery();
405
+ init_path_values();
406
+ init_util();
407
+ init_box_identity();
408
+ init_worker_cap_source();
409
+ init_disk_gate();
410
+ CONFIG_DIR = path4.join(homedir4(), ".kynver");
411
+ CONFIG_FILE = path4.join(CONFIG_DIR, "config.json");
412
+ CREDENTIALS_FILE = path4.join(CONFIG_DIR, "credentials");
413
+ SETUP_PER_WORKER_MEM_BYTES = 500 * 1024 * 1024;
414
+ SETUP_MEM_RESERVE_BYTES = 4 * 1024 * 1024 * 1024;
415
+ }
416
+ });
191
417
 
192
418
  // src/default-repo.ts
419
+ init_config();
420
+ init_default_repo_discovery();
421
+ init_path_values();
422
+ import path5 from "node:path";
193
423
  function expandConfiguredRepo(value) {
194
424
  return path5.resolve(resolveUserPath(value.trim()));
195
425
  }