@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.
- package/CHANGELOG.md +97 -1
- package/README.md +52 -306
- package/SECURITY.md +1 -1
- package/SUPPORT.md +7 -3
- package/benchmarks/README.md +3 -3
- package/contracts/client-protocol-v1.schema.json +341 -0
- package/contracts/public-api.json +100 -1
- package/contracts/stable-api-signatures.json +14 -14
- package/dist/approval-diff.d.ts +45 -0
- package/dist/approval-history.d.ts +38 -0
- package/dist/approval-preview.d.ts +26 -0
- package/dist/cli-credentials.d.ts +38 -0
- package/dist/cli-help.d.ts +3 -0
- package/dist/cli-options.d.ts +1 -1
- package/dist/cli-stream.d.ts +3 -3
- package/dist/cli.d.ts +15 -69
- package/dist/cli.js +13796 -10032
- package/dist/client-contract.d.ts +208 -0
- package/dist/console-commands.d.ts +6 -0
- package/dist/console-context.d.ts +5 -1
- package/dist/console-input.d.ts +44 -4
- package/dist/console-model-catalog.d.ts +25 -0
- package/dist/console-navigation.d.ts +27 -0
- package/dist/console-presentation.d.ts +18 -0
- package/dist/console-welcome.d.ts +13 -0
- package/dist/execution-environment.d.ts +4 -0
- package/dist/harness.d.ts +3 -0
- package/dist/hostile-repository-demo.js +1913 -798
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7908 -6330
- package/dist/local-service.d.ts +34 -0
- package/dist/operations.d.ts +23 -1
- package/dist/orchestration.d.ts +3 -0
- package/dist/persistence-secrets.d.ts +2 -0
- package/dist/recorded-workspace.d.ts +4 -0
- package/dist/run-document.d.ts +91 -0
- package/dist/runtime-policy.d.ts +4 -4
- package/dist/service-cli.d.ts +2 -0
- package/dist/service-cli.js +10858 -0
- package/dist/service-client-cli.d.ts +2 -0
- package/dist/service-events.d.ts +50 -0
- package/dist/sessions.d.ts +3 -0
- package/dist/sqlite-access.d.ts +26 -0
- package/dist/sqlite-database.d.ts +2 -0
- package/dist/state-backup.d.ts +8 -0
- package/dist/task-memory.d.ts +2 -2
- package/dist/terminal-continuation.d.ts +3 -0
- package/dist/terminal-markdown.d.ts +1 -0
- package/dist/terminal-ui.d.ts +5 -0
- package/dist/usage-ledger.d.ts +84 -0
- package/dist/verify-historical-migrations.js +5699 -5191
- package/dist/workspace.d.ts +22 -0
- package/dist/zhx.js +13796 -10032
- package/docs/CLI.md +136 -30
- package/docs/CLIENT_PROTOCOL.md +212 -0
- package/docs/CREDENTIALS.md +59 -0
- package/docs/DURABLE_OPERATIONS.md +2 -2
- package/docs/FIRST_USE.md +82 -0
- package/docs/FIRST_USE_EXAMPLE.md +40 -0
- package/docs/HOSTILE_REPOSITORY_DEMO.md +1 -1
- package/docs/LOCAL_SERVICE.md +142 -0
- package/docs/README.md +24 -23
- package/docs/THREAT_MODEL.md +1 -1
- package/docs/TIME_TO_SAFE_FIX.md +2 -2
- package/docs/USAGE.md +181 -0
- package/evaluations/daily-cli-cohort.json +33 -0
- package/evaluations/representative-assembly-matrix.json +19 -1
- package/examples/README.md +26 -0
- package/examples/first-use/greeting.test.ts +3 -0
- package/examples/first-use/greeting.ts +1 -0
- package/examples/first-use/package.json +7 -0
- package/package.json +34 -9
- package/ROADMAP.md +0 -414
- package/benchmarks/baselines/context-navigation-2026-09-09.json +0 -94
- package/benchmarks/baselines/efficiency-2026-09-08.json +0 -233
- package/benchmarks/baselines/external-final-2026-09-08.json +0 -588
- package/benchmarks/baselines/external-intermediate-2026-09-08.json +0 -116
- package/benchmarks/baselines/external-matched-openai-2026-09-08.json +0 -1922
- package/benchmarks/baselines/external-matched-qwen-2026-09-08.json +0 -1706
- package/benchmarks/baselines/external-pilot-2026-09-08.json +0 -439
- package/benchmarks/baselines/external-qwen-flash-2026-09-08.json +0 -1570
- package/benchmarks/baselines/external-qwen-remediation-2026-09-09.json +0 -1509
- package/benchmarks/baselines/external-qwen-sdk-114-progress-2026-09-09.json +0 -2509
- package/benchmarks/baselines/external-sdk-upgrade-2026-09-08.json +0 -564
- package/benchmarks/baselines/external-verifier-recovery-2026-09-09.json +0 -794
- package/benchmarks/baselines/full-harness-review-2026-09-10.json +0 -134
- package/benchmarks/baselines/harness-audit-2026-09-09.json +0 -136
- package/benchmarks/baselines/harness-remediation-2026-09-09.json +0 -160
- package/benchmarks/baselines/oci-remediation-2026-09-10.json +0 -535
- package/benchmarks/baselines/rc14-holdout-2026-09-10.json +0 -854
- package/benchmarks/baselines/repair-architecture-audit-2026-09-09.json +0 -75
- package/benchmarks/baselines/time-to-safe-fix-live-expanded-2026-08-21.json +0 -186
- package/benchmarks/baselines/time-to-safe-fix-live-smoke-2026-08-21.json +0 -186
- package/docs/GA_READINESS.md +0 -29
- package/docs/GEMINI_1_0_DECISION.md +0 -9
- package/docs/LIVE_CERTIFICATION.md +0 -107
- package/docs/RC13_SECURITY_REVIEW.md +0 -28
- package/docs/RC14_DELEGATED_SECURITY_DECISION.md +0 -80
- package/docs/RC14_SECURITY_REVIEW.md +0 -40
- package/docs/RELEASE.md +0 -96
- package/docs/ROLLBACK.md +0 -9
- package/docs/SECURITY_REVIEW_EVIDENCE.md +0 -17
- package/docs/ga-readiness.json +0 -366
- package/docs/reports/EFFICIENCY_REVIEW.md +0 -156
- package/docs/reports/EXTERNAL_COMPARISON.md +0 -434
- package/docs/reports/FULL_HARNESS_REVIEW_2026-09-10.md +0 -200
- package/docs/reports/GA_BUDGET_REMEDIATION_2026-09-19.md +0 -38
- package/docs/reports/GA_REPAIR_RECOVERY_2026-09-19.md +0 -700
- package/docs/reports/GA_VALIDATION_2026-09-19.md +0 -111
- package/docs/reports/HARNESS_ARCHITECTURE_REVIEW_2026-09-09.md +0 -202
- package/docs/reports/HARNESS_AUDIT_2026-09-09.md +0 -306
- package/docs/reports/HARNESS_REMEDIATION_2026-09-09.md +0 -74
- package/docs/reports/HARNESS_REMEDIATION_2026-09-10.md +0 -90
- package/docs/reports/MODEL_COMPARISON_2026-09-09.md +0 -184
- package/docs/reports/QWEN_REMEDIATION_COMPARISON_2026-09-09.md +0 -142
- package/docs/reports/RC14_VALIDATION_2026-09-10.md +0 -45
- package/docs/reports/README.md +0 -26
- package/docs/reports/evidence/ga-budget-remediation-2026-09-19.json +0 -133
- package/docs/reports/evidence/ga-catalog-ablation-2026-09-19.json +0 -699
- package/docs/reports/evidence/ga-catalog-ablation-plan-2026-09-19.json +0 -40
- package/docs/reports/evidence/ga-catalog-observed-2026-09-19.json +0 -985
- package/docs/reports/evidence/ga-catalog-observed-plan-2026-09-19.json +0 -28
- package/docs/reports/evidence/ga-catalog-observed-status-2026-09-19.json +0 -15
- package/docs/reports/evidence/ga-complete-local-check-2026-09-19.json +0 -47
- package/docs/reports/evidence/ga-completion-reminder-2026-09-19.json +0 -22
- package/docs/reports/evidence/ga-fresh-cohort-plan-2026-09-19.json +0 -54
- package/docs/reports/evidence/ga-fresh-cohort-preparation-2026-09-19.json +0 -242
- package/docs/reports/evidence/ga-fresh-cohort-result-2026-09-19.json +0 -4318
- package/docs/reports/evidence/ga-local-validation-followup-2026-09-19.json +0 -66
- package/docs/reports/evidence/ga-node-consumers-2026-09-19.json +0 -31
- package/docs/reports/evidence/ga-package-content-validation-2026-09-19.json +0 -22
- package/docs/reports/evidence/ga-plan-completion-2026-09-19.json +0 -39
- package/docs/reports/evidence/ga-plan-reserve-2026-09-19.json +0 -573
- package/docs/reports/evidence/ga-plan-reserve-plan-2026-09-19.json +0 -24
- package/docs/reports/evidence/ga-plan-transition-2026-09-19.json +0 -19
- package/docs/reports/evidence/ga-private-verifier-plan-2026-09-19.json +0 -24
- package/docs/reports/evidence/ga-private-verifier-root-cause-2026-09-19.json +0 -41
- package/docs/reports/evidence/ga-published-sdk-2026-09-19.json +0 -35
- package/docs/reports/evidence/ga-python-checkout-imports-2026-09-19.json +0 -95
- package/docs/reports/evidence/ga-python-origin-delivery-2026-09-19.json +0 -211
- package/docs/reports/evidence/ga-python-origin-delivery-plan-2026-09-19.json +0 -27
- package/docs/reports/evidence/ga-qwen-patched-package-2026-09-19.json +0 -1092
- package/docs/reports/evidence/ga-qwen-patched-package-plan-2026-09-19.json +0 -18
- package/docs/reports/evidence/ga-qwen-published-2026-09-19.json +0 -571
- package/docs/reports/evidence/ga-qwen-published-plan-2026-09-19.json +0 -18
- package/docs/reports/evidence/ga-qwen-tool-choice-2026-09-19.json +0 -85
- package/docs/reports/evidence/ga-qwen-tool-choice-patched-2026-09-19.json +0 -85
- package/docs/reports/evidence/ga-recovery-development-2026-09-19.json +0 -1066
- package/docs/reports/evidence/ga-recovery-graded-development-2026-09-19.json +0 -1313
- package/docs/reports/evidence/ga-recovery-graded-v2-2026-09-19.json +0 -1151
- package/docs/reports/evidence/ga-recovery-v3-2026-09-19.json +0 -3943
- package/docs/reports/evidence/ga-recovery-v4-2026-09-19.json +0 -1055
- package/docs/reports/evidence/ga-recovery-v5-2026-09-19.json +0 -1245
- package/docs/reports/evidence/ga-recovery-v6-2026-09-19.json +0 -699
- package/docs/reports/evidence/ga-recovery-v7-2026-09-19.json +0 -854
- package/docs/reports/evidence/ga-recovery-v8-2026-09-19.json +0 -596
- package/docs/reports/evidence/ga-required-delivery-2026-09-19.json +0 -25
- package/docs/reports/evidence/ga-required-delivery-live-2026-09-19.json +0 -1337
- package/docs/reports/evidence/ga-required-delivery-live-plan-2026-09-19.json +0 -25
- package/docs/reports/evidence/ga-retained-candidate-grading-2026-09-19.json +0 -30
- package/docs/reports/evidence/ga-tool-selection-live-2026-09-19.json +0 -559
- package/docs/reports/evidence/ga-tool-selection-live-plan-2026-09-19.json +0 -28
- package/docs/reports/evidence/ga-tool-selection-recovery-2026-09-19.json +0 -27
- package/docs/reports/evidence/ga-validation-2026-09-19.json +0 -236
- package/docs/reports/evidence/ga-verifier-discovery-live-2026-09-19.json +0 -1369
- package/docs/reports/evidence/ga-verifier-discovery-plan-2026-09-19.json +0 -29
- package/docs/reports/evidence/ga-verifier-failure-identification-2026-09-19.json +0 -30
- package/docs/reports/evidence/ga-verifier-feedback-2026-09-19.json +0 -65
- package/docs/reports/evidence/ga-verifier-hints-live-2026-09-19.json +0 -1297
- package/docs/reports/evidence/ga-verifier-hints-plan-2026-09-19.json +0 -27
- package/docs/reports/evidence/ga-work-boundary-context-analysis-2026-09-19.json +0 -113
- package/docs/reports/evidence/ga-work-boundary-live-2026-09-19.json +0 -301
- package/docs/reports/evidence/ga-work-boundary-live-plan-2026-09-19.json +0 -84
- package/docs/reports/evidence/ga-work-budget-planning-2026-09-19.json +0 -32
- package/docs/reports/evidence/ga-working-context-2026-09-19.json +0 -22
- package/docs/reports/evidence/rc14-delegated-security-review-2026-09-20.json +0 -81
- package/docs/reports/evidence/rc14-ga-gate-2026-09-20.json +0 -18
- package/docs/reports/evidence/rc14-representative-2026-09-20.json +0 -509
- package/docs/reports/evidence/rc14-security-regressions-2026-09-20.json +0 -64
- package/docs/reports/evidence/security-current-2026-09-19.json +0 -91
- 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>>;
|
package/dist/cli-options.d.ts
CHANGED
|
@@ -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: {
|
package/dist/cli-stream.d.ts
CHANGED
|
@@ -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/
|
|
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/
|
|
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/
|
|
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
|
-
|
|
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;
|