@kynver-app/runtime 0.1.99 → 0.1.102
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/cli.js +616 -196
- package/dist/cli.js.map +4 -4
- package/dist/harness-worker-active.d.ts +12 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +611 -187
- package/dist/index.js.map +4 -4
- package/dist/lane/landing-maintainer-local.d.ts +15 -0
- package/dist/lane/landing-maintainer-tick.d.ts +16 -0
- package/dist/lane/lane-spec.d.ts +8 -0
- package/dist/lane/lane-tick-cli.d.ts +1 -0
- package/dist/local-pr-attention-reconcile.d.ts +25 -0
- package/dist/resource-gate.d.ts +2 -7
- package/dist/run-resolve.d.ts +4 -0
- package/dist/stale-reconcile.d.ts +2 -0
- package/dist/status.d.ts +1 -0
- package/dist/util.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface LandingMaintainerLocalAction {
|
|
2
|
+
kind: "land_pr" | "skip" | "noop" | "repair_dispatch_hint";
|
|
3
|
+
prNumber?: number;
|
|
4
|
+
prUrl?: string;
|
|
5
|
+
reason: string;
|
|
6
|
+
}
|
|
7
|
+
export interface LandingMaintainerLocalOutcome {
|
|
8
|
+
action: LandingMaintainerLocalAction;
|
|
9
|
+
executed: boolean;
|
|
10
|
+
exitCode: number | null;
|
|
11
|
+
stdout: string;
|
|
12
|
+
stderr: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function runLandingWrapper(prNumber: number, repoRoot: string, execute: boolean): LandingMaintainerLocalOutcome;
|
|
15
|
+
export declare function resolveLandingMaintainerRepoRoot(args: Record<string, string | boolean>): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface LandingMaintainerTickResult {
|
|
2
|
+
repo: string;
|
|
3
|
+
fleet: boolean;
|
|
4
|
+
execute: boolean;
|
|
5
|
+
coordinator: unknown;
|
|
6
|
+
localOutcomes: Array<{
|
|
7
|
+
action: {
|
|
8
|
+
kind: string;
|
|
9
|
+
prNumber?: number;
|
|
10
|
+
reason: string;
|
|
11
|
+
};
|
|
12
|
+
executed: boolean;
|
|
13
|
+
exitCode: number | null;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
export declare function runLandingMaintainerLaneTick(args: Record<string, string | boolean>): Promise<LandingMaintainerTickResult>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Runtime mirror of server landing-maintainer lane policy. */
|
|
2
|
+
export declare const LANDING_MAINTAINER_LANE_SPEC: {
|
|
3
|
+
readonly slug: "landing-maintainer";
|
|
4
|
+
readonly originCron: "maintain-8-blocker-and-pr-landing-workers";
|
|
5
|
+
readonly defaultRepo: "Totalsolutionsync/Kynver";
|
|
6
|
+
readonly landScript: "scripts/agent-os-land-pr.mjs";
|
|
7
|
+
readonly landScriptArgs: readonly ["--skip-not-ready"];
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runLaneTickCli(args: Record<string, string | boolean>, laneFromArgv?: string): Promise<void>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface LocalPrAttentionReconcileOutcome {
|
|
2
|
+
runId: string;
|
|
3
|
+
worker: string;
|
|
4
|
+
action: "marked_done" | "skipped";
|
|
5
|
+
reason: string;
|
|
6
|
+
prUrl?: string;
|
|
7
|
+
mergeCommit?: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface LocalPrAttentionReconcileResult {
|
|
10
|
+
workers: LocalPrAttentionReconcileOutcome[];
|
|
11
|
+
}
|
|
12
|
+
interface PrLookupResult {
|
|
13
|
+
prUrl: string;
|
|
14
|
+
state: string;
|
|
15
|
+
mergedAt?: string | null;
|
|
16
|
+
mergeCommit?: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface LocalPrAttentionReconcileOptions {
|
|
19
|
+
lookupPr?: (input: {
|
|
20
|
+
repoDir: string;
|
|
21
|
+
prNumber: number;
|
|
22
|
+
}) => PrLookupResult | null;
|
|
23
|
+
}
|
|
24
|
+
export declare function reconcileLocalOnlyMergedPrAttention(options?: LocalPrAttentionReconcileOptions): LocalPrAttentionReconcileResult;
|
|
25
|
+
export {};
|
package/dist/resource-gate.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type KynverUserConfig } from "./config.js";
|
|
2
2
|
import type { WorkerCapSource } from "./worker-cap-source.js";
|
|
3
3
|
import type { DispatchNextDiskGateShape } from "./callbacks.js";
|
|
4
|
-
import
|
|
4
|
+
import { workerProcessMatchesRecord } from "./harness-worker-active.js";
|
|
5
|
+
export { workerProcessMatchesRecord };
|
|
5
6
|
/** Default RAM budget per worker (~500 MiB, dogfood measured). Internal — not a setup knob. */
|
|
6
7
|
export declare const DEFAULT_PER_WORKER_MEM_BYTES: number;
|
|
7
8
|
/** Keep headroom for OS / IDE. Internal — not a setup knob. */
|
|
@@ -48,12 +49,6 @@ export declare function computeAutoMaxWorkers(totalMemBytes: number, opts?: {
|
|
|
48
49
|
memReserveBytes?: number;
|
|
49
50
|
memUtilization?: number;
|
|
50
51
|
}): number;
|
|
51
|
-
/**
|
|
52
|
-
* PID existence is not enough on long-running hosts: Linux can reuse an old
|
|
53
|
-
* worker PID for an unrelated process, which makes stale worker.json records
|
|
54
|
-
* look alive and can falsely saturate the global worker gate.
|
|
55
|
-
*/
|
|
56
|
-
export declare function workerProcessMatchesRecord(worker: HarnessWorkerRecord): boolean;
|
|
57
52
|
/** Count active workers in ONE run (kept for callers/tests scoped to a run). */
|
|
58
53
|
export declare function countActiveWorkers(runId: string): number;
|
|
59
54
|
/**
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type RunListRow } from "./run-list.js";
|
|
2
|
+
/** Reconcile stale workers/runs first, then pick a non-completed run by name. */
|
|
3
|
+
export declare function resolveHarnessRunByName(runName: string): RunListRow | null;
|
|
4
|
+
export declare function resolveHarnessRunCli(args: Record<string, string | boolean>): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type RunFinalizeResult } from "./finalize.js";
|
|
2
2
|
import { reconcileWorkerMetadata } from "./worker-metadata-reconcile.js";
|
|
3
|
+
import { reconcileLocalOnlyMergedPrAttention } from "./local-pr-attention-reconcile.js";
|
|
3
4
|
/** No heartbeat this long + dead PID → reconcile as exited. */
|
|
4
5
|
export declare const STALE_RECONCILE_HEARTBEAT_MS: number;
|
|
5
6
|
export interface StaleWorkerReconcileOutcome {
|
|
@@ -12,6 +13,7 @@ export interface ReconcileStaleWorkersResult {
|
|
|
12
13
|
workers: StaleWorkerReconcileOutcome[];
|
|
13
14
|
finalizedRuns: RunFinalizeResult[];
|
|
14
15
|
metadataReconcile: ReturnType<typeof reconcileWorkerMetadata>;
|
|
16
|
+
localPrAttentionReconcile: ReturnType<typeof reconcileLocalOnlyMergedPrAttention>;
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
19
|
* Reconcile workers that exited without updating worker.json, and optionally
|
package/dist/status.d.ts
CHANGED
|
@@ -195,6 +195,7 @@ export declare function computeAttention(input: {
|
|
|
195
195
|
completionBlocker?: string | null;
|
|
196
196
|
landingContract?: WorkerLandingContract | null;
|
|
197
197
|
prUrl?: string | null;
|
|
198
|
+
localOnly?: boolean;
|
|
198
199
|
}): WorkerAttention;
|
|
199
200
|
export declare function computeWorkerStatus(worker: HarnessWorkerRecord, options?: WorkerStatusOptions): RawHarnessWorkerStatus;
|
|
200
201
|
export declare function isFinishedWorkerStatus(status: RawHarnessWorkerStatus): boolean;
|
package/dist/util.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export declare function tailFile(file: string, lines: number): string;
|
|
|
16
16
|
export declare function readMaybeFile(file: string | undefined): string;
|
|
17
17
|
export declare function listRunIds(runsDir: string): string[];
|
|
18
18
|
export declare function sleepMs(ms: number): void;
|
|
19
|
+
/** Non-blocking sleep for async loops (daemon backoff, interruptible shutdown). */
|
|
20
|
+
export declare function sleepMsAsync(ms: number): Promise<void>;
|
|
19
21
|
export declare function isPidAlive(pid: number | undefined): boolean;
|
|
20
22
|
export declare function killWorkerProcess(pid: number, signal: NodeJS.Signals): void;
|
|
21
23
|
export declare function latestIso(values: Array<string | null | undefined>): string | null;
|