@zhivex-ai/harness 1.0.0 → 1.1.0-rc.2

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.
Files changed (181) hide show
  1. package/CHANGELOG.md +97 -1
  2. package/README.md +52 -306
  3. package/SECURITY.md +1 -1
  4. package/SUPPORT.md +7 -3
  5. package/benchmarks/README.md +3 -3
  6. package/contracts/client-protocol-v1.schema.json +341 -0
  7. package/contracts/public-api.json +100 -1
  8. package/contracts/stable-api-signatures.json +14 -14
  9. package/dist/approval-diff.d.ts +45 -0
  10. package/dist/approval-history.d.ts +38 -0
  11. package/dist/approval-preview.d.ts +26 -0
  12. package/dist/cli-credentials.d.ts +38 -0
  13. package/dist/cli-help.d.ts +3 -0
  14. package/dist/cli-options.d.ts +1 -1
  15. package/dist/cli-stream.d.ts +3 -3
  16. package/dist/cli.d.ts +15 -69
  17. package/dist/cli.js +13796 -10032
  18. package/dist/client-contract.d.ts +208 -0
  19. package/dist/console-commands.d.ts +6 -0
  20. package/dist/console-context.d.ts +5 -1
  21. package/dist/console-input.d.ts +44 -4
  22. package/dist/console-model-catalog.d.ts +25 -0
  23. package/dist/console-navigation.d.ts +27 -0
  24. package/dist/console-presentation.d.ts +18 -0
  25. package/dist/console-welcome.d.ts +13 -0
  26. package/dist/execution-environment.d.ts +4 -0
  27. package/dist/harness.d.ts +3 -0
  28. package/dist/hostile-repository-demo.js +1913 -798
  29. package/dist/index.d.ts +7 -0
  30. package/dist/index.js +7908 -6330
  31. package/dist/local-service.d.ts +34 -0
  32. package/dist/operations.d.ts +23 -1
  33. package/dist/orchestration.d.ts +3 -0
  34. package/dist/persistence-secrets.d.ts +2 -0
  35. package/dist/recorded-workspace.d.ts +4 -0
  36. package/dist/run-document.d.ts +91 -0
  37. package/dist/runtime-policy.d.ts +4 -4
  38. package/dist/service-cli.d.ts +2 -0
  39. package/dist/service-cli.js +10858 -0
  40. package/dist/service-client-cli.d.ts +2 -0
  41. package/dist/service-events.d.ts +50 -0
  42. package/dist/sessions.d.ts +3 -0
  43. package/dist/sqlite-access.d.ts +26 -0
  44. package/dist/sqlite-database.d.ts +2 -0
  45. package/dist/state-backup.d.ts +8 -0
  46. package/dist/task-memory.d.ts +2 -2
  47. package/dist/terminal-continuation.d.ts +3 -0
  48. package/dist/terminal-markdown.d.ts +1 -0
  49. package/dist/terminal-ui.d.ts +5 -0
  50. package/dist/usage-ledger.d.ts +84 -0
  51. package/dist/verify-historical-migrations.js +5699 -5191
  52. package/dist/workspace.d.ts +22 -0
  53. package/dist/zhx.js +13796 -10032
  54. package/docs/CLI.md +136 -30
  55. package/docs/CLIENT_PROTOCOL.md +212 -0
  56. package/docs/CREDENTIALS.md +59 -0
  57. package/docs/DURABLE_OPERATIONS.md +2 -2
  58. package/docs/FIRST_USE.md +82 -0
  59. package/docs/FIRST_USE_EXAMPLE.md +40 -0
  60. package/docs/HOSTILE_REPOSITORY_DEMO.md +1 -1
  61. package/docs/LOCAL_SERVICE.md +142 -0
  62. package/docs/README.md +24 -23
  63. package/docs/THREAT_MODEL.md +1 -1
  64. package/docs/TIME_TO_SAFE_FIX.md +2 -2
  65. package/docs/USAGE.md +181 -0
  66. package/evaluations/daily-cli-cohort.json +33 -0
  67. package/evaluations/representative-assembly-matrix.json +19 -1
  68. package/examples/README.md +26 -0
  69. package/examples/first-use/greeting.test.ts +3 -0
  70. package/examples/first-use/greeting.ts +1 -0
  71. package/examples/first-use/package.json +7 -0
  72. package/package.json +34 -9
  73. package/ROADMAP.md +0 -414
  74. package/benchmarks/baselines/context-navigation-2026-09-09.json +0 -94
  75. package/benchmarks/baselines/efficiency-2026-09-08.json +0 -233
  76. package/benchmarks/baselines/external-final-2026-09-08.json +0 -588
  77. package/benchmarks/baselines/external-intermediate-2026-09-08.json +0 -116
  78. package/benchmarks/baselines/external-matched-openai-2026-09-08.json +0 -1922
  79. package/benchmarks/baselines/external-matched-qwen-2026-09-08.json +0 -1706
  80. package/benchmarks/baselines/external-pilot-2026-09-08.json +0 -439
  81. package/benchmarks/baselines/external-qwen-flash-2026-09-08.json +0 -1570
  82. package/benchmarks/baselines/external-qwen-remediation-2026-09-09.json +0 -1509
  83. package/benchmarks/baselines/external-qwen-sdk-114-progress-2026-09-09.json +0 -2509
  84. package/benchmarks/baselines/external-sdk-upgrade-2026-09-08.json +0 -564
  85. package/benchmarks/baselines/external-verifier-recovery-2026-09-09.json +0 -794
  86. package/benchmarks/baselines/full-harness-review-2026-09-10.json +0 -134
  87. package/benchmarks/baselines/harness-audit-2026-09-09.json +0 -136
  88. package/benchmarks/baselines/harness-remediation-2026-09-09.json +0 -160
  89. package/benchmarks/baselines/oci-remediation-2026-09-10.json +0 -535
  90. package/benchmarks/baselines/rc14-holdout-2026-09-10.json +0 -854
  91. package/benchmarks/baselines/repair-architecture-audit-2026-09-09.json +0 -75
  92. package/benchmarks/baselines/time-to-safe-fix-live-expanded-2026-08-21.json +0 -186
  93. package/benchmarks/baselines/time-to-safe-fix-live-smoke-2026-08-21.json +0 -186
  94. package/docs/GA_READINESS.md +0 -29
  95. package/docs/GEMINI_1_0_DECISION.md +0 -9
  96. package/docs/LIVE_CERTIFICATION.md +0 -107
  97. package/docs/RC13_SECURITY_REVIEW.md +0 -28
  98. package/docs/RC14_DELEGATED_SECURITY_DECISION.md +0 -80
  99. package/docs/RC14_SECURITY_REVIEW.md +0 -40
  100. package/docs/RELEASE.md +0 -96
  101. package/docs/ROLLBACK.md +0 -9
  102. package/docs/SECURITY_REVIEW_EVIDENCE.md +0 -17
  103. package/docs/ga-readiness.json +0 -366
  104. package/docs/reports/EFFICIENCY_REVIEW.md +0 -156
  105. package/docs/reports/EXTERNAL_COMPARISON.md +0 -434
  106. package/docs/reports/FULL_HARNESS_REVIEW_2026-09-10.md +0 -200
  107. package/docs/reports/GA_BUDGET_REMEDIATION_2026-09-19.md +0 -38
  108. package/docs/reports/GA_REPAIR_RECOVERY_2026-09-19.md +0 -700
  109. package/docs/reports/GA_VALIDATION_2026-09-19.md +0 -111
  110. package/docs/reports/HARNESS_ARCHITECTURE_REVIEW_2026-09-09.md +0 -202
  111. package/docs/reports/HARNESS_AUDIT_2026-09-09.md +0 -306
  112. package/docs/reports/HARNESS_REMEDIATION_2026-09-09.md +0 -74
  113. package/docs/reports/HARNESS_REMEDIATION_2026-09-10.md +0 -90
  114. package/docs/reports/MODEL_COMPARISON_2026-09-09.md +0 -184
  115. package/docs/reports/QWEN_REMEDIATION_COMPARISON_2026-09-09.md +0 -142
  116. package/docs/reports/RC14_VALIDATION_2026-09-10.md +0 -45
  117. package/docs/reports/README.md +0 -26
  118. package/docs/reports/evidence/ga-budget-remediation-2026-09-19.json +0 -133
  119. package/docs/reports/evidence/ga-catalog-ablation-2026-09-19.json +0 -699
  120. package/docs/reports/evidence/ga-catalog-ablation-plan-2026-09-19.json +0 -40
  121. package/docs/reports/evidence/ga-catalog-observed-2026-09-19.json +0 -985
  122. package/docs/reports/evidence/ga-catalog-observed-plan-2026-09-19.json +0 -28
  123. package/docs/reports/evidence/ga-catalog-observed-status-2026-09-19.json +0 -15
  124. package/docs/reports/evidence/ga-complete-local-check-2026-09-19.json +0 -47
  125. package/docs/reports/evidence/ga-completion-reminder-2026-09-19.json +0 -22
  126. package/docs/reports/evidence/ga-fresh-cohort-plan-2026-09-19.json +0 -54
  127. package/docs/reports/evidence/ga-fresh-cohort-preparation-2026-09-19.json +0 -242
  128. package/docs/reports/evidence/ga-fresh-cohort-result-2026-09-19.json +0 -4318
  129. package/docs/reports/evidence/ga-local-validation-followup-2026-09-19.json +0 -66
  130. package/docs/reports/evidence/ga-node-consumers-2026-09-19.json +0 -31
  131. package/docs/reports/evidence/ga-package-content-validation-2026-09-19.json +0 -22
  132. package/docs/reports/evidence/ga-plan-completion-2026-09-19.json +0 -39
  133. package/docs/reports/evidence/ga-plan-reserve-2026-09-19.json +0 -573
  134. package/docs/reports/evidence/ga-plan-reserve-plan-2026-09-19.json +0 -24
  135. package/docs/reports/evidence/ga-plan-transition-2026-09-19.json +0 -19
  136. package/docs/reports/evidence/ga-private-verifier-plan-2026-09-19.json +0 -24
  137. package/docs/reports/evidence/ga-private-verifier-root-cause-2026-09-19.json +0 -41
  138. package/docs/reports/evidence/ga-published-sdk-2026-09-19.json +0 -35
  139. package/docs/reports/evidence/ga-python-checkout-imports-2026-09-19.json +0 -95
  140. package/docs/reports/evidence/ga-python-origin-delivery-2026-09-19.json +0 -211
  141. package/docs/reports/evidence/ga-python-origin-delivery-plan-2026-09-19.json +0 -27
  142. package/docs/reports/evidence/ga-qwen-patched-package-2026-09-19.json +0 -1092
  143. package/docs/reports/evidence/ga-qwen-patched-package-plan-2026-09-19.json +0 -18
  144. package/docs/reports/evidence/ga-qwen-published-2026-09-19.json +0 -571
  145. package/docs/reports/evidence/ga-qwen-published-plan-2026-09-19.json +0 -18
  146. package/docs/reports/evidence/ga-qwen-tool-choice-2026-09-19.json +0 -85
  147. package/docs/reports/evidence/ga-qwen-tool-choice-patched-2026-09-19.json +0 -85
  148. package/docs/reports/evidence/ga-recovery-development-2026-09-19.json +0 -1066
  149. package/docs/reports/evidence/ga-recovery-graded-development-2026-09-19.json +0 -1313
  150. package/docs/reports/evidence/ga-recovery-graded-v2-2026-09-19.json +0 -1151
  151. package/docs/reports/evidence/ga-recovery-v3-2026-09-19.json +0 -3943
  152. package/docs/reports/evidence/ga-recovery-v4-2026-09-19.json +0 -1055
  153. package/docs/reports/evidence/ga-recovery-v5-2026-09-19.json +0 -1245
  154. package/docs/reports/evidence/ga-recovery-v6-2026-09-19.json +0 -699
  155. package/docs/reports/evidence/ga-recovery-v7-2026-09-19.json +0 -854
  156. package/docs/reports/evidence/ga-recovery-v8-2026-09-19.json +0 -596
  157. package/docs/reports/evidence/ga-required-delivery-2026-09-19.json +0 -25
  158. package/docs/reports/evidence/ga-required-delivery-live-2026-09-19.json +0 -1337
  159. package/docs/reports/evidence/ga-required-delivery-live-plan-2026-09-19.json +0 -25
  160. package/docs/reports/evidence/ga-retained-candidate-grading-2026-09-19.json +0 -30
  161. package/docs/reports/evidence/ga-tool-selection-live-2026-09-19.json +0 -559
  162. package/docs/reports/evidence/ga-tool-selection-live-plan-2026-09-19.json +0 -28
  163. package/docs/reports/evidence/ga-tool-selection-recovery-2026-09-19.json +0 -27
  164. package/docs/reports/evidence/ga-validation-2026-09-19.json +0 -236
  165. package/docs/reports/evidence/ga-verifier-discovery-live-2026-09-19.json +0 -1369
  166. package/docs/reports/evidence/ga-verifier-discovery-plan-2026-09-19.json +0 -29
  167. package/docs/reports/evidence/ga-verifier-failure-identification-2026-09-19.json +0 -30
  168. package/docs/reports/evidence/ga-verifier-feedback-2026-09-19.json +0 -65
  169. package/docs/reports/evidence/ga-verifier-hints-live-2026-09-19.json +0 -1297
  170. package/docs/reports/evidence/ga-verifier-hints-plan-2026-09-19.json +0 -27
  171. package/docs/reports/evidence/ga-work-boundary-context-analysis-2026-09-19.json +0 -113
  172. package/docs/reports/evidence/ga-work-boundary-live-2026-09-19.json +0 -301
  173. package/docs/reports/evidence/ga-work-boundary-live-plan-2026-09-19.json +0 -84
  174. package/docs/reports/evidence/ga-work-budget-planning-2026-09-19.json +0 -32
  175. package/docs/reports/evidence/ga-working-context-2026-09-19.json +0 -22
  176. package/docs/reports/evidence/rc14-delegated-security-review-2026-09-20.json +0 -81
  177. package/docs/reports/evidence/rc14-ga-gate-2026-09-20.json +0 -18
  178. package/docs/reports/evidence/rc14-representative-2026-09-20.json +0 -509
  179. package/docs/reports/evidence/rc14-security-regressions-2026-09-20.json +0 -64
  180. package/docs/reports/evidence/security-current-2026-09-19.json +0 -91
  181. package/docs/reports/evidence/security-remediation-2026-09-19.json +0 -97
@@ -0,0 +1,45 @@
1
+ import { z } from "zod";
2
+ import type { AgentRunState } from "@zhivex-ai/core";
3
+ import type { HarnessClientRun } from "./client-contract.js";
4
+ import type { ApprovalDecisionView } from "./approval-history.js";
5
+ export declare const APPROVAL_DIFFS_KEY = "clientApprovalDiffsV1";
6
+ declare const file: z.ZodObject<{
7
+ path: z.ZodString;
8
+ expectedDigest: z.ZodNullable<z.ZodString>;
9
+ before: z.ZodNullable<z.ZodString>;
10
+ after: z.ZodNullable<z.ZodString>;
11
+ afterDigest: z.ZodNullable<z.ZodString>;
12
+ beforeMode: z.ZodOptional<z.ZodNumber>;
13
+ afterMode: z.ZodOptional<z.ZodNumber>;
14
+ operation: z.ZodOptional<z.ZodEnum<{
15
+ create: "create";
16
+ delete: "delete";
17
+ update: "update";
18
+ }>>;
19
+ }, z.core.$strict>;
20
+ export type AppliedDiff = {
21
+ status: "complete";
22
+ files: z.infer<typeof file>[];
23
+ redacted?: boolean;
24
+ } | {
25
+ status: "unavailable";
26
+ };
27
+ /** Capture complete previews before admitting execution, bounded across the run. */
28
+ export declare function captureApprovalDiffs(state: AgentRunState, run: HarnessClientRun, approved: ReadonlySet<string>): {
29
+ approvalId: string;
30
+ digest: string;
31
+ proposalId: string;
32
+ files: {
33
+ path: string;
34
+ expectedDigest: string | null;
35
+ before: string | null;
36
+ after: string | null;
37
+ afterDigest: string | null;
38
+ beforeMode?: number | undefined;
39
+ afterMode?: number | undefined;
40
+ operation?: "create" | "delete" | "update" | undefined;
41
+ }[];
42
+ }[];
43
+ /** Only expose saved content when exact journal effects certify every file. */
44
+ export declare function attachAppliedDiffs(state: AgentRunState, decisions: ApprovalDecisionView[]): ApprovalDecisionView[];
45
+ export {};
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ import type { AgentRunState, AgentToolCallJournalEntry } from "@zhivex-ai/core";
3
+ import type { AppliedDiff } from "./approval-diff.js";
4
+ export declare const APPROVAL_HISTORY_KEY = "clientApprovalDecisionsV1";
5
+ export declare const approvalInputDigest: (value: unknown) => string;
6
+ declare const rowSchema: z.ZodObject<{
7
+ approvalId: z.ZodString;
8
+ digest: z.ZodString;
9
+ toolCallId: z.ZodOptional<z.ZodString>;
10
+ name: z.ZodString;
11
+ inputDigest: z.ZodOptional<z.ZodString>;
12
+ approved: z.ZodBoolean;
13
+ decidedAt: z.ZodNumber;
14
+ reviewedRevision: z.ZodNumber;
15
+ }, z.core.$strict>;
16
+ export type ApprovalDecisionRecord = z.infer<typeof rowSchema>;
17
+ export interface ApprovalDecisionView extends ApprovalDecisionRecord {
18
+ status: "rejected" | "approved" | "applied" | "succeeded" | "failed" | "unknown";
19
+ finalDiff?: AppliedDiff;
20
+ evidence?: {
21
+ journalRevision: number;
22
+ completedAt?: number;
23
+ exitCode?: number;
24
+ timedOut?: boolean;
25
+ proposalId?: string;
26
+ reviewedProposalId?: string;
27
+ verifiedPatchId?: string;
28
+ command?: string[];
29
+ effects?: Array<{
30
+ path: string;
31
+ beforeDigest: string | null;
32
+ afterDigest: string | null;
33
+ }>;
34
+ };
35
+ }
36
+ export declare function readApprovalDecisions(state: AgentRunState): ApprovalDecisionRecord[];
37
+ export declare function approvalDecisionViews(state: AgentRunState, journal: readonly AgentToolCallJournalEntry[], offset?: number): ApprovalDecisionView[];
38
+ export {};
@@ -0,0 +1,26 @@
1
+ import type { HarnessOciExecutionEnvironment } from "./execution-environment.js";
2
+ import type { AgentStoreScope } from "@zhivex-ai/core";
3
+ import type { Workspace } from "./workspace.js";
4
+ import type { HarnessClientRun } from "./client-contract.js";
5
+ export interface ApprovalPreviewFile {
6
+ path: string;
7
+ expectedDigest: string | null;
8
+ before: string | null;
9
+ after: string | null;
10
+ afterDigest: string | null;
11
+ beforeMode?: number;
12
+ afterMode?: number;
13
+ operation?: "create" | "update" | "delete";
14
+ }
15
+ export type ApprovalFilePreview = {
16
+ status: "complete";
17
+ proposalId: string;
18
+ files: ApprovalPreviewFile[];
19
+ } | {
20
+ status: "unavailable";
21
+ };
22
+ /** Explicitly requested read projection; never trusts renderer-supplied paths or changes. */
23
+ export declare function attachApprovalPreviews(run: HarnessClientRun, workspace: Workspace, options?: {
24
+ environment?: HarnessOciExecutionEnvironment | undefined;
25
+ scope?: AgentStoreScope | undefined;
26
+ }): Promise<HarnessClientRun>;
@@ -0,0 +1,38 @@
1
+ import { type HarnessProvider } from "./config.js";
2
+ export interface SecretEntry {
3
+ getPassword(): Promise<string | null | undefined>;
4
+ setPassword(value: string): Promise<void>;
5
+ deleteCredential(): Promise<boolean>;
6
+ }
7
+ export interface CredentialInput {
8
+ select<T>(title: string, items: readonly {
9
+ value: T;
10
+ label: string;
11
+ detail?: string;
12
+ }[]): Promise<T | undefined>;
13
+ secret(prompt: string): Promise<string>;
14
+ }
15
+ export type EntryFactory = (provider: string) => Promise<SecretEntry>;
16
+ export declare const credentialService = "ai.zhivex.harness.cli";
17
+ export declare const validCredential: (value: string) => boolean;
18
+ export declare const nativeCredentialEntry: EntryFactory;
19
+ /** CLI session only. Never put this object or its secrets in run metadata or process.env. */
20
+ export declare class CliCredentials {
21
+ private readonly entry;
22
+ private readonly environment;
23
+ private readonly write;
24
+ private readonly temporary;
25
+ revision: number;
26
+ constructor(entry?: EntryFactory, environment?: NodeJS.ProcessEnv, write?: (text: string) => void);
27
+ private environmentKey;
28
+ private validate;
29
+ private saved;
30
+ configure(provider: HarnessProvider, input: CredentialInput): Promise<boolean>;
31
+ providerEnvironment(provider: HarnessProvider, input: CredentialInput): Promise<NodeJS.ProcessEnv>;
32
+ clear(): void;
33
+ }
34
+ /** Keep provider error payloads out of durable runs when they can contain a key. */
35
+ export declare function credentialModel(config: {
36
+ provider: HarnessProvider;
37
+ model: string;
38
+ }, env: NodeJS.ProcessEnv, modelFactory?: typeof import("./config.js").createProviderModel): Promise<import("@zhivex-ai/core").LanguageModel<import("@zhivex-ai/core").ProviderOptions>>;
@@ -0,0 +1,3 @@
1
+ export declare const shortCliHelp: (version: string) => string;
2
+ export declare function resolveHelpTopic(parts: string[], explicit: boolean): string | undefined;
3
+ export declare function formatCliHelp(topic: string | undefined, version: string, full: string): string;
@@ -8,7 +8,7 @@ export interface CliCommandOptionContract {
8
8
  repeatable: readonly string[];
9
9
  conflicts: Readonly<Record<string, readonly string[]>>;
10
10
  }
11
- export declare const CLI_OPTION_NAMES: readonly ["--provider", "--model", "--profile", "--route", "--workspace", "--state-dir", "--mcp-config", "--context-config", "--no-project-context", "--patch", "--preconditions", "--now", "--agent-profile", "--execution", "--oci-runtime", "--oci-image", "--oci-allow-command", "--oci-shell", "--oci-max-process-runtime-ms", "--oci-max-process-output-bytes", "--oci-max-memory-mb", "--oci-max-pids", "--oci-max-cpus", "--oci-max-workspace-bytes", "--oci-max-file-write-bytes", "--oci-tmpfs-mb", "--store", "--tenant", "--user", "--namespace", "--idempotency-key", "--max-steps", "--timeout-ms", "--max-tool-calls", "--max-tool-errors", "--max-input-tokens", "--max-output-tokens", "--max-total-tokens", "--subagent-max-steps", "--subagent-max-tool-calls", "--subagent-max-tool-errors", "--subagent-max-input-tokens", "--subagent-max-output-tokens", "--subagent-max-total-tokens", "--subagent-timeout-ms", "--max-parallel-reviews", "--max-cost-usd", "--input-cost-per-million", "--output-cost-per-million", "--allow-check", "--require-capability", "--subagent", "--reviewer", "--yes", "--approve", "--deny", "--json", "--jsonl", "--session", "--continue", "--status", "--limit", "--cursor", "--before", "--reason", "--cascade", "--final", "--apply", "--help", "--version"];
11
+ export declare const CLI_OPTION_NAMES: readonly ["--provider", "--model", "--profile", "--route", "--workspace", "--state-dir", "--mcp-config", "--context-config", "--no-project-context", "--patch", "--preconditions", "--now", "--agent-profile", "--execution", "--oci-runtime", "--oci-image", "--oci-allow-command", "--oci-shell", "--oci-max-process-runtime-ms", "--oci-max-process-output-bytes", "--oci-max-memory-mb", "--oci-max-pids", "--oci-max-cpus", "--oci-max-workspace-bytes", "--oci-max-file-write-bytes", "--oci-tmpfs-mb", "--store", "--tenant", "--user", "--namespace", "--idempotency-key", "--max-steps", "--timeout-ms", "--max-tool-calls", "--max-tool-errors", "--max-input-tokens", "--max-output-tokens", "--max-total-tokens", "--subagent-max-steps", "--subagent-max-tool-calls", "--subagent-max-tool-errors", "--subagent-max-input-tokens", "--subagent-max-output-tokens", "--subagent-max-total-tokens", "--subagent-timeout-ms", "--max-parallel-reviews", "--max-cost-usd", "--input-cost-per-million", "--output-cost-per-million", "--allow-check", "--require-capability", "--subagent", "--reviewer", "--yes", "--approve", "--deny", "--json", "--jsonl", "--session", "--continue", "--status", "--limit", "--cursor", "--before", "--reason", "--cascade", "--final", "--service", "--apply", "--help", "--version", "--search", "--pricing-file", "--usage-limit-usd"];
12
12
  export type CliOptionName = (typeof CLI_OPTION_NAMES)[number];
13
13
  export declare const CLI_OPTION_DEFINITIONS: Readonly<Record<CliOptionName, CliOptionDefinition>>;
14
14
  export declare const CLI_COMMAND_OPTION_CONTRACTS: {
@@ -112,7 +112,7 @@ export declare const streamEventDocument: (event: AgentStreamEvent, sequence?: n
112
112
  sequence: number;
113
113
  type: "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish" | "agent-run-start" | "agent-run-update" | "agent-step-finish" | "agent-step-start" | "error" | "finish" | "image-generation" | "provider-data" | "text-delta" | "tool-approval-request" | "tool-call" | "tool-result";
114
114
  stepIndex: number;
115
- status: import("@zhivex-ai/agents").AgentStepStatus;
115
+ status: import("@zhivex-ai/core").AgentStepStatus;
116
116
  toolCalls: number;
117
117
  } | {
118
118
  schemaVersion: 1;
@@ -120,7 +120,7 @@ export declare const streamEventDocument: (event: AgentStreamEvent, sequence?: n
120
120
  sequence: number;
121
121
  type: "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish" | "agent-run-start" | "agent-run-update" | "agent-step-finish" | "agent-step-start" | "error" | "finish" | "image-generation" | "provider-data" | "text-delta" | "tool-approval-request" | "tool-call" | "tool-result";
122
122
  compactionId: string;
123
- reasons: import("@zhivex-ai/agents").AgentCompactionReason[];
123
+ reasons: import("@zhivex-ai/core").AgentCompactionReason[];
124
124
  messageCountBefore: number;
125
125
  messageCountAfter: number;
126
126
  } | {
@@ -129,7 +129,7 @@ export declare const streamEventDocument: (event: AgentStreamEvent, sequence?: n
129
129
  sequence: number;
130
130
  type: "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish" | "agent-run-start" | "agent-run-update" | "agent-step-finish" | "agent-step-start" | "error" | "finish" | "image-generation" | "provider-data" | "text-delta" | "tool-approval-request" | "tool-call" | "tool-result";
131
131
  runId: string;
132
- status: import("@zhivex-ai/agents").AgentStatus;
132
+ status: import("@zhivex-ai/core").AgentStatus;
133
133
  provider: string;
134
134
  model: string;
135
135
  } | undefined;
package/dist/cli.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { type AgentApprovalRequest, type AgentRunInput, type AgentRunOutput, type AgentRunState, type AgentStatus } from "@zhivex-ai/agents";
2
+ export { runResultDocument } from "./run-document.js";
3
+ import { type AgentApprovalRequest, type AgentRunInput, type AgentRunState, type AgentStatus } from "@zhivex-ai/agents";
3
4
  import { providerAvailability, resolveHarnessConfig, type HarnessConfig, type HarnessConfigInput, type HarnessProvider, type HarnessSubagentProfile } from "./config.js";
4
- import { type ZhivexHarness } from "./harness.js";
5
5
  import { type HarnessOciRuntimeAdapter } from "./execution-environment.js";
6
6
  import { type HarnessModelRoute } from "./routing.js";
7
7
  import { CLI_JSON_SCHEMA_VERSION } from "./cli-stream.js";
@@ -29,7 +29,9 @@ type SessionsCommand = (typeof CLI_SESSIONS_COMMANDS)[number];
29
29
  type ChangesCommand = (typeof CLI_CHANGES_COMMANDS)[number];
30
30
  type StateCommand = (typeof CLI_STATE_COMMANDS)[number];
31
31
  export interface CliOptions {
32
+ serviceFile?: string;
32
33
  command: Command;
34
+ helpTopic?: string;
33
35
  profile?: string;
34
36
  provider?: string;
35
37
  model?: string;
@@ -93,6 +95,9 @@ export interface CliOptions {
93
95
  backupPath?: string;
94
96
  sessionId?: string;
95
97
  sessionTitle?: string;
98
+ sessionSearch?: string;
99
+ pricingFile?: string;
100
+ usageLimitUsd?: number;
96
101
  continueSession: boolean;
97
102
  implicitCommand: boolean;
98
103
  statuses?: AgentStatus[];
@@ -117,80 +122,21 @@ export declare const readHarnessResumeRoutes: (state: Pick<AgentRunState, "metad
117
122
  export declare const resumeCommand: (runId: string, config: HarnessConfig, approve?: boolean) => string;
118
123
  export declare const parseCliArgs: (argv: string[]) => CliOptions;
119
124
  export declare const CLI_HELP_TEXT: string;
125
+ export declare const CLI_FULL_HELP_TEXT: string;
120
126
  export declare const summarizeApproval: (approval: AgentApprovalRequest) => string;
121
- export declare const runResultDocument: (result: AgentRunOutput, harness: ZhivexHarness) => {
122
- schemaVersion: 1;
123
- kind: "run-result";
124
- runId: string;
125
- status: AgentStatus;
126
- provider: string;
127
- model: string;
128
- output: string;
129
- steps: number;
130
- toolCalls: number;
131
- mutations: readonly {
132
- id: string;
133
- operation: "create" | "move" | "quarantine" | "restore" | "update";
134
- path: string;
135
- destination?: string | undefined;
136
- beforeDigest?: string | undefined;
137
- afterDigest?: string | undefined;
138
- timestamp: string;
139
- quarantineId?: string | undefined;
140
- }[];
141
- pendingApprovals: {
142
- id: string;
143
- kind: "local-tool" | "provider" | "subagent";
144
- name: string;
145
- arguments: string;
146
- childRunId?: string;
147
- childAgentId?: string;
148
- }[];
149
- children: {
150
- runId: string;
151
- agentId: string | undefined;
152
- toolName: string | undefined;
153
- status: AgentStatus;
154
- steps: number;
155
- toolCalls: number;
156
- toolErrors: number;
157
- usage: import("@zhivex-ai/core").TokenUsage | undefined;
158
- }[];
159
- usage: import("@zhivex-ai/core").TokenUsage | undefined;
160
- budget: import("@zhivex-ai/agents").AgentBudgetStatus;
161
- costBudget?: {
162
- limitUsd: number;
163
- estimate: import("@zhivex-ai/core").CostEstimate;
164
- };
165
- scope: import("@zhivex-ai/core").AgentStoreScope | undefined;
166
- capabilities: import("./capabilities.js").HarnessModelCapabilityReport;
167
- orchestration: {
168
- profiles: readonly ("explorer" | "implementer" | "reviewer" | "tester")[];
169
- childBudget: import("./config.js").HarnessBudget;
170
- mcpServers: string[];
171
- };
172
- execution: {
173
- backend: "oci";
174
- binding: import("@zhivex-ai/agents").AgentExecutionEnvironmentBinding | undefined;
175
- image: import("./execution-environment.js").OciImageInspection;
176
- } | {
177
- binding?: never;
178
- image?: never;
179
- backend: "none";
180
- };
181
- store: {
182
- backend: "file" | "sqlite";
183
- stateDirectory: string;
184
- migration: import("./operations.js").HarnessMigrationResult | undefined;
185
- };
186
- stateDirectory: string;
187
- };
188
127
  export declare const withTemporaryHarnessProfiles: <T>(profiles: readonly HarnessSubagentProfile[], configure: (profiles: readonly HarnessSubagentProfile[]) => Promise<void>, operation: () => Promise<T>) => Promise<T>;
189
128
  export declare const providersDocument: (env?: NodeJS.ProcessEnv) => {
190
129
  schemaVersion: 1;
191
130
  kind: "providers";
192
131
  providers: readonly import("./providers.js").ProviderAvailability[];
193
132
  };
133
+ export declare const confirmDefaultProfileSelection: (profile: {
134
+ provider: HarnessProvider;
135
+ model: string;
136
+ }, ask: (prompt: string) => Promise<string>) => Promise<{
137
+ provider: HarnessProvider;
138
+ model: string;
139
+ } | undefined>;
194
140
  export type DoctorCheckStatus = "pass" | "warn" | "fail";
195
141
  export interface DoctorCheck {
196
142
  id: string;