@zergai/ztc 0.5.0-beta.1 → 0.6.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 +65 -46
- package/THIRD_PARTY_NOTICES.md +7 -2
- 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/zterm-darwin-arm64 +0 -0
- package/dist/App.js +26 -9
- package/dist/agent/agent.d.ts +77 -0
- package/dist/agent/agent.js +618 -94
- package/dist/agent/backends/account_login.js +3 -1
- package/dist/agent/backends/anthropic.js +4 -3
- package/dist/agent/backends/bedrock.d.ts +20 -0
- package/dist/agent/backends/bedrock.js +175 -0
- package/dist/agent/backends/claude_cli.js +8 -0
- package/dist/agent/backends/codex_app_server.js +2 -0
- package/dist/agent/backends/codex_auth.d.ts +5 -2
- package/dist/agent/backends/codex_auth.js +131 -31
- package/dist/agent/backends/gemini.js +1 -1
- package/dist/agent/backends/http_error.d.ts +2 -0
- package/dist/agent/backends/http_error.js +4 -0
- package/dist/agent/backends/index.d.ts +3 -0
- package/dist/agent/backends/index.js +16 -0
- package/dist/agent/backends/model_pool.d.ts +20 -0
- package/dist/agent/backends/model_pool.js +98 -0
- package/dist/agent/backends/openai.js +2 -0
- package/dist/agent/backends/openai_compatible.js +8 -3
- package/dist/agent/backends/openai_responses.d.ts +14 -3
- package/dist/agent/backends/openai_responses.js +91 -26
- package/dist/agent/backends/responses_reasoning.d.ts +5 -0
- package/dist/agent/backends/responses_reasoning.js +23 -0
- package/dist/agent/backends/transport_errors.d.ts +6 -0
- package/dist/agent/backends/transport_errors.js +11 -0
- package/dist/agent/backends/types.d.ts +25 -2
- package/dist/agent/backends/types.js +4 -0
- package/dist/agent/backends/zrouter_stream.d.ts +16 -0
- package/dist/agent/backends/zrouter_stream.js +162 -17
- package/dist/agent/background_workers.d.ts +68 -0
- package/dist/agent/background_workers.js +139 -0
- package/dist/agent/commands/accounts.d.ts +9 -1
- package/dist/agent/commands/accounts.js +13 -5
- package/dist/agent/commands/auth.d.ts +30 -1
- package/dist/agent/commands/auth.js +166 -35
- package/dist/agent/commands/command_refusal.d.ts +8 -0
- package/dist/agent/commands/command_refusal.js +8 -0
- package/dist/agent/commands/compact.js +16 -10
- package/dist/agent/commands/config.js +386 -80
- package/dist/agent/commands/connect.d.ts +20 -0
- package/dist/agent/commands/connect.js +150 -0
- package/dist/agent/commands/credential_redaction.d.ts +12 -0
- package/dist/agent/commands/credential_redaction.js +46 -0
- package/dist/agent/commands/credential_status.d.ts +72 -0
- package/dist/agent/commands/credential_status.js +181 -0
- package/dist/agent/commands/direct_credential_prompt.d.ts +71 -0
- package/dist/agent/commands/direct_credential_prompt.js +422 -0
- package/dist/agent/commands/effort.d.ts +1 -0
- package/dist/agent/commands/effort.js +16 -34
- package/dist/agent/commands/goal.d.ts +0 -4
- package/dist/agent/commands/goal.js +48 -10
- package/dist/agent/commands/handoff.d.ts +6 -0
- package/dist/agent/commands/handoff.js +17 -0
- package/dist/agent/commands/help.js +1 -1
- package/dist/agent/commands/inbox.js +3 -0
- package/dist/agent/commands/index.js +5 -3
- package/dist/agent/commands/keybindings.js +4 -3
- package/dist/agent/commands/mirror.js +29 -16
- package/dist/agent/commands/model.js +83 -4
- package/dist/agent/commands/models.d.ts +1 -1
- package/dist/agent/commands/models.js +89 -67
- package/dist/agent/commands/openai_compat_wizard.d.ts +3 -2
- package/dist/agent/commands/openai_compat_wizard.js +53 -15
- package/dist/agent/commands/provider_choices.d.ts +56 -0
- package/dist/agent/commands/provider_choices.js +72 -3
- package/dist/agent/commands/provider_model_defaults.d.ts +7 -0
- package/dist/agent/commands/provider_model_defaults.js +11 -0
- package/dist/agent/commands/provider_selection.d.ts +27 -2
- package/dist/agent/commands/provider_selection.js +143 -8
- package/dist/agent/commands/reasoning_page.d.ts +33 -0
- package/dist/agent/commands/reasoning_page.js +595 -0
- package/dist/agent/commands/reasoning_picker.d.ts +14 -0
- package/dist/agent/commands/reasoning_picker.js +99 -0
- package/dist/agent/commands/reasoning_settings.d.ts +18 -0
- package/dist/agent/commands/reasoning_settings.js +46 -0
- package/dist/agent/commands/settings.d.ts +2 -0
- package/dist/agent/commands/settings.js +689 -264
- package/dist/agent/commands/status.js +13 -44
- package/dist/agent/commands/types.d.ts +108 -2
- package/dist/agent/commands/update.d.ts +18 -0
- package/dist/agent/commands/update.js +55 -96
- package/dist/agent/completion_state.d.ts +18 -0
- package/dist/agent/completion_state.js +35 -3
- package/dist/agent/factory.d.ts +9 -1
- package/dist/agent/factory.js +61 -17
- package/dist/agent/loop_policy.d.ts +14 -0
- package/dist/agent/loop_policy.js +9 -0
- package/dist/agent/request_encoder.d.ts +6 -0
- package/dist/agent/request_encoder.js +36 -6
- package/dist/agent/result_emit_cap.d.ts +1 -0
- package/dist/agent/result_emit_cap.js +1 -0
- package/dist/agent/runaway_output.d.ts +32 -0
- package/dist/agent/runaway_output.js +80 -0
- package/dist/agent/runtime/command_execution_policy.d.ts +6 -0
- package/dist/agent/runtime/command_execution_policy.js +39 -0
- package/dist/agent/runtime/evidence.d.ts +17 -1
- package/dist/agent/runtime/evidence.js +58 -8
- package/dist/agent/runtime/execution_context.js +7 -3
- package/dist/agent/runtime/read_only_command.d.ts +15 -0
- package/dist/agent/runtime/read_only_command.js +265 -0
- package/dist/agent/runtime/recovery.js +2 -38
- package/dist/agent/runtime/source_verification.js +3 -1
- package/dist/agent/runtime/tool_checkpoints.js +5 -1
- package/dist/agent/runtime/tool_runtime.js +15 -1
- package/dist/agent/runtime/tool_scheduler.js +3 -1
- package/dist/agent/subagent.d.ts +4 -0
- package/dist/agent/subagent.js +195 -23
- package/dist/agent/system_prompt.d.ts +3 -1
- package/dist/agent/system_prompt.js +3 -1
- package/dist/agent/tool_response_store.d.ts +9 -0
- package/dist/agent/tool_response_store.js +39 -3
- package/dist/agent/tool_result_parsing.d.ts +2 -0
- package/dist/agent/tool_result_parsing.js +1 -0
- package/dist/agent/tool_result_presentation.d.ts +21 -0
- package/dist/agent/tool_result_presentation.js +237 -0
- package/dist/agent/tools/apply_patch.js +130 -42
- package/dist/agent/tools/deferred.js +22 -2
- package/dist/agent/tools/delegate.js +182 -49
- package/dist/agent/tools/edit_view.d.ts +13 -0
- package/dist/agent/tools/edit_view.js +134 -0
- package/dist/agent/tools/file.js +54 -16
- package/dist/agent/tools/recall_tool_response.d.ts +6 -0
- package/dist/agent/tools/recall_tool_response.js +60 -17
- package/dist/agent/tools/screenshot.js +5 -3
- package/dist/agent/tools/search.js +18 -9
- package/dist/agent/tools/shell.d.ts +1 -1
- package/dist/agent/tools/shell.js +48 -10
- package/dist/agent/tools/sim_domain_tools.js +7 -1
- package/dist/agent/tools/tool_groups.d.ts +34 -0
- package/dist/agent/tools/tool_groups.js +112 -0
- package/dist/agent/tools/types.d.ts +10 -0
- package/dist/app/activity.js +2 -1
- package/dist/app/agent_runner.js +13 -4
- package/dist/app/ask_user_response.d.ts +6 -0
- package/dist/app/ask_user_response.js +26 -0
- package/dist/app/command_context.js +11 -5
- package/dist/app/launch_notices.d.ts +10 -0
- package/dist/app/launch_notices.js +20 -0
- package/dist/app/selection_completion.d.ts +30 -1
- package/dist/app/selection_completion.js +191 -28
- package/dist/app/session_manager.d.ts +5 -0
- package/dist/app/session_manager.js +50 -12
- package/dist/app/session_messages.d.ts +3 -0
- package/dist/app/session_messages.js +34 -12
- package/dist/app/workspace_admission_details.d.ts +7 -0
- package/dist/app/workspace_admission_details.js +45 -1
- package/dist/cli_args.js +1 -1
- package/dist/cli_main.js +20 -3
- package/dist/cli_ratatui.d.ts +95 -3
- package/dist/cli_ratatui.js +654 -161
- package/dist/components/InputArea.js +1 -1
- package/dist/config/compaction.d.ts +2 -1
- package/dist/config/compaction.js +2 -1
- package/dist/config/defaults.js +20 -48
- package/dist/config/provider_api_key_env.d.ts +76 -0
- package/dist/config/provider_api_key_env.js +148 -0
- package/dist/config/resolved.d.ts +4 -4
- package/dist/config/types.d.ts +102 -1
- package/dist/config.d.ts +70 -8
- package/dist/config.js +253 -63
- package/dist/diagnostics/session_export.d.ts +1 -0
- package/dist/diagnostics/session_export.js +81 -13
- package/dist/emulation/catalog.d.ts +2 -0
- package/dist/emulation/catalog.js +50 -21
- package/dist/emulation/tool_adapters.d.ts +6 -0
- package/dist/emulation/tool_adapters.js +30 -0
- package/dist/emulation/ztc_addendum.d.ts +22 -0
- package/dist/emulation/ztc_addendum.js +37 -0
- package/dist/events.d.ts +3 -0
- package/dist/headless.d.ts +35 -1
- package/dist/headless.js +209 -14
- package/dist/headless_cli.js +6 -0
- package/dist/headless_cli_args.d.ts +4 -0
- package/dist/headless_cli_args.js +2 -0
- package/dist/headless_output_schema.d.ts +46 -0
- package/dist/headless_output_schema.js +386 -0
- package/dist/headless_trajectory.d.ts +44 -0
- package/dist/headless_trajectory.js +113 -0
- package/dist/library.d.ts +6 -3
- package/dist/library.js +8 -4
- package/dist/lsp/client.js +4 -1
- package/dist/lsp/servers.js +2 -0
- package/dist/onboarding/first_run.d.ts +26 -6
- package/dist/onboarding/first_run.js +63 -45
- package/dist/onboarding/router_tips.d.ts +7 -0
- package/dist/onboarding/router_tips.js +38 -0
- package/dist/onboarding/setup.js +1 -1
- package/dist/onboarding/wordmark.d.ts +7 -0
- package/dist/onboarding/wordmark.js +14 -0
- package/dist/onboarding/zergai_login.d.ts +48 -0
- package/dist/onboarding/zergai_login.js +60 -0
- package/dist/prompts/subagent_worker.j2 +20 -0
- package/dist/prompts/tool_delegate_task.j2 +5 -14
- package/dist/router_auth.d.ts +37 -3
- package/dist/router_auth.js +221 -73
- package/dist/runtime_info.d.ts +19 -6
- package/dist/runtime_info.js +64 -28
- package/dist/session.d.ts +9 -0
- package/dist/session.js +41 -8
- package/dist/session_handoff_contract.d.ts +13 -0
- package/dist/session_handoff_contract.js +81 -15
- package/dist/session_media.d.ts +5 -0
- package/dist/session_media.js +2 -1
- package/dist/simulation/domain_types.d.ts +3 -3
- package/dist/simulation/living/context.d.ts +9 -9
- package/dist/simulation/living/definition.d.ts +1 -1
- package/dist/simulation/living/open-world.d.ts +3 -3
- package/dist/simulation/living/recall.d.ts +1 -1
- package/dist/simulation/living/types.d.ts +18 -18
- package/dist/simulation/orchestration/world_response.d.ts +2 -2
- package/dist/simulation/toolkit/dynamic_meetings.d.ts +1 -1
- package/dist/simulation/toolkit/dynamic_state.d.ts +1 -1
- package/dist/simulation/world/bootstrap_schema.d.ts +1 -1
- package/dist/simulation/world/gm_schema.d.ts +8 -8
- package/dist/skills/loader.js +3 -1
- package/dist/types.d.ts +6 -2
- package/dist/ui/core/input.d.ts +5 -1
- package/dist/ui/core/input.js +5 -1
- package/dist/ui/core/input_segments.d.ts +5 -1
- package/dist/ui/core/input_segments.js +5 -3
- package/dist/ui/ratatui/headless_pane_manager.d.ts +3 -1
- package/dist/ui/ratatui/headless_pane_manager.js +16 -5
- package/dist/ui/ratatui/input.js +4 -3
- package/dist/ui/ratatui/process.js +22 -13
- package/dist/ui/ratatui/protocol.d.ts +14 -0
- package/dist/ui/ratatui/protocol.js +2 -0
- package/dist/ui/scrollback.d.ts +17 -0
- package/dist/ui/scrollback.js +138 -4
- package/dist/ui/terminal_image.d.ts +129 -0
- package/dist/ui/terminal_image.js +516 -0
- package/dist/ui/transcript_render_cache.d.ts +4 -4
- package/dist/ui/transcript_render_cache.js +7 -4
- package/dist/ui/views/app.d.ts +7 -3
- package/dist/ui/views/app.js +13 -6
- package/dist/ui/views/completion_menu.js +18 -10
- package/dist/ui/views/input_area.d.ts +1 -2
- package/dist/ui/views/input_area.js +2 -2
- package/dist/ui/views/message_list.d.ts +8 -1
- package/dist/ui/views/message_list.js +176 -45
- package/dist/ui/views/status_bar.js +7 -1
- package/dist/ui/views/theme.d.ts +2 -0
- package/dist/ui/views/theme.js +2 -0
- package/dist/ui/widgets/color_panel.js +4 -3
- package/dist/ui/widgets/form.d.ts +8 -1
- package/dist/ui/widgets/form.js +36 -22
- package/dist/ui/widgets/index.d.ts +1 -1
- package/dist/ui/widgets/index.js +1 -1
- package/dist/ui/widgets/log_view.js +4 -3
- package/dist/ui/widgets/navigator_panel.js +5 -4
- package/dist/ui/widgets/panel_frame.d.ts +2 -0
- package/dist/ui/widgets/panel_frame.js +14 -0
- package/dist/ui/widgets/prompt_viewer.js +2 -1
- package/dist/ui/widgets/questionnaire.js +3 -3
- package/dist/ui/widgets/reasoning_track.d.ts +60 -0
- package/dist/ui/widgets/reasoning_track.js +218 -0
- package/dist/ui/widgets/resume_panel.js +15 -10
- package/dist/ui/widgets/rewind_panel.js +4 -16
- package/dist/ui/widgets/select.d.ts +90 -4
- package/dist/ui/widgets/select.js +305 -135
- package/dist/ui/widgets/settings_panel.d.ts +21 -1
- package/dist/ui/widgets/settings_panel.js +266 -45
- package/dist/ui/widgets/status_line_panel.js +6 -5
- package/dist/ui/widgets/text_input.d.ts +4 -0
- package/dist/ui/widgets/text_input.js +20 -13
- package/dist/ui/widgets/types.d.ts +2 -0
- package/dist/utils/compaction.d.ts +24 -4
- package/dist/utils/compaction.js +228 -44
- package/dist/utils/context.js +1 -0
- package/dist/utils/debug_log.d.ts +12 -0
- package/dist/utils/debug_log.js +25 -3
- package/dist/utils/deepseek.d.ts +3 -1
- package/dist/utils/deepseek.js +29 -1
- package/dist/utils/docker_target.d.ts +28 -0
- package/dist/utils/docker_target.js +89 -0
- package/dist/utils/ephemeral.js +2 -0
- package/dist/utils/fireworks.d.ts +4 -4
- package/dist/utils/fireworks.js +11 -7
- package/dist/utils/idle_compaction.d.ts +32 -0
- package/dist/utils/idle_compaction.js +113 -0
- package/dist/utils/mid_turn_compaction.d.ts +12 -0
- package/dist/utils/mid_turn_compaction.js +17 -0
- package/dist/utils/open_url.d.ts +4 -0
- package/dist/utils/open_url.js +10 -0
- package/dist/utils/openrouter_prices.d.ts +165 -0
- package/dist/utils/openrouter_prices.js +313 -0
- package/dist/utils/router_catalog.d.ts +13 -0
- package/dist/utils/router_catalog.js +30 -3
- package/dist/utils/sandbox.d.ts +12 -0
- package/dist/utils/sandbox.js +23 -5
- package/dist/utils/session_interactivity.d.ts +21 -0
- package/dist/utils/session_interactivity.js +28 -0
- package/dist/utils/shell.d.ts +7 -0
- package/dist/utils/shell.js +43 -7
- package/dist/utils/subprocess_env.d.ts +27 -0
- package/dist/utils/subprocess_env.js +69 -3
- package/dist/utils/tool_output_copies.d.ts +44 -0
- package/dist/utils/tool_output_copies.js +196 -0
- package/dist/utils/tool_result_message.d.ts +7 -0
- package/dist/utils/tool_result_message.js +11 -0
- package/dist/utils/tool_trace.d.ts +15 -0
- package/dist/utils/tool_trace.js +40 -9
- package/dist/web/event_history_store.d.ts +2 -0
- package/dist/web/event_history_store.js +31 -6
- package/dist/web/mirror_client.d.ts +3 -0
- package/dist/web/mirror_stream.d.ts +11 -0
- package/dist/web/mirror_stream.js +23 -3
- package/dist/worker/executor.js +3 -1
- package/dist/worker/toolsets.d.ts +1 -1
- package/dist/worker/toolsets.js +4 -3
- package/dist/worker/types.d.ts +6 -0
- package/dist/worker/worker_models.d.ts +17 -0
- package/dist/worker/worker_models.js +79 -0
- package/dist/zlm-embed.mjs +53761 -10916
- package/node_modules/@zerg/model-contracts/README.md +16 -5
- package/node_modules/@zerg/model-contracts/index.d.ts +7 -3
- package/node_modules/@zerg/model-contracts/index.js +40 -18
- package/node_modules/abort-controller/LICENSE +21 -0
- package/node_modules/abort-controller/README.md +98 -0
- package/node_modules/abort-controller/browser.js +13 -0
- package/node_modules/abort-controller/browser.mjs +11 -0
- package/node_modules/abort-controller/dist/abort-controller.d.ts +43 -0
- package/node_modules/abort-controller/dist/abort-controller.js +127 -0
- package/node_modules/abort-controller/dist/abort-controller.js.map +1 -0
- package/node_modules/abort-controller/dist/abort-controller.mjs +118 -0
- package/node_modules/abort-controller/dist/abort-controller.mjs.map +1 -0
- package/node_modules/abort-controller/dist/abort-controller.umd.js +5 -0
- package/node_modules/abort-controller/dist/abort-controller.umd.js.map +1 -0
- package/node_modules/abort-controller/package.json +97 -0
- package/node_modules/abort-controller/polyfill.js +21 -0
- package/node_modules/abort-controller/polyfill.mjs +19 -0
- package/node_modules/bluebird/LICENSE +1 -1
- package/node_modules/bluebird/README.md +8 -2
- package/node_modules/bluebird/js/browser/bluebird.core.js +325 -150
- package/node_modules/bluebird/js/browser/bluebird.core.min.js +4 -4
- package/node_modules/bluebird/js/browser/bluebird.js +362 -165
- package/node_modules/bluebird/js/browser/bluebird.min.js +5 -5
- package/node_modules/bluebird/js/release/async.js +15 -56
- package/node_modules/bluebird/js/release/debuggability.js +118 -25
- package/node_modules/bluebird/js/release/finally.js +37 -2
- package/node_modules/bluebird/js/release/generators.js +1 -1
- package/node_modules/bluebird/js/release/join.js +4 -7
- package/node_modules/bluebird/js/release/map.js +10 -3
- package/node_modules/bluebird/js/release/promise.js +89 -43
- package/node_modules/bluebird/js/release/promise_array.js +2 -0
- package/node_modules/bluebird/js/release/props.js +1 -1
- package/node_modules/bluebird/js/release/reduce.js +16 -5
- package/node_modules/bluebird/js/release/schedule.js +6 -5
- package/node_modules/bluebird/js/release/settle.js +4 -0
- package/node_modules/bluebird/js/release/util.js +53 -11
- package/node_modules/bluebird/package.json +7 -5
- package/node_modules/buffer/AUTHORS.md +3 -0
- package/node_modules/buffer/README.md +1 -1
- package/node_modules/buffer/index.d.ts +11 -3
- package/node_modules/buffer/index.js +424 -135
- package/node_modules/buffer/package.json +8 -11
- package/node_modules/compress-commons/README.md +1 -1
- package/node_modules/compress-commons/lib/archivers/archive-entry.js +6 -16
- package/node_modules/compress-commons/lib/archivers/archive-output-stream.js +79 -98
- package/node_modules/compress-commons/lib/archivers/zip/constants.js +99 -70
- package/node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js +70 -92
- package/node_modules/compress-commons/lib/archivers/zip/unix-stat.js +19 -53
- package/node_modules/compress-commons/lib/archivers/zip/util.js +49 -49
- package/node_modules/compress-commons/lib/archivers/zip/zip-archive-entry.js +356 -389
- package/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js +335 -404
- package/node_modules/compress-commons/lib/compress-commons.js +18 -13
- package/node_modules/compress-commons/lib/util/index.js +11 -21
- package/node_modules/compress-commons/node_modules/readable-stream/README.md +116 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/_stream_duplex.js +4 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/_stream_passthrough.js +4 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/_stream_readable.js +4 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/_stream_transform.js +4 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/_stream_writable.js +4 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/shims/process.js +19 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/add-abort-signal.js +52 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/buffer_list.js +157 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/compose.js +194 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/destroy.js +290 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/duplex.js +143 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/duplexify.js +378 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +286 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/from.js +98 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/lazy_transform.js +51 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/legacy.js +94 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/operators.js +457 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/passthrough.js +39 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/pipeline.js +471 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/readable.js +1290 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/state.js +39 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/transform.js +180 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/utils.js +327 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/writable.js +819 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/internal/validators.js +530 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/ours/browser.js +35 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/ours/errors.js +343 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/ours/index.js +65 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/ours/primordials.js +124 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/ours/util/inspect.js +55 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/ours/util.js +148 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/stream/promises.js +43 -0
- package/node_modules/compress-commons/node_modules/readable-stream/lib/stream.js +143 -0
- package/node_modules/compress-commons/node_modules/readable-stream/package.json +89 -0
- package/node_modules/compress-commons/package.json +13 -10
- package/node_modules/crc32-stream/README.md +8 -8
- package/node_modules/crc32-stream/lib/crc32-stream.js +4 -23
- package/node_modules/crc32-stream/lib/deflate-crc32-stream.js +5 -27
- package/node_modules/crc32-stream/lib/index.js +7 -6
- package/node_modules/crc32-stream/node_modules/readable-stream/README.md +116 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/_stream_duplex.js +4 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/_stream_passthrough.js +4 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/_stream_readable.js +4 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/_stream_transform.js +4 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/_stream_writable.js +4 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/shims/process.js +19 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/add-abort-signal.js +52 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/buffer_list.js +157 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/compose.js +194 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/destroy.js +290 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/duplex.js +143 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/duplexify.js +378 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +286 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/from.js +98 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/lazy_transform.js +51 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/legacy.js +94 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/operators.js +457 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/passthrough.js +39 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/pipeline.js +471 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/readable.js +1290 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/state.js +39 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/transform.js +180 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/utils.js +327 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/writable.js +819 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/internal/validators.js +530 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/ours/browser.js +35 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/ours/errors.js +343 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/ours/index.js +65 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/ours/primordials.js +124 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/ours/util/inspect.js +55 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/ours/util.js +148 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/stream/promises.js +43 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/lib/stream.js +143 -0
- package/node_modules/crc32-stream/node_modules/readable-stream/package.json +89 -0
- package/node_modules/crc32-stream/package.json +9 -10
- package/node_modules/event-target-shim/LICENSE +22 -0
- package/node_modules/event-target-shim/README.md +293 -0
- package/node_modules/event-target-shim/dist/event-target-shim.js +871 -0
- package/node_modules/event-target-shim/dist/event-target-shim.js.map +1 -0
- package/node_modules/event-target-shim/dist/event-target-shim.mjs +862 -0
- package/node_modules/event-target-shim/dist/event-target-shim.mjs.map +1 -0
- package/node_modules/event-target-shim/dist/event-target-shim.umd.js +6 -0
- package/node_modules/event-target-shim/dist/event-target-shim.umd.js.map +1 -0
- package/node_modules/event-target-shim/index.d.ts +399 -0
- package/node_modules/event-target-shim/package.json +82 -0
- package/node_modules/events/.airtap.yml +15 -0
- package/node_modules/events/.github/FUNDING.yml +12 -0
- package/node_modules/events/.travis.yml +18 -0
- package/node_modules/events/History.md +118 -0
- package/node_modules/events/LICENSE +22 -0
- package/node_modules/events/Readme.md +50 -0
- package/node_modules/events/events.js +497 -0
- package/node_modules/events/package.json +37 -0
- package/node_modules/events/security.md +10 -0
- package/node_modules/events/tests/add-listeners.js +111 -0
- package/node_modules/events/tests/check-listener-leaks.js +101 -0
- package/node_modules/events/tests/common.js +104 -0
- package/node_modules/events/tests/errors.js +13 -0
- package/node_modules/events/tests/events-list.js +28 -0
- package/node_modules/events/tests/events-once.js +234 -0
- package/node_modules/events/tests/index.js +64 -0
- package/node_modules/events/tests/legacy-compat.js +16 -0
- package/node_modules/events/tests/listener-count.js +37 -0
- package/node_modules/events/tests/listeners-side-effects.js +56 -0
- package/node_modules/events/tests/listeners.js +168 -0
- package/node_modules/events/tests/max-listeners.js +47 -0
- package/node_modules/events/tests/method-names.js +35 -0
- package/node_modules/events/tests/modify-in-emit.js +90 -0
- package/node_modules/events/tests/num-args.js +60 -0
- package/node_modules/events/tests/once.js +83 -0
- package/node_modules/events/tests/prepend.js +31 -0
- package/node_modules/events/tests/remove-all-listeners.js +133 -0
- package/node_modules/events/tests/remove-listeners.js +212 -0
- package/node_modules/events/tests/set-max-listeners-side-effects.js +31 -0
- package/node_modules/events/tests/special-event-names.js +45 -0
- package/node_modules/events/tests/subclass.js +66 -0
- package/node_modules/events/tests/symbols.js +25 -0
- package/node_modules/exceljs/lib/stream/xlsx/workbook-reader.js +5 -1
- package/node_modules/exceljs/lib/stream/xlsx/workbook-writer.js +2 -2
- package/node_modules/exceljs/lib/utils/zip-archive.js +85 -0
- package/node_modules/exceljs/package.json +3 -3
- package/node_modules/fs-extra/LICENSE +15 -0
- package/node_modules/fs-extra/README.md +294 -0
- package/node_modules/fs-extra/lib/copy/copy-sync.js +171 -0
- package/node_modules/fs-extra/lib/copy/copy.js +182 -0
- package/node_modules/fs-extra/lib/copy/index.js +7 -0
- package/node_modules/fs-extra/lib/empty/index.js +39 -0
- package/node_modules/fs-extra/lib/ensure/file.js +66 -0
- package/node_modules/fs-extra/lib/ensure/index.js +23 -0
- package/node_modules/fs-extra/lib/ensure/link.js +64 -0
- package/node_modules/fs-extra/lib/ensure/symlink-paths.js +101 -0
- package/node_modules/fs-extra/lib/ensure/symlink-type.js +34 -0
- package/node_modules/fs-extra/lib/ensure/symlink.js +67 -0
- package/node_modules/fs-extra/lib/esm.mjs +68 -0
- package/node_modules/fs-extra/lib/fs/index.js +146 -0
- package/node_modules/fs-extra/lib/index.js +16 -0
- package/node_modules/fs-extra/lib/json/index.js +16 -0
- package/node_modules/fs-extra/lib/json/jsonfile.js +11 -0
- package/node_modules/fs-extra/lib/json/output-json-sync.js +12 -0
- package/node_modules/fs-extra/lib/json/output-json.js +12 -0
- package/node_modules/fs-extra/lib/mkdirs/index.js +14 -0
- package/node_modules/fs-extra/lib/mkdirs/make-dir.js +27 -0
- package/node_modules/fs-extra/lib/mkdirs/utils.js +21 -0
- package/node_modules/fs-extra/lib/move/index.js +7 -0
- package/node_modules/fs-extra/lib/move/move-sync.js +55 -0
- package/node_modules/fs-extra/lib/move/move.js +59 -0
- package/node_modules/fs-extra/lib/output-file/index.js +31 -0
- package/node_modules/fs-extra/lib/path-exists/index.js +12 -0
- package/node_modules/fs-extra/lib/remove/index.js +17 -0
- package/node_modules/fs-extra/lib/util/stat.js +159 -0
- package/node_modules/fs-extra/lib/util/utimes.js +36 -0
- package/node_modules/fs-extra/package.json +71 -0
- package/node_modules/is-stream/index.d.ts +90 -0
- package/node_modules/is-stream/index.js +37 -0
- package/node_modules/is-stream/license +9 -0
- package/node_modules/is-stream/package.json +48 -0
- package/node_modules/is-stream/readme.md +57 -0
- package/node_modules/jsonfile/LICENSE +15 -0
- package/node_modules/jsonfile/README.md +230 -0
- package/node_modules/jsonfile/index.js +88 -0
- package/node_modules/jsonfile/package.json +40 -0
- package/node_modules/jsonfile/utils.js +18 -0
- package/node_modules/node-int64/.npmignore +3 -0
- package/node_modules/node-int64/Int64.js +268 -0
- package/node_modules/node-int64/LICENSE +19 -0
- package/node_modules/node-int64/README.md +78 -0
- package/node_modules/node-int64/package.json +27 -0
- package/node_modules/node-int64/test.js +120 -0
- package/node_modules/process/.eslintrc +21 -0
- package/node_modules/process/LICENSE +22 -0
- package/node_modules/process/README.md +26 -0
- package/node_modules/process/browser.js +184 -0
- package/node_modules/process/index.js +2 -0
- package/node_modules/process/package.json +27 -0
- package/node_modules/process/test.js +199 -0
- package/node_modules/universalify/LICENSE +20 -0
- package/node_modules/universalify/README.md +76 -0
- package/node_modules/universalify/index.js +24 -0
- package/node_modules/universalify/package.json +34 -0
- package/node_modules/unzipper/README.md +206 -176
- package/node_modules/unzipper/eslint.config.mjs +29 -0
- package/node_modules/unzipper/lib/BufferStream.js +9 -15
- package/node_modules/unzipper/lib/Decrypt.js +58 -36
- package/node_modules/unzipper/lib/NoopStream.js +5 -10
- package/node_modules/unzipper/lib/Open/directory.js +140 -127
- package/node_modules/unzipper/lib/Open/index.js +72 -32
- package/node_modules/unzipper/lib/Open/unzip.js +68 -74
- package/node_modules/unzipper/lib/PullStream.js +50 -55
- package/node_modules/unzipper/lib/extract.js +26 -18
- package/node_modules/unzipper/lib/parse.js +119 -118
- package/node_modules/unzipper/lib/parseBuffer.js +55 -0
- package/node_modules/unzipper/lib/parseExtraField.js +17 -14
- package/node_modules/unzipper/lib/parseOne.js +23 -27
- package/node_modules/unzipper/package.json +12 -13
- package/node_modules/unzipper/unzip.js +0 -6
- package/node_modules/zip-stream/README.md +5 -5
- package/node_modules/zip-stream/index.js +143 -169
- package/node_modules/zip-stream/node_modules/readable-stream/README.md +116 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/_stream_duplex.js +4 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/_stream_passthrough.js +4 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/_stream_readable.js +4 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/_stream_transform.js +4 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/_stream_writable.js +4 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/shims/process.js +19 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/add-abort-signal.js +52 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/buffer_list.js +157 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/compose.js +194 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/destroy.js +290 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/duplex.js +143 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/duplexify.js +378 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +286 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/from.js +98 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/lazy_transform.js +51 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/legacy.js +94 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/operators.js +457 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/passthrough.js +39 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/pipeline.js +471 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/readable.js +1290 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/state.js +39 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/transform.js +180 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/utils.js +327 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/streams/writable.js +819 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/internal/validators.js +530 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/ours/browser.js +35 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/ours/errors.js +343 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/ours/index.js +65 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/ours/primordials.js +124 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/ours/util/inspect.js +55 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/ours/util.js +148 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/stream/promises.js +43 -0
- package/node_modules/zip-stream/node_modules/readable-stream/lib/stream.js +143 -0
- package/node_modules/zip-stream/node_modules/readable-stream/package.json +89 -0
- package/node_modules/zip-stream/package.json +15 -12
- package/node_modules/zip-stream/utils.js +21 -0
- package/package.json +22 -10
- package/packages/exceljs/PROVENANCE.md +24 -1
- package/packages/exceljs/lib/stream/xlsx/workbook-reader.js +5 -1
- package/packages/exceljs/lib/stream/xlsx/workbook-writer.js +2 -2
- package/packages/exceljs/lib/utils/zip-archive.js +85 -0
- package/packages/exceljs/package.json +3 -3
- package/packages/model-contracts/README.md +16 -5
- package/packages/model-contracts/index.d.ts +7 -3
- package/packages/model-contracts/index.js +40 -18
- package/scripts/install-macos-app.mjs +10 -1
- package/node_modules/archiver/LICENSE +0 -22
- package/node_modules/archiver/README.md +0 -94
- package/node_modules/archiver/index.js +0 -84
- package/node_modules/archiver/lib/core.js +0 -974
- package/node_modules/archiver/lib/error.js +0 -40
- package/node_modules/archiver/lib/plugins/json.js +0 -110
- package/node_modules/archiver/lib/plugins/tar.js +0 -167
- package/node_modules/archiver/lib/plugins/zip.js +0 -120
- package/node_modules/archiver/package.json +0 -60
- package/node_modules/archiver-utils/LICENSE +0 -22
- package/node_modules/archiver-utils/README.md +0 -7
- package/node_modules/archiver-utils/file.js +0 -209
- package/node_modules/archiver-utils/index.js +0 -156
- package/node_modules/archiver-utils/node_modules/readable-stream/.travis.yml +0 -34
- package/node_modules/archiver-utils/node_modules/readable-stream/CONTRIBUTING.md +0 -38
- package/node_modules/archiver-utils/node_modules/readable-stream/GOVERNANCE.md +0 -136
- package/node_modules/archiver-utils/node_modules/readable-stream/README.md +0 -58
- package/node_modules/archiver-utils/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -60
- package/node_modules/archiver-utils/node_modules/readable-stream/duplex-browser.js +0 -1
- package/node_modules/archiver-utils/node_modules/readable-stream/duplex.js +0 -1
- package/node_modules/archiver-utils/node_modules/readable-stream/lib/_stream_duplex.js +0 -131
- package/node_modules/archiver-utils/node_modules/readable-stream/lib/_stream_passthrough.js +0 -47
- package/node_modules/archiver-utils/node_modules/readable-stream/lib/_stream_readable.js +0 -1019
- package/node_modules/archiver-utils/node_modules/readable-stream/lib/_stream_transform.js +0 -214
- package/node_modules/archiver-utils/node_modules/readable-stream/lib/_stream_writable.js +0 -685
- package/node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/BufferList.js +0 -78
- package/node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -84
- package/node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
- package/node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
- package/node_modules/archiver-utils/node_modules/readable-stream/package.json +0 -52
- package/node_modules/archiver-utils/node_modules/readable-stream/passthrough.js +0 -1
- package/node_modules/archiver-utils/node_modules/readable-stream/readable-browser.js +0 -7
- package/node_modules/archiver-utils/node_modules/readable-stream/readable.js +0 -19
- package/node_modules/archiver-utils/node_modules/readable-stream/transform.js +0 -1
- package/node_modules/archiver-utils/node_modules/readable-stream/writable-browser.js +0 -1
- package/node_modules/archiver-utils/node_modules/readable-stream/writable.js +0 -8
- package/node_modules/archiver-utils/node_modules/safe-buffer/LICENSE +0 -21
- package/node_modules/archiver-utils/node_modules/safe-buffer/README.md +0 -584
- package/node_modules/archiver-utils/node_modules/safe-buffer/index.d.ts +0 -187
- package/node_modules/archiver-utils/node_modules/safe-buffer/index.js +0 -62
- package/node_modules/archiver-utils/node_modules/safe-buffer/package.json +0 -37
- package/node_modules/archiver-utils/node_modules/string_decoder/.travis.yml +0 -50
- package/node_modules/archiver-utils/node_modules/string_decoder/LICENSE +0 -48
- package/node_modules/archiver-utils/node_modules/string_decoder/README.md +0 -47
- package/node_modules/archiver-utils/node_modules/string_decoder/lib/string_decoder.js +0 -296
- package/node_modules/archiver-utils/node_modules/string_decoder/package.json +0 -31
- package/node_modules/archiver-utils/package.json +0 -54
- package/node_modules/async/CHANGELOG.md +0 -351
- package/node_modules/async/LICENSE +0 -19
- package/node_modules/async/README.md +0 -59
- package/node_modules/async/all.js +0 -119
- package/node_modules/async/allLimit.js +0 -46
- package/node_modules/async/allSeries.js +0 -45
- package/node_modules/async/any.js +0 -122
- package/node_modules/async/anyLimit.js +0 -47
- package/node_modules/async/anySeries.js +0 -46
- package/node_modules/async/apply.js +0 -11
- package/node_modules/async/applyEach.js +0 -57
- package/node_modules/async/applyEachSeries.js +0 -37
- package/node_modules/async/asyncify.js +0 -118
- package/node_modules/async/auto.js +0 -333
- package/node_modules/async/autoInject.js +0 -182
- package/node_modules/async/bower.json +0 -17
- package/node_modules/async/cargo.js +0 -63
- package/node_modules/async/cargoQueue.js +0 -71
- package/node_modules/async/compose.js +0 -55
- package/node_modules/async/concat.js +0 -115
- package/node_modules/async/concatLimit.js +0 -60
- package/node_modules/async/concatSeries.js +0 -41
- package/node_modules/async/constant.js +0 -14
- package/node_modules/async/detect.js +0 -96
- package/node_modules/async/detectLimit.js +0 -48
- package/node_modules/async/detectSeries.js +0 -47
- package/node_modules/async/dir.js +0 -43
- package/node_modules/async/dist/async.js +0 -6061
- package/node_modules/async/dist/async.min.js +0 -1
- package/node_modules/async/dist/async.mjs +0 -5948
- package/node_modules/async/doDuring.js +0 -68
- package/node_modules/async/doUntil.js +0 -46
- package/node_modules/async/doWhilst.js +0 -68
- package/node_modules/async/during.js +0 -78
- package/node_modules/async/each.js +0 -129
- package/node_modules/async/eachLimit.js +0 -50
- package/node_modules/async/eachOf.js +0 -185
- package/node_modules/async/eachOfLimit.js +0 -47
- package/node_modules/async/eachOfSeries.js +0 -39
- package/node_modules/async/eachSeries.js +0 -44
- package/node_modules/async/ensureAsync.js +0 -67
- package/node_modules/async/every.js +0 -119
- package/node_modules/async/everyLimit.js +0 -46
- package/node_modules/async/everySeries.js +0 -45
- package/node_modules/async/filter.js +0 -93
- package/node_modules/async/filterLimit.js +0 -45
- package/node_modules/async/filterSeries.js +0 -43
- package/node_modules/async/find.js +0 -96
- package/node_modules/async/findLimit.js +0 -48
- package/node_modules/async/findSeries.js +0 -47
- package/node_modules/async/flatMap.js +0 -115
- package/node_modules/async/flatMapLimit.js +0 -60
- package/node_modules/async/flatMapSeries.js +0 -41
- package/node_modules/async/foldl.js +0 -153
- package/node_modules/async/foldr.js +0 -41
- package/node_modules/async/forEach.js +0 -129
- package/node_modules/async/forEachLimit.js +0 -50
- package/node_modules/async/forEachOf.js +0 -185
- package/node_modules/async/forEachOfLimit.js +0 -47
- package/node_modules/async/forEachOfSeries.js +0 -39
- package/node_modules/async/forEachSeries.js +0 -44
- package/node_modules/async/forever.js +0 -68
- package/node_modules/async/groupBy.js +0 -108
- package/node_modules/async/groupByLimit.js +0 -71
- package/node_modules/async/groupBySeries.js +0 -36
- package/node_modules/async/index.js +0 -588
- package/node_modules/async/inject.js +0 -153
- package/node_modules/async/internal/DoublyLinkedList.js +0 -92
- package/node_modules/async/internal/Heap.js +0 -120
- package/node_modules/async/internal/applyEach.js +0 -29
- package/node_modules/async/internal/asyncEachOfLimit.js +0 -75
- package/node_modules/async/internal/awaitify.js +0 -28
- package/node_modules/async/internal/breakLoop.js +0 -10
- package/node_modules/async/internal/consoleFunc.js +0 -31
- package/node_modules/async/internal/createTester.js +0 -40
- package/node_modules/async/internal/eachOfLimit.js +0 -90
- package/node_modules/async/internal/filter.js +0 -55
- package/node_modules/async/internal/getIterator.js +0 -11
- package/node_modules/async/internal/initialParams.js +0 -14
- package/node_modules/async/internal/isArrayLike.js +0 -10
- package/node_modules/async/internal/iterator.js +0 -57
- package/node_modules/async/internal/map.js +0 -30
- package/node_modules/async/internal/once.js +0 -17
- package/node_modules/async/internal/onlyOnce.js +0 -15
- package/node_modules/async/internal/parallel.js +0 -34
- package/node_modules/async/internal/promiseCallback.js +0 -23
- package/node_modules/async/internal/queue.js +0 -294
- package/node_modules/async/internal/range.js +0 -14
- package/node_modules/async/internal/reject.js +0 -26
- package/node_modules/async/internal/setImmediate.js +0 -34
- package/node_modules/async/internal/withoutIndex.js +0 -10
- package/node_modules/async/internal/wrapAsync.js +0 -34
- package/node_modules/async/log.js +0 -41
- package/node_modules/async/map.js +0 -142
- package/node_modules/async/mapLimit.js +0 -45
- package/node_modules/async/mapSeries.js +0 -44
- package/node_modules/async/mapValues.js +0 -152
- package/node_modules/async/mapValuesLimit.js +0 -61
- package/node_modules/async/mapValuesSeries.js +0 -37
- package/node_modules/async/memoize.js +0 -91
- package/node_modules/async/nextTick.js +0 -52
- package/node_modules/async/package.json +0 -75
- package/node_modules/async/parallel.js +0 -180
- package/node_modules/async/parallelLimit.js +0 -41
- package/node_modules/async/priorityQueue.js +0 -60
- package/node_modules/async/queue.js +0 -24
- package/node_modules/async/race.js +0 -67
- package/node_modules/async/reduce.js +0 -153
- package/node_modules/async/reduceRight.js +0 -41
- package/node_modules/async/reflect.js +0 -78
- package/node_modules/async/reflectAll.js +0 -93
- package/node_modules/async/reject.js +0 -87
- package/node_modules/async/rejectLimit.js +0 -45
- package/node_modules/async/rejectSeries.js +0 -43
- package/node_modules/async/retry.js +0 -159
- package/node_modules/async/retryable.js +0 -77
- package/node_modules/async/select.js +0 -93
- package/node_modules/async/selectLimit.js +0 -45
- package/node_modules/async/selectSeries.js +0 -43
- package/node_modules/async/seq.js +0 -79
- package/node_modules/async/series.js +0 -186
- package/node_modules/async/setImmediate.js +0 -45
- package/node_modules/async/some.js +0 -122
- package/node_modules/async/someLimit.js +0 -47
- package/node_modules/async/someSeries.js +0 -46
- package/node_modules/async/sortBy.js +0 -190
- package/node_modules/async/timeout.js +0 -89
- package/node_modules/async/times.js +0 -50
- package/node_modules/async/timesLimit.js +0 -43
- package/node_modules/async/timesSeries.js +0 -32
- package/node_modules/async/transform.js +0 -173
- package/node_modules/async/tryEach.js +0 -78
- package/node_modules/async/unmemoize.js +0 -25
- package/node_modules/async/until.js +0 -61
- package/node_modules/async/waterfall.js +0 -105
- package/node_modules/async/whilst.js +0 -78
- package/node_modules/async/wrapSync.js +0 -118
- package/node_modules/big-integer/BigInteger.d.ts +0 -2393
- package/node_modules/big-integer/BigInteger.js +0 -1453
- package/node_modules/big-integer/BigInteger.min.js +0 -1
- package/node_modules/big-integer/LICENSE +0 -24
- package/node_modules/big-integer/README.md +0 -589
- package/node_modules/big-integer/bower.json +0 -29
- package/node_modules/big-integer/package.json +0 -48
- package/node_modules/big-integer/tsconfig.json +0 -24
- package/node_modules/binary/.npmignore +0 -1
- package/node_modules/binary/.travis.yml +0 -4
- package/node_modules/binary/README.markdown +0 -177
- package/node_modules/binary/example/buf.js +0 -11
- package/node_modules/binary/example/parse.js +0 -10
- package/node_modules/binary/example/stream.js +0 -12
- package/node_modules/binary/index.js +0 -397
- package/node_modules/binary/lib/vars.js +0 -28
- package/node_modules/binary/package.json +0 -38
- package/node_modules/binary/perf/loop.js +0 -92
- package/node_modules/binary/perf/small.js +0 -80
- package/node_modules/binary/test/bu.js +0 -46
- package/node_modules/binary/test/deferred.js +0 -20
- package/node_modules/binary/test/dots.js +0 -23
- package/node_modules/binary/test/eof.js +0 -41
- package/node_modules/binary/test/flush.js +0 -17
- package/node_modules/binary/test/from_buffer.js +0 -14
- package/node_modules/binary/test/get_buffer.js +0 -28
- package/node_modules/binary/test/immediate.js +0 -18
- package/node_modules/binary/test/interval.js +0 -38
- package/node_modules/binary/test/into_buffer.js +0 -35
- package/node_modules/binary/test/into_stream.js +0 -43
- package/node_modules/binary/test/loop.js +0 -44
- package/node_modules/binary/test/loop_scan.js +0 -54
- package/node_modules/binary/test/lu.js +0 -46
- package/node_modules/binary/test/negbs.js +0 -29
- package/node_modules/binary/test/negls.js +0 -29
- package/node_modules/binary/test/nested.js +0 -35
- package/node_modules/binary/test/not_enough_buf.js +0 -17
- package/node_modules/binary/test/not_enough_parse.js +0 -19
- package/node_modules/binary/test/parse.js +0 -54
- package/node_modules/binary/test/peek.js +0 -40
- package/node_modules/binary/test/pipe.js +0 -49
- package/node_modules/binary/test/posbs.js +0 -29
- package/node_modules/binary/test/posls.js +0 -29
- package/node_modules/binary/test/scan.js +0 -33
- package/node_modules/binary/test/scan_buf.js +0 -18
- package/node_modules/binary/test/scan_buf_null.js +0 -16
- package/node_modules/binary/test/skip.js +0 -58
- package/node_modules/binary/test/split.js +0 -34
- package/node_modules/bl/.travis.yml +0 -17
- package/node_modules/bl/BufferList.js +0 -396
- package/node_modules/bl/LICENSE.md +0 -13
- package/node_modules/bl/README.md +0 -247
- package/node_modules/bl/bl.js +0 -84
- package/node_modules/bl/package.json +0 -37
- package/node_modules/bl/test/convert.js +0 -21
- package/node_modules/bl/test/indexOf.js +0 -492
- package/node_modules/bl/test/isBufferList.js +0 -32
- package/node_modules/bl/test/test.js +0 -869
- package/node_modules/buffer-crc32/LICENSE +0 -19
- package/node_modules/buffer-crc32/README.md +0 -47
- package/node_modules/buffer-crc32/index.js +0 -111
- package/node_modules/buffer-crc32/package.json +0 -39
- package/node_modules/buffer-indexof-polyfill/.eslintrc +0 -33
- package/node_modules/buffer-indexof-polyfill/.travis.yml +0 -17
- package/node_modules/buffer-indexof-polyfill/LICENSE +0 -22
- package/node_modules/buffer-indexof-polyfill/README.md +0 -33
- package/node_modules/buffer-indexof-polyfill/index.js +0 -73
- package/node_modules/buffer-indexof-polyfill/init-buffer.js +0 -8
- package/node_modules/buffer-indexof-polyfill/package.json +0 -34
- package/node_modules/buffer-indexof-polyfill/test/indexof.js +0 -128
- package/node_modules/buffers/README.markdown +0 -122
- package/node_modules/buffers/examples/slice.js +0 -9
- package/node_modules/buffers/examples/splice.js +0 -17
- package/node_modules/buffers/index.js +0 -269
- package/node_modules/buffers/package.json +0 -14
- package/node_modules/buffers/test/buffers.js +0 -209
- package/node_modules/chainsaw/.npmignore +0 -1
- package/node_modules/chainsaw/README.markdown +0 -157
- package/node_modules/chainsaw/examples/add_do.js +0 -25
- package/node_modules/chainsaw/examples/prompt.js +0 -67
- package/node_modules/chainsaw/index.js +0 -145
- package/node_modules/chainsaw/package.json +0 -23
- package/node_modules/chainsaw/test/chainsaw.js +0 -418
- package/node_modules/concat-map/.travis.yml +0 -4
- package/node_modules/concat-map/LICENSE +0 -18
- package/node_modules/concat-map/README.markdown +0 -62
- package/node_modules/concat-map/example/map.js +0 -6
- package/node_modules/concat-map/index.js +0 -13
- package/node_modules/concat-map/package.json +0 -43
- package/node_modules/concat-map/test/map.js +0 -39
- package/node_modules/end-of-stream/LICENSE +0 -21
- package/node_modules/end-of-stream/README.md +0 -54
- package/node_modules/end-of-stream/index.js +0 -96
- package/node_modules/end-of-stream/package.json +0 -37
- package/node_modules/fs-constants/LICENSE +0 -21
- package/node_modules/fs-constants/README.md +0 -26
- package/node_modules/fs-constants/browser.js +0 -1
- package/node_modules/fs-constants/index.js +0 -1
- package/node_modules/fs-constants/package.json +0 -19
- package/node_modules/fs.realpath/LICENSE +0 -43
- package/node_modules/fs.realpath/README.md +0 -33
- package/node_modules/fs.realpath/index.js +0 -66
- package/node_modules/fs.realpath/old.js +0 -303
- package/node_modules/fs.realpath/package.json +0 -26
- package/node_modules/fstream/.travis.yml +0 -9
- package/node_modules/fstream/LICENSE +0 -15
- package/node_modules/fstream/README.md +0 -76
- package/node_modules/fstream/examples/filter-pipe.js +0 -134
- package/node_modules/fstream/examples/pipe.js +0 -118
- package/node_modules/fstream/examples/reader.js +0 -68
- package/node_modules/fstream/examples/symlink-write.js +0 -27
- package/node_modules/fstream/fstream.js +0 -35
- package/node_modules/fstream/lib/abstract.js +0 -85
- package/node_modules/fstream/lib/collect.js +0 -70
- package/node_modules/fstream/lib/dir-reader.js +0 -252
- package/node_modules/fstream/lib/dir-writer.js +0 -174
- package/node_modules/fstream/lib/file-reader.js +0 -150
- package/node_modules/fstream/lib/file-writer.js +0 -107
- package/node_modules/fstream/lib/get-type.js +0 -33
- package/node_modules/fstream/lib/link-reader.js +0 -53
- package/node_modules/fstream/lib/link-writer.js +0 -95
- package/node_modules/fstream/lib/proxy-reader.js +0 -95
- package/node_modules/fstream/lib/proxy-writer.js +0 -111
- package/node_modules/fstream/lib/reader.js +0 -255
- package/node_modules/fstream/lib/socket-reader.js +0 -36
- package/node_modules/fstream/lib/writer.js +0 -390
- package/node_modules/fstream/package.json +0 -28
- package/node_modules/glob/LICENSE +0 -21
- package/node_modules/glob/README.md +0 -378
- package/node_modules/glob/common.js +0 -238
- package/node_modules/glob/glob.js +0 -790
- package/node_modules/glob/node_modules/balanced-match/.github/FUNDING.yml +0 -2
- package/node_modules/glob/node_modules/balanced-match/LICENSE.md +0 -21
- package/node_modules/glob/node_modules/balanced-match/README.md +0 -97
- package/node_modules/glob/node_modules/balanced-match/index.js +0 -62
- package/node_modules/glob/node_modules/balanced-match/package.json +0 -48
- package/node_modules/glob/node_modules/brace-expansion/LICENSE +0 -21
- package/node_modules/glob/node_modules/brace-expansion/README.md +0 -151
- package/node_modules/glob/node_modules/brace-expansion/index.js +0 -438
- package/node_modules/glob/node_modules/brace-expansion/package.json +0 -50
- package/node_modules/glob/node_modules/minimatch/LICENSE +0 -15
- package/node_modules/glob/node_modules/minimatch/README.md +0 -267
- package/node_modules/glob/node_modules/minimatch/minimatch.js +0 -1005
- package/node_modules/glob/node_modules/minimatch/package.json +0 -33
- package/node_modules/glob/package.json +0 -55
- package/node_modules/glob/sync.js +0 -486
- package/node_modules/inflight/LICENSE +0 -15
- package/node_modules/inflight/README.md +0 -37
- package/node_modules/inflight/inflight.js +0 -54
- package/node_modules/inflight/package.json +0 -29
- package/node_modules/lazystream/LICENSE +0 -23
- package/node_modules/lazystream/README.md +0 -114
- package/node_modules/lazystream/lib/lazystream.js +0 -54
- package/node_modules/lazystream/node_modules/readable-stream/.travis.yml +0 -34
- package/node_modules/lazystream/node_modules/readable-stream/CONTRIBUTING.md +0 -38
- package/node_modules/lazystream/node_modules/readable-stream/GOVERNANCE.md +0 -136
- package/node_modules/lazystream/node_modules/readable-stream/README.md +0 -58
- package/node_modules/lazystream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -60
- package/node_modules/lazystream/node_modules/readable-stream/duplex-browser.js +0 -1
- package/node_modules/lazystream/node_modules/readable-stream/duplex.js +0 -1
- package/node_modules/lazystream/node_modules/readable-stream/lib/_stream_duplex.js +0 -131
- package/node_modules/lazystream/node_modules/readable-stream/lib/_stream_passthrough.js +0 -47
- package/node_modules/lazystream/node_modules/readable-stream/lib/_stream_readable.js +0 -1019
- package/node_modules/lazystream/node_modules/readable-stream/lib/_stream_transform.js +0 -214
- package/node_modules/lazystream/node_modules/readable-stream/lib/_stream_writable.js +0 -685
- package/node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/BufferList.js +0 -78
- package/node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -84
- package/node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
- package/node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
- package/node_modules/lazystream/node_modules/readable-stream/package.json +0 -52
- package/node_modules/lazystream/node_modules/readable-stream/passthrough.js +0 -1
- package/node_modules/lazystream/node_modules/readable-stream/readable-browser.js +0 -7
- package/node_modules/lazystream/node_modules/readable-stream/readable.js +0 -19
- package/node_modules/lazystream/node_modules/readable-stream/transform.js +0 -1
- package/node_modules/lazystream/node_modules/readable-stream/writable-browser.js +0 -1
- package/node_modules/lazystream/node_modules/readable-stream/writable.js +0 -8
- package/node_modules/lazystream/node_modules/safe-buffer/LICENSE +0 -21
- package/node_modules/lazystream/node_modules/safe-buffer/README.md +0 -584
- package/node_modules/lazystream/node_modules/safe-buffer/index.d.ts +0 -187
- package/node_modules/lazystream/node_modules/safe-buffer/index.js +0 -62
- package/node_modules/lazystream/node_modules/safe-buffer/package.json +0 -37
- package/node_modules/lazystream/node_modules/string_decoder/.travis.yml +0 -50
- package/node_modules/lazystream/node_modules/string_decoder/LICENSE +0 -48
- package/node_modules/lazystream/node_modules/string_decoder/README.md +0 -47
- package/node_modules/lazystream/node_modules/string_decoder/lib/string_decoder.js +0 -296
- package/node_modules/lazystream/node_modules/string_decoder/package.json +0 -31
- package/node_modules/lazystream/package.json +0 -46
- package/node_modules/lazystream/test/data.md +0 -13
- package/node_modules/lazystream/test/fs_test.js +0 -69
- package/node_modules/lazystream/test/helper.js +0 -39
- package/node_modules/lazystream/test/pipe_test.js +0 -36
- package/node_modules/lazystream/test/readable_test.js +0 -90
- package/node_modules/lazystream/test/writable_test.js +0 -59
- package/node_modules/listenercount/.npmignore +0 -2
- package/node_modules/listenercount/LICENSE.md +0 -5
- package/node_modules/listenercount/README.md +0 -50
- package/node_modules/listenercount/circle.yml +0 -6
- package/node_modules/listenercount/index.js +0 -16
- package/node_modules/listenercount/package.json +0 -27
- package/node_modules/listenercount/test/test.js +0 -31
- package/node_modules/lodash.defaults/LICENSE +0 -47
- package/node_modules/lodash.defaults/README.md +0 -18
- package/node_modules/lodash.defaults/index.js +0 -668
- package/node_modules/lodash.defaults/package.json +0 -17
- package/node_modules/lodash.difference/LICENSE +0 -47
- package/node_modules/lodash.difference/README.md +0 -18
- package/node_modules/lodash.difference/index.js +0 -1170
- package/node_modules/lodash.difference/package.json +0 -17
- package/node_modules/lodash.flatten/LICENSE +0 -47
- package/node_modules/lodash.flatten/README.md +0 -18
- package/node_modules/lodash.flatten/index.js +0 -349
- package/node_modules/lodash.flatten/package.json +0 -17
- package/node_modules/lodash.isplainobject/LICENSE +0 -47
- package/node_modules/lodash.isplainobject/README.md +0 -18
- package/node_modules/lodash.isplainobject/index.js +0 -139
- package/node_modules/lodash.isplainobject/package.json +0 -17
- package/node_modules/lodash.union/LICENSE +0 -47
- package/node_modules/lodash.union/README.md +0 -18
- package/node_modules/lodash.union/index.js +0 -1181
- package/node_modules/lodash.union/package.json +0 -17
- package/node_modules/minimist/.eslintrc +0 -29
- package/node_modules/minimist/.github/FUNDING.yml +0 -12
- package/node_modules/minimist/.nycrc +0 -14
- package/node_modules/minimist/CHANGELOG.md +0 -298
- package/node_modules/minimist/LICENSE +0 -18
- package/node_modules/minimist/README.md +0 -121
- package/node_modules/minimist/example/parse.js +0 -4
- package/node_modules/minimist/index.js +0 -263
- package/node_modules/minimist/package.json +0 -75
- package/node_modules/minimist/test/all_bool.js +0 -34
- package/node_modules/minimist/test/bool.js +0 -177
- package/node_modules/minimist/test/dash.js +0 -43
- package/node_modules/minimist/test/default_bool.js +0 -37
- package/node_modules/minimist/test/dotted.js +0 -24
- package/node_modules/minimist/test/kv_short.js +0 -32
- package/node_modules/minimist/test/long.js +0 -33
- package/node_modules/minimist/test/num.js +0 -38
- package/node_modules/minimist/test/parse.js +0 -209
- package/node_modules/minimist/test/parse_modified.js +0 -11
- package/node_modules/minimist/test/proto.js +0 -64
- package/node_modules/minimist/test/short.js +0 -69
- package/node_modules/minimist/test/stop_early.js +0 -17
- package/node_modules/minimist/test/unknown.js +0 -104
- package/node_modules/minimist/test/whitespace.js +0 -10
- package/node_modules/mkdirp/LICENSE +0 -21
- package/node_modules/mkdirp/bin/cmd.js +0 -33
- package/node_modules/mkdirp/bin/usage.txt +0 -12
- package/node_modules/mkdirp/index.js +0 -102
- package/node_modules/mkdirp/package.json +0 -33
- package/node_modules/mkdirp/readme.markdown +0 -100
- package/node_modules/once/LICENSE +0 -15
- package/node_modules/once/README.md +0 -79
- package/node_modules/once/once.js +0 -42
- package/node_modules/once/package.json +0 -33
- package/node_modules/path-is-absolute/index.js +0 -20
- package/node_modules/path-is-absolute/license +0 -21
- package/node_modules/path-is-absolute/package.json +0 -43
- package/node_modules/path-is-absolute/readme.md +0 -59
- package/node_modules/readdir-glob/LICENSE +0 -201
- package/node_modules/readdir-glob/README.md +0 -85
- package/node_modules/readdir-glob/index.js +0 -243
- package/node_modules/readdir-glob/node_modules/balanced-match/.github/FUNDING.yml +0 -2
- package/node_modules/readdir-glob/node_modules/balanced-match/LICENSE.md +0 -21
- package/node_modules/readdir-glob/node_modules/balanced-match/README.md +0 -97
- package/node_modules/readdir-glob/node_modules/balanced-match/index.js +0 -62
- package/node_modules/readdir-glob/node_modules/balanced-match/package.json +0 -48
- package/node_modules/readdir-glob/node_modules/brace-expansion/.github/FUNDING.yml +0 -2
- package/node_modules/readdir-glob/node_modules/brace-expansion/LICENSE +0 -21
- package/node_modules/readdir-glob/node_modules/brace-expansion/README.md +0 -157
- package/node_modules/readdir-glob/node_modules/brace-expansion/index.js +0 -394
- package/node_modules/readdir-glob/node_modules/brace-expansion/package.json +0 -49
- package/node_modules/readdir-glob/node_modules/minimatch/LICENSE +0 -15
- package/node_modules/readdir-glob/node_modules/minimatch/README.md +0 -296
- package/node_modules/readdir-glob/node_modules/minimatch/lib/path.js +0 -4
- package/node_modules/readdir-glob/node_modules/minimatch/minimatch.js +0 -996
- package/node_modules/readdir-glob/node_modules/minimatch/package.json +0 -35
- package/node_modules/readdir-glob/package.json +0 -43
- package/node_modules/rimraf/LICENSE +0 -15
- package/node_modules/rimraf/README.md +0 -101
- package/node_modules/rimraf/bin.js +0 -50
- package/node_modules/rimraf/package.json +0 -29
- package/node_modules/rimraf/rimraf.js +0 -372
- package/node_modules/tar-stream/LICENSE +0 -21
- package/node_modules/tar-stream/README.md +0 -168
- package/node_modules/tar-stream/extract.js +0 -257
- package/node_modules/tar-stream/headers.js +0 -295
- package/node_modules/tar-stream/index.js +0 -2
- package/node_modules/tar-stream/pack.js +0 -255
- package/node_modules/tar-stream/package.json +0 -58
- package/node_modules/tar-stream/sandbox.js +0 -11
- package/node_modules/traverse/.npmignore +0 -1
- package/node_modules/traverse/LICENSE +0 -24
- package/node_modules/traverse/README.markdown +0 -247
- package/node_modules/traverse/examples/json.js +0 -16
- package/node_modules/traverse/examples/leaves.js +0 -15
- package/node_modules/traverse/examples/negative.js +0 -8
- package/node_modules/traverse/examples/stringify.js +0 -38
- package/node_modules/traverse/index.js +0 -322
- package/node_modules/traverse/package.json +0 -18
- package/node_modules/traverse/test/circular.js +0 -114
- package/node_modules/traverse/test/date.js +0 -35
- package/node_modules/traverse/test/equal.js +0 -219
- package/node_modules/traverse/test/instance.js +0 -17
- package/node_modules/traverse/test/interface.js +0 -42
- package/node_modules/traverse/test/json.js +0 -47
- package/node_modules/traverse/test/leaves.js +0 -21
- package/node_modules/traverse/test/mutability.js +0 -203
- package/node_modules/traverse/test/negative.js +0 -20
- package/node_modules/traverse/test/obj.js +0 -15
- package/node_modules/traverse/test/stop.js +0 -41
- package/node_modules/traverse/test/stringify.js +0 -36
- package/node_modules/traverse/test/super_deep.js +0 -54
- package/node_modules/unzipper/.circleci/config.yml +0 -13
- package/node_modules/unzipper/.travis.yml +0 -21
- package/node_modules/unzipper/lib/Buffer.js +0 -12
- package/node_modules/unzipper/node_modules/readable-stream/.travis.yml +0 -34
- package/node_modules/unzipper/node_modules/readable-stream/CONTRIBUTING.md +0 -38
- package/node_modules/unzipper/node_modules/readable-stream/GOVERNANCE.md +0 -136
- package/node_modules/unzipper/node_modules/readable-stream/README.md +0 -58
- package/node_modules/unzipper/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -60
- package/node_modules/unzipper/node_modules/readable-stream/duplex-browser.js +0 -1
- package/node_modules/unzipper/node_modules/readable-stream/duplex.js +0 -1
- package/node_modules/unzipper/node_modules/readable-stream/lib/_stream_duplex.js +0 -131
- package/node_modules/unzipper/node_modules/readable-stream/lib/_stream_passthrough.js +0 -47
- package/node_modules/unzipper/node_modules/readable-stream/lib/_stream_readable.js +0 -1019
- package/node_modules/unzipper/node_modules/readable-stream/lib/_stream_transform.js +0 -214
- package/node_modules/unzipper/node_modules/readable-stream/lib/_stream_writable.js +0 -685
- package/node_modules/unzipper/node_modules/readable-stream/lib/internal/streams/BufferList.js +0 -78
- package/node_modules/unzipper/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -84
- package/node_modules/unzipper/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
- package/node_modules/unzipper/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
- package/node_modules/unzipper/node_modules/readable-stream/package.json +0 -52
- package/node_modules/unzipper/node_modules/readable-stream/passthrough.js +0 -1
- package/node_modules/unzipper/node_modules/readable-stream/readable-browser.js +0 -7
- package/node_modules/unzipper/node_modules/readable-stream/readable.js +0 -19
- package/node_modules/unzipper/node_modules/readable-stream/transform.js +0 -1
- package/node_modules/unzipper/node_modules/readable-stream/writable-browser.js +0 -1
- package/node_modules/unzipper/node_modules/readable-stream/writable.js +0 -8
- package/node_modules/unzipper/node_modules/safe-buffer/LICENSE +0 -21
- package/node_modules/unzipper/node_modules/safe-buffer/README.md +0 -584
- package/node_modules/unzipper/node_modules/safe-buffer/index.d.ts +0 -187
- package/node_modules/unzipper/node_modules/safe-buffer/index.js +0 -62
- package/node_modules/unzipper/node_modules/safe-buffer/package.json +0 -37
- package/node_modules/unzipper/node_modules/string_decoder/.travis.yml +0 -50
- package/node_modules/unzipper/node_modules/string_decoder/LICENSE +0 -48
- package/node_modules/unzipper/node_modules/string_decoder/README.md +0 -47
- package/node_modules/unzipper/node_modules/string_decoder/lib/string_decoder.js +0 -296
- package/node_modules/unzipper/node_modules/string_decoder/package.json +0 -31
- package/node_modules/wrappy/LICENSE +0 -15
- package/node_modules/wrappy/README.md +0 -36
- package/node_modules/wrappy/package.json +0 -29
- package/node_modules/wrappy/wrappy.js +0 -33
- package/node_modules/zip-stream/node_modules/archiver-utils/LICENSE +0 -22
- package/node_modules/zip-stream/node_modules/archiver-utils/README.md +0 -6
- package/node_modules/zip-stream/node_modules/archiver-utils/file.js +0 -209
- package/node_modules/zip-stream/node_modules/archiver-utils/index.js +0 -149
- package/node_modules/zip-stream/node_modules/archiver-utils/package.json +0 -54
- /package/node_modules/{archiver-utils → compress-commons}/node_modules/readable-stream/LICENSE +0 -0
- /package/node_modules/{lazystream → crc32-stream}/node_modules/readable-stream/LICENSE +0 -0
- /package/node_modules/{unzipper → zip-stream}/node_modules/readable-stream/LICENSE +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { parseReasoningSelection } from '../../utils/reasoning.js';
|
|
2
|
-
import { resolveRouterModel } from '../../utils/router_catalog.js';
|
|
2
|
+
import { resolveRouterModel, routerModelForSwitch } from '../../utils/router_catalog.js';
|
|
3
3
|
import { getSupportedCodexReasoningEfforts } from '../../utils/models.js';
|
|
4
4
|
import { resolveExecutionSettings } from '../../config/execution.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { openAccountsManager } from './accounts.js';
|
|
6
|
+
import { pendingZergAILogin, runAuthAction, stopZergAILogin } from './auth.js';
|
|
7
7
|
import { setupCommand } from './setup.js';
|
|
8
8
|
import { activatePermissionConfig } from './permissions.js';
|
|
9
9
|
import { PERMISSION_CAPABILITIES } from '../../config/permissions.js';
|
|
@@ -11,14 +11,21 @@ import { activeProfile, builtinProfileEmulation, listConfigProfiles } from '../.
|
|
|
11
11
|
import { switchConfigProfile } from './config_profile_switch.js';
|
|
12
12
|
import { keybindingsCommand } from './keybindings.js';
|
|
13
13
|
import { DEFAULT_CONTEXT_PROGRESS_BAR, resolveTerminalInteractionSettings } from '../../config.js';
|
|
14
|
-
import { loadRouterCredentials } from '../../router_auth.js';
|
|
14
|
+
import { loadRouterCredentials, routingAfterLogout } from '../../router_auth.js';
|
|
15
15
|
import { CODEX_REASONING_EFFORTS } from '../../config/types.js';
|
|
16
16
|
import { customPaneOptions, storedCustomPaneOptions, withCustomPaneOptions, } from '../../config/panes.js';
|
|
17
17
|
import { getMcpServerStatuses } from '../../mcp/registry.js';
|
|
18
18
|
import { hasUsableClaudeCodeCliAuth, isClaudeCliAvailable } from '../backends/claude_cli.js';
|
|
19
|
-
import {
|
|
19
|
+
import { modelForProviderSwitch } from './provider_model_defaults.js';
|
|
20
20
|
import { normalizeProviderId } from '../backends/provider_ids.js';
|
|
21
21
|
import { applyRuntimeModelSelection, getEffectiveModel } from './runtime_model.js';
|
|
22
|
+
import { isBuildableResolvedConfig, unbuildableSelectionMessage } from './config.js';
|
|
23
|
+
import { hasRemovableKey, manageApiKey, promptForMissingDirectKey, removeApiKey, } from './direct_credential_prompt.js';
|
|
24
|
+
import { offerKeyedProviderSwitch } from './provider_selection.js';
|
|
25
|
+
import { API_KEY_PROVIDER_CHOICES, DIRECT_PROVIDER_CHOICES, PROVIDER_CHOICES, canonicalProvider, describeKeySource, isLocalSubscription, isRouterOnlyProvider, modelRouteStatus, } from './provider_choices.js';
|
|
26
|
+
import { describeActiveRoute, describeConnection, describeKeyRow } from './credential_status.js';
|
|
27
|
+
import { runOpenAICompatibleWizard } from './openai_compat_wizard.js';
|
|
28
|
+
import { ZERGAI_LOGIN_BENEFITS, ZERGAI_LOGIN_PITCH } from '../../onboarding/zergai_login.js';
|
|
22
29
|
import { parseGoalTurnCap } from './goal.js';
|
|
23
30
|
import { shutdownAndClearWorkflowRegistry } from '../../workflows/registry_handle.js';
|
|
24
31
|
import { invalidateSkillsCache, preloadSkillsManifest } from '../../skills/registry.js';
|
|
@@ -64,18 +71,88 @@ function withCurrentValue(options, value, label) {
|
|
|
64
71
|
return options;
|
|
65
72
|
return [{ value, label: label(value), description: 'Currently configured' }, ...options];
|
|
66
73
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
/** The first category: how ZTC reaches a model, the ZergAI login and API keys. */
|
|
75
|
+
const CONNECTION = 'Connection';
|
|
76
|
+
/** Config profiles, write scope, reset and subscription accounts. */
|
|
77
|
+
const PROFILE = 'Profile & subscriptions';
|
|
78
|
+
/** Words that open a category directly, beside a part of its own name. */
|
|
79
|
+
const CATEGORY_ALIASES = {
|
|
80
|
+
keys: CONNECTION, key: CONNECTION, 'api-keys': CONNECTION, apikeys: CONNECTION, login: CONNECTION, logout: CONNECTION,
|
|
81
|
+
auth: CONNECTION, zergai: CONNECTION, connect: CONNECTION,
|
|
82
|
+
accounts: PROFILE, account: PROFILE, subscriptions: PROFILE,
|
|
83
|
+
};
|
|
84
|
+
/** A Provider row choice that runs through Zerg Router: `zergrouter:<provider>`. */
|
|
85
|
+
const ROUTER_CHOICE_PREFIX = 'zergrouter:';
|
|
86
|
+
/** The ZergAI row's help: what the login offers. */
|
|
87
|
+
const ZERGAI_LOGIN_HELP = [
|
|
88
|
+
`${ZERGAI_LOGIN_PITCH}. Enter opens the login; its code shows in the transcript.`,
|
|
89
|
+
...ZERGAI_LOGIN_BENEFITS.map(benefit => `• ${benefit}`),
|
|
90
|
+
].join('\n');
|
|
91
|
+
/** Local subscription logins, each a family in the account manager. */
|
|
92
|
+
const LOCAL_LOGINS = [
|
|
93
|
+
{ id: 'claude_code', label: 'Claude Code login', family: 'Claude', alsoReady: [] },
|
|
94
|
+
{ id: 'codex_app_server', label: 'Codex login', family: 'Codex', alsoReady: ['codex_legacy'] },
|
|
95
|
+
{ id: 'kimi_code', label: 'Kimi Code login', family: 'Kimi', alsoReady: [] },
|
|
78
96
|
];
|
|
97
|
+
/** A provider's label as PROVIDER_CHOICES names it. */
|
|
98
|
+
function providerChoiceLabel(provider, fallback) {
|
|
99
|
+
return PROVIDER_CHOICES.find(choice => choice.id === provider)?.label ?? fallback ?? provider;
|
|
100
|
+
}
|
|
101
|
+
/** A key row's help: what it does now, and what Enter offers. */
|
|
102
|
+
function keyRowHelp(ctx, provider, label) {
|
|
103
|
+
const source = ctx.config.getApiKeySource(provider);
|
|
104
|
+
switch (source.kind) {
|
|
105
|
+
case 'saved': return 'Saved in your ZTC config. Enter to replace it, use an environment variable, or remove it.';
|
|
106
|
+
case 'env-ref': return source.set ? `Read from $${source.name}. Enter to change it or stop reading it.`
|
|
107
|
+
: `$${source.name} is not set in this ZTC process${source.fallback?.kind === 'saved' ? ', so ZTC uses the saved key'
|
|
108
|
+
: source.fallback ? `, so ZTC uses $${source.fallback.name}` : ''}. Enter to fix the name or stop reading it.`;
|
|
109
|
+
case 'env-default': return `Read from $${source.name} in your environment. Enter to save a different key or name another variable.`;
|
|
110
|
+
case 'login': return 'Uses a local login. Enter to manage it.';
|
|
111
|
+
case 'none': return `Enter to paste your ${label} key or name the environment variable that holds it.`;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/** The custom endpoint row's help: what it is, its key when it has one, and what Enter offers. */
|
|
115
|
+
function customEndpointHelp(ctx) {
|
|
116
|
+
const intro = 'An OpenAI-compatible server: Ollama, vLLM, LM Studio or a gateway.';
|
|
117
|
+
const source = ctx.config.getApiKeySource('openai_compatible');
|
|
118
|
+
const key = source.kind === 'none' ? '' : ` Key: ${describeKeyRow(ctx.config, 'openai_compatible')}.`;
|
|
119
|
+
return `${intro}${key} ${hasRemovableKey(source) ? 'Enter to edit it or remove its key.' : 'Enter to set its URL, model and key.'}`;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The Provider row's value: a Zerg Router choice when the selection runs
|
|
123
|
+
* through Zerg Router (or can only run there), otherwise the provider itself.
|
|
124
|
+
*/
|
|
125
|
+
function providerRowValue(ctx, route = describeActiveRoute(ctx.config)) {
|
|
126
|
+
const provider = normalizeProviderId(ctx.config.getProvider());
|
|
127
|
+
return route.kind === 'router' || isRouterOnlyProvider(provider) ? `${ROUTER_CHOICE_PREFIX}${provider}` : provider;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The Provider row's choices, each naming its route as /model does: Zerg
|
|
131
|
+
* Router choices (every catalog provider once logged in with ZergAI), then
|
|
132
|
+
* every local provider with its key or login state.
|
|
133
|
+
*/
|
|
134
|
+
function providerRowOptions(ctx, { signedIn, route, ready }) {
|
|
135
|
+
const provider = normalizeProviderId(ctx.config.getProvider());
|
|
136
|
+
const catalog = ctx.config.getRouterCatalog?.();
|
|
137
|
+
const owners = catalog?.version === 1
|
|
138
|
+
? [...new Map(catalog.models.filter(row => row.capabilities?.chat)
|
|
139
|
+
.map(row => [row.owned_by, row.provider_display_name])).entries()]
|
|
140
|
+
: [['modal', undefined], ...(route.kind === 'router' && provider !== 'modal' ? [[provider, undefined]] : [])];
|
|
141
|
+
return [
|
|
142
|
+
...owners.map(([owner, displayName]) => ({
|
|
143
|
+
value: `${ROUTER_CHOICE_PREFIX}${owner}`,
|
|
144
|
+
label: `${providerChoiceLabel(owner, displayName)} · Zerg Router`,
|
|
145
|
+
description: signedIn ? 'Zerg Router · your ZergAI login' : 'Zerg Router · log in with ZergAI first (Connection)',
|
|
146
|
+
})),
|
|
147
|
+
...DIRECT_PROVIDER_CHOICES.map(choice => ({
|
|
148
|
+
value: choice.id,
|
|
149
|
+
label: choice.label,
|
|
150
|
+
description: isLocalSubscription(choice.id) ? `Local login · ${ready.has(choice.id) ? 'ready' : 'sign in from /accounts'}`
|
|
151
|
+
: choice.id === 'openai_compatible' ? `Custom endpoint · ${ready.has(choice.id) ? 'set' : 'not set'}`
|
|
152
|
+
: `Local API key · ${describeKeySource(ctx.config.getApiKeySource(choice.id))}`,
|
|
153
|
+
})),
|
|
154
|
+
];
|
|
155
|
+
}
|
|
79
156
|
function toggleSetting(name, label, enabled, description) {
|
|
80
157
|
return {
|
|
81
158
|
name, label, value: String(enabled), type: 'select', description,
|
|
@@ -128,9 +205,36 @@ function routerLoginOrigin(config, storedOrigin) {
|
|
|
128
205
|
return undefined;
|
|
129
206
|
}
|
|
130
207
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
208
|
+
/**
|
|
209
|
+
* The ZergAI row: log in, cancel a login still waiting for approval, or log
|
|
210
|
+
* out (after a confirmation, since one Enter would otherwise end the session).
|
|
211
|
+
*/
|
|
212
|
+
function zergaiLoginRow(ctx, config, credentials, signedIn) {
|
|
213
|
+
const keywords = ['login', 'log in', 'logout', 'log out', 'sign in', 'sign out', 'router', 'zerg router', 'zergai', 'account'];
|
|
214
|
+
const waiting = pendingZergAILogin();
|
|
215
|
+
if (waiting) {
|
|
216
|
+
return {
|
|
217
|
+
name: 'zergaiLogin', label: 'Cancel the ZergAI login', value: 'Waiting for approval', type: 'text', keywords,
|
|
218
|
+
description: `A login is waiting for approval in your browser at ${waiting}; its code is in the transcript. Enter to cancel it.`,
|
|
219
|
+
onActivate: () => {
|
|
220
|
+
const cancelled = stopZergAILogin(content => ctx.addMessage({ role: 'system', content }));
|
|
221
|
+
void openSettings(ctx, { category: CONNECTION, setting: 'zergaiLogin',
|
|
222
|
+
...(cancelled ? { notice: { text: '✓ Cancelled the ZergAI login.', tone: 'success' } } : {}) });
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
if (signedIn && credentials) {
|
|
227
|
+
return {
|
|
228
|
+
name: 'zergaiLogin', label: 'Log out of ZergAI', value: `Signed in to ${credentials.origin}`, type: 'text', keywords,
|
|
229
|
+
description: `Enter to log out of Zerg Router at ${credentials.origin}. ZTC asks first.`,
|
|
230
|
+
onActivate: () => confirmZergAILogout(ctx, credentials),
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
return {
|
|
234
|
+
name: 'zergaiLogin', label: 'Log in with ZergAI', value: credentials ? 'Session expired' : 'Not signed in', type: 'text',
|
|
235
|
+
description: ZERGAI_LOGIN_HELP, keywords,
|
|
236
|
+
onActivate: () => runZergAILogin(ctx, 'login', routerLoginOrigin(config, credentials?.origin)),
|
|
237
|
+
};
|
|
134
238
|
}
|
|
135
239
|
export async function buildSettingsCategories(ctx) {
|
|
136
240
|
const config = ctx.config.get();
|
|
@@ -151,6 +255,9 @@ export async function buildSettingsCategories(ctx) {
|
|
|
151
255
|
const configScope = ctx.config.getConfigScope?.() || 'global';
|
|
152
256
|
const authMode = ctx.config.getAuthMode?.() || config.authMode || 'auto';
|
|
153
257
|
const zergProxyUrl = config.zergProxyUrl || '';
|
|
258
|
+
const activeRoute = describeActiveRoute(ctx.config);
|
|
259
|
+
// Probes local logins, so once per build.
|
|
260
|
+
const localReady = new Set(modelRouteStatus(ctx.config).directProviders);
|
|
154
261
|
const zergEndpoint = config.zergEndpoint || '';
|
|
155
262
|
const openaiCompat = ctx.config.getOpenAICompatibleSettings?.() || config.openaiCompatible || {};
|
|
156
263
|
const contextProgressBar = contextProgressBarConfig(config);
|
|
@@ -233,8 +340,8 @@ export async function buildSettingsCategories(ctx) {
|
|
|
233
340
|
value: '',
|
|
234
341
|
type: 'text',
|
|
235
342
|
description: builtinProfileEmulation(activeProfile())
|
|
236
|
-
? 'Clear shared default settings, including stored API keys and account registrations, and
|
|
237
|
-
: 'Clear saved settings for this profile, including stored API keys and account registrations, and its
|
|
343
|
+
? 'Clear shared default settings, including stored API keys and account registrations, and the ZergAI login. Sessions and managed account directories stay on disk.'
|
|
344
|
+
: 'Clear saved settings for this profile, including stored API keys and account registrations, and its ZergAI login. Sessions and managed account directories stay on disk.',
|
|
238
345
|
},
|
|
239
346
|
],
|
|
240
347
|
},
|
|
@@ -255,8 +362,9 @@ export async function buildSettingsCategories(ctx) {
|
|
|
255
362
|
label: 'Manage accounts',
|
|
256
363
|
value: 'Claude · Codex · Kimi',
|
|
257
364
|
type: 'text',
|
|
258
|
-
description: '
|
|
259
|
-
|
|
365
|
+
description: 'Subscription logins: switch accounts, check usage, or refresh a stale sign-in.',
|
|
366
|
+
keywords: ['subscriptions', 'local login', 'claude code', 'codex', 'kimi code'],
|
|
367
|
+
onActivate: () => openAccountsFromSettings(ctx, undefined, { category: PROFILE, setting: 'manageAccounts' }),
|
|
260
368
|
}],
|
|
261
369
|
},
|
|
262
370
|
{
|
|
@@ -266,12 +374,12 @@ export async function buildSettingsCategories(ctx) {
|
|
|
266
374
|
name: 'provider',
|
|
267
375
|
label: 'Provider',
|
|
268
376
|
// getProvider() returns the raw stored id, which may be an alias
|
|
269
|
-
// (e.g. "codex" -> "codex_legacy")
|
|
270
|
-
|
|
271
|
-
value: normalizeProviderId(provider),
|
|
377
|
+
// (e.g. "codex" -> "codex_legacy"); providerRowValue normalizes it.
|
|
378
|
+
value: providerRowValue(ctx, activeRoute),
|
|
272
379
|
type: 'select',
|
|
273
|
-
options:
|
|
274
|
-
|
|
380
|
+
options: withCurrentValue(providerRowOptions(ctx, { signedIn: routerSignedIn, route: activeRoute, ready: localReady }), providerRowValue(ctx, activeRoute), value => value),
|
|
381
|
+
description: `Now ${activeRoute.kind === 'router' ? 'through Zerg Router' : 'on this machine'}. `
|
|
382
|
+
+ 'Zerg Router choices use your ZergAI login; the others call the provider directly.',
|
|
275
383
|
},
|
|
276
384
|
{
|
|
277
385
|
name: 'model',
|
|
@@ -307,60 +415,72 @@ export async function buildSettingsCategories(ctx) {
|
|
|
307
415
|
],
|
|
308
416
|
},
|
|
309
417
|
{
|
|
310
|
-
name: '
|
|
418
|
+
name: 'Connection',
|
|
311
419
|
settings: [
|
|
312
|
-
{
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
420
|
+
{
|
|
421
|
+
// The status is the row's label, so it spans the pane: route and
|
|
422
|
+
// model names are long, and the value column is narrow.
|
|
423
|
+
name: 'connectionStatus',
|
|
424
|
+
label: describeConnection(ctx.config, activeRoute),
|
|
425
|
+
value: '',
|
|
426
|
+
type: 'text',
|
|
427
|
+
description: 'How ZTC reaches a model. Enter to change the provider or model.',
|
|
428
|
+
keywords: ['route', 'connected', 'model'],
|
|
429
|
+
onActivate: () => { void openSettings(ctx, { category: 'Provider & Model', setting: 'provider' }); },
|
|
430
|
+
},
|
|
431
|
+
zergaiLoginRow(ctx, config, routerCredentials, routerSignedIn),
|
|
432
|
+
...API_KEY_PROVIDER_CHOICES.map(choice => ({
|
|
433
|
+
name: `key_${choice.id}`,
|
|
434
|
+
label: `${choice.label} API key`,
|
|
435
|
+
value: describeKeyRow(ctx.config, choice.id),
|
|
436
|
+
type: 'text',
|
|
437
|
+
description: keyRowHelp(ctx, choice.id, choice.label),
|
|
438
|
+
keywords: ['keys', 'api key', 'api keys', choice.id, ...('aliases' in choice ? choice.aliases ?? [] : [])],
|
|
439
|
+
onActivate: () => openKeyRow(ctx, choice.id, choice.label),
|
|
440
|
+
})),
|
|
441
|
+
{
|
|
442
|
+
name: 'customEndpoint',
|
|
443
|
+
// Short, so the value column keeps room for the status line.
|
|
444
|
+
label: 'Custom endpoint…',
|
|
445
|
+
value: openaiCompat.baseUrl || config.openaiCompatibleBaseUrl || 'not set',
|
|
446
|
+
type: 'text',
|
|
447
|
+
description: customEndpointHelp(ctx),
|
|
448
|
+
keywords: ['openai-compatible', 'openai compatible', 'ollama', 'vllm', 'local model', 'endpoint', 'api key'],
|
|
449
|
+
onActivate: () => openCustomEndpointRow(ctx),
|
|
450
|
+
},
|
|
451
|
+
...LOCAL_LOGINS.map(login => ({
|
|
452
|
+
name: `localLogin_${login.id}`,
|
|
453
|
+
label: login.label,
|
|
454
|
+
value: [login.id, ...login.alsoReady].some(id => localReady.has(id)) ? 'Signed in' : 'Not signed in',
|
|
455
|
+
type: 'text',
|
|
456
|
+
description: `Uses your local ${login.family} subscription. Enter to manage its accounts (/accounts).`,
|
|
457
|
+
keywords: ['login', 'local login', 'subscription', 'accounts', 'sign in'],
|
|
458
|
+
onActivate: () => openAccountsFromSettings(ctx, login.family, { category: CONNECTION, setting: `localLogin_${login.id}` }),
|
|
459
|
+
})),
|
|
319
460
|
],
|
|
320
461
|
},
|
|
321
462
|
{
|
|
322
|
-
name: '
|
|
463
|
+
name: 'Advanced routing',
|
|
323
464
|
settings: [
|
|
324
|
-
{
|
|
325
|
-
name: 'zrouterAuth',
|
|
326
|
-
label: routerSignedIn ? 'Log out of ZRouter' : 'Log in to ZRouter',
|
|
327
|
-
value: routerSignedIn ? `Signed in to ${routerCredentials.origin}` : routerCredentials ? 'Session expired' : 'Not signed in',
|
|
328
|
-
type: 'text',
|
|
329
|
-
description: routerSignedIn
|
|
330
|
-
? 'Revoke this Router session and restore the routing settings from before login.'
|
|
331
|
-
: 'Open the Router login in your browser. The confirmation code appears in the transcript.',
|
|
332
|
-
onActivate: async () => {
|
|
333
|
-
ctx.settingsPanel?.closeSettingsPanel?.();
|
|
334
|
-
const action = routerSignedIn ? 'logout' : 'login';
|
|
335
|
-
const origin = routerLoginOrigin(config, routerCredentials?.origin);
|
|
336
|
-
try {
|
|
337
|
-
await authCommand.handler(action === 'login' && origin ? [action, '--url', origin] : [action], ctx);
|
|
338
|
-
if (await routerSessionIsCurrent() !== routerSignedIn) {
|
|
339
|
-
await settingsCommand.handler(['auth'], ctx);
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
catch (error) {
|
|
343
|
-
ctx.addMessage({ role: 'system', content: error instanceof Error ? error.message : 'ZRouter authentication failed.' });
|
|
344
|
-
}
|
|
345
|
-
},
|
|
346
|
-
},
|
|
347
465
|
{
|
|
348
466
|
name: 'authMode',
|
|
349
|
-
label: '
|
|
467
|
+
label: 'Routing',
|
|
350
468
|
value: authMode,
|
|
351
469
|
type: 'select',
|
|
352
470
|
options: [
|
|
353
|
-
{ value: 'auto', label: 'auto', description: '
|
|
354
|
-
{ value: 'direct', label: 'direct', description: '
|
|
355
|
-
{ value: 'zrouter', label: 'zrouter', description: '
|
|
471
|
+
{ value: 'auto', label: 'auto', description: 'Zerg Router while you are logged in with ZergAI, except local logins and a Gemini API key; otherwise local API keys' },
|
|
472
|
+
{ value: 'direct', label: 'direct · local keys only', description: 'Local API keys only; never Zerg Router' },
|
|
473
|
+
{ value: 'zrouter', label: 'zrouter · Zerg Router only', description: 'Zerg Router only, with your ZergAI login' },
|
|
356
474
|
],
|
|
475
|
+
keywords: ['router', 'zerg router', 'routing mode', 'auth mode'],
|
|
357
476
|
},
|
|
358
477
|
{
|
|
359
478
|
name: 'zergProxyUrl',
|
|
360
|
-
label: '
|
|
479
|
+
label: 'Zerg Router URL',
|
|
361
480
|
value: zergProxyUrl,
|
|
362
481
|
type: 'text',
|
|
363
|
-
placeholder: 'blank disables stored
|
|
482
|
+
placeholder: 'blank disables the stored URL; env ZERG_PROXY_URL may still override',
|
|
483
|
+
keywords: ['router'],
|
|
364
484
|
},
|
|
365
485
|
{
|
|
366
486
|
name: 'zergEndpoint',
|
|
@@ -387,31 +507,31 @@ export async function buildSettingsCategories(ctx) {
|
|
|
387
507
|
settings: [
|
|
388
508
|
{
|
|
389
509
|
name: 'openaiCompatibleBaseUrl',
|
|
390
|
-
label: '
|
|
510
|
+
label: 'Custom endpoint URL',
|
|
391
511
|
value: openaiCompat.baseUrl || config.openaiCompatibleBaseUrl || '',
|
|
392
512
|
type: 'text',
|
|
393
513
|
placeholder: 'http://localhost:11434/v1',
|
|
394
|
-
description: 'Used when
|
|
514
|
+
description: 'Used when the custom endpoint is the selected provider. Connection sets it up with its key.',
|
|
395
515
|
},
|
|
396
516
|
{
|
|
397
517
|
name: 'openaiCompatibleApiPath',
|
|
398
|
-
label: '
|
|
518
|
+
label: 'Custom endpoint path',
|
|
399
519
|
value: openaiCompat.apiPath || '/chat/completions',
|
|
400
520
|
type: 'text',
|
|
401
521
|
placeholder: '/chat/completions',
|
|
402
|
-
description: 'Used when
|
|
522
|
+
description: 'Used when the custom endpoint is the selected provider.',
|
|
403
523
|
},
|
|
404
524
|
{
|
|
405
525
|
name: 'openaiCompatibleModel',
|
|
406
|
-
label: '
|
|
526
|
+
label: 'Custom endpoint model',
|
|
407
527
|
value: openaiCompat.defaultModel || '',
|
|
408
528
|
type: 'text',
|
|
409
529
|
placeholder: 'llama3.1, qwen2.5-coder, ...',
|
|
410
|
-
description: 'Used when
|
|
530
|
+
description: 'Used when the custom endpoint is the selected provider.',
|
|
411
531
|
},
|
|
412
|
-
{ name: 'openaiCompatibleLabel', label: '
|
|
532
|
+
{ name: 'openaiCompatibleLabel', label: 'Custom endpoint label', value: openaiCompat.label ?? '', type: 'text', placeholder: 'Custom Endpoint' },
|
|
413
533
|
configuredSetting(ctx, 'openaiCompatibleHeaders', 'Custom endpoint headers', `${Object.keys(openaiCompat.headers ?? {}).length} configured`, 'Edit openaiCompatible.headers in ~/.ztc/config.json. Header values are not displayed here.'),
|
|
414
|
-
configuredSetting(ctx, 'openaiCompatibleSystemPromptSuffix', '
|
|
534
|
+
configuredSetting(ctx, 'openaiCompatibleSystemPromptSuffix', 'Custom endpoint prompt suffix', openaiCompat.systemPromptSuffix ? `${openaiCompat.systemPromptSuffix.length} characters` : 'none', 'Edit openaiCompatible.systemPromptSuffix in ~/.ztc/config.json.'),
|
|
415
535
|
],
|
|
416
536
|
},
|
|
417
537
|
{
|
|
@@ -419,18 +539,18 @@ export async function buildSettingsCategories(ctx) {
|
|
|
419
539
|
settings: [
|
|
420
540
|
{
|
|
421
541
|
name: 'claudeCodeStatus',
|
|
422
|
-
label: 'CLI
|
|
542
|
+
label: 'Claude Code CLI token',
|
|
423
543
|
value: claudeCodeStatus,
|
|
424
544
|
type: 'select',
|
|
425
545
|
options: [
|
|
426
546
|
{ value: claudeCodeStatus, label: claudeCodeStatus, description: 'Run: claude /login && claude setup-token; export CLAUDE_CODE_OAUTH_TOKEN' },
|
|
427
547
|
],
|
|
428
548
|
// The login state is worth seeing whatever provider is selected: it is
|
|
429
|
-
// what makes choosing Claude Code possible at all.
|
|
549
|
+
// what makes choosing Claude Code possible at all. The label says so.
|
|
430
550
|
},
|
|
431
551
|
{
|
|
432
552
|
name: 'claudeCodeModel',
|
|
433
|
-
label: '
|
|
553
|
+
label: 'Claude Code model',
|
|
434
554
|
value: provider === 'claude_code' ? model : 'sonnet',
|
|
435
555
|
type: 'select',
|
|
436
556
|
options: [
|
|
@@ -547,13 +667,32 @@ export async function buildSettingsCategories(ctx) {
|
|
|
547
667
|
type: 'select',
|
|
548
668
|
options: [
|
|
549
669
|
{ value: 'summary', label: 'summary', description: 'Rewrite old turns into a lossy summary (default)' },
|
|
550
|
-
{ value: 'jev', label: 'jev', description: 'Delete only the tool calls and outputs Jev says are stale; everything kept stays verbatim. Requires a
|
|
670
|
+
{ value: 'jev', label: 'jev', description: 'Delete only the tool calls and outputs Jev says are stale; everything kept stays verbatim. Requires a ZergAI login (Connection). Falls back to summary if Jev is unreachable.' },
|
|
551
671
|
],
|
|
552
672
|
},
|
|
553
673
|
{ name: 'jevModel', label: 'Jev model', value: compaction.jev.model, type: 'text', placeholder: DEFAULT_JEV_SETTINGS.model, description: 'Applies when Strategy is jev.' },
|
|
554
674
|
{ name: 'jevKeepThreshold', label: 'Jev keep threshold', value: String(compaction.jev.keepThreshold), type: 'text', placeholder: '0.5', description: 'Applies when Strategy is jev.' },
|
|
555
675
|
{ name: 'jevPreserveRecent', label: 'Jev protect recent messages', value: String(compaction.jev.preserveRecentMessages), type: 'text', placeholder: '6', description: 'Applies when Strategy is jev.' },
|
|
556
676
|
{ name: 'jevMaxStateTokens', label: 'Jev state budget (tokens)', value: String(compaction.jev.maxStateTokens), type: 'text', placeholder: '25000', description: 'Applies when Strategy is jev.' },
|
|
677
|
+
{
|
|
678
|
+
name: 'idleCompaction',
|
|
679
|
+
label: 'Compact before the cache expires',
|
|
680
|
+
value: config.idleCompaction === false ? 'off' : 'on',
|
|
681
|
+
type: 'select',
|
|
682
|
+
options: [
|
|
683
|
+
{ value: 'on', label: 'on', description: 'Compact an idle session just before its prompt cache expires (default)' },
|
|
684
|
+
{ value: 'off', label: 'off', description: 'Never compact while idle' },
|
|
685
|
+
],
|
|
686
|
+
description: 'Interactive sessions only. Fires once when the agent is idle with no pending work, so the next message starts from a warm, small context.',
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
name: 'promptCacheTtlMs',
|
|
690
|
+
label: 'Prompt cache lifetime (seconds)',
|
|
691
|
+
value: config.promptCacheTtlMs === undefined ? '' : String(Math.round(config.promptCacheTtlMs / 1000)),
|
|
692
|
+
type: 'text',
|
|
693
|
+
placeholder: 'provider default',
|
|
694
|
+
description: 'How long the provider caches the prompt, in seconds. Anthropic follows ZTC_PROMPT_CACHE_TTL. Leave blank for a provider ZTC has no lifetime for, which then never fires on a guess.',
|
|
695
|
+
},
|
|
557
696
|
],
|
|
558
697
|
},
|
|
559
698
|
{
|
|
@@ -928,8 +1067,8 @@ export async function buildSettingsCategories(ctx) {
|
|
|
928
1067
|
{ name: 'shannonApiBaseUrl', label: 'Shannon API URL', value: config.shannon?.apiBaseUrl ?? '', type: 'text' },
|
|
929
1068
|
configuredSetting(ctx, 'hostedThreadInstructions', 'Hosted instructions', config.hostedThreadInstructions ? 'configured' : 'none', 'Managed by the hosted session; content is not shown in settings.'),
|
|
930
1069
|
configuredSetting(ctx, 'zrouterRoutePlan', 'Hosted route plan', config.zrouterRoutePlan ? 'configured' : 'none', 'Managed by the hosted session.'),
|
|
931
|
-
configuredSetting(ctx, 'auth', '
|
|
932
|
-
configuredSetting(ctx, 'apiKey', 'Legacy API key', config.apiKey ? 'configured' : 'none', 'Use the
|
|
1070
|
+
configuredSetting(ctx, 'auth', 'Legacy ZergAI token', config.auth?.email ?? 'none', 'An older platform login. Log in with ZergAI from Connection.'),
|
|
1071
|
+
configuredSetting(ctx, 'apiKey', 'Legacy API key', config.apiKey ? 'configured' : 'none', 'Use the API key rows on Connection. Secret values are never displayed here.'),
|
|
933
1072
|
{ name: 'codexAppServerCommand', label: 'Codex App Server command', value: config.codexAppServer?.command ?? 'codex', type: 'text' },
|
|
934
1073
|
{ name: 'codexAppServerArgs', label: 'Codex App Server arguments', value: JSON.stringify(config.codexAppServer?.args ?? ['app-server']), type: 'text', description: 'JSON array of arguments.' },
|
|
935
1074
|
configuredSetting(ctx, 'codexAppServerLoginFlow', 'Codex login flow', config.codexAppServer?.loginFlow ?? 'cached', 'The App Server currently uses cached credentials; this stored field is informational.'),
|
|
@@ -949,9 +1088,8 @@ export async function buildSettingsCategories(ctx) {
|
|
|
949
1088
|
}),
|
|
950
1089
|
});
|
|
951
1090
|
return [
|
|
952
|
-
group(
|
|
1091
|
+
group(CONNECTION, 'Connection'),
|
|
953
1092
|
group('Provider & Model', 'Provider & Model', 'Claude Code'),
|
|
954
|
-
group('Auth & Routing', 'Auth & Routing', 'API Keys', 'Custom Endpoint'),
|
|
955
1093
|
group('Behavior', 'Behavior', 'Retries & Timeouts', 'Automation', 'Execution'),
|
|
956
1094
|
group('Context Compaction', 'Context Compaction', 'Context Storage'),
|
|
957
1095
|
group('Tools & Security', 'Tool Access'),
|
|
@@ -959,6 +1097,8 @@ export async function buildSettingsCategories(ctx) {
|
|
|
959
1097
|
group('Status Line', 'Status Line', 'Context Progress Bar'),
|
|
960
1098
|
group('Integrations', 'MCP Servers', 'Runtime Integrations'),
|
|
961
1099
|
group('Sound', 'Sound', 'Voice & Dictation'),
|
|
1100
|
+
group('Advanced routing', 'Advanced routing', 'Custom Endpoint'),
|
|
1101
|
+
group(PROFILE, 'Config Scope', 'Accounts'),
|
|
962
1102
|
];
|
|
963
1103
|
}
|
|
964
1104
|
/** Summary for the custom-option row: what the chooser will actually offer. */
|
|
@@ -1113,25 +1253,16 @@ function applySettingChange(ctx, setting, value) {
|
|
|
1113
1253
|
}
|
|
1114
1254
|
switch (setting) {
|
|
1115
1255
|
case 'provider':
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
ctx.config.set('model', selected.id);
|
|
1125
|
-
break;
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
ctx.config.setProvider(value);
|
|
1129
|
-
{
|
|
1130
|
-
const resetModel = resolveModelForProviderChange(value, getEffectiveModel(ctx));
|
|
1131
|
-
if (resetModel)
|
|
1132
|
-
ctx.config.set('model', resetModel);
|
|
1133
|
-
}
|
|
1256
|
+
case 'claudeCodeModel': {
|
|
1257
|
+
// The route is part of the choice: a local provider never runs through
|
|
1258
|
+
// Zerg Router because routing happened to be automatic.
|
|
1259
|
+
const selection = plannedModelSelection(ctx, setting, value);
|
|
1260
|
+
ctx.config.setProvider(selection.provider);
|
|
1261
|
+
ctx.config.set('model', selection.model);
|
|
1262
|
+
if (selection.authMode)
|
|
1263
|
+
ctx.config.set('authMode', selection.authMode);
|
|
1134
1264
|
break;
|
|
1265
|
+
}
|
|
1135
1266
|
case 'model':
|
|
1136
1267
|
ctx.config.set('model', value);
|
|
1137
1268
|
break;
|
|
@@ -1166,10 +1297,6 @@ function applySettingChange(ctx, setting, value) {
|
|
|
1166
1297
|
case 'codexFastMode':
|
|
1167
1298
|
ctx.config.set('codexFastMode', value === 'true');
|
|
1168
1299
|
break;
|
|
1169
|
-
case 'claudeCodeModel':
|
|
1170
|
-
ctx.config.setProvider('claude_code');
|
|
1171
|
-
ctx.config.set('model', value);
|
|
1172
|
-
break;
|
|
1173
1300
|
case 'claudeCodeStatus':
|
|
1174
1301
|
// Read-only informational setting.
|
|
1175
1302
|
break;
|
|
@@ -1178,31 +1305,6 @@ function applySettingChange(ctx, setting, value) {
|
|
|
1178
1305
|
// opens. A renderer without that surface must not store a typed line over
|
|
1179
1306
|
// the list, so refuse rather than corrupt the entries.
|
|
1180
1307
|
throw new Error('Custom pane options are edited from the manager on this row (Enter).');
|
|
1181
|
-
case 'key_anthropic':
|
|
1182
|
-
ctx.config.setApiKey(value, 'anthropic');
|
|
1183
|
-
break;
|
|
1184
|
-
case 'key_openai':
|
|
1185
|
-
ctx.config.setApiKey(value, 'openai');
|
|
1186
|
-
break;
|
|
1187
|
-
case 'key_gemini':
|
|
1188
|
-
ctx.config.setApiKey(value, 'gemini');
|
|
1189
|
-
break;
|
|
1190
|
-
case 'key_inception':
|
|
1191
|
-
ctx.config.setApiKey(value, 'inception');
|
|
1192
|
-
break;
|
|
1193
|
-
case 'key_kimi':
|
|
1194
|
-
ctx.config.setApiKey(value, 'kimi');
|
|
1195
|
-
ctx.config.setApiKey(value, 'moonshot');
|
|
1196
|
-
break;
|
|
1197
|
-
case 'key_clarifai':
|
|
1198
|
-
ctx.config.setApiKey(value, 'clarifai');
|
|
1199
|
-
break;
|
|
1200
|
-
case 'key_openai_compatible':
|
|
1201
|
-
if (ctx.config.setOpenAICompatibleSettings)
|
|
1202
|
-
ctx.config.setOpenAICompatibleSettings({ apiKey: value || undefined });
|
|
1203
|
-
else
|
|
1204
|
-
ctx.config.setApiKey(value, 'openai_compatible');
|
|
1205
|
-
break;
|
|
1206
1308
|
case 'authMode':
|
|
1207
1309
|
if (ctx.config.setAuthMode)
|
|
1208
1310
|
ctx.config.setAuthMode(value);
|
|
@@ -1320,6 +1422,32 @@ function applySettingChange(ctx, setting, value) {
|
|
|
1320
1422
|
ctx.config.set('contextTokenBudget', budget);
|
|
1321
1423
|
break;
|
|
1322
1424
|
}
|
|
1425
|
+
case 'idleCompaction': {
|
|
1426
|
+
if (ctx.config.setIdleCompaction)
|
|
1427
|
+
ctx.config.setIdleCompaction(value !== 'off');
|
|
1428
|
+
else
|
|
1429
|
+
ctx.config.set('idleCompaction', value !== 'off');
|
|
1430
|
+
break;
|
|
1431
|
+
}
|
|
1432
|
+
case 'promptCacheTtlMs': {
|
|
1433
|
+
if (value.trim() === '') {
|
|
1434
|
+
if (ctx.config.setPromptCacheTtlMs)
|
|
1435
|
+
ctx.config.setPromptCacheTtlMs(undefined);
|
|
1436
|
+
else
|
|
1437
|
+
ctx.config.set('promptCacheTtlMs', undefined);
|
|
1438
|
+
break;
|
|
1439
|
+
}
|
|
1440
|
+
const seconds = Number(value);
|
|
1441
|
+
if (!Number.isFinite(seconds) || seconds <= 0) {
|
|
1442
|
+
throw new Error('Prompt cache lifetime must be a positive number of seconds, or blank.');
|
|
1443
|
+
}
|
|
1444
|
+
const ms = Math.round(seconds * 1000);
|
|
1445
|
+
if (ctx.config.setPromptCacheTtlMs)
|
|
1446
|
+
ctx.config.setPromptCacheTtlMs(ms);
|
|
1447
|
+
else
|
|
1448
|
+
ctx.config.set('promptCacheTtlMs', ms);
|
|
1449
|
+
break;
|
|
1450
|
+
}
|
|
1323
1451
|
case 'maxIterations': {
|
|
1324
1452
|
if (value === 'off') {
|
|
1325
1453
|
ctx.config.set('maxIterations', undefined);
|
|
@@ -1769,6 +1897,79 @@ function applySettingChange(ctx, setting, value) {
|
|
|
1769
1897
|
throw new Error(`Unknown setting: ${setting}`);
|
|
1770
1898
|
}
|
|
1771
1899
|
}
|
|
1900
|
+
/** Rows that choose what the agent runs on. */
|
|
1901
|
+
const MODEL_SELECTION_SETTINGS = new Set(['provider', 'model', 'claudeCodeModel']);
|
|
1902
|
+
/** The provider, model and route a provider or model row selects. */
|
|
1903
|
+
function plannedModelSelection(ctx, setting, value) {
|
|
1904
|
+
const current = ctx.config.getProvider();
|
|
1905
|
+
if (setting === 'model')
|
|
1906
|
+
return { provider: current, model: value };
|
|
1907
|
+
if (setting === 'claudeCodeModel')
|
|
1908
|
+
return { provider: 'claude_code', model: value, authMode: 'direct' };
|
|
1909
|
+
const choice = value.startsWith(ROUTER_CHOICE_PREFIX) ? value.slice(ROUTER_CHOICE_PREFIX.length) : value;
|
|
1910
|
+
const provider = canonicalProvider(choice) ?? choice;
|
|
1911
|
+
if (value.startsWith(ROUTER_CHOICE_PREFIX) || isRouterOnlyProvider(provider)) {
|
|
1912
|
+
const catalog = ctx.config.getRouterCatalog?.();
|
|
1913
|
+
if (catalog?.version === 1) {
|
|
1914
|
+
const selected = routerModelForSwitch(catalog, provider, current, getEffectiveModel(ctx));
|
|
1915
|
+
if (!selected)
|
|
1916
|
+
throw new Error(`${providerChoiceLabel(provider)} is not in the Zerg Router catalog. Keeping the current selection.`);
|
|
1917
|
+
return { provider, model: selected.id, authMode: 'zrouter',
|
|
1918
|
+
...(selected.available === false ? { warning: `Zerg Router lists no ${providerChoiceLabel(provider)} model your account can use now; selected ${selected.id} anyway.` } : {}) };
|
|
1919
|
+
}
|
|
1920
|
+
return { provider, model: modelForProviderSwitch(provider, current, getEffectiveModel(ctx)), authMode: 'zrouter' };
|
|
1921
|
+
}
|
|
1922
|
+
return { provider, model: modelForProviderSwitch(provider, current, getEffectiveModel(ctx)), authMode: 'direct' };
|
|
1923
|
+
}
|
|
1924
|
+
/**
|
|
1925
|
+
* Check a provider or model choice before anything is saved. A direct
|
|
1926
|
+
* provider without a key closes the panel and asks for one; `apply` runs once
|
|
1927
|
+
* it is saved. Any other choice that cannot reach a model throws, so the row
|
|
1928
|
+
* reverts with the reason. True while the choice waits on the key prompt.
|
|
1929
|
+
*/
|
|
1930
|
+
function holdUnbuildableSelection(ctx, categories, setting, { provider, model, authMode }, apply, reopen) {
|
|
1931
|
+
const current = ctx.config.getProvider();
|
|
1932
|
+
const loginFirst = 'Log in with ZergAI first (Connection → Log in with ZergAI). Keeping the current selection.';
|
|
1933
|
+
const signedIn = ctx.config.getRouterSessionStatus?.() === 'signed_in';
|
|
1934
|
+
// A local login builds a backend without a key, so readiness is the login itself.
|
|
1935
|
+
if (isLocalSubscription(provider) && ctx.config.hasDirectCredential?.(provider) === false) {
|
|
1936
|
+
throw new Error(unbuildableSelectionMessage(provider));
|
|
1937
|
+
}
|
|
1938
|
+
let llm;
|
|
1939
|
+
try {
|
|
1940
|
+
llm = ctx.config.resolveLLMBackendConfig({ provider, model,
|
|
1941
|
+
config: { ...ctx.config.get(), provider, model, ...(authMode ? { authMode } : {}) } });
|
|
1942
|
+
}
|
|
1943
|
+
catch (error) {
|
|
1944
|
+
if (authMode === 'zrouter' && !signedIn)
|
|
1945
|
+
throw new Error(loginFirst);
|
|
1946
|
+
throw new Error(`${error instanceof Error ? error.message : String(error)} Keeping the current selection.`);
|
|
1947
|
+
}
|
|
1948
|
+
if (authMode && llm.authMode !== authMode) {
|
|
1949
|
+
throw new Error('Routing is pinned by ZTC_LLM_AUTH_MODE/ZERG_LLM_AUTH_MODE. Unset it before switching routes. Keeping the current selection.');
|
|
1950
|
+
}
|
|
1951
|
+
if (authMode === 'zrouter' && !llm.useProxy)
|
|
1952
|
+
throw new Error(loginFirst);
|
|
1953
|
+
if (isBuildableResolvedConfig(llm))
|
|
1954
|
+
return false;
|
|
1955
|
+
const asked = promptForMissingDirectKey(llm, ctx, apply, {
|
|
1956
|
+
beforeAsk: () => ctx.settingsPanel?.closeSettingsPanel?.(),
|
|
1957
|
+
onCancel: async () => {
|
|
1958
|
+
ctx.addMessage({ role: 'system', content: setting === 'provider'
|
|
1959
|
+
? `Provider unchanged: ${current}.` : `Model unchanged: ${getEffectiveModel(ctx)}.` });
|
|
1960
|
+
await reopen();
|
|
1961
|
+
},
|
|
1962
|
+
});
|
|
1963
|
+
if (!asked)
|
|
1964
|
+
throw new Error(unbuildableSelectionMessage(provider));
|
|
1965
|
+
// The row keeps showing what is still selected until the key arrives.
|
|
1966
|
+
const row = categories.flatMap(category => category.settings).find(item => item.name === setting);
|
|
1967
|
+
if (row && setting === 'provider')
|
|
1968
|
+
row.value = providerRowValue(ctx);
|
|
1969
|
+
if (row && setting === 'model')
|
|
1970
|
+
row.value = getEffectiveModel(ctx);
|
|
1971
|
+
return true;
|
|
1972
|
+
}
|
|
1772
1973
|
/**
|
|
1773
1974
|
* Settings the live agent never captured at construction, so changing one must
|
|
1774
1975
|
* not rebuild it.
|
|
@@ -1798,6 +1999,8 @@ const LIVE_READ_SETTINGS = new Set([
|
|
|
1798
1999
|
'autoCompactThreshold',
|
|
1799
2000
|
'compactionTargetPercent',
|
|
1800
2001
|
'contextTokenBudget',
|
|
2002
|
+
'idleCompaction',
|
|
2003
|
+
'promptCacheTtlMs',
|
|
1801
2004
|
'contextProgressBarEnabled',
|
|
1802
2005
|
'contextProgressBarAccentColor',
|
|
1803
2006
|
'contextProgressBarWarningColor',
|
|
@@ -1847,6 +2050,16 @@ function refreshRowDisplays(categories, ctx) {
|
|
|
1847
2050
|
else if (setting.name === 'compactionTargetPercent') {
|
|
1848
2051
|
setting.value = String(resolveCompactionTargetPercent(config));
|
|
1849
2052
|
}
|
|
2053
|
+
else if (setting.name === 'idleCompaction') {
|
|
2054
|
+
setting.value = config.idleCompaction === false ? 'off' : 'on';
|
|
2055
|
+
}
|
|
2056
|
+
else if (setting.name === 'promptCacheTtlMs') {
|
|
2057
|
+
setting.value = config.promptCacheTtlMs === undefined ? '' : String(Math.round(config.promptCacheTtlMs / 1000));
|
|
2058
|
+
}
|
|
2059
|
+
else if (setting.name === 'connectionStatus') {
|
|
2060
|
+
// Routing rows change how the model is reached without naming it.
|
|
2061
|
+
setting.label = describeConnection(ctx.config);
|
|
2062
|
+
}
|
|
1850
2063
|
}
|
|
1851
2064
|
}
|
|
1852
2065
|
async function refreshAllRowDisplays(categories, ctx) {
|
|
@@ -1857,163 +2070,375 @@ async function refreshAllRowDisplays(categories, ctx) {
|
|
|
1857
2070
|
if (!next)
|
|
1858
2071
|
continue;
|
|
1859
2072
|
row.value = next.value;
|
|
2073
|
+
row.label = next.label;
|
|
2074
|
+
// A provider switch can turn the Model row from a typed field into a list.
|
|
2075
|
+
row.type = next.type;
|
|
1860
2076
|
row.options = next.options;
|
|
1861
2077
|
row.placeholder = next.placeholder;
|
|
2078
|
+
row.description = next.description;
|
|
1862
2079
|
}
|
|
1863
2080
|
}
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
const
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
2081
|
+
/**
|
|
2082
|
+
* The settings panel, as `/settings`, `/config` and the rows that hand the
|
|
2083
|
+
* user back to it open it: on a category (or a search), on a row, and with a
|
|
2084
|
+
* one-line notice saying what just happened.
|
|
2085
|
+
*/
|
|
2086
|
+
async function openSettings(ctx, open = {}) {
|
|
2087
|
+
if (!ctx.settingsPanel) {
|
|
2088
|
+
ctx.addMessage({ role: 'system', content: 'Settings panel not available in this renderer.' });
|
|
2089
|
+
return;
|
|
2090
|
+
}
|
|
2091
|
+
const categories = await buildSettingsCategories(ctx);
|
|
2092
|
+
const onSettingChange = async (setting, value) => {
|
|
2093
|
+
if (setting === 'permissionProfile' || setting.startsWith('toolPermission_')
|
|
2094
|
+
|| ['sandboxEnabled', 'sandboxBackend', 'sandboxRequireOsEnforcement'].includes(setting)) {
|
|
2095
|
+
const config = ctx.config.get();
|
|
2096
|
+
let next;
|
|
2097
|
+
if (setting === 'permissionProfile')
|
|
2098
|
+
next = { ...config, permissionProfile: value };
|
|
2099
|
+
else if (setting.startsWith('toolPermission_')) {
|
|
2100
|
+
const cap = setting.slice('toolPermission_'.length);
|
|
2101
|
+
if (!PERMISSION_CAPABILITIES.includes(cap) || !['true', 'false'].includes(value))
|
|
2102
|
+
throw new Error('Invalid tool permission');
|
|
2103
|
+
next = { ...config, toolPermissions: { ...config.toolPermissions, [cap]: value === 'true' } };
|
|
2104
|
+
}
|
|
2105
|
+
else {
|
|
2106
|
+
if (setting === 'sandboxBackend') {
|
|
2107
|
+
if (!['auto', 'none', 'seatbelt', 'bubblewrap', 'windows-job'].includes(value))
|
|
2108
|
+
throw new Error(`Unknown sandbox backend: ${value}`);
|
|
2109
|
+
next = { ...config, sandbox: { ...config.sandbox, backend: value } };
|
|
1892
2110
|
}
|
|
1893
2111
|
else {
|
|
1894
|
-
if (
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
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
|
-
}
|
|
2112
|
+
if (!['true', 'false'].includes(value))
|
|
2113
|
+
throw new Error('Invalid sandbox toggle');
|
|
2114
|
+
const key = setting === 'sandboxEnabled' ? 'enabled' : 'requireOsEnforcement';
|
|
2115
|
+
next = { ...config, sandbox: { ...config.sandbox, [key]: value === 'true' } };
|
|
1905
2116
|
}
|
|
1906
|
-
const notice = await activatePermissionConfig(next, ctx);
|
|
1907
|
-
await refreshAllRowDisplays(categories, ctx);
|
|
1908
|
-
ctx.addMessage({ role: 'system', content: notice });
|
|
1909
|
-
return;
|
|
1910
|
-
}
|
|
1911
|
-
if (setting === 'workflowsEnabled' && value === 'false') {
|
|
1912
|
-
await shutdownAndClearWorkflowRegistry(5000);
|
|
1913
|
-
}
|
|
1914
|
-
applySettingChange(ctx, setting, value);
|
|
1915
|
-
await ctx.config.save();
|
|
1916
|
-
if (setting === 'skillsEnabled' || setting === 'skillsRoots' || setting === 'skillsDisabled') {
|
|
1917
|
-
invalidateSkillsCache();
|
|
1918
|
-
await preloadSkillsManifest();
|
|
1919
|
-
}
|
|
1920
|
-
if ((setting === 'clearSessionConfig' && value === 'yes')
|
|
1921
|
-
|| setting === 'provider' || setting === 'model' || setting === 'claudeCodeModel') {
|
|
1922
|
-
await refreshAllRowDisplays(categories, ctx);
|
|
1923
2117
|
}
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
2118
|
+
const notice = await activatePermissionConfig(next, ctx);
|
|
2119
|
+
await refreshAllRowDisplays(categories, ctx);
|
|
2120
|
+
ctx.addMessage({ role: 'system', content: notice });
|
|
2121
|
+
return;
|
|
2122
|
+
}
|
|
2123
|
+
// Planned before anything is saved: once saved, the live selection would
|
|
2124
|
+
// still report the previous model.
|
|
2125
|
+
const selection = MODEL_SELECTION_SETTINGS.has(setting) ? plannedModelSelection(ctx, setting, value) : undefined;
|
|
2126
|
+
// The panel closes for a key prompt; it comes back on this row afterwards.
|
|
2127
|
+
const category = categories.find(entry => entry.settings.some(row => row.name === setting))?.name;
|
|
2128
|
+
const reopen = (notice) => openSettings(ctx, { category, setting, notice });
|
|
2129
|
+
if (selection && holdUnbuildableSelection(ctx, categories, setting, selection, async () => {
|
|
2130
|
+
await onSettingChange(setting, value);
|
|
2131
|
+
const summary = setting === 'provider'
|
|
2132
|
+
? `✓ Provider updated: ${ctx.config.getProvider()} (${getEffectiveModel(ctx)})`
|
|
2133
|
+
: `✓ Model updated: ${getEffectiveModel(ctx)}`;
|
|
2134
|
+
ctx.addMessage({ role: 'system', content: summary });
|
|
2135
|
+
await reopen({ text: summary, tone: 'success' });
|
|
2136
|
+
}, () => reopen()))
|
|
2137
|
+
return;
|
|
2138
|
+
if (setting === 'workflowsEnabled' && value === 'false') {
|
|
2139
|
+
await shutdownAndClearWorkflowRegistry(5000);
|
|
2140
|
+
}
|
|
2141
|
+
applySettingChange(ctx, setting, value);
|
|
2142
|
+
await ctx.config.save();
|
|
2143
|
+
if (setting === 'skillsEnabled' || setting === 'skillsRoots' || setting === 'skillsDisabled') {
|
|
2144
|
+
invalidateSkillsCache();
|
|
2145
|
+
await preloadSkillsManifest();
|
|
2146
|
+
}
|
|
2147
|
+
if (selection?.warning)
|
|
2148
|
+
ctx.addMessage({ role: 'system', content: selection.warning });
|
|
2149
|
+
try {
|
|
2150
|
+
if (selection) {
|
|
2151
|
+
applyRuntimeModelSelection(ctx, selection.provider, selection.model);
|
|
1937
2152
|
}
|
|
1938
2153
|
else if (setting !== 'clearSessionConfig' && !LIVE_READ_SETTINGS.has(setting)) {
|
|
1939
|
-
ctx.reloadAgent();
|
|
2154
|
+
await ctx.reloadAgent();
|
|
1940
2155
|
}
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
2156
|
+
}
|
|
2157
|
+
catch (error) {
|
|
2158
|
+
// config.json already holds the value. Failing here would make the
|
|
2159
|
+
// panel revert a row to a value that is no longer saved.
|
|
2160
|
+
ctx.addMessage({ role: 'system', content: `Saved. The agent could not restart with this change: ${error instanceof Error ? error.message : String(error)}` });
|
|
2161
|
+
}
|
|
2162
|
+
// Repainted after the runtime takes the selection: until then the live
|
|
2163
|
+
// provider and model still report the previous one.
|
|
2164
|
+
if ((setting === 'clearSessionConfig' && value === 'yes') || selection) {
|
|
2165
|
+
await refreshAllRowDisplays(categories, ctx);
|
|
2166
|
+
}
|
|
2167
|
+
else {
|
|
2168
|
+
const row = categories.flatMap(category => category.settings).find(item => item.name === setting);
|
|
2169
|
+
if (row)
|
|
2170
|
+
row.value = value;
|
|
2171
|
+
refreshRowDisplays(categories, ctx);
|
|
2172
|
+
}
|
|
2173
|
+
if (setting === 'mouseCapture' || setting === 'wheelScrollLines') {
|
|
2174
|
+
const applied = ctx.zmux?.setTerminalInteraction?.(resolveTerminalInteractionSettings(ctx.config.get().terminalInteraction)) === true;
|
|
2175
|
+
if (!applied)
|
|
2176
|
+
ctx.addMessage({
|
|
2177
|
+
role: 'system',
|
|
2178
|
+
content: 'Terminal interaction saved for the next compatible native renderer launch; not applied to this renderer.',
|
|
2179
|
+
metadata: { ephemeral: true },
|
|
2180
|
+
});
|
|
2181
|
+
}
|
|
2182
|
+
};
|
|
2183
|
+
/**
|
|
2184
|
+
* One entry point for the settings surface, so the color picker can hand the
|
|
2185
|
+
* user back to the page they came from. Picking four colors should not mean
|
|
2186
|
+
* reopening `/settings` four times.
|
|
2187
|
+
*/
|
|
2188
|
+
const showSettings = (filter, landing = {}) => {
|
|
2189
|
+
const matches = landing.category
|
|
2190
|
+
? categories.filter(category => category.name === landing.category)
|
|
2191
|
+
: filter
|
|
1958
2192
|
? categories.filter(category => category.name.toLowerCase().includes(filter.toLowerCase()))
|
|
1959
2193
|
: [];
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
2194
|
+
const initialCategory = matches.length === 1 ? matches[0].name : undefined;
|
|
2195
|
+
const shown = panelShown();
|
|
2196
|
+
ctx.settingsPanel?.showSettingsPanel({
|
|
2197
|
+
title: 'Settings',
|
|
2198
|
+
categories,
|
|
2199
|
+
initialCategory,
|
|
2200
|
+
initialFilter: initialCategory ? undefined : filter,
|
|
2201
|
+
initialSetting: landing.setting,
|
|
2202
|
+
notice: landing.notice?.text,
|
|
2203
|
+
noticeTone: landing.notice?.tone,
|
|
2204
|
+
onSettingChange,
|
|
2205
|
+
onClose: () => panelClosed(shown),
|
|
2206
|
+
});
|
|
2207
|
+
};
|
|
2208
|
+
const openColorPicker = (rowName, config) => {
|
|
2209
|
+
const { field, label } = BAR_COLOR_FIELDS[rowName];
|
|
2210
|
+
const bar = contextProgressBarConfig(config);
|
|
2211
|
+
ctx.colorPanel?.open({
|
|
2212
|
+
label,
|
|
2213
|
+
value: bar[field] ?? '',
|
|
2214
|
+
defaultValue: DEFAULT_CONTEXT_PROGRESS_BAR[field] ?? '',
|
|
2215
|
+
// The other three, so the preview can paint the bar the color will
|
|
2216
|
+
// actually appear in rather than a swatch on its own.
|
|
2217
|
+
siblings: Object.entries(BAR_COLOR_FIELDS)
|
|
2218
|
+
.filter(([name]) => name !== rowName)
|
|
2219
|
+
.map(([, entry]) => ({ label: entry.label, value: bar[entry.field] ?? '' })),
|
|
2220
|
+
onChange: draft => { void onSettingChange(rowName, draft); },
|
|
2221
|
+
onClose: () => showSettings('context progress bar'),
|
|
2222
|
+
});
|
|
2223
|
+
};
|
|
2224
|
+
// The picker is attached here rather than in `buildSettingsCategories`
|
|
2225
|
+
// because only this command can hand the user back to the panel afterwards.
|
|
2226
|
+
if (ctx.colorPanel) {
|
|
2227
|
+
for (const setting of categories.flatMap(category => category.settings)) {
|
|
2228
|
+
if (setting.name in BAR_COLOR_FIELDS) {
|
|
2229
|
+
setting.onActivate = () => openColorPicker(setting.name, ctx.config.get());
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
// Same reason as the color rows: the manager is attached here so that
|
|
2234
|
+
// finishing in it returns the user to this panel rather than the transcript.
|
|
2235
|
+
for (const setting of categories.flatMap(category => category.settings)) {
|
|
2236
|
+
if (setting.name === 'panesCustomOptions') {
|
|
2237
|
+
setting.onActivate = () => openCustomPaneManager(ctx, () => showSettings('custom pane options'));
|
|
2238
|
+
}
|
|
2239
|
+
if (setting.name === 'factoryReset') {
|
|
2240
|
+
setting.onActivate = () => openFactoryResetConfirmation(ctx, () => openSettings(ctx, { category: PROFILE }));
|
|
2241
|
+
}
|
|
2242
|
+
if (setting.name === 'configProfile') {
|
|
2243
|
+
setting.onActivate = () => openConfigProfilePicker(ctx).catch(error => {
|
|
2244
|
+
ctx.addMessage({ role: 'system', content: `Could not open config profiles: ${error.message}` });
|
|
1967
2245
|
});
|
|
1968
|
-
}
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
showSettings(open.filter, open);
|
|
2249
|
+
}
|
|
2250
|
+
/** The account manager, whose Escape comes back to the settings row that opened it. */
|
|
2251
|
+
function openAccountsFromSettings(ctx, focus, back) {
|
|
2252
|
+
openAccountsManager(ctx, { focus, onBack: () => { void openSettings(ctx, back); } }).catch((error) => {
|
|
2253
|
+
ctx.addMessage({ role: 'system', content: `Could not open Accounts: ${error instanceof Error ? error.message : String(error)}` });
|
|
2254
|
+
});
|
|
2255
|
+
}
|
|
2256
|
+
/**
|
|
2257
|
+
* Settings panels this module has shown, and whether the last one is still
|
|
2258
|
+
* open. A login waits minutes for the browser; when it ends, these say whether
|
|
2259
|
+
* the person moved on to something else in the meantime.
|
|
2260
|
+
*/
|
|
2261
|
+
let panelsShown = 0;
|
|
2262
|
+
let panelOpen = false;
|
|
2263
|
+
/** Count a panel being shown; returns its number for `panelClosed`. */
|
|
2264
|
+
function panelShown() {
|
|
2265
|
+
panelOpen = true;
|
|
2266
|
+
return ++panelsShown;
|
|
2267
|
+
}
|
|
2268
|
+
function panelClosed(shown) {
|
|
2269
|
+
if (shown === panelsShown)
|
|
2270
|
+
panelOpen = false;
|
|
2271
|
+
}
|
|
2272
|
+
/**
|
|
2273
|
+
* Log out after asking, on a page of its own: staying logged in comes first,
|
|
2274
|
+
* and Escape goes back to Connection as staying does.
|
|
2275
|
+
*/
|
|
2276
|
+
function confirmZergAILogout(ctx, credentials) {
|
|
2277
|
+
if (!ctx.settingsPanel)
|
|
2278
|
+
return;
|
|
2279
|
+
const { origin } = credentials;
|
|
2280
|
+
const config = ctx.config.get();
|
|
2281
|
+
const after = routingAfterLogout(credentials, config);
|
|
2282
|
+
const routing = after.restore ? `Routing goes back to ${after.authMode}, as before the login.` : `Routing stays ${after.authMode}.`;
|
|
2283
|
+
let chosen = false;
|
|
2284
|
+
const back = () => { void openSettings(ctx, { category: CONNECTION, setting: 'zergaiLogin' }); };
|
|
2285
|
+
const shown = panelShown();
|
|
2286
|
+
ctx.settingsPanel.showSettingsPanel({
|
|
2287
|
+
title: 'Log out of ZergAI?',
|
|
2288
|
+
layout: 'page',
|
|
2289
|
+
categories: [{ name: 'Log out of ZergAI', settings: [
|
|
2290
|
+
{
|
|
2291
|
+
name: 'stayLoggedIn', label: 'Stay logged in', value: '', type: 'text',
|
|
2292
|
+
description: `Keep your ZergAI login for Zerg Router at ${origin}.`,
|
|
2293
|
+
onActivate: () => { chosen = true; back(); },
|
|
2294
|
+
},
|
|
2295
|
+
{
|
|
2296
|
+
name: 'confirmZergaiLogout', label: 'Log out', value: '', type: 'text',
|
|
2297
|
+
description: `End your ZergAI session at ${origin} and remove it from this machine. ${routing}`,
|
|
2298
|
+
onActivate: () => { chosen = true; return runZergAILogin(ctx, 'logout', origin); },
|
|
2299
|
+
},
|
|
2300
|
+
] }],
|
|
2301
|
+
onSettingChange: () => { },
|
|
2302
|
+
onClose: () => {
|
|
2303
|
+
panelClosed(shown);
|
|
2304
|
+
if (!chosen)
|
|
2305
|
+
back();
|
|
2306
|
+
},
|
|
2307
|
+
});
|
|
2308
|
+
}
|
|
2309
|
+
/**
|
|
2310
|
+
* The ZergAI row's login or logout: the panel steps aside while the device
|
|
2311
|
+
* code shows in the transcript, then comes back to Connection with the result.
|
|
2312
|
+
* A login that was cancelled or ran out reports in the transcript only, and a
|
|
2313
|
+
* late result never reopens the panel once the person has moved on.
|
|
2314
|
+
*/
|
|
2315
|
+
async function runZergAILogin(ctx, action, origin) {
|
|
2316
|
+
ctx.settingsPanel?.closeSettingsPanel?.();
|
|
2317
|
+
panelOpen = false;
|
|
2318
|
+
const shownBefore = panelsShown;
|
|
2319
|
+
const outcome = await runAuthAction(action === 'login' && origin ? ['login', '--url', origin] : [action], ctx);
|
|
2320
|
+
if (!outcome.ok && (outcome.ended === 'cancelled' || outcome.ended === 'expired'))
|
|
2321
|
+
return;
|
|
2322
|
+
// Another panel opened and closed meanwhile, or a turn is running: the
|
|
2323
|
+
// transcript already has the result.
|
|
2324
|
+
if ((panelsShown !== shownBefore && !panelOpen) || ctx.isAgentRunning?.())
|
|
2325
|
+
return;
|
|
2326
|
+
const credentials = await loadRouterCredentials().catch(() => null);
|
|
2327
|
+
const notice = !outcome.ok ? { text: `✗ ${outcome.error}`, tone: 'error' }
|
|
2328
|
+
: action === 'logout' ? { text: '✓ Logged out of ZergAI.', tone: 'success' }
|
|
2329
|
+
: { text: `✓ Logged in with ZergAI${credentials ? ` (Zerg Router at ${credentials.origin})` : ''}.`, tone: 'success' };
|
|
2330
|
+
await openSettings(ctx, { category: CONNECTION, setting: 'zergaiLogin', notice });
|
|
2331
|
+
}
|
|
2332
|
+
/**
|
|
2333
|
+
* A provider's key row: the shared key choices (paste, environment variable,
|
|
2334
|
+
* remove, cancel), then back to Connection with what changed.
|
|
2335
|
+
*/
|
|
2336
|
+
function openKeyRow(ctx, provider, label) {
|
|
2337
|
+
const asked = manageApiKey(provider, ctx, change => afterKeyChange(ctx, provider, change), { beforeAsk: () => ctx.settingsPanel?.closeSettingsPanel?.() });
|
|
2338
|
+
if (!asked)
|
|
2339
|
+
ctx.addMessage({ role: 'system', content: `Set the ${label} key with /config key ${provider} in an interactive session.` });
|
|
2340
|
+
}
|
|
2341
|
+
/**
|
|
2342
|
+
* The custom endpoint row. With a key to remove, it asks first: edit the
|
|
2343
|
+
* endpoint, remove the key (keeping the URL and model), or cancel. Every
|
|
2344
|
+
* choice comes back to Connection on this row.
|
|
2345
|
+
*/
|
|
2346
|
+
function openCustomEndpointRow(ctx) {
|
|
2347
|
+
ctx.settingsPanel?.closeSettingsPanel?.();
|
|
2348
|
+
if (!hasRemovableKey(ctx.config.getApiKeySource('openai_compatible'))) {
|
|
2349
|
+
editCustomEndpoint(ctx);
|
|
2350
|
+
return;
|
|
2351
|
+
}
|
|
2352
|
+
ctx.select.showSelect({
|
|
2353
|
+
title: 'Custom endpoint', type: 'select', question: 'Edit the endpoint, or remove its key?',
|
|
2354
|
+
options: [
|
|
2355
|
+
{ value: 'edit', label: 'Edit the endpoint', description: 'URL, model, key and headers' },
|
|
2356
|
+
{ value: 'remove', label: 'Remove the key', description: 'Keeps the URL and model' },
|
|
2357
|
+
{ value: 'cancel', label: 'Cancel', description: 'Keep things as they are' },
|
|
2358
|
+
],
|
|
2359
|
+
}, async (value) => {
|
|
2360
|
+
if (value === 'edit')
|
|
2361
|
+
return editCustomEndpoint(ctx);
|
|
2362
|
+
let changed = false;
|
|
2363
|
+
if (value === 'remove') {
|
|
2364
|
+
await removeApiKey('openai_compatible', ctx, change => {
|
|
2365
|
+
changed = true;
|
|
2366
|
+
return afterKeyChange(ctx, 'openai_compatible', change, 'customEndpoint');
|
|
1983
2367
|
});
|
|
1984
|
-
};
|
|
1985
|
-
// The picker is attached here rather than in `buildSettingsCategories`
|
|
1986
|
-
// because only this command can hand the user back to the panel afterwards.
|
|
1987
|
-
if (ctx.colorPanel) {
|
|
1988
|
-
for (const setting of categories.flatMap(category => category.settings)) {
|
|
1989
|
-
if (setting.name in BAR_COLOR_FIELDS) {
|
|
1990
|
-
setting.onActivate = () => openColorPicker(setting.name, ctx.config.get());
|
|
1991
|
-
}
|
|
1992
|
-
}
|
|
1993
2368
|
}
|
|
1994
|
-
//
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
}
|
|
2369
|
+
// Cancel, Escape, or a key that was gone already.
|
|
2370
|
+
if (!changed)
|
|
2371
|
+
await openSettings(ctx, { category: CONNECTION, setting: 'customEndpoint' });
|
|
2372
|
+
});
|
|
2373
|
+
}
|
|
2374
|
+
/**
|
|
2375
|
+
* The endpoint form, then back to Connection. With no model connected, a
|
|
2376
|
+
* saved endpoint is offered for use first.
|
|
2377
|
+
*/
|
|
2378
|
+
function editCustomEndpoint(ctx) {
|
|
2379
|
+
runOpenAICompatibleWizard(ctx, async (saved) => {
|
|
2380
|
+
const baseUrl = ctx.config.getOpenAICompatibleSettings?.().baseUrl;
|
|
2381
|
+
const notice = saved
|
|
2382
|
+
? { text: `✓ Saved your custom endpoint${baseUrl ? ` (${baseUrl})` : ''}.`, tone: 'success' } : undefined;
|
|
2383
|
+
const reopen = () => openSettings(ctx, { category: CONNECTION, setting: 'customEndpoint', notice });
|
|
2384
|
+
if (saved && offerKeyedProviderSwitch('openai_compatible', ctx, { onAnswered: reopen }))
|
|
2385
|
+
return;
|
|
2386
|
+
await reopen();
|
|
2387
|
+
});
|
|
2388
|
+
}
|
|
2389
|
+
/**
|
|
2390
|
+
* Put a key change to use, then reopen Connection on its row. A key for the
|
|
2391
|
+
* provider in use rebuilds the agent; with no model connected, ZTC offers to
|
|
2392
|
+
* switch to the provider first.
|
|
2393
|
+
*/
|
|
2394
|
+
async function afterKeyChange(ctx, provider, change, setting = `key_${provider}`) {
|
|
2395
|
+
let notice = change && { text: change.summary, tone: 'success' };
|
|
2396
|
+
const reopen = () => openSettings(ctx, { category: CONNECTION, setting, notice });
|
|
2397
|
+
if (change) {
|
|
2398
|
+
const inUse = normalizeProviderId(provider) === normalizeProviderId(ctx.config.getProvider());
|
|
2399
|
+
// A removal, or a variable not set yet, may leave nothing to build from, so only the old backend goes.
|
|
2400
|
+
const keyless = change.kind === 'removed' || change.kind === 'env-pending';
|
|
2401
|
+
try {
|
|
2402
|
+
if (inUse)
|
|
2403
|
+
ctx.reloadAgent(keyless ? { defer: true } : undefined);
|
|
2404
|
+
}
|
|
2405
|
+
catch (error) {
|
|
2406
|
+
notice = { text: `${change.summary} The agent could not restart: ${error instanceof Error ? error.message : String(error)}`, tone: 'error' };
|
|
2008
2407
|
}
|
|
2009
|
-
|
|
2408
|
+
if (!inUse && !keyless && offerKeyedProviderSwitch(provider, ctx, { onAnswered: reopen }))
|
|
2409
|
+
return;
|
|
2410
|
+
}
|
|
2411
|
+
await reopen();
|
|
2412
|
+
}
|
|
2413
|
+
export const settingsCommand = {
|
|
2414
|
+
name: 'settings',
|
|
2415
|
+
description: 'Interactive settings panel',
|
|
2416
|
+
usage: '/settings [connection|provider|behavior|compaction|tools|verbosity|statusline|integrations|sound|routing|profile]',
|
|
2417
|
+
handler: async (args, ctx) => {
|
|
2418
|
+
const sub = args[0]?.toLowerCase();
|
|
2419
|
+
const category = sub ? CATEGORY_ALIASES[sub] : undefined;
|
|
2420
|
+
const filter = sub === 'statusline' || sub === 'status-line'
|
|
2421
|
+
? 'status line'
|
|
2422
|
+
: sub === 'display'
|
|
2423
|
+
? 'verbosity'
|
|
2424
|
+
: sub;
|
|
2425
|
+
await openSettings(ctx, category ? { category } : { filter: filter || undefined });
|
|
2426
|
+
},
|
|
2427
|
+
};
|
|
2428
|
+
/** `/keys`: the ZergAI login and every API key, on the settings panel's Connection page. */
|
|
2429
|
+
export const keysCommand = {
|
|
2430
|
+
name: 'keys',
|
|
2431
|
+
description: 'Log in with ZergAI or manage your API keys (settings: Connection)',
|
|
2432
|
+
usage: '',
|
|
2433
|
+
handler: async (_args, ctx) => {
|
|
2434
|
+
await openSettings(ctx, { category: CONNECTION });
|
|
2010
2435
|
},
|
|
2011
2436
|
};
|
|
2012
2437
|
async function openConfigProfilePicker(ctx) {
|
|
2013
2438
|
if (!ctx.settingsPanel)
|
|
2014
2439
|
return;
|
|
2015
2440
|
const names = await listConfigProfiles();
|
|
2016
|
-
const reopenSettings = async () => { await
|
|
2441
|
+
const reopenSettings = async () => { await openSettings(ctx, { category: PROFILE, setting: 'configProfile' }); };
|
|
2017
2442
|
const choose = (name, allowNew = false) => {
|
|
2018
2443
|
return switchConfigProfile(ctx, name, allowNew).then(reopenSettings).catch(error => {
|
|
2019
2444
|
ctx.addMessage({ role: 'system', content: `Profile switch failed: ${error.message}` });
|
|
@@ -2073,7 +2498,7 @@ export function openFactoryResetConfirmation(ctx, onDone) {
|
|
|
2073
2498
|
},
|
|
2074
2499
|
{
|
|
2075
2500
|
name: 'confirmFactoryReset', label: 'Reset saved settings', value: '', type: 'text',
|
|
2076
|
-
description: `Remove ${path} and ${builtinProfileEmulation(activeProfile()) ? 'the shared default' : "this profile's"}
|
|
2501
|
+
description: `Remove ${path} and ${builtinProfileEmulation(activeProfile()) ? 'the shared default' : "this profile's"} ZergAI login. `
|
|
2077
2502
|
+ 'This deletes the API keys, OpenAI-compatible endpoint, account registrations, voice keys and MCP servers saved there. '
|
|
2078
2503
|
+ 'Sessions and managed account directories stay on disk.',
|
|
2079
2504
|
onActivate: () => {
|