@zhivex-ai/harness 1.2.0 → 1.3.0-rc.7

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 (164) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +9 -10
  3. package/contracts/engine-api.json +2921 -0
  4. package/contracts/public-api.json +267 -1
  5. package/contracts/stable-api-signatures.json +43 -43
  6. package/dist/acp-cli.js +137 -15002
  7. package/dist/approvals/approval-history.d.ts +22 -0
  8. package/dist/approvals/explicit-review.d.ts +24 -0
  9. package/dist/approvals/host-policy-identity.d.ts +3 -0
  10. package/dist/cli/arguments.d.ts +6 -2
  11. package/dist/cli/checkpoints.d.ts +230 -0
  12. package/dist/cli/cli-options.d.ts +2 -41
  13. package/dist/cli/cli-profiles.d.ts +4 -2
  14. package/dist/cli/cli-stream.d.ts +2 -167
  15. package/dist/cli/governance-report.d.ts +5 -0
  16. package/dist/cli/policy-decisions.d.ts +9 -0
  17. package/dist/cli/policy.d.ts +5 -0
  18. package/dist/cli/presentation.d.ts +3 -1
  19. package/dist/cli/run-document.d.ts +2 -91
  20. package/dist/cli/terminal/terminal-continuation.d.ts +2 -3
  21. package/dist/cli/terminal/terminal-ui.d.ts +4 -0
  22. package/dist/{cli-entry-c2f58zj2.js → cli-entry-ae7x44d4.js} +14969 -10731
  23. package/dist/{cli-entry-427869g9.js → cli-entry-d5788aay.js} +388 -47
  24. package/dist/cli-entry-ev76ezcd.js +656 -0
  25. package/dist/{cli-3jmy4h5h.js → cli-t7hrhayq.js} +918 -2223
  26. package/dist/cli.js +3 -5
  27. package/dist/client/acp-mcp-admission.d.ts +32 -0
  28. package/dist/client/acp-mcp-host.d.ts +19 -0
  29. package/dist/client/acp-mcp-session.d.ts +14 -0
  30. package/dist/client/acp-stdio.d.ts +2 -0
  31. package/dist/client/acp.d.ts +4 -1
  32. package/dist/client/adapter.d.ts +13 -1
  33. package/dist/client/continuation.d.ts +3 -0
  34. package/dist/client/json-contracts.d.ts +107 -4
  35. package/dist/client/local-service.d.ts +2 -0
  36. package/dist/client/protocol.d.ts +127 -1
  37. package/dist/client/run-document.d.ts +91 -0
  38. package/dist/client/service-events.d.ts +4 -0
  39. package/dist/client/stream.d.ts +167 -0
  40. package/dist/compat/cli-options.d.ts +53 -0
  41. package/dist/compat/code-support.d.ts +22 -0
  42. package/dist/compat/code-support.js +74 -0
  43. package/dist/{config-1k9t4jhh.js → config-c002f06f.js} +1 -1
  44. package/dist/config-j3jga5wh.js +61 -0
  45. package/dist/context/adaptive-compaction.d.ts +1 -0
  46. package/dist/context/compaction.d.ts +1 -1
  47. package/dist/context/request-measurements.d.ts +17 -0
  48. package/dist/context/request-projection.d.ts +10 -0
  49. package/dist/context/task-memory.d.ts +1 -0
  50. package/dist/engine/acp.d.ts +6 -0
  51. package/dist/engine/acp.js +205 -0
  52. package/dist/engine/client.d.ts +6 -0
  53. package/dist/engine/client.js +28 -0
  54. package/dist/engine/desktop-providers-v1.d.ts +4 -0
  55. package/dist/engine/desktop-providers-v1.js +18 -0
  56. package/dist/engine/desktop-state-v1.d.ts +10 -0
  57. package/dist/engine/desktop-state-v1.js +168 -0
  58. package/dist/engine/index.d.ts +73 -0
  59. package/dist/engine/index.js +977 -0
  60. package/dist/engine/mcp-stdio-v1.d.ts +11 -0
  61. package/dist/engine/mcp-stdio-v1.js +108 -0
  62. package/dist/engine/models.d.ts +3 -0
  63. package/dist/engine/models.js +894 -0
  64. package/dist/engine/protocol.d.ts +7 -0
  65. package/dist/engine/protocol.js +182 -0
  66. package/dist/engine/service.d.ts +5 -0
  67. package/dist/engine/service.js +28 -0
  68. package/dist/execution/acceptance-snapshot.d.ts +2 -0
  69. package/dist/execution/execution-environment.d.ts +10 -0
  70. package/dist/execution/mcp-oci-channel.d.ts +11 -0
  71. package/dist/execution/mcp-oci-server.d.ts +38 -0
  72. package/dist/execution/mcp-oci-workspace.d.ts +23 -0
  73. package/dist/execution/mcp-resource-recovery.d.ts +19 -0
  74. package/dist/execution/mcp-workspace-snapshot.d.ts +20 -0
  75. package/dist/hostile-repository-demo.js +3368 -1304
  76. package/dist/index-1bx83sw4.js +4 -0
  77. package/dist/index-2gz7jv7g.js +549 -0
  78. package/dist/{cli-entry-b1mfvmxe.js → index-2jrdcj6b.js} +72 -115
  79. package/dist/index-3ah1f369.js +356 -0
  80. package/dist/index-42gp2hy8.js +1555 -0
  81. package/dist/index-4jw3tvy8.js +301 -0
  82. package/dist/index-8705zxpr.js +145 -0
  83. package/dist/index-8vm2m34s.js +2080 -0
  84. package/dist/index-8zzhggxv.js +477 -0
  85. package/dist/index-a97bezbz.js +1073 -0
  86. package/dist/index-gq9xagx2.js +1343 -0
  87. package/dist/index-h0mqx2ed.js +1373 -0
  88. package/dist/index-jgrx804e.js +5589 -0
  89. package/dist/index-qfpz5y2v.js +174 -0
  90. package/dist/index-t60rva31.js +1004 -0
  91. package/dist/index-wg1sd3at.js +80 -0
  92. package/dist/index-xqxeypt5.js +888 -0
  93. package/dist/index-yb239ghk.js +961 -0
  94. package/dist/index-z0qxmkm2.js +3389 -0
  95. package/dist/index-z4e8d0ph.js +1768 -0
  96. package/dist/index.js +251 -18649
  97. package/dist/integrations/mcp-host-session.d.ts +26 -0
  98. package/dist/integrations/mcp-stdio-admission.d.ts +54 -0
  99. package/dist/integrations/mcp-stdio-client.d.ts +44 -0
  100. package/dist/integrations/mcp-stdio-framing.d.ts +18 -0
  101. package/dist/integrations/mcp-stdio-launch.d.ts +20 -0
  102. package/dist/integrations/mcp-stdio-session.d.ts +7 -0
  103. package/dist/integrations/mcp-stdio-tools.d.ts +12 -0
  104. package/dist/internal/desktop/catalog.d.ts +2 -0
  105. package/dist/internal/desktop/persistence.d.ts +2 -3
  106. package/dist/internal/desktop/providers.d.ts +1 -0
  107. package/dist/models/catalog.d.ts +2 -0
  108. package/dist/persistence/governance-context.d.ts +126 -0
  109. package/dist/persistence/governance-report.d.ts +299 -0
  110. package/dist/persistence/host-database-backup.d.ts +28 -0
  111. package/dist/persistence/mcp-execution-journal.d.ts +19 -0
  112. package/dist/persistence/mcp-reconciliation.d.ts +33 -0
  113. package/dist/persistence/mcp-resource-journal.d.ts +54 -0
  114. package/dist/persistence/workspace-checkpoints.d.ts +138 -0
  115. package/dist/providers/anthropic-continuation.d.ts +5 -0
  116. package/dist/providers/providers.d.ts +1 -1
  117. package/dist/providers/vertex-auth.d.ts +27 -0
  118. package/dist/runtime/delegation-contracts.d.ts +9 -0
  119. package/dist/runtime/delegation-correction.d.ts +9 -0
  120. package/dist/runtime/delegation-result.d.ts +73 -0
  121. package/dist/runtime/error-diagnostics.d.ts +86 -0
  122. package/dist/runtime/harness.d.ts +11 -1
  123. package/dist/runtime/policy-decisions.d.ts +66 -0
  124. package/dist/runtime/policy-inspection.d.ts +52 -0
  125. package/dist/runtime/provider-diagnostics.d.ts +1 -0
  126. package/dist/runtime/runtime-instructions.d.ts +8 -0
  127. package/dist/runtime/task-acceptance-checks.d.ts +103 -0
  128. package/dist/runtime/task-acceptance-delivery.d.ts +107 -0
  129. package/dist/runtime/task-acceptance-host.d.ts +20 -0
  130. package/dist/runtime/task-acceptance-record.d.ts +107 -0
  131. package/dist/runtime/task-acceptance-validation.d.ts +25 -0
  132. package/dist/runtime/task-acceptance.d.ts +47 -0
  133. package/dist/runtime/time-to-safe-fix.d.ts +83 -0
  134. package/dist/runtime/tool-policy-file.d.ts +23 -0
  135. package/dist/runtime/tool-policy-paths.d.ts +5 -0
  136. package/dist/runtime/tool-policy.d.ts +6 -0
  137. package/dist/service-cli.js +19 -14504
  138. package/dist/{service-client-cli-yx56n0hc.js → service-client-cli-kns4mf57.js} +307 -248
  139. package/dist/verify-historical-migrations.js +3314 -1251
  140. package/dist/workspace/path-policy.d.ts +4 -0
  141. package/dist/zhx.js +3 -5
  142. package/docs/ACP.md +14 -2
  143. package/docs/ANTHROPIC.md +33 -0
  144. package/docs/CLI.md +132 -0
  145. package/docs/CLIENT_PROTOCOL.md +45 -0
  146. package/docs/CODE_RELEASE.md +93 -0
  147. package/docs/ENGINE_API.md +319 -0
  148. package/docs/EXTENSIBILITY.md +46 -3
  149. package/docs/FIRST_USE.md +6 -6
  150. package/docs/LOCAL_SERVICE.md +13 -0
  151. package/docs/MCP_STDIO.md +20 -0
  152. package/docs/README.md +6 -0
  153. package/docs/STABILITY.md +9 -1
  154. package/docs/SUPPORT_MATRIX.md +1 -1
  155. package/docs/TOOL_POLICY.md +81 -0
  156. package/docs/VERTEX.md +50 -0
  157. package/docs/adr/0002-isolated-mcp-stdio.md +135 -0
  158. package/docs/fixtures/mcp-stdio-contract-v1.json +189 -0
  159. package/docs/support-matrix.json +2 -0
  160. package/evaluations/representative-assembly-matrix.json +64 -1
  161. package/evaluations/task-acceptance-routes.json +7 -0
  162. package/examples/README.md +1 -1
  163. package/package.json +74 -12
  164. package/dist/cli-entry-64pdp3k5.js +0 -17
@@ -3,6 +3,17 @@ import type { AgentRunState, AgentToolCallJournalEntry } from "@zhivex-ai/core";
3
3
  import type { AppliedDiff } from "./approval-diff.js";
4
4
  export declare const APPROVAL_HISTORY_KEY = "clientApprovalDecisionsV1";
5
5
  export declare const approvalInputDigest: (value: unknown) => string;
6
+ export declare const approvalProvenanceSchema: z.ZodObject<{
7
+ schemaVersion: z.ZodLiteral<1>;
8
+ origin: z.ZodEnum<{
9
+ application: "application";
10
+ automatic: "automatic";
11
+ interactive: "interactive";
12
+ unknown: "unknown";
13
+ }>;
14
+ channel: z.ZodString;
15
+ policyDigest: z.ZodNullable<z.ZodString>;
16
+ }, z.core.$strict>;
6
17
  declare const rowSchema: z.ZodObject<{
7
18
  approvalId: z.ZodString;
8
19
  digest: z.ZodString;
@@ -12,6 +23,17 @@ declare const rowSchema: z.ZodObject<{
12
23
  approved: z.ZodBoolean;
13
24
  decidedAt: z.ZodNumber;
14
25
  reviewedRevision: z.ZodNumber;
26
+ provenance: z.ZodOptional<z.ZodObject<{
27
+ schemaVersion: z.ZodLiteral<1>;
28
+ origin: z.ZodEnum<{
29
+ application: "application";
30
+ automatic: "automatic";
31
+ interactive: "interactive";
32
+ unknown: "unknown";
33
+ }>;
34
+ channel: z.ZodString;
35
+ policyDigest: z.ZodNullable<z.ZodString>;
36
+ }, z.core.$strict>>;
15
37
  }, z.core.$strict>;
16
38
  export type ApprovalDecisionRecord = z.infer<typeof rowSchema>;
17
39
  export interface ApprovalDecisionView extends ApprovalDecisionRecord {
@@ -0,0 +1,24 @@
1
+ import type { AgentApprovalResponse, AgentRunState } from '@zhivex-ai/core';
2
+ import type { AgentRunStore } from '@zhivex-ai/agents/ops';
3
+ type DecisionOrigin = 'interactive' | 'automatic' | 'application';
4
+ /** Presence only; admission still validates and consumes the receipt against durable state. */
5
+ export declare const hasHostApprovalReceipt: (responses: readonly AgentApprovalResponse[]) => boolean;
6
+ /** Trusted host only: call after its review UI confirms the complete snapshot.
7
+ * No renderer/client flag creates evidence. Cloning or serializing loses authority.
8
+ * This attests a local channel, not a person's legal or corporate identity. */
9
+ export declare const issueExplicitReviewResponses: (host: object, state: AgentRunState, responses: readonly AgentApprovalResponse[], channel: string, now?: number, reviewedRevision?: number) => AgentApprovalResponse[];
10
+ /** Observed provenance is separate from evidence of complete explicit review. */
11
+ export declare const issueObservedApprovalResponses: (host: object, state: AgentRunState, responses: readonly AgentApprovalResponse[], channel: string, origins: readonly DecisionOrigin[], now?: number) => AgentApprovalResponse[];
12
+ export declare const issueAutomaticApprovalResponses: (host: object, state: AgentRunState, responses: readonly AgentApprovalResponse[], channel: string) => AgentApprovalResponse[];
13
+ /** Internal adapter handoff after its durable intent write; not a protocol field. */
14
+ export declare const issueRecordedApprovalResponses: (host: object, state: AgentRunState, responses: readonly AgentApprovalResponse[]) => AgentApprovalResponse[];
15
+ export declare const consumeExplicitReviewResponses: (host: object, state: AgentRunState, responses: readonly AgentApprovalResponse[], now?: number) => {
16
+ alreadyRecorded?: boolean;
17
+ origins: DecisionOrigin[];
18
+ channel: string;
19
+ policyDigest: string | null;
20
+ reviewedRevision: number;
21
+ };
22
+ /** Save review intent before effects; acknowledgement loss does not authorize retry. */
23
+ export declare const admitExplicitReviewResponses: (host: object, store: AgentRunStore, state: AgentRunState, responses: readonly AgentApprovalResponse[]) => Promise<AgentRunState>;
24
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare const bindHostPolicyIdentity: (host: object, digest: string, explicitReview?: boolean) => void;
2
+ export declare const hostPolicyIdentity: (host: object) => string | null;
3
+ export declare const requiresExplicitHostReview: (host: object) => boolean;
@@ -2,8 +2,8 @@ import { type HarnessReasoningEffort } from "../providers/reasoning.js";
2
2
  import { type AgentStatus } from "@zhivex-ai/agents";
3
3
  import { type HarnessSubagentProfile } from "../runtime/config.js";
4
4
  import { HarnessError } from "../runtime/errors.js";
5
- export declare const CLI_COMMANDS: readonly ["init", "run", "review", "chat", "providers", "doctor", "resume", "runs", "sessions", "changes", "state", "help", "version"];
6
- export declare const CLI_RUNS_COMMANDS: readonly ["list", "inspect", "cancel", "cleanup", "export"];
5
+ export declare const CLI_COMMANDS: readonly ["init", "run", "review", "chat", "providers", "doctor", "policy", "resume", "runs", "sessions", "checkpoints", "changes", "state", "help", "version"];
6
+ export declare const CLI_RUNS_COMMANDS: readonly ["list", "inspect", "cancel", "cleanup", "export", "report"];
7
7
  export declare const CLI_SESSIONS_COMMANDS: readonly ["list", "inspect", "rename", "fork", "archive"];
8
8
  export declare const CLI_CHANGES_COMMANDS: readonly ["create", "verify"];
9
9
  export declare const CLI_STATE_COMMANDS: readonly ["status", "export", "import"];
@@ -75,7 +75,10 @@ export interface CliOptions {
75
75
  runId?: string;
76
76
  idempotencyKey?: string;
77
77
  runsCommand?: RunsCommand;
78
+ reportEnvelopePath?: string;
78
79
  sessionsCommand?: SessionsCommand;
80
+ checkpointsCommand?: "list" | "capture" | "inspect" | "prepare" | "review" | "apply" | "recover" | "storage" | "prune-review" | "prune-apply";
81
+ checkpointArguments?: string[];
79
82
  changesCommand?: ChangesCommand;
80
83
  stateCommand?: StateCommand;
81
84
  artifactPath?: string;
@@ -87,6 +90,7 @@ export interface CliOptions {
87
90
  sessionTitle?: string;
88
91
  sessionSearch?: string;
89
92
  pricingFile?: string;
93
+ toolPolicyFile?: string;
90
94
  usageLimitUsd?: number;
91
95
  continueSession: boolean;
92
96
  implicitCommand: boolean;
@@ -0,0 +1,230 @@
1
+ import { type CliSession } from '../persistence/sessions.js';
2
+ import { type CliOptions } from './arguments.js';
3
+ /** Operator CLI over the existing checkpoint API; never constructs a model. */
4
+ export declare function checkpointCliDocument(options: CliOptions): Promise<{
5
+ policy: 'explicit-reviewed-removal';
6
+ automaticEviction: false;
7
+ maxRecords: number;
8
+ maxRecordBytes: number;
9
+ maxFilesPerCheckpoint: number;
10
+ maxFileBytes: number;
11
+ records: number;
12
+ availableRecords: number;
13
+ serializedBytes: number;
14
+ pendingRestores: number;
15
+ checkpoints: {
16
+ id: string;
17
+ referenced: boolean;
18
+ }[];
19
+ kind: string;
20
+ restores?: never;
21
+ inspection?: never;
22
+ reviewedProposalId?: never;
23
+ diff?: never;
24
+ coverage?: never;
25
+ forkSessionId?: never;
26
+ operationId?: never;
27
+ stage?: never;
28
+ session?: never;
29
+ } | {
30
+ planId: string;
31
+ selection: {
32
+ checkpointIds: string[];
33
+ completedRestoreIds: string[];
34
+ };
35
+ records: {
36
+ id: string;
37
+ kind: string;
38
+ sessionId: string;
39
+ bytes: number;
40
+ }[];
41
+ recordsBefore: number;
42
+ recordsAfter: number;
43
+ bytesRemoved: number;
44
+ workspaceFilesChanged: false;
45
+ conversationsChanged: false;
46
+ kind: string;
47
+ checkpoints?: never;
48
+ restores?: never;
49
+ inspection?: never;
50
+ reviewedProposalId?: never;
51
+ diff?: never;
52
+ coverage?: never;
53
+ forkSessionId?: never;
54
+ operationId?: never;
55
+ stage?: never;
56
+ session?: never;
57
+ } | {
58
+ kind: string;
59
+ checkpoints: {
60
+ id: string;
61
+ sessionId: string;
62
+ turnId: string;
63
+ files: {
64
+ path: string;
65
+ digest: string;
66
+ bytes: number;
67
+ mode: number;
68
+ }[];
69
+ }[];
70
+ restores: {
71
+ id: string;
72
+ checkpointId: string;
73
+ proposalId: string;
74
+ stage: "applied" | "applying" | "completed" | "forked" | "forking" | "prepared";
75
+ forkSessionId?: string;
76
+ }[];
77
+ inspection?: never;
78
+ reviewedProposalId?: never;
79
+ diff?: never;
80
+ coverage?: never;
81
+ forkSessionId?: never;
82
+ operationId?: never;
83
+ stage?: never;
84
+ session?: never;
85
+ } | {
86
+ checkpoints?: never;
87
+ restores?: never;
88
+ kind: string;
89
+ inspection: {
90
+ checkpoint: {
91
+ id: string;
92
+ sessionId: string;
93
+ turnId: string;
94
+ files: {
95
+ path: string;
96
+ digest: string;
97
+ bytes: number;
98
+ mode: number;
99
+ }[];
100
+ };
101
+ files: ({
102
+ path: string;
103
+ status: "mode-conflict";
104
+ before?: never;
105
+ after?: never;
106
+ expectedDigest?: never;
107
+ afterDigest?: never;
108
+ mode?: never;
109
+ } | {
110
+ path: string;
111
+ status: "available";
112
+ before: string;
113
+ after: string;
114
+ expectedDigest: string;
115
+ afterDigest: string;
116
+ mode: number;
117
+ } | {
118
+ before?: never;
119
+ after?: never;
120
+ expectedDigest?: never;
121
+ afterDigest?: never;
122
+ mode?: never;
123
+ path: string;
124
+ status: "unavailable";
125
+ })[];
126
+ coverage: {
127
+ existingTextOnly: true;
128
+ maxFiles: number;
129
+ maxFileBytes: number;
130
+ creation: false;
131
+ deletion: false;
132
+ binary: false;
133
+ modeRollback: false;
134
+ fullWorkspaceSnapshot: false;
135
+ };
136
+ };
137
+ reviewedProposalId?: never;
138
+ diff?: never;
139
+ coverage?: never;
140
+ forkSessionId?: never;
141
+ operationId?: never;
142
+ stage?: never;
143
+ session?: never;
144
+ } | {
145
+ checkpoints?: never;
146
+ restores?: never;
147
+ inspection?: never;
148
+ kind: string;
149
+ operationId: string;
150
+ stage: "applied" | "applying" | "completed" | "forked" | "forking" | "prepared";
151
+ reviewedProposalId: string;
152
+ diff: {
153
+ proposalId: string;
154
+ files: {
155
+ path: string;
156
+ expectedDigest: import("../index.js").FileDigest | null;
157
+ before: string | null;
158
+ after: string;
159
+ afterDigest: import("../index.js").FileDigest;
160
+ }[];
161
+ };
162
+ coverage: {
163
+ existingTextOnly: true;
164
+ maxFiles: number;
165
+ maxFileBytes: number;
166
+ creation: false;
167
+ deletion: false;
168
+ binary: false;
169
+ modeRollback: false;
170
+ fullWorkspaceSnapshot: false;
171
+ };
172
+ forkSessionId?: never;
173
+ session?: never;
174
+ } | {
175
+ checkpoints?: never;
176
+ restores?: never;
177
+ inspection?: never;
178
+ kind: string;
179
+ operationId: string;
180
+ stage: "applied" | "applying" | "completed" | "forked" | "forking" | "prepared";
181
+ reviewedProposalId: string;
182
+ forkSessionId: string | undefined;
183
+ previewStatus: string;
184
+ diff?: {
185
+ proposalId: string;
186
+ files: {
187
+ path: string;
188
+ expectedDigest: import("../index.js").FileDigest | null;
189
+ before: string | null;
190
+ after: string;
191
+ afterDigest: import("../index.js").FileDigest;
192
+ }[];
193
+ };
194
+ coverage: {
195
+ existingTextOnly: true;
196
+ maxFiles: number;
197
+ maxFileBytes: number;
198
+ creation: false;
199
+ deletion: false;
200
+ binary: false;
201
+ modeRollback: false;
202
+ fullWorkspaceSnapshot: false;
203
+ };
204
+ session?: never;
205
+ } | {
206
+ checkpoints?: never;
207
+ restores?: never;
208
+ inspection?: never;
209
+ reviewedProposalId?: never;
210
+ diff?: never;
211
+ coverage?: never;
212
+ kind: string;
213
+ operationId: string;
214
+ stage: "applied" | "applying" | "completed" | "forked" | "forking" | "prepared";
215
+ forkSessionId: string | undefined;
216
+ session?: never;
217
+ } | {
218
+ checkpoints?: never;
219
+ restores?: never;
220
+ inspection?: never;
221
+ reviewedProposalId?: never;
222
+ diff?: never;
223
+ coverage?: never;
224
+ forkSessionId?: never;
225
+ kind: string;
226
+ operationId: string;
227
+ stage: "applied" | "applying" | "completed" | "forked" | "forking" | "prepared";
228
+ session: CliSession;
229
+ }>;
230
+ export declare function manageCheckpoints(options: CliOptions): Promise<CliSession | undefined>;
@@ -1,41 +1,2 @@
1
- export interface CliOptionDefinition {
2
- repeatable: boolean;
3
- conflictsWith: readonly string[];
4
- }
5
- export interface CliCommandOptionContract {
6
- allowed: readonly string[];
7
- required: readonly (string | readonly string[])[];
8
- repeatable: readonly string[];
9
- conflicts: Readonly<Record<string, readonly string[]>>;
10
- }
11
- export declare const CLI_OPTION_NAMES: readonly ["--compaction-model", "--compaction-provider", "--provider", "--model", "--reasoning", "--profile", "--route", "--workspace", "--state-dir", "--mcp-config", "--context-config", "--no-project-context", "--patch", "--preconditions", "--now", "--require-verified-delivery", "--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", "--token-budget", "--context-tokens", "--no-token-budget", "--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", "--approval-mode", "--yes", "--approve", "--deny", "--json", "--jsonl", "--session", "--continue", "--update", "--status", "--limit", "--cursor", "--before", "--reason", "--cascade", "--final", "--service", "--apply", "--help", "--version", "--search", "--pricing-file", "--usage-limit-usd"];
12
- export type CliOptionName = (typeof CLI_OPTION_NAMES)[number];
13
- export declare const CLI_OPTION_DEFINITIONS: Readonly<Record<CliOptionName, CliOptionDefinition>>;
14
- export declare const CLI_COMMAND_OPTION_CONTRACTS: {
15
- readonly init: CliCommandOptionContract;
16
- readonly run: CliCommandOptionContract;
17
- readonly review: CliCommandOptionContract;
18
- readonly chat: CliCommandOptionContract;
19
- readonly providers: CliCommandOptionContract;
20
- readonly doctor: CliCommandOptionContract;
21
- readonly resume: CliCommandOptionContract;
22
- readonly "runs:list": CliCommandOptionContract;
23
- readonly "runs:inspect": CliCommandOptionContract;
24
- readonly "runs:cancel": CliCommandOptionContract;
25
- readonly "runs:cleanup": CliCommandOptionContract;
26
- readonly "runs:export": CliCommandOptionContract;
27
- readonly "sessions:list": CliCommandOptionContract;
28
- readonly "sessions:inspect": CliCommandOptionContract;
29
- readonly "sessions:rename": CliCommandOptionContract;
30
- readonly "sessions:fork": CliCommandOptionContract;
31
- readonly "sessions:archive": CliCommandOptionContract;
32
- readonly "changes:create": CliCommandOptionContract;
33
- readonly "changes:verify": CliCommandOptionContract;
34
- readonly "state:status": CliCommandOptionContract;
35
- readonly "state:export": CliCommandOptionContract;
36
- readonly "state:import": CliCommandOptionContract;
37
- readonly help: CliCommandOptionContract;
38
- readonly version: CliCommandOptionContract;
39
- };
40
- export type CliCommandOptionContractKey = keyof typeof CLI_COMMAND_OPTION_CONTRACTS;
41
- export declare const validateCliCommandOptions: (commandKey: CliCommandOptionContractKey, counts: ReadonlyMap<string, number>) => void;
1
+ /** Harness 1.x compatibility bridge; implementation belongs to the engine. */
2
+ export * from "../compat/cli-options.js";
@@ -7,10 +7,12 @@ export declare const MAX_CLI_PROFILE_BYTES: number;
7
7
  export declare const cliProfileSchema: z.ZodObject<{
8
8
  schemaVersion: z.ZodLiteral<1>;
9
9
  provider: z.ZodEnum<{
10
+ anthropic: "anthropic";
10
11
  gemini: "gemini";
11
12
  meta: "meta";
12
13
  openai: "openai";
13
14
  qwen: "qwen";
15
+ vertex: "vertex";
14
16
  }>;
15
17
  reasoningEffort: z.ZodOptional<z.ZodEnum<{
16
18
  default: "default";
@@ -42,7 +44,7 @@ export declare const createCliProfile: (name: string, input: {
42
44
  path: string;
43
45
  profile: {
44
46
  schemaVersion: 1;
45
- provider: "gemini" | "meta" | "openai" | "qwen";
47
+ provider: "anthropic" | "gemini" | "meta" | "openai" | "qwen" | "vertex";
46
48
  reasoningEffort?: "default" | "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | undefined;
47
49
  model: string;
48
50
  };
@@ -56,7 +58,7 @@ export declare const updateCliProfile: (name: string, input: {
56
58
  path: string;
57
59
  profile: {
58
60
  schemaVersion: 1;
59
- provider: "gemini" | "meta" | "openai" | "qwen";
61
+ provider: "anthropic" | "gemini" | "meta" | "openai" | "qwen" | "vertex";
60
62
  reasoningEffort?: "default" | "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | undefined;
61
63
  model: string;
62
64
  };
@@ -1,167 +1,2 @@
1
- import type { AgentStreamEvent } from "@zhivex-ai/agents";
2
- export declare const CLI_JSON_SCHEMA_VERSION: 1;
3
- export declare const CLI_EVENT_SCHEMA_VERSION: 1;
4
- export interface StreamRunResultSource {
5
- runId: string;
6
- status: string;
7
- provider: string;
8
- model: string;
9
- steps: number;
10
- toolCalls: number;
11
- pendingApprovals?: readonly ({
12
- id: string;
13
- kind: string;
14
- name: string;
15
- childRunId?: string;
16
- childAgentId?: string;
17
- [key: string]: unknown;
18
- })[];
19
- children?: readonly ({
20
- runId: string;
21
- status: string;
22
- [key: string]: unknown;
23
- })[];
24
- [key: string]: unknown;
25
- }
26
- /**
27
- * Convert runtime events into a stable, line-oriented CLI contract.
28
- *
29
- * Tool inputs, tool outputs, provider payloads, model messages, and error text
30
- * are deliberately omitted: they can contain repository content or secrets.
31
- */
32
- export declare const streamEventDocument: (event: AgentStreamEvent, sequence?: number) => {
33
- schemaVersion: 1;
34
- kind: "run-event";
35
- sequence: number;
36
- 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";
37
- textDelta: string;
38
- } | {
39
- schemaVersion: 1;
40
- kind: "run-event";
41
- sequence: number;
42
- 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";
43
- toolCallId: string;
44
- toolName: string;
45
- } | {
46
- schemaVersion: 1;
47
- kind: "run-event";
48
- sequence: number;
49
- 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";
50
- toolCallId: string;
51
- toolName: string;
52
- isError: boolean;
53
- } | {
54
- schemaVersion: 1;
55
- kind: "run-event";
56
- sequence: number;
57
- 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";
58
- approvalRequestId: string;
59
- approvalKind: "local-tool" | "provider" | "subagent";
60
- toolName: string;
61
- } | {
62
- schemaVersion: 1;
63
- kind: "run-event";
64
- sequence: number;
65
- 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";
66
- approvalRequestId: string;
67
- approved: boolean;
68
- } | {
69
- schemaVersion: 1;
70
- kind: "run-event";
71
- sequence: number;
72
- 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";
73
- provider: string;
74
- } | {
75
- schemaVersion: 1;
76
- kind: "run-event";
77
- sequence: number;
78
- 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";
79
- provider: string;
80
- partial: boolean;
81
- id?: string;
82
- index?: number;
83
- } | {
84
- schemaVersion: 1;
85
- kind: "run-event";
86
- sequence: number;
87
- 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";
88
- finishReason?: import("@zhivex-ai/core").FinishReason;
89
- usage?: import("@zhivex-ai/core").TokenUsage;
90
- } | {
91
- schemaVersion: 1;
92
- kind: "run-event";
93
- sequence: number;
94
- 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";
95
- error: string;
96
- } | {
97
- schemaVersion: 1;
98
- kind: "run-event";
99
- sequence: number;
100
- 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";
101
- currentStep: number;
102
- maxSteps: number;
103
- } | {
104
- schemaVersion: 1;
105
- kind: "run-event";
106
- sequence: number;
107
- 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";
108
- stepIndex: number;
109
- } | {
110
- schemaVersion: 1;
111
- kind: "run-event";
112
- sequence: number;
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
- stepIndex: number;
115
- status: import("@zhivex-ai/core").AgentStepStatus;
116
- toolCalls: number;
117
- } | {
118
- schemaVersion: 1;
119
- kind: "run-event";
120
- sequence: number;
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
- compactionId: string;
123
- reasons: import("@zhivex-ai/core").AgentCompactionReason[];
124
- messageCountBefore: number;
125
- messageCountAfter: number;
126
- } | {
127
- schemaVersion: 1;
128
- kind: "run-event";
129
- sequence: number;
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
- runId: string;
132
- status: import("@zhivex-ai/core").AgentStatus;
133
- provider: string;
134
- model: string;
135
- } | undefined;
136
- export declare const serializeStreamEvent: (event: AgentStreamEvent, sequence?: number) => string;
137
- /**
138
- * Project the rich final JSON document onto the redacted JSONL contract.
139
- *
140
- * This is deliberately a whitelist. Output text, mutations, approval
141
- * arguments, scope, paths, provider payloads, and configuration bindings can
142
- * contain repository or operator data and must remain exclusive to the
143
- * separate final-document contract.
144
- */
145
- export declare const streamResultDocument: (result: StreamRunResultSource, sequence?: number) => {
146
- schemaVersion: 1;
147
- kind: "run-stream-result";
148
- sequence: number;
149
- runId: string;
150
- status: string;
151
- provider: string;
152
- model: string;
153
- steps: number;
154
- toolCalls: number;
155
- pendingApprovals: {
156
- id: string;
157
- kind: string;
158
- name: string;
159
- childRunId?: string;
160
- childAgentId?: string;
161
- }[];
162
- children: {
163
- runId: string;
164
- status: string;
165
- }[];
166
- };
167
- export declare const serializeStreamResult: (result: StreamRunResultSource, sequence?: number) => string;
1
+ /** Harness 1.x compatibility bridge; implementation belongs to the engine. */
2
+ export * from "../client/stream.js";
@@ -0,0 +1,5 @@
1
+ import type { AgentRunStore } from '@zhivex-ai/core';
2
+ import type { HarnessConfig } from '../runtime/config.js';
3
+ import type { CliOptions } from './arguments.js';
4
+ /** Provider-free report command; the optional envelope is bounded data, never a command. */
5
+ export declare function governanceReportCli(options: CliOptions, config: HarnessConfig, store: AgentRunStore): Promise<string>;
@@ -0,0 +1,9 @@
1
+ import { type HarnessPolicyDecisionEvent, type PolicyDecisionEvidence } from '../runtime/policy-decisions.js';
2
+ export declare const formatPolicyDecision: (event: HarnessPolicyDecisionEvent) => string;
3
+ export declare function observeCliPolicy<T>(options: {
4
+ json?: boolean;
5
+ jsonl?: boolean;
6
+ }, tracker: {
7
+ sequence?: number;
8
+ policyEvidence?: PolicyDecisionEvidence;
9
+ }, work: () => Promise<T>): Promise<T>;
@@ -0,0 +1,5 @@
1
+ import { type HarnessPolicyInspection } from '../runtime/policy-inspection.js';
2
+ import type { CliOptions } from './arguments.js';
3
+ export declare function formatPolicyInspection(policy: HarnessPolicyInspection): string;
4
+ export declare function printPolicyInspection(policy: HarnessPolicyInspection, json: boolean | undefined): void;
5
+ export declare function inspectCliPolicy(options: CliOptions): Promise<void>;
@@ -1,3 +1,4 @@
1
+ import type { PolicyDecisionEvidence } from "../runtime/policy-decisions.js";
1
2
  import type { ActivityHistory } from "./terminal/activity-history.js";
2
3
  import { TerminalMarkdown } from "./terminal/terminal-markdown.js";
3
4
  import { type AgentApprovalRequest, type AgentApprovalResponse, type AgentRunOutput, type AgentStreamEvent } from "@zhivex-ai/agents";
@@ -13,11 +14,12 @@ export declare const terminalApprovalResolver: (automaticallyApprove: boolean |
13
14
  select: import("./cli-credentials.js").CredentialInput["select"];
14
15
  workspace: string;
15
16
  sessionGrants?: Set<string>;
16
- }) => NonNullable<HarnessRunOptions["resolveApprovals"]>;
17
+ }, reviewHost?: ZhivexHarness) => NonNullable<HarnessRunOptions["resolveApprovals"]>;
17
18
  export declare const printTerminalResult: (result: AgentRunOutput, harness: ZhivexHarness, output: Pick<CliOptions, "json" | "jsonl">, tracker: {
18
19
  streamedText: boolean;
19
20
  sequence?: number;
20
21
  markdown?: TerminalMarkdown;
22
+ policyEvidence?: PolicyDecisionEvidence;
21
23
  }) => void;
22
24
  export declare const flushToolActivity: (tracker: object) => void | undefined;
23
25
  export declare const streamSink: (output: Pick<CliOptions, "json" | "jsonl">, tracker: {