@zergai/ztc 0.4.0-beta.1 → 0.5.0-beta.1
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/README.md +398 -45
- package/RUST_THIRD_PARTY_LICENSES.txt +1080 -822
- package/THIRD_PARTY_NOTICES.md +273 -12
- package/bin/zmux-darwin-arm64 +0 -0
- package/bin/ztc-audio-darwin-arm64 +0 -0
- package/bin/ztc-capture-darwin-arm64 +0 -0
- package/bin/ztc-computer-darwin-arm64 +0 -0
- package/bin/ztc-llm-darwin-arm64 +0 -0
- package/bin/ztc-tts-darwin-arm64 +0 -0
- package/bin/ztc-tui-darwin-arm64 +0 -0
- package/bin/ztc-zlicky-overlay-darwin-arm64 +0 -0
- package/bin/zterm-darwin-arm64 +0 -0
- package/dist/App.js +1206 -209
- package/dist/agent/agent.d.ts +74 -8
- package/dist/agent/agent.js +1073 -184
- package/dist/agent/backends/account_rotation.d.ts +4 -0
- package/dist/agent/backends/account_rotation.js +8 -2
- package/dist/agent/backends/anthropic.d.ts +13 -0
- package/dist/agent/backends/anthropic.js +169 -28
- package/dist/agent/backends/claude_cli.js +18 -8
- package/dist/agent/backends/codex_app_server.d.ts +1 -0
- package/dist/agent/backends/codex_app_server.js +55 -3
- package/dist/agent/backends/codex_auth.d.ts +1 -0
- package/dist/agent/backends/codex_auth.js +67 -13
- package/dist/agent/backends/codex_buffered_recovery.d.ts +27 -0
- package/dist/agent/backends/codex_buffered_recovery.js +293 -0
- package/dist/agent/backends/gemini.js +3 -1
- package/dist/agent/backends/http_error.d.ts +26 -0
- package/dist/agent/backends/http_error.js +221 -0
- package/dist/agent/backends/index.d.ts +9 -2
- package/dist/agent/backends/index.js +22 -2
- package/dist/agent/backends/openai.d.ts +0 -6
- package/dist/agent/backends/openai.js +5 -2
- package/dist/agent/backends/openai_compatible.d.ts +5 -4
- package/dist/agent/backends/openai_compatible.js +26 -19
- package/dist/agent/backends/openai_responses.d.ts +8 -3
- package/dist/agent/backends/openai_responses.js +77 -33
- package/dist/agent/backends/provider_ids.d.ts +1 -0
- package/dist/agent/backends/provider_ids.js +4 -0
- package/dist/agent/backends/request_metrics.js +12 -2
- package/dist/agent/backends/types.d.ts +109 -6
- package/dist/agent/backends/types.js +5 -1
- package/dist/agent/backends/zrouter_stream.d.ts +6 -1
- package/dist/agent/backends/zrouter_stream.js +160 -42
- package/dist/agent/background_registry.d.ts +2 -0
- package/dist/agent/background_registry.js +1 -0
- package/dist/agent/claim_observation.d.ts +6 -0
- package/dist/agent/claim_observation.js +54 -0
- package/dist/agent/commands/accounts.js +46 -177
- package/dist/agent/commands/attention.d.ts +2 -0
- package/dist/agent/commands/attention.js +67 -0
- package/dist/agent/commands/auth.js +18 -2
- package/dist/agent/commands/board.d.ts +2 -0
- package/dist/agent/commands/board.js +169 -0
- package/dist/agent/commands/clipboard.js +50 -1
- package/dist/agent/commands/compact.js +21 -13
- package/dist/agent/commands/config.js +4 -1
- package/dist/agent/commands/context.js +6 -1
- package/dist/agent/commands/desktop.d.ts +2 -0
- package/dist/agent/commands/desktop.js +29 -0
- package/dist/agent/commands/effort.js +14 -6
- package/dist/agent/commands/environment.d.ts +3 -0
- package/dist/agent/commands/environment.js +109 -0
- package/dist/agent/commands/evidence.d.ts +2 -0
- package/dist/agent/commands/evidence.js +9 -0
- package/dist/agent/commands/fork.js +4 -3
- package/dist/agent/commands/goal.d.ts +33 -1
- package/dist/agent/commands/goal.js +174 -14
- package/dist/agent/commands/goal_exit.d.ts +36 -0
- package/dist/agent/commands/goal_exit.js +120 -0
- package/dist/agent/commands/help.js +3 -1
- package/dist/agent/commands/history.js +3 -1
- package/dist/agent/commands/inbox.d.ts +2 -0
- package/dist/agent/commands/inbox.js +148 -0
- package/dist/agent/commands/index.js +16 -1
- package/dist/agent/commands/input_mode.js +8 -6
- package/dist/agent/commands/job.d.ts +2 -0
- package/dist/agent/commands/job.js +93 -0
- package/dist/agent/commands/keybindings.js +4 -1
- package/dist/agent/commands/label.d.ts +2 -0
- package/dist/agent/commands/label.js +77 -0
- package/dist/agent/commands/layout.d.ts +2 -0
- package/dist/agent/commands/layout.js +20 -0
- package/dist/agent/commands/mirror.js +16 -1
- package/dist/agent/commands/model.js +12 -2
- package/dist/agent/commands/permissions.d.ts +3 -1
- package/dist/agent/commands/permissions.js +79 -89
- package/dist/agent/commands/plan.js +5 -15
- package/dist/agent/commands/profile.js +21 -2
- package/dist/agent/commands/provider_selection.js +20 -1
- package/dist/agent/commands/rename.js +1 -1
- package/dist/agent/commands/resources.d.ts +2 -0
- package/dist/agent/commands/resources.js +67 -0
- package/dist/agent/commands/rewind.d.ts +3 -0
- package/dist/agent/commands/rewind.js +16 -0
- package/dist/agent/commands/runbooks.d.ts +2 -0
- package/dist/agent/commands/runbooks.js +73 -0
- package/dist/agent/commands/runbooks_lazy.d.ts +2 -0
- package/dist/agent/commands/runbooks_lazy.js +8 -0
- package/dist/agent/commands/sessions.d.ts +1 -1
- package/dist/agent/commands/sessions.js +33 -5
- package/dist/agent/commands/settings.js +185 -39
- package/dist/agent/commands/setup.d.ts +2 -0
- package/dist/agent/commands/setup.js +78 -0
- package/dist/agent/commands/share.d.ts +2 -0
- package/dist/agent/commands/share.js +64 -0
- package/dist/agent/commands/status.js +14 -2
- package/dist/agent/commands/types.d.ts +99 -6
- package/dist/agent/commands/update.js +8 -0
- package/dist/agent/commands/usage.d.ts +2 -0
- package/dist/agent/commands/usage.js +8 -0
- package/dist/agent/factory.d.ts +11 -0
- package/dist/agent/factory.js +113 -88
- package/dist/agent/loop_policy.d.ts +6 -3
- package/dist/agent/loop_policy.js +12 -3
- package/dist/agent/measurement_guidance.d.ts +2 -0
- package/dist/agent/measurement_guidance.js +5 -0
- package/dist/agent/request_encoder.d.ts +8 -1
- package/dist/agent/request_encoder.js +95 -23
- package/dist/agent/runtime/benchmark_comparison.d.ts +30 -0
- package/dist/agent/runtime/benchmark_comparison.js +94 -0
- package/dist/agent/runtime/benchmark_contract.d.ts +48 -0
- package/dist/agent/runtime/benchmark_contract.js +90 -0
- package/dist/agent/runtime/checked_commands.d.ts +32 -0
- package/dist/agent/runtime/checked_commands.js +119 -0
- package/dist/agent/runtime/command_execution_policy.d.ts +26 -0
- package/dist/agent/runtime/command_execution_policy.js +91 -0
- package/dist/agent/runtime/command_jobs.d.ts +36 -18
- package/dist/agent/runtime/command_jobs.js +151 -13
- package/dist/agent/runtime/command_panes.d.ts +59 -0
- package/dist/agent/runtime/command_panes.js +398 -0
- package/dist/agent/runtime/command_wait.d.ts +19 -0
- package/dist/agent/runtime/command_wait.js +167 -0
- package/dist/agent/runtime/cpu_benchmark.d.ts +30 -0
- package/dist/agent/runtime/cpu_benchmark.js +126 -0
- package/dist/agent/runtime/delegated_evidence.d.ts +26 -0
- package/dist/agent/runtime/delegated_evidence.js +80 -0
- package/dist/agent/runtime/evidence.d.ts +127 -0
- package/dist/agent/runtime/evidence.js +468 -0
- package/dist/agent/runtime/execution_context.d.ts +7 -0
- package/dist/agent/runtime/execution_context.js +39 -3
- package/dist/agent/runtime/json_verifier_recipe.d.ts +8 -0
- package/dist/agent/runtime/json_verifier_recipe.js +66 -0
- package/dist/agent/runtime/measurements.d.ts +110 -0
- package/dist/agent/runtime/measurements.js +317 -0
- package/dist/agent/runtime/policy.d.ts +4 -0
- package/dist/agent/runtime/policy.js +31 -20
- package/dist/agent/runtime/provider_native_evidence.d.ts +20 -0
- package/dist/agent/runtime/provider_native_evidence.js +86 -0
- package/dist/agent/runtime/recovery.d.ts +2 -0
- package/dist/agent/runtime/recovery.js +45 -2
- package/dist/agent/runtime/remote_broker_transport.d.ts +10 -0
- package/dist/agent/runtime/remote_broker_transport.js +84 -0
- package/dist/agent/runtime/remote_deletion_receipts.d.ts +3 -0
- package/dist/agent/runtime/remote_deletion_receipts.js +43 -0
- package/dist/agent/runtime/remote_journal_replay.d.ts +13 -0
- package/dist/agent/runtime/remote_journal_replay.js +233 -0
- package/dist/agent/runtime/remote_mutation_journal.d.ts +25 -0
- package/dist/agent/runtime/remote_mutation_journal.js +208 -0
- package/dist/agent/runtime/remote_resource_endpoint.d.ts +7 -0
- package/dist/agent/runtime/remote_resource_endpoint.js +6 -0
- package/dist/agent/runtime/remote_resource_errors.d.ts +5 -0
- package/dist/agent/runtime/remote_resource_errors.js +9 -0
- package/dist/agent/runtime/remote_resource_script.d.ts +2 -0
- package/dist/agent/runtime/remote_resource_script.js +1009 -0
- package/dist/agent/runtime/remote_resources.d.ts +29 -0
- package/dist/agent/runtime/remote_resources.js +160 -0
- package/dist/agent/runtime/source_verification.d.ts +12 -0
- package/dist/agent/runtime/source_verification.js +210 -0
- package/dist/agent/runtime/source_verification_contract.d.ts +75 -0
- package/dist/agent/runtime/source_verification_contract.js +203 -0
- package/dist/agent/runtime/tool_checkpoints.d.ts +11 -0
- package/dist/agent/runtime/tool_checkpoints.js +26 -0
- package/dist/agent/runtime/tool_effects.d.ts +5 -0
- package/dist/agent/runtime/tool_progress.d.ts +12 -0
- package/dist/agent/runtime/tool_progress.js +76 -0
- package/dist/agent/runtime/tool_runtime.d.ts +16 -1
- package/dist/agent/runtime/tool_runtime.js +204 -10
- package/dist/agent/runtime/tracing.d.ts +1 -1
- package/dist/agent/runtime/verifier_capture.d.ts +9 -0
- package/dist/agent/runtime/verifier_capture.js +100 -0
- package/dist/agent/runtime/verifier_contract.d.ts +24 -0
- package/dist/agent/runtime/verifier_contract.js +41 -0
- package/dist/agent/subagent.d.ts +20 -10
- package/dist/agent/subagent.js +266 -29
- package/dist/agent/tool_response_directory.d.ts +24 -0
- package/dist/agent/tool_response_directory.js +61 -0
- package/dist/agent/tool_response_source.d.ts +8 -0
- package/dist/agent/tool_response_source.js +49 -0
- package/dist/agent/tool_response_store.d.ts +75 -4
- package/dist/agent/tool_response_store.js +583 -64
- package/dist/agent/tools/ask_user.d.ts +3 -1
- package/dist/agent/tools/ask_user.js +30 -11
- package/dist/agent/tools/background.js +1 -0
- package/dist/agent/tools/benchmark_cpu.d.ts +2 -0
- package/dist/agent/tools/benchmark_cpu.js +102 -0
- package/dist/agent/tools/compare_benchmarks.d.ts +2 -0
- package/dist/agent/tools/compare_benchmarks.js +53 -0
- package/dist/agent/tools/deferred.js +1 -0
- package/dist/agent/tools/delegate.js +18 -2
- package/dist/agent/tools/helper_requirements.d.ts +7 -0
- package/dist/agent/tools/helper_requirements.js +19 -0
- package/dist/agent/tools/index.d.ts +1 -0
- package/dist/agent/tools/index.js +3 -0
- package/dist/agent/tools/measurement_report.d.ts +22 -0
- package/dist/agent/tools/measurement_report.js +190 -0
- package/dist/agent/tools/pane.d.ts +0 -7
- package/dist/agent/tools/pane.js +5 -4
- package/dist/agent/tools/project_context.d.ts +3 -0
- package/dist/agent/tools/project_context.js +45 -0
- package/dist/agent/tools/recall_tool_response.d.ts +3 -5
- package/dist/agent/tools/recall_tool_response.js +19 -29
- package/dist/agent/tools/registry.d.ts +1 -0
- package/dist/agent/tools/registry.js +23 -0
- package/dist/agent/tools/related_sessions.d.ts +2 -0
- package/dist/agent/tools/related_sessions.js +156 -0
- package/dist/agent/tools/routine.js +13 -3
- package/dist/agent/tools/session_evidence.d.ts +3 -0
- package/dist/agent/tools/session_evidence.js +72 -0
- package/dist/agent/tools/shell.d.ts +4 -3
- package/dist/agent/tools/shell.js +174 -47
- package/dist/agent/tools/tool_search.js +3 -2
- package/dist/agent/tools/types.d.ts +28 -0
- package/dist/agent/tools/verify_artifact.d.ts +2 -0
- package/dist/agent/tools/verify_artifact.js +60 -0
- package/dist/agent/tools/workflow.js +1 -0
- package/dist/app/activity.d.ts +6 -1
- package/dist/app/activity.js +81 -12
- package/dist/app/agent_runner.d.ts +6 -1
- package/dist/app/agent_runner.js +34 -19
- package/dist/app/command_context.js +106 -10
- package/dist/app/controller.d.ts +15 -4
- package/dist/app/controller.js +29 -3
- package/dist/app/escape_stop.d.ts +11 -0
- package/dist/app/escape_stop.js +15 -0
- package/dist/app/liveness.d.ts +6 -4
- package/dist/app/liveness.js +13 -3
- package/dist/app/model_catalog_cache.d.ts +5 -0
- package/dist/app/model_catalog_cache.js +138 -0
- package/dist/app/ordered_transcript.js +43 -4
- package/dist/app/prompt_turn.d.ts +14 -0
- package/dist/app/prompt_turn.js +53 -0
- package/dist/app/recap.d.ts +3 -0
- package/dist/app/recap.js +9 -3
- package/dist/app/restart.d.ts +3 -2
- package/dist/app/restart.js +22 -7
- package/dist/app/rewind.d.ts +3 -3
- package/dist/app/rewind.js +3 -3
- package/dist/app/selection_completion.d.ts +17 -2
- package/dist/app/selection_completion.js +84 -9
- package/dist/app/session_manager.d.ts +38 -6
- package/dist/app/session_manager.js +263 -60
- package/dist/app/session_messages.d.ts +3 -0
- package/dist/app/session_messages.js +60 -0
- package/dist/app/task_scope_router.d.ts +20 -0
- package/dist/app/task_scope_router.js +173 -0
- package/dist/app/transcript_window.d.ts +2 -0
- package/dist/app/transcript_window.js +4 -0
- package/dist/app/workspace_admission_details.d.ts +3 -0
- package/dist/app/workspace_admission_details.js +26 -0
- package/dist/app/workspace_layout_controller.d.ts +11 -0
- package/dist/app/workspace_layout_controller.js +88 -0
- package/dist/app/workspace_monitor.d.ts +1 -0
- package/dist/app/workspace_monitor.js +216 -0
- package/dist/app/workspace_presets.d.ts +29 -0
- package/dist/app/workspace_presets.js +192 -0
- package/dist/attention/queue.d.ts +37 -0
- package/dist/attention/queue.js +183 -0
- package/dist/bench/rf_shared.d.ts +2 -0
- package/dist/board/binding.d.ts +42 -0
- package/dist/board/binding.js +38 -0
- package/dist/board/client.d.ts +42 -0
- package/dist/board/client.js +60 -0
- package/dist/cli.js +1 -1
- package/dist/cli_args.js +19 -17
- package/dist/cli_main.js +110 -13
- package/dist/cli_ratatui.d.ts +183 -16
- package/dist/cli_ratatui.js +3989 -1255
- package/dist/components/ActivityLine.d.ts +3 -2
- package/dist/components/ActivityLine.js +2 -2
- package/dist/components/InputArea.d.ts +19 -1
- package/dist/components/InputArea.js +264 -190
- package/dist/components/MessageList.d.ts +2 -0
- package/dist/components/MessageList.js +3 -1
- package/dist/components/SingleMessage.d.ts +2 -0
- package/dist/components/SingleMessage.js +4 -2
- package/dist/components/StatusBar.d.ts +4 -2
- package/dist/components/StatusBar.js +3 -1
- package/dist/conductor_branch.js +3 -0
- package/dist/config/api_retry.d.ts +6 -1
- package/dist/config/api_retry.js +19 -1
- package/dist/config/defaults.d.ts +2 -1
- package/dist/config/defaults.js +9 -2
- package/dist/config/message_display.d.ts +1 -0
- package/dist/config/message_display.js +17 -2
- package/dist/config/permissions.d.ts +21 -0
- package/dist/config/permissions.js +89 -0
- package/dist/config/resolved.d.ts +2 -2
- package/dist/config/types.d.ts +32 -5
- package/dist/config.d.ts +38 -4
- package/dist/config.js +290 -42
- package/dist/context/project_intelligence.d.ts +44 -0
- package/dist/context/project_intelligence.js +246 -0
- package/dist/desktop/cli_launch.d.ts +8 -0
- package/dist/desktop/cli_launch.js +6 -0
- package/dist/desktop/cli_shim.d.ts +8 -0
- package/dist/desktop/cli_shim.js +120 -0
- package/dist/desktop/runtime.d.ts +16 -0
- package/dist/desktop/runtime.js +161 -0
- package/dist/desktop/worker_launch.d.ts +7 -0
- package/dist/desktop/worker_launch.js +7 -0
- package/dist/diagnostics/cargo_mutants_selection.d.ts +27 -0
- package/dist/diagnostics/cargo_mutants_selection.js +48 -0
- package/dist/diagnostics/native_terminal_benchmark.d.ts +58 -0
- package/dist/diagnostics/native_terminal_benchmark.js +1247 -0
- package/dist/diagnostics/session_evidence_package.d.ts +40 -0
- package/dist/diagnostics/session_evidence_package.js +234 -0
- package/dist/diagnostics/session_export.d.ts +93 -0
- package/dist/diagnostics/session_export.js +634 -0
- package/dist/emulation/tool_adapters.js +48 -18
- package/dist/emulation/ztc_addendum.d.ts +1 -0
- package/dist/emulation/ztc_addendum.js +13 -12
- package/dist/environment/service_runner.d.ts +1 -0
- package/dist/environment/service_runner.js +68 -0
- package/dist/environment/store.d.ts +120 -0
- package/dist/environment/store.js +387 -0
- package/dist/events.d.ts +40 -1
- package/dist/events.js +10 -17
- package/dist/goal_contract.d.ts +25 -0
- package/dist/goal_contract.js +44 -0
- package/dist/headless.d.ts +31 -0
- package/dist/headless.js +578 -70
- package/dist/headless_cli.js +8 -0
- package/dist/headless_cli_args.d.ts +1 -0
- package/dist/headless_cli_args.js +1 -0
- package/dist/intake/cli.d.ts +1 -0
- package/dist/intake/cli.js +33 -0
- package/dist/intake/format.d.ts +2 -0
- package/dist/intake/format.js +14 -0
- package/dist/intake/notifications.d.ts +16 -0
- package/dist/intake/notifications.js +132 -0
- package/dist/intake/store.d.ts +56 -0
- package/dist/intake/store.js +238 -0
- package/dist/library.d.ts +8 -0
- package/dist/library.js +19 -10
- package/dist/mcp/client.d.ts +1 -0
- package/dist/mcp/client.js +20 -0
- package/dist/modes/builtin/plan.yaml +2 -2
- package/dist/modes/handlers.js +1 -1
- package/dist/onboarding/first_run.d.ts +3 -0
- package/dist/onboarding/first_run.js +33 -25
- package/dist/onboarding/setup.d.ts +32 -0
- package/dist/onboarding/setup.js +133 -0
- package/dist/onboarding/setup_agent_health.d.ts +17 -0
- package/dist/onboarding/setup_agent_health.js +79 -0
- package/dist/onboarding/setup_environment.d.ts +66 -0
- package/dist/onboarding/setup_environment.js +219 -0
- package/dist/onboarding/setup_workspace.d.ts +17 -0
- package/dist/onboarding/setup_workspace.js +129 -0
- package/dist/optimize/adapters/index.d.ts +4 -1
- package/dist/optimize/adapters/index.js +7 -0
- package/dist/optimize/adapters/kernelbench.js +14 -5
- package/dist/optimize/adapters/popcorn.js +3 -2
- package/dist/optimize/adapters/profile_benchmark.js +13 -7
- package/dist/optimize/adapters/rfbench.js +25 -14
- package/dist/optimize/adapters/types.d.ts +3 -0
- package/dist/optimize/adapters/zergpod.js +5 -2
- package/dist/optimize/baseline.js +10 -21
- package/dist/optimize/branch.js +9 -12
- package/dist/optimize/combine.js +2 -3
- package/dist/optimize/executor.js +34 -48
- package/dist/optimize/measurements.d.ts +55 -0
- package/dist/optimize/measurements.js +173 -0
- package/dist/optimize/results.d.ts +1 -0
- package/dist/optimize/results.js +11 -33
- package/dist/optimize/tge.js +2 -1
- package/dist/panes/initial_input.d.ts +19 -0
- package/dist/panes/initial_input.js +206 -0
- package/dist/panes/labels.d.ts +16 -0
- package/dist/panes/labels.js +42 -0
- package/dist/panes/model_catalog.d.ts +3 -3
- package/dist/panes/model_catalog.js +28 -4
- package/dist/panes/pane_registry.js +6 -2
- package/dist/panes/types.d.ts +3 -0
- package/dist/panes/ztc_launch.js +19 -0
- package/dist/plugin/optimization.d.ts +2 -0
- package/dist/plugin/optimization.js +1 -0
- package/dist/plugin/runtime.d.ts +2 -0
- package/dist/plugin/simulation.d.ts +6 -1
- package/dist/plugin/simulation_contract.d.ts +836 -1
- package/dist/plugin/simulation_documents.d.ts +22 -0
- package/dist/plugin/simulation_documents.js +1 -0
- package/dist/plugin/simulation_interventions.d.ts +103 -0
- package/dist/plugin/simulation_interventions.js +1 -0
- package/dist/plugin/simulation_living.d.ts +1 -0
- package/dist/plugin/simulation_living.js +3 -0
- package/dist/plugin/simulation_meetings.d.ts +121 -0
- package/dist/plugin/simulation_meetings.js +1 -0
- package/dist/plugin/simulation_story_review.d.ts +111 -0
- package/dist/plugin/simulation_story_review.js +1 -0
- package/dist/plugin/simulation_storyteller.d.ts +91 -0
- package/dist/plugin/simulation_storyteller.js +1 -0
- package/dist/plugin/simulation_structured.d.ts +2 -0
- package/dist/plugin/simulation_structured.js +2 -0
- package/dist/plugin/simulation_toolkit.d.ts +21 -0
- package/dist/plugin/simulation_toolkit.js +24 -0
- package/dist/prompts/tool_delegate_task.j2 +1 -1
- package/dist/remote-broker/Dockerfile +10 -0
- package/dist/remote-broker/archive.py +1227 -0
- package/dist/remote-broker/cutover.py +761 -0
- package/dist/remote-broker/requirements.txt +5 -0
- package/dist/remote-broker/resources.json +6 -0
- package/dist/remote-broker/resources.write-staging.example.json +18 -0
- package/dist/remote-broker/retained.py +686 -0
- package/dist/remote-broker/retained_cleanup.py +550 -0
- package/dist/remote-broker/server.py +648 -0
- package/dist/remote-broker/worker.py +1007 -0
- package/dist/router_auth.d.ts +31 -0
- package/dist/router_auth.js +155 -9
- package/dist/runbooks/catalog.d.ts +3 -0
- package/dist/runbooks/catalog.js +26 -0
- package/dist/runbooks/library.d.ts +11 -0
- package/dist/runbooks/library.js +95 -0
- package/dist/runbooks/package.d.ts +43 -0
- package/dist/runbooks/package.js +102 -0
- package/dist/session.d.ts +65 -13
- package/dist/session.js +548 -43
- package/dist/session_handoff.d.ts +25 -0
- package/dist/session_handoff.js +322 -0
- package/dist/session_handoff_contract.d.ts +89 -0
- package/dist/session_handoff_contract.js +179 -0
- package/dist/session_media.d.ts +41 -0
- package/dist/session_media.js +357 -0
- package/dist/session_ownership.d.ts +16 -0
- package/dist/session_ownership.js +221 -0
- package/dist/session_public.d.ts +10 -2
- package/dist/session_public.js +6 -1
- package/dist/simulation/dynamic_history.d.ts +42 -0
- package/dist/simulation/dynamic_history.js +173 -0
- package/dist/simulation/engines/swarm/pane_manager.js +7 -6
- package/dist/simulation/inference.d.ts +3 -1
- package/dist/simulation/inference.js +19 -1
- package/dist/simulation/intervention_generation.d.ts +27 -0
- package/dist/simulation/intervention_generation.js +246 -0
- package/dist/simulation/intervention_material.d.ts +4 -0
- package/dist/simulation/intervention_material.js +81 -0
- package/dist/simulation/living/context.d.ts +3130 -0
- package/dist/simulation/living/context.js +944 -0
- package/dist/simulation/living/definer.d.ts +12 -0
- package/dist/simulation/living/definer.js +223 -0
- package/dist/simulation/living/definition.d.ts +257 -0
- package/dist/simulation/living/definition.js +341 -0
- package/dist/simulation/living/frame.d.ts +259 -0
- package/dist/simulation/living/frame.js +223 -0
- package/dist/simulation/living/identifiers.d.ts +2 -0
- package/dist/simulation/living/identifiers.js +12 -0
- package/dist/simulation/living/index.d.ts +15 -0
- package/dist/simulation/living/index.js +15 -0
- package/dist/simulation/living/inference.d.ts +219 -0
- package/dist/simulation/living/inference.js +576 -0
- package/dist/simulation/living/mechanics.d.ts +54 -0
- package/dist/simulation/living/mechanics.js +588 -0
- package/dist/simulation/living/model-input.d.ts +25 -0
- package/dist/simulation/living/model-input.js +215 -0
- package/dist/simulation/living/open-world.d.ts +257 -0
- package/dist/simulation/living/open-world.js +102 -0
- package/dist/simulation/living/projection.d.ts +7 -0
- package/dist/simulation/living/projection.js +31 -0
- package/dist/simulation/living/recall.d.ts +17 -0
- package/dist/simulation/living/recall.js +25 -0
- package/dist/simulation/living/reduce.d.ts +15 -0
- package/dist/simulation/living/reduce.js +1853 -0
- package/dist/simulation/living/replay.d.ts +6 -0
- package/dist/simulation/living/replay.js +22 -0
- package/dist/simulation/living/runtime.d.ts +140 -0
- package/dist/simulation/living/runtime.js +3020 -0
- package/dist/simulation/living/shared-kinds.d.ts +24 -0
- package/dist/simulation/living/shared-kinds.js +96 -0
- package/dist/simulation/living/types.d.ts +2785 -0
- package/dist/simulation/living/types.js +669 -0
- package/dist/simulation/llm.d.ts +3 -1
- package/dist/simulation/llm.js +90 -30
- package/dist/simulation/memory/embedding.d.ts +1 -1
- package/dist/simulation/memory/embedding.js +9 -3
- package/dist/simulation/memory/filesystem.d.ts +2 -0
- package/dist/simulation/memory/filesystem.js +5 -1
- package/dist/simulation/memory/filesystem_file_tree.d.ts +4 -1
- package/dist/simulation/memory/filesystem_file_tree.js +41 -10
- package/dist/simulation/memory/filesystem_invariants.js +1 -2
- package/dist/simulation/memory/filesystem_types.d.ts +1 -0
- package/dist/simulation/memory/memory.d.ts +2 -0
- package/dist/simulation/memory/memory.js +5 -1
- package/dist/simulation/orchestration/intent.js +0 -2
- package/dist/simulation/orchestration/lifecycle.js +0 -2
- package/dist/simulation/plugin_host.d.ts +25 -1
- package/dist/simulation/plugin_host.js +334 -17
- package/dist/simulation/session_documents.d.ts +20 -0
- package/dist/simulation/session_documents.js +62 -0
- package/dist/simulation/session_input_validation.d.ts +43 -0
- package/dist/simulation/session_input_validation.js +364 -0
- package/dist/simulation/session_inputs.d.ts +32 -0
- package/dist/simulation/session_inputs.js +154 -0
- package/dist/simulation/telemetry.d.ts +11 -14
- package/dist/simulation/telemetry.js +177 -54
- package/dist/simulation/toolkit/bounded_turns.d.ts +13 -0
- package/dist/simulation/toolkit/bounded_turns.js +80 -0
- package/dist/simulation/toolkit/dynamic_agents.d.ts +25 -0
- package/dist/simulation/toolkit/dynamic_agents.js +218 -0
- package/dist/simulation/toolkit/dynamic_digest.d.ts +1 -0
- package/dist/simulation/toolkit/dynamic_digest.js +8 -0
- package/dist/simulation/toolkit/dynamic_documents.d.ts +7 -0
- package/dist/simulation/toolkit/dynamic_documents.js +71 -0
- package/dist/simulation/toolkit/dynamic_driver.d.ts +8 -0
- package/dist/simulation/toolkit/dynamic_driver.js +269 -0
- package/dist/simulation/toolkit/dynamic_game.d.ts +53 -0
- package/dist/simulation/toolkit/dynamic_game.js +805 -0
- package/dist/simulation/toolkit/dynamic_knowledge.d.ts +15 -0
- package/dist/simulation/toolkit/dynamic_knowledge.js +91 -0
- package/dist/simulation/toolkit/dynamic_mechanics.d.ts +22 -0
- package/dist/simulation/toolkit/dynamic_mechanics.js +910 -0
- package/dist/simulation/toolkit/dynamic_meetings.d.ts +239 -0
- package/dist/simulation/toolkit/dynamic_meetings.js +350 -0
- package/dist/simulation/toolkit/dynamic_progress.d.ts +131 -0
- package/dist/simulation/toolkit/dynamic_progress.js +214 -0
- package/dist/simulation/toolkit/dynamic_projection.d.ts +9 -0
- package/dist/simulation/toolkit/dynamic_projection.js +219 -0
- package/dist/simulation/toolkit/dynamic_runtime.d.ts +412 -0
- package/dist/simulation/toolkit/dynamic_runtime.js +6536 -0
- package/dist/simulation/toolkit/dynamic_state.d.ts +111 -0
- package/dist/simulation/toolkit/dynamic_state.js +1967 -0
- package/dist/simulation/toolkit/dynamic_story_review.d.ts +508 -0
- package/dist/simulation/toolkit/dynamic_story_review.js +333 -0
- package/dist/simulation/toolkit/dynamic_storyteller.d.ts +77 -0
- package/dist/simulation/toolkit/dynamic_storyteller.js +114 -0
- package/dist/simulation/toolkit/dynamic_storyteller_runtime.d.ts +26 -0
- package/dist/simulation/toolkit/dynamic_storyteller_runtime.js +126 -0
- package/dist/simulation/toolkit/dynamic_world.d.ts +22 -0
- package/dist/simulation/toolkit/dynamic_world.js +377 -0
- package/dist/simulation/toolkit/structured_output.d.ts +5 -0
- package/dist/simulation/toolkit/structured_output.js +321 -0
- package/dist/simulation/types/world.d.ts +2 -0
- package/dist/simulation/world/artifact_store.js +1 -1
- package/dist/simulation/world/memory_manager.d.ts +5 -0
- package/dist/simulation/world/memory_manager.js +17 -2
- package/dist/simulation/world/state.d.ts +3 -2
- package/dist/simulation/world/state.js +15 -5
- package/dist/skills/bundled/measurement-validation/SKILL.md +144 -0
- package/dist/terminal_attach.d.ts +1 -0
- package/dist/terminal_attach.js +113 -0
- package/dist/tool_progress.d.ts +3 -0
- package/dist/tool_progress.js +27 -0
- package/dist/types.d.ts +145 -10
- package/dist/types.js +3 -0
- package/dist/ui/core/input.d.ts +3 -0
- package/dist/ui/core/input_segments.d.ts +18 -1
- package/dist/ui/core/input_segments.js +131 -47
- package/dist/ui/core/input_state.d.ts +12 -0
- package/dist/ui/core/layout_yoga.d.ts +1 -1
- package/dist/ui/core/turn_metadata.d.ts +5 -0
- package/dist/ui/core/turn_metadata.js +22 -0
- package/dist/ui/ink/render.d.ts +2 -1
- package/dist/ui/ink/render.js +6 -5
- package/dist/ui/ratatui/headless_pane_manager.d.ts +14 -1
- package/dist/ui/ratatui/headless_pane_manager.js +293 -104
- package/dist/ui/ratatui/index.d.ts +1 -0
- package/dist/ui/ratatui/input.d.ts +4 -0
- package/dist/ui/ratatui/input.js +15 -0
- package/dist/ui/ratatui/ipc_path.d.ts +2 -0
- package/dist/ui/ratatui/ipc_path.js +29 -1
- package/dist/ui/ratatui/mux_persistence.d.ts +3 -1
- package/dist/ui/ratatui/mux_persistence.js +139 -1
- package/dist/ui/ratatui/pane_relay.d.ts +1 -1
- package/dist/ui/ratatui/pane_relay.js +55 -27
- package/dist/ui/ratatui/process.d.ts +17 -1
- package/dist/ui/ratatui/process.js +80 -7
- package/dist/ui/ratatui/protocol.d.ts +236 -1
- package/dist/ui/ratatui/protocol.js +90 -0
- package/dist/ui/scrollback.d.ts +2 -1
- package/dist/ui/scrollback.js +9 -4
- package/dist/ui/stream_typewriter.d.ts +8 -3
- package/dist/ui/stream_typewriter.js +30 -1
- package/dist/ui/streaming_scrollback.d.ts +1 -0
- package/dist/ui/streaming_scrollback.js +1 -1
- package/dist/ui/transcript_render_cache.js +10 -0
- package/dist/ui/views/activity_line.d.ts +5 -3
- package/dist/ui/views/activity_line.js +65 -7
- package/dist/ui/views/app.d.ts +6 -3
- package/dist/ui/views/app.js +17 -6
- package/dist/ui/views/completion_menu.js +10 -5
- package/dist/ui/views/input_area.d.ts +7 -3
- package/dist/ui/views/input_area.js +15 -9
- package/dist/ui/views/message_list.d.ts +4 -1
- package/dist/ui/views/message_list.js +89 -19
- package/dist/ui/views/queue_panel.d.ts +3 -1
- package/dist/ui/views/queue_panel.js +9 -2
- package/dist/ui/views/status_bar.d.ts +4 -2
- package/dist/ui/views/status_bar.js +28 -13
- package/dist/ui/views/theme.d.ts +2 -0
- package/dist/ui/views/theme.js +2 -0
- package/dist/ui/widgets/color_panel.js +18 -0
- package/dist/ui/widgets/form.js +8 -0
- package/dist/ui/widgets/log_view.js +7 -0
- package/dist/ui/widgets/navigator_panel.js +8 -0
- package/dist/ui/widgets/prompt_viewer.js +2 -0
- package/dist/ui/widgets/questionnaire.d.ts +2 -0
- package/dist/ui/widgets/questionnaire.js +79 -16
- package/dist/ui/widgets/resume_panel.d.ts +2 -0
- package/dist/ui/widgets/resume_panel.js +26 -15
- package/dist/ui/widgets/rewind_panel.d.ts +2 -2
- package/dist/ui/widgets/rewind_panel.js +4 -2
- package/dist/ui/widgets/select.js +16 -27
- package/dist/ui/widgets/settings_panel.js +16 -0
- package/dist/ui/widgets/status_line_panel.d.ts +1 -0
- package/dist/ui/widgets/status_line_panel.js +30 -4
- package/dist/ui/widgets/text_input.d.ts +2 -0
- package/dist/ui/widgets/text_input.js +15 -1
- package/dist/ui/widgets/types.d.ts +2 -0
- package/dist/usage_projection.d.ts +24 -0
- package/dist/usage_projection.js +130 -0
- package/dist/usage_snapshot.d.ts +36 -0
- package/dist/usage_snapshot.js +131 -0
- package/dist/utils/assistant_message.d.ts +2 -0
- package/dist/utils/assistant_message.js +5 -0
- package/dist/utils/atomic_write.d.ts +6 -2
- package/dist/utils/atomic_write.js +29 -4
- package/dist/utils/checked_shell.d.ts +25 -0
- package/dist/utils/checked_shell.js +107 -0
- package/dist/utils/compaction.d.ts +4 -1
- package/dist/utils/compaction.js +31 -7
- package/dist/utils/context.d.ts +4 -4
- package/dist/utils/context.js +14 -12
- package/dist/utils/deepseek.d.ts +2 -2
- package/dist/utils/deepseek.js +13 -5
- package/dist/utils/ephemeral.js +4 -0
- package/dist/utils/ephemeral_tools.d.ts +18 -0
- package/dist/utils/ephemeral_tools.js +97 -0
- package/dist/utils/jev_client.d.ts +4 -0
- package/dist/utils/jev_client.js +15 -0
- package/dist/utils/model_cache.d.ts +15 -0
- package/dist/utils/model_cache.js +143 -0
- package/dist/utils/models.d.ts +4 -2
- package/dist/utils/models.js +12 -16
- package/dist/utils/reasoning.d.ts +8 -1
- package/dist/utils/reasoning.js +31 -11
- package/dist/utils/router_catalog.d.ts +49 -0
- package/dist/utils/router_catalog.js +271 -0
- package/dist/utils/sandbox.d.ts +9 -0
- package/dist/utils/sandbox.js +118 -15
- package/dist/utils/shell.d.ts +7 -0
- package/dist/utils/shell.js +98 -34
- package/dist/utils/subprocess_env.d.ts +3 -0
- package/dist/utils/subprocess_env.js +27 -1
- package/dist/web/accounts_mirror.d.ts +3 -1
- package/dist/web/accounts_mirror.js +13 -9
- package/dist/web/child_publication.d.ts +17 -0
- package/dist/web/child_publication.js +45 -0
- package/dist/web/mirror_authenticator.d.ts +31 -11
- package/dist/web/mirror_authenticator.js +67 -17
- package/dist/web/mirror_client.d.ts +31 -4
- package/dist/web/mirror_client.js +189 -23
- package/dist/web/mirror_stream.d.ts +84 -22
- package/dist/web/mirror_stream.js +676 -95
- package/dist/web/observer_query_redaction.d.ts +6 -0
- package/dist/web/observer_query_redaction.js +58 -0
- package/dist/web/pane_registry.d.ts +2 -0
- package/dist/web/pane_registry.js +86 -22
- package/dist/web/tool_image.d.ts +6 -0
- package/dist/web/tool_image.js +17 -0
- package/dist/web/view_plugin.d.ts +14 -0
- package/dist/web/view_plugin.js +23 -1
- package/dist/worker/executor.js +31 -12
- package/dist/worker/index.d.ts +1 -0
- package/dist/worker/toolsets.js +3 -1
- package/dist/worker/types.d.ts +12 -1
- package/dist/workflows/registry.js +1 -0
- package/dist/workflows/registry_handle.d.ts +2 -0
- package/dist/workflows/runtime.d.ts +2 -0
- package/dist/workflows/runtime.js +1 -0
- package/dist/workspace_agent.d.ts +7 -0
- package/dist/workspace_agent.js +36 -0
- package/dist/workspace_collision.d.ts +76 -0
- package/dist/workspace_collision.js +688 -0
- package/dist/workspace_layout.d.ts +18 -0
- package/dist/workspace_layout.js +121 -0
- package/dist/workspace_runtime.d.ts +44 -0
- package/dist/workspace_runtime.js +82 -0
- package/dist/workspace_session_context.d.ts +62 -0
- package/dist/workspace_session_context.js +160 -0
- package/dist/zlm-embed.mjs +32518 -9615
- package/dist/zlm.js +1 -0
- package/node_modules/@zerg/model-contracts/LICENSE.md +375 -0
- package/node_modules/@zerg/model-contracts/README.md +90 -0
- package/node_modules/@zerg/model-contracts/index.d.ts +20 -0
- package/node_modules/@zerg/model-contracts/index.js +223 -0
- package/node_modules/@zerg/model-contracts/package.json +8 -0
- package/node_modules/glob/node_modules/brace-expansion/index.js +78 -22
- package/node_modules/glob/node_modules/brace-expansion/package.json +1 -1
- package/node_modules/readdir-glob/node_modules/brace-expansion/index.js +78 -22
- package/node_modules/readdir-glob/node_modules/brace-expansion/package.json +1 -1
- package/package.json +45 -24
- package/packages/model-contracts/LICENSE.md +375 -0
- package/packages/model-contracts/README.md +90 -0
- package/packages/model-contracts/index.d.ts +20 -0
- package/packages/model-contracts/index.js +223 -0
- package/packages/model-contracts/package.json +8 -0
- package/remote-broker/Dockerfile +10 -0
- package/remote-broker/README.md +308 -0
- package/remote-broker/archive.py +1227 -0
- package/remote-broker/cutover.py +761 -0
- package/remote-broker/requirements.txt +5 -0
- package/remote-broker/resources.example.json +6 -0
- package/remote-broker/resources.write-staging.example.json +18 -0
- package/remote-broker/retained.py +686 -0
- package/remote-broker/retained_cleanup.py +550 -0
- package/remote-broker/server.py +648 -0
- package/scripts/build-remote-broker.mjs +13 -0
- package/scripts/ensure-local-packages.mjs +6 -0
- package/scripts/node-pty-helpers.mjs +103 -0
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { parseReasoningSelection } from '../../utils/reasoning.js';
|
|
2
|
+
import { resolveRouterModel } from '../../utils/router_catalog.js';
|
|
3
|
+
import { getSupportedCodexReasoningEfforts } from '../../utils/models.js';
|
|
1
4
|
import { resolveExecutionSettings } from '../../config/execution.js';
|
|
2
5
|
import { accountsCommand } from './accounts.js';
|
|
3
6
|
import { authCommand } from './auth.js';
|
|
7
|
+
import { setupCommand } from './setup.js';
|
|
8
|
+
import { activatePermissionConfig } from './permissions.js';
|
|
9
|
+
import { PERMISSION_CAPABILITIES } from '../../config/permissions.js';
|
|
4
10
|
import { activeProfile, builtinProfileEmulation, listConfigProfiles } from '../../config/profiles.js';
|
|
5
11
|
import { switchConfigProfile } from './config_profile_switch.js';
|
|
6
12
|
import { keybindingsCommand } from './keybindings.js';
|
|
7
|
-
import { DEFAULT_CONTEXT_PROGRESS_BAR } from '../../config.js';
|
|
13
|
+
import { DEFAULT_CONTEXT_PROGRESS_BAR, resolveTerminalInteractionSettings } from '../../config.js';
|
|
8
14
|
import { loadRouterCredentials } from '../../router_auth.js';
|
|
9
15
|
import { CODEX_REASONING_EFFORTS } from '../../config/types.js';
|
|
10
16
|
import { customPaneOptions, storedCustomPaneOptions, withCustomPaneOptions, } from '../../config/panes.js';
|
|
@@ -16,13 +22,13 @@ import { applyRuntimeModelSelection, getEffectiveModel } from './runtime_model.j
|
|
|
16
22
|
import { parseGoalTurnCap } from './goal.js';
|
|
17
23
|
import { shutdownAndClearWorkflowRegistry } from '../../workflows/registry_handle.js';
|
|
18
24
|
import { invalidateSkillsCache, preloadSkillsManifest } from '../../skills/registry.js';
|
|
19
|
-
import { MIN_TOOL_OUTPUT_LINES, parseToolOutputLines, resolveMessageDisplaySettings, } from '../../config/message_display.js';
|
|
25
|
+
import { MIN_TOOL_OUTPUT_LINES, parseToolOutputLines, parseProseReadingRate, resolveMessageDisplaySettings, } from '../../config/message_display.js';
|
|
20
26
|
import { DEFAULT_JEV_SETTINGS, MAX_AUTO_COMPACT_THRESHOLD, MAX_COMPACTION_TARGET_PERCENT, MIN_AUTO_COMPACT_THRESHOLD, MIN_COMPACTION_TARGET_PERCENT, MIN_CONTEXT_TOKEN_BUDGET, defaultTokenTrigger, maxCompactionTargetFor, minAutoCompactThresholdFor, parseCompactionTriggerMode, resolveAutoCompactThreshold, resolveCompactionTargetPercent, resolveCompactionTriggerMode, resolveCompactionSettings, resolveContextTokenBudget, tokenTriggerActive, MAX_JEV_KEEP_THRESHOLD, MAX_JEV_STATE_TOKENS, MIN_JEV_KEEP_THRESHOLD, MIN_JEV_PRESERVE_RECENT, MIN_JEV_STATE_TOKENS, parseAutoCompactThreshold, parseCompactionTargetPercent, parseContextTokenBudget, parseJevKeepThreshold, parseJevPreserveRecent, parseJevStateTokens, } from '../../config/compaction.js';
|
|
21
27
|
import { MIN_MAX_ITERATIONS, parseMaxIterations } from '../../config/agent_limits.js';
|
|
22
28
|
import { MAX_SFX_VOLUME, MIN_SFX_VOLUME, parseSfxPack, parseSfxVolume, resolveSfxPack, resolveSfxVolume, } from '../../config/sound.js';
|
|
23
29
|
import { listPacks } from '../../audio/sfx.js';
|
|
24
30
|
import { DEFAULT_SPINNER_VERBS, parseSpinnerVerbs } from '../../utils/spinner_verbs.js';
|
|
25
|
-
import { MIN_API_RETRY_ATTEMPTS, MIN_API_RETRY_BASE_DELAY_MS, MIN_API_RETRY_TIMEOUT_MS, parseApiRetryAttempts, parseApiRetryBaseDelayMs, parseApiRetryTimeoutMs, resolveApiRetrySettings, } from '../../config/api_retry.js';
|
|
31
|
+
import { MIN_API_RETRY_ATTEMPTS, MIN_API_RETRY_BASE_DELAY_MS, MIN_API_RETRY_TIMEOUT_MS, parseApiRetryAttempts, parseApiRetryBaseDelayMs, parseApiRetryMaxDelayMs, parseApiRecoveryWindowMs, parseApiRetryTimeoutMs, resolveApiRetrySettings, } from '../../config/api_retry.js';
|
|
26
32
|
import { STATUS_LINE_ITEMS, compactStatusLineVariants, normalizeStatusLineSeparator, parseStatusLineItems, replaceStatusLineSide, resolveStatusLineSettings, statusLineItemOptions, statusLineSettingsForStorage, } from '../../ui/status_line_config.js';
|
|
27
33
|
import { BAR_COLOR_FIELDS, contextProgressBarConfig, normalizeBarColor, publishContextProgressBar, withBarColor, } from './context_progress_bar.js';
|
|
28
34
|
/**
|
|
@@ -132,6 +138,8 @@ export async function buildSettingsCategories(ctx) {
|
|
|
132
138
|
const routerSignedIn = routerCredentials !== null && Date.parse(routerCredentials.expiresAt) > Date.now();
|
|
133
139
|
const provider = ctx.config.getProvider();
|
|
134
140
|
const model = ctx.config.getModel?.() || config.model;
|
|
141
|
+
const reasoningEfforts = getSupportedCodexReasoningEfforts(model, provider, ctx.config.getReasoningWireSurface?.(provider, model)
|
|
142
|
+
?? (config.authMode === 'zrouter' || provider === 'openai_compatible' ? 'chat_tools' : 'native_api'));
|
|
135
143
|
const claudeCliInstalled = isClaudeCliAvailable();
|
|
136
144
|
const claudeCodeTokenPresent = Boolean(process.env.CLAUDE_CODE_OAUTH_TOKEN?.trim());
|
|
137
145
|
const claudeCodeReady = hasUsableClaudeCodeCliAuth();
|
|
@@ -168,10 +176,30 @@ export async function buildSettingsCategories(ctx) {
|
|
|
168
176
|
modelOptions = models.slice(0, 20).map(m => ({ value: m, label: m }));
|
|
169
177
|
}
|
|
170
178
|
catch { /* fallback: no pre-fetched options, user can type manually */ }
|
|
179
|
+
const routerCatalog = ctx.config.getRoutedModelCatalog?.();
|
|
180
|
+
const routerDescriptor = routerCatalog?.version === 1
|
|
181
|
+
? resolveRouterModel(routerCatalog, provider, model) : undefined;
|
|
182
|
+
if (routerCatalog?.version === 1)
|
|
183
|
+
modelOptions = routerCatalog.models.filter(row => row.owned_by === provider && row.capabilities?.chat)
|
|
184
|
+
.map(row => ({ value: row.id, label: `${row.display_name || row.id}${row.capabilities?.tools === false ? ' (chat only)' : ''}${row.available === false ? ' (access unavailable)' : ''}` }));
|
|
185
|
+
const reasoningChoices = routerCatalog?.version === 1 ? routerDescriptor?.capabilities?.reasoning?.choices ?? []
|
|
186
|
+
: reasoningEfforts ?? CODEX_REASONING_EFFORTS;
|
|
187
|
+
const effortSupported = config.codexEffort === undefined || reasoningChoices.includes(config.codexEffort);
|
|
171
188
|
const sections = [
|
|
172
189
|
{
|
|
173
190
|
name: 'Config Scope',
|
|
174
191
|
settings: [
|
|
192
|
+
{
|
|
193
|
+
name: 'setUpZtc',
|
|
194
|
+
label: 'Set up ZTC',
|
|
195
|
+
value: '/setup',
|
|
196
|
+
type: 'text',
|
|
197
|
+
description: 'Verify the runtime, account and sample workspace with the shared setup action.',
|
|
198
|
+
onActivate: async () => {
|
|
199
|
+
ctx.settingsPanel?.closeSettingsPanel?.();
|
|
200
|
+
await setupCommand.handler([], ctx);
|
|
201
|
+
},
|
|
202
|
+
},
|
|
175
203
|
{
|
|
176
204
|
name: 'configProfile',
|
|
177
205
|
label: 'Active config profile',
|
|
@@ -242,7 +270,8 @@ export async function buildSettingsCategories(ctx) {
|
|
|
242
270
|
// option matches a canonical PROVIDERS value instead of nothing.
|
|
243
271
|
value: normalizeProviderId(provider),
|
|
244
272
|
type: 'select',
|
|
245
|
-
options:
|
|
273
|
+
options: routerCatalog?.version === 1 ? [...new Map(routerCatalog.models.filter(row => row.capabilities?.chat)
|
|
274
|
+
.map(row => [row.owned_by, { value: row.owned_by, label: row.provider_display_name || row.owned_by }])).values()] : PROVIDERS,
|
|
246
275
|
},
|
|
247
276
|
{
|
|
248
277
|
name: 'model',
|
|
@@ -258,13 +287,15 @@ export async function buildSettingsCategories(ctx) {
|
|
|
258
287
|
value: config.maxTokens === undefined ? 'provider default' : String(config.maxTokens),
|
|
259
288
|
type: 'text',
|
|
260
289
|
placeholder: 'provider default',
|
|
261
|
-
description:
|
|
290
|
+
description: `Maximum output tokens, including reasoning tokens. ${routerDescriptor?.capabilities?.max_output_tokens ? `Router limit: ${routerDescriptor.capabilities.max_output_tokens.toLocaleString()}. ` : ''}Enter a positive whole number, or "provider default" to clear the limit.`,
|
|
262
291
|
},
|
|
263
292
|
{
|
|
264
293
|
name: 'codexEffort', label: 'Default reasoning effort',
|
|
265
|
-
value: config.codexEffort ?? 'provider default', type: 'select',
|
|
266
|
-
options: [{ value: 'provider default', label: 'provider default' }, ...
|
|
267
|
-
description:
|
|
294
|
+
value: effortSupported ? config.codexEffort ?? 'provider default' : 'provider default', type: 'select',
|
|
295
|
+
options: [{ value: 'provider default', label: 'provider default' }, ...reasoningChoices.map(level => ({ value: level, label: level }))],
|
|
296
|
+
description: reasoningChoices.length === 0
|
|
297
|
+
? `This model takes no reasoning-effort setting (${provider} · ${model}).`
|
|
298
|
+
: `Levels supported by ${provider} · ${model}. Model and provider overrides take precedence.`,
|
|
268
299
|
},
|
|
269
300
|
{
|
|
270
301
|
name: 'codexFastMode', label: 'Fast mode', value: String(config.codexFastMode === true), type: 'select',
|
|
@@ -536,7 +567,7 @@ export async function buildSettingsCategories(ctx) {
|
|
|
536
567
|
// provider's health, not a choice between five presets.
|
|
537
568
|
type: 'text',
|
|
538
569
|
placeholder: '3',
|
|
539
|
-
description: '
|
|
570
|
+
description: 'Attempts before sustained recovery. 1 disables Agent-level retries and recovery; backend reconnect policies are separate. Any whole number of at least 1.',
|
|
540
571
|
},
|
|
541
572
|
{
|
|
542
573
|
name: 'apiRetryBaseDelay',
|
|
@@ -544,7 +575,18 @@ export async function buildSettingsCategories(ctx) {
|
|
|
544
575
|
value: String(apiRetry.baseDelayMs),
|
|
545
576
|
type: 'text',
|
|
546
577
|
placeholder: '2000',
|
|
547
|
-
description: '
|
|
578
|
+
description: 'Exponential wait base in milliseconds. Waits use jitter and the maximum delay below. Any whole number from 0.',
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
name: 'apiRetryMaxDelay', label: 'Maximum retry wait', value: String(apiRetry.maxDelayMs),
|
|
582
|
+
type: 'text', placeholder: '30000',
|
|
583
|
+
description: 'Caps each retry wait in milliseconds. Any whole number of at least 1.',
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
name: 'apiRetryRecoveryWindow', label: 'Endpoint recovery window',
|
|
587
|
+
value: apiRetry.recoveryWindowMs === null ? 'continuous' : String(apiRetry.recoveryWindowMs),
|
|
588
|
+
type: 'text', placeholder: 'continuous',
|
|
589
|
+
description: 'After the initial attempts, retain the task until cancellation (continuous), for this many milliseconds, or stop at the initial limit (0).',
|
|
548
590
|
},
|
|
549
591
|
{
|
|
550
592
|
name: 'apiRetryTimeout',
|
|
@@ -559,6 +601,16 @@ export async function buildSettingsCategories(ctx) {
|
|
|
559
601
|
{
|
|
560
602
|
name: 'Verbosity',
|
|
561
603
|
settings: [
|
|
604
|
+
{
|
|
605
|
+
name: 'showTurnMetadata',
|
|
606
|
+
label: 'Turn time and tokens',
|
|
607
|
+
value: String(messageDisplay.showTurnMetadata),
|
|
608
|
+
type: 'select',
|
|
609
|
+
options: [
|
|
610
|
+
{ value: 'true', label: 'shown', description: 'Show elapsed time and model usage beside assistant timestamps' },
|
|
611
|
+
{ value: 'false', label: 'hidden', description: 'Keep message headers to role and timestamp' },
|
|
612
|
+
],
|
|
613
|
+
},
|
|
562
614
|
{
|
|
563
615
|
name: 'showThinking',
|
|
564
616
|
label: 'Show thinking prompts',
|
|
@@ -603,10 +655,19 @@ export async function buildSettingsCategories(ctx) {
|
|
|
603
655
|
value: String(messageDisplay.smoothStreaming),
|
|
604
656
|
type: 'select',
|
|
605
657
|
options: [
|
|
606
|
-
{ value: 'true', label: 'smooth', description: '
|
|
607
|
-
{ value: 'false', label: 'instant', description: 'Show every arrival the
|
|
658
|
+
{ value: 'true', label: 'smooth', description: 'Use bounded-lag smoothing when the prose reading cap is off' },
|
|
659
|
+
{ value: 'false', label: 'instant', description: 'Show every arrival immediately when the prose reading cap is off' },
|
|
608
660
|
],
|
|
609
661
|
},
|
|
662
|
+
{
|
|
663
|
+
name: 'proseReadingRateWordsPerSecond',
|
|
664
|
+
label: 'Prose reading rate',
|
|
665
|
+
value: messageDisplay.proseReadingRateWordsPerSecond === null
|
|
666
|
+
? 'off' : String(messageDisplay.proseReadingRateWordsPerSecond),
|
|
667
|
+
type: 'text',
|
|
668
|
+
placeholder: '9',
|
|
669
|
+
description: 'Assistant prose words per second. Any positive finite rate, or "off" for bounded-lag streaming. Reasoning, tools, and messages containing fenced code are uncapped.',
|
|
670
|
+
},
|
|
610
671
|
],
|
|
611
672
|
},
|
|
612
673
|
{
|
|
@@ -719,6 +780,8 @@ export async function buildSettingsCategories(ctx) {
|
|
|
719
780
|
settings: [
|
|
720
781
|
{ name: 'uiTheme', label: 'Theme', value: config.uiTheme ?? 'ztc-dark', type: 'text', description: 'Terminal theme name. Use /theme list for built-in choices.' },
|
|
721
782
|
{ name: 'rawScrollback', label: 'Raw scrollback', value: String(config.rawScrollback === true), type: 'select', options: [{ value: 'true', label: 'on' }, { value: 'false', label: 'off' }] },
|
|
783
|
+
{ name: 'mouseCapture', label: 'Mouse capture', value: String(resolveTerminalInteractionSettings(config.terminalInteraction).mouseCapture), type: 'select', options: [{ value: 'true', label: 'on' }, { value: 'false', label: 'off' }], description: 'Requires a compatible renderer; otherwise saved for next launch.' },
|
|
784
|
+
{ name: 'wheelScrollLines', label: 'Wheel scroll lines', value: String(resolveTerminalInteractionSettings(config.terminalInteraction).wheelScrollLines), type: 'text', description: 'Compatible renderer required. Lines per wheel: 1–20 (default 3).' },
|
|
722
785
|
{ name: 'keybindings', label: 'Keybindings', value: `${Object.keys(config.keybindings?.zmux ?? {}).length} overrides`, type: 'text', description: 'Enter to edit shortcuts.', onActivate: () => { void keybindingsCommand.handler([], ctx); } },
|
|
723
786
|
{
|
|
724
787
|
name: 'panesCustomOptions',
|
|
@@ -889,7 +952,7 @@ export async function buildSettingsCategories(ctx) {
|
|
|
889
952
|
group('Accounts', 'Config Scope', 'Accounts'),
|
|
890
953
|
group('Provider & Model', 'Provider & Model', 'Claude Code'),
|
|
891
954
|
group('Auth & Routing', 'Auth & Routing', 'API Keys', 'Custom Endpoint'),
|
|
892
|
-
group('Behavior', 'Behavior', 'Retries & Timeouts', 'Automation'),
|
|
955
|
+
group('Behavior', 'Behavior', 'Retries & Timeouts', 'Automation', 'Execution'),
|
|
893
956
|
group('Context Compaction', 'Context Compaction', 'Context Storage'),
|
|
894
957
|
group('Tools & Security', 'Tool Access'),
|
|
895
958
|
group('Verbosity', 'Verbosity', 'Panes'),
|
|
@@ -1048,16 +1111,20 @@ function applySettingChange(ctx, setting, value) {
|
|
|
1048
1111
|
ctx.config.set('execution', next);
|
|
1049
1112
|
return;
|
|
1050
1113
|
}
|
|
1051
|
-
if (setting.startsWith('toolPermission_')) {
|
|
1052
|
-
const capability = setting.slice('toolPermission_'.length);
|
|
1053
|
-
if (!['file_read', 'file_write', 'shell_exec', 'network', 'screen_capture', 'computer_control', 'ml_inference'].includes(capability)) {
|
|
1054
|
-
throw new Error(`Unknown tool permission: ${capability}`);
|
|
1055
|
-
}
|
|
1056
|
-
ctx.config.set('toolPermissions', { ...ctx.config.get().toolPermissions, [capability]: value === 'true' });
|
|
1057
|
-
return;
|
|
1058
|
-
}
|
|
1059
1114
|
switch (setting) {
|
|
1060
1115
|
case 'provider':
|
|
1116
|
+
{
|
|
1117
|
+
const catalog = ctx.config.getRoutedModelCatalog?.();
|
|
1118
|
+
if (catalog?.version === 1) {
|
|
1119
|
+
const rows = catalog.models.filter(row => row.owned_by === value && row.capabilities?.chat);
|
|
1120
|
+
const selected = rows.find(row => row.is_default) ?? rows[0];
|
|
1121
|
+
if (!selected)
|
|
1122
|
+
throw new Error('Provider is not in the Router chat catalog.');
|
|
1123
|
+
ctx.config.setProvider(value);
|
|
1124
|
+
ctx.config.set('model', selected.id);
|
|
1125
|
+
break;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1061
1128
|
ctx.config.setProvider(value);
|
|
1062
1129
|
{
|
|
1063
1130
|
const resetModel = resolveModelForProviderChange(value, getEffectiveModel(ctx));
|
|
@@ -1082,10 +1149,19 @@ function applySettingChange(ctx, setting, value) {
|
|
|
1082
1149
|
break;
|
|
1083
1150
|
}
|
|
1084
1151
|
case 'codexEffort':
|
|
1085
|
-
|
|
1152
|
+
const catalog = ctx.config.getRoutedModelCatalog?.();
|
|
1153
|
+
const choices = catalog?.version === 1 ? resolveRouterModel(catalog, ctx.config.getProvider(), getEffectiveModel(ctx))?.capabilities?.reasoning?.choices ?? [] : CODEX_REASONING_EFFORTS;
|
|
1154
|
+
if (value !== 'provider default' && !choices.includes(value)) {
|
|
1086
1155
|
throw new Error(`Unknown reasoning effort: ${value}`);
|
|
1087
1156
|
}
|
|
1088
|
-
ctx.config.
|
|
1157
|
+
const activeConfig = ctx.config.get();
|
|
1158
|
+
const activeProvider = ctx.config.getProvider();
|
|
1159
|
+
const activeModel = ctx.config.getModel?.() || activeConfig.model;
|
|
1160
|
+
const selectedEffort = parseReasoningSelection(activeProvider, activeModel, undefined, { effort: value === 'provider default' ? 'default' : value }, catalog?.version === 1
|
|
1161
|
+
? resolveRouterModel(catalog, activeProvider, activeModel)?.capabilities?.reasoning?.choices ?? []
|
|
1162
|
+
: ctx.config.getReasoningWireSurface?.(activeProvider, activeModel)
|
|
1163
|
+
?? (activeConfig.authMode === 'zrouter' || activeProvider === 'openai_compatible' ? 'chat_tools' : 'native_api'));
|
|
1164
|
+
ctx.config.set('codexEffort', selectedEffort ?? undefined);
|
|
1089
1165
|
break;
|
|
1090
1166
|
case 'codexFastMode':
|
|
1091
1167
|
ctx.config.set('codexFastMode', value === 'true');
|
|
@@ -1296,6 +1372,20 @@ function applySettingChange(ctx, setting, value) {
|
|
|
1296
1372
|
ctx.config.set('apiRetry', { ...(ctx.config.get().apiRetry ?? {}), requestTimeoutMs });
|
|
1297
1373
|
break;
|
|
1298
1374
|
}
|
|
1375
|
+
case 'apiRetryMaxDelay': {
|
|
1376
|
+
const maxDelayMs = parseApiRetryMaxDelayMs(value);
|
|
1377
|
+
if (maxDelayMs === null)
|
|
1378
|
+
throw new Error('Maximum retry wait must be a whole number of milliseconds of at least 1.');
|
|
1379
|
+
ctx.config.set('apiRetry', { ...(ctx.config.get().apiRetry ?? {}), maxDelayMs });
|
|
1380
|
+
break;
|
|
1381
|
+
}
|
|
1382
|
+
case 'apiRetryRecoveryWindow': {
|
|
1383
|
+
const recoveryWindowMs = parseApiRecoveryWindowMs(value);
|
|
1384
|
+
if (recoveryWindowMs === undefined)
|
|
1385
|
+
throw new Error('Recovery window must be continuous or a whole number of milliseconds of at least 0.');
|
|
1386
|
+
ctx.config.set('apiRetry', { ...(ctx.config.get().apiRetry ?? {}), recoveryWindowMs });
|
|
1387
|
+
break;
|
|
1388
|
+
}
|
|
1299
1389
|
case 'compactionMethod':
|
|
1300
1390
|
ctx.config.set('compaction', {
|
|
1301
1391
|
...resolveCompactionSettings(ctx.config.get()),
|
|
@@ -1366,6 +1456,12 @@ function applySettingChange(ctx, setting, value) {
|
|
|
1366
1456
|
groupToolCalls: value === 'true',
|
|
1367
1457
|
});
|
|
1368
1458
|
break;
|
|
1459
|
+
case 'showTurnMetadata':
|
|
1460
|
+
ctx.config.set('messageDisplay', {
|
|
1461
|
+
...resolveMessageDisplaySettings(ctx.config.get()),
|
|
1462
|
+
showTurnMetadata: value === 'true',
|
|
1463
|
+
});
|
|
1464
|
+
break;
|
|
1369
1465
|
case 'showThinking':
|
|
1370
1466
|
ctx.config.set('messageDisplay', {
|
|
1371
1467
|
...resolveMessageDisplaySettings(ctx.config.get()),
|
|
@@ -1378,6 +1474,16 @@ function applySettingChange(ctx, setting, value) {
|
|
|
1378
1474
|
smoothStreaming: value === 'true',
|
|
1379
1475
|
});
|
|
1380
1476
|
break;
|
|
1477
|
+
case 'proseReadingRateWordsPerSecond': {
|
|
1478
|
+
const rate = parseProseReadingRate(value);
|
|
1479
|
+
if (rate === undefined)
|
|
1480
|
+
throw new Error('Prose reading rate must be positive finite words per second, or "off".');
|
|
1481
|
+
ctx.config.set('messageDisplay', {
|
|
1482
|
+
...resolveMessageDisplaySettings(ctx.config.get()),
|
|
1483
|
+
proseReadingRateWordsPerSecond: rate,
|
|
1484
|
+
});
|
|
1485
|
+
break;
|
|
1486
|
+
}
|
|
1381
1487
|
case 'statusLineEnabled':
|
|
1382
1488
|
ctx.config.set('statusLine', statusLineSettingsForStorage({
|
|
1383
1489
|
...resolveStatusLineSettings(ctx.config.get().statusLine),
|
|
@@ -1430,22 +1536,6 @@ function applySettingChange(ctx, setting, value) {
|
|
|
1430
1536
|
case 'mcpStatus':
|
|
1431
1537
|
// Read-only informational setting.
|
|
1432
1538
|
break;
|
|
1433
|
-
case 'permissionProfile':
|
|
1434
|
-
if (!ctx.config.get().permissionProfiles?.[value])
|
|
1435
|
-
throw new Error(`Unknown permission profile: ${value}`);
|
|
1436
|
-
ctx.config.set('permissionProfile', value);
|
|
1437
|
-
break;
|
|
1438
|
-
case 'sandboxEnabled':
|
|
1439
|
-
ctx.config.set('sandbox', { ...ctx.config.get().sandbox, enabled: value === 'true' });
|
|
1440
|
-
break;
|
|
1441
|
-
case 'sandboxBackend':
|
|
1442
|
-
if (!['auto', 'none', 'seatbelt', 'bubblewrap', 'windows-job'].includes(value))
|
|
1443
|
-
throw new Error(`Unknown sandbox backend: ${value}`);
|
|
1444
|
-
ctx.config.set('sandbox', { ...ctx.config.get().sandbox, backend: value });
|
|
1445
|
-
break;
|
|
1446
|
-
case 'sandboxRequireOsEnforcement':
|
|
1447
|
-
ctx.config.set('sandbox', { ...ctx.config.get().sandbox, requireOsEnforcement: value === 'true' });
|
|
1448
|
-
break;
|
|
1449
1539
|
case 'sandboxAuditDir':
|
|
1450
1540
|
ctx.config.set('sandbox', { ...ctx.config.get().sandbox, auditDir: value.trim() || undefined });
|
|
1451
1541
|
break;
|
|
@@ -1570,6 +1660,19 @@ function applySettingChange(ctx, setting, value) {
|
|
|
1570
1660
|
case 'rawScrollback':
|
|
1571
1661
|
ctx.config.set('rawScrollback', value === 'true');
|
|
1572
1662
|
break;
|
|
1663
|
+
case 'mouseCapture':
|
|
1664
|
+
if (value !== 'true' && value !== 'false')
|
|
1665
|
+
throw new Error('Mouse capture must be true or false.');
|
|
1666
|
+
ctx.config.set('terminalInteraction', { ...resolveTerminalInteractionSettings(ctx.config.get().terminalInteraction), mouseCapture: value === 'true' });
|
|
1667
|
+
break;
|
|
1668
|
+
case 'wheelScrollLines': {
|
|
1669
|
+
const lines = Number(value.trim());
|
|
1670
|
+
if (!value.trim() || !Number.isInteger(lines) || lines < 1 || lines > 20) {
|
|
1671
|
+
throw new Error('Wheel scroll lines must be a whole number from 1 to 20.');
|
|
1672
|
+
}
|
|
1673
|
+
ctx.config.set('terminalInteraction', { ...resolveTerminalInteractionSettings(ctx.config.get().terminalInteraction), wheelScrollLines: lines });
|
|
1674
|
+
break;
|
|
1675
|
+
}
|
|
1573
1676
|
case 'manifestsDir':
|
|
1574
1677
|
ctx.config.set('manifestsDir', value.trim() || undefined);
|
|
1575
1678
|
break;
|
|
@@ -1679,10 +1782,12 @@ function applySettingChange(ctx, setting, value) {
|
|
|
1679
1782
|
*/
|
|
1680
1783
|
const LIVE_READ_SETTINGS = new Set([
|
|
1681
1784
|
'toolOutputLines',
|
|
1785
|
+
'showTurnMetadata',
|
|
1682
1786
|
'collapseToolCalls',
|
|
1683
1787
|
'groupToolCalls',
|
|
1684
1788
|
'showThinking',
|
|
1685
1789
|
'smoothStreaming',
|
|
1790
|
+
'proseReadingRateWordsPerSecond',
|
|
1686
1791
|
'statusLineEnabled',
|
|
1687
1792
|
'statusLineLeft',
|
|
1688
1793
|
'statusLineRight',
|
|
@@ -1702,6 +1807,8 @@ const LIVE_READ_SETTINGS = new Set([
|
|
|
1702
1807
|
'sfxVolume',
|
|
1703
1808
|
'sfxPack',
|
|
1704
1809
|
'configScope',
|
|
1810
|
+
'mouseCapture',
|
|
1811
|
+
'wheelScrollLines',
|
|
1705
1812
|
]);
|
|
1706
1813
|
/**
|
|
1707
1814
|
* Re-read the rows whose displayed value is not simply what was picked.
|
|
@@ -1771,6 +1878,36 @@ export const settingsCommand = {
|
|
|
1771
1878
|
? 'verbosity'
|
|
1772
1879
|
: sub;
|
|
1773
1880
|
const onSettingChange = async (setting, value) => {
|
|
1881
|
+
if (setting === 'permissionProfile' || setting.startsWith('toolPermission_')
|
|
1882
|
+
|| ['sandboxEnabled', 'sandboxBackend', 'sandboxRequireOsEnforcement'].includes(setting)) {
|
|
1883
|
+
const config = ctx.config.get();
|
|
1884
|
+
let next;
|
|
1885
|
+
if (setting === 'permissionProfile')
|
|
1886
|
+
next = { ...config, permissionProfile: value };
|
|
1887
|
+
else if (setting.startsWith('toolPermission_')) {
|
|
1888
|
+
const cap = setting.slice('toolPermission_'.length);
|
|
1889
|
+
if (!PERMISSION_CAPABILITIES.includes(cap) || !['true', 'false'].includes(value))
|
|
1890
|
+
throw new Error('Invalid tool permission');
|
|
1891
|
+
next = { ...config, toolPermissions: { ...config.toolPermissions, [cap]: value === 'true' } };
|
|
1892
|
+
}
|
|
1893
|
+
else {
|
|
1894
|
+
if (setting === 'sandboxBackend') {
|
|
1895
|
+
if (!['auto', 'none', 'seatbelt', 'bubblewrap', 'windows-job'].includes(value))
|
|
1896
|
+
throw new Error(`Unknown sandbox backend: ${value}`);
|
|
1897
|
+
next = { ...config, sandbox: { ...config.sandbox, backend: value } };
|
|
1898
|
+
}
|
|
1899
|
+
else {
|
|
1900
|
+
if (!['true', 'false'].includes(value))
|
|
1901
|
+
throw new Error('Invalid sandbox toggle');
|
|
1902
|
+
const key = setting === 'sandboxEnabled' ? 'enabled' : 'requireOsEnforcement';
|
|
1903
|
+
next = { ...config, sandbox: { ...config.sandbox, [key]: value === 'true' } };
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
const notice = await activatePermissionConfig(next, ctx);
|
|
1907
|
+
await refreshAllRowDisplays(categories, ctx);
|
|
1908
|
+
ctx.addMessage({ role: 'system', content: notice });
|
|
1909
|
+
return;
|
|
1910
|
+
}
|
|
1774
1911
|
if (setting === 'workflowsEnabled' && value === 'false') {
|
|
1775
1912
|
await shutdownAndClearWorkflowRegistry(5000);
|
|
1776
1913
|
}
|
|
@@ -1801,6 +1938,15 @@ export const settingsCommand = {
|
|
|
1801
1938
|
else if (setting !== 'clearSessionConfig' && !LIVE_READ_SETTINGS.has(setting)) {
|
|
1802
1939
|
ctx.reloadAgent();
|
|
1803
1940
|
}
|
|
1941
|
+
if (setting === 'mouseCapture' || setting === 'wheelScrollLines') {
|
|
1942
|
+
const applied = ctx.zmux?.setTerminalInteraction?.(resolveTerminalInteractionSettings(ctx.config.get().terminalInteraction)) === true;
|
|
1943
|
+
if (!applied)
|
|
1944
|
+
ctx.addMessage({
|
|
1945
|
+
role: 'system',
|
|
1946
|
+
content: 'Terminal interaction saved for the next compatible native renderer launch; not applied to this renderer.',
|
|
1947
|
+
metadata: { ephemeral: true },
|
|
1948
|
+
});
|
|
1949
|
+
}
|
|
1804
1950
|
};
|
|
1805
1951
|
/**
|
|
1806
1952
|
* One entry point for the settings surface, so the color picker can hand the
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { completeSetup, formatSetupReport } from '../../onboarding/setup.js';
|
|
2
|
+
let activeSetup = null;
|
|
3
|
+
async function startSetup(ctx, checkAgent) {
|
|
4
|
+
if (activeSetup) {
|
|
5
|
+
ctx.addMessage({ role: 'system', content: 'Setup is already running. Use /setup cancel to stop it.' });
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
if (ctx.getMode?.() === 'plan') {
|
|
9
|
+
ctx.addMessage({ role: 'system', content: 'Setup can install tools and create a sample workspace. Use /exit-mode to leave Plan mode, then run /setup.' });
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const abort = new AbortController();
|
|
13
|
+
activeSetup = abort;
|
|
14
|
+
try {
|
|
15
|
+
const options = {
|
|
16
|
+
checkAgent, config: ctx.config, cwd: ctx.shell.getCwd(), signal: abort.signal,
|
|
17
|
+
onProgress: (content) => ctx.addMessage({ role: 'system', content }),
|
|
18
|
+
};
|
|
19
|
+
ctx.addMessage({ role: 'system', content: 'Setting up ZTC. Use /setup cancel to stop; completed steps can be resumed.' });
|
|
20
|
+
const report = await completeSetup(options);
|
|
21
|
+
ctx.addMessage({ role: 'system', content: formatSetupReport(report) });
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
ctx.addMessage({ role: 'system', content: abort.signal.aborted
|
|
25
|
+
? 'ZTC setup cancelled. Completed steps were preserved; run /setup to resume.'
|
|
26
|
+
: 'ZTC setup could not complete. Check /doctor and the previous setup checks, then run /setup again.' });
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
if (activeSetup === abort)
|
|
30
|
+
activeSetup = null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export const setupCommand = {
|
|
34
|
+
name: 'setup',
|
|
35
|
+
description: 'Set up and verify the environment, account and sample workspace',
|
|
36
|
+
usage: '[--check-agent|cancel]',
|
|
37
|
+
agentRunnable: false,
|
|
38
|
+
handler: (args, ctx) => {
|
|
39
|
+
if (ctx.commandOrigin === 'agent') {
|
|
40
|
+
ctx.addMessage({ role: 'system', content: 'Setup requires the user to type /setup and confirm its primary action.' });
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (args.length === 1 && args[0] === 'cancel') {
|
|
44
|
+
activeSetup?.abort();
|
|
45
|
+
ctx.addMessage({ role: 'system', content: activeSetup ? 'Stopping setup…' : 'No setup is running. Use Esc to close an unconfirmed setup prompt.' });
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const checkAgent = args.length === 1 && args[0] === '--check-agent';
|
|
49
|
+
if (args.length && !checkAgent) {
|
|
50
|
+
ctx.addMessage({ role: 'system', content: 'Usage: /setup [--check-agent|cancel]' });
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (activeSetup) {
|
|
54
|
+
ctx.addMessage({ role: 'system', content: 'Setup is already running. Use /setup cancel to stop it.' });
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
ctx.addMessage({ role: 'system', content: 'Setup verifies Node, shell, GitHub auth and common tools; installs missing Git/ripgrep through a supported package manager; preserves current account/model defaults; creates a reusable sample; and checks shell health without spending model quota.' + (checkAgent ? ' You also requested one isolated model health request (at most 64 output tokens); it may use paid quota.' : '') });
|
|
58
|
+
let submitted = false;
|
|
59
|
+
const confirm = async (input) => {
|
|
60
|
+
if (submitted)
|
|
61
|
+
return;
|
|
62
|
+
submitted = true;
|
|
63
|
+
if (input === null)
|
|
64
|
+
return;
|
|
65
|
+
if (input.trim()) {
|
|
66
|
+
ctx.addMessage({ role: 'system', content: 'Setup was not started. Run /setup and press Enter to use its primary action, or Esc to cancel.' });
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
await startSetup(ctx, checkAgent);
|
|
70
|
+
};
|
|
71
|
+
if (ctx.prompt.showPrompt) {
|
|
72
|
+
ctx.prompt.showPrompt({ title: 'Set up ZTC', question: checkAgent ? 'Enter to set up and use model quota · Esc to cancel' : 'Enter to set up without model quota · Esc to cancel' }, confirm);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
ctx.prompt.prompt(checkAgent ? 'Set up ZTC — Enter to set up and use model quota · Esc to cancel' : 'Set up ZTC — Enter to set up without model quota · Esc to cancel', confirm, { allowEmptySubmit: true });
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const USAGE = '/share [create [label] [--ttl seconds]|list|revoke <ID|all>|owner]';
|
|
2
|
+
export const shareCommand = {
|
|
3
|
+
name: 'share',
|
|
4
|
+
description: 'Create, inspect or revoke read-only browser access to this session',
|
|
5
|
+
usage: USAGE,
|
|
6
|
+
handler: async (args, ctx) => {
|
|
7
|
+
const say = (content) => ctx.addMessage({ role: 'system', content });
|
|
8
|
+
if (ctx.commandOrigin === 'agent') {
|
|
9
|
+
say('Only you can manage terminal sharing.');
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const action = args[0] ?? 'list';
|
|
13
|
+
try {
|
|
14
|
+
const mirror = ctx.mirror;
|
|
15
|
+
if (!mirror?.sharing)
|
|
16
|
+
throw new Error('Session sharing requires the native ZTC mirror.');
|
|
17
|
+
if (!mirror.isRunning())
|
|
18
|
+
throw new Error('Start the mirror with /mirror start first.');
|
|
19
|
+
if (action === 'create') {
|
|
20
|
+
const labelParts = [];
|
|
21
|
+
let ttl = 3600;
|
|
22
|
+
let ttlSeen = false;
|
|
23
|
+
for (let i = 1; i < args.length; i++) {
|
|
24
|
+
if (args[i] === '--ttl') {
|
|
25
|
+
if (ttlSeen || !/^\d+$/.test(args[i + 1] ?? ''))
|
|
26
|
+
throw new Error('TTL must be an integer from 1 to 43200 seconds.');
|
|
27
|
+
ttlSeen = true;
|
|
28
|
+
ttl = Number(args[++i]);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
if (args[i].startsWith('--'))
|
|
32
|
+
throw new Error(`Unknown sharing option: ${args[i]}`);
|
|
33
|
+
labelParts.push(args[i]);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (!Number.isSafeInteger(ttl) || ttl < 1 || ttl > 43200)
|
|
37
|
+
throw new Error('TTL must be an integer from 1 to 43200 seconds.');
|
|
38
|
+
const share = mirror.sharing.create(labelParts.join(' ') || 'Observer', ttl);
|
|
39
|
+
say(`Read-only share created: ${share.label}\nID: ${share.id}\nExpires: ${new Date(share.expiresAtMs).toISOString()}\n${share.url}\nThis link shows terminal activity and output. It cannot control the session.\nRemote viewers need an authenticated SSH tunnel to this loopback mirror. Revoke: /share revoke ${share.id}\nExisting browser controllers may need /share owner after sharing enables authentication.`);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (action === 'list' && args.length <= 1) {
|
|
43
|
+
const shares = mirror.sharing.list();
|
|
44
|
+
say(shares.length === 0 ? 'No observation shares.' : ['Observation shares:', ...shares.map(share => `${share.id} · ${share.label} · ${share.revoked ? 'revoked' : share.expiresAtMs <= Date.now() ? 'expired' : 'active'} · ${new Date(share.expiresAtMs).toISOString()}`)].join('\n'));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (action === 'revoke' && args.length === 2) {
|
|
48
|
+
const ids = args[1] === 'all' ? mirror.sharing.list().filter(share => !share.revoked).map(share => share.id) : [args[1]];
|
|
49
|
+
const count = ids.filter(id => mirror.sharing.revoke(id)).length;
|
|
50
|
+
say(count ? `Revoked ${count} observation share${count === 1 ? '' : 's'}. The terminal session keeps running.` : 'No active observation share matches that ID.');
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (action === 'owner' && args.length === 1) {
|
|
54
|
+
await mirror.open();
|
|
55
|
+
say('Opened your controller view. Keep its credential private.');
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
throw new Error(USAGE);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
say(`Sharing: ${error instanceof Error ? error.message : String(error)}`);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
};
|
|
@@ -8,9 +8,10 @@ import { isLocalSubscription } from './provider_choices.js';
|
|
|
8
8
|
export const statusCommand = {
|
|
9
9
|
name: 'status',
|
|
10
10
|
description: 'Show current status',
|
|
11
|
+
usage: '/status [--verbose]',
|
|
11
12
|
agentRunnable: true,
|
|
12
13
|
category: 'core',
|
|
13
|
-
handler: (
|
|
14
|
+
handler: (args, ctx) => {
|
|
14
15
|
const isAuthenticated = ctx.config.isAuthenticated?.() ?? false;
|
|
15
16
|
const config = ctx.config.get();
|
|
16
17
|
const provider = ctx.config.getProvider();
|
|
@@ -46,11 +47,22 @@ export const statusCommand = {
|
|
|
46
47
|
routeError = error instanceof Error ? error.message : String(error);
|
|
47
48
|
}
|
|
48
49
|
const execution = ctx.getExecutionContext?.();
|
|
50
|
+
const environment = ctx.getEnvironment?.();
|
|
51
|
+
const executionLines = !execution ? [] : args.includes('--verbose')
|
|
52
|
+
? [describeExecutionContext(execution)]
|
|
53
|
+
: [
|
|
54
|
+
` Mode: ${execution.mode}`,
|
|
55
|
+
` Working directory: ${execution.cwd}`,
|
|
56
|
+
` Output cap: ${execution.maxTokens ?? 'provider default'}`,
|
|
57
|
+
` Tools: ${execution.tools.length} registered; mux ${execution.mux ? 'connected' : 'off'}`,
|
|
58
|
+
' Full execution details: /status --verbose',
|
|
59
|
+
];
|
|
49
60
|
ctx.addMessage({
|
|
50
61
|
role: 'system',
|
|
51
62
|
content: [
|
|
52
63
|
'Status:',
|
|
53
|
-
...(
|
|
64
|
+
...(environment ? [` Environment: ${environment.name} (${environment.status}); /environment status`] : []),
|
|
65
|
+
...executionLines,
|
|
54
66
|
` API Key: ${hasKey ? '✓ configured' : '✗ not set (use /config key <key>)'}`,
|
|
55
67
|
` Platform Auth: ${isAuthenticated ? '✓ configured' : '✗ not set'}`,
|
|
56
68
|
` Provider: ${provider}`,
|