@kynver-app/runtime 0.1.112 → 0.1.117

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,18 @@
1
+ import { type CliRunner, type ProviderEvidenceItem, type ProviderEvidenceWantedItem } from "./types.js";
2
+ export interface ProviderEvidenceCollectionSummary {
3
+ attempted: number;
4
+ collected: number;
5
+ items: ProviderEvidenceItem[];
6
+ skipped: Array<{
7
+ provider: string;
8
+ kind: string;
9
+ subject: string;
10
+ reason: "no_recipe" | "provider_unavailable" | "collect_failed" | "budget_exhausted";
11
+ }>;
12
+ }
13
+ export declare function collectProviderEvidence(wanted: ProviderEvidenceWantedItem[], opts?: {
14
+ run?: CliRunner;
15
+ maxSubjects?: number;
16
+ deadlineMs?: number;
17
+ now?: () => Date;
18
+ }): ProviderEvidenceCollectionSummary;
@@ -0,0 +1,5 @@
1
+ import type { CliRunner } from "./types.js";
2
+ /** Default recipe CLI runner: bounded, capture-only, never throws. */
3
+ export declare const defaultCliRunner: CliRunner;
4
+ /** Run a CLI expected to emit JSON on stdout; null on failure or bad JSON. */
5
+ export declare function runCliJson<T>(run: CliRunner, cmd: string, args: string[]): T | null;
@@ -0,0 +1,7 @@
1
+ export * from "./types.js";
2
+ export * from "./exec.js";
3
+ export * from "./registry.js";
4
+ export * from "./collect.js";
5
+ export * from "./wanted-store.js";
6
+ export * from "./recipes-github.js";
7
+ export * from "./recipes-vercel.js";
@@ -0,0 +1,4 @@
1
+ import { type EvidenceCollectorRecipe } from "./types.js";
2
+ export declare const githubPrSnapshotRecipe: EvidenceCollectorRecipe;
3
+ export declare const githubCommitStatusRecipe: EvidenceCollectorRecipe;
4
+ export declare const githubBranchReachabilityRecipe: EvidenceCollectorRecipe;
@@ -0,0 +1,2 @@
1
+ import { type EvidenceCollectorRecipe } from "./types.js";
2
+ export declare const vercelDeploymentStatusRecipe: EvidenceCollectorRecipe;
@@ -0,0 +1,6 @@
1
+ import type { EvidenceCollectorRecipe } from "./types.js";
2
+ export declare function registerEvidenceCollector(recipe: EvidenceCollectorRecipe): void;
3
+ export declare function getEvidenceCollector(provider: string, kind: string): EvidenceCollectorRecipe | null;
4
+ export declare function listEvidenceCollectors(): EvidenceCollectorRecipe[];
5
+ /** Idempotent default-recipe registration (called by the collection loop). */
6
+ export declare function registerDefaultEvidenceCollectors(): void;
@@ -0,0 +1,48 @@
1
+ /** Subject the server asked us to collect (from the tick response). */
2
+ export interface ProviderEvidenceWantedItem {
3
+ provider: string;
4
+ kind: string;
5
+ subject: string;
6
+ }
7
+ /** One collected evidence item shipped on the next operator tick. */
8
+ export interface ProviderEvidenceItem {
9
+ provider: string;
10
+ kind: string;
11
+ subject: string;
12
+ payload: unknown;
13
+ observedAt: string;
14
+ collectorVersion?: string;
15
+ }
16
+ /** Result of one CLI invocation (injectable for tests). */
17
+ export interface CliRunResult {
18
+ ok: boolean;
19
+ stdout: string;
20
+ stderr: string;
21
+ }
22
+ export type CliRunner = (cmd: string, args: string[], opts?: {
23
+ timeoutMs?: number;
24
+ }) => CliRunResult;
25
+ /**
26
+ * A collector recipe: the only provider-specific code on the daemon side.
27
+ * Runs a CLI with the user's own auth and shapes the output minimally — all
28
+ * classification/validation lives with the matching server consumer.
29
+ */
30
+ export interface EvidenceCollectorRecipe {
31
+ provider: string;
32
+ kind: string;
33
+ version: string;
34
+ /** Cheap probe: is the underlying CLI installed + authenticated? */
35
+ isAvailable(run: CliRunner): boolean;
36
+ /** Collect evidence for one subject; null when collection failed. */
37
+ collect(subject: string, run: CliRunner): unknown | null;
38
+ }
39
+ export declare function providerEvidenceKey(provider: string, kind: string, subject: string): string;
40
+ export declare function parseCommitEvidenceSubject(subject: string): {
41
+ repo: string;
42
+ sha: string;
43
+ } | null;
44
+ /** Same PR-URL grammar as the server's pr-notification parser. */
45
+ export declare function parsePrUrlSubject(subject: string): {
46
+ repo: string;
47
+ number: number;
48
+ } | null;
@@ -0,0 +1,5 @@
1
+ import type { ProviderEvidenceWantedItem } from "./types.js";
2
+ export declare function loadPersistedProviderEvidenceWanted(runId: string): ProviderEvidenceWantedItem[];
3
+ export declare function persistProviderEvidenceWanted(runId: string, wanted: ProviderEvidenceWantedItem[]): void;
4
+ /** Extract `providerEvidenceWanted` from an operator-tick response body. */
5
+ export declare function extractProviderEvidenceWanted(tickResponse: unknown): ProviderEvidenceWantedItem[] | null;
@@ -1,6 +1,11 @@
1
1
  import type { WorkerProvider } from "./types.js";
2
- /** Default Codex model for harness orchestration (override with --model). */
3
- export declare const CODEX_DEFAULT_MODEL = "gpt-5.4";
2
+ /**
3
+ * Default Codex model for harness orchestration.
4
+ * Override with `--model` flag or `KYNVER_CODEX_DEFAULT_MODEL` env var.
5
+ * Cheaper alternatives: `o4-mini`, `gpt-4o-mini`.
6
+ */
7
+ export declare function resolveCodexDefaultModel(): string;
8
+ export declare const CODEX_DEFAULT_MODEL: string;
4
9
  /**
5
10
  * Build argv for `codex exec` headless orchestration.
6
11
  * Uses read-only sandbox + no approval prompts for low-risk harness slices.
@@ -1,6 +1,9 @@
1
1
  import type { WorkerProvider } from "./types.js";
2
- /** Default model when routing through Hermes openai-codex subscription. */
3
- export declare const HERMES_OPENAI_CODEX_DEFAULT_MODEL = "gpt-5.4";
2
+ /**
3
+ * Default model when routing through Hermes openai-codex subscription.
4
+ * Inherits `KYNVER_CODEX_DEFAULT_MODEL` override so both codex paths use the same cheaper model.
5
+ */
6
+ export declare const HERMES_OPENAI_CODEX_DEFAULT_MODEL: string;
4
7
  /**
5
8
  * Non-interactive Hermes chat argv for openai-codex subscription orchestration.
6
9
  * `-Q` suppresses banners; `--accept-hooks` avoids TTY approval prompts.