@kynver-app/runtime 0.1.90 → 0.1.91
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/box-resource-snapshot-shared.d.ts +1 -0
- package/dist/cleanup-active-worktrees.d.ts +1 -1
- package/dist/cleanup-dependency-scan.d.ts +1 -0
- package/dist/cleanup-dir-size.d.ts +2 -1
- package/dist/cleanup-guards.d.ts +5 -0
- package/dist/cleanup-index-status.d.ts +9 -0
- package/dist/cleanup-progress.d.ts +2 -0
- package/dist/cleanup-retention-config.d.ts +4 -0
- package/dist/cleanup-run-liveness.d.ts +6 -2
- package/dist/cleanup-run-terminal-cache.d.ts +6 -0
- package/dist/cleanup-summary.d.ts +29 -0
- package/dist/cleanup-types.d.ts +7 -1
- package/dist/cleanup-worktree-index.d.ts +3 -2
- package/dist/cli.js +2276 -793
- package/dist/cli.js.map +4 -4
- package/dist/completion-ack.d.ts +8 -0
- package/dist/completion-response.d.ts +1 -1
- package/dist/db-credential-env-paths.d.ts +13 -0
- package/dist/db-credential-resolver.d.ts +2 -1
- package/dist/default-repo-cli.d.ts +20 -0
- package/dist/dispatch-claim-release.d.ts +17 -0
- package/dist/dispatch-lane-normalization.d.ts +14 -0
- package/dist/dispatch.d.ts +4 -1
- package/dist/doctor/doctor.types.d.ts +2 -0
- package/dist/doctor/runtime-takeover-cli.d.ts +1 -1
- package/dist/doctor/runtime-takeover-scheduler.d.ts +3 -1
- package/dist/heartbeat-final-result.d.ts +5 -0
- package/dist/heartbeat.d.ts +3 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +2634 -971
- package/dist/index.js.map +4 -4
- package/dist/landing-contract-pr-classify.d.ts +4 -0
- package/dist/memory-cost-package-version-guard-enforce.d.ts +10 -0
- package/dist/memory-cost-package-version-guard.d.ts +49 -0
- package/dist/orchestration-enforcement/config.d.ts +5 -0
- package/dist/orchestration-enforcement/evaluator.d.ts +6 -0
- package/dist/orchestration-enforcement/idempotency.d.ts +8 -0
- package/dist/orchestration-enforcement/index.d.ts +4 -0
- package/dist/orchestration-enforcement/types.d.ts +24 -0
- package/dist/prompt.d.ts +2 -0
- package/dist/repo-search.d.ts +40 -0
- package/dist/run-worker-index.d.ts +10 -0
- package/dist/runner-identity.d.ts +2 -0
- package/dist/shell-command-outcome.d.ts +1 -1
- package/dist/status.d.ts +13 -0
- package/dist/supervisor.d.ts +3 -1
- package/dist/validate.d.ts +10 -0
- package/dist/worker-final-result-embed.d.ts +1 -0
- package/dist/worker-ops.d.ts +22 -1
- package/dist/worker-persona-catalog.d.ts +24 -0
- package/dist/worker-persona-catalog.js +138 -0
- package/dist/worker-persona-catalog.js.map +7 -0
- package/dist/workspace-runtime-config.d.ts +2 -0
- package/package.json +1 -1
package/dist/completion-ack.d.ts
CHANGED
|
@@ -6,5 +6,13 @@ export interface CompletionAckFields {
|
|
|
6
6
|
completionResponse?: unknown;
|
|
7
7
|
}
|
|
8
8
|
export declare function hasCompletionAck(worker: HarnessWorkerRecord): boolean;
|
|
9
|
+
/** True when AgentOS acknowledged completion and the board advanced (or was already terminal). */
|
|
10
|
+
export declare function hasSuccessfulCompletionAck(worker: HarnessWorkerRecord): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Finished workers with a prior completion POST that did not advance the board
|
|
13
|
+
* (rejected route, structural blocker) must be eligible for replay so fresher
|
|
14
|
+
* `finalResult` evidence can reach AgentOS.
|
|
15
|
+
*/
|
|
16
|
+
export declare function needsCompletionReplay(worker: HarnessWorkerRecord): boolean;
|
|
9
17
|
export declare function persistCompletionAck(worker: HarnessWorkerRecord, runId: string, fields: CompletionAckFields): void;
|
|
10
18
|
export declare function clearCompletionAck(worker: HarnessWorkerRecord, runId: string): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Parsed outcome from POST /harness/completion (AgentOS handleHarnessWorkerCompletion). */
|
|
2
|
-
export type HarnessCompletionRouteOutcome = "review_scheduled" | "review_already_scheduled" | "needs_attention" | "mirror_only" | "task_not_found" | "task_not_harness" | "skipped_terminal_task";
|
|
2
|
+
export type HarnessCompletionRouteOutcome = "review_scheduled" | "review_already_scheduled" | "needs_attention" | "mirror_only" | "task_not_found" | "task_not_harness" | "skipped_terminal_task" | "closed" | "dispatched" | "dispatch_already_done" | "blocked" | "reviewer_no_parent" | "landing_no_parent";
|
|
3
3
|
export interface HarnessCompletionResponseSummary {
|
|
4
4
|
routeOutcome: HarnessCompletionRouteOutcome | null;
|
|
5
5
|
/** True when the board task should have moved into review (or already was). */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Expand a leading `~/` for filesystem use. */
|
|
2
|
+
export declare function expandHomePath(filePath: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* Candidate `.env` paths for selective production DB key reads.
|
|
5
|
+
* Order: explicit `KYNVER_ENV_FILE` → walk up from `cwd` → `~/.kynver/.env` →
|
|
6
|
+
* `defaultRepo` from `~/.kynver/config.json`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function discoverProductionDbEnvFilePaths(options?: {
|
|
9
|
+
cwd?: string;
|
|
10
|
+
env?: NodeJS.ProcessEnv;
|
|
11
|
+
/** Injectable for tests; defaults to `os.homedir()`. */
|
|
12
|
+
homeDir?: string;
|
|
13
|
+
}): string[];
|
|
@@ -29,7 +29,8 @@ export interface ResolveProductionDatabaseOptions {
|
|
|
29
29
|
export declare function readProductionDbKeysFromEnvFile(envPath: string): Partial<Record<(typeof ENV_FILE_KEYS)[number], string>>;
|
|
30
30
|
/**
|
|
31
31
|
* Resolve a production Prisma `DATABASE_URL` at CLI execution time.
|
|
32
|
-
* Precedence: Neon CLI → explicit process env → selective `.env` keys
|
|
32
|
+
* Precedence: Neon CLI → explicit process env → selective `.env` keys
|
|
33
|
+
* (`KYNVER_ENV_FILE`, walk-up from cwd, `~/.kynver/.env`, `defaultRepo/.env`).
|
|
33
34
|
*/
|
|
34
35
|
export declare function resolveProductionDatabaseUrl(options?: ResolveProductionDatabaseOptions): ResolveProductionDatabaseResult;
|
|
35
36
|
/** Set `process.env.DATABASE_URL` from resolver; logs source + host hint to stderr (no secrets). */
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { presentUserConfig } from "./config.js";
|
|
2
|
+
import { formatResolvedDefaultRepo, type ResolvedDefaultRepo } from "./default-repo.js";
|
|
3
|
+
export interface EnsureDefaultRepoResult {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
remediated: boolean;
|
|
6
|
+
alreadyPersisted: boolean;
|
|
7
|
+
configPath: string;
|
|
8
|
+
resolved: ReturnType<typeof formatResolvedDefaultRepo> | null;
|
|
9
|
+
config?: ReturnType<typeof presentUserConfig>;
|
|
10
|
+
reason?: string;
|
|
11
|
+
remediation?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function ensureDefaultRepo(opts?: {
|
|
14
|
+
cwd?: string;
|
|
15
|
+
}): EnsureDefaultRepoResult;
|
|
16
|
+
export declare function runEnsureDefaultRepoCli(json?: boolean): void;
|
|
17
|
+
export declare function summarizeResolvedDefaultRepo(resolved: ResolvedDefaultRepo | null): {
|
|
18
|
+
status: "pass" | "warn";
|
|
19
|
+
remediation?: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ReleaseDispatchClaimInput {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
secret: string;
|
|
4
|
+
agentOsId: string;
|
|
5
|
+
taskId: string;
|
|
6
|
+
leaseOwner: string;
|
|
7
|
+
failureDetail?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ReleaseDispatchClaimOutcome {
|
|
10
|
+
released: boolean;
|
|
11
|
+
releaseResponse: unknown;
|
|
12
|
+
httpOk: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Hand a dispatch-next lease back to the board when local worker spawn did not start.
|
|
16
|
+
*/
|
|
17
|
+
export declare function releaseDispatchClaimAfterSpawnFailure(input: ReleaseDispatchClaimInput): Promise<ReleaseDispatchClaimOutcome>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Runtime mirror of server dispatch lane normalization (keep in sync). */
|
|
2
|
+
export type DispatchNextLane = "implementation" | "review" | "landing" | "any";
|
|
3
|
+
export type DispatchLaneTaskHints = {
|
|
4
|
+
title?: string | null;
|
|
5
|
+
executorRef?: string | null;
|
|
6
|
+
personaSlug?: string | null;
|
|
7
|
+
status?: string | null;
|
|
8
|
+
roleLane?: string | null;
|
|
9
|
+
};
|
|
10
|
+
export declare function roleLaneToDispatchLane(roleLane: string | null | undefined): DispatchNextLane | null;
|
|
11
|
+
export declare function normalizeDispatchNextLaneFilter(raw: string | null | undefined): DispatchNextLane | undefined;
|
|
12
|
+
export declare function inferRoleLaneFromTaskHints(task: DispatchLaneTaskHints): string | null;
|
|
13
|
+
export declare function inferTaskDispatchLane(task: DispatchLaneTaskHints): DispatchNextLane;
|
|
14
|
+
export declare function resolveDispatchNextLaneFilter(raw: string | null | undefined): DispatchNextLane;
|
package/dist/dispatch.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { runDirectory } from "./run-store.js";
|
|
2
|
-
import type { HarnessMemoryQualityCaptureSnapshot, InstructionPolicyEvidenceSnapshot, PersonaContextEvidenceSnapshot } from "./status.js";
|
|
2
|
+
import type { ContextEnvelopeEvidenceSnapshot, HarnessMemoryQualityCaptureSnapshot, InstructionPolicyEvidenceSnapshot, PersonaContextEvidenceSnapshot } from "./status.js";
|
|
3
3
|
export declare const DEFAULT_DISPATCH_LEASE_MS: number;
|
|
4
4
|
export interface HarnessWorkerDispatchContext {
|
|
5
5
|
instructionPolicyMarkdown: string | null;
|
|
@@ -11,6 +11,9 @@ export interface HarnessWorkerDispatchContext {
|
|
|
11
11
|
personaSlug: string | null;
|
|
12
12
|
personaEvidence: PersonaContextEvidenceSnapshot | null;
|
|
13
13
|
personaInjectionReady: boolean;
|
|
14
|
+
contextEnvelopeMarkdown: string | null;
|
|
15
|
+
contextEnvelopeEvidence: ContextEnvelopeEvidenceSnapshot | null;
|
|
16
|
+
contextEnvelopeReady: boolean;
|
|
14
17
|
}
|
|
15
18
|
export declare function readHarnessWorkerContext(decision: Record<string, unknown>): HarnessWorkerDispatchContext | null;
|
|
16
19
|
export declare function buildDispatchTaskText(task: Record<string, unknown>, agentOsId: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function runRuntimeTakeoverDoctorCli(): void;
|
|
1
|
+
export declare function runRuntimeTakeoverDoctorCli(args?: Record<string, string | boolean>): void;
|
|
@@ -22,6 +22,8 @@ export interface RuntimeTakeoverSchedulerContext {
|
|
|
22
22
|
* Scheduler readiness for runtime takeover.
|
|
23
23
|
*
|
|
24
24
|
* Runner hosts drive dispatch via `kynver daemon` → `pipeline-tick` → `operator/tick`
|
|
25
|
-
* and must not depend on OpenClaw cron. Server/hosted deploys should resolve to QStash
|
|
25
|
+
* and must not depend on OpenClaw cron. Server/hosted deploys should resolve to QStash
|
|
26
|
+
* when configured; otherwise the Kynver-owned `kynver-cron` provider is the fallback
|
|
27
|
+
* (not the legacy OpenClaw adapter).
|
|
26
28
|
*/
|
|
27
29
|
export declare function assessRuntimeTakeoverScheduler(env: RuntimeTakeoverSchedulerEnv, ctx: RuntimeTakeoverSchedulerContext): DoctorCheck;
|
package/dist/heartbeat.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export interface ParsedHeartbeat {
|
|
|
4
4
|
lastHeartbeatAt: string | null;
|
|
5
5
|
lastHeartbeatPhase: string | null;
|
|
6
6
|
lastHeartbeatSummary: string | null;
|
|
7
|
+
/** Structured finalResult from the terminal `phase: complete` heartbeat line. */
|
|
8
|
+
terminalFinalResult: unknown;
|
|
7
9
|
heartbeatBlocker: string | null;
|
|
8
10
|
timestampAnomalies: ParsedHeartbeatTimestampAnomaly[];
|
|
9
11
|
lastBoxResourceSnapshot: RuntimeBoxResourceSnapshot | null;
|
|
@@ -21,5 +23,5 @@ export declare function isTerminalHeartbeatPhase(phase: string | null | undefine
|
|
|
21
23
|
* treat the worker's completion heartbeat as a synthetic final result so lifecycle
|
|
22
24
|
* sync, completion replay, and resource gates advance.
|
|
23
25
|
*/
|
|
24
|
-
export declare function terminalFinalResultFromHeartbeat(heartbeat: ParsedHeartbeat):
|
|
26
|
+
export declare function terminalFinalResultFromHeartbeat(heartbeat: ParsedHeartbeat): unknown;
|
|
25
27
|
export declare function parseHeartbeat(file: string): ParsedHeartbeat;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export { PACKAGE_VERSION } from "./package-version.js";
|
|
2
|
+
export { MEMORY_COST_PACKAGE_MIN_VERSIONS, MEMORY_COST_MANAGED_PACKAGES, MemoryCostPackageVersionGuardError, assertMemoryCostPackageVersionGuard, compareSemver, evaluateMemoryCostPackageVersionGuard, formatMemoryCostPackageGuardError, probeRepoPackageVersions, semverAtLeast, type MemoryCostManagedPackageName, type MemoryCostPackageGuardResult, type MemoryCostPackageGuardRow, } from "./memory-cost-package-version-guard.js";
|
|
3
|
+
export { buildMemoryCostPackageGuardInput, enforceMemoryCostPackageGuardAtStartup, evaluateMemoryCostPackageGuardAtStartup, shouldEnforceMemoryCostPackageGuardCli, } from "./memory-cost-package-version-guard-enforce.js";
|
|
2
4
|
export { buildDispatchTaskText, dispatchRun, DEFAULT_DISPATCH_LEASE_MS } from "./dispatch.js";
|
|
3
5
|
export { observeRunnerDiskGate } from "./disk-gate.js";
|
|
4
6
|
export { isWslHost, observeWslHostDisk, summarizeWslRecoverySteps, DEFAULT_WSL_HOST_MOUNT, DEFAULT_WSL_HOST_WARN_FREE_BYTES, DEFAULT_WSL_HOST_CRITICAL_FREE_BYTES, type WslHostDiskShape, } from "./wsl-host.js";
|
|
5
7
|
export { postJson, type DispatchNextDiskGateShape, type DispatchNextWslHostShape, } from "./callbacks.js";
|
|
6
8
|
export { parseClaudeStream, parseHarnessStream, summarizeEvent, summarizeShellToolCallEvent, } from "./stream.js";
|
|
7
9
|
export { classifyNpmAuditOutcome, classifyShellCommandOutcome, summarizeNpmAuditReport, type NpmAuditSummary, type ShellCommandOutcome, type ShellCommandOutcomeKind, } from "./shell-command-outcome.js";
|
|
10
|
+
export { classifyRepoSearchMeta, diagnoseRepoSearchFailure, extractSearchMeta, extractSearchMetaFromToolLine, formatRepoSearchGuidance, isRgExcludeScopeTarget, isSingleFileSearchTarget, metaToNormalizedRgCommand, normalizeRepoSearchCommand, normalizeRgArgv, type RepoSearchContext, type RepoSearchKind, } from "./repo-search.js";
|
|
8
11
|
export { parseHeartbeat, isTerminalHeartbeatPhase, terminalFinalResultFromHeartbeat, } from "./heartbeat.js";
|
|
9
12
|
export { buildBoxResourceSnapshotFromGate, formatHeartbeatLine, type RuntimeBoxResourceSnapshot, type RuntimeBoxResourceSnapshotPrEvidence, type HeartbeatLineInput, } from "./box-resource-snapshot.js";
|
|
10
13
|
export { resolveBoxKindFromEnv, defaultBoxId } from "./box-resource-snapshot-shared.js";
|
|
@@ -14,6 +17,7 @@ export { isEngagementRequiredSkip } from "./fortress-engagement-gate.js";
|
|
|
14
17
|
export { assessWorkerLandingContract, landingContractAttentionReason, type WorkerLandingContract, type WorkerLandingContractVerdict, type TargetPrReconciliation, } from "./landing-contract-gate.js";
|
|
15
18
|
export { assessExitedWorkerSalvage, type ExitedSalvageAssessment, type ExitedSalvageKind, } from "./exited-salvage.js";
|
|
16
19
|
export { buildPrompt } from "./prompt.js";
|
|
20
|
+
export { WORKER_PERSONA_CATALOG, getWorkerPersonaCatalogEntry, getPersonaDispatchLane, getPersonaDefaultRoleLane, isKnownWorkerPersonaSlug, workerPersonaReviewSlugs, workerPersonaLandingSlugs, type WorkerPersonaCatalogEntry, type WorkerPersonaCatalogSlug, type WorkerPersonaDispatchLane, type WorkerPersonaDefaultRoleLane, } from "./worker-persona-catalog.js";
|
|
17
21
|
export { assessPrHandoffRequirement, ensurePrReadyHandoff, extractPrUrlFromText, } from "./pr-handoff/index.js";
|
|
18
22
|
export { normalizeCursorModelAlias, preflightClaudeModel, preflightCodexModel, preflightCursorModel, } from "./providers/model-preflight.js";
|
|
19
23
|
export { CODEX_DEFAULT_MODEL, codexProvider, buildCodexExecArgv } from "./providers/codex.js";
|
|
@@ -21,12 +25,14 @@ export { HERMES_OPENAI_CODEX_DEFAULT_MODEL, hermesCodexProvider, buildHermesOpen
|
|
|
21
25
|
export { classifyOpenAiCodexError, formatCronJobDeliveryFailure, formatOpenAiCodexFailureNotice, redactProviderErrorText, resolveOpenAiCodexRetryBudget, TRANSIENT_OPENAI_CODEX_ERROR_CLASSES, OPENAI_CODEX_PROVIDER, type ClassifiedOpenAiCodexError, type CodexFailureNoticeInput, type OpenAiCodexErrorClass, } from "./providers/openai-codex-resilience.js";
|
|
22
26
|
export * from "./cron/hermes-provider-notice.js";
|
|
23
27
|
export { buildOrchestrationProviderInventory, classifyOrchestrationRisk, compareProviderCandidates, getOrchestrationProviderCapability, listOrchestrationProviderCapabilities, probeClaudeOAuthBinding, probeCodexOAuthBinding, probeCursorOAuthBinding, probeHermesCliAdapter, probeHermesOpenAiCodexBinding, probeOrchestrationProviderBinding, providerCapableForRisk, resolveCodexOrchestrationAdapter, resolveOrchestrationRouting, selectCheapestCapableProvider, sanitizeOrchestrationAudit, orchestrationAuditForWorkerJson, type CodexOrchestrationAdapterStatus, type CodexOrchestrationPath, type HermesCliAdapterStatus, type HermesOpenAiCodexBindingStatus, type OrchestrationAuthSource, type OrchestrationCloudApiCredits, type OrchestrationCostTier, type OrchestrationProviderBindingStatus, type OrchestrationProviderCapability, type OrchestrationProviderId, type OrchestrationProviderInventory, type OrchestrationRiskClass, type OrchestrationRoutingAudit, type OrchestrationRoutingDecision, } from "./orchestration-providers/index.js";
|
|
28
|
+
export { ORCHESTRATION_POLICY_MODES, ORCHESTRATION_ACTION_KINDS, ORCHESTRATION_POLICY_DECISIONS, resolveOrchestrationPolicyMode, isOrchestrationEnforceTasksEnabled, buildForegroundHarnessIdempotencyKey, evaluateOrchestrationPolicy, type OrchestrationPolicyMode, type OrchestrationActionKind, type OrchestrationPolicyDecision, type OrchestrationPolicyEvaluateInput, type OrchestrationPolicyEvaluateResult, } from "./orchestration-enforcement/index.js";
|
|
24
29
|
export { DEFAULT_WORKER_PROVIDER, enforceCursorWorkerProvider, isClaudeFamilyProvider, preferCursorExecutor, resolveConfiguredWorkerProvider, taskAllowsClaudeWorker, type EnforceCursorWorkerProviderInput, } from "./worker-provider-policy.js";
|
|
25
30
|
export { redactHarness } from "./redact.js";
|
|
26
31
|
export { scrubWorkerEnv, scrubClaudeEnv, auditWorkerEnv, listForbiddenWorkerEnvKeys, isForbiddenWorkerEnvKey, FORBIDDEN_WORKER_ENV_KEYS, type WorkerEnvAudit, } from "./worker-env.js";
|
|
32
|
+
export { discoverProductionDbEnvFilePaths, expandHomePath } from "./db-credential-env-paths.js";
|
|
27
33
|
export { applyProductionDatabaseToProcess, readProductionDbKeysFromEnvFile, resolveProductionDatabaseUrl, type DbCredentialResolution, type DbCredentialFailure, type DbCredentialSource, type ResolveProductionDatabaseResult, type ResolveProductionDatabaseOptions, } from "./db-credential-resolver.js";
|
|
28
34
|
export { safeDatabaseUrlHint } from "./db-url-hint.js";
|
|
29
|
-
export { validateRunId, validateWorkerName, validateRepo, validateOwnedPaths, validateTailLines, } from "./validate.js";
|
|
35
|
+
export { validateRunId, validateWorkerName, validateRepo, validateOwnedPaths, validateTailLines, resolveWorkerTargetArgs, resolveRunTargetArg, } from "./validate.js";
|
|
30
36
|
export { spawnWorkerProcess, startWorker } from "./supervisor.js";
|
|
31
37
|
export { createRun, listRuns } from "./worktree.js";
|
|
32
38
|
export { buildRunListRows, listRunsCli, type RunListFinalizeBlockedReason, type RunListRow, type RunListWorkerEvidence, } from "./run-list.js";
|