@kynver-app/runtime 0.1.118 → 0.1.119
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/chat/anthropic-credentials.d.ts +9 -0
- package/dist/chat/anthropic-stream.d.ts +43 -0
- package/dist/chat/chat-claim-loop.d.ts +25 -0
- package/dist/chat/delta-batcher.d.ts +13 -0
- package/dist/cli.js +8143 -6989
- package/dist/cli.js.map +4 -4
- package/dist/config.d.ts +2 -0
- package/dist/cron/cron-env-file.d.ts +15 -0
- package/dist/cron/cron-id.d.ts +3 -0
- package/dist/cron/cron-install-api.d.ts +27 -0
- package/dist/cron/cron-install-cli.d.ts +2 -0
- package/dist/cron/cron-install-plan.d.ts +32 -0
- package/dist/cron/cron-install-secrets.d.ts +6 -0
- package/dist/cron/cron-install-systemd.d.ts +18 -0
- package/dist/cron/cron-install-verify.d.ts +15 -0
- package/dist/cron/cron-install.d.ts +51 -0
- package/dist/cron/cron-store.d.ts +5 -0
- package/dist/index.js +1349 -197
- package/dist/index.js.map +4 -4
- package/dist/server/cleanup.js.map +2 -2
- package/dist/server/default-repo.js.map +2 -2
- package/dist/server/memory-cost-enforce.js.map +1 -1
- package/dist/server/monitor.js.map +2 -2
- package/dist/server/worker-policy.js.map +2 -2
- package/dist/start.d.ts +7 -0
- package/dist/worktree.d.ts +8 -1
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export interface KynverUserConfig {
|
|
|
12
12
|
* (set on user runners after Vercel env cutover — scheduling is deployment-owned).
|
|
13
13
|
*/
|
|
14
14
|
deploymentSchedulerProvider?: "qstash" | "kynver-cron" | "openclaw-cron";
|
|
15
|
+
/** Default harness run for `kynver daemon` / systemd user unit (set by `kynver cron install`). */
|
|
16
|
+
defaultDaemonRunId?: string;
|
|
15
17
|
/** Physical box pool for capacity snapshots (`forge` | `ghost`). Set via `kynver setup --box-kind`. */
|
|
16
18
|
boxKind?: "ghost" | "forge";
|
|
17
19
|
/** Max concurrent workers on this machine. Omit to auto-size from RAM. */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const DEFAULT_KYNVER_ENV_FILE: string;
|
|
2
|
+
export interface EnvFileMergeResult {
|
|
3
|
+
path: string;
|
|
4
|
+
changed: boolean;
|
|
5
|
+
keysWritten: string[];
|
|
6
|
+
keysRemoved: string[];
|
|
7
|
+
}
|
|
8
|
+
/** Parse `KEY=VALUE` lines; skips blanks and `#` comments. */
|
|
9
|
+
export declare function parseEnvFile(content: string): Map<string, string>;
|
|
10
|
+
export declare function serializeEnvFile(values: Map<string, string>, header?: string): string;
|
|
11
|
+
export declare function readEnvFile(filePath?: string): Map<string, string>;
|
|
12
|
+
export declare function mergeEnvFile(updates: Record<string, string | undefined>, options?: {
|
|
13
|
+
filePath?: string;
|
|
14
|
+
removeKeys?: string[];
|
|
15
|
+
}): EnvFileMergeResult;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CronJobSpec } from "./cron-types.js";
|
|
2
|
+
export interface SchedulerJobRow {
|
|
3
|
+
id: string;
|
|
4
|
+
kind: string;
|
|
5
|
+
provider: string;
|
|
6
|
+
status: string;
|
|
7
|
+
cron?: string | null;
|
|
8
|
+
dedupeKey?: string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function listSchedulerJobs(baseUrl: string, agentOsId: string, apiKey: string, query?: Record<string, string>): Promise<SchedulerJobRow[]>;
|
|
11
|
+
export declare function ensureWatchdogScheduleRemote(baseUrl: string, agentOsId: string, apiKey: string, cron?: string, options?: {
|
|
12
|
+
requireProvider?: "kynver-cron";
|
|
13
|
+
}): Promise<{
|
|
14
|
+
job: SchedulerJobRow;
|
|
15
|
+
route: string;
|
|
16
|
+
dedupeKey: string;
|
|
17
|
+
requestedCron: string;
|
|
18
|
+
selectedProvider: string | null;
|
|
19
|
+
}>;
|
|
20
|
+
export declare function cancelSchedulerJob(baseUrl: string, agentOsId: string, jobId: string, apiKey: string): Promise<void>;
|
|
21
|
+
export declare function buildWatchdogCronSpec(agentOsId: string, cron: string, dedupeKey?: string): CronJobSpec;
|
|
22
|
+
export declare function findQstashWatchdogLeftovers(jobs: SchedulerJobRow[]): SchedulerJobRow[];
|
|
23
|
+
export declare function findKynverCronWatchdog(jobs: SchedulerJobRow[]): SchedulerJobRow | undefined;
|
|
24
|
+
export declare function canCancelQstashWatchdogLeftovers(jobs: SchedulerJobRow[]): {
|
|
25
|
+
allowed: boolean;
|
|
26
|
+
reason?: string;
|
|
27
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { KynverUserConfig } from "../config.js";
|
|
2
|
+
export declare const WATCHDOG_DEDUPE_KEY = "watchdog:board-sweep";
|
|
3
|
+
export declare const DEFAULT_WATCHDOG_CRON = "*/5 * * * *";
|
|
4
|
+
export declare const VERCEL_KYNVER_CRON_CUTOVER_STEPS: readonly ["Set KYNVER_SCHEDULER_PROVIDER=kynver-cron on the hosted Kynver deployment (Vercel).", "Set KYNVER_CRON_SECRET to the same value written to ~/.kynver/.env by this installer.", "Unset KYNVER_CRON_STORE_PATH on Vercel — the connected box owns the local store.", "Keep QSTASH_TOKEN only if other non-watchdog schedules still use QStash (analyst/market jobs)."];
|
|
5
|
+
export interface CronInstallPlanInput {
|
|
6
|
+
config: KynverUserConfig;
|
|
7
|
+
apiBaseUrl: string;
|
|
8
|
+
agentOsId: string;
|
|
9
|
+
cronSecret: string;
|
|
10
|
+
storePath?: string;
|
|
11
|
+
envFilePath?: string;
|
|
12
|
+
defaultDaemonRunId?: string;
|
|
13
|
+
installSystemd?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface CronInstallPlan {
|
|
16
|
+
envFilePath: string;
|
|
17
|
+
configPath: string;
|
|
18
|
+
storePath: string;
|
|
19
|
+
envUpdates: Record<string, string>;
|
|
20
|
+
envRemovals: string[];
|
|
21
|
+
configUpdates: Partial<KynverUserConfig>;
|
|
22
|
+
deploymentSteps: readonly string[];
|
|
23
|
+
prerequisites: string[];
|
|
24
|
+
systemdSupported: boolean;
|
|
25
|
+
watchdogSpec: {
|
|
26
|
+
kind: "watchdog";
|
|
27
|
+
cron: string;
|
|
28
|
+
dedupeKey: string;
|
|
29
|
+
callbackPath: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export declare function buildCronInstallPlan(input: CronInstallPlanInput): CronInstallPlan;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const KYNVER_CRON_DAEMON_UNIT = "kynver-cron-daemon.service";
|
|
2
|
+
export interface SystemdDaemonServiceInput {
|
|
3
|
+
envFilePath: string;
|
|
4
|
+
agentOsId: string;
|
|
5
|
+
runId: string;
|
|
6
|
+
kynverBin?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function defaultSystemdUserUnitDir(): string;
|
|
9
|
+
export declare function renderKynverCronDaemonService(input: SystemdDaemonServiceInput): string;
|
|
10
|
+
export interface SystemdInstallResult {
|
|
11
|
+
supported: boolean;
|
|
12
|
+
unitPath: string | null;
|
|
13
|
+
written: boolean;
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
started: boolean;
|
|
16
|
+
note?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function installSystemdUserDaemon(input: SystemdDaemonServiceInput, execute: boolean): SystemdInstallResult;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { KynverUserConfig } from "../config.js";
|
|
2
|
+
export interface CronVerifyCheck {
|
|
3
|
+
id: string;
|
|
4
|
+
ok: boolean;
|
|
5
|
+
summary: string;
|
|
6
|
+
remediation?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CronInstallVerifyReport {
|
|
9
|
+
ok: boolean;
|
|
10
|
+
checks: CronVerifyCheck[];
|
|
11
|
+
}
|
|
12
|
+
export declare function verifyCronInstall(input: {
|
|
13
|
+
config: KynverUserConfig;
|
|
14
|
+
envFilePath?: string;
|
|
15
|
+
}): Promise<CronInstallVerifyReport>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { buildCronInstallPlan } from "./cron-install-plan.js";
|
|
2
|
+
import { installSystemdUserDaemon } from "./cron-install-systemd.js";
|
|
3
|
+
import { verifyCronInstall } from "./cron-install-verify.js";
|
|
4
|
+
export interface CronInstallOptions {
|
|
5
|
+
execute?: boolean;
|
|
6
|
+
json?: boolean;
|
|
7
|
+
installSystemd?: boolean;
|
|
8
|
+
confirmQstashRemoval?: boolean;
|
|
9
|
+
skipWatchdog?: boolean;
|
|
10
|
+
skipTestFire?: boolean;
|
|
11
|
+
agentOsId?: string;
|
|
12
|
+
apiBaseUrl?: string;
|
|
13
|
+
runId?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface CronInstallResult {
|
|
16
|
+
ok: boolean;
|
|
17
|
+
dryRun: boolean;
|
|
18
|
+
plan: ReturnType<typeof buildCronInstallPlan>;
|
|
19
|
+
secretGenerated: boolean;
|
|
20
|
+
envFile?: {
|
|
21
|
+
path: string;
|
|
22
|
+
changed: boolean;
|
|
23
|
+
keysWritten: string[];
|
|
24
|
+
};
|
|
25
|
+
configPath: string;
|
|
26
|
+
storeInitialized: boolean;
|
|
27
|
+
watchdog?: {
|
|
28
|
+
remoteJobId?: string;
|
|
29
|
+
provider?: string;
|
|
30
|
+
localProviderScheduleId?: string;
|
|
31
|
+
error?: string;
|
|
32
|
+
};
|
|
33
|
+
qstashWatchdog?: {
|
|
34
|
+
found: Array<{
|
|
35
|
+
id: string;
|
|
36
|
+
provider: string;
|
|
37
|
+
status: string;
|
|
38
|
+
}>;
|
|
39
|
+
removed: string[];
|
|
40
|
+
manualSteps: string[];
|
|
41
|
+
};
|
|
42
|
+
systemd?: ReturnType<typeof installSystemdUserDaemon>;
|
|
43
|
+
testFire?: {
|
|
44
|
+
fired: number;
|
|
45
|
+
errors: number;
|
|
46
|
+
skipped?: boolean;
|
|
47
|
+
};
|
|
48
|
+
verify?: Awaited<ReturnType<typeof verifyCronInstall>>;
|
|
49
|
+
blockers: string[];
|
|
50
|
+
}
|
|
51
|
+
export declare function runCronInstall(opts?: CronInstallOptions): Promise<CronInstallResult>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import type { CronRegisteredJob } from "./cron-types.js";
|
|
2
2
|
export declare function parseCronStore(raw: string | null): CronRegisteredJob[];
|
|
3
3
|
export declare function loadCronJobs(storePath?: string): Promise<CronRegisteredJob[]>;
|
|
4
|
+
/** Insert or replace a cron store entry (by `providerScheduleId`). */
|
|
5
|
+
export declare function saveCronJob(entry: CronRegisteredJob, storePath?: string): Promise<void>;
|
|
6
|
+
export declare function ensureCronStoreInitialized(storePath?: string): Promise<{
|
|
7
|
+
created: boolean;
|
|
8
|
+
}>;
|