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

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 (236) hide show
  1. package/CHANGELOG.md +109 -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/approvals/approval-diff.d.ts +45 -0
  10. package/dist/approvals/approval-history.d.ts +38 -0
  11. package/dist/approvals/approval-preview.d.ts +26 -0
  12. package/dist/cli/arguments.d.ts +103 -0
  13. package/dist/cli/changes.d.ts +2 -0
  14. package/dist/cli/cli-credentials.d.ts +38 -0
  15. package/dist/cli/cli-help.d.ts +3 -0
  16. package/dist/{cli-options.d.ts → cli/cli-options.d.ts} +1 -1
  17. package/dist/{cli-profiles.d.ts → cli/cli-profiles.d.ts} +1 -1
  18. package/dist/cli/configured-harness.d.ts +12 -0
  19. package/dist/cli/console/console-commands.d.ts +6 -0
  20. package/dist/{console-context.d.ts → cli/console/console-context.d.ts} +7 -3
  21. package/dist/cli/console/console-input.d.ts +68 -0
  22. package/dist/cli/console/console-model-catalog.d.ts +25 -0
  23. package/dist/cli/console/console-navigation.d.ts +27 -0
  24. package/dist/cli/console/console-presentation.d.ts +18 -0
  25. package/dist/cli/console/console-welcome.d.ts +13 -0
  26. package/dist/cli/console.d.ts +2 -0
  27. package/dist/cli/doctor.d.ts +50 -0
  28. package/dist/cli/errors.d.ts +7 -0
  29. package/dist/cli/help-text.d.ts +2 -0
  30. package/dist/cli/presentation.d.ts +23 -0
  31. package/dist/cli/resume-metadata.d.ts +12 -0
  32. package/dist/cli/routing.d.ts +6 -0
  33. package/dist/cli/run-commands.d.ts +4 -0
  34. package/dist/cli/run-document.d.ts +91 -0
  35. package/dist/cli/run-management.d.ts +2 -0
  36. package/dist/cli/service-client-cli.d.ts +2 -0
  37. package/dist/cli/session-management.d.ts +8 -0
  38. package/dist/cli/setup.d.ts +16 -0
  39. package/dist/cli/state.d.ts +2 -0
  40. package/dist/cli/terminal/terminal-continuation.d.ts +3 -0
  41. package/dist/{terminal-markdown.d.ts → cli/terminal/terminal-markdown.d.ts} +1 -0
  42. package/dist/{terminal-ui.d.ts → cli/terminal/terminal-ui.d.ts} +7 -0
  43. package/dist/cli/terminal/tool-activity.d.ts +19 -0
  44. package/dist/cli.d.ts +33 -238
  45. package/dist/cli.js +16049 -12066
  46. package/dist/client/adapter.d.ts +4 -0
  47. package/dist/client/index.d.ts +15 -0
  48. package/dist/client/local-service.d.ts +34 -0
  49. package/dist/client/protocol.d.ts +205 -0
  50. package/dist/client/service-events.d.ts +50 -0
  51. package/dist/{context-engineering.d.ts → context/context-engineering.d.ts} +2 -2
  52. package/dist/{execution-environment.d.ts → execution/execution-environment.d.ts} +8 -4
  53. package/dist/hostile-repository-demo.js +2025 -897
  54. package/dist/index.d.ts +48 -41
  55. package/dist/index.js +7541 -5906
  56. package/dist/internal/desktop/persistence.d.ts +14 -0
  57. package/dist/internal/desktop/protocol.d.ts +8 -0
  58. package/dist/internal/desktop/providers.d.ts +6 -0
  59. package/dist/internal/desktop/runtime.d.ts +7 -0
  60. package/dist/{operations.d.ts → persistence/operations.d.ts} +24 -2
  61. package/dist/persistence/persistence-secrets.d.ts +2 -0
  62. package/dist/persistence/recorded-workspace.d.ts +4 -0
  63. package/dist/{sessions.d.ts → persistence/sessions.d.ts} +3 -0
  64. package/dist/persistence/sqlite-access.d.ts +26 -0
  65. package/dist/{sqlite-database.d.ts → persistence/sqlite-database.d.ts} +2 -0
  66. package/dist/{state-backup.d.ts → persistence/state-backup.d.ts} +9 -1
  67. package/dist/{capabilities.d.ts → providers/capabilities.d.ts} +1 -1
  68. package/dist/{routing.d.ts → providers/routing.d.ts} +1 -1
  69. package/dist/{config.d.ts → runtime/config.d.ts} +1 -1
  70. package/dist/{harness.d.ts → runtime/harness.d.ts} +12 -135
  71. package/dist/{orchestration.d.ts → runtime/orchestration.d.ts} +3 -0
  72. package/dist/{runtime-policy.d.ts → runtime/runtime-policy.d.ts} +1 -1
  73. package/dist/runtime/usage-ledger.d.ts +84 -0
  74. package/dist/service-cli.d.ts +2 -0
  75. package/dist/service-cli.js +10899 -0
  76. package/dist/tools/execution.d.ts +47 -0
  77. package/dist/tools/shared.d.ts +67 -0
  78. package/dist/tools/workspace.d.ts +85 -0
  79. package/dist/verify-historical-migrations.js +5786 -5265
  80. package/dist/{workspace.d.ts → workspace/workspace.d.ts} +22 -0
  81. package/dist/zhx.js +16049 -12066
  82. package/docs/CLI.md +151 -30
  83. package/docs/CLIENT_PROTOCOL.md +212 -0
  84. package/docs/CREDENTIALS.md +59 -0
  85. package/docs/DURABLE_OPERATIONS.md +2 -2
  86. package/docs/FIRST_USE.md +82 -0
  87. package/docs/FIRST_USE_EXAMPLE.md +40 -0
  88. package/docs/HOSTILE_REPOSITORY_DEMO.md +1 -1
  89. package/docs/LOCAL_SERVICE.md +142 -0
  90. package/docs/README.md +24 -23
  91. package/docs/THREAT_MODEL.md +1 -1
  92. package/docs/TIME_TO_SAFE_FIX.md +2 -2
  93. package/docs/USAGE.md +181 -0
  94. package/evaluations/daily-cli-cohort.json +33 -0
  95. package/evaluations/representative-assembly-matrix.json +28 -1
  96. package/examples/README.md +26 -0
  97. package/examples/first-use/greeting.test.ts +3 -0
  98. package/examples/first-use/greeting.ts +1 -0
  99. package/examples/first-use/package.json +7 -0
  100. package/package.json +39 -11
  101. package/ROADMAP.md +0 -414
  102. package/benchmarks/baselines/context-navigation-2026-09-09.json +0 -94
  103. package/benchmarks/baselines/efficiency-2026-09-08.json +0 -233
  104. package/benchmarks/baselines/external-final-2026-09-08.json +0 -588
  105. package/benchmarks/baselines/external-intermediate-2026-09-08.json +0 -116
  106. package/benchmarks/baselines/external-matched-openai-2026-09-08.json +0 -1922
  107. package/benchmarks/baselines/external-matched-qwen-2026-09-08.json +0 -1706
  108. package/benchmarks/baselines/external-pilot-2026-09-08.json +0 -439
  109. package/benchmarks/baselines/external-qwen-flash-2026-09-08.json +0 -1570
  110. package/benchmarks/baselines/external-qwen-remediation-2026-09-09.json +0 -1509
  111. package/benchmarks/baselines/external-qwen-sdk-114-progress-2026-09-09.json +0 -2509
  112. package/benchmarks/baselines/external-sdk-upgrade-2026-09-08.json +0 -564
  113. package/benchmarks/baselines/external-verifier-recovery-2026-09-09.json +0 -794
  114. package/benchmarks/baselines/full-harness-review-2026-09-10.json +0 -134
  115. package/benchmarks/baselines/harness-audit-2026-09-09.json +0 -136
  116. package/benchmarks/baselines/harness-remediation-2026-09-09.json +0 -160
  117. package/benchmarks/baselines/oci-remediation-2026-09-10.json +0 -535
  118. package/benchmarks/baselines/rc14-holdout-2026-09-10.json +0 -854
  119. package/benchmarks/baselines/repair-architecture-audit-2026-09-09.json +0 -75
  120. package/benchmarks/baselines/time-to-safe-fix-live-expanded-2026-08-21.json +0 -186
  121. package/benchmarks/baselines/time-to-safe-fix-live-smoke-2026-08-21.json +0 -186
  122. package/dist/console-input.d.ts +0 -28
  123. package/docs/GA_READINESS.md +0 -29
  124. package/docs/GEMINI_1_0_DECISION.md +0 -9
  125. package/docs/LIVE_CERTIFICATION.md +0 -107
  126. package/docs/RC13_SECURITY_REVIEW.md +0 -28
  127. package/docs/RC14_DELEGATED_SECURITY_DECISION.md +0 -80
  128. package/docs/RC14_SECURITY_REVIEW.md +0 -40
  129. package/docs/RELEASE.md +0 -96
  130. package/docs/ROLLBACK.md +0 -9
  131. package/docs/SECURITY_REVIEW_EVIDENCE.md +0 -17
  132. package/docs/ga-readiness.json +0 -366
  133. package/docs/reports/EFFICIENCY_REVIEW.md +0 -156
  134. package/docs/reports/EXTERNAL_COMPARISON.md +0 -434
  135. package/docs/reports/FULL_HARNESS_REVIEW_2026-09-10.md +0 -200
  136. package/docs/reports/GA_BUDGET_REMEDIATION_2026-09-19.md +0 -38
  137. package/docs/reports/GA_REPAIR_RECOVERY_2026-09-19.md +0 -700
  138. package/docs/reports/GA_VALIDATION_2026-09-19.md +0 -111
  139. package/docs/reports/HARNESS_ARCHITECTURE_REVIEW_2026-09-09.md +0 -202
  140. package/docs/reports/HARNESS_AUDIT_2026-09-09.md +0 -306
  141. package/docs/reports/HARNESS_REMEDIATION_2026-09-09.md +0 -74
  142. package/docs/reports/HARNESS_REMEDIATION_2026-09-10.md +0 -90
  143. package/docs/reports/MODEL_COMPARISON_2026-09-09.md +0 -184
  144. package/docs/reports/QWEN_REMEDIATION_COMPARISON_2026-09-09.md +0 -142
  145. package/docs/reports/RC14_VALIDATION_2026-09-10.md +0 -45
  146. package/docs/reports/README.md +0 -26
  147. package/docs/reports/evidence/ga-budget-remediation-2026-09-19.json +0 -133
  148. package/docs/reports/evidence/ga-catalog-ablation-2026-09-19.json +0 -699
  149. package/docs/reports/evidence/ga-catalog-ablation-plan-2026-09-19.json +0 -40
  150. package/docs/reports/evidence/ga-catalog-observed-2026-09-19.json +0 -985
  151. package/docs/reports/evidence/ga-catalog-observed-plan-2026-09-19.json +0 -28
  152. package/docs/reports/evidence/ga-catalog-observed-status-2026-09-19.json +0 -15
  153. package/docs/reports/evidence/ga-complete-local-check-2026-09-19.json +0 -47
  154. package/docs/reports/evidence/ga-completion-reminder-2026-09-19.json +0 -22
  155. package/docs/reports/evidence/ga-fresh-cohort-plan-2026-09-19.json +0 -54
  156. package/docs/reports/evidence/ga-fresh-cohort-preparation-2026-09-19.json +0 -242
  157. package/docs/reports/evidence/ga-fresh-cohort-result-2026-09-19.json +0 -4318
  158. package/docs/reports/evidence/ga-local-validation-followup-2026-09-19.json +0 -66
  159. package/docs/reports/evidence/ga-node-consumers-2026-09-19.json +0 -31
  160. package/docs/reports/evidence/ga-package-content-validation-2026-09-19.json +0 -22
  161. package/docs/reports/evidence/ga-plan-completion-2026-09-19.json +0 -39
  162. package/docs/reports/evidence/ga-plan-reserve-2026-09-19.json +0 -573
  163. package/docs/reports/evidence/ga-plan-reserve-plan-2026-09-19.json +0 -24
  164. package/docs/reports/evidence/ga-plan-transition-2026-09-19.json +0 -19
  165. package/docs/reports/evidence/ga-private-verifier-plan-2026-09-19.json +0 -24
  166. package/docs/reports/evidence/ga-private-verifier-root-cause-2026-09-19.json +0 -41
  167. package/docs/reports/evidence/ga-published-sdk-2026-09-19.json +0 -35
  168. package/docs/reports/evidence/ga-python-checkout-imports-2026-09-19.json +0 -95
  169. package/docs/reports/evidence/ga-python-origin-delivery-2026-09-19.json +0 -211
  170. package/docs/reports/evidence/ga-python-origin-delivery-plan-2026-09-19.json +0 -27
  171. package/docs/reports/evidence/ga-qwen-patched-package-2026-09-19.json +0 -1092
  172. package/docs/reports/evidence/ga-qwen-patched-package-plan-2026-09-19.json +0 -18
  173. package/docs/reports/evidence/ga-qwen-published-2026-09-19.json +0 -571
  174. package/docs/reports/evidence/ga-qwen-published-plan-2026-09-19.json +0 -18
  175. package/docs/reports/evidence/ga-qwen-tool-choice-2026-09-19.json +0 -85
  176. package/docs/reports/evidence/ga-qwen-tool-choice-patched-2026-09-19.json +0 -85
  177. package/docs/reports/evidence/ga-recovery-development-2026-09-19.json +0 -1066
  178. package/docs/reports/evidence/ga-recovery-graded-development-2026-09-19.json +0 -1313
  179. package/docs/reports/evidence/ga-recovery-graded-v2-2026-09-19.json +0 -1151
  180. package/docs/reports/evidence/ga-recovery-v3-2026-09-19.json +0 -3943
  181. package/docs/reports/evidence/ga-recovery-v4-2026-09-19.json +0 -1055
  182. package/docs/reports/evidence/ga-recovery-v5-2026-09-19.json +0 -1245
  183. package/docs/reports/evidence/ga-recovery-v6-2026-09-19.json +0 -699
  184. package/docs/reports/evidence/ga-recovery-v7-2026-09-19.json +0 -854
  185. package/docs/reports/evidence/ga-recovery-v8-2026-09-19.json +0 -596
  186. package/docs/reports/evidence/ga-required-delivery-2026-09-19.json +0 -25
  187. package/docs/reports/evidence/ga-required-delivery-live-2026-09-19.json +0 -1337
  188. package/docs/reports/evidence/ga-required-delivery-live-plan-2026-09-19.json +0 -25
  189. package/docs/reports/evidence/ga-retained-candidate-grading-2026-09-19.json +0 -30
  190. package/docs/reports/evidence/ga-tool-selection-live-2026-09-19.json +0 -559
  191. package/docs/reports/evidence/ga-tool-selection-live-plan-2026-09-19.json +0 -28
  192. package/docs/reports/evidence/ga-tool-selection-recovery-2026-09-19.json +0 -27
  193. package/docs/reports/evidence/ga-validation-2026-09-19.json +0 -236
  194. package/docs/reports/evidence/ga-verifier-discovery-live-2026-09-19.json +0 -1369
  195. package/docs/reports/evidence/ga-verifier-discovery-plan-2026-09-19.json +0 -29
  196. package/docs/reports/evidence/ga-verifier-failure-identification-2026-09-19.json +0 -30
  197. package/docs/reports/evidence/ga-verifier-feedback-2026-09-19.json +0 -65
  198. package/docs/reports/evidence/ga-verifier-hints-live-2026-09-19.json +0 -1297
  199. package/docs/reports/evidence/ga-verifier-hints-plan-2026-09-19.json +0 -27
  200. package/docs/reports/evidence/ga-work-boundary-context-analysis-2026-09-19.json +0 -113
  201. package/docs/reports/evidence/ga-work-boundary-live-2026-09-19.json +0 -301
  202. package/docs/reports/evidence/ga-work-boundary-live-plan-2026-09-19.json +0 -84
  203. package/docs/reports/evidence/ga-work-budget-planning-2026-09-19.json +0 -32
  204. package/docs/reports/evidence/ga-working-context-2026-09-19.json +0 -22
  205. package/docs/reports/evidence/rc14-delegated-security-review-2026-09-20.json +0 -81
  206. package/docs/reports/evidence/rc14-ga-gate-2026-09-20.json +0 -18
  207. package/docs/reports/evidence/rc14-representative-2026-09-20.json +0 -509
  208. package/docs/reports/evidence/rc14-security-regressions-2026-09-20.json +0 -64
  209. package/docs/reports/evidence/security-current-2026-09-19.json +0 -91
  210. package/docs/reports/evidence/security-remediation-2026-09-19.json +0 -97
  211. /package/dist/{cli-stream.d.ts → cli/cli-stream.d.ts} +0 -0
  212. /package/dist/{json-contracts.d.ts → client/json-contracts.d.ts} +0 -0
  213. /package/dist/{compaction.d.ts → context/compaction.d.ts} +0 -0
  214. /package/dist/{context-metrics.d.ts → context/context-metrics.d.ts} +0 -0
  215. /package/dist/{task-memory.d.ts → context/task-memory.d.ts} +0 -0
  216. /package/dist/{package-manager.d.ts → execution/package-manager.d.ts} +0 -0
  217. /package/dist/{process-runtime.d.ts → execution/process-runtime.d.ts} +0 -0
  218. /package/dist/{mcp.d.ts → integrations/mcp.d.ts} +0 -0
  219. /package/dist/{state-directory.d.ts → persistence/state-directory.d.ts} +0 -0
  220. /package/dist/{providers.d.ts → providers/providers.d.ts} +0 -0
  221. /package/dist/{errors.d.ts → runtime/errors.d.ts} +0 -0
  222. /package/dist/{model-budget.d.ts → runtime/model-budget.d.ts} +0 -0
  223. /package/dist/{repair-controller.d.ts → runtime/repair-controller.d.ts} +0 -0
  224. /package/dist/{repair-progress.d.ts → runtime/repair-progress.d.ts} +0 -0
  225. /package/dist/{repair-verifier.d.ts → runtime/repair-verifier.d.ts} +0 -0
  226. /package/dist/{run-interruption.d.ts → runtime/run-interruption.d.ts} +0 -0
  227. /package/dist/{runtime-checkpoints.d.ts → runtime/runtime-checkpoints.d.ts} +0 -0
  228. /package/dist/{runtime-diagnostics.d.ts → runtime/runtime-diagnostics.d.ts} +0 -0
  229. /package/dist/{time-to-safe-fix.d.ts → runtime/time-to-safe-fix.d.ts} +0 -0
  230. /package/dist/{tool-registry.d.ts → tools/tool-registry.d.ts} +0 -0
  231. /package/dist/{bounded-reads.d.ts → workspace/bounded-reads.d.ts} +0 -0
  232. /package/dist/{change-envelope.d.ts → workspace/change-envelope.d.ts} +0 -0
  233. /package/dist/{edit-contracts.d.ts → workspace/edit-contracts.d.ts} +0 -0
  234. /package/dist/{file-security.d.ts → workspace/file-security.d.ts} +0 -0
  235. /package/dist/{replacement-edits.d.ts → workspace/replacement-edits.d.ts} +0 -0
  236. /package/dist/{workspace-mutation-lock.d.ts → workspace/workspace-mutation-lock.d.ts} +0 -0
@@ -0,0 +1,45 @@
1
+ import { z } from "zod";
2
+ import type { AgentRunState } from "@zhivex-ai/core";
3
+ import type { HarnessClientRun } from "../client/protocol.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/execution-environment.js";
2
+ import type { AgentStoreScope } from "@zhivex-ai/core";
3
+ import type { Workspace } from "../workspace/workspace.js";
4
+ import type { HarnessClientRun } from "../client/protocol.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,103 @@
1
+ import { type AgentStatus } from "@zhivex-ai/agents";
2
+ import { type HarnessSubagentProfile } from "../runtime/config.js";
3
+ import { HarnessError } from "../runtime/errors.js";
4
+ export declare const CLI_COMMANDS: readonly ["init", "run", "review", "chat", "providers", "doctor", "resume", "runs", "sessions", "changes", "state", "help", "version"];
5
+ export declare const CLI_RUNS_COMMANDS: readonly ["list", "inspect", "cancel", "cleanup", "export"];
6
+ export declare const CLI_SESSIONS_COMMANDS: readonly ["list", "inspect", "rename", "fork", "archive"];
7
+ export declare const CLI_CHANGES_COMMANDS: readonly ["create", "verify"];
8
+ export declare const CLI_STATE_COMMANDS: readonly ["status", "export", "import"];
9
+ type Command = (typeof CLI_COMMANDS)[number];
10
+ type RunsCommand = (typeof CLI_RUNS_COMMANDS)[number];
11
+ type SessionsCommand = (typeof CLI_SESSIONS_COMMANDS)[number];
12
+ type ChangesCommand = (typeof CLI_CHANGES_COMMANDS)[number];
13
+ type StateCommand = (typeof CLI_STATE_COMMANDS)[number];
14
+ export interface CliOptions {
15
+ serviceFile?: string;
16
+ command: Command;
17
+ helpTopic?: string;
18
+ profile?: string;
19
+ provider?: string;
20
+ model?: string;
21
+ workspace?: string;
22
+ stateDirectory?: string;
23
+ storeBackend?: string;
24
+ tenantId?: string;
25
+ userId?: string;
26
+ namespace?: string;
27
+ maxSteps?: number;
28
+ timeoutMs?: number;
29
+ maxToolCalls?: number;
30
+ maxToolErrors?: number;
31
+ maxInputTokens?: number;
32
+ maxOutputTokens?: number;
33
+ maxTotalTokens?: number;
34
+ maxCostUsd?: number;
35
+ inputCostPerMillion?: number;
36
+ outputCostPerMillion?: number;
37
+ allowedChecks?: string[];
38
+ requiredCapabilities?: string[];
39
+ subagentProfiles?: HarnessSubagentProfile[];
40
+ reviewers?: HarnessSubagentProfile[];
41
+ routes?: string[];
42
+ subagentMaxSteps?: number;
43
+ subagentMaxToolCalls?: number;
44
+ subagentMaxToolErrors?: number;
45
+ subagentMaxInputTokens?: number;
46
+ subagentMaxOutputTokens?: number;
47
+ subagentMaxTotalTokens?: number;
48
+ subagentTimeoutMs?: number;
49
+ maxParallelReviews?: number;
50
+ executionBackend?: string;
51
+ agentProfile?: string;
52
+ ociRuntime?: string;
53
+ ociImage?: string;
54
+ ociAllowedCommands?: string[];
55
+ ociShellMode?: string;
56
+ ociMaxProcessRuntimeMs?: number;
57
+ ociMaxProcessOutputBytes?: number;
58
+ ociMaxMemoryMb?: number;
59
+ ociMaxPids?: number;
60
+ ociMaxCpus?: number;
61
+ ociMaxWorkspaceBytes?: number;
62
+ ociMaxFileWriteBytes?: number;
63
+ ociTmpfsMb?: number;
64
+ mcpConfigPath?: string;
65
+ contextConfigPath?: string;
66
+ projectContext?: boolean;
67
+ prompt?: string;
68
+ runId?: string;
69
+ idempotencyKey?: string;
70
+ runsCommand?: RunsCommand;
71
+ sessionsCommand?: SessionsCommand;
72
+ changesCommand?: ChangesCommand;
73
+ stateCommand?: StateCommand;
74
+ artifactPath?: string;
75
+ patchPath?: string;
76
+ preconditionsPath?: string;
77
+ verificationTime?: string;
78
+ backupPath?: string;
79
+ sessionId?: string;
80
+ sessionTitle?: string;
81
+ sessionSearch?: string;
82
+ pricingFile?: string;
83
+ usageLimitUsd?: number;
84
+ continueSession: boolean;
85
+ implicitCommand: boolean;
86
+ statuses?: AgentStatus[];
87
+ limit?: number;
88
+ cursor?: string;
89
+ before?: number;
90
+ reason?: string;
91
+ cascade: boolean;
92
+ final: boolean;
93
+ apply: boolean;
94
+ yes: boolean;
95
+ approve?: boolean;
96
+ json: boolean;
97
+ jsonl: boolean;
98
+ }
99
+ export declare class CliUsageError extends HarnessError {
100
+ constructor(message: string);
101
+ }
102
+ export declare const parseCliArgs: (argv: string[]) => CliOptions;
103
+ export {};
@@ -0,0 +1,2 @@
1
+ import { type CliOptions } from "./arguments.js";
2
+ export declare const manageChanges: (options: CliOptions) => Promise<void>;
@@ -0,0 +1,38 @@
1
+ import { type HarnessProvider } from "../runtime/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("../runtime/config.js").createProviderModel): Promise<import("@zhivex-ai/agents").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: {
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { type HarnessConfigInput, type HarnessProvider } from "./config.js";
2
+ import { type HarnessConfigInput, type HarnessProvider } from "../runtime/config.js";
3
3
  export declare const CLI_PROFILE_SCHEMA_VERSION: 1;
4
4
  export declare const CLI_PROFILE_CONFIG_DIRECTORY_ENV: "ZHIVEX_HARNESS_CONFIG_DIR";
5
5
  export declare const MAX_CLI_PROFILE_BYTES: number;
@@ -0,0 +1,12 @@
1
+ import { CliCredentials } from "./cli-credentials.js";
2
+ import { ConsoleInput } from "./console/console-input.js";
3
+ import { type HarnessSubagentProfile } from "../runtime/config.js";
4
+ import { type HarnessModelRoute } from "../providers/routing.js";
5
+ import { type CliOptions } from "./arguments.js";
6
+ export declare const createConfiguredHarness: (options: CliOptions, extraProfiles?: readonly HarnessSubagentProfile[], persistedRoutes?: ReadonlyMap<HarnessSubagentProfile, HarnessModelRoute>, credentials?: {
7
+ store: CliCredentials;
8
+ input: ConsoleInput;
9
+ }) => Promise<{
10
+ harness: import("../index.js").ZhivexHarness;
11
+ routes: ReadonlyMap<"explorer" | "implementer" | "reviewer" | "tester", HarnessModelRoute>;
12
+ }>;
@@ -0,0 +1,6 @@
1
+ /** Presentation shared by the direct console and the local-service client. */
2
+ export declare const CONSOLE_COMMAND_CATALOG: readonly [readonly ["/menu", "Open navigation menu", true], readonly ["/help", "Show commands; /help all shows everything", true], readonly ["/credentials", "Manage provider keys in the system keychain or this session", false], readonly ["/provider", "Select a provider", false], readonly ["/model", "Select a model", false], readonly ["/route", "Configure specialist model routes", false], readonly ["/status", "Inspect the current session and run", true], readonly ["/diff", "Review workspace changes", false], readonly ["/review", "Review a task", false], readonly ["/resume", "Reopen a conversation by session ID", true], readonly ["/pending", "Inspect pending approvals", true], readonly ["/approve", "Approve the pending actions", true], readonly ["/deny", "Deny the pending actions", true], readonly ["/compact", "Compact conversation context", false], readonly ["/new", "Start a new conversation", true], readonly ["/rename", "Rename the current conversation", true], readonly ["/clear", "Clear conversation context", false], readonly ["/exit", "Exit the console", true], readonly ["/paste", "Compose a literal multiline draft", true], readonly ["/verbose", "Toggle full or compact activity details", false], readonly ["/context", "Inspect project rules and selected context", false], readonly ["/attach", "Attach a workspace file to the next request", false], readonly ["/attachments", "List selected attachments", false], readonly ["/detach", "Remove selected attachments", false], readonly ["/sessions", "Find saved conversations", true], readonly ["/usage", "Inspect transport usage", false], readonly ["/cancel", "Cancel the active run", true]];
3
+ export type ConsoleMode = "direct" | "service";
4
+ export declare const consoleCommands: (mode?: ConsoleMode) => (readonly ["/approve", "Approve the pending actions", true] | readonly ["/attach", "Attach a workspace file to the next request", false] | readonly ["/attachments", "List selected attachments", false] | readonly ["/cancel", "Cancel the active run", true] | readonly ["/clear", "Clear conversation context", false] | readonly ["/compact", "Compact conversation context", false] | readonly ["/context", "Inspect project rules and selected context", false] | readonly ["/credentials", "Manage provider keys in the system keychain or this session", false] | readonly ["/deny", "Deny the pending actions", true] | readonly ["/detach", "Remove selected attachments", false] | readonly ["/diff", "Review workspace changes", false] | readonly ["/exit", "Exit the console", true] | readonly ["/help", "Show commands; /help all shows everything", true] | readonly ["/menu", "Open navigation menu", true] | readonly ["/model", "Select a model", false] | readonly ["/new", "Start a new conversation", true] | readonly ["/paste", "Compose a literal multiline draft", true] | readonly ["/pending", "Inspect pending approvals", true] | readonly ["/provider", "Select a provider", false] | readonly ["/rename", "Rename the current conversation", true] | readonly ["/resume", "Reopen a conversation by session ID", true] | readonly ["/review", "Review a task", false] | readonly ["/route", "Configure specialist model routes", false] | readonly ["/sessions", "Find saved conversations", true] | readonly ["/status", "Inspect the current session and run", true] | readonly ["/usage", "Inspect transport usage", false] | readonly ["/verbose", "Toggle full or compact activity details", false])[];
5
+ export declare const searchConsoleCommands: (query: string, mode?: ConsoleMode) => (readonly ["/approve", "Approve the pending actions", true] | readonly ["/attach", "Attach a workspace file to the next request", false] | readonly ["/attachments", "List selected attachments", false] | readonly ["/cancel", "Cancel the active run", true] | readonly ["/clear", "Clear conversation context", false] | readonly ["/compact", "Compact conversation context", false] | readonly ["/context", "Inspect project rules and selected context", false] | readonly ["/credentials", "Manage provider keys in the system keychain or this session", false] | readonly ["/deny", "Deny the pending actions", true] | readonly ["/detach", "Remove selected attachments", false] | readonly ["/diff", "Review workspace changes", false] | readonly ["/exit", "Exit the console", true] | readonly ["/help", "Show commands; /help all shows everything", true] | readonly ["/menu", "Open navigation menu", true] | readonly ["/model", "Select a model", false] | readonly ["/new", "Start a new conversation", true] | readonly ["/paste", "Compose a literal multiline draft", true] | readonly ["/pending", "Inspect pending approvals", true] | readonly ["/provider", "Select a provider", false] | readonly ["/rename", "Rename the current conversation", true] | readonly ["/resume", "Reopen a conversation by session ID", true] | readonly ["/review", "Review a task", false] | readonly ["/route", "Configure specialist model routes", false] | readonly ["/sessions", "Find saved conversations", true] | readonly ["/status", "Inspect the current session and run", true] | readonly ["/usage", "Inspect transport usage", false] | readonly ["/verbose", "Toggle full or compact activity details", false])[];
6
+ export declare const formatConsoleHelp: (mode?: ConsoleMode, all?: boolean) => string;
@@ -1,6 +1,10 @@
1
- import type { ZhivexHarness } from "./harness.js";
2
- import type { Workspace } from "./workspace.js";
3
- export declare const formatConsoleContext: (context: ZhivexHarness["context"]) => string;
1
+ import type { ZhivexHarness } from "../../runtime/harness.js";
2
+ import type { Workspace } from "../../workspace/workspace.js";
3
+ export declare const formatConsoleContext: (context: ZhivexHarness["context"], options?: {
4
+ attachments: ReturnType<ConsoleAttachments["list"]>;
5
+ config: ZhivexHarness["config"];
6
+ messages: unknown[];
7
+ }) => string;
4
8
  export declare const formatConsoleDiff: (diff: string, color: boolean) => string;
5
9
  /** Explicit attachments use the same bounded, secret-excluding reads as model tools. */
6
10
  export declare class ConsoleAttachments {
@@ -0,0 +1,68 @@
1
+ import { type Readable, Writable } from "node:stream";
2
+ import { type ConsoleMode } from "./console-commands.js";
3
+ export declare const CONSOLE_COMMANDS: ("/approve" | "/attach" | "/attachments" | "/cancel" | "/clear" | "/compact" | "/context" | "/credentials" | "/deny" | "/detach" | "/diff" | "/exit" | "/help" | "/menu" | "/model" | "/new" | "/paste" | "/pending" | "/provider" | "/rename" | "/resume" | "/review" | "/route" | "/sessions" | "/status" | "/usage" | "/verbose")[];
4
+ export declare const MAX_CONSOLE_INPUT_BYTES: number;
5
+ export declare const completeConsoleCommand: (line: string) => [string[], string];
6
+ /** Lines received without an active question are discarded, never replayed as approvals. */
7
+ export declare class ConsoleInput {
8
+ private readonly input;
9
+ private readonly output;
10
+ private readonly terminal;
11
+ private readonly mode;
12
+ private hidden;
13
+ private readonly reader;
14
+ private readonly keyboard;
15
+ private readonly display;
16
+ private readonly decoder;
17
+ private escape;
18
+ private clipboard;
19
+ private clipboardBytes;
20
+ private clipboardAllowed;
21
+ private draftWasPaste;
22
+ lastSubmissionWasPaste: boolean;
23
+ private closed;
24
+ private completeCommands;
25
+ private history;
26
+ private historyPosition;
27
+ private historyDraft;
28
+ private historyDraftWasPaste;
29
+ private pending;
30
+ private paste;
31
+ onInterrupt: (() => void) | undefined;
32
+ constructor(input: Readable, output: Writable, terminal?: boolean, mode?: ConsoleMode);
33
+ private selection;
34
+ private selectionMatches;
35
+ private finishSelection;
36
+ select<T>(title: string, items: readonly {
37
+ value: T;
38
+ label: string;
39
+ detail?: string;
40
+ }[]): Promise<T | undefined>;
41
+ private taskPrompt;
42
+ private shortcutsShown;
43
+ private historySearch;
44
+ private historyMatches;
45
+ private finishHistorySearch;
46
+ private menuVisible;
47
+ private menuSelection;
48
+ private menuQuery;
49
+ private menuDismissed;
50
+ private escapeMenuTimer;
51
+ private standaloneMenuEscape;
52
+ private hideMenu;
53
+ private renderMenu;
54
+ private readonly onEnd;
55
+ private readonly onResize;
56
+ private finishSecret;
57
+ secret(prompt: string): Promise<string>;
58
+ private readonly onData;
59
+ private insert;
60
+ private readonly onKeypress;
61
+ rememberPrompt(prompt: string, literal?: boolean): void;
62
+ clearHistory(): void;
63
+ private interrupt;
64
+ get isClosed(): boolean;
65
+ question(prompt: string, completeCommands?: boolean): Promise<string>;
66
+ multiline(): Promise<string>;
67
+ close(): void;
68
+ }
@@ -0,0 +1,25 @@
1
+ export declare const CONSOLE_MODEL_CATALOG: {
2
+ readonly sdkVersion: "1.25.1";
3
+ readonly providers: {
4
+ readonly openai: {
5
+ readonly revision: "2026-09-12";
6
+ readonly sourceSha256: "af33783afbf76d7fd12776a2a19244663c286a0f7bc6f05549e2ffe8a3e41900";
7
+ readonly models: readonly ["gpt-6-astra", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5", "gpt-5.4", "gpt-5.4-mini", "gpt-4o-mini"];
8
+ };
9
+ readonly qwen: {
10
+ readonly revision: "2026-09-20";
11
+ readonly sourceSha256: "f52a311095ad69f94bdfdbb71f7011ec7e19d24a5c7d7a116f53d7d13c8c6008";
12
+ readonly models: readonly ["qwen3.8-omni-flash", "qwen3.8-max-0902", "qwen3.8-max", "qwen3.8-flash", "qwen3.8-max-preview", "qwen3.7-max", "qwen3.7-plus", "qwen3.6-flash", "qwen3.5-omni-plus", "qwen-plus"];
13
+ };
14
+ readonly gemini: {
15
+ readonly revision: "2026-09-16";
16
+ readonly sourceSha256: "ef26943ffd54a786e06f232adf06585ccfdddb6450dd090b2e7bc01d668153b4";
17
+ readonly models: readonly ["gemini-3.8-flash", "gemini-3.7-flash", "gemini-3.6-flash", "gemini-3.5-flash-lite", "gemini-3.5-flash", "gemini-3.1-pro-preview", "gemini-3.1-pro-preview-customtools", "gemini-3-flash-preview", "gemini-3.1-flash-lite"];
18
+ };
19
+ readonly meta: {
20
+ readonly revision: "2026-09-04";
21
+ readonly sourceSha256: "0e655bb5cee4dd5430336bec10d1a9cfb08a4fdc5902c211d91599f6f92492f6";
22
+ readonly models: readonly ["muse-spark-1.3", "muse-spark-1.2", "muse-spark-1.2-contributor", "muse-spark-1.1"];
23
+ };
24
+ };
25
+ };
@@ -0,0 +1,27 @@
1
+ import type { ConsoleInput } from "./console-input.js";
2
+ import type { ProviderAvailability } from "../../providers/providers.js";
3
+ export declare const consoleModelChoices: (provider: string, defaultModel: string, current?: string) => {
4
+ value: string;
5
+ label: string;
6
+ detail: string;
7
+ }[];
8
+ export type ConsoleNavigationResult = {
9
+ command: string;
10
+ } | {
11
+ provider: string;
12
+ model: string;
13
+ };
14
+ export declare const navigateConsole: (input: Pick<ConsoleInput, "select" | "question">, options: {
15
+ entry: "menu" | "provider" | "model";
16
+ current: {
17
+ provider: string;
18
+ model: string;
19
+ };
20
+ providers: readonly ProviderAvailability[];
21
+ sessions: () => Promise<readonly {
22
+ value: string;
23
+ label: string;
24
+ detail?: string;
25
+ }[]>;
26
+ service?: boolean;
27
+ }) => Promise<ConsoleNavigationResult | undefined>;
@@ -0,0 +1,18 @@
1
+ /** Bound presentation metadata without allowing paths/titles to control the terminal. */
2
+ export declare const consoleLabel: (text: string, width: number) => string;
3
+ export declare const formatComposer: (input: {
4
+ model: string;
5
+ title?: string;
6
+ status: string;
7
+ attachments?: number;
8
+ automaticApprovals?: boolean;
9
+ }, columns?: number, color?: boolean) => string;
10
+ export declare const CONSOLE_SHORTCUTS: string;
11
+ export declare const chooseConsoleItem: <T>(title: string, items: readonly {
12
+ value: T;
13
+ label: string;
14
+ detail?: string;
15
+ }[], io: {
16
+ write(text: string): void;
17
+ ask(prompt: string): Promise<string>;
18
+ }) => Promise<T | undefined>;
@@ -0,0 +1,13 @@
1
+ export declare const ZHIVEX_TERMINAL_LOGO: string;
2
+ export declare const formatConsoleWelcome: (input: {
3
+ version: string;
4
+ workspace: string;
5
+ sessionId?: string;
6
+ sessionTitle?: string;
7
+ provider?: string;
8
+ model?: string;
9
+ service?: boolean;
10
+ }, options?: {
11
+ color?: boolean;
12
+ columns?: number;
13
+ }) => string;
@@ -0,0 +1,2 @@
1
+ import { type CliOptions } from "./arguments.js";
2
+ export declare const chat: (options: CliOptions) => Promise<void>;
@@ -0,0 +1,50 @@
1
+ import { providerAvailability, resolveHarnessConfig, type HarnessProvider } from "../runtime/config.js";
2
+ import { type HarnessOciRuntimeAdapter } from "../execution/execution-environment.js";
3
+ import { CLI_JSON_SCHEMA_VERSION } from "./cli-stream.js";
4
+ export type DoctorCheckStatus = "pass" | "warn" | "fail";
5
+ export interface DoctorCheck {
6
+ id: string;
7
+ status: DoctorCheckStatus;
8
+ message: string;
9
+ details: Record<string, boolean | number | string | readonly string[]>;
10
+ }
11
+ import { type CliOptions } from "./arguments.js";
12
+ export interface DoctorReport {
13
+ schemaVersion: typeof CLI_JSON_SCHEMA_VERSION;
14
+ kind: "doctor";
15
+ ok: boolean;
16
+ harnessVersion: string;
17
+ configSchemaVersion: number;
18
+ configuration: {
19
+ provider: HarnessProvider;
20
+ model: string;
21
+ workspace: string;
22
+ stateDirectory: string;
23
+ storeBackend: string;
24
+ scope: ReturnType<typeof resolveHarnessConfig>["scope"];
25
+ maxSteps: number;
26
+ timeoutMs: number;
27
+ agentProfile: "strict" | "repair";
28
+ budget: ReturnType<typeof resolveHarnessConfig>["budget"];
29
+ costBudget?: ReturnType<typeof resolveHarnessConfig>["costBudget"];
30
+ compaction: ReturnType<typeof resolveHarnessConfig>["compaction"];
31
+ allowedChecks: readonly string[];
32
+ requiredCapabilities: ReturnType<typeof resolveHarnessConfig>["requiredCapabilities"];
33
+ orchestration: ReturnType<typeof resolveHarnessConfig>["orchestration"];
34
+ context: ReturnType<typeof resolveHarnessConfig>["context"];
35
+ execution: ReturnType<typeof resolveHarnessConfig>["execution"];
36
+ mcpConfigPath?: string;
37
+ };
38
+ checks: DoctorCheck[];
39
+ providers: ReturnType<typeof providerAvailability>;
40
+ }
41
+ export interface DoctorContext {
42
+ env?: NodeJS.ProcessEnv;
43
+ nodeVersion?: string;
44
+ /** @deprecated Test-only compatibility injection for the secondary Bun runtime. */
45
+ bunVersion?: string;
46
+ ociRuntimeAdapter?: HarnessOciRuntimeAdapter;
47
+ }
48
+ export declare const createDoctorReport: (options?: Pick<CliOptions, "provider" | "model" | "workspace" | "stateDirectory" | "storeBackend" | "tenantId" | "userId" | "namespace" | "maxSteps" | "agentProfile" | "timeoutMs" | "maxToolCalls" | "maxToolErrors" | "maxInputTokens" | "maxOutputTokens" | "maxTotalTokens" | "maxCostUsd" | "inputCostPerMillion" | "outputCostPerMillion" | "allowedChecks" | "requiredCapabilities" | "subagentProfiles" | "subagentMaxSteps" | "subagentMaxToolCalls" | "subagentMaxToolErrors" | "subagentMaxInputTokens" | "subagentMaxOutputTokens" | "subagentMaxTotalTokens" | "subagentTimeoutMs" | "maxParallelReviews" | "executionBackend" | "ociRuntime" | "ociImage" | "ociAllowedCommands" | "ociShellMode" | "ociMaxProcessRuntimeMs" | "ociMaxProcessOutputBytes" | "ociMaxMemoryMb" | "ociMaxPids" | "ociMaxCpus" | "ociMaxWorkspaceBytes" | "ociMaxFileWriteBytes" | "ociTmpfsMb" | "mcpConfigPath" | "contextConfigPath" | "projectContext">, context?: DoctorContext) => Promise<DoctorReport>;
49
+ export declare const formatDoctorReport: (report: DoctorReport) => string;
50
+ export declare const doctor: (options: CliOptions) => Promise<void>;
@@ -0,0 +1,7 @@
1
+ export declare const CLI_EXIT_CODES: {
2
+ readonly success: 0;
3
+ readonly runtimeError: 1;
4
+ readonly usageError: 2;
5
+ readonly doctorFailed: 3;
6
+ };
7
+ export declare const cliExitCodeForError: (error: unknown) => 1 | 2;
@@ -0,0 +1,2 @@
1
+ export declare const CLI_HELP_TEXT: string;
2
+ export declare const CLI_FULL_HELP_TEXT: string;
@@ -0,0 +1,23 @@
1
+ import { TerminalMarkdown } from "./terminal/terminal-markdown.js";
2
+ import { type AgentApprovalRequest, type AgentApprovalResponse, type AgentRunOutput, type AgentStreamEvent } from "@zhivex-ai/agents";
3
+ import { type HarnessRunOptions, type ZhivexHarness } from "../runtime/harness.js";
4
+ import { type AgentTelemetryObserver } from "@zhivex-ai/agents/ops";
5
+ import { type CliOptions } from "./arguments.js";
6
+ export declare const annotateCliStreamError: (error: unknown, lastSequence: number | undefined) => Error;
7
+ export declare const cliStreamErrorSequence: (error: unknown) => number;
8
+ export declare const terminalErrorMessage: (error: unknown) => string;
9
+ export declare const summarizeApproval: (approval: AgentApprovalRequest) => string;
10
+ export declare const approvalResponses: (approvals: readonly AgentApprovalRequest[], approve: boolean, reason: string) => AgentApprovalResponse[];
11
+ export declare const terminalApprovalResolver: (automaticallyApprove: boolean, ask?: (question: string) => Promise<string>) => NonNullable<HarnessRunOptions["resolveApprovals"]>;
12
+ export declare const printTerminalResult: (result: AgentRunOutput, harness: ZhivexHarness, output: Pick<CliOptions, "json" | "jsonl">, tracker: {
13
+ streamedText: boolean;
14
+ sequence?: number;
15
+ markdown?: TerminalMarkdown;
16
+ }) => void;
17
+ export declare const flushToolActivity: (tracker: object) => void | undefined;
18
+ export declare const streamSink: (output: Pick<CliOptions, "json" | "jsonl">, tracker: {
19
+ streamedText: boolean;
20
+ sequence?: number;
21
+ markdown?: TerminalMarkdown;
22
+ }, compact?: boolean) => (event: AgentStreamEvent) => Promise<void>;
23
+ export declare const orchestrationObserver: (json: boolean) => AgentTelemetryObserver;
@@ -0,0 +1,12 @@
1
+ import { type AgentRunInput, type AgentRunState } from "@zhivex-ai/agents";
2
+ import { type HarnessConfig, type HarnessConfigInput, type HarnessSubagentProfile } from "../runtime/config.js";
3
+ import { type HarnessModelRoute } from "../providers/routing.js";
4
+ import { type CliOptions } from "./arguments.js";
5
+ export declare const HARNESS_RESUME_METADATA_KEY: "zhivexHarnessResume";
6
+ export declare const HARNESS_RESUME_METADATA_SCHEMA_VERSION: 1;
7
+ export declare const harnessConfigInput: (config: HarnessConfig) => HarnessConfigInput;
8
+ export declare const persistedCliOptions: (input: HarnessConfigInput | undefined) => Partial<CliOptions>;
9
+ export declare const createHarnessResumeMetadata: (config: HarnessConfig, routes?: ReadonlyMap<HarnessSubagentProfile, HarnessModelRoute>) => NonNullable<AgentRunInput["metadata"]>;
10
+ export declare const readHarnessResumeConfig: (state: Pick<AgentRunState, "metadata">) => HarnessConfigInput | undefined;
11
+ export declare const readHarnessResumeRoutes: (state: Pick<AgentRunState, "metadata">) => Map<"explorer" | "implementer" | "reviewer" | "tester", HarnessModelRoute>;
12
+ export declare const resumeCommand: (runId: string, config: HarnessConfig, approve?: boolean) => string;
@@ -0,0 +1,6 @@
1
+ import { type HarnessConfig, type HarnessSubagentProfile } from "../runtime/config.js";
2
+ import { type HarnessModelRoute } from "../providers/routing.js";
3
+ import { type CliOptions } from "./arguments.js";
4
+ export declare const resolvedRouting: (options: CliOptions) => Map<"explorer" | "implementer" | "reviewer" | "tester", HarnessModelRoute>;
5
+ export declare const assertRoutePricingIsSafe: (routes: ReadonlyMap<HarnessSubagentProfile, HarnessModelRoute>, costBudget: HarnessConfig["costBudget"]) => void;
6
+ export declare const withTemporaryHarnessProfiles: <T>(profiles: readonly HarnessSubagentProfile[], configure: (profiles: readonly HarnessSubagentProfile[]) => Promise<void>, operation: () => Promise<T>) => Promise<T>;
@@ -0,0 +1,4 @@
1
+ import { type CliOptions } from "./arguments.js";
2
+ export declare const runOnce: (options: CliOptions) => Promise<void>;
3
+ export declare const reviewOnce: (options: CliOptions) => Promise<void>;
4
+ export declare const resumeRun: (options: CliOptions) => Promise<void>;