@zhivex-ai/harness 1.1.1 → 1.2.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.
Files changed (119) hide show
  1. package/CHANGELOG.md +160 -0
  2. package/README.md +14 -7
  3. package/SECURITY.md +1 -1
  4. package/SUPPORT.md +3 -3
  5. package/benchmarks/README.md +17 -0
  6. package/contracts/public-api.json +95 -5
  7. package/contracts/stable-api-signatures.json +38 -38
  8. package/dist/acp-cli.d.ts +2 -0
  9. package/dist/acp-cli.js +15938 -0
  10. package/dist/cli/arguments.d.ts +7 -1
  11. package/dist/cli/cli-credentials.d.ts +6 -1
  12. package/dist/cli/cli-options.d.ts +1 -1
  13. package/dist/cli/cli-profiles.d.ts +15 -0
  14. package/dist/cli/cli-stream.d.ts +3 -3
  15. package/dist/cli/console/console-budget.d.ts +9 -0
  16. package/dist/cli/console/console-commands.d.ts +3 -3
  17. package/dist/cli/console/console-compaction.d.ts +18 -0
  18. package/dist/cli/console/console-input.d.ts +22 -3
  19. package/dist/cli/console/console-navigation.d.ts +3 -0
  20. package/dist/cli/console/console-presentation.d.ts +9 -2
  21. package/dist/cli/console/console-progress.d.ts +6 -0
  22. package/dist/cli/console/console-reasoning.d.ts +3 -0
  23. package/dist/cli/doctor.d.ts +2 -2
  24. package/dist/cli/presentation.d.ts +8 -1
  25. package/dist/cli/qwen-connection.d.ts +23 -0
  26. package/dist/cli/run-document.d.ts +4 -4
  27. package/dist/cli/terminal/activity-history.d.ts +15 -0
  28. package/dist/cli/terminal/session-grants.d.ts +4 -0
  29. package/dist/cli/terminal/terminal-markdown.d.ts +7 -4
  30. package/dist/cli/terminal/terminal-table.d.ts +6 -0
  31. package/dist/cli/terminal/terminal-ui.d.ts +3 -0
  32. package/dist/cli/terminal/tool-activity.d.ts +21 -10
  33. package/dist/cli/tool-execution.d.ts +1 -0
  34. package/dist/cli-3jmy4h5h.js +5798 -0
  35. package/dist/cli-entry-1bx83sw4.js +4 -0
  36. package/dist/cli-entry-427869g9.js +2009 -0
  37. package/dist/cli-entry-64pdp3k5.js +17 -0
  38. package/dist/cli-entry-b1mfvmxe.js +376 -0
  39. package/dist/cli-entry-c2f58zj2.js +13602 -0
  40. package/dist/cli-entry.d.ts +2 -0
  41. package/dist/cli.d.ts +1 -0
  42. package/dist/cli.js +15 -19168
  43. package/dist/client/acp-stdio.d.ts +9 -0
  44. package/dist/client/acp.d.ts +18 -0
  45. package/dist/client/index.d.ts +2 -0
  46. package/dist/client/json-contracts.d.ts +22 -8
  47. package/dist/config-1k9t4jhh.js +59 -0
  48. package/dist/context/adaptive-compaction.d.ts +2 -0
  49. package/dist/context/compaction.d.ts +3 -1
  50. package/dist/context/qwen-reasoning.d.ts +5 -0
  51. package/dist/context/scoped-context.d.ts +61 -0
  52. package/dist/context/semantic-compaction.d.ts +21 -0
  53. package/dist/context/task-memory.d.ts +13 -8
  54. package/dist/execution/execution-environment.d.ts +5 -0
  55. package/dist/execution/oci-observability.d.ts +2 -0
  56. package/dist/execution/patch-diagnostics.d.ts +6 -0
  57. package/dist/hostile-repository-demo.js +4614 -1930
  58. package/dist/index.d.ts +13 -1
  59. package/dist/index.js +16435 -12486
  60. package/dist/integrations/mcp.d.ts +23 -3
  61. package/dist/models/catalog.d.ts +76 -0
  62. package/dist/models/compaction-recommendations.d.ts +28 -0
  63. package/dist/models/sdk-catalog-adapter.d.ts +7 -0
  64. package/dist/persistence/operations.d.ts +10 -6
  65. package/dist/persistence/state-backup-stream.d.ts +4 -0
  66. package/dist/persistence/state-backup.d.ts +52 -0
  67. package/dist/persistence/state-gitignore.d.ts +2 -0
  68. package/dist/persistence/workspace-checkpoints.d.ts +149 -0
  69. package/dist/providers/meta-continuation.d.ts +1 -1
  70. package/dist/providers/meta-errors.d.ts +2 -0
  71. package/dist/providers/meta-replay.d.ts +2 -0
  72. package/dist/providers/qwen-context.d.ts +2 -0
  73. package/dist/providers/qwen-hosted-policy.d.ts +5 -0
  74. package/dist/providers/reasoning.d.ts +18 -0
  75. package/dist/runtime/config.d.ts +12 -3
  76. package/dist/runtime/context-runtime.d.ts +12 -0
  77. package/dist/runtime/error-diagnostics.d.ts +641 -0
  78. package/dist/runtime/harness.d.ts +13 -4
  79. package/dist/runtime/model-edit-references.d.ts +8 -0
  80. package/dist/runtime/oci-delivery.d.ts +17 -0
  81. package/dist/runtime/progress-monitor.d.ts +33 -0
  82. package/dist/runtime/provider-diagnostics.d.ts +35 -0
  83. package/dist/runtime/runtime-checkpoints.d.ts +3 -0
  84. package/dist/runtime/runtime-diagnostics.d.ts +5 -5
  85. package/dist/runtime/runtime-policy.d.ts +14 -6
  86. package/dist/runtime/time-to-safe-fix.d.ts +308 -1
  87. package/dist/runtime/tool-execution.d.ts +11 -0
  88. package/dist/runtime/tool-policy.d.ts +55 -0
  89. package/dist/runtime/tool-scheduling.d.ts +5 -0
  90. package/dist/runtime/usage-ledger.d.ts +1 -0
  91. package/dist/service-cli.js +9422 -6622
  92. package/dist/service-client-cli-yx56n0hc.js +1086 -0
  93. package/dist/tools/dependency-read.d.ts +63 -0
  94. package/dist/tools/execution.d.ts +8 -8
  95. package/dist/tools/workspace.d.ts +31 -15
  96. package/dist/verify-historical-migrations.js +5272 -2437
  97. package/dist/workspace/file-security.d.ts +6 -0
  98. package/dist/zhx.js +15 -19168
  99. package/docs/ACP.md +55 -0
  100. package/docs/CLI.md +292 -29
  101. package/docs/CONTEXT_ENGINEERING.md +184 -20
  102. package/docs/CREDENTIALS.md +38 -6
  103. package/docs/DURABLE_OPERATIONS.md +10 -0
  104. package/docs/EXTENSIBILITY.md +101 -4
  105. package/docs/FIRST_USE.md +7 -5
  106. package/docs/MODEL_CATALOG.md +52 -1
  107. package/docs/README.md +1 -0
  108. package/docs/REPOSITORY_EDITING.md +42 -0
  109. package/docs/STABILITY.md +2 -0
  110. package/docs/SUPPORT_MATRIX_1_1.md +17 -0
  111. package/docs/USAGE.md +9 -0
  112. package/docs/WORKSPACE_CHECKPOINTS.md +27 -0
  113. package/docs/images/cli-conversation.png +0 -0
  114. package/docs/support-matrix-1.1.json +29 -0
  115. package/evaluations/golden-expectations.json +5 -0
  116. package/evaluations/representative-assembly-matrix.json +145 -1
  117. package/evaluations/representative-repositories-v2.jsonl +7 -0
  118. package/examples/README.md +2 -2
  119. package/package.json +19 -13
@@ -1,3 +1,4 @@
1
+ import { type HarnessReasoningEffort } from "../providers/reasoning.js";
1
2
  import { type AgentStatus } from "@zhivex-ai/agents";
2
3
  import { type HarnessSubagentProfile } from "../runtime/config.js";
3
4
  import { HarnessError } from "../runtime/errors.js";
@@ -12,6 +13,8 @@ type SessionsCommand = (typeof CLI_SESSIONS_COMMANDS)[number];
12
13
  type ChangesCommand = (typeof CLI_CHANGES_COMMANDS)[number];
13
14
  type StateCommand = (typeof CLI_STATE_COMMANDS)[number];
14
15
  export interface CliOptions {
16
+ compactionModel?: string;
17
+ compactionProvider?: string;
15
18
  serviceFile?: string;
16
19
  command: Command;
17
20
  helpTopic?: string;
@@ -19,6 +22,7 @@ export interface CliOptions {
19
22
  updateProfile?: boolean;
20
23
  provider?: string;
21
24
  model?: string;
25
+ reasoningEffort?: HarnessReasoningEffort;
22
26
  workspace?: string;
23
27
  stateDirectory?: string;
24
28
  storeBackend?: string;
@@ -30,6 +34,7 @@ export interface CliOptions {
30
34
  maxToolCalls?: number;
31
35
  maxToolErrors?: number;
32
36
  unlimitedTokens?: boolean;
37
+ compactionMaxEstimatedInputTokens?: number;
33
38
  maxInputTokens?: number;
34
39
  maxOutputTokens?: number;
35
40
  maxTotalTokens?: number;
@@ -50,7 +55,7 @@ export interface CliOptions {
50
55
  subagentTimeoutMs?: number;
51
56
  maxParallelReviews?: number;
52
57
  executionBackend?: string;
53
- agentProfile?: string;
58
+ requireVerifiedDelivery?: boolean;
54
59
  ociRuntime?: string;
55
60
  ociImage?: string;
56
61
  ociAllowedCommands?: string[];
@@ -94,6 +99,7 @@ export interface CliOptions {
94
99
  final: boolean;
95
100
  apply: boolean;
96
101
  yes: boolean;
102
+ approvalMode?: "ask" | "auto" | "restricted";
97
103
  approve?: boolean;
98
104
  json: boolean;
99
105
  jsonl: boolean;
@@ -11,6 +11,7 @@ export interface CredentialInput {
11
11
  detail?: string;
12
12
  }[]): Promise<T | undefined>;
13
13
  secret(prompt: string): Promise<string>;
14
+ question?(prompt: string): Promise<string>;
14
15
  }
15
16
  export type EntryFactory = (provider: string) => Promise<SecretEntry>;
16
17
  export type CredentialStatus = {
@@ -29,10 +30,14 @@ export declare class CliCredentials {
29
30
  private readonly write;
30
31
  private readonly temporary;
31
32
  revision: number;
33
+ private qwenManaged;
34
+ private qwenOverrideAccepted;
32
35
  constructor(entry?: EntryFactory, environment?: NodeJS.ProcessEnv, write?: (text: string) => void);
33
36
  private environmentKey;
34
37
  private validate;
35
38
  private saved;
39
+ private readonly destinations;
40
+ destination(provider: HarnessProvider): string;
36
41
  private readonly sources;
37
42
  source(provider: HarnessProvider): "blocked" | "environment" | "keychain" | "missing" | "temporary" | "unavailable";
38
43
  private endpointOverride;
@@ -47,4 +52,4 @@ export declare class CliCredentials {
47
52
  export declare function credentialModel(config: {
48
53
  provider: HarnessProvider;
49
54
  model: string;
50
- }, env: NodeJS.ProcessEnv, modelFactory?: typeof import("../runtime/config.js").createProviderModel): Promise<import("@zhivex-ai/agents").LanguageModel<import("@zhivex-ai/core").ProviderOptions>>;
55
+ }, env: NodeJS.ProcessEnv, modelFactory?: typeof import("../runtime/config.js").createProviderModel): Promise<import("@zhivex-ai/core").LanguageModel<import("@zhivex-ai/core").ProviderOptions>>;
@@ -8,7 +8,7 @@ export interface CliCommandOptionContract {
8
8
  repeatable: readonly string[];
9
9
  conflicts: Readonly<Record<string, readonly string[]>>;
10
10
  }
11
- export declare const CLI_OPTION_NAMES: readonly ["--provider", "--model", "--profile", "--route", "--workspace", "--state-dir", "--mcp-config", "--context-config", "--no-project-context", "--patch", "--preconditions", "--now", "--agent-profile", "--execution", "--oci-runtime", "--oci-image", "--oci-allow-command", "--oci-shell", "--oci-max-process-runtime-ms", "--oci-max-process-output-bytes", "--oci-max-memory-mb", "--oci-max-pids", "--oci-max-cpus", "--oci-max-workspace-bytes", "--oci-max-file-write-bytes", "--oci-tmpfs-mb", "--store", "--tenant", "--user", "--namespace", "--idempotency-key", "--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", "--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"];
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
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: {
@@ -1,3 +1,4 @@
1
+ import { type HarnessReasoningEffort } from "../providers/reasoning.js";
1
2
  import { z } from "zod";
2
3
  import { type HarnessConfigInput, type HarnessProvider } from "../runtime/config.js";
3
4
  export declare const CLI_PROFILE_SCHEMA_VERSION: 1;
@@ -11,6 +12,16 @@ export declare const cliProfileSchema: z.ZodObject<{
11
12
  openai: "openai";
12
13
  qwen: "qwen";
13
14
  }>;
15
+ reasoningEffort: z.ZodOptional<z.ZodEnum<{
16
+ default: "default";
17
+ high: "high";
18
+ low: "low";
19
+ max: "max";
20
+ medium: "medium";
21
+ minimal: "minimal";
22
+ none: "none";
23
+ xhigh: "xhigh";
24
+ }>>;
14
25
  model: z.ZodString;
15
26
  }, z.core.$strict>;
16
27
  export type CliProfile = z.infer<typeof cliProfileSchema>;
@@ -26,11 +37,13 @@ export declare const loadCliProfile: (name: string, context?: CliProfilePathCont
26
37
  export declare const createCliProfile: (name: string, input: {
27
38
  provider: HarnessProvider;
28
39
  model: string;
40
+ reasoningEffort?: HarnessReasoningEffort;
29
41
  }, context?: CliProfilePathContext) => Promise<{
30
42
  path: string;
31
43
  profile: {
32
44
  schemaVersion: 1;
33
45
  provider: "gemini" | "meta" | "openai" | "qwen";
46
+ reasoningEffort?: "default" | "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | undefined;
34
47
  model: string;
35
48
  };
36
49
  }>;
@@ -38,11 +51,13 @@ export declare const createCliProfile: (name: string, input: {
38
51
  export declare const updateCliProfile: (name: string, input: {
39
52
  provider: HarnessProvider;
40
53
  model: string;
54
+ reasoningEffort?: HarnessReasoningEffort;
41
55
  }, context?: CliProfilePathContext) => Promise<{
42
56
  path: string;
43
57
  profile: {
44
58
  schemaVersion: 1;
45
59
  provider: "gemini" | "meta" | "openai" | "qwen";
60
+ reasoningEffort?: "default" | "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | undefined;
46
61
  model: string;
47
62
  };
48
63
  }>;
@@ -112,7 +112,7 @@ export declare const streamEventDocument: (event: AgentStreamEvent, sequence?: n
112
112
  sequence: number;
113
113
  type: "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish" | "agent-run-start" | "agent-run-update" | "agent-step-finish" | "agent-step-start" | "error" | "finish" | "image-generation" | "provider-data" | "text-delta" | "tool-approval-request" | "tool-call" | "tool-result";
114
114
  stepIndex: number;
115
- status: import("@zhivex-ai/agents").AgentStepStatus;
115
+ status: import("@zhivex-ai/core").AgentStepStatus;
116
116
  toolCalls: number;
117
117
  } | {
118
118
  schemaVersion: 1;
@@ -120,7 +120,7 @@ export declare const streamEventDocument: (event: AgentStreamEvent, sequence?: n
120
120
  sequence: number;
121
121
  type: "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish" | "agent-run-start" | "agent-run-update" | "agent-step-finish" | "agent-step-start" | "error" | "finish" | "image-generation" | "provider-data" | "text-delta" | "tool-approval-request" | "tool-call" | "tool-result";
122
122
  compactionId: string;
123
- reasons: import("@zhivex-ai/agents").AgentCompactionReason[];
123
+ reasons: import("@zhivex-ai/core").AgentCompactionReason[];
124
124
  messageCountBefore: number;
125
125
  messageCountAfter: number;
126
126
  } | {
@@ -129,7 +129,7 @@ export declare const streamEventDocument: (event: AgentStreamEvent, sequence?: n
129
129
  sequence: number;
130
130
  type: "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish" | "agent-run-start" | "agent-run-update" | "agent-step-finish" | "agent-step-start" | "error" | "finish" | "image-generation" | "provider-data" | "text-delta" | "tool-approval-request" | "tool-call" | "tool-result";
131
131
  runId: string;
132
- status: import("@zhivex-ai/agents").AgentStatus;
132
+ status: import("@zhivex-ai/core").AgentStatus;
133
133
  provider: string;
134
134
  model: string;
135
135
  } | undefined;
@@ -0,0 +1,9 @@
1
+ import type { CliOptions } from "../arguments.js";
2
+ import { type HarnessConfig } from "../../runtime/config.js";
3
+ import type { TokenUsage } from "@zhivex-ai/core";
4
+ /** Only new local console sessions change defaults. Explicit limits always opt
5
+ * into bounded execution; SDK, service hosts and automation retain their policy. */
6
+ export declare const consoleBudgetOptions: (options: CliOptions, env?: NodeJS.ProcessEnv) => CliOptions;
7
+ /** A saved run owns its budget, including legacy runs without a mode flag. */
8
+ export declare const restoreConsoleOptions: (current: CliOptions, saved: Partial<CliOptions>) => CliOptions;
9
+ export declare const formatConsoleBudget: (config: HarnessConfig, usage?: TokenUsage) => string;
@@ -1,6 +1,6 @@
1
1
  /** Presentation shared by the direct console and the local-service client. */
2
- export declare const CONSOLE_COMMAND_CATALOG: readonly [readonly ["/menu", "Open navigation menu", true], readonly ["/help", "Show commands; /help all shows everything", true], readonly ["/credentials", "Manage provider keys in the system keychain or this session", false], readonly ["/provider", "Select a provider", false], readonly ["/model", "Select a model", false], readonly ["/route", "Configure specialist model routes", false], readonly ["/status", "Inspect the current session and run", true], readonly ["/diff", "Review workspace changes", false], readonly ["/review", "Review a task", false], readonly ["/resume", "Reopen a conversation by session ID", true], readonly ["/pending", "Inspect pending approvals", true], readonly ["/approve", "Approve the pending actions", true], readonly ["/deny", "Deny the pending actions", true], readonly ["/compact", "Compact conversation context", false], readonly ["/new", "Start a new conversation", true], readonly ["/rename", "Rename the current conversation", true], readonly ["/clear", "Clear conversation context", false], readonly ["/exit", "Exit the console", true], readonly ["/paste", "Compose a literal multiline draft", true], readonly ["/verbose", "Toggle full or compact activity details", false], readonly ["/context", "Inspect project rules and selected context", false], readonly ["/attach", "Attach a workspace file to the next request", false], readonly ["/attachments", "List selected attachments", false], readonly ["/detach", "Remove selected attachments", false], readonly ["/sessions", "Find saved conversations", true], readonly ["/usage", "Inspect transport usage", false], readonly ["/cancel", "Cancel the active run", true]];
2
+ export declare const CONSOLE_COMMAND_CATALOG: readonly [readonly ["/menu", "Open navigation menu", true], readonly ["/help", "Show commands; /help all shows everything", true], readonly ["/connection", "Inspect credentials and optionally test selected model access", false], readonly ["/credentials", "Manage provider keys in the system keychain or this session", false], readonly ["/provider", "Select a provider", false], readonly ["/model", "Select a model and reasoning effort", false], readonly ["/reasoning", "Choose reasoning effort for the current model", false], readonly ["/route", "Configure specialist model routes", false], readonly ["/status", "Inspect the current session and run", true], readonly ["/diff", "Review workspace changes", false], readonly ["/review", "Review a task", false], readonly ["/resume", "Reopen a conversation by session ID", true], readonly ["/pending", "Inspect pending approvals", true], readonly ["/approve", "Approve the pending actions", true], readonly ["/deny", "Deny the pending actions", true], readonly ["/approvals", "Change approval mode for this CLI session", false], readonly ["/continue", "Continue an interrupted task with retained results in a new run", false], readonly ["/compact", "Compact conversation context", false], readonly ["/compaction", "Choose a compaction model or inspect recommendations", false], readonly ["/new", "Start a new conversation", true], readonly ["/rename", "Rename the current conversation", true], readonly ["/clear", "Clear conversation context", false], readonly ["/exit", "Exit the console", true], readonly ["/paste", "Compose a literal multiline draft", true], readonly ["/activity", "Show recent activity; /activity clear resets it", true], readonly ["/queue", "Inspect queued tasks; /queue clear discards them", true], readonly ["/verbose", "Toggle full or compact activity details", false], readonly ["/context", "Inspect project rules and selected context", false], readonly ["/attach", "Attach a workspace file to the next request", false], readonly ["/attachments", "List selected attachments", false], readonly ["/detach", "Remove selected attachments", false], readonly ["/sessions", "Find saved conversations", true], readonly ["/limits", "Inspect or change the step limit for next turns", false], readonly ["/usage", "Inspect transport usage", false], readonly ["/cancel", "Cancel the active run", true]];
3
3
  export type ConsoleMode = "direct" | "service";
4
- export declare const consoleCommands: (mode?: ConsoleMode) => (readonly ["/approve", "Approve the pending actions", true] | readonly ["/attach", "Attach a workspace file to the next request", false] | readonly ["/attachments", "List selected attachments", false] | readonly ["/cancel", "Cancel the active run", true] | readonly ["/clear", "Clear conversation context", false] | readonly ["/compact", "Compact conversation context", false] | readonly ["/context", "Inspect project rules and selected context", false] | readonly ["/credentials", "Manage provider keys in the system keychain or this session", false] | readonly ["/deny", "Deny the pending actions", true] | readonly ["/detach", "Remove selected attachments", false] | readonly ["/diff", "Review workspace changes", false] | readonly ["/exit", "Exit the console", true] | readonly ["/help", "Show commands; /help all shows everything", true] | readonly ["/menu", "Open navigation menu", true] | readonly ["/model", "Select a model", false] | readonly ["/new", "Start a new conversation", true] | readonly ["/paste", "Compose a literal multiline draft", true] | readonly ["/pending", "Inspect pending approvals", true] | readonly ["/provider", "Select a provider", false] | readonly ["/rename", "Rename the current conversation", true] | readonly ["/resume", "Reopen a conversation by session ID", true] | readonly ["/review", "Review a task", false] | readonly ["/route", "Configure specialist model routes", false] | readonly ["/sessions", "Find saved conversations", true] | readonly ["/status", "Inspect the current session and run", true] | readonly ["/usage", "Inspect transport usage", false] | readonly ["/verbose", "Toggle full or compact activity details", false])[];
5
- export declare const searchConsoleCommands: (query: string, mode?: ConsoleMode) => (readonly ["/approve", "Approve the pending actions", true] | readonly ["/attach", "Attach a workspace file to the next request", false] | readonly ["/attachments", "List selected attachments", false] | readonly ["/cancel", "Cancel the active run", true] | readonly ["/clear", "Clear conversation context", false] | readonly ["/compact", "Compact conversation context", false] | readonly ["/context", "Inspect project rules and selected context", false] | readonly ["/credentials", "Manage provider keys in the system keychain or this session", false] | readonly ["/deny", "Deny the pending actions", true] | readonly ["/detach", "Remove selected attachments", false] | readonly ["/diff", "Review workspace changes", false] | readonly ["/exit", "Exit the console", true] | readonly ["/help", "Show commands; /help all shows everything", true] | readonly ["/menu", "Open navigation menu", true] | readonly ["/model", "Select a model", false] | readonly ["/new", "Start a new conversation", true] | readonly ["/paste", "Compose a literal multiline draft", true] | readonly ["/pending", "Inspect pending approvals", true] | readonly ["/provider", "Select a provider", false] | readonly ["/rename", "Rename the current conversation", true] | readonly ["/resume", "Reopen a conversation by session ID", true] | readonly ["/review", "Review a task", false] | readonly ["/route", "Configure specialist model routes", false] | readonly ["/sessions", "Find saved conversations", true] | readonly ["/status", "Inspect the current session and run", true] | readonly ["/usage", "Inspect transport usage", false] | readonly ["/verbose", "Toggle full or compact activity details", false])[];
4
+ export declare const consoleCommands: (mode?: ConsoleMode) => (readonly ["/activity", "Show recent activity; /activity clear resets it", true] | readonly ["/approvals", "Change approval mode for this CLI session", false] | readonly ["/approve", "Approve the pending actions", true] | readonly ["/attach", "Attach a workspace file to the next request", false] | readonly ["/attachments", "List selected attachments", false] | readonly ["/cancel", "Cancel the active run", true] | readonly ["/clear", "Clear conversation context", false] | readonly ["/compact", "Compact conversation context", false] | readonly ["/compaction", "Choose a compaction model or inspect recommendations", false] | readonly ["/connection", "Inspect credentials and optionally test selected model access", false] | readonly ["/context", "Inspect project rules and selected context", false] | readonly ["/continue", "Continue an interrupted task with retained results in a new run", false] | readonly ["/credentials", "Manage provider keys in the system keychain or this session", false] | readonly ["/deny", "Deny the pending actions", true] | readonly ["/detach", "Remove selected attachments", false] | readonly ["/diff", "Review workspace changes", false] | readonly ["/exit", "Exit the console", true] | readonly ["/help", "Show commands; /help all shows everything", true] | readonly ["/limits", "Inspect or change the step limit for next turns", false] | readonly ["/menu", "Open navigation menu", true] | readonly ["/model", "Select a model and reasoning effort", false] | readonly ["/new", "Start a new conversation", true] | readonly ["/paste", "Compose a literal multiline draft", true] | readonly ["/pending", "Inspect pending approvals", true] | readonly ["/provider", "Select a provider", false] | readonly ["/queue", "Inspect queued tasks; /queue clear discards them", true] | readonly ["/reasoning", "Choose reasoning effort for the current model", false] | readonly ["/rename", "Rename the current conversation", true] | readonly ["/resume", "Reopen a conversation by session ID", true] | readonly ["/review", "Review a task", false] | readonly ["/route", "Configure specialist model routes", false] | readonly ["/sessions", "Find saved conversations", true] | readonly ["/status", "Inspect the current session and run", true] | readonly ["/usage", "Inspect transport usage", false] | readonly ["/verbose", "Toggle full or compact activity details", false])[];
5
+ export declare const searchConsoleCommands: (query: string, mode?: ConsoleMode) => (readonly ["/activity", "Show recent activity; /activity clear resets it", true] | readonly ["/approvals", "Change approval mode for this CLI session", false] | readonly ["/approve", "Approve the pending actions", true] | readonly ["/attach", "Attach a workspace file to the next request", false] | readonly ["/attachments", "List selected attachments", false] | readonly ["/cancel", "Cancel the active run", true] | readonly ["/clear", "Clear conversation context", false] | readonly ["/compact", "Compact conversation context", false] | readonly ["/compaction", "Choose a compaction model or inspect recommendations", false] | readonly ["/connection", "Inspect credentials and optionally test selected model access", false] | readonly ["/context", "Inspect project rules and selected context", false] | readonly ["/continue", "Continue an interrupted task with retained results in a new run", false] | readonly ["/credentials", "Manage provider keys in the system keychain or this session", false] | readonly ["/deny", "Deny the pending actions", true] | readonly ["/detach", "Remove selected attachments", false] | readonly ["/diff", "Review workspace changes", false] | readonly ["/exit", "Exit the console", true] | readonly ["/help", "Show commands; /help all shows everything", true] | readonly ["/limits", "Inspect or change the step limit for next turns", false] | readonly ["/menu", "Open navigation menu", true] | readonly ["/model", "Select a model and reasoning effort", false] | readonly ["/new", "Start a new conversation", true] | readonly ["/paste", "Compose a literal multiline draft", true] | readonly ["/pending", "Inspect pending approvals", true] | readonly ["/provider", "Select a provider", false] | readonly ["/queue", "Inspect queued tasks; /queue clear discards them", true] | readonly ["/reasoning", "Choose reasoning effort for the current model", false] | readonly ["/rename", "Rename the current conversation", true] | readonly ["/resume", "Reopen a conversation by session ID", true] | readonly ["/review", "Review a task", false] | readonly ["/route", "Configure specialist model routes", false] | readonly ["/sessions", "Find saved conversations", true] | readonly ["/status", "Inspect the current session and run", true] | readonly ["/usage", "Inspect transport usage", false] | readonly ["/verbose", "Toggle full or compact activity details", false])[];
6
6
  export declare const formatConsoleHelp: (mode?: ConsoleMode, all?: boolean) => string;
@@ -0,0 +1,18 @@
1
+ import type { CliOptions } from "../arguments.js";
2
+ import type { HarnessConfig, HarnessProvider } from "../../runtime/config.js";
3
+ import { type CatalogSnapshot } from "../../models/catalog-store.js";
4
+ export interface ConsoleCompactionDependencies {
5
+ config: HarnessConfig;
6
+ options: CliOptions;
7
+ hasActiveTurn(): Promise<unknown>;
8
+ /** Rebuild the harness atomically; leave conversation and approval state intact. */
9
+ replaceOptions(options: CliOptions): Promise<void>;
10
+ inspectCredential(provider: HarnessProvider): Promise<{
11
+ configured: boolean;
12
+ }>;
13
+ loadCatalog?(): Promise<CatalogSnapshot>;
14
+ write?(message: string): void;
15
+ now?: number;
16
+ }
17
+ /** A route change is session-scoped and applies only after a successful rebuild. */
18
+ export declare function handleConsoleCompaction(command: string, deps: ConsoleCompactionDependencies): Promise<boolean>;
@@ -1,14 +1,20 @@
1
1
  import { type Readable, Writable } from "node:stream";
2
+ import { type ConsoleComposerInput } from "./console-presentation.js";
2
3
  import { type ConsoleMode } from "./console-commands.js";
3
- export declare const CONSOLE_COMMANDS: ("/approve" | "/attach" | "/attachments" | "/cancel" | "/clear" | "/compact" | "/context" | "/credentials" | "/deny" | "/detach" | "/diff" | "/exit" | "/help" | "/menu" | "/model" | "/new" | "/paste" | "/pending" | "/provider" | "/rename" | "/resume" | "/review" | "/route" | "/sessions" | "/status" | "/usage" | "/verbose")[];
4
+ export declare const CONSOLE_COMMANDS: ("/activity" | "/approvals" | "/approve" | "/attach" | "/attachments" | "/cancel" | "/clear" | "/compact" | "/compaction" | "/connection" | "/context" | "/continue" | "/credentials" | "/deny" | "/detach" | "/diff" | "/exit" | "/help" | "/limits" | "/menu" | "/model" | "/new" | "/paste" | "/pending" | "/provider" | "/queue" | "/reasoning" | "/rename" | "/resume" | "/review" | "/route" | "/sessions" | "/status" | "/usage" | "/verbose")[];
4
5
  export declare const MAX_CONSOLE_INPUT_BYTES: number;
5
6
  export declare const completeConsoleCommand: (line: string) => [string[], string];
6
- /** Lines received without an active question are discarded, never replayed as approvals. */
7
+ /** Background drafts and queued tasks are separate from fresh approval answers. */
7
8
  export declare class ConsoleInput {
8
9
  private readonly input;
9
10
  private readonly output;
10
11
  private readonly terminal;
11
12
  private readonly mode;
13
+ private background;
14
+ private backgroundDraft;
15
+ private queued;
16
+ private queueNotice;
17
+ private queueEnabled;
12
18
  private hidden;
13
19
  private readonly reader;
14
20
  private readonly keyboard;
@@ -44,12 +50,18 @@ export declare class ConsoleInput {
44
50
  private historyMatches;
45
51
  private finishHistorySearch;
46
52
  private menuVisible;
53
+ private placeholderVisible;
54
+ private focusComposer;
47
55
  private menuSelection;
48
56
  private menuQuery;
49
57
  private menuDismissed;
50
58
  private escapeMenuTimer;
51
59
  private standaloneMenuEscape;
52
60
  private hideMenu;
61
+ /** Place overlays after the entire draft, even when editing an earlier line. */
62
+ private draftPosition;
63
+ private showOverlay;
64
+ private renderFocus;
53
65
  private renderMenu;
54
66
  private readonly onEnd;
55
67
  private readonly onResize;
@@ -59,10 +71,17 @@ export declare class ConsoleInput {
59
71
  private insert;
60
72
  private readonly onKeypress;
61
73
  rememberPrompt(prompt: string, literal?: boolean): void;
74
+ startBackground(): void;
75
+ stopBackground(): void;
76
+ get backgroundStatus(): string;
77
+ queueSummary(): string;
78
+ setQueueEnabled(enabled: boolean): void;
79
+ clearQueue(): void;
62
80
  clearHistory(): void;
63
81
  private interrupt;
64
82
  get isClosed(): boolean;
65
- question(prompt: string, completeCommands?: boolean): Promise<string>;
83
+ compose(input: ConsoleComposerInput): Promise<string>;
84
+ question(prompt: string, completeCommands?: boolean, focus?: boolean): Promise<string>;
66
85
  multiline(): Promise<string>;
67
86
  close(): void;
68
87
  }
@@ -1,3 +1,4 @@
1
+ import type { HarnessReasoningEffort } from "../../providers/reasoning.js";
1
2
  import type { ConsoleInput } from "./console-input.js";
2
3
  import { type ModelCatalog } from "../../models/catalog.js";
3
4
  import type { ProviderAvailability } from "../../providers/providers.js";
@@ -12,12 +13,14 @@ export type ConsoleNavigationResult = {
12
13
  } | {
13
14
  provider: string;
14
15
  model: string;
16
+ reasoningEffort?: HarnessReasoningEffort;
15
17
  };
16
18
  export declare const navigateConsole: (input: Pick<ConsoleInput, "select" | "question">, options: {
17
19
  entry: "menu" | "provider" | "model";
18
20
  current: {
19
21
  provider: string;
20
22
  model: string;
23
+ reasoningEffort?: HarnessReasoningEffort;
21
24
  };
22
25
  providers: readonly ProviderAvailability[];
23
26
  sessions: () => Promise<readonly {
@@ -1,12 +1,19 @@
1
1
  /** Bound presentation metadata without allowing paths/titles to control the terminal. */
2
2
  export declare const consoleLabel: (text: string, width: number) => string;
3
- export declare const formatComposer: (input: {
3
+ export interface ConsoleComposerInput {
4
4
  model: string;
5
+ reasoning?: string;
5
6
  title?: string;
6
7
  status: string;
7
8
  attachments?: number;
8
9
  automaticApprovals?: boolean;
9
- }, columns?: number, color?: boolean) => string;
10
+ approvalMode?: "ask" | "auto" | "restricted";
11
+ }
12
+ export declare const consoleWidth: (columns?: number) => number;
13
+ /** Focus keeps policy and pending decisions ahead of optional presentation metadata. */
14
+ export declare const formatComposer: (input: ConsoleComposerInput, columns?: number, color?: boolean) => string;
15
+ export declare const formatComposerFooter: (columns?: number, color?: boolean) => string[];
16
+ export declare const formatComposerPlaceholder: (columns?: number, color?: boolean) => string;
10
17
  export declare const CONSOLE_SHORTCUTS: string;
11
18
  export declare const chooseConsoleItem: <T>(title: string, items: readonly {
12
19
  value: T;
@@ -0,0 +1,6 @@
1
+ import type { AgentStreamEvent } from "@zhivex-ai/agents";
2
+ /** A local-session circuit breaker. Do not retain tool payloads or replay tools. */
3
+ export declare function consoleProgressGuard(): {
4
+ signal: AbortSignal;
5
+ observe(event: AgentStreamEvent): void;
6
+ };
@@ -0,0 +1,3 @@
1
+ import { type HarnessReasoningEffort } from "../../providers/reasoning.js";
2
+ import type { ConsoleInput } from "./console-input.js";
3
+ export declare const chooseReasoning: (input: Pick<ConsoleInput, "select">, provider: string, model: string, current?: HarnessReasoningEffort) => Promise<HarnessReasoningEffort | undefined>;
@@ -25,7 +25,7 @@ export interface DoctorReport {
25
25
  scope: ReturnType<typeof resolveHarnessConfig>["scope"];
26
26
  maxSteps: number;
27
27
  timeoutMs: number;
28
- agentProfile: "strict" | "repair";
28
+ requireVerifiedDelivery: boolean;
29
29
  budget: ReturnType<typeof resolveHarnessConfig>["budget"];
30
30
  costBudget?: ReturnType<typeof resolveHarnessConfig>["costBudget"];
31
31
  compaction: ReturnType<typeof resolveHarnessConfig>["compaction"];
@@ -47,6 +47,6 @@ export interface DoctorContext {
47
47
  bunVersion?: string;
48
48
  ociRuntimeAdapter?: HarnessOciRuntimeAdapter;
49
49
  }
50
- export declare const createDoctorReport: (options?: Pick<CliOptions, "provider" | "model" | "workspace" | "stateDirectory" | "storeBackend" | "tenantId" | "userId" | "namespace" | "maxSteps" | "agentProfile" | "timeoutMs" | "maxToolCalls" | "maxToolErrors" | "unlimitedTokens" | "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>;
50
+ export declare const createDoctorReport: (options?: Pick<CliOptions, "provider" | "model" | "workspace" | "stateDirectory" | "storeBackend" | "tenantId" | "userId" | "namespace" | "maxSteps" | "requireVerifiedDelivery" | "timeoutMs" | "maxToolCalls" | "maxToolErrors" | "unlimitedTokens" | "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>;
51
51
  export declare const formatDoctorReport: (report: DoctorReport) => string;
52
52
  export declare const doctor: (options: CliOptions) => Promise<void>;
@@ -1,3 +1,4 @@
1
+ import type { ActivityHistory } from "./terminal/activity-history.js";
1
2
  import { TerminalMarkdown } from "./terminal/terminal-markdown.js";
2
3
  import { type AgentApprovalRequest, type AgentApprovalResponse, type AgentRunOutput, type AgentStreamEvent } from "@zhivex-ai/agents";
3
4
  import { type HarnessRunOptions, type ZhivexHarness } from "../runtime/harness.js";
@@ -8,7 +9,11 @@ export declare const cliStreamErrorSequence: (error: unknown) => number;
8
9
  export declare const terminalErrorMessage: (error: unknown) => string;
9
10
  export declare const summarizeApproval: (approval: AgentApprovalRequest) => string;
10
11
  export declare const approvalResponses: (approvals: readonly AgentApprovalRequest[], approve: boolean, reason: string) => AgentApprovalResponse[];
11
- export declare const terminalApprovalResolver: (automaticallyApprove: boolean, ask?: (question: string) => Promise<string>) => NonNullable<HarnessRunOptions["resolveApprovals"]>;
12
+ export declare const terminalApprovalResolver: (automaticallyApprove: boolean | "ask" | "auto" | "restricted", ask?: (question: string) => Promise<string>, ui?: {
13
+ select: import("./cli-credentials.js").CredentialInput["select"];
14
+ workspace: string;
15
+ sessionGrants?: Set<string>;
16
+ }) => NonNullable<HarnessRunOptions["resolveApprovals"]>;
12
17
  export declare const printTerminalResult: (result: AgentRunOutput, harness: ZhivexHarness, output: Pick<CliOptions, "json" | "jsonl">, tracker: {
13
18
  streamedText: boolean;
14
19
  sequence?: number;
@@ -19,5 +24,7 @@ export declare const streamSink: (output: Pick<CliOptions, "json" | "jsonl">, tr
19
24
  streamedText: boolean;
20
25
  sequence?: number;
21
26
  markdown?: TerminalMarkdown;
27
+ activityHistory?: ActivityHistory;
28
+ inputStatus?: () => string;
22
29
  }, compact?: boolean) => (event: AgentStreamEvent) => Promise<void>;
23
30
  export declare const orchestrationObserver: (json: boolean) => AgentTelemetryObserver;
@@ -0,0 +1,23 @@
1
+ import type { CredentialInput } from "./cli-credentials.js";
2
+ declare const regions: {
3
+ readonly singapore: readonly ["Singapore", "ap-southeast-1", "dashscope-intl.aliyuncs.com"];
4
+ readonly beijing: readonly ["Beijing", "cn-beijing", "dashscope.aliyuncs.com"];
5
+ readonly "hong-kong": readonly ["Hong Kong", "cn-hongkong", "cn-hongkong.dashscope.aliyuncs.com"];
6
+ readonly tokyo: readonly ["Tokyo", "ap-northeast-1", ""];
7
+ readonly frankfurt: readonly ["Frankfurt", "eu-central-1", ""];
8
+ readonly virginia: readonly ["Virginia", "us-east-1", ""];
9
+ };
10
+ export type QwenConnection = {
11
+ service: "api";
12
+ region: keyof typeof regions;
13
+ workspace?: string;
14
+ } | {
15
+ service: "token-plan";
16
+ };
17
+ export declare function qwenEndpoint(connection: QwenConnection): string;
18
+ export declare function decodeQwenCredential(value: string): {
19
+ key: string;
20
+ connection: QwenConnection;
21
+ };
22
+ export declare function selectQwenConnection(input: CredentialInput): Promise<QwenConnection | undefined>;
23
+ export {};
@@ -4,7 +4,7 @@ export declare const runResultDocument: (result: AgentRunOutput, harness: Zhivex
4
4
  schemaVersion: 1;
5
5
  kind: "run-result";
6
6
  runId: string;
7
- status: import("@zhivex-ai/agents").AgentStatus;
7
+ status: import("@zhivex-ai/core").AgentStatus;
8
8
  provider: string;
9
9
  model: string;
10
10
  output: string;
@@ -32,7 +32,7 @@ export declare const runResultDocument: (result: AgentRunOutput, harness: Zhivex
32
32
  runId: string;
33
33
  agentId: string | undefined;
34
34
  toolName: string | undefined;
35
- status: import("@zhivex-ai/agents").AgentStatus;
35
+ status: import("@zhivex-ai/core").AgentStatus;
36
36
  steps: number;
37
37
  toolCalls: number;
38
38
  toolErrors: number;
@@ -61,7 +61,7 @@ export declare const runResultDocument: (result: AgentRunOutput, harness: Zhivex
61
61
  priceStatuses: ("estimate" | "missing" | "stale")[];
62
62
  }[];
63
63
  } | null;
64
- budget: import("@zhivex-ai/agents").AgentBudgetStatus;
64
+ budget: import("@zhivex-ai/core").AgentBudgetStatus;
65
65
  costBudget?: {
66
66
  limitUsd: number;
67
67
  estimate: import("@zhivex-ai/core").CostEstimate;
@@ -75,7 +75,7 @@ export declare const runResultDocument: (result: AgentRunOutput, harness: Zhivex
75
75
  };
76
76
  execution: {
77
77
  backend: "oci";
78
- binding: import("@zhivex-ai/agents").AgentExecutionEnvironmentBinding | undefined;
78
+ binding: import("@zhivex-ai/core").AgentExecutionEnvironmentBinding | undefined;
79
79
  image: import("../index.js").OciImageInspection;
80
80
  } | {
81
81
  binding?: never;
@@ -0,0 +1,15 @@
1
+ import type { AgentStreamEvent } from "@zhivex-ai/agents";
2
+ import type { MutationAuditEntry } from "../../workspace/edit-contracts.js";
3
+ /** Bounded in-memory activity, not model reasoning or raw tool payloads. */
4
+ export declare class ActivityHistory {
5
+ private lines;
6
+ private started;
7
+ private dropped;
8
+ clear(): void;
9
+ add(text: string): void;
10
+ observe(event: AgentStreamEvent): void;
11
+ observeService(event: Record<string, unknown>): void;
12
+ render(): string;
13
+ }
14
+ /** Only workspace-owned committed mutation receipts may supply file labels. */
15
+ export declare const formatAppliedFiles: (entries: readonly Pick<MutationAuditEntry, "operation" | "path" | "destination">[], reviewHint?: string) => string;
@@ -0,0 +1,4 @@
1
+ import type { AgentApprovalRequest } from "@zhivex-ai/agents";
2
+ /** Never grant by command prefix or tool name alone. Unknown payload fields
3
+ * prevent reuse so an expanded tool contract cannot inherit an old grant. */
4
+ export declare function checkApprovalGrant(approval: AgentApprovalRequest, workspace: string): string | undefined;
@@ -1,13 +1,16 @@
1
- /** Bounded, line-oriented presentation; never emits terminal controls from model text. */
1
+ /** Small streaming Markdown renderer. Formatting survives pauses between tokens. */
2
2
  export declare class TerminalMarkdown {
3
3
  private readonly output;
4
4
  private readonly color;
5
+ private readonly columns;
5
6
  private pending;
6
7
  private code;
8
+ private heading;
9
+ private lineStart;
7
10
  private timer;
8
- constructor(output: (text: string) => void, color: boolean);
9
- private style;
10
- private line;
11
+ private tableLines;
12
+ constructor(output: (text: string) => void, color: boolean, columns?: () => number);
13
+ private drain;
11
14
  write(delta: string): void;
12
15
  flush(): void;
13
16
  }
@@ -0,0 +1,6 @@
1
+ /** Terminal cell width, including combining marks, CJK and emoji clusters. */
2
+ export declare const terminalCellWidth: (value: string) => number;
3
+ export declare function tableCells(line: string): string[];
4
+ export declare const isTableSeparator: (line: string, columns: number) => boolean;
5
+ /** Input has already passed sanitizeTerminalText; only generated styles are emitted. */
6
+ export declare function renderTerminalTable(lines: readonly string[], columns: number, color: boolean): string;
@@ -18,6 +18,9 @@ export interface ApprovalFormatOptions {
18
18
  export declare const formatApproval: (approval: AgentApprovalRequest, options?: ApprovalFormatOptions) => string;
19
19
  export interface TerminalApprovalResolverOptions {
20
20
  ask(question: string): Promise<string>;
21
+ select?: import("../cli-credentials.js").CredentialInput["select"];
22
+ workspace?: string;
23
+ sessionGrants?: Set<string>;
21
24
  write(text: string): void;
22
25
  maxSummaryCharacters?: number;
23
26
  approvedReason?: string;
@@ -1,19 +1,30 @@
1
- /** A bounded activity line; transcript entries are committed only at message boundaries. */
1
+ /** Live progress plus a bounded, durable summary per activity group. No tool payloads. */
2
2
  export declare class ToolActivity {
3
3
  private write;
4
4
  private tty;
5
5
  private columns;
6
- private completed;
6
+ private inputStatus;
7
7
  private active;
8
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;
9
+ private label;
10
+ private completed;
11
+ private started;
12
+ private readonly runStarted;
13
+ private timer;
14
+ constructor(write: (text: string) => void, tty: boolean, columns?: () => number, inputStatus?: () => string);
15
+ phase(label: "Waiting for model response" | "Waiting for approval" | "Updating context", _step?: number): void;
16
+ start(name?: string): void;
17
+ finish(name: string, success?: boolean): void;
18
+ private begin;
17
19
  private render;
20
+ /** Hide progress while prose or a receipt is printed, preserving the cumulative counts. */
21
+ pause(): void;
22
+ private clear;
18
23
  flush(): void;
19
24
  }
25
+ /** Render only fixed categories. Never echo paths, arguments, outputs, or arbitrary errors. */
26
+ export declare const compactToolResult: (result: {
27
+ toolName: string;
28
+ isError?: boolean;
29
+ error?: unknown;
30
+ }) => string | undefined;
@@ -0,0 +1 @@
1
+ export { harnessToolExecution as cliToolExecution } from "../runtime/tool-execution.js";