@zhivex-ai/harness 1.0.0-rc.12 → 1.0.0-rc.13

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 CHANGED
@@ -4,6 +4,33 @@ All notable changes to Zhivex Harness are documented in this file.
4
4
 
5
5
  The project follows Semantic Versioning. During `0.x`, minor releases may change user-facing contracts when the change is documented with a migration note. Patch releases remain backwards compatible bug fixes.
6
6
 
7
+ ## 1.0.0-rc.13 - 2026-09-03
8
+
9
+ ### Added
10
+
11
+ - Add console command completion, previewed multiline drafts, active project-context inspection, and bounded digest-checked file attachments for the next task.
12
+ - Keep interactive sessions open after command/provider failures and pass Ctrl+C cancellation to active turns and review groups while preserving unresolved approval batches.
13
+ - Render terminal-safe model text and optionally colored diffs; discard unsolicited input lines instead of replaying them into approval prompts.
14
+ - Add `zhx init` with interactive terminal prompts and deterministic non-interactive flags, plus explicit `--profile <name>` selection for `run`, `chat`, `review`, and `doctor`.
15
+ - Store one provider/model pair per schema-versioned personal profile outside the repository with owner-only directories/files, descriptor-bound no-follow reads, strict size/link/permission checks, and no credential or authority-bearing fields.
16
+ - Add a versioned `init` JSON document and installed-tarball smoke coverage for initialization, profile reuse, precedence, permissions, and secret-free output.
17
+
18
+ ### Fixed
19
+
20
+ - Persist externally interrupted ordinary turns as cancelled after runtime cleanup, without replacing completed work, pending approvals, or genuine timeouts.
21
+ - Accept explicit null first-page cursors for listing/search tools, keeping opaque cursor validation for subsequent pages.
22
+ - Add bounded in-memory task history, Alt+Enter multiline input, and terminal-safe Markdown presentation.
23
+ - Treat a valid SQLite database created only by `sessions list` as an uninitialized operations store in `doctor`, while continuing to reject partially initialized or incompatible operational schemas.
24
+
25
+ ### Changed
26
+
27
+ - Preserve the published RC.12 tag, artifact, complete Meta/Qwen/OpenAI representative matrix, npm SHA-512 integrity, and SLSA provenance as immutable historical evidence. The onboarding and diagnostics changes are authorized only for a distinct pending RC.13 artifact.
28
+ - Keep profiles explicit rather than active-by-default. Precedence is CLI flags, selected profile, environment, then built-in defaults; `resume` never accepts a profile and continues to restore the original durable policy.
29
+
30
+ ### Migration from RC.12
31
+
32
+ No Harness configuration, run-store, session-store, change-envelope, or execution-policy migration is required. Existing invocations behave as before unless they opt into `zhx init` and `--profile`. Profiles contain only schema version, provider, and model; API keys remain environment-owned.
33
+
7
34
  ## 1.0.0-rc.12 - 2026-09-02
8
35
 
9
36
  ### Fixed
package/README.md CHANGED
@@ -112,7 +112,7 @@ It does not include arbitrary host shell access, `stdio` MCP, permanent deletion
112
112
  Install the Node-first `0.11.1` artifact with an exact version:
113
113
 
114
114
  ```bash
115
- npx --yes --package=@zhivex-ai/harness@0.11.1 zhx --version
115
+ bunx @zhivex-ai/harness@0.11.1 --version
116
116
  ```
117
117
 
118
118
  To exercise the source checkout, contributors use Bun for deterministic repository tooling while the built CLI itself runs on Node:
@@ -123,6 +123,16 @@ cp .env.example .env
123
123
  bun run dev --version
124
124
  ```
125
125
 
126
+ The 1.0 source candidate adds a first-run setup that stores only a provider and model in an explicit personal profile:
127
+
128
+ ```bash
129
+ bun run dev init --profile daily --provider openai
130
+ bun run dev doctor --profile daily
131
+ bun run dev --profile daily "inspect this repository"
132
+ ```
133
+
134
+ Installed builds expose the same flow as `zhx init`. Profiles are private user configuration outside the repository, use owner-only permissions, contain no credentials, and are never selected implicitly. CLI flags override the selected profile; the selected profile overrides environment variables; environment variables override built-in defaults.
135
+
126
136
  Configure only the providers you plan to use:
127
137
 
128
138
  ```dotenv
@@ -140,6 +150,7 @@ GEMINI_API_KEY=...
140
150
 
141
151
  ```bash
142
152
  zhx doctor
153
+ zhx doctor --profile daily
143
154
  zhx doctor --provider qwen --json
144
155
  ```
145
156
 
@@ -157,6 +168,13 @@ zhivex-harness --version
157
168
 
158
169
  Inside the console, `/help` lists `/provider`, `/model`, `/route`, `/status`, `/diff`, `/review`, `/resume`, `/pending`, `/approve`, `/deny`, `/compact`, `/new`, `/rename`, and `/exit`. Tool and step activity is rendered without tool payloads; approval cards sanitize terminal controls and keep governed edit/command payloads fully reviewable.
159
170
 
171
+ The pending RC.13 source also adds Tab command completion, `/paste` for previewed
172
+ multiline tasks, `/context` for active project rules/skills, and `/attach <path>` for
173
+ bounded file excerpts. Ctrl+C interrupts active work while retaining the session;
174
+ errors return to the prompt. See the [interactive workflow](./docs/CLI.md#interactive-daily-workflow)
175
+ for attachment limits, approval behavior, and recovery. These source additions are
176
+ not yet published or live-certified.
177
+
160
178
  Project context engineering is enabled by default. A root `AGENTS.md` plus an optional `.zhivex/harness.json` can declare bounded context files, rule files, and progressively loaded `SKILL.md` directories. Disable discovery with `--no-project-context` or select another manifest with `--context-config`.
161
179
 
162
180
  Show providers and detected configuration without printing secrets:
package/ROADMAP.md CHANGED
@@ -355,7 +355,9 @@ Exit criteria:
355
355
 
356
356
  Goal: freeze a supportable public contract after the pre-1.0 safety and operational surfaces have been exercised in real repositories.
357
357
 
358
- Status: RC.1 through RC.6 did not complete every protected gate, so every publication was skipped. RC.6 passed release-bound live certification and Meta's complete representative matrix, then failed closed at Qwen with 12/14 safe resolutions in both the original run and one retry. RC.7 retained the Core, Agents, and OpenAI corrections, restored Qwen to the last adapter certified by this matrix, passed exact-artifact, live-provider, and all three 14-case representative gates, and was published to npm `next` with verified SHA-512 integrity and SLSA provenance. RC.8 carried the coordinated Core `1.11.0`, Qwen `0.11.1`, and Gemini `0.11.0` refresh and passed exact-tag readiness, but its manual protected workflow packed before building `dist/`; artifact binding failed, OCI and provider gates were skipped, and npm publication was not dispatched. RC.9 corrected that workflow and passed manual protected certification, but its release-bound deterministic job exposed an environment-sensitive early-diagnostic test before packing; no release tarball was created and every downstream job was skipped. RC.10 isolated that fixture and produced a valid exact tarball, then failed closed because an OpenAI account-funding issue surfaced as retryable HTTP 500 failures and Qwen resolved 13/14 representative cases; npm publication was skipped. RC.11 preserved its fail-closed first attempt, then reran every protected gate from scratch; Meta, Qwen, and OpenAI each completed 14/14 representative cases, and the exact validated artifact was published to npm `next` with verified SHA-512 integrity and SLSA provenance. Public API/CLI/schema baselines, config `4 → 5` migration, historical tarball fixtures, support/security/rollback policy, RC channel enforcement, representative-evaluation generation, and evidence requirements remain machine-checked. The two required passing candidates are now recorded; GA remains blocked on the final-candidate security review in [`docs/ga-readiness.json`](./docs/ga-readiness.json).
358
+ Release evidence checkpoint: RC.12 was published to npm `next` only after its exact protected workflow passed; RC.13 remains pending.
359
+
360
+ Status: RC.1 through RC.6 did not complete every protected gate, so every publication was skipped. RC.6 passed release-bound live certification and Meta's complete representative matrix, then failed closed at Qwen with 12/14 safe resolutions in both the original run and one retry. RC.7 retained the Core, Agents, and OpenAI corrections, restored Qwen to the last adapter certified by this matrix, passed exact-artifact, live-provider, and all three 14-case representative gates, and was published to npm `next` with verified SHA-512 integrity and SLSA provenance. RC.8 carried the coordinated Core `1.11.0`, Qwen `0.11.1`, and Gemini `0.11.0` refresh and passed exact-tag readiness, but its manual protected workflow packed before building `dist/`; artifact binding failed, OCI and provider gates were skipped, and npm publication was not dispatched. RC.9 corrected that workflow and passed manual protected certification, but its release-bound deterministic job exposed an environment-sensitive early-diagnostic test before packing; no release tarball was created and every downstream job was skipped. RC.10 isolated that fixture and produced a valid exact tarball, then failed closed because an OpenAI account-funding issue surfaced as retryable HTTP 500 failures and Qwen resolved 13/14 representative cases; npm publication was skipped. RC.11 preserved its fail-closed first attempt, then reran every protected gate from scratch; Meta, Qwen, and OpenAI each completed 14/14 representative cases, and the exact validated artifact was published to npm `next` with verified SHA-512 integrity and SLSA provenance. RC.12 then passed the complete deterministic, installed-artifact, OCI, live-provider, and three-provider representative matrix and was published to `next` with verified integrity and provenance. RC.13 is the distinct pending candidate for explicit first-run profiles and the session-only `doctor` correction; it has no release evidence until its exact tag completes the protected workflow. Public API/CLI/schema baselines, config `4 → 5` migration, historical tarball fixtures, support/security/rollback policy, RC channel enforcement, representative-evaluation generation, and evidence requirements remain machine-checked. The required historical passing candidates are recorded; GA remains blocked on a current security review of the final candidate in [`docs/ga-readiness.json`](./docs/ga-readiness.json).
359
361
 
360
362
  Scope:
361
363
 
package/SECURITY.md CHANGED
@@ -20,7 +20,7 @@ The enabled no-cost public controls and the explicitly cost-gated features left
20
20
 
21
21
  ## Scope
22
22
 
23
- Reports are in scope when they affect packaged runtime code, workspace or state isolation, approval enforcement, secret handling, MCP boundaries, provider communication, dependency integrity, or the build and release pipeline.
23
+ Reports are in scope when they affect packaged runtime code, personal-profile isolation, workspace or state isolation, approval enforcement, secret handling, MCP boundaries, provider communication, dependency integrity, or the build and release pipeline.
24
24
 
25
25
  The absence of an OS sandbox is a documented product boundary rather than a vulnerability by itself. The harness does not expose generic host shell or permanent-delete model tools.
26
26
 
@@ -105,6 +105,7 @@
105
105
  "cliChangeEnvelopeVerificationDocumentSchema",
106
106
  "cliDoctorDocumentSchema",
107
107
  "cliErrorDocumentSchema",
108
+ "cliInitDocumentSchema",
108
109
  "cliJsonDocumentSchema",
109
110
  "cliJsonLineDocumentSchema",
110
111
  "cliProviderDocumentSchema",
@@ -371,6 +372,7 @@
371
372
  "cliChangeEnvelopeVerificationDocumentSchema",
372
373
  "cliDoctorDocumentSchema",
373
374
  "cliErrorDocumentSchema",
375
+ "cliInitDocumentSchema",
374
376
  "cliProviderDocumentSchema",
375
377
  "cliReviewGroupDocumentSchema",
376
378
  "cliRunCancellationDocumentSchema",
@@ -459,6 +461,7 @@
459
461
  "CliChangeEnvelopeVerificationDocument",
460
462
  "CliCommandOptionContract",
461
463
  "CliCommandOptionContractKey",
464
+ "CliInitDocument",
462
465
  "CliJsonDocument",
463
466
  "CliJsonLineDocument",
464
467
  "CliOptionDefinition",
@@ -616,6 +619,7 @@
616
619
  "CliChangeEnvelopeVerificationDocument",
617
620
  "CliCommandOptionContract",
618
621
  "CliCommandOptionContractKey",
622
+ "CliInitDocument",
619
623
  "CliJsonDocument",
620
624
  "CliJsonLineDocument",
621
625
  "CliOptionDefinition",
@@ -787,6 +791,7 @@
787
791
  ],
788
792
  "cli": {
789
793
  "commands": [
794
+ "init",
790
795
  "run",
791
796
  "review",
792
797
  "chat",
@@ -836,10 +841,22 @@
836
841
  "doctorFailed": 3
837
842
  },
838
843
  "commandOptions": {
844
+ "init": {
845
+ "allowed": [
846
+ "--provider",
847
+ "--model",
848
+ "--profile",
849
+ "--json"
850
+ ],
851
+ "required": [],
852
+ "repeatable": [],
853
+ "conflicts": {}
854
+ },
839
855
  "run": {
840
856
  "allowed": [
841
857
  "--provider",
842
858
  "--model",
859
+ "--profile",
843
860
  "--route",
844
861
  "--workspace",
845
862
  "--state-dir",
@@ -909,6 +926,7 @@
909
926
  "allowed": [
910
927
  "--provider",
911
928
  "--model",
929
+ "--profile",
912
930
  "--route",
913
931
  "--workspace",
914
932
  "--state-dir",
@@ -942,6 +960,7 @@
942
960
  "allowed": [
943
961
  "--provider",
944
962
  "--model",
963
+ "--profile",
945
964
  "--route",
946
965
  "--workspace",
947
966
  "--state-dir",
@@ -1018,6 +1037,7 @@
1018
1037
  "allowed": [
1019
1038
  "--provider",
1020
1039
  "--model",
1040
+ "--profile",
1021
1041
  "--workspace",
1022
1042
  "--state-dir",
1023
1043
  "--store",
@@ -7,6 +7,7 @@
7
7
  { "threat": "hostile-mcp-server", "mitigations": ["HTTPS or allowlisted loopback", "tool allowlists", "permissions", "bounded payloads"], "evidence": ["tests/mcp.test.ts", "scripts/mcp-interoperability-smoke.ts"], "residualRisk": "An approved remote MCP service can observe the inputs explicitly sent to it." },
8
8
  { "threat": "approval-replay-or-substitution", "mitigations": ["fingerprints", "exact proposal digests", "durable approval identity"], "evidence": ["tests/harness.test.ts", "tests/edit-contracts.test.ts"], "residualRisk": "Paused approvals require the original artifact and cannot be rebound across incompatible policy versions." },
9
9
  { "threat": "cross-scope-state-access", "mitigations": ["tenant/user/namespace scope", "workspace binding", "scoped hierarchy reads"], "evidence": ["tests/operations.test.ts", "tests/sessions.test.ts"], "residualRisk": "A process with direct filesystem access to the local state directory remains inside the trust boundary." },
10
+ { "threat": "tampered-personal-profile", "mitigations": ["explicit profile selection", "external user configuration", "owner-only permissions", "strict provider/model-only schema", "descriptor-bound no-follow reads"], "evidence": ["tests/cli-profiles.test.ts", "tests/cli.test.ts", "scripts/package-smoke.ts"], "residualRisk": "A compromised operator account or host filesystem can still replace the selected provider/model configuration." },
10
11
  { "threat": "hostile-subprocess", "mitigations": ["no-network OCI", "resource ceilings", "argv allowlist", "separate host import approval"], "evidence": ["tests/execution-environment.test.ts", "scripts/oci-execution-smoke.ts"], "residualRisk": "Containers are not VMs; the host kernel and OCI daemon are trusted." },
11
12
  { "threat": "crash-or-concurrent-writer", "mitigations": ["SQLite WAL", "optimistic revisions", "leases", "interrupted cleanup recovery"], "evidence": ["tests/operations.test.ts", "tests/execution-environment.test.ts"], "residualRisk": "Power loss and external filesystem corruption still require operator backup and recovery." },
12
13
  { "threat": "supply-chain-substitution", "mitigations": ["annotated tag", "immutable tarball", "SHA-512", "OIDC provenance", "pinned workflow actions"], "evidence": ["tests/release-workflow.test.ts", "scripts/check-release-artifact.ts", "scripts/release-provenance.ts"], "residualRisk": "Registry, GitHub, npm, and maintainer identities remain external trust dependencies." },
@@ -13,7 +13,7 @@
13
13
  },
14
14
  {
15
15
  "name": "CLI_COMMAND_OPTION_CONTRACTS",
16
- "sha256": "sha256:24b4f1884ff228de6027655bf75908e8267cfbf8852235971252bebe19581412"
16
+ "sha256": "sha256:aa09f2e5e3dc2061fa8171f78428b077f666776d49e78cddfbfc5d3e14ea3cf0"
17
17
  },
18
18
  {
19
19
  "name": "CLI_EVENT_SCHEMA_VERSION",
@@ -25,11 +25,11 @@
25
25
  },
26
26
  {
27
27
  "name": "CLI_OPTION_DEFINITIONS",
28
- "sha256": "sha256:e9f6878dc5cf6a6d82f902fb6157db0f65932234ca69ed7f87e89f3dbb4811de"
28
+ "sha256": "sha256:80643d92df0424a8c5ecd67900b658a5fc67cda7bc857bdd36583f37eb33f508"
29
29
  },
30
30
  {
31
31
  "name": "CLI_OPTION_NAMES",
32
- "sha256": "sha256:72f3b2f6a13b1bed6977b8d0ac43327246efb492b99ec5975a7c9e6b81196723"
32
+ "sha256": "sha256:ff63e6dcc9cff7b9d369457d2d5f40021e7ab05f59eb7ea8bf512cf165fafe12"
33
33
  },
34
34
  {
35
35
  "name": "DEFAULT_ALLOWED_CHECKS",
@@ -145,7 +145,7 @@
145
145
  },
146
146
  {
147
147
  "name": "cliJsonDocumentSchema",
148
- "sha256": "sha256:2a18f15adcf6d11745eb8499e1a458afc6d47f17e5d9820711a3157e348acbe0"
148
+ "sha256": "sha256:6d6d32f289af541f437c6632f82360be9a6cae43faa16942505aedb8ca602c37"
149
149
  },
150
150
  {
151
151
  "name": "cliJsonLineDocumentSchema",
@@ -245,7 +245,7 @@
245
245
  },
246
246
  {
247
247
  "name": "parseCliJsonDocument",
248
- "sha256": "sha256:fedf61cd4fc0a83eebf113af3771b3e8eb8148fb9c3961d34ddfc2386b453de4"
248
+ "sha256": "sha256:88171752f13fd7f031d27152eaa7c49048a78fd3f857f31565bff62a251b8537"
249
249
  },
250
250
  {
251
251
  "name": "parseCliJsonLineDocument",
@@ -289,7 +289,7 @@
289
289
  },
290
290
  {
291
291
  "name": "validateCliCommandOptions",
292
- "sha256": "sha256:0db6291eaea426f120f5ee900cc0c0332007e7897587f49ac5f5b8f23cde209a"
292
+ "sha256": "sha256:0ecaa9569b797d3a26c23b9473b80a98e5d94925e8ecae4aef937e96be357fb8"
293
293
  },
294
294
  {
295
295
  "name": "verifyChangeEnvelope",
@@ -311,11 +311,15 @@
311
311
  },
312
312
  {
313
313
  "name": "CliCommandOptionContractKey",
314
- "sha256": "sha256:ebba6d15bf9d4d4a1f556c49f82a13f60791825574662f58b228372265b82437"
314
+ "sha256": "sha256:e69ffd0ea0af23a143a85b6d596d710bbdf607e9474657547dfb83fa69c78cbd"
315
+ },
316
+ {
317
+ "name": "CliInitDocument",
318
+ "sha256": "sha256:bd8de48830fffc5a4479974bbba6ccf36911a84de41d858e50d2d9cee056489c"
315
319
  },
316
320
  {
317
321
  "name": "CliJsonDocument",
318
- "sha256": "sha256:819decd0ff5969a9e534c0da940fd498896343b932e17f3c2712a584a7d5251d"
322
+ "sha256": "sha256:69d773fc769a1a3c0e4657dd18e486feb6a42c999c9b490874841e4330ddf0e5"
319
323
  },
320
324
  {
321
325
  "name": "CliJsonLineDocument",
@@ -327,7 +331,7 @@
327
331
  },
328
332
  {
329
333
  "name": "CliOptionName",
330
- "sha256": "sha256:650c835c1b9dafc111608dc5214b555b2b0527442f2bdfc2d42ef74d0d306208"
334
+ "sha256": "sha256:6af106bfbfd758333ef524ef32e44f29429651bfc837bbaad647609a93a1e6ca"
331
335
  },
332
336
  {
333
337
  "name": "CliReviewGroupDocument",
@@ -486,5 +490,5 @@
486
490
  "sha256": "sha256:b165b5eb63b24371c7ab1ca83b95a9c553e7200aa89e94306ca4a7434eb1bb39"
487
491
  }
488
492
  ],
489
- "digest": "sha256:834bf8631b3e549da9ff2641050082dd2601898a7b7a1efa7d20511b82f3dd0d"
493
+ "digest": "sha256:b89e3786cd87b50506c3dc75dc8cf332a7c266974dc1a76611757531d8c49840"
490
494
  }
@@ -8,10 +8,11 @@ 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", "--route", "--workspace", "--state-dir", "--mcp-config", "--context-config", "--no-project-context", "--patch", "--preconditions", "--now", "--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", "--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"];
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: {
15
+ readonly init: CliCommandOptionContract;
15
16
  readonly run: CliCommandOptionContract;
16
17
  readonly review: CliCommandOptionContract;
17
18
  readonly chat: CliCommandOptionContract;
@@ -0,0 +1,39 @@
1
+ import { z } from "zod";
2
+ import { type HarnessConfigInput, type HarnessProvider } from "./config.js";
3
+ export declare const CLI_PROFILE_SCHEMA_VERSION: 1;
4
+ export declare const CLI_PROFILE_CONFIG_DIRECTORY_ENV: "ZHIVEX_HARNESS_CONFIG_DIR";
5
+ export declare const MAX_CLI_PROFILE_BYTES: number;
6
+ export declare const cliProfileSchema: z.ZodObject<{
7
+ schemaVersion: z.ZodLiteral<1>;
8
+ provider: z.ZodEnum<{
9
+ meta: "meta";
10
+ qwen: "qwen";
11
+ openai: "openai";
12
+ gemini: "gemini";
13
+ }>;
14
+ model: z.ZodString;
15
+ }, z.core.$strict>;
16
+ export type CliProfile = z.infer<typeof cliProfileSchema>;
17
+ export interface CliProfilePathContext {
18
+ env?: NodeJS.ProcessEnv;
19
+ homeDirectory?: string;
20
+ platform?: NodeJS.Platform;
21
+ }
22
+ export declare const validateCliProfileName: (name: string) => string;
23
+ export declare const resolveCliProfileConfigDirectory: (context?: CliProfilePathContext) => string;
24
+ export declare const resolveCliProfilePath: (name: string, context?: CliProfilePathContext) => string;
25
+ export declare const loadCliProfile: (name: string, context?: CliProfilePathContext) => Promise<CliProfile>;
26
+ export declare const createCliProfile: (name: string, input: {
27
+ provider: HarnessProvider;
28
+ model: string;
29
+ }, context?: CliProfilePathContext) => Promise<{
30
+ path: string;
31
+ profile: {
32
+ schemaVersion: 1;
33
+ provider: "meta" | "qwen" | "openai" | "gemini";
34
+ model: string;
35
+ };
36
+ }>;
37
+ export declare const applyCliProfile: <T extends HarnessConfigInput & {
38
+ profile?: string;
39
+ }>(options: T, context?: CliProfilePathContext) => Promise<T>;
package/dist/cli.d.ts CHANGED
@@ -18,7 +18,7 @@ export declare const CLI_EXIT_CODES: {
18
18
  export declare const annotateCliStreamError: (error: unknown, lastSequence: number | undefined) => Error;
19
19
  export declare const cliStreamErrorSequence: (error: unknown) => number;
20
20
  export declare const terminalErrorMessage: (error: unknown) => string;
21
- export declare const CLI_COMMANDS: readonly ["run", "review", "chat", "providers", "doctor", "resume", "runs", "sessions", "changes", "state", "help", "version"];
21
+ export declare const CLI_COMMANDS: readonly ["init", "run", "review", "chat", "providers", "doctor", "resume", "runs", "sessions", "changes", "state", "help", "version"];
22
22
  export declare const CLI_RUNS_COMMANDS: readonly ["list", "inspect", "cancel", "cleanup", "export"];
23
23
  export declare const CLI_SESSIONS_COMMANDS: readonly ["list", "inspect", "rename", "fork", "archive"];
24
24
  export declare const CLI_CHANGES_COMMANDS: readonly ["create", "verify"];
@@ -30,6 +30,7 @@ type ChangesCommand = (typeof CLI_CHANGES_COMMANDS)[number];
30
30
  type StateCommand = (typeof CLI_STATE_COMMANDS)[number];
31
31
  export interface CliOptions {
32
32
  command: Command;
33
+ profile?: string;
33
34
  provider?: string;
34
35
  model?: string;
35
36
  workspace?: string;