@kynver-app/runtime 0.2.1 → 0.2.8
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 +107 -59
- package/dist/context-preview/chat-memory-preview.d.ts +33 -0
- package/dist/doctor/local-store-cli.d.ts +11 -0
- package/dist/doctor/local-store.d.ts +35 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +135 -82
- package/dist/instruction-bundle/contract.js +1 -1
- package/dist/local-run-store/dispatch-receipts.d.ts +70 -0
- package/dist/local-run-store/index.d.ts +10 -0
- package/dist/local-run-store/index.js +50 -0
- package/dist/local-run-store/local-run-store.d.ts +95 -0
- package/dist/local-run-store/remote-surface-flags.d.ts +15 -0
- package/dist/local-run-store/sqlite/sqlite-filesystem-policy.d.ts +16 -0
- package/dist/local-run-store/sqlite/sqlite-local-run-store.d.ts +62 -0
- package/dist/local-run-store/sqlite/sqlite-recovery.d.ts +14 -0
- package/dist/local-run-store/sqlite/sqlite-schema.d.ts +13 -0
- package/dist/local-run-store/store-lifecycle.d.ts +38 -0
- package/dist/local-run-store/surface-flags.d.ts +47 -0
- package/dist/local-run-store/tick-posture.d.ts +27 -0
- package/dist/plan-persist/index.d.ts +1 -1
- package/dist/plan-persist/outbox-durability.d.ts +31 -0
- package/dist/plan-persist/outbox-store.d.ts +18 -0
- package/dist/plan-persist/types.d.ts +4 -0
- package/dist/repo-search.d.ts +13 -0
- package/dist/server/cleanup.js +14 -14
- package/dist/server/default-repo.js +1 -1
- package/dist/server/heavy-verification.js +1 -1
- package/dist/server/memory-cost-enforce.js +2 -2
- package/dist/server/memory-cost.js +1 -1
- package/dist/server/monitor.js +7 -7
- package/dist/server/repo-search.d.ts +1 -1
- package/dist/server/repo-search.js +1 -1
- package/dist/server/worker-policy.js +1 -1
- package/dist/util.d.ts +11 -0
- package/package.json +8 -3
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Shared with app memory-retrieval.constants — single source for MCP + server preview blocks. */
|
|
2
|
+
export declare const MEMORY_LANE_PREVIEW_CHARS = 160;
|
|
3
|
+
export interface ContextPreviewMemoryItem {
|
|
4
|
+
slug: string;
|
|
5
|
+
lane?: string | null;
|
|
6
|
+
trust?: string | null;
|
|
7
|
+
contentPreview: string;
|
|
8
|
+
selectedBecause?: string | null;
|
|
9
|
+
expansionRoute?: string | null;
|
|
10
|
+
expandable?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface ContextPreviewBlockInput {
|
|
13
|
+
sectionTitle: string;
|
|
14
|
+
items: ContextPreviewMemoryItem[];
|
|
15
|
+
emptyFallback?: string;
|
|
16
|
+
previewCharsPerItem?: number;
|
|
17
|
+
}
|
|
18
|
+
/** Compact preview block — handles-first, never full memory bodies. */
|
|
19
|
+
export declare function formatContextPreviewMemoryBlock(input: ContextPreviewBlockInput): string;
|
|
20
|
+
export declare function chatMemoriesToPreviewItems(memories: {
|
|
21
|
+
content: string;
|
|
22
|
+
similarity?: number;
|
|
23
|
+
}[]): ContextPreviewMemoryItem[];
|
|
24
|
+
/** Legacy chat memory block — flag-invariant (PR1 baseline capture, diagnostics). */
|
|
25
|
+
export declare function buildLegacyChatMemorySection(memories: {
|
|
26
|
+
content: string;
|
|
27
|
+
similarity?: number;
|
|
28
|
+
}[]): string;
|
|
29
|
+
/** Shadow chat preview — ignores dark flag (diagnostics / MCP comparison). */
|
|
30
|
+
export declare function buildChatMemoryShadowPreview(memories: {
|
|
31
|
+
content: string;
|
|
32
|
+
similarity?: number;
|
|
33
|
+
}[]): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `kynver doctor local-store [--no-probe]` — report-only in D0: always exits
|
|
3
|
+
* 0 (no surface consults the store yet, so nothing may gate on this); the
|
|
4
|
+
* posture lives in the printed report.
|
|
5
|
+
*
|
|
6
|
+
* The default openability probe CREATES `local-run-store.sqlite` under the
|
|
7
|
+
* harness root on a host that never opened it (inert — nothing reads it with
|
|
8
|
+
* flags off). Pass `--no-probe` to report current lifecycle state without
|
|
9
|
+
* touching disk.
|
|
10
|
+
*/
|
|
11
|
+
export declare function runLocalStoreDoctorCli(args?: Record<string, unknown>): void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type LocalRunStoreLifecycleStatus } from "../local-run-store/store-lifecycle.js";
|
|
2
|
+
import { type LocalRunStoreSurfaceMode } from "../local-run-store/surface-flags.js";
|
|
3
|
+
export interface LocalStoreQuarantineEntry {
|
|
4
|
+
file: string;
|
|
5
|
+
mtime: string | null;
|
|
6
|
+
}
|
|
7
|
+
export interface LocalStoreDoctorReport {
|
|
8
|
+
command: "doctor local-store";
|
|
9
|
+
contractVersion: 1;
|
|
10
|
+
harnessRoot: string;
|
|
11
|
+
store: {
|
|
12
|
+
state: LocalRunStoreLifecycleStatus["state"];
|
|
13
|
+
databasePath: string | null;
|
|
14
|
+
schemaVersion: number | null;
|
|
15
|
+
recovered: boolean;
|
|
16
|
+
quarantinedTo: string | null;
|
|
17
|
+
reason: string | null;
|
|
18
|
+
};
|
|
19
|
+
surfaces: Array<{
|
|
20
|
+
key: string;
|
|
21
|
+
env: string;
|
|
22
|
+
milestone: string;
|
|
23
|
+
mode: LocalRunStoreSurfaceMode;
|
|
24
|
+
/** env override / server-delivered policy / default off. */
|
|
25
|
+
source: "env" | "server" | "default";
|
|
26
|
+
}>;
|
|
27
|
+
flagWarnings: string[];
|
|
28
|
+
/** `*.quarantine-*` artifacts under the harness root (offline inspection). */
|
|
29
|
+
quarantineHistory: LocalStoreQuarantineEntry[];
|
|
30
|
+
}
|
|
31
|
+
export declare function buildLocalStoreDoctorReport(options?: {
|
|
32
|
+
env?: NodeJS.ProcessEnv;
|
|
33
|
+
/** Skip the open probe (report current lifecycle state only). */
|
|
34
|
+
probe?: boolean;
|
|
35
|
+
}): LocalStoreDoctorReport;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { cleanupWslCrashDumps, shouldAutoCleanupWslCrashDumps, type WslCrashDump
|
|
|
9
9
|
export { postJson, type DispatchNextDiskGateShape, type DispatchNextWslHostShape, } from "./callbacks.js";
|
|
10
10
|
export { parseClaudeStream, parseHarnessStream, summarizeEvent, summarizeShellToolCallEvent, } from "./stream.js";
|
|
11
11
|
export { classifyNpmAuditOutcome, classifyShellCommandOutcome, summarizeNpmAuditReport, type NpmAuditSummary, type ShellCommandOutcome, type ShellCommandOutcomeKind, } from "./shell-command-outcome.js";
|
|
12
|
-
export { classifyRepoSearchMeta, diagnoseRepoSearchFailure, extractSearchMeta, extractSearchMetaFromToolLine, formatRepoSearchGuidance, isRgExcludeScopeTarget, isSingleFileSearchTarget, metaToNormalizedRgCommand, normalizeRepoSearchCommand, normalizeRgArgv, type RepoSearchContext, type RepoSearchKind, } from "./repo-search.js";
|
|
12
|
+
export { classifyRepoSearchMeta, diagnoseRepoSearchFailure, extractSearchMeta, extractSearchMetaFromToolLine, formatRepoSearchGuidance, isRgExcludeScopeTarget, isSingleFileSearchTarget, metaToNormalizedRgCommand, normalizeRepoSearchCommand, normalizeRgArgv, shouldTreatRgNoMatchAsSuccess, unwrapShellWrapperCommand, type RepoSearchContext, type RepoSearchKind, } from "./repo-search.js";
|
|
13
13
|
export { parseHeartbeat, isTerminalHeartbeatPhase, terminalFinalResultFromHeartbeat, } from "./heartbeat.js";
|
|
14
14
|
export { buildBoxResourceSnapshotFromGate, formatHeartbeatLine, type RuntimeBoxResourceSnapshot, type RuntimeBoxResourceSnapshotPrEvidence, type HeartbeatLineInput, } from "./box-resource-snapshot.js";
|
|
15
15
|
export { resolveBoxKindFromEnv, defaultBoxId } from "./box-resource-snapshot-shared.js";
|
|
@@ -21,6 +21,7 @@ export { assessExitedWorkerSalvage, type ExitedSalvageAssessment, type ExitedSal
|
|
|
21
21
|
export { persistExitedWorkerHandoffCapture, resolveExitedWorkerFinalResult, type ExitedHandoffCapture, type ExitedHandoffCaptureSource, } from "./exited-worker-handoff-capture.js";
|
|
22
22
|
export { buildPrompt, buildPromptWithReceipt, RUNTIME_PROMPT_ENFORCEMENT, type BuildPromptInput, } from "./prompt.js";
|
|
23
23
|
export { RUNTIME_CONTEXT_BUDGET_RECEIPT_SCHEMA_VERSION, RUNTIME_CONTEXT_BUDGET_RECEIPT_V2_SCHEMA_VERSION, buildContextBudgetReceiptV2, estimateTokensFromChars, finalizeReceiptTotals, isRuntimeContextBudgetReceiptV2, sectionReceiptFromMarkdown, upgradeReceiptToV2, type BuildContextBudgetReceiptV2Input, type ContextBudgetReceiptSurface, type ContextEnvelopeMode, type RuntimeContextActiveStateLookup, type RuntimeContextActiveStateLookupKind, type RuntimeContextActiveStateLookupStatus, type RuntimeContextBudgetReceipt, type RuntimeContextBudgetReceiptSchemaVersion, type RuntimeContextBudgetReceiptV2, type RuntimeContextRehydrationKind, type RuntimeContextRehydrationRoute, type RuntimeContextSection, type RuntimeContextSectionReceipt, type UsefulContextCoverage, } from "./context-budget-receipt.js";
|
|
24
|
+
export { MEMORY_LANE_PREVIEW_CHARS, buildChatMemoryShadowPreview, buildLegacyChatMemorySection, chatMemoriesToPreviewItems, formatContextPreviewMemoryBlock, type ContextPreviewBlockInput, type ContextPreviewMemoryItem, } from "./context-preview/chat-memory-preview.js";
|
|
24
25
|
export { canonicalJsonStringify, computeInstructionBundleVersion, deriveInstructionBundleKeyId, parseRawEd25519Key, isSignedInstructionBundleShape, PINNED_INSTRUCTION_BUNDLE_PUBLIC_KEYS, resolveInstructionBundlePublicKey, verifyInstructionBundleSignatureWithKey, verifySignedInstructionBundle, EMBEDDED_INSTRUCTION_BUNDLE, EMBEDDED_INSTRUCTION_BUNDLE_VERSION, getActiveInstructionBundle, getActiveInstructionBundleSource, getActiveInstructionBundleVersion, setActiveInstructionBundle, resolveInstructionText, resolvePolicyThreshold, resolveBundlePersona, ensureInstructionBundle, instructionBundleCachePath, loadInstructionBundleCache, saveInstructionBundleCache, INSTRUCTION_BUNDLE_REFRESH_TTL_MS, type InstructionBundle, type InstructionBundleContent, type InstructionBundlePersona, type SignedInstructionBundle, type InstructionBundleSource, type InstructionBundleVerifyResult, type EnsureInstructionBundleOptions, type EnsureInstructionBundleResult, } from "./instruction-bundle/index.js";
|
|
25
26
|
export { WORKER_PERSONA_CATALOG, getWorkerPersonaCatalogEntry, getPersonaDispatchLane, getPersonaDefaultRoleLane, isKnownWorkerPersonaSlug, workerPersonaReviewSlugs, workerPersonaLandingSlugs, type WorkerPersonaCatalogEntry, type WorkerPersonaCatalogSlug, type WorkerPersonaDispatchLane, type WorkerPersonaDefaultRoleLane, } from "./worker-persona-catalog.js";
|
|
26
27
|
export { assessPrHandoffRequirement, ensurePrReadyHandoff, extractPrUrlFromText, } from "./pr-handoff/index.js";
|
|
@@ -73,7 +74,7 @@ export { runBoundedBuildCheck, assessBuildAdmission, mergeNodeOptionsForBuildChe
|
|
|
73
74
|
export { assessHeavyVerificationGate, countActiveHeavyVerificationSlots, isHeavyVerificationGateSkipped, listActiveHeavyVerificationSlots, reclaimStaleHeavyVerificationSlots, releaseHeavyVerificationSlot, resolveHeavyVerificationMaxConcurrent, tryAcquireHeavyVerificationSlot, waitForHeavyVerificationSlot, DEFAULT_HEAVY_VERIFICATION_MAX_CONCURRENT, classifyHeavyShellCommand, gateWorkerShellCommand, HEAVY_VERIFICATION_TOKEN_REQUIRED, type HeavyCommandClass, type HeavyCommandClassification, type HeavyVerificationGateVerdict, type HeavyVerificationSlotRecord, type WorkerCommandGateOutcome, type WorkerCommandGateResult, } from "./heavy-verification/index.js";
|
|
74
75
|
export { assessAutoCompleteEligibility, classifyWorkerHealth, getMonitorStatus, listMonitors, runMonitorTick, spawnMonitorSidecar, type AutoCompleteAssessment, type MonitorTickResult, type TaskLeaseSnapshot, type WorkerHealthClass, type WorkerMonitorView, } from "./monitor/index.js";
|
|
75
76
|
export { formatHarnessToolReadable, formatMonitorTickNotice, formatAutoCompleteOutcomeNotice, formatWorkerStatusNotice, formatWorkerCompleteNotice, joinHarnessNotice, type HarnessReadableNotice, type HarnessToolFormatContext, } from "./harness-notice/index.js";
|
|
76
|
-
export { persistPlan, drainPlanOutbox, listOutboxItems, formatPlanOutboxHandoffBlock, extractPlanOutboxFromTask, hashPlanBody, type PersistPlanInput, type PersistPlanResult, type PlanPersistUserStatus, } from "./plan-persist/index.js";
|
|
77
|
+
export { persistPlan, drainPlanOutbox, listOutboxItems, writeOutboxItem, formatPlanOutboxHandoffBlock, extractPlanOutboxFromTask, hashPlanBody, type PersistPlanInput, type PersistPlanResult, type PlanPersistUserStatus, } from "./plan-persist/index.js";
|
|
77
78
|
export { classifyVercelUrl, collectVercelEvidence, evidenceFromGitHubVercelStatus, isDashboardVercelUrl, isInspectableVercelTarget, isVercelStatusContext, pickVercelStatusContext, resolveVercelInspectTarget, type CollectVercelEvidenceInput, type GitHubCommitStatusRow, type VercelEvidenceResult, type VercelEvidenceStatus, } from "./vercel/index.js";
|
|
78
79
|
export { validateJobEnvelope, type LocalCodexJobEnvelope, type LocalCodexJobToolPolicy, type JobEnvelopeValidationError, type JobEnvelopeValidationResult, } from "./byoc/job-envelope.js";
|
|
79
80
|
export { verifyLocalCodexGoldenPath, formatGoldenPathFailureNotice, type GoldenPathCheckCode, type GoldenPathAuditEvidence, type GoldenPathOptions, type GoldenPathResult, } from "./byoc/m6-golden-path.js";
|
|
@@ -81,3 +82,4 @@ export { AGENT_RUNTIME_ENVELOPE_SCHEMA_VERSION, AGENT_RUNTIME_ENVELOPE_SCHEMA_VE
|
|
|
81
82
|
export { evaluateNodeRuntimePolicy, KYNVER_NODE_PATCH_FLOOR, PUBLISHED_NODE_RANGE, PRIVATE_ROOT_NODE_RANGE, type NodeRuntimePolicyStatus, type NodeRuntimePolicyVerdict, } from "./node-runtime-policy.js";
|
|
82
83
|
export { buildRuntimeIdentity, type RuntimeIdentityV1 } from "./runtime-identity.js";
|
|
83
84
|
export { buildNodeRuntimeDoctorReport, type NodeRuntimeDoctorReport } from "./doctor/node-runtime.js";
|
|
85
|
+
export { readJson, writeJson } from "./util.js";
|