@zhivex-ai/harness 1.1.0-rc.2 → 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 (103) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/{approval-diff.d.ts → approvals/approval-diff.d.ts} +1 -1
  4. package/dist/{approval-preview.d.ts → approvals/approval-preview.d.ts} +3 -3
  5. package/dist/cli/arguments.d.ts +103 -0
  6. package/dist/cli/changes.d.ts +2 -0
  7. package/dist/{cli-credentials.d.ts → cli/cli-credentials.d.ts} +2 -2
  8. package/dist/{cli-profiles.d.ts → cli/cli-profiles.d.ts} +1 -1
  9. package/dist/{cli-stream.d.ts → cli/cli-stream.d.ts} +3 -3
  10. package/dist/cli/configured-harness.d.ts +12 -0
  11. package/dist/{console-context.d.ts → cli/console/console-context.d.ts} +2 -2
  12. package/dist/{console-navigation.d.ts → cli/console/console-navigation.d.ts} +1 -1
  13. package/dist/cli/console.d.ts +2 -0
  14. package/dist/cli/doctor.d.ts +50 -0
  15. package/dist/cli/errors.d.ts +7 -0
  16. package/dist/cli/help-text.d.ts +2 -0
  17. package/dist/cli/presentation.d.ts +23 -0
  18. package/dist/cli/resume-metadata.d.ts +12 -0
  19. package/dist/cli/routing.d.ts +6 -0
  20. package/dist/cli/run-commands.d.ts +4 -0
  21. package/dist/{run-document.d.ts → cli/run-document.d.ts} +9 -9
  22. package/dist/cli/run-management.d.ts +2 -0
  23. package/dist/{service-client-cli.d.ts → cli/service-client-cli.d.ts} +1 -1
  24. package/dist/cli/session-management.d.ts +8 -0
  25. package/dist/cli/setup.d.ts +16 -0
  26. package/dist/cli/state.d.ts +2 -0
  27. package/dist/{terminal-ui.d.ts → cli/terminal/terminal-ui.d.ts} +2 -0
  28. package/dist/cli/terminal/tool-activity.d.ts +19 -0
  29. package/dist/cli.d.ts +33 -184
  30. package/dist/cli.js +15840 -15621
  31. package/dist/client/adapter.d.ts +4 -0
  32. package/dist/client/index.d.ts +15 -0
  33. package/dist/{local-service.d.ts → client/local-service.d.ts} +2 -2
  34. package/dist/{client-contract.d.ts → client/protocol.d.ts} +3 -6
  35. package/dist/{service-events.d.ts → client/service-events.d.ts} +1 -1
  36. package/dist/{context-engineering.d.ts → context/context-engineering.d.ts} +2 -2
  37. package/dist/{task-memory.d.ts → context/task-memory.d.ts} +2 -2
  38. package/dist/{execution-environment.d.ts → execution/execution-environment.d.ts} +4 -4
  39. package/dist/hostile-repository-demo.js +217 -204
  40. package/dist/index.d.ts +48 -48
  41. package/dist/index.js +442 -385
  42. package/dist/internal/desktop/persistence.d.ts +14 -0
  43. package/dist/internal/desktop/protocol.d.ts +8 -0
  44. package/dist/internal/desktop/providers.d.ts +6 -0
  45. package/dist/internal/desktop/runtime.d.ts +7 -0
  46. package/dist/{operations.d.ts → persistence/operations.d.ts} +1 -1
  47. package/dist/{state-backup.d.ts → persistence/state-backup.d.ts} +1 -1
  48. package/dist/{capabilities.d.ts → providers/capabilities.d.ts} +1 -1
  49. package/dist/{routing.d.ts → providers/routing.d.ts} +1 -1
  50. package/dist/{config.d.ts → runtime/config.d.ts} +1 -1
  51. package/dist/{harness.d.ts → runtime/harness.d.ts} +9 -135
  52. package/dist/{runtime-policy.d.ts → runtime/runtime-policy.d.ts} +5 -5
  53. package/dist/service-cli.js +337 -296
  54. package/dist/tools/execution.d.ts +47 -0
  55. package/dist/tools/shared.d.ts +67 -0
  56. package/dist/tools/workspace.d.ts +85 -0
  57. package/dist/verify-historical-migrations.js +218 -205
  58. package/dist/zhx.js +15840 -15621
  59. package/docs/CLI.md +15 -0
  60. package/evaluations/representative-assembly-matrix.json +10 -1
  61. package/package.json +7 -4
  62. /package/dist/{approval-history.d.ts → approvals/approval-history.d.ts} +0 -0
  63. /package/dist/{cli-help.d.ts → cli/cli-help.d.ts} +0 -0
  64. /package/dist/{cli-options.d.ts → cli/cli-options.d.ts} +0 -0
  65. /package/dist/{console-commands.d.ts → cli/console/console-commands.d.ts} +0 -0
  66. /package/dist/{console-input.d.ts → cli/console/console-input.d.ts} +0 -0
  67. /package/dist/{console-model-catalog.d.ts → cli/console/console-model-catalog.d.ts} +0 -0
  68. /package/dist/{console-presentation.d.ts → cli/console/console-presentation.d.ts} +0 -0
  69. /package/dist/{console-welcome.d.ts → cli/console/console-welcome.d.ts} +0 -0
  70. /package/dist/{terminal-continuation.d.ts → cli/terminal/terminal-continuation.d.ts} +0 -0
  71. /package/dist/{terminal-markdown.d.ts → cli/terminal/terminal-markdown.d.ts} +0 -0
  72. /package/dist/{json-contracts.d.ts → client/json-contracts.d.ts} +0 -0
  73. /package/dist/{compaction.d.ts → context/compaction.d.ts} +0 -0
  74. /package/dist/{context-metrics.d.ts → context/context-metrics.d.ts} +0 -0
  75. /package/dist/{package-manager.d.ts → execution/package-manager.d.ts} +0 -0
  76. /package/dist/{process-runtime.d.ts → execution/process-runtime.d.ts} +0 -0
  77. /package/dist/{mcp.d.ts → integrations/mcp.d.ts} +0 -0
  78. /package/dist/{persistence-secrets.d.ts → persistence/persistence-secrets.d.ts} +0 -0
  79. /package/dist/{recorded-workspace.d.ts → persistence/recorded-workspace.d.ts} +0 -0
  80. /package/dist/{sessions.d.ts → persistence/sessions.d.ts} +0 -0
  81. /package/dist/{sqlite-access.d.ts → persistence/sqlite-access.d.ts} +0 -0
  82. /package/dist/{sqlite-database.d.ts → persistence/sqlite-database.d.ts} +0 -0
  83. /package/dist/{state-directory.d.ts → persistence/state-directory.d.ts} +0 -0
  84. /package/dist/{providers.d.ts → providers/providers.d.ts} +0 -0
  85. /package/dist/{errors.d.ts → runtime/errors.d.ts} +0 -0
  86. /package/dist/{model-budget.d.ts → runtime/model-budget.d.ts} +0 -0
  87. /package/dist/{orchestration.d.ts → runtime/orchestration.d.ts} +0 -0
  88. /package/dist/{repair-controller.d.ts → runtime/repair-controller.d.ts} +0 -0
  89. /package/dist/{repair-progress.d.ts → runtime/repair-progress.d.ts} +0 -0
  90. /package/dist/{repair-verifier.d.ts → runtime/repair-verifier.d.ts} +0 -0
  91. /package/dist/{run-interruption.d.ts → runtime/run-interruption.d.ts} +0 -0
  92. /package/dist/{runtime-checkpoints.d.ts → runtime/runtime-checkpoints.d.ts} +0 -0
  93. /package/dist/{runtime-diagnostics.d.ts → runtime/runtime-diagnostics.d.ts} +0 -0
  94. /package/dist/{time-to-safe-fix.d.ts → runtime/time-to-safe-fix.d.ts} +0 -0
  95. /package/dist/{usage-ledger.d.ts → runtime/usage-ledger.d.ts} +0 -0
  96. /package/dist/{tool-registry.d.ts → tools/tool-registry.d.ts} +0 -0
  97. /package/dist/{bounded-reads.d.ts → workspace/bounded-reads.d.ts} +0 -0
  98. /package/dist/{change-envelope.d.ts → workspace/change-envelope.d.ts} +0 -0
  99. /package/dist/{edit-contracts.d.ts → workspace/edit-contracts.d.ts} +0 -0
  100. /package/dist/{file-security.d.ts → workspace/file-security.d.ts} +0 -0
  101. /package/dist/{replacement-edits.d.ts → workspace/replacement-edits.d.ts} +0 -0
  102. /package/dist/{workspace-mutation-lock.d.ts → workspace/workspace-mutation-lock.d.ts} +0 -0
  103. /package/dist/{workspace.d.ts → workspace/workspace.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to Zhivex Harness are documented in this file.
4
4
 
5
5
  The project follows Semantic Versioning. During `0.x`, minor releases may change user-facing contracts when the change is documented with a migration note. Patch releases remain backwards compatible bug fixes.
6
6
 
7
+ ## 1.1.0-rc.3 - 2026-09-22
8
+
9
+ Release candidate targeting npm `next`; fresh protected certification is required
10
+ before publication. Stable `latest` remains 1.0.0.
11
+
12
+ - Group interactive tool activity into a bounded live line and summaries between assistant messages. Preserve individual failures, check receipts and approval requests; `/verbose` restores event detail.
13
+ - Identify token-budget and step-limit failures without mislabeling them as provider stream failures or exposing arbitrary provider error payloads.
14
+ - Enforce cumulative Qwen token budgets between responses for runs without subagents, including approval resume, without injecting a transport `maxTokens` parameter. An over-budget response cannot execute its requested tools or trigger another call.
15
+ - Organize CLI, runtime, providers, persistence, tools and Desktop integration behind explicit module boundaries, with architecture checks and unchanged public API contracts.
16
+ - Make the packaged conversation smoke select its fixture provider explicitly; onboarding is verified separately.
17
+ - Add release preparation and early metadata validation, retain release tarballs for recovery, and distinguish publication from verification in workflow summaries.
18
+
7
19
  ## 1.1.0-rc.2 - 2026-09-22
8
20
 
9
21
  Release candidate superseding the unpublished RC.1, targeting npm `next`.
package/README.md CHANGED
@@ -6,7 +6,7 @@ Zhivex Harness is a local terminal assistant and TypeScript library. It supports
6
6
  OpenAI, Qwen and Meta, with provisional Gemini support. Conversations and pending
7
7
  approvals survive restarts.
8
8
 
9
- This development branch prepares `1.1.0-rc.2` (unpublished), with console, local
9
+ This development branch prepares `1.1.0-rc.3` (unpublished), with console, local
10
10
  service and Desktop preview improvements. The commands below install stable 1.0.0.
11
11
 
12
12
  ## Quick start
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import type { AgentRunState } from "@zhivex-ai/core";
3
- import type { HarnessClientRun } from "./client-contract.js";
3
+ import type { HarnessClientRun } from "../client/protocol.js";
4
4
  import type { ApprovalDecisionView } from "./approval-history.js";
5
5
  export declare const APPROVAL_DIFFS_KEY = "clientApprovalDiffsV1";
6
6
  declare const file: z.ZodObject<{
@@ -1,7 +1,7 @@
1
- import type { HarnessOciExecutionEnvironment } from "./execution-environment.js";
1
+ import type { HarnessOciExecutionEnvironment } from "../execution/execution-environment.js";
2
2
  import type { AgentStoreScope } from "@zhivex-ai/core";
3
- import type { Workspace } from "./workspace.js";
4
- import type { HarnessClientRun } from "./client-contract.js";
3
+ import type { Workspace } from "../workspace/workspace.js";
4
+ import type { HarnessClientRun } from "../client/protocol.js";
5
5
  export interface ApprovalPreviewFile {
6
6
  path: string;
7
7
  expectedDigest: string | null;
@@ -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>;
@@ -1,4 +1,4 @@
1
- import { type HarnessProvider } from "./config.js";
1
+ import { type HarnessProvider } from "../runtime/config.js";
2
2
  export interface SecretEntry {
3
3
  getPassword(): Promise<string | null | undefined>;
4
4
  setPassword(value: string): Promise<void>;
@@ -35,4 +35,4 @@ export declare class CliCredentials {
35
35
  export declare function credentialModel(config: {
36
36
  provider: HarnessProvider;
37
37
  model: string;
38
- }, env: NodeJS.ProcessEnv, modelFactory?: typeof import("./config.js").createProviderModel): Promise<import("@zhivex-ai/core").LanguageModel<import("@zhivex-ai/core").ProviderOptions>>;
38
+ }, env: NodeJS.ProcessEnv, modelFactory?: typeof import("../runtime/config.js").createProviderModel): Promise<import("@zhivex-ai/agents").LanguageModel<import("@zhivex-ai/core").ProviderOptions>>;
@@ -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;
@@ -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/core").AgentStepStatus;
115
+ status: import("@zhivex-ai/agents").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/core").AgentCompactionReason[];
123
+ reasons: import("@zhivex-ai/agents").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/core").AgentStatus;
132
+ status: import("@zhivex-ai/agents").AgentStatus;
133
133
  provider: string;
134
134
  model: string;
135
135
  } | undefined;
@@ -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
+ }>;
@@ -1,5 +1,5 @@
1
- import type { ZhivexHarness } from "./harness.js";
2
- import type { Workspace } from "./workspace.js";
1
+ import type { ZhivexHarness } from "../../runtime/harness.js";
2
+ import type { Workspace } from "../../workspace/workspace.js";
3
3
  export declare const formatConsoleContext: (context: ZhivexHarness["context"], options?: {
4
4
  attachments: ReturnType<ConsoleAttachments["list"]>;
5
5
  config: ZhivexHarness["config"];
@@ -1,5 +1,5 @@
1
1
  import type { ConsoleInput } from "./console-input.js";
2
- import type { ProviderAvailability } from "./providers.js";
2
+ import type { ProviderAvailability } from "../../providers/providers.js";
3
3
  export declare const consoleModelChoices: (provider: string, defaultModel: string, current?: string) => {
4
4
  value: string;
5
5
  label: 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>;
@@ -1,10 +1,10 @@
1
1
  import { type AgentRunOutput } from "@zhivex-ai/agents";
2
- import type { ZhivexHarness } from "./harness.js";
2
+ import type { ZhivexHarness } from "../runtime/harness.js";
3
3
  export declare const runResultDocument: (result: AgentRunOutput, harness: ZhivexHarness) => {
4
4
  schemaVersion: 1;
5
5
  kind: "run-result";
6
6
  runId: string;
7
- status: import("@zhivex-ai/core").AgentStatus;
7
+ status: import("@zhivex-ai/agents").AgentStatus;
8
8
  provider: string;
9
9
  model: string;
10
10
  output: string;
@@ -32,7 +32,7 @@ export declare const runResultDocument: (result: AgentRunOutput, harness: Zhivex
32
32
  runId: string;
33
33
  agentId: string | undefined;
34
34
  toolName: string | undefined;
35
- status: import("@zhivex-ai/core").AgentStatus;
35
+ status: import("@zhivex-ai/agents").AgentStatus;
36
36
  steps: number;
37
37
  toolCalls: number;
38
38
  toolErrors: number;
@@ -61,22 +61,22 @@ export declare const runResultDocument: (result: AgentRunOutput, harness: Zhivex
61
61
  priceStatuses: ("estimate" | "missing" | "stale")[];
62
62
  }[];
63
63
  } | null;
64
- budget: import("@zhivex-ai/core").AgentBudgetStatus;
64
+ budget: import("@zhivex-ai/agents").AgentBudgetStatus;
65
65
  costBudget?: {
66
66
  limitUsd: number;
67
67
  estimate: import("@zhivex-ai/core").CostEstimate;
68
68
  };
69
69
  scope: import("@zhivex-ai/core").AgentStoreScope | undefined;
70
- capabilities: import("./capabilities.js").HarnessModelCapabilityReport;
70
+ capabilities: import("../index.js").HarnessModelCapabilityReport;
71
71
  orchestration: {
72
72
  profiles: readonly ("explorer" | "implementer" | "reviewer" | "tester")[];
73
- childBudget: import("./config.js").HarnessBudget;
73
+ childBudget: import("../index.js").HarnessBudget;
74
74
  mcpServers: string[];
75
75
  };
76
76
  execution: {
77
77
  backend: "oci";
78
- binding: import("@zhivex-ai/core").AgentExecutionEnvironmentBinding | undefined;
79
- image: import("./execution-environment.js").OciImageInspection;
78
+ binding: import("@zhivex-ai/agents").AgentExecutionEnvironmentBinding | undefined;
79
+ image: import("../index.js").OciImageInspection;
80
80
  } | {
81
81
  binding?: never;
82
82
  image?: never;
@@ -85,7 +85,7 @@ export declare const runResultDocument: (result: AgentRunOutput, harness: Zhivex
85
85
  store: {
86
86
  backend: "file" | "sqlite";
87
87
  stateDirectory: string;
88
- migration: import("./operations.js").HarnessMigrationResult | undefined;
88
+ migration: import("../index.js").HarnessMigrationResult | undefined;
89
89
  };
90
90
  stateDirectory: string;
91
91
  };
@@ -0,0 +1,2 @@
1
+ import { type CliOptions } from "./arguments.js";
2
+ export declare const manageRuns: (options: CliOptions) => Promise<void>;
@@ -1,2 +1,2 @@
1
- import type { CliOptions } from "./cli.js";
1
+ import type { CliOptions } from "./arguments.js";
2
2
  export declare const runServiceCli: (options: CliOptions, annotate: (error: unknown, sequence: number) => Error) => Promise<void>;
@@ -0,0 +1,8 @@
1
+ import { type AgentStatus } from "@zhivex-ai/agents";
2
+ import { type HarnessConfig } from "../runtime/config.js";
3
+ import { type SessionRunStatus } from "../persistence/sessions.js";
4
+ import { type CliOptions } from "./arguments.js";
5
+ export declare const openSessionStoreForConfig: (config: HarnessConfig) => Promise<import("../index.js").CliSessionStore>;
6
+ export declare const manageSessions: (options: CliOptions) => Promise<void>;
7
+ export declare const sessionStatus: (status: AgentStatus) => SessionRunStatus;
8
+ export declare const updateIndexedSessionRun: (config: HarnessConfig, runId: string, status: AgentStatus) => Promise<void>;
@@ -0,0 +1,16 @@
1
+ import { type HarnessProvider } from "../runtime/config.js";
2
+ import { type CliOptions } from "./arguments.js";
3
+ export declare const providersDocument: (env?: NodeJS.ProcessEnv) => {
4
+ schemaVersion: 1;
5
+ kind: "providers";
6
+ providers: readonly import("../index.js").ProviderAvailability[];
7
+ };
8
+ export declare const confirmDefaultProfileSelection: (profile: {
9
+ provider: HarnessProvider;
10
+ model: string;
11
+ }, ask: (prompt: string) => Promise<string>) => Promise<{
12
+ provider: HarnessProvider;
13
+ model: string;
14
+ } | undefined>;
15
+ export declare const initializeCli: (options: CliOptions) => Promise<void>;
16
+ export declare const listProviders: (json: boolean) => void;
@@ -0,0 +1,2 @@
1
+ import { type CliOptions } from "./arguments.js";
2
+ export declare const manageState: (options: CliOptions) => Promise<void>;
@@ -42,6 +42,8 @@ export declare const formatVerificationSummary: (results: readonly {
42
42
  * Produce a compact activity line from a redacted event subset. Tool inputs,
43
43
  * outputs, provider payloads, repository text, and raw errors are never read.
44
44
  */
45
+ /** Only known runtime diagnostics are projected; provider payloads remain private. */
46
+ export declare const terminalRunFailure: (error: unknown) => string;
45
47
  export declare const formatTerminalEvent: (event: AgentStreamEvent, options?: TerminalAppearanceOptions) => string | undefined;
46
48
  export interface TerminalHeaderInput {
47
49
  version: string;
@@ -0,0 +1,19 @@
1
+ /** A bounded activity line; transcript entries are committed only at message boundaries. */
2
+ export declare class ToolActivity {
3
+ private write;
4
+ private tty;
5
+ private columns;
6
+ private completed;
7
+ private active;
8
+ private visible;
9
+ private dirty;
10
+ private reads;
11
+ private searches;
12
+ private other;
13
+ constructor(write: (text: string) => void, tty: boolean, columns?: () => number);
14
+ start(): void;
15
+ finish(name: string): void;
16
+ private line;
17
+ private render;
18
+ flush(): void;
19
+ }