@kynver-app/runtime 0.1.112 → 0.1.117
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/cli.js +1559 -397
- 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/device-login.d.ts +8 -0
- package/dist/index.js +2185 -999
- package/dist/index.js.map +4 -4
- 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 +376 -127
- package/dist/server/cleanup.js.map +4 -4
- package/dist/server/default-repo.js +288 -68
- package/dist/server/default-repo.js.map +4 -4
- package/dist/server/monitor.js +342 -126
- 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/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface DaemonHeartbeat {
|
|
2
|
+
observedAt: string;
|
|
3
|
+
pid: number;
|
|
4
|
+
runId: string;
|
|
5
|
+
agentOsId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function daemonHeartbeatPath(agentOsId: string): string;
|
|
8
|
+
/** Best-effort atomic write (temp + rename). Never throws. */
|
|
9
|
+
export declare function writeDaemonHeartbeat(input: {
|
|
10
|
+
agentOsId: string;
|
|
11
|
+
runId: string;
|
|
12
|
+
now?: Date;
|
|
13
|
+
}): void;
|
|
14
|
+
export declare function readDaemonHeartbeat(agentOsId: string): DaemonHeartbeat | null;
|
|
15
|
+
/**
|
|
16
|
+
* True when the heartbeat indicates a hung daemon. A missing heartbeat is NOT
|
|
17
|
+
* stale — a freshly spawned child has not written one yet; the keeper grants a
|
|
18
|
+
* startup grace window instead.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isDaemonHeartbeatStale(beat: DaemonHeartbeat | null, stallMs: number, nowMs?: number): boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare function resolveKeeperStallMs(flag: string | boolean | undefined, env?: NodeJS.ProcessEnv): number;
|
|
2
|
+
/**
|
|
3
|
+
* Supervision is the DEFAULT for `kynver daemon`. Opt out only when an
|
|
4
|
+
* external supervisor (systemd, pm2, container restart policy) already owns
|
|
5
|
+
* restarts: `--no-supervise`, `--supervised false`, or
|
|
6
|
+
* `KYNVER_DAEMON_SUPERVISED=0|false|no|off`. The keeper's own child carries
|
|
7
|
+
* the internal `--keeper-child` flag so it can never recurse into a second
|
|
8
|
+
* keeper. `--supervised` stays accepted as a no-op for back-compat.
|
|
9
|
+
*/
|
|
10
|
+
export declare function shouldRunDaemonKeeper(args: Record<string, string | boolean>, env?: NodeJS.ProcessEnv): boolean;
|
|
11
|
+
/** Exponential backoff with cap; resets to base after a healthy stretch. */
|
|
12
|
+
export declare function nextKeeperBackoffMs(consecutiveFailures: number, base?: number, cap?: number): number;
|
|
13
|
+
/** True when the child ran long enough to count as healthy (resets backoff). */
|
|
14
|
+
export declare function keeperRunWasHealthy(startedAtMs: number, endedAtMs: number, healthyMs?: number): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Rebuild the child argv: original daemon args minus keeper-only flags, plus
|
|
17
|
+
* the internal `--keeper-child` marker that prevents keeper recursion now
|
|
18
|
+
* that supervision is the default.
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildKeeperChildArgv(argv: readonly string[]): string[];
|
|
21
|
+
export declare function runDaemonKeeper(args: Record<string, string | boolean>, rawArgv?: readonly string[]): Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run the device-authorization login flow. Returns `{ ok, apiKey }`. Prints
|
|
3
|
+
* progress to the console. Does not exit the process (the caller decides).
|
|
4
|
+
*/
|
|
5
|
+
export declare function runDeviceLogin(args: Record<string, string | boolean>): Promise<{
|
|
6
|
+
ok: boolean;
|
|
7
|
+
apiKey?: string;
|
|
8
|
+
}>;
|