@zhivex-ai/harness 0.6.1 → 0.8.0

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.
package/dist/cli.d.ts CHANGED
@@ -3,7 +3,9 @@ import { type AgentApprovalRequest, type AgentRunInput, type AgentRunOutput, typ
3
3
  import { providerAvailability, resolveHarnessConfig, type HarnessConfig, type HarnessConfigInput, type HarnessProvider, type HarnessSubagentProfile } from "./config.js";
4
4
  import { type ZhivexHarness } from "./harness.js";
5
5
  import { type HarnessOciRuntimeAdapter } from "./execution-environment.js";
6
- export declare const CLI_JSON_SCHEMA_VERSION: 1;
6
+ import { type HarnessModelRoute } from "./routing.js";
7
+ import { CLI_JSON_SCHEMA_VERSION } from "./cli-stream.js";
8
+ export { CLI_JSON_SCHEMA_VERSION } from "./cli-stream.js";
7
9
  export declare const HARNESS_RESUME_METADATA_KEY: "zhivexHarnessResume";
8
10
  export declare const HARNESS_RESUME_METADATA_SCHEMA_VERSION: 1;
9
11
  export declare const CLI_EXIT_CODES: {
@@ -12,8 +14,9 @@ export declare const CLI_EXIT_CODES: {
12
14
  readonly usageError: 2;
13
15
  readonly doctorFailed: 3;
14
16
  };
15
- type Command = "run" | "review" | "chat" | "providers" | "doctor" | "resume" | "runs" | "help" | "version";
17
+ type Command = "run" | "review" | "chat" | "providers" | "doctor" | "resume" | "runs" | "sessions" | "help" | "version";
16
18
  type RunsCommand = "list" | "inspect" | "cancel" | "cleanup" | "export";
19
+ type SessionsCommand = "list" | "inspect" | "rename" | "fork" | "archive";
17
20
  export interface CliOptions {
18
21
  command: Command;
19
22
  provider?: string;
@@ -36,8 +39,9 @@ export interface CliOptions {
36
39
  outputCostPerMillion?: number;
37
40
  allowedChecks?: string[];
38
41
  requiredCapabilities?: string[];
39
- subagentProfiles?: string[];
42
+ subagentProfiles?: HarnessSubagentProfile[];
40
43
  reviewers?: HarnessSubagentProfile[];
44
+ routes?: string[];
41
45
  subagentMaxSteps?: number;
42
46
  subagentMaxToolCalls?: number;
43
47
  subagentMaxToolErrors?: number;
@@ -63,6 +67,11 @@ export interface CliOptions {
63
67
  runId?: string;
64
68
  idempotencyKey?: string;
65
69
  runsCommand?: RunsCommand;
70
+ sessionsCommand?: SessionsCommand;
71
+ sessionId?: string;
72
+ sessionTitle?: string;
73
+ continueSession: boolean;
74
+ implicitCommand: boolean;
66
75
  statuses?: AgentStatus[];
67
76
  limit?: number;
68
77
  cursor?: string;
@@ -73,12 +82,14 @@ export interface CliOptions {
73
82
  yes: boolean;
74
83
  approve?: boolean;
75
84
  json: boolean;
85
+ jsonl: boolean;
76
86
  }
77
87
  export declare class CliUsageError extends Error {
78
88
  constructor(message: string);
79
89
  }
80
- export declare const createHarnessResumeMetadata: (config: HarnessConfig) => NonNullable<AgentRunInput["metadata"]>;
90
+ export declare const createHarnessResumeMetadata: (config: HarnessConfig, routes?: ReadonlyMap<HarnessSubagentProfile, HarnessModelRoute>) => NonNullable<AgentRunInput["metadata"]>;
81
91
  export declare const readHarnessResumeConfig: (state: Pick<AgentRunState, "metadata">) => HarnessConfigInput | undefined;
92
+ export declare const readHarnessResumeRoutes: (state: Pick<AgentRunState, "metadata">) => Map<"explorer" | "implementer" | "tester" | "reviewer", HarnessModelRoute>;
82
93
  export declare const resumeCommand: (runId: string, config: HarnessConfig, approve?: boolean) => string;
83
94
  export declare const parseCliArgs: (argv: string[]) => CliOptions;
84
95
  export declare const summarizeApproval: (approval: AgentApprovalRequest) => string;
@@ -149,30 +160,11 @@ export declare const runResultDocument: (result: AgentRunOutput, harness: Zhivex
149
160
  usage: import("@zhivex-ai/core").TokenUsage | undefined;
150
161
  budget: import("@zhivex-ai/core").AgentBudgetStatus;
151
162
  };
163
+ export declare const withTemporaryHarnessProfiles: <T>(profiles: readonly HarnessSubagentProfile[], configure: (profiles: readonly HarnessSubagentProfile[]) => Promise<void>, operation: () => Promise<T>) => Promise<T>;
152
164
  export declare const providersDocument: (env?: NodeJS.ProcessEnv) => {
153
165
  schemaVersion: 1;
154
166
  kind: "providers";
155
- providers: {
156
- configured: boolean;
157
- credentials: {
158
- name: string;
159
- present: boolean;
160
- }[];
161
- configuration: {
162
- workspaceIdConfigured?: boolean;
163
- regionConfigured?: boolean;
164
- regionValid?: boolean;
165
- customEndpoint: boolean;
166
- endpointValid: boolean;
167
- endpointSecure: boolean;
168
- };
169
- id: HarnessProvider;
170
- name: string;
171
- defaultModel: string;
172
- credentialNames: readonly string[];
173
- capabilities: readonly import("./config.js").ProviderCapability[];
174
- support: import("./config.js").ProviderSupport;
175
- }[];
167
+ providers: readonly import("./providers.js").ProviderAvailability[];
176
168
  };
177
169
  export type DoctorCheckStatus = "pass" | "warn" | "fail";
178
170
  export interface DoctorCheck {
@@ -215,6 +207,5 @@ export interface DoctorContext {
215
207
  }
216
208
  export declare const createDoctorReport: (options?: Pick<CliOptions, "provider" | "model" | "workspace" | "stateDirectory" | "storeBackend" | "tenantId" | "userId" | "namespace" | "maxSteps" | "timeoutMs" | "maxToolCalls" | "maxToolErrors" | "maxInputTokens" | "maxOutputTokens" | "maxTotalTokens" | "maxCostUsd" | "inputCostPerMillion" | "outputCostPerMillion" | "allowedChecks" | "requiredCapabilities" | "subagentProfiles" | "subagentMaxSteps" | "subagentMaxToolCalls" | "subagentMaxToolErrors" | "subagentMaxInputTokens" | "subagentMaxOutputTokens" | "subagentMaxTotalTokens" | "subagentTimeoutMs" | "maxParallelReviews" | "executionBackend" | "ociRuntime" | "ociImage" | "ociAllowedCommands" | "ociMaxProcessRuntimeMs" | "ociMaxProcessOutputBytes" | "ociMaxMemoryMb" | "ociMaxPids" | "ociMaxCpus" | "ociMaxWorkspaceBytes" | "ociMaxFileWriteBytes" | "ociTmpfsMb" | "mcpConfigPath">, context?: DoctorContext) => Promise<DoctorReport>;
217
209
  export declare const formatDoctorReport: (report: DoctorReport) => string;
218
- export declare const cliExitCodeForError: (error: unknown) => 2 | 1;
210
+ export declare const cliExitCodeForError: (error: unknown) => 1 | 2;
219
211
  export declare const main: (argv?: string[]) => Promise<void>;
220
- export {};