@kynver-app/runtime 0.2.0 → 0.2.4

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.
@@ -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;
@@ -3,3 +3,4 @@ export { buildDaemonSupervisionPolicy, defaultSupervisionOwner, formatSupervisio
3
3
  export { applyDaemonSupervisionSetup, defaultSystemdUserUnitPath, isSystemdSupervisionInstalled, supervisionOwnerForDoctor, type DaemonSupervisionSetupResult, } from "./setup.js";
4
4
  export { ensureDaemonSupervisionForStart, formatSystemdDelegationGuidance, shouldDelegateStartToSystemd, summarizeSupervisionForStart, type EnsureDaemonSupervisionInput, type EnsureDaemonSupervisionResult, } from "./start.js";
5
5
  export { assessDaemonSupervisionChecks, type AssessDaemonSupervisionOptions, type DaemonSupervisionVerifyCheck, } from "./verify.js";
6
+ export { assessSupervisionHealth, type SupervisionHealth } from "./supervision-health.js";
@@ -0,0 +1,20 @@
1
+ import type { KynverUserConfig } from "../config.js";
2
+ import type { DaemonSupervisionOwner } from "./policy.js";
3
+ export interface SupervisionHealthOptions {
4
+ envFilePath?: string;
5
+ /** Injectable for tests. */
6
+ systemdUnitActive?: () => boolean;
7
+ }
8
+ export interface SupervisionHealth {
9
+ owner: DaemonSupervisionOwner | null;
10
+ daemonPresentSignal: boolean;
11
+ systemdUnitInstalled: boolean;
12
+ systemdUnitActive: boolean;
13
+ /** True when restart policy is persisted or inferable from a healthy supervised daemon. */
14
+ effectivelyConfigured: boolean;
15
+ }
16
+ /**
17
+ * Infer whether a keeper/systemd-owned daemon is already healthy on this host,
18
+ * so doctor checks avoid stale warnings on upgraded installs.
19
+ */
20
+ export declare function assessSupervisionHealth(config: KynverUserConfig, options?: SupervisionHealthOptions): SupervisionHealth;
@@ -2,6 +2,7 @@ import type { KynverUserConfig } from "../config.js";
2
2
  export interface AssessDaemonSupervisionOptions {
3
3
  /** Override for tests; defaults to ~/.kynver/.env */
4
4
  envFilePath?: string;
5
+ systemdUnitActive?: () => boolean;
5
6
  }
6
7
  export interface DaemonSupervisionVerifyCheck {
7
8
  id: string;
@@ -0,0 +1,16 @@
1
+ import type { CommandProbeResult } from "./runtime-takeover.probes.js";
2
+ export type GitHubReadinessSource = "env" | "gh-cli" | "missing";
3
+ export interface GitHubReadinessProbe {
4
+ envGithubToken?: boolean;
5
+ envGhToken?: boolean;
6
+ ghAuthToken(): CommandProbeResult;
7
+ }
8
+ export interface GitHubReadinessResult {
9
+ viable: boolean;
10
+ source: GitHubReadinessSource;
11
+ summary: string;
12
+ }
13
+ /**
14
+ * Read-only GitHub auth probe for doctor checks. Never prints or persists tokens.
15
+ */
16
+ export declare function probeGitHubReadiness(probe: GitHubReadinessProbe): GitHubReadinessResult;
@@ -0,0 +1,9 @@
1
+ import type { DoctorSection } from "./doctor.types.js";
2
+ import { type GitHubReadinessProbe } from "./github-readiness.js";
3
+ import type { RuntimeTakeoverProbes } from "./runtime-takeover.probes.js";
4
+ /**
5
+ * Optional deploy-evidence checks for merge-gate / PR handoff workflows.
6
+ * Core runtime takeover does not require Vercel CLI or VERCEL_TOKEN when GitHub
7
+ * commit-status evidence is viable.
8
+ */
9
+ export declare function assessDeployEvidence(probes: RuntimeTakeoverProbes, githubProbe: GitHubReadinessProbe): DoctorSection;
@@ -36,5 +36,10 @@ export interface RuntimeTakeoverProbes {
36
36
  legacyOpenclawHarnessRoot(): string;
37
37
  pathExists(target: string): boolean;
38
38
  pathWritable(target: string): boolean;
39
+ ghAuthToken(): CommandProbeResult;
40
+ /** When false, GitHub/Vercel deploy-evidence checks are advisory-only skips. */
41
+ deployEvidenceNeedsGithub?(): boolean;
42
+ /** Injectable systemd active probe for supervision checks. */
43
+ systemdDaemonActive?(): boolean;
39
44
  }
40
45
  export declare const defaultRuntimeTakeoverProbes: RuntimeTakeoverProbes;
package/dist/index.d.ts CHANGED
@@ -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";