@kynver-app/runtime 0.1.77 → 0.1.79
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/cleanup-types.d.ts +2 -0
- package/dist/cli.js +1082 -302
- package/dist/cli.js.map +4 -4
- package/dist/cron/cron-env.d.ts +21 -0
- package/dist/cron/cron-fire.d.ts +8 -0
- package/dist/cron/cron-lock.d.ts +9 -0
- package/dist/cron/cron-match.d.ts +8 -0
- package/dist/cron/cron-status.d.ts +10 -0
- package/dist/cron/cron-store.d.ts +3 -0
- package/dist/cron/cron-tick-cli.d.ts +2 -0
- package/dist/cron/cron-tick-state.d.ts +5 -0
- package/dist/cron/cron-tick.d.ts +17 -0
- package/dist/cron/cron-types.d.ts +44 -0
- package/dist/dispatch.d.ts +1 -0
- package/dist/doctor/runtime-takeover-scheduler.d.ts +3 -1
- package/dist/doctor/runtime-takeover.probes.d.ts +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1119 -318
- package/dist/index.js.map +4 -4
- package/dist/pipeline-max-starts.d.ts +8 -1
- package/dist/pipeline-tick.d.ts +2 -0
- package/dist/prompt.d.ts +2 -0
- package/dist/run-metadata-retention.d.ts +23 -0
- package/dist/scheduler-cutover.d.ts +4 -1
- package/dist/status.d.ts +2 -0
- package/dist/supervisor.d.ts +1 -0
- package/dist/worker-metadata-reconcile.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface KynverCronEnv {
|
|
2
|
+
storePath: string;
|
|
3
|
+
statePath: string;
|
|
4
|
+
lockPath: string;
|
|
5
|
+
fireBaseUrl: string | null;
|
|
6
|
+
secret: string | null;
|
|
7
|
+
tickEnabled: boolean;
|
|
8
|
+
tickIntervalMs: number;
|
|
9
|
+
missedRunPolicy: "catch_up" | "skip";
|
|
10
|
+
maxCatchUpPerTick: number;
|
|
11
|
+
maxRetries: number;
|
|
12
|
+
retryBackoffMs: number;
|
|
13
|
+
inflightLeaseMs: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function defaultKynverCronStorePath(): string;
|
|
16
|
+
export declare function defaultKynverCronStatePath(storePath?: string): string;
|
|
17
|
+
export declare function resolveKynverCronFireBaseUrl(): string | null;
|
|
18
|
+
export declare function resolveKynverCronSecret(): string | null;
|
|
19
|
+
/** Whether the connected-box daemon should run the local cron tick loop. */
|
|
20
|
+
export declare function resolveKynverCronEnv(): KynverCronEnv;
|
|
21
|
+
export declare function isKynverCronDaemonPrimary(env?: KynverCronEnv): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CronFireResult, CronRegisteredJob } from "./cron-types.js";
|
|
2
|
+
export declare function fireKynverCronJob(input: {
|
|
3
|
+
entry: CronRegisteredJob;
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
secret: string;
|
|
6
|
+
jobId?: string | null;
|
|
7
|
+
fetchFn?: typeof fetch;
|
|
8
|
+
}): Promise<CronFireResult>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CronJobSpec } from "./cron-types.js";
|
|
2
|
+
export declare function isCronExpression(value: string): boolean;
|
|
3
|
+
/** UTC 5-field cron match for a Date (minute resolution). */
|
|
4
|
+
export declare function cronMatchesUtc(expr: string, at: Date): boolean;
|
|
5
|
+
/** Next UTC fire at or strictly after `after` (minute resolution). */
|
|
6
|
+
export declare function computeNextCronFireUtc(expr: string, after: Date): Date | null;
|
|
7
|
+
export declare function computeInitialNextFire(spec: CronJobSpec, now: Date): string | null;
|
|
8
|
+
export declare function advanceRecurringNextFire(spec: CronJobSpec, fromInclusive: Date): string | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { KynverCronEnv } from "./cron-env.js";
|
|
2
|
+
export interface KynverCronStatusReport {
|
|
3
|
+
primary: "kynver-cron-daemon" | "qstash" | "disabled";
|
|
4
|
+
env: Pick<KynverCronEnv, "storePath" | "statePath" | "tickEnabled" | "fireBaseUrl" | "missedRunPolicy" | "maxCatchUpPerTick" | "maxRetries">;
|
|
5
|
+
jobCount: number;
|
|
6
|
+
stateJobCount: number;
|
|
7
|
+
credentialsReady: boolean;
|
|
8
|
+
daemonPrimary: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function buildKynverCronStatusReport(env?: KynverCronEnv): Promise<KynverCronStatusReport>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CronTickJobState, CronTickStateFile } from "./cron-types.js";
|
|
2
|
+
export declare function parseCronTickState(raw: string | null): CronTickStateFile;
|
|
3
|
+
export declare function loadCronTickState(statePath: string): Promise<CronTickStateFile>;
|
|
4
|
+
export declare function saveCronTickState(statePath: string, state: CronTickStateFile): Promise<void>;
|
|
5
|
+
export declare function getOrCreateJobState(state: CronTickStateFile, providerScheduleId: string): CronTickJobState;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { KynverCronEnv } from "./cron-env.js";
|
|
2
|
+
export interface CronTickResult {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
skipped?: string;
|
|
5
|
+
scanned: number;
|
|
6
|
+
due: number;
|
|
7
|
+
fired: number;
|
|
8
|
+
skippedJobs: number;
|
|
9
|
+
errors: number;
|
|
10
|
+
lockHeld?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function runKynverCronTick(opts?: {
|
|
13
|
+
env?: KynverCronEnv;
|
|
14
|
+
now?: Date;
|
|
15
|
+
fetchFn?: typeof fetch;
|
|
16
|
+
agentOsIdFilter?: string | null;
|
|
17
|
+
}): Promise<CronTickResult>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** Minimal mirror of server `KynverCronRegisteredJob` / `SchedulerJobSpec` for the local store. */
|
|
2
|
+
export interface CronJobTarget {
|
|
3
|
+
agentOsId: string;
|
|
4
|
+
taskId?: string | null;
|
|
5
|
+
planId?: string | null;
|
|
6
|
+
planVersionId?: string | null;
|
|
7
|
+
goalId?: string | null;
|
|
8
|
+
projectId?: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface CronJobSpec {
|
|
11
|
+
kind: string;
|
|
12
|
+
scheduleKind: "cron" | "runAt";
|
|
13
|
+
cron?: string | null;
|
|
14
|
+
runAt?: string | null;
|
|
15
|
+
callbackPath: string;
|
|
16
|
+
payload?: Record<string, unknown> | null;
|
|
17
|
+
target: CronJobTarget;
|
|
18
|
+
description?: string | null;
|
|
19
|
+
dedupeKey?: string | null;
|
|
20
|
+
}
|
|
21
|
+
export interface CronRegisteredJob {
|
|
22
|
+
providerScheduleId: string;
|
|
23
|
+
spec: CronJobSpec;
|
|
24
|
+
registeredAt: string;
|
|
25
|
+
paused: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface CronTickJobState {
|
|
28
|
+
providerScheduleId: string;
|
|
29
|
+
nextFireAt: string | null;
|
|
30
|
+
lastFiredAt: string | null;
|
|
31
|
+
lastAttemptAt: string | null;
|
|
32
|
+
consecutiveFailures: number;
|
|
33
|
+
completedAt: string | null;
|
|
34
|
+
inflightUntil: string | null;
|
|
35
|
+
}
|
|
36
|
+
export interface CronTickStateFile {
|
|
37
|
+
version: 1;
|
|
38
|
+
jobs: Record<string, CronTickJobState>;
|
|
39
|
+
}
|
|
40
|
+
export interface CronFireResult {
|
|
41
|
+
ok: boolean;
|
|
42
|
+
status: number;
|
|
43
|
+
body: unknown;
|
|
44
|
+
}
|
package/dist/dispatch.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface HarnessWorkerDispatchContext {
|
|
|
6
6
|
instructionPolicyFingerprint: string | null;
|
|
7
7
|
instructionPolicyEvidence: InstructionPolicyEvidenceSnapshot | null;
|
|
8
8
|
memoryQualityCapture: HarnessMemoryQualityCaptureSnapshot | null;
|
|
9
|
+
memoryQualityPromptMarkdown: string | null;
|
|
9
10
|
personaMarkdown: string | null;
|
|
10
11
|
personaSlug: string | null;
|
|
11
12
|
personaEvidence: PersonaContextEvidenceSnapshot | null;
|
|
@@ -2,8 +2,10 @@ import type { DoctorCheck } from "./doctor.types.js";
|
|
|
2
2
|
export type DeploymentSchedulerProvider = "qstash" | "kynver-cron" | "openclaw-cron";
|
|
3
3
|
export interface RuntimeTakeoverSchedulerEnv {
|
|
4
4
|
kynverSchedulerProvider?: string;
|
|
5
|
-
/** Local durable
|
|
5
|
+
/** Local durable cron store (`KYNVER_CRON_STORE_PATH` / legacy `OPENCLAW_CRON_STORE_PATH`). */
|
|
6
6
|
openclawCronStorePath?: boolean;
|
|
7
|
+
/** `kynver daemon` runs the Kynver Cron tick loop (primary connected-box scheduler). */
|
|
8
|
+
kynverCronDaemonPrimary?: boolean;
|
|
7
9
|
/** True when this process has QStash credentials (typical Kynver server deploy). */
|
|
8
10
|
qstashTokenPresent?: boolean;
|
|
9
11
|
/** Explicit hosted-deploy marker (`KYNVER_HOSTED_DEPLOYMENT=1|true|yes`). */
|
|
@@ -26,8 +26,9 @@ export interface RuntimeTakeoverProbes {
|
|
|
26
26
|
kynverHarnessRoot?: string;
|
|
27
27
|
opusHarnessRoot?: string;
|
|
28
28
|
kynverSchedulerProvider?: string;
|
|
29
|
-
/** Local durable
|
|
29
|
+
/** Local durable cron store (`KYNVER_CRON_STORE_PATH` / legacy alias). */
|
|
30
30
|
openclawCronStorePath?: boolean;
|
|
31
|
+
kynverCronDaemonPrimary?: boolean;
|
|
31
32
|
qstashTokenPresent?: boolean;
|
|
32
33
|
kynverHostedDeployment?: boolean;
|
|
33
34
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export { assessOrphanWorktreeSafety } from "./cleanup-orphan-safety.js";
|
|
|
45
45
|
export { isGeneratedHarnessPath, HARNESS_BUILD_CACHE_RELATIVE_PATHS } from "./cleanup-build-cache-paths.js";
|
|
46
46
|
export { usage, main } from "./cli.js";
|
|
47
47
|
export { reconcileRunsCli, reconcileStaleWorkers, type ReconcileStaleWorkersResult, type StaleWorkerReconcileOutcome } from "./stale-reconcile.js";
|
|
48
|
+
export { repairMissingRunMetadata, collectFilesystemLiveRunKeys, isHarnessRunMetadataPath, runDirHasActiveRetentionSignals, workerDirHasActiveRetentionSignals, RUN_METADATA_ACTIVE_SIGNAL_MS, type RunMetadataRetentionOutcome, type RunMetadataRetentionResult, } from "./run-metadata-retention.js";
|
|
48
49
|
export { reconcileWorkerMetadata, reconcileWorkerMetadataCli, type WorkerMetadataReconcileOutcome, type WorkerMetadataReconcileResult, } from "./worker-metadata-reconcile.js";
|
|
49
50
|
export { canonicalWorkerDir, hasNestedRunsSegment, repairNestedRunsPath, resolveWorkerJsonPath, } from "./worker-metadata-paths.js";
|
|
50
51
|
export { runDaemon } from "./daemon.js";
|