@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.
- package/CHANGELOG.md +109 -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/approvals/approval-diff.d.ts +45 -0
- package/dist/approvals/approval-history.d.ts +38 -0
- package/dist/approvals/approval-preview.d.ts +26 -0
- package/dist/cli/arguments.d.ts +103 -0
- package/dist/cli/changes.d.ts +2 -0
- package/dist/cli/cli-credentials.d.ts +38 -0
- package/dist/cli/cli-help.d.ts +3 -0
- package/dist/{cli-options.d.ts → cli/cli-options.d.ts} +1 -1
- package/dist/{cli-profiles.d.ts → cli/cli-profiles.d.ts} +1 -1
- package/dist/cli/configured-harness.d.ts +12 -0
- package/dist/cli/console/console-commands.d.ts +6 -0
- package/dist/{console-context.d.ts → cli/console/console-context.d.ts} +7 -3
- package/dist/cli/console/console-input.d.ts +68 -0
- package/dist/cli/console/console-model-catalog.d.ts +25 -0
- package/dist/cli/console/console-navigation.d.ts +27 -0
- package/dist/cli/console/console-presentation.d.ts +18 -0
- package/dist/cli/console/console-welcome.d.ts +13 -0
- package/dist/cli/console.d.ts +2 -0
- package/dist/cli/doctor.d.ts +50 -0
- package/dist/cli/errors.d.ts +7 -0
- package/dist/cli/help-text.d.ts +2 -0
- package/dist/cli/presentation.d.ts +23 -0
- package/dist/cli/resume-metadata.d.ts +12 -0
- package/dist/cli/routing.d.ts +6 -0
- package/dist/cli/run-commands.d.ts +4 -0
- package/dist/cli/run-document.d.ts +91 -0
- package/dist/cli/run-management.d.ts +2 -0
- package/dist/cli/service-client-cli.d.ts +2 -0
- package/dist/cli/session-management.d.ts +8 -0
- package/dist/cli/setup.d.ts +16 -0
- package/dist/cli/state.d.ts +2 -0
- package/dist/cli/terminal/terminal-continuation.d.ts +3 -0
- package/dist/{terminal-markdown.d.ts → cli/terminal/terminal-markdown.d.ts} +1 -0
- package/dist/{terminal-ui.d.ts → cli/terminal/terminal-ui.d.ts} +7 -0
- package/dist/cli/terminal/tool-activity.d.ts +19 -0
- package/dist/cli.d.ts +33 -238
- package/dist/cli.js +16049 -12066
- package/dist/client/adapter.d.ts +4 -0
- package/dist/client/index.d.ts +15 -0
- package/dist/client/local-service.d.ts +34 -0
- package/dist/client/protocol.d.ts +205 -0
- package/dist/client/service-events.d.ts +50 -0
- package/dist/{context-engineering.d.ts → context/context-engineering.d.ts} +2 -2
- package/dist/{execution-environment.d.ts → execution/execution-environment.d.ts} +8 -4
- package/dist/hostile-repository-demo.js +2025 -897
- package/dist/index.d.ts +48 -41
- package/dist/index.js +7541 -5906
- package/dist/internal/desktop/persistence.d.ts +14 -0
- package/dist/internal/desktop/protocol.d.ts +8 -0
- package/dist/internal/desktop/providers.d.ts +6 -0
- package/dist/internal/desktop/runtime.d.ts +7 -0
- package/dist/{operations.d.ts → persistence/operations.d.ts} +24 -2
- package/dist/persistence/persistence-secrets.d.ts +2 -0
- package/dist/persistence/recorded-workspace.d.ts +4 -0
- package/dist/{sessions.d.ts → persistence/sessions.d.ts} +3 -0
- package/dist/persistence/sqlite-access.d.ts +26 -0
- package/dist/{sqlite-database.d.ts → persistence/sqlite-database.d.ts} +2 -0
- package/dist/{state-backup.d.ts → persistence/state-backup.d.ts} +9 -1
- package/dist/{capabilities.d.ts → providers/capabilities.d.ts} +1 -1
- package/dist/{routing.d.ts → providers/routing.d.ts} +1 -1
- package/dist/{config.d.ts → runtime/config.d.ts} +1 -1
- package/dist/{harness.d.ts → runtime/harness.d.ts} +12 -135
- package/dist/{orchestration.d.ts → runtime/orchestration.d.ts} +3 -0
- package/dist/{runtime-policy.d.ts → runtime/runtime-policy.d.ts} +1 -1
- package/dist/runtime/usage-ledger.d.ts +84 -0
- package/dist/service-cli.d.ts +2 -0
- package/dist/service-cli.js +10899 -0
- package/dist/tools/execution.d.ts +47 -0
- package/dist/tools/shared.d.ts +67 -0
- package/dist/tools/workspace.d.ts +85 -0
- package/dist/verify-historical-migrations.js +5786 -5265
- package/dist/{workspace.d.ts → workspace/workspace.d.ts} +22 -0
- package/dist/zhx.js +16049 -12066
- package/docs/CLI.md +151 -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 +28 -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 +39 -11
- 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/dist/console-input.d.ts +0 -28
- 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
- /package/dist/{cli-stream.d.ts → cli/cli-stream.d.ts} +0 -0
- /package/dist/{json-contracts.d.ts → client/json-contracts.d.ts} +0 -0
- /package/dist/{compaction.d.ts → context/compaction.d.ts} +0 -0
- /package/dist/{context-metrics.d.ts → context/context-metrics.d.ts} +0 -0
- /package/dist/{task-memory.d.ts → context/task-memory.d.ts} +0 -0
- /package/dist/{package-manager.d.ts → execution/package-manager.d.ts} +0 -0
- /package/dist/{process-runtime.d.ts → execution/process-runtime.d.ts} +0 -0
- /package/dist/{mcp.d.ts → integrations/mcp.d.ts} +0 -0
- /package/dist/{state-directory.d.ts → persistence/state-directory.d.ts} +0 -0
- /package/dist/{providers.d.ts → providers/providers.d.ts} +0 -0
- /package/dist/{errors.d.ts → runtime/errors.d.ts} +0 -0
- /package/dist/{model-budget.d.ts → runtime/model-budget.d.ts} +0 -0
- /package/dist/{repair-controller.d.ts → runtime/repair-controller.d.ts} +0 -0
- /package/dist/{repair-progress.d.ts → runtime/repair-progress.d.ts} +0 -0
- /package/dist/{repair-verifier.d.ts → runtime/repair-verifier.d.ts} +0 -0
- /package/dist/{run-interruption.d.ts → runtime/run-interruption.d.ts} +0 -0
- /package/dist/{runtime-checkpoints.d.ts → runtime/runtime-checkpoints.d.ts} +0 -0
- /package/dist/{runtime-diagnostics.d.ts → runtime/runtime-diagnostics.d.ts} +0 -0
- /package/dist/{time-to-safe-fix.d.ts → runtime/time-to-safe-fix.d.ts} +0 -0
- /package/dist/{tool-registry.d.ts → tools/tool-registry.d.ts} +0 -0
- /package/dist/{bounded-reads.d.ts → workspace/bounded-reads.d.ts} +0 -0
- /package/dist/{change-envelope.d.ts → workspace/change-envelope.d.ts} +0 -0
- /package/dist/{edit-contracts.d.ts → workspace/edit-contracts.d.ts} +0 -0
- /package/dist/{file-security.d.ts → workspace/file-security.d.ts} +0 -0
- /package/dist/{replacement-edits.d.ts → workspace/replacement-edits.d.ts} +0 -0
- /package/dist/{workspace-mutation-lock.d.ts → workspace/workspace-mutation-lock.d.ts} +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { type AgentRunOutput } from "@zhivex-ai/agents";
|
|
2
|
+
import type { ZhivexHarness } from "../runtime/harness.js";
|
|
3
|
+
export declare const runResultDocument: (result: AgentRunOutput, harness: ZhivexHarness) => {
|
|
4
|
+
schemaVersion: 1;
|
|
5
|
+
kind: "run-result";
|
|
6
|
+
runId: string;
|
|
7
|
+
status: import("@zhivex-ai/agents").AgentStatus;
|
|
8
|
+
provider: string;
|
|
9
|
+
model: string;
|
|
10
|
+
output: string;
|
|
11
|
+
steps: number;
|
|
12
|
+
toolCalls: number;
|
|
13
|
+
mutations: readonly {
|
|
14
|
+
id: string;
|
|
15
|
+
operation: "create" | "move" | "quarantine" | "restore" | "update";
|
|
16
|
+
path: string;
|
|
17
|
+
destination?: string | undefined;
|
|
18
|
+
beforeDigest?: string | undefined;
|
|
19
|
+
afterDigest?: string | undefined;
|
|
20
|
+
timestamp: string;
|
|
21
|
+
quarantineId?: string | undefined;
|
|
22
|
+
}[];
|
|
23
|
+
pendingApprovals: {
|
|
24
|
+
id: string;
|
|
25
|
+
kind: "local-tool" | "provider" | "subagent";
|
|
26
|
+
name: string;
|
|
27
|
+
arguments: string;
|
|
28
|
+
childRunId?: string;
|
|
29
|
+
childAgentId?: string;
|
|
30
|
+
}[];
|
|
31
|
+
children: {
|
|
32
|
+
runId: string;
|
|
33
|
+
agentId: string | undefined;
|
|
34
|
+
toolName: string | undefined;
|
|
35
|
+
status: import("@zhivex-ai/agents").AgentStatus;
|
|
36
|
+
steps: number;
|
|
37
|
+
toolCalls: number;
|
|
38
|
+
toolErrors: number;
|
|
39
|
+
usage: import("@zhivex-ai/core").TokenUsage | undefined;
|
|
40
|
+
}[];
|
|
41
|
+
usage: import("@zhivex-ai/core").TokenUsage | undefined;
|
|
42
|
+
usageLedger?: {
|
|
43
|
+
calls: number;
|
|
44
|
+
inputTokens: number;
|
|
45
|
+
outputTokens: number;
|
|
46
|
+
usageComplete: boolean;
|
|
47
|
+
estimatedUsd: number | null;
|
|
48
|
+
limitUsd: number | null;
|
|
49
|
+
schemaVersion: 1;
|
|
50
|
+
runId: string;
|
|
51
|
+
historicalUsageUnknown?: boolean | undefined;
|
|
52
|
+
costKind: "estimate-not-invoice";
|
|
53
|
+
routes: {
|
|
54
|
+
provider: string;
|
|
55
|
+
model: string;
|
|
56
|
+
calls: number;
|
|
57
|
+
inputTokens: number;
|
|
58
|
+
outputTokens: number;
|
|
59
|
+
unknownCalls: number;
|
|
60
|
+
estimatedUsd: number | null;
|
|
61
|
+
priceStatuses: ("estimate" | "missing" | "stale")[];
|
|
62
|
+
}[];
|
|
63
|
+
} | null;
|
|
64
|
+
budget: import("@zhivex-ai/agents").AgentBudgetStatus;
|
|
65
|
+
costBudget?: {
|
|
66
|
+
limitUsd: number;
|
|
67
|
+
estimate: import("@zhivex-ai/core").CostEstimate;
|
|
68
|
+
};
|
|
69
|
+
scope: import("@zhivex-ai/core").AgentStoreScope | undefined;
|
|
70
|
+
capabilities: import("../index.js").HarnessModelCapabilityReport;
|
|
71
|
+
orchestration: {
|
|
72
|
+
profiles: readonly ("explorer" | "implementer" | "reviewer" | "tester")[];
|
|
73
|
+
childBudget: import("../index.js").HarnessBudget;
|
|
74
|
+
mcpServers: string[];
|
|
75
|
+
};
|
|
76
|
+
execution: {
|
|
77
|
+
backend: "oci";
|
|
78
|
+
binding: import("@zhivex-ai/agents").AgentExecutionEnvironmentBinding | undefined;
|
|
79
|
+
image: import("../index.js").OciImageInspection;
|
|
80
|
+
} | {
|
|
81
|
+
binding?: never;
|
|
82
|
+
image?: never;
|
|
83
|
+
backend: "none";
|
|
84
|
+
};
|
|
85
|
+
store: {
|
|
86
|
+
backend: "file" | "sqlite";
|
|
87
|
+
stateDirectory: string;
|
|
88
|
+
migration: import("../index.js").HarnessMigrationResult | undefined;
|
|
89
|
+
};
|
|
90
|
+
stateDirectory: string;
|
|
91
|
+
};
|
|
@@ -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;
|
|
@@ -33,10 +33,17 @@ export interface TerminalAppearanceOptions {
|
|
|
33
33
|
color?: boolean;
|
|
34
34
|
}
|
|
35
35
|
export declare const terminalSupportsColor: (isTTY: boolean, env?: Readonly<Record<string, string | undefined>>) => boolean;
|
|
36
|
+
export declare const formatVerificationSummary: (results: readonly {
|
|
37
|
+
toolName: string;
|
|
38
|
+
output?: unknown;
|
|
39
|
+
isError?: boolean;
|
|
40
|
+
}[]) => string;
|
|
36
41
|
/**
|
|
37
42
|
* Produce a compact activity line from a redacted event subset. Tool inputs,
|
|
38
43
|
* outputs, provider payloads, repository text, and raw errors are never read.
|
|
39
44
|
*/
|
|
45
|
+
/** Only known runtime diagnostics are projected; provider payloads remain private. */
|
|
46
|
+
export declare const terminalRunFailure: (error: unknown) => string;
|
|
40
47
|
export declare const formatTerminalEvent: (event: AgentStreamEvent, options?: TerminalAppearanceOptions) => string | undefined;
|
|
41
48
|
export interface TerminalHeaderInput {
|
|
42
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
|
+
}
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,240 +1,35 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { type ZhivexHarness } from "./harness.js";
|
|
5
|
-
import { type HarnessOciRuntimeAdapter } from "./execution-environment.js";
|
|
6
|
-
import { type HarnessModelRoute } from "./routing.js";
|
|
7
|
-
import { CLI_JSON_SCHEMA_VERSION } from "./cli-stream.js";
|
|
8
|
-
import { HarnessError } from "./errors.js";
|
|
9
|
-
export { CLI_JSON_SCHEMA_VERSION } from "./cli-stream.js";
|
|
10
|
-
export declare const HARNESS_RESUME_METADATA_KEY: "zhivexHarnessResume";
|
|
11
|
-
export declare const HARNESS_RESUME_METADATA_SCHEMA_VERSION: 1;
|
|
12
|
-
export declare const CLI_EXIT_CODES: {
|
|
13
|
-
readonly success: 0;
|
|
14
|
-
readonly runtimeError: 1;
|
|
15
|
-
readonly usageError: 2;
|
|
16
|
-
readonly doctorFailed: 3;
|
|
17
|
-
};
|
|
18
|
-
export declare const annotateCliStreamError: (error: unknown, lastSequence: number | undefined) => Error;
|
|
19
|
-
export declare const cliStreamErrorSequence: (error: unknown) => number;
|
|
20
|
-
export declare const terminalErrorMessage: (error: unknown) => string;
|
|
21
|
-
export declare const CLI_COMMANDS: readonly ["init", "run", "review", "chat", "providers", "doctor", "resume", "runs", "sessions", "changes", "state", "help", "version"];
|
|
22
|
-
export declare const CLI_RUNS_COMMANDS: readonly ["list", "inspect", "cancel", "cleanup", "export"];
|
|
23
|
-
export declare const CLI_SESSIONS_COMMANDS: readonly ["list", "inspect", "rename", "fork", "archive"];
|
|
24
|
-
export declare const CLI_CHANGES_COMMANDS: readonly ["create", "verify"];
|
|
25
|
-
export declare const CLI_STATE_COMMANDS: readonly ["status", "export", "import"];
|
|
26
|
-
type Command = (typeof CLI_COMMANDS)[number];
|
|
27
|
-
type RunsCommand = (typeof CLI_RUNS_COMMANDS)[number];
|
|
28
|
-
type SessionsCommand = (typeof CLI_SESSIONS_COMMANDS)[number];
|
|
29
|
-
type ChangesCommand = (typeof CLI_CHANGES_COMMANDS)[number];
|
|
30
|
-
type StateCommand = (typeof CLI_STATE_COMMANDS)[number];
|
|
31
|
-
export interface CliOptions {
|
|
32
|
-
command: Command;
|
|
33
|
-
profile?: string;
|
|
34
|
-
provider?: string;
|
|
35
|
-
model?: string;
|
|
36
|
-
workspace?: string;
|
|
37
|
-
stateDirectory?: string;
|
|
38
|
-
storeBackend?: string;
|
|
39
|
-
tenantId?: string;
|
|
40
|
-
userId?: string;
|
|
41
|
-
namespace?: string;
|
|
42
|
-
maxSteps?: number;
|
|
43
|
-
timeoutMs?: number;
|
|
44
|
-
maxToolCalls?: number;
|
|
45
|
-
maxToolErrors?: number;
|
|
46
|
-
maxInputTokens?: number;
|
|
47
|
-
maxOutputTokens?: number;
|
|
48
|
-
maxTotalTokens?: number;
|
|
49
|
-
maxCostUsd?: number;
|
|
50
|
-
inputCostPerMillion?: number;
|
|
51
|
-
outputCostPerMillion?: number;
|
|
52
|
-
allowedChecks?: string[];
|
|
53
|
-
requiredCapabilities?: string[];
|
|
54
|
-
subagentProfiles?: HarnessSubagentProfile[];
|
|
55
|
-
reviewers?: HarnessSubagentProfile[];
|
|
56
|
-
routes?: string[];
|
|
57
|
-
subagentMaxSteps?: number;
|
|
58
|
-
subagentMaxToolCalls?: number;
|
|
59
|
-
subagentMaxToolErrors?: number;
|
|
60
|
-
subagentMaxInputTokens?: number;
|
|
61
|
-
subagentMaxOutputTokens?: number;
|
|
62
|
-
subagentMaxTotalTokens?: number;
|
|
63
|
-
subagentTimeoutMs?: number;
|
|
64
|
-
maxParallelReviews?: number;
|
|
65
|
-
executionBackend?: string;
|
|
66
|
-
agentProfile?: string;
|
|
67
|
-
ociRuntime?: string;
|
|
68
|
-
ociImage?: string;
|
|
69
|
-
ociAllowedCommands?: string[];
|
|
70
|
-
ociShellMode?: string;
|
|
71
|
-
ociMaxProcessRuntimeMs?: number;
|
|
72
|
-
ociMaxProcessOutputBytes?: number;
|
|
73
|
-
ociMaxMemoryMb?: number;
|
|
74
|
-
ociMaxPids?: number;
|
|
75
|
-
ociMaxCpus?: number;
|
|
76
|
-
ociMaxWorkspaceBytes?: number;
|
|
77
|
-
ociMaxFileWriteBytes?: number;
|
|
78
|
-
ociTmpfsMb?: number;
|
|
79
|
-
mcpConfigPath?: string;
|
|
80
|
-
contextConfigPath?: string;
|
|
81
|
-
projectContext?: boolean;
|
|
82
|
-
prompt?: string;
|
|
83
|
-
runId?: string;
|
|
84
|
-
idempotencyKey?: string;
|
|
85
|
-
runsCommand?: RunsCommand;
|
|
86
|
-
sessionsCommand?: SessionsCommand;
|
|
87
|
-
changesCommand?: ChangesCommand;
|
|
88
|
-
stateCommand?: StateCommand;
|
|
89
|
-
artifactPath?: string;
|
|
90
|
-
patchPath?: string;
|
|
91
|
-
preconditionsPath?: string;
|
|
92
|
-
verificationTime?: string;
|
|
93
|
-
backupPath?: string;
|
|
94
|
-
sessionId?: string;
|
|
95
|
-
sessionTitle?: string;
|
|
96
|
-
continueSession: boolean;
|
|
97
|
-
implicitCommand: boolean;
|
|
98
|
-
statuses?: AgentStatus[];
|
|
99
|
-
limit?: number;
|
|
100
|
-
cursor?: string;
|
|
101
|
-
before?: number;
|
|
102
|
-
reason?: string;
|
|
103
|
-
cascade: boolean;
|
|
104
|
-
final: boolean;
|
|
105
|
-
apply: boolean;
|
|
106
|
-
yes: boolean;
|
|
107
|
-
approve?: boolean;
|
|
108
|
-
json: boolean;
|
|
109
|
-
jsonl: boolean;
|
|
110
|
-
}
|
|
111
|
-
export declare class CliUsageError extends HarnessError {
|
|
112
|
-
constructor(message: string);
|
|
113
|
-
}
|
|
114
|
-
export declare const createHarnessResumeMetadata: (config: HarnessConfig, routes?: ReadonlyMap<HarnessSubagentProfile, HarnessModelRoute>) => NonNullable<AgentRunInput["metadata"]>;
|
|
115
|
-
export declare const readHarnessResumeConfig: (state: Pick<AgentRunState, "metadata">) => HarnessConfigInput | undefined;
|
|
116
|
-
export declare const readHarnessResumeRoutes: (state: Pick<AgentRunState, "metadata">) => Map<"explorer" | "implementer" | "reviewer" | "tester", HarnessModelRoute>;
|
|
117
|
-
export declare const resumeCommand: (runId: string, config: HarnessConfig, approve?: boolean) => string;
|
|
118
|
-
export declare const parseCliArgs: (argv: string[]) => CliOptions;
|
|
119
|
-
export declare const CLI_HELP_TEXT: string;
|
|
120
|
-
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
|
-
export declare const withTemporaryHarnessProfiles: <T>(profiles: readonly HarnessSubagentProfile[], configure: (profiles: readonly HarnessSubagentProfile[]) => Promise<void>, operation: () => Promise<T>) => Promise<T>;
|
|
189
|
-
export declare const providersDocument: (env?: NodeJS.ProcessEnv) => {
|
|
190
|
-
schemaVersion: 1;
|
|
191
|
-
kind: "providers";
|
|
192
|
-
providers: readonly import("./providers.js").ProviderAvailability[];
|
|
193
|
-
};
|
|
194
|
-
export type DoctorCheckStatus = "pass" | "warn" | "fail";
|
|
195
|
-
export interface DoctorCheck {
|
|
196
|
-
id: string;
|
|
197
|
-
status: DoctorCheckStatus;
|
|
198
|
-
message: string;
|
|
199
|
-
details: Record<string, boolean | number | string | readonly string[]>;
|
|
200
|
-
}
|
|
201
|
-
export interface DoctorReport {
|
|
202
|
-
schemaVersion: typeof CLI_JSON_SCHEMA_VERSION;
|
|
203
|
-
kind: "doctor";
|
|
204
|
-
ok: boolean;
|
|
205
|
-
harnessVersion: string;
|
|
206
|
-
configSchemaVersion: number;
|
|
207
|
-
configuration: {
|
|
208
|
-
provider: HarnessProvider;
|
|
209
|
-
model: string;
|
|
210
|
-
workspace: string;
|
|
211
|
-
stateDirectory: string;
|
|
212
|
-
storeBackend: string;
|
|
213
|
-
scope: ReturnType<typeof resolveHarnessConfig>["scope"];
|
|
214
|
-
maxSteps: number;
|
|
215
|
-
timeoutMs: number;
|
|
216
|
-
agentProfile: "strict" | "repair";
|
|
217
|
-
budget: ReturnType<typeof resolveHarnessConfig>["budget"];
|
|
218
|
-
costBudget?: ReturnType<typeof resolveHarnessConfig>["costBudget"];
|
|
219
|
-
compaction: ReturnType<typeof resolveHarnessConfig>["compaction"];
|
|
220
|
-
allowedChecks: readonly string[];
|
|
221
|
-
requiredCapabilities: ReturnType<typeof resolveHarnessConfig>["requiredCapabilities"];
|
|
222
|
-
orchestration: ReturnType<typeof resolveHarnessConfig>["orchestration"];
|
|
223
|
-
context: ReturnType<typeof resolveHarnessConfig>["context"];
|
|
224
|
-
execution: ReturnType<typeof resolveHarnessConfig>["execution"];
|
|
225
|
-
mcpConfigPath?: string;
|
|
226
|
-
};
|
|
227
|
-
checks: DoctorCheck[];
|
|
228
|
-
providers: ReturnType<typeof providerAvailability>;
|
|
229
|
-
}
|
|
230
|
-
export interface DoctorContext {
|
|
231
|
-
env?: NodeJS.ProcessEnv;
|
|
232
|
-
nodeVersion?: string;
|
|
233
|
-
/** @deprecated Test-only compatibility injection for the secondary Bun runtime. */
|
|
234
|
-
bunVersion?: string;
|
|
235
|
-
ociRuntimeAdapter?: HarnessOciRuntimeAdapter;
|
|
236
|
-
}
|
|
237
|
-
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>;
|
|
238
|
-
export declare const formatDoctorReport: (report: DoctorReport) => string;
|
|
239
|
-
export declare const cliExitCodeForError: (error: unknown) => 1 | 2;
|
|
2
|
+
export { runResultDocument } from "./cli/run-document.js";
|
|
3
|
+
export { CLI_JSON_SCHEMA_VERSION } from "./cli/cli-stream.js";
|
|
240
4
|
export declare const main: (argv?: string[]) => Promise<void>;
|
|
5
|
+
export { HARNESS_RESUME_METADATA_KEY } from "./cli/resume-metadata.js";
|
|
6
|
+
export { HARNESS_RESUME_METADATA_SCHEMA_VERSION } from "./cli/resume-metadata.js";
|
|
7
|
+
export { CLI_EXIT_CODES } from "./cli/errors.js";
|
|
8
|
+
export { annotateCliStreamError } from "./cli/presentation.js";
|
|
9
|
+
export { cliStreamErrorSequence } from "./cli/presentation.js";
|
|
10
|
+
export { terminalErrorMessage } from "./cli/presentation.js";
|
|
11
|
+
export { CLI_COMMANDS } from "./cli/arguments.js";
|
|
12
|
+
export { CLI_RUNS_COMMANDS } from "./cli/arguments.js";
|
|
13
|
+
export { CLI_SESSIONS_COMMANDS } from "./cli/arguments.js";
|
|
14
|
+
export { CLI_CHANGES_COMMANDS } from "./cli/arguments.js";
|
|
15
|
+
export { CLI_STATE_COMMANDS } from "./cli/arguments.js";
|
|
16
|
+
export type { CliOptions } from "./cli/arguments.js";
|
|
17
|
+
export { CliUsageError } from "./cli/arguments.js";
|
|
18
|
+
export { createHarnessResumeMetadata } from "./cli/resume-metadata.js";
|
|
19
|
+
export { readHarnessResumeConfig } from "./cli/resume-metadata.js";
|
|
20
|
+
export { readHarnessResumeRoutes } from "./cli/resume-metadata.js";
|
|
21
|
+
export { resumeCommand } from "./cli/resume-metadata.js";
|
|
22
|
+
export { parseCliArgs } from "./cli/arguments.js";
|
|
23
|
+
export { CLI_HELP_TEXT } from "./cli/help-text.js";
|
|
24
|
+
export { CLI_FULL_HELP_TEXT } from "./cli/help-text.js";
|
|
25
|
+
export { summarizeApproval } from "./cli/presentation.js";
|
|
26
|
+
export { withTemporaryHarnessProfiles } from "./cli/routing.js";
|
|
27
|
+
export { providersDocument } from "./cli/setup.js";
|
|
28
|
+
export { confirmDefaultProfileSelection } from "./cli/setup.js";
|
|
29
|
+
export type { DoctorCheckStatus } from "./cli/doctor.js";
|
|
30
|
+
export type { DoctorCheck } from "./cli/doctor.js";
|
|
31
|
+
export type { DoctorReport } from "./cli/doctor.js";
|
|
32
|
+
export type { DoctorContext } from "./cli/doctor.js";
|
|
33
|
+
export { createDoctorReport } from "./cli/doctor.js";
|
|
34
|
+
export { formatDoctorReport } from "./cli/doctor.js";
|
|
35
|
+
export { cliExitCodeForError } from "./cli/errors.js";
|