kaijibot 2026.8.17 → 2026.8.21
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/dist/.buildstamp +1 -1
- package/dist/abort-BA4i4CO6.js +202 -0
- package/dist/abort-cutoff.runtime-140Dy9Z_.js +20 -0
- package/dist/abort-cutoff.runtime.js +1 -1
- package/dist/abort-primitives-DqU6syXA.js +93 -0
- package/dist/abort.runtime-D2xd_Jxq.js +2 -0
- package/dist/abort.runtime.js +1 -1
- package/dist/account-action-gate-w2MQyrck.js +114 -0
- package/dist/acp-cli-lUerPOt4.js +2171 -0
- package/dist/acp-spawn-CKu5HWZd.js +1024 -0
- package/dist/acp-stateful-target-driver-DNcDMame.js +88 -0
- package/dist/action-agents-bNO5zlxQ.js +67 -0
- package/dist/action-focus-BQH1yzA9.js +124 -0
- package/dist/action-help-Copk6G3d.js +7 -0
- package/dist/action-info-BUV_zoSU.js +58 -0
- package/dist/action-kill-BMDz9l_U.js +33 -0
- package/dist/action-list-CxkulhYF.js +21 -0
- package/dist/action-log-D0K9-YCV.js +30 -0
- package/dist/action-send-B8ggJVwC.js +39 -0
- package/dist/action-spawn-D9kSXA_K.js +46 -0
- package/dist/action-unfocus-bI4VBonB.js +28 -0
- package/dist/agent-CdxQT19_.js +2 -0
- package/dist/agent-command-Bu_cXSEL.js +1479 -0
- package/dist/agent-list-CPYyofv7.js +67 -0
- package/dist/agent-runner-utils--p6HAP6k.js +202 -0
- package/dist/agent-runner.runtime-BossnlL1.js +2825 -0
- package/dist/agent-runner.runtime.js +1 -1
- package/dist/agents/auth-profiles.runtime.js +1 -1
- package/dist/agents/model-catalog.runtime.js +1 -1
- package/dist/agents/models-config.runtime.js +1 -1
- package/dist/agents/pi-model-discovery-runtime.js +1 -1
- package/dist/agents-DA2-qNUI.js +887 -0
- package/dist/agents-DaKVGj9F.js +5 -0
- package/dist/allow-from-p586L6ne.js +164 -0
- package/dist/anthropic-cache-control-payload-N8EtT94O.js +28 -0
- package/dist/anthropic-payload-policy-D6dpwqVe.js +136 -0
- package/dist/anthropic-vertex-stream-CrF-fPgb.js +5666 -0
- package/dist/api-BPByI3-X.js +2 -0
- package/dist/api-BRJq6Aya.js +2 -0
- package/dist/api-BpAm-eRQ.js +2 -0
- package/dist/api-BvFPt7b2.js +19 -0
- package/dist/api-C6IdzdoP.js +5 -0
- package/dist/api-CSOm-O9I.js +5 -0
- package/dist/api-ChQfiSmG.js +4 -0
- package/dist/api-Cm3n-2Iw.js +3 -0
- package/dist/api-CqBQhm6r.js +2 -0
- package/dist/api-D7SjdU34.js +4 -0
- package/dist/api-D7qSjVDS.js +3 -0
- package/dist/api-DbRoXBTn.js +45 -0
- package/dist/api-_HshnS5J.js +35 -0
- package/dist/apply-G86rau7x.js +493 -0
- package/dist/apply.runtime-BoYc09wu.js +166 -0
- package/dist/apply.runtime-Dmh02lO-.js +2 -0
- package/dist/apply.runtime.js +1 -1
- package/dist/approval-client-helpers-cyaJyAMz.js +82 -0
- package/dist/approval-gateway-resolver-bdX78er-.js +58 -0
- package/dist/approval-gateway-runtime-CJm68vrp.js +2 -0
- package/dist/approval-handler-runtime-CT08B2_a.js +439 -0
- package/dist/approval-native-helpers-DagoPLtW.js +33 -0
- package/dist/approval-native-runtime-CN4meUkM.js +709 -0
- package/dist/approval-renderers-CnmO8wke.js +64 -0
- package/dist/asr-Cz-FH-3c.js +196 -0
- package/dist/audit-Cbfv4nmn.js +885 -0
- package/dist/audit-channel.collect.runtime.js +1 -1
- package/dist/audit-extra.async-DQv_s9K0.js +847 -0
- package/dist/audit.deep.runtime-CAPtrWg1.js +2 -0
- package/dist/audit.deep.runtime.js +1 -1
- package/dist/audit.nondeep.runtime-HUJ6INiD.js +859 -0
- package/dist/audit.nondeep.runtime.js +1 -1
- package/dist/audit.runtime-CAKbHyXK.js +7 -0
- package/dist/audit.runtime.js +1 -1
- package/dist/auth-CRAwpkC_.js +181 -0
- package/dist/auth-choice-Bhps2D29.js +3 -0
- package/dist/auth-choice-kMIs0xTd.js +71 -0
- package/dist/auth-choice-options-Bx_XsiW-.js +104 -0
- package/dist/auth-choice-prompt-B-koxVGL.js +2 -0
- package/dist/auth-choice-prompt-DytHsI5U.js +36 -0
- package/dist/auth-choice-vRXPONqL.js +353 -0
- package/dist/auth-choice.apply-helpers-D6x2bWVB.js +2 -0
- package/dist/auth-choice.plugin-providers.runtime-BNfpK_sp.js +11 -0
- package/dist/auth-choice.plugin-providers.runtime.js +1 -1
- package/dist/auth-health-BAxUQXZE.js +165 -0
- package/dist/auth-profiles-YXfmeEhu.js +438 -0
- package/dist/auth-profiles.runtime-CNNciZQU.js +7 -0
- package/dist/auth-profiles.runtime.js +1 -1
- package/dist/auto-disable-ABhUEc3O.js +69 -0
- package/dist/auto-disable-r26Mu7X0.js +2 -0
- package/dist/auto-recall-CsrNcQNa.js +78 -0
- package/dist/backup-create-DuIPhK_s.js +391 -0
- package/dist/banner-Bb9u_-IS.js +2 -0
- package/dist/banner-BkHTsqFt.js +281 -0
- package/dist/binding-routing-C6_mrNEN.js +50 -0
- package/dist/binding-targets-Cq2e7wRT.js +99 -0
- package/dist/block-streaming-BTtPFYsM.js +103 -0
- package/dist/bootstrap-files-DsmC0cJP.js +206 -0
- package/dist/bridge-server-Co3awCAM.js +103 -0
- package/dist/browser-config-runtime-BtkKPBMj.js +6 -0
- package/dist/browser-control-auth-Bqu1lakr.js +120 -0
- package/dist/browser-node-runtime-D8xut4fJ.js +12 -0
- package/dist/browser-open-BzpYLaas.js +94 -0
- package/dist/browser-profiles-gPG14SPk.js +170 -0
- package/dist/browser-runtime-BBkGI01q.js +377 -0
- package/dist/browser-security-runtime-CzhzXJ8D.js +10 -0
- package/dist/browser-setup-tools-CD_s48fd.js +12 -0
- package/dist/btw-command-Bgn_NviR.js +17 -0
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +5 -5
- package/dist/bundled/bootstrap-extra-files/handler.js +1 -1
- package/dist/bundled/session-memory/handler.js +6 -6
- package/dist/call-CiUZqjsN.js +2 -0
- package/dist/call-k_nZXTJ3.js +495 -0
- package/dist/call.runtime-CZI7yxSF.js +2 -0
- package/dist/call.runtime.js +1 -1
- package/dist/capability-cli-CIm_YhHH.js +1357 -0
- package/dist/catalog-provider-Ch4CMHLl.js +40 -0
- package/dist/cdp.helpers-BVl3YwYe.js +372 -0
- package/dist/channel-config-helpers-BO9yY1Zu.js +462 -0
- package/dist/channel-core-BB7pTANC.js +5 -0
- package/dist/channel-feedback-c7a-Gb7w.js +259 -0
- package/dist/channel-plugin-resolution-DHgXIZV6.js +146 -0
- package/dist/channel-policy-DO-ZWErE.js +270 -0
- package/dist/channel-reply-pipeline-2KImYC85.js +26 -0
- package/dist/channel-runtime-Bqn7zFyT.js +6 -0
- package/dist/channel-selection.runtime.js +1 -1
- package/dist/channel-setup.status-XI51qJ8U.js +2 -0
- package/dist/channel-setup.status-bJBbVDcA.js +754 -0
- package/dist/channel-summary-TxoZjGPA.js +139 -0
- package/dist/channel-summary-dKkFDRbe.js +2 -0
- package/dist/channel.runtime-2WY9MkoH.js +399 -0
- package/dist/channel.runtime.js +1 -1
- package/dist/channels-D66hRVnR.js +1147 -0
- package/dist/channels-cli-0DjAVaKh.js +248 -0
- package/dist/chat-Fv3LkEfF.js +213 -0
- package/dist/chat-history-text-CZhwQ5__.js +42 -0
- package/dist/chrome-CEE9kYYR.js +1080 -0
- package/dist/chrome.executables-Dp7W-RgV.js +550 -0
- package/dist/chunk-B9X-O7Vw.js +267 -0
- package/dist/clack-prompter-BSVVLa7H.js +113 -0
- package/dist/clawhub-Ina62jCa.js +400 -0
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/cli-BsNkLoFI.js +57 -0
- package/dist/cli-DQH9X5IE.js +2 -0
- package/dist/cli-DW_ou4hw.js +2 -0
- package/dist/cli-DuoVlLKx.js +154 -0
- package/dist/cli-QG03g_im.js +191 -0
- package/dist/cli-auth-seam-BrijKBRQ.js +14 -0
- package/dist/cli-backend-CIs4F7ip.js +66 -0
- package/dist/cli-migration-CVktTGRI.js +127 -0
- package/dist/cli-runner-12iECISR.js +1662 -0
- package/dist/cli-runner.runtime-C5noDuQ-.js +3 -0
- package/dist/cli-runner.runtime-YrAg_h19.js +2 -0
- package/dist/cli-runner.runtime.js +1 -1
- package/dist/cli-runtime-wB1rYZco.js +3 -0
- package/dist/cli-shared-BUW2okV2.js +142 -0
- package/dist/cli-startup-metadata.json +3 -3
- package/dist/cli.runtime-Bhxt80sB.js +819 -0
- package/dist/cli.runtime.js +1 -1
- package/dist/client-bootstrap-BWo-ZK_j.js +28 -0
- package/dist/codex-native-web-search-C6s55zGf.js +2 -0
- package/dist/codex-native-web-search-Cxf1u7R-.js +156 -0
- package/dist/collector-CRTTihSY.js +349 -0
- package/dist/collector-tJxrYXuY.js +2 -0
- package/dist/command-auth-Dlrd5CYD.js +75 -0
- package/dist/command-config-resolution-B8pxzh3W.js +2 -0
- package/dist/command-config-resolution-BXSCDJTh.js +23 -0
- package/dist/command-detection-DFlZHBMC.js +50 -0
- package/dist/command-execution-startup-DYXpKpvc.js +269 -0
- package/dist/command-format-JYoGhCek.js +2 -0
- package/dist/command-poll-backoff.runtime.js +1 -1
- package/dist/command-queue-CmX7XAL1.js +260 -0
- package/dist/command-registry-BF51N12E.js +3 -0
- package/dist/command-registry-BqpfCBbW.js +113 -0
- package/dist/command-secret-gateway-DuuctECr.js +528 -0
- package/dist/command-status-builders-CnD1rvYb.js +145 -0
- package/dist/commands-acp-DiLJUV45.js +1017 -0
- package/dist/commands-compact.runtime-BOM8PsWH.js +10 -0
- package/dist/commands-compact.runtime.js +1 -1
- package/dist/commands-context-C-jRwdK3.js +34 -0
- package/dist/commands-core.runtime-CH_aGeT-.js +2 -0
- package/dist/commands-core.runtime.js +1 -1
- package/dist/commands-handlers.runtime-Ca6xoeW5.js +3762 -0
- package/dist/commands-handlers.runtime.js +1 -1
- package/dist/commands-models-CRURuXR-.js +306 -0
- package/dist/commands-registry-CJw_6JDj.js +295 -0
- package/dist/commands-registry.runtime-78mbU8Il.js +2 -0
- package/dist/commands-registry.runtime.js +1 -1
- package/dist/commands-reset-hooks-D3RzsOIn.js +129 -0
- package/dist/commands-status-Cufj4x2j.js +223 -0
- package/dist/commands-status.runtime-C8Nz4Glk.js +2 -0
- package/dist/commands-status.runtime.js +1 -1
- package/dist/commands-subagents-control.runtime-DjhcmoRT.js +3 -0
- package/dist/commands-subagents-control.runtime-s_DYQWfW.js +2 -0
- package/dist/commands-subagents-control.runtime.js +1 -1
- package/dist/commands.runtime-ChfYOBeV.js +103 -0
- package/dist/commands.runtime.js +1 -1
- package/dist/comment-shared-DFEZzqhH.js +40 -0
- package/dist/compact-DEsHFhEL.js +11324 -0
- package/dist/compact.runtime-BzLFUSmk.js +7 -0
- package/dist/compact.runtime.js +1 -1
- package/dist/completion-cli-CiWtzUFQ.js +2 -0
- package/dist/completion-cli-h3zgpXGM.js +468 -0
- package/dist/config-B3cxNRyw.js +8 -0
- package/dist/config-Bd1PtH4x.js +166 -0
- package/dist/config-D5YvYnSX.js +136 -0
- package/dist/config-DuLfQQvE.js +53 -0
- package/dist/config-cli-BiEmyiRa.js +948 -0
- package/dist/config-defaults-Bw9wwyo1.js +163 -0
- package/dist/config-guard-BGGjXg_Y.js +94 -0
- package/dist/config-runtime-Bvdi0W59.js +14 -0
- package/dist/config-validation-BDeuMlc1.js +279 -0
- package/dist/configure-CUSDnrHs.js +2 -0
- package/dist/configure-FDqT3i_9.js +1162 -0
- package/dist/connection-auth-7izNv08V.js +30 -0
- package/dist/context-B2wCjR9D.js +249 -0
- package/dist/context-builder-BTAOEMTs.js +2 -0
- package/dist/context-n8ANhlMJ.js +2 -0
- package/dist/context-visibility-d6FHLhsq.js +14 -0
- package/dist/context-writer-COhxMkVz.js +290 -0
- package/dist/control-auth-Csa4b5CR.js +122 -0
- package/dist/control-ui/assets/agents-CYCtph5J.js +767 -0
- package/dist/control-ui/assets/anthropic-B66S-tt5.js +40 -0
- package/dist/control-ui/assets/azure-openai-responses-CRJyPvrW.js +2 -0
- package/dist/control-ui/assets/cron-DPaLQLTR.js +744 -0
- package/dist/control-ui/assets/dialogues-DPJy1B4C.js +83 -0
- package/dist/control-ui/assets/history-CT3DjMa7.js +71 -0
- package/dist/control-ui/assets/index-Ci2oc-eJ.css +1 -0
- package/dist/control-ui/assets/index-Ua-cFlP6.js +2686 -0
- package/dist/control-ui/assets/mistral-DWkPN1WM.js +72 -0
- package/dist/control-ui/assets/openai-codex-responses-CSJ_tbUW.js +8 -0
- package/dist/control-ui/assets/openai-completions-QUhkmdlC.js +6 -0
- package/dist/control-ui/assets/openai-responses-CjthZA3L.js +2 -0
- package/dist/control-ui/assets/openai-responses-shared-tozh4HQx.js +13 -0
- package/dist/control-ui/index.html +2 -2
- package/dist/control-ui-links-tILfT2Ek.js +70 -0
- package/dist/conversation-id-d7KXWjzV.js +140 -0
- package/dist/conversation-runtime-D-YmpVS2.js +31 -0
- package/dist/core-8TPCsNB-.js +210 -0
- package/dist/core-command-descriptors-CogWiUSt.js +112 -0
- package/dist/cron-cli-C5ok2iVK.js +637 -0
- package/dist/curator-9KwCnpXG.js +598 -0
- package/dist/curator-t_jLT3Ie.js +2 -0
- package/dist/daemon-cli-Cr_y38yv.js +476 -0
- package/dist/daemon-install-CrhzPiZ-.js +70 -0
- package/dist/delegate-r3VqUt34.js +61 -0
- package/dist/deliver-Cuu36rnv.js +3 -0
- package/dist/deliver-SAyi_F0e.js +782 -0
- package/dist/deliver-runtime-DKv9J6QE.js +2 -0
- package/dist/delivery-outbound.runtime-DDoInTnF.js +6 -0
- package/dist/delivery-outbound.runtime.js +1 -1
- package/dist/delivery-queue-CWi3kUit.js +372 -0
- package/dist/delivery-queue-ecSu6ZNL.js +2 -0
- package/dist/deps-BIU2SScd.js +60 -0
- package/dist/detect-9KcxEkJd.js +113 -0
- package/dist/device-bootstrap---geQnCr.js +4 -0
- package/dist/device-bootstrap-BEWox6at.js +248 -0
- package/dist/device-bootstrap-profile-BR1NnTGX.js +36 -0
- package/dist/device-identity-huL1Exh1.js +2 -0
- package/dist/device-pairing-DSkkI5A-.js +600 -0
- package/dist/devices-cli-BUAuMOOj.js +336 -0
- package/dist/diagnostic-BLwuJXPT.js +311 -0
- package/dist/diagnostics-Bh0Gbi4L.js +33 -0
- package/dist/diagnostics-BsUG_otQ.js +2 -0
- package/dist/direct-dm-D_7_vKGq.js +139 -0
- package/dist/directive-handling.fast-lane-C91i_iZm.js +2 -0
- package/dist/directive-handling.fast-lane-F7l0XNwG.js +64 -0
- package/dist/directive-handling.impl-8RAWZiZE.js +659 -0
- package/dist/directive-handling.impl-BxAIWFS-.js +2 -0
- package/dist/directive-handling.parse-B3O0CfXY.js +376 -0
- package/dist/directive-handling.persist-QXt7GHcD.js +139 -0
- package/dist/directive-handling.persist.runtime-CPPm2qYQ.js +2 -0
- package/dist/directive-handling.persist.runtime.js +1 -1
- package/dist/directive-handling.shared-C5ywsGJd.js +159 -0
- package/dist/directory-cli-D9v1dSPr.js +240 -0
- package/dist/dispatch-DoyBs65s.js +1126 -0
- package/dist/dispatch-acp-Dz8rU6t9.js +969 -0
- package/dist/dispatch-acp-command-bypass-CJ5xdqXR.js +38 -0
- package/dist/dispatch-acp-manager.runtime-tPUGDjl3.js +3 -0
- package/dist/dispatch-acp-manager.runtime.js +1 -1
- package/dist/dispatch-acp-media.runtime-rwYN3ewY.js +3 -0
- package/dist/dispatch-acp-media.runtime.js +1 -1
- package/dist/dispatch-acp-session.runtime-C9nyGih8.js +2 -0
- package/dist/dispatch-acp-session.runtime.js +1 -1
- package/dist/dispatch-acp-tts.runtime-B4jS8gyW.js +3 -0
- package/dist/dispatch-acp-tts.runtime.js +1 -1
- package/dist/dispatch-acp.runtime-Co-JFuKU.js +19 -0
- package/dist/dispatch-acp.runtime.js +1 -1
- package/dist/dns-cli-BRVJtnve.js +193 -0
- package/dist/docker-TZx6u2PT.js +826 -0
- package/dist/docs-cli-DvJd--iI.js +156 -0
- package/dist/doctor-completion-C46W5KI7.js +90 -0
- package/dist/doctor-config-preflight-B_UDrFsE.js +148 -0
- package/dist/doctor-config-preflight-DtvhOeuT.js +2 -0
- package/dist/doctor-state-migrations-Cd3yfnI1.js +2 -0
- package/dist/doctor-state-migrations-D3qorqjy.js +3 -0
- package/dist/drive-C2mxxJx5.js +718 -0
- package/dist/embedding-provider-C5S1sxvR.js +129 -0
- package/dist/embedding-provider-CNDA2uD3.js +26 -0
- package/dist/embedding-provider-CdVS1B85.js +33 -0
- package/dist/engine-B71iyBo0.js +72 -0
- package/dist/engine-CKgZ1obQ.js +82 -0
- package/dist/engine-embeddings-Bt1bTxtw.js +1489 -0
- package/dist/entry-capabilities-DrciJZn1.js +89 -0
- package/dist/entry.js +5 -5
- package/dist/env-overrides-DTd6EBBV.js +347 -0
- package/dist/env-overrides.runtime-Dxy8Shg7.js +7 -0
- package/dist/env-overrides.runtime.js +1 -1
- package/dist/exec-approval-forwarder.runtime-Dpa8Gi_P.js +3 -0
- package/dist/exec-approval-forwarder.runtime.js +1 -1
- package/dist/exec-approval-reply-BaUWuhD6.js +292 -0
- package/dist/exec-approval-session-target-BYtddDF5.js +165 -0
- package/dist/exec-approvals-cli-BuOJPaPp.js +485 -0
- package/dist/exec-defaults-B5egc-6t.js +1440 -0
- package/dist/extensionAPI.js +5 -5
- package/dist/extensions/alibaba/index.js +1 -1
- package/dist/extensions/alibaba/video-generation-provider.js +1 -1
- package/dist/extensions/anthropic/api.js +2 -2
- package/dist/extensions/anthropic/cli-auth-seam.js +1 -1
- package/dist/extensions/anthropic/cli-backend-api.js +2 -2
- package/dist/extensions/anthropic/cli-backend.js +1 -1
- package/dist/extensions/anthropic/cli-migration.js +1 -1
- package/dist/extensions/anthropic/cli-shared.js +1 -1
- package/dist/extensions/anthropic/config-defaults.js +1 -1
- package/dist/extensions/anthropic/contract-api.js +1 -1
- package/dist/extensions/anthropic/index.js +1 -1
- package/dist/extensions/anthropic/media-understanding-provider.js +1 -1
- package/dist/extensions/anthropic/provider-policy-api.js +1 -1
- package/dist/extensions/anthropic/register.runtime.js +1 -1
- package/dist/extensions/anthropic/replay-policy.js +1 -1
- package/dist/extensions/anthropic/setup-api.js +1 -1
- package/dist/extensions/anthropic/stream-wrappers.js +1 -1
- package/dist/extensions/anthropic/test-api.js +3 -3
- package/dist/extensions/anthropic-vertex/api.js +3 -3
- package/dist/extensions/anthropic-vertex/index.js +3 -3
- package/dist/extensions/anthropic-vertex/provider-catalog.js +1 -1
- package/dist/extensions/anthropic-vertex/region.js +1 -1
- package/dist/extensions/anthropic-vertex/setup-api.js +1 -1
- package/dist/extensions/arcee/index.js +4 -4
- package/dist/extensions/browser/browser-bridge.js +1 -1
- package/dist/extensions/browser/browser-cdp.js +1 -1
- package/dist/extensions/browser/browser-config.js +4 -4
- package/dist/extensions/browser/browser-control-auth.js +1 -1
- package/dist/extensions/browser/browser-doctor.js +5 -5
- package/dist/extensions/browser/browser-host-inspection.js +1 -1
- package/dist/extensions/browser/browser-maintenance.js +2 -2
- package/dist/extensions/browser/browser-profiles.js +2 -2
- package/dist/extensions/browser/browser-runtime-api.js +12 -12
- package/dist/extensions/browser/index.js +1 -1
- package/dist/extensions/browser/plugin-registration.js +1 -1
- package/dist/extensions/browser/register.runtime.js +3 -3
- package/dist/extensions/browser/runtime-api.js +13 -13
- package/dist/extensions/browser/setup-api.js +2 -2
- package/dist/extensions/browser/test-support.js +2 -2
- package/dist/extensions/byteplus/index.js +3 -3
- package/dist/extensions/byteplus/video-generation-provider.js +1 -1
- package/dist/extensions/cerebras/index.js +1 -1
- package/dist/extensions/chutes/api.js +3 -3
- package/dist/extensions/chutes/index.js +9 -9
- package/dist/extensions/chutes/models.js +1 -1
- package/dist/extensions/chutes/onboard.js +2 -2
- package/dist/extensions/chutes/provider-catalog.js +1 -1
- package/dist/extensions/cloudflare-ai-gateway/api.js +1 -1
- package/dist/extensions/cloudflare-ai-gateway/catalog-provider.js +1 -1
- package/dist/extensions/cloudflare-ai-gateway/index.js +7 -7
- package/dist/extensions/deepinfra/api.js +8 -8
- package/dist/extensions/deepinfra/embedding-provider.js +2 -2
- package/dist/extensions/deepinfra/image-generation-provider.js +1 -1
- package/dist/extensions/deepinfra/index.js +9 -9
- package/dist/extensions/deepinfra/media-models.js +2 -2
- package/dist/extensions/deepinfra/media-understanding-provider.js +1 -1
- package/dist/extensions/deepinfra/memory-embedding-adapter.js +1 -1
- package/dist/extensions/deepinfra/onboard.js +2 -2
- package/dist/extensions/deepinfra/provider-catalog.js +1 -1
- package/dist/extensions/deepinfra/provider-models.js +1 -1
- package/dist/extensions/deepinfra/speech-provider.js +1 -1
- package/dist/extensions/deepinfra/video-generation-provider.js +1 -1
- package/dist/extensions/deepseek/index.js +3 -3
- package/dist/extensions/device-pair/api.js +6 -6
- package/dist/extensions/device-pair/index.js +9 -9
- package/dist/extensions/device-pair/notify.js +1 -1
- package/dist/extensions/device-pair/pair-command-approve.js +1 -1
- package/dist/extensions/device-pair/qr-image.js +2 -2
- package/dist/extensions/diffs/.kaijibot-runtime-deps-stamp.json +1 -1
- package/dist/extensions/diffs/index.js +1 -1
- package/dist/extensions/diffs/node_modules/.package-lock.json +3 -3
- package/dist/extensions/diffs/node_modules/typebox/build/schema/engine/_stack.mjs +11 -12
- package/dist/extensions/diffs/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/dist/extensions/diffs/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/dist/extensions/diffs/node_modules/typebox/package.json +1 -1
- package/dist/extensions/diffs/node_modules/typebox/readme.md +31 -31
- package/dist/extensions/exa/index.js +4 -4
- package/dist/extensions/feishu/.kaijibot-runtime-deps-stamp.json +1 -1
- package/dist/extensions/feishu/api.js +21 -21
- package/dist/extensions/feishu/contract-api.js +2 -2
- package/dist/extensions/feishu/node_modules/.package-lock.json +3 -3
- package/dist/extensions/feishu/node_modules/typebox/build/schema/engine/_stack.mjs +11 -12
- package/dist/extensions/feishu/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/dist/extensions/feishu/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/dist/extensions/feishu/node_modules/typebox/package.json +1 -1
- package/dist/extensions/feishu/node_modules/typebox/readme.md +31 -31
- package/dist/extensions/feishu/runtime-api.js +4 -4
- package/dist/extensions/feishu/security-contract-api.js +1 -1
- package/dist/extensions/feishu/session-key-api.js +1 -1
- package/dist/extensions/feishu/setup-api.js +1 -1
- package/dist/extensions/fireworks/index.js +4 -4
- package/dist/extensions/fireworks/stream.js +1 -1
- package/dist/extensions/github-copilot/api.js +1 -1
- package/dist/extensions/github-copilot/index.js +7 -7
- package/dist/extensions/github-copilot/login.js +1 -1
- package/dist/extensions/github-copilot/models-defaults.js +1 -1
- package/dist/extensions/github-copilot/models.js +1 -1
- package/dist/extensions/github-copilot/register.runtime.js +6 -6
- package/dist/extensions/github-copilot/replay-policy.js +1 -1
- package/dist/extensions/github-copilot/stream.js +1 -1
- package/dist/extensions/google/api.js +1 -1
- package/dist/extensions/google/gemini-cli-provider.js +1 -1
- package/dist/extensions/google/google-shared.test-helpers.js +1 -1
- package/dist/extensions/google/image-generation-provider.js +1 -1
- package/dist/extensions/google/index.js +5 -5
- package/dist/extensions/google/media-understanding-provider.js +1 -1
- package/dist/extensions/google/music-generation-provider.js +1 -1
- package/dist/extensions/google/oauth-token-shared.js +1 -1
- package/dist/extensions/google/oauth.credentials.js +1 -1
- package/dist/extensions/google/oauth.flow.js +1 -1
- package/dist/extensions/google/oauth.http.js +1 -1
- package/dist/extensions/google/oauth.js +2 -2
- package/dist/extensions/google/oauth.project.js +1 -1
- package/dist/extensions/google/oauth.runtime.js +1 -1
- package/dist/extensions/google/oauth.settings.js +1 -1
- package/dist/extensions/google/oauth.token.js +1 -1
- package/dist/extensions/google/provider-models.js +1 -1
- package/dist/extensions/google/provider-registration.js +1 -1
- package/dist/extensions/google/runtime-api.js +2 -2
- package/dist/extensions/google/test-api.js +2 -2
- package/dist/extensions/google/video-generation-provider.js +1 -1
- package/dist/extensions/google/web-search-contract-api.js +1 -1
- package/dist/extensions/google/web-search-provider.js +1 -1
- package/dist/extensions/gradium/index.js +1 -1
- package/dist/extensions/gradium/speech-provider.js +1 -1
- package/dist/extensions/gradium/tts.js +1 -1
- package/dist/extensions/groq/index.js +1 -1
- package/dist/extensions/groq/media-understanding-provider.js +1 -1
- package/dist/extensions/groq/test-api.js +1 -1
- package/dist/extensions/huggingface/api.js +3 -3
- package/dist/extensions/huggingface/index.js +3 -3
- package/dist/extensions/huggingface/models.js +1 -1
- package/dist/extensions/huggingface/onboard.js +1 -1
- package/dist/extensions/huggingface/provider-catalog.js +2 -2
- package/dist/extensions/image-generation-core/api.js +2 -2
- package/dist/extensions/image-generation-core/runtime-api.js +2 -2
- package/dist/extensions/kilocode/api.js +2 -2
- package/dist/extensions/kilocode/index.js +8 -8
- package/dist/extensions/kilocode/onboard.js +2 -2
- package/dist/extensions/kilocode/provider-catalog.js +1 -1
- package/dist/extensions/kilocode/provider-models.js +1 -1
- package/dist/extensions/kilocode/shared.js +1 -1
- package/dist/extensions/kimi-coding/index.js +4 -4
- package/dist/extensions/kindle-portal/.kaijibot-runtime-deps-stamp.json +1 -1
- package/dist/extensions/kindle-portal/node_modules/.package-lock.json +3 -3
- package/dist/extensions/kindle-portal/node_modules/typebox/build/schema/engine/_stack.mjs +11 -12
- package/dist/extensions/kindle-portal/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/dist/extensions/kindle-portal/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/dist/extensions/kindle-portal/node_modules/typebox/package.json +1 -1
- package/dist/extensions/kindle-portal/node_modules/typebox/readme.md +31 -31
- package/dist/extensions/knowledge-wiki/index.js +2 -2
- package/dist/extensions/litellm/index.js +1 -1
- package/dist/extensions/llm-task/index.js +1 -1
- package/dist/extensions/lmstudio/api.js +8 -8
- package/dist/extensions/lmstudio/index.js +3 -3
- package/dist/extensions/lmstudio/runtime-api.js +1 -1
- package/dist/extensions/media-understanding-core/runtime-api.js +2 -2
- package/dist/extensions/memory-core/cli-metadata.js +2 -2
- package/dist/extensions/memory-core/index.js +12 -12
- package/dist/extensions/memory-core/manager-runtime.js +1 -1
- package/dist/extensions/memory-core/runtime-api.js +5 -5
- package/dist/extensions/memory-lancedb/cli-metadata.js +1 -1
- package/dist/extensions/memory-lancedb/index.js +3 -3
- package/dist/extensions/microsoft/index.js +1 -1
- package/dist/extensions/microsoft/kaijibot.plugin.json +4 -0
- package/dist/extensions/microsoft/speech-provider.js +1 -1
- package/dist/extensions/microsoft/test-api.js +1 -1
- package/dist/extensions/microsoft/tts.js +1 -1
- package/dist/extensions/microsoft-foundry/auth.js +1 -1
- package/dist/extensions/microsoft-foundry/cli.js +1 -1
- package/dist/extensions/microsoft-foundry/index.js +1 -1
- package/dist/extensions/microsoft-foundry/onboard.js +2 -2
- package/dist/extensions/microsoft-foundry/provider.js +1 -1
- package/dist/extensions/microsoft-foundry/runtime.js +1 -1
- package/dist/extensions/microsoft-foundry/shared-runtime.js +2 -2
- package/dist/extensions/microsoft-foundry/shared.js +1 -1
- package/dist/extensions/minimax/api.js +5 -5
- package/dist/extensions/minimax/image-generation-provider.js +1 -1
- package/dist/extensions/minimax/index.js +7 -7
- package/dist/extensions/minimax/media-understanding-provider.js +1 -1
- package/dist/extensions/minimax/model-definitions.js +1 -1
- package/dist/extensions/minimax/music-generation-provider.js +1 -1
- package/dist/extensions/minimax/oauth.js +1 -1
- package/dist/extensions/minimax/oauth.runtime.js +1 -1
- package/dist/extensions/minimax/onboard.js +1 -1
- package/dist/extensions/minimax/provider-catalog.js +1 -1
- package/dist/extensions/minimax/provider-http.test-helpers.js +1 -1
- package/dist/extensions/minimax/provider-models.js +1 -1
- package/dist/extensions/minimax/provider-registration.js +1 -1
- package/dist/extensions/minimax/speech-provider.js +1 -1
- package/dist/extensions/minimax/test-api.js +2 -2
- package/dist/extensions/minimax/video-generation-provider.js +1 -1
- package/dist/extensions/minimax/web-search-contract-api.js +1 -1
- package/dist/extensions/minimax/web-search-provider.js +1 -1
- package/dist/extensions/mistral/embedding-provider.js +1 -1
- package/dist/extensions/mistral/index.js +3 -3
- package/dist/extensions/mistral/media-understanding-provider.js +1 -1
- package/dist/extensions/mistral/memory-embedding-adapter.js +3 -3
- package/dist/extensions/mistral/provider-compat.js +1 -1
- package/dist/extensions/mistral/test-api.js +1 -1
- package/dist/extensions/moonshot/api.js +3 -3
- package/dist/extensions/moonshot/index.js +9 -9
- package/dist/extensions/moonshot/media-understanding-provider.js +1 -1
- package/dist/extensions/moonshot/onboard.js +1 -1
- package/dist/extensions/moonshot/provider-catalog.js +1 -1
- package/dist/extensions/moonshot/test-api.js +2 -2
- package/dist/extensions/moonshot/web-search-contract-api.js +1 -1
- package/dist/extensions/moonshot/web-search-provider.js +1 -1
- package/dist/extensions/nvidia/index.js +1 -1
- package/dist/extensions/ollama/api.js +4 -4
- package/dist/extensions/ollama/index.js +8 -8
- package/dist/extensions/ollama/provider-discovery.js +1 -1
- package/dist/extensions/ollama/runtime-api.js +2 -2
- package/dist/extensions/ollama/web-search-contract-api.js +1 -1
- package/dist/extensions/ollama/web-search-provider.js +1 -1
- package/dist/extensions/openai/api.js +3 -3
- package/dist/extensions/openai/image-generation-provider.js +1 -1
- package/dist/extensions/openai/index.js +9 -9
- package/dist/extensions/openai/media-understanding-provider.js +1 -1
- package/dist/extensions/openai/openai-codex-auth-identity.js +1 -1
- package/dist/extensions/openai/openai-codex-cli-auth.js +1 -1
- package/dist/extensions/openai/openai-codex-provider.js +1 -1
- package/dist/extensions/openai/openai-codex-provider.runtime.js +2 -2
- package/dist/extensions/openai/openai-codex-shared.js +1 -1
- package/dist/extensions/openai/openai-provider.js +1 -1
- package/dist/extensions/openai/prompt-overlay.js +1 -1
- package/dist/extensions/openai/realtime-provider-shared.js +1 -1
- package/dist/extensions/openai/realtime-transcription-provider.js +1 -1
- package/dist/extensions/openai/realtime-voice-provider.js +1 -1
- package/dist/extensions/openai/register.runtime.js +8 -8
- package/dist/extensions/openai/shared.js +3 -3
- package/dist/extensions/openai/speech-provider.js +1 -1
- package/dist/extensions/openai/test-api.js +5 -5
- package/dist/extensions/openai/transport-policy.js +1 -1
- package/dist/extensions/openai/video-generation-provider.js +1 -1
- package/dist/extensions/opencode/index.js +4 -4
- package/dist/extensions/opencode-go/index.js +3 -3
- package/dist/extensions/openrouter/api.js +2 -2
- package/dist/extensions/openrouter/image-generation-provider.js +1 -1
- package/dist/extensions/openrouter/index.js +8 -8
- package/dist/extensions/openrouter/media-understanding-provider.js +1 -1
- package/dist/extensions/openrouter/music-generation-provider.js +1 -1
- package/dist/extensions/openrouter/stream.js +1 -1
- package/dist/extensions/openrouter/test-api.js +3 -3
- package/dist/extensions/openrouter/video-generation-provider.js +6 -6
- package/dist/extensions/openrouter/video-http.js +1 -1
- package/dist/extensions/openrouter/video-model-catalog.js +1 -1
- package/dist/extensions/openshell/index.js +4 -4
- package/dist/extensions/perplexity/index.js +1 -1
- package/dist/extensions/perplexity/test-api.js +1 -1
- package/dist/extensions/perplexity/web-search-contract-api.js +1 -1
- package/dist/extensions/perplexity/web-search-provider.js +1 -1
- package/dist/extensions/qianfan/index.js +1 -1
- package/dist/extensions/qwen/api.js +4 -4
- package/dist/extensions/qwen/index.js +8 -8
- package/dist/extensions/qwen/media-understanding-provider.js +1 -1
- package/dist/extensions/qwen/model-definitions.js +1 -1
- package/dist/extensions/qwen/models.js +1 -1
- package/dist/extensions/qwen/onboard.js +1 -1
- package/dist/extensions/qwen/provider-catalog.js +1 -1
- package/dist/extensions/qwen/stream.js +1 -1
- package/dist/extensions/qwen/test-api.js +2 -2
- package/dist/extensions/qwen/video-generation-provider.js +1 -1
- package/dist/extensions/runway/index.js +1 -1
- package/dist/extensions/runway/video-generation-provider.js +1 -1
- package/dist/extensions/sglang/api.js +2 -2
- package/dist/extensions/sglang/index.js +2 -2
- package/dist/extensions/sglang/models.js +1 -1
- package/dist/extensions/sherpa-speech/asr.js +2 -0
- package/dist/extensions/sherpa-speech/engine.js +3 -0
- package/dist/extensions/sherpa-speech/index.js +36 -0
- package/dist/extensions/sherpa-speech/kaijibot.plugin.json +20 -0
- package/dist/extensions/sherpa-speech/model-manager.js +2 -0
- package/dist/extensions/sherpa-speech/models.js +2 -0
- package/dist/extensions/sherpa-speech/package.json +12 -0
- package/dist/extensions/sherpa-speech/runtime.js +2 -0
- package/dist/extensions/speech-core/api.js +3 -3
- package/dist/extensions/speech-core/runtime-api.js +5 -5
- package/dist/extensions/stepfun/index.js +4 -4
- package/dist/extensions/stepfun/onboard.js +1 -1
- package/dist/extensions/stepfun/provider-catalog.js +1 -1
- package/dist/extensions/talk-voice/api.js +1 -1
- package/dist/extensions/talk-voice/index.js +3 -3
- package/dist/extensions/tavily/index.js +5 -5
- package/dist/extensions/together/api.js +3 -3
- package/dist/extensions/together/index.js +3 -3
- package/dist/extensions/together/models.js +1 -1
- package/dist/extensions/together/onboard.js +1 -1
- package/dist/extensions/together/provider-catalog.js +1 -1
- package/dist/extensions/together/video-generation-provider.js +5 -5
- package/dist/extensions/venice/api.js +3 -3
- package/dist/extensions/venice/index.js +6 -6
- package/dist/extensions/venice/models.js +1 -1
- package/dist/extensions/venice/onboard.js +2 -2
- package/dist/extensions/venice/provider-catalog.js +1 -1
- package/dist/extensions/vercel-ai-gateway/api.js +3 -3
- package/dist/extensions/vercel-ai-gateway/index.js +3 -3
- package/dist/extensions/vercel-ai-gateway/models.js +1 -1
- package/dist/extensions/vercel-ai-gateway/onboard.js +1 -1
- package/dist/extensions/vercel-ai-gateway/provider-catalog.js +1 -1
- package/dist/extensions/vllm/api.js +3 -3
- package/dist/extensions/vllm/defaults.js +1 -1
- package/dist/extensions/vllm/index.js +3 -3
- package/dist/extensions/vllm/models.js +1 -1
- package/dist/extensions/vllm/register.runtime.js +3 -3
- package/dist/extensions/volcengine/api.js +2 -2
- package/dist/extensions/volcengine/index.js +4 -4
- package/dist/extensions/volcengine/models.js +1 -1
- package/dist/extensions/volcengine/provider-catalog.js +1 -1
- package/dist/extensions/vydra/image-generation-provider.js +1 -1
- package/dist/extensions/vydra/index.js +6 -6
- package/dist/extensions/vydra/onboard.js +1 -1
- package/dist/extensions/vydra/shared.js +1 -1
- package/dist/extensions/vydra/speech-provider.js +1 -1
- package/dist/extensions/vydra/video-generation-provider.js +1 -1
- package/dist/extensions/webhooks/.kaijibot-runtime-deps-stamp.json +1 -1
- package/dist/extensions/webhooks/api.js +1 -1
- package/dist/extensions/webhooks/index.js +4 -4
- package/dist/extensions/webhooks/runtime-api.js +1 -1
- package/dist/extensions/wechat/api.js +32 -10
- package/dist/extensions/xai/api.js +6 -6
- package/dist/extensions/xai/code-execution.js +6 -6
- package/dist/extensions/xai/index.js +15 -15
- package/dist/extensions/xai/model-definitions.js +1 -1
- package/dist/extensions/xai/model-id.js +1 -1
- package/dist/extensions/xai/onboard.js +1 -1
- package/dist/extensions/xai/provider-catalog.js +1 -1
- package/dist/extensions/xai/provider-models.js +1 -1
- package/dist/extensions/xai/setup-api.js +1 -1
- package/dist/extensions/xai/stream.js +1 -1
- package/dist/extensions/xai/video-generation-provider.js +1 -1
- package/dist/extensions/xai/web-search-contract-api.js +1 -1
- package/dist/extensions/xai/web-search.js +1 -1
- package/dist/extensions/xai/x-search-tool-shared.js +1 -1
- package/dist/extensions/xai/x-search.js +6 -6
- package/dist/extensions/xiaomi/api.js +2 -2
- package/dist/extensions/xiaomi/index.js +3 -3
- package/dist/extensions/xiaomi/onboard.js +1 -1
- package/dist/extensions/xiaomi/provider-catalog.js +1 -1
- package/dist/extensions/zai/api.js +3 -3
- package/dist/extensions/zai/detect.js +1 -1
- package/dist/extensions/zai/index.js +12 -12
- package/dist/extensions/zai/media-understanding-provider.js +1 -1
- package/dist/extensions/zai/model-definitions.js +1 -1
- package/dist/extensions/zai/onboard.js +1 -1
- package/dist/extensions/zai/runtime-api.js +1 -1
- package/dist/extensions/zai/test-api.js +1 -1
- package/dist/extra-params-Bfdm7Piq.js +295 -0
- package/dist/fetch-4HO0k3hc.js +65 -0
- package/dist/fetch-guard-BWtRcc5b.js +224 -0
- package/dist/fetch-jNI8hIPZ.js +256 -0
- package/dist/format-KzNAm6y6.js +245 -0
- package/dist/fragment-collector-DEW1fwlc.js +189 -0
- package/dist/fragment-store-C9tRSlBU.js +2 -0
- package/dist/fragment-store-F7KNJ21T.js +230 -0
- package/dist/gateway-CR7RtTbI.js +2 -0
- package/dist/gateway-CuQC7wph.js +119 -0
- package/dist/gateway-cli-CWHsIpm8.js +1532 -0
- package/dist/gateway-discovery-targets-Bww-Rx4g.js +431 -0
- package/dist/gateway-install-token-CcpoWcqs.js +284 -0
- package/dist/gateway-lock-B4umteJZ.js +238 -0
- package/dist/gateway-rpc-Do_3fQSm.js +14 -0
- package/dist/gateway-rpc.runtime-C4kzyrJj.js +23 -0
- package/dist/gateway-rpc.runtime.js +1 -1
- package/dist/gateway-secret-options-DT6lYhI9.js +38 -0
- package/dist/gemini-cli-provider-YULRMcs8.js +106 -0
- package/dist/gemini-web-search-provider-D_QJZMM3.js +167 -0
- package/dist/get-reply-from-config.runtime-BpdriKtr.js +2 -0
- package/dist/get-reply-from-config.runtime.js +1 -1
- package/dist/git-commit-Cblh675s.js +2 -0
- package/dist/gmail-setup-utils-D_e1q-h_.js +422 -0
- package/dist/group-policy-BxTxJeKP.js +202 -0
- package/dist/groups.runtime.js +1 -1
- package/dist/hard-trigger-D6Zoztuc.js +106 -0
- package/dist/health-B5YmS_bW.js +2 -0
- package/dist/health-CQ4zXQ-2.js +579 -0
- package/dist/heartbeat-B1UJqney.js +184 -0
- package/dist/heartbeat-runner--rVDmB2Z.js +1365 -0
- package/dist/heartbeat-runner-CwtXIPI-.js +4 -0
- package/dist/heartbeat-runner.runtime-D_5UeAsX.js +2 -0
- package/dist/heartbeat-runner.runtime.js +1 -1
- package/dist/heartbeat-summary-Cf17FCYf.js +58 -0
- package/dist/heartbeat-visibility-BpEZ4Xf-.js +86 -0
- package/dist/help-CAj5xloH.js +76 -0
- package/dist/hooks-cli-BGDBJqzt.js +364 -0
- package/dist/hooks-status-DmEGo9Fp.js +86 -0
- package/dist/identity-Bwhl61jK.js +30 -0
- package/dist/identity-avatar-Bu5l4dFW.js +87 -0
- package/dist/image-DiK7kcmJ.js +152 -0
- package/dist/image-generation-core-Cwutmg_V.js +17 -0
- package/dist/image-generation-core.auth.runtime-DA7XD5V2.js +2 -0
- package/dist/image-generation-core.auth.runtime.js +1 -1
- package/dist/image-generation-provider-B-0SxnvJ.js +280 -0
- package/dist/image-generation-provider-B-UW3NU_.js +94 -0
- package/dist/image-generation-provider-BR1_oIU4.js +130 -0
- package/dist/image-generation-provider-BvAaZO7K.js +86 -0
- package/dist/image-generation-provider-CnGMLnE9.js +163 -0
- package/dist/image-generation-provider-DHvw6TSJ.js +136 -0
- package/dist/image-generation-runtime-DCWf9P6F.js +2 -0
- package/dist/image-runtime-DGNzvqkb.js +7 -0
- package/dist/images-BwT2L5zh.js +586 -0
- package/dist/inbound-reply-dispatch-DgEqNffL.js +73 -0
- package/dist/inbound.runtime-CloYEZJO.js +4 -0
- package/dist/inbound.runtime-DLbKJWOY.js +3 -0
- package/dist/inbound.runtime.js +1 -1
- package/dist/index.js +2 -2
- package/dist/infra-runtime-DE-Vi3Dn.js +25 -0
- package/dist/ingest-DbZJju1a.js +842 -0
- package/dist/ingest-Dyj9M3ZM.js +2 -0
- package/dist/input-files-tzSehEsO.js +252 -0
- package/dist/inspect-_4i1jBjC.js +2 -0
- package/dist/inspect-dprTBmSB.js +282 -0
- package/dist/install-DCsrCvd1.js +662 -0
- package/dist/install-security-scan-CckHbywU.js +22 -0
- package/dist/install-security-scan.runtime-BgROR-cq.js +299 -0
- package/dist/install-security-scan.runtime.js +1 -1
- package/dist/install-skills-BcVojHit.js +70 -0
- package/dist/install.runtime-C3_WB-H4.js +12 -0
- package/dist/install.runtime-CoXV-73Y.js +27 -0
- package/dist/install.runtime.js +1 -1
- package/dist/io-Bz-M35LC.js +7184 -0
- package/dist/io-DacBLjh1.js +5 -0
- package/dist/issue-format-CoEMThLD.js +2 -0
- package/dist/kaijibot-tools-Df_9YJcO.js +9434 -0
- package/dist/kaijibot-tools.runtime-CZId-V1O.js +2 -0
- package/dist/kaijibot-tools.runtime.js +1 -1
- package/dist/kill-tree-DerqhtJm.js +2 -0
- package/dist/kimi-web-search-provider-DunVVASJ.js +308 -0
- package/dist/launchd-Bh7KL8au.js +556 -0
- package/dist/library-BqMFzJMy.js +45 -0
- package/dist/lifecycle-core-DD_IXtH-.js +422 -0
- package/dist/list.runtime-DU0ctAjd.js +12 -0
- package/dist/list.runtime-DXWlaAJq.js +9 -0
- package/dist/list.runtime.js +1 -1
- package/dist/llm-draft-generator-B9jtO6H9.js +2 -0
- package/dist/llm-draft-generator-bfVpcuQF.js +567 -0
- package/dist/llm-engine-CMR9RxLA.js +1792 -0
- package/dist/llm-engine-VKRjaGY_.js +2 -0
- package/dist/llm-extractor-BCPvoWmb.js +445 -0
- package/dist/llm-slug-generator.js +2 -2
- package/dist/load-context-DV3B4twI.js +51 -0
- package/dist/logging-BMNGvpuz.js +13 -0
- package/dist/logging-CN3VAZ70.js +2 -0
- package/dist/login-Dex1JqnY.js +108 -0
- package/dist/logs-cli-BZFJyrsk.js +264 -0
- package/dist/logs-cli.runtime-bBS2Sbi6.js +2 -0
- package/dist/logs-cli.runtime.js +1 -1
- package/dist/manager-BmS2ofc4.js +2049 -0
- package/dist/manager-CabVEPeE.js +3314 -0
- package/dist/markdown-tables-DyVly8kN.js +51 -0
- package/dist/mcp/plugin-tools-serve.js +3 -3
- package/dist/mcp-cli-DGrmbpsu.js +733 -0
- package/dist/mcp-config-CY_3tJVi.js +115 -0
- package/dist/media-models-Dw0Y1LxG.js +49 -0
- package/dist/media-runtime-CAa8uHqv.js +312 -0
- package/dist/media-understanding-D_VRj6xY.js +83 -0
- package/dist/media-understanding-provider-B9Jfjq6L.js +13 -0
- package/dist/media-understanding-provider-BWksuEBw.js +30 -0
- package/dist/media-understanding-provider-Bhtq5Kpe.js +14 -0
- package/dist/media-understanding-provider-BzsmDAMk.js +67 -0
- package/dist/media-understanding-provider-C6_6yxvP.js +123 -0
- package/dist/media-understanding-provider-CdRlAb9s.js +18 -0
- package/dist/media-understanding-provider-D5m-2RW8.js +21 -0
- package/dist/media-understanding-provider-PmVmfI6p.js +112 -0
- package/dist/media-understanding-provider-cmLTPd8x.js +18 -0
- package/dist/media-understanding-provider-nPxfFv8l.js +37 -0
- package/dist/media-understanding-provider-yp9gxov6.js +69 -0
- package/dist/media-understanding-runtime-Bu7m-lVs.js +2 -0
- package/dist/memory-5jlpYBqx.js +242 -0
- package/dist/memory-BFKl6oSn.js +3 -0
- package/dist/memory-core-host-engine-embeddings-p06288xV.js +2 -0
- package/dist/memory-core-host-engine-foundation-DHbdNLgZ.js +11 -0
- package/dist/memory-core-host-runtime-cli-BnvAiNzO.js +9 -0
- package/dist/memory-core-host-runtime-core-CnVg69Uw.js +8 -0
- package/dist/memory-embedding-adapter-Cux48Bvk.js +33 -0
- package/dist/memory-host-search.runtime-D6ORyqHq.js +2 -0
- package/dist/memory-host-search.runtime.js +1 -1
- package/dist/memory-index-DSbV_yD0.js +2 -0
- package/dist/memory-index-EFkCRTeh.js +514 -0
- package/dist/memory-runtime-BKqNwQ9X.js +2 -0
- package/dist/memory-runtime-Cn41W0bC.js +26 -0
- package/dist/message-CMCdNyAT.js +223 -0
- package/dist/message-action-runner-CG2CcWaS.js +1628 -0
- package/dist/message-action-runner-DUZQ7nmt.js +2 -0
- package/dist/message.config.runtime-B3ztIjsr.js +3 -0
- package/dist/message.config.runtime.js +1 -1
- package/dist/message.gateway.runtime-COLMRCv4.js +2 -0
- package/dist/message.gateway.runtime.js +1 -1
- package/dist/metadata-registry-loader-BSyFpHop.js +15 -0
- package/dist/metadata-registry-loader-Ci3mcmNV.js +2 -0
- package/dist/method-scopes-BNjBMlqM.js +2883 -0
- package/dist/minimax-vlm-D1DbVSjC.js +183 -0
- package/dist/minimax-web-search-provider-BzgvahXM.js +165 -0
- package/dist/mmr-Clamw4uq.js +146 -0
- package/dist/model-CJIbRRp9.js +630 -0
- package/dist/model-auth-BQpkMtoP.js +427 -0
- package/dist/model-auth-env-BWJjZ_uc.js +53 -0
- package/dist/model-auth-env-CZXe-GO2.js +2 -0
- package/dist/model-auth-label-dLSkL9EI.js +45 -0
- package/dist/model-catalog-DgqowW_L.js +204 -0
- package/dist/model-definitions-BOTIDDWJ.js +258 -0
- package/dist/model-definitions-mx0Ogg9X.js +74 -0
- package/dist/model-discovery-live.runtime-D2J8zvfK.js +419 -0
- package/dist/model-discovery-live.runtime.js +1 -1
- package/dist/model-discovery-modelsdev-BKijFiV8.js +174 -0
- package/dist/model-manager-D6ZJxU6i.js +213 -0
- package/dist/model-picker-B4SuA28P.js +3 -0
- package/dist/model-picker-buwrc8kM.js +500 -0
- package/dist/model-picker.runtime-DXgS2Rab.js +15 -0
- package/dist/model-picker.runtime.js +1 -1
- package/dist/model-selection-CBuo2hSg.js +381 -0
- package/dist/model-suppression-CthTVW_x.js +28 -0
- package/dist/model-suppression.runtime-R-qnGNBa.js +7 -0
- package/dist/model-suppression.runtime.js +1 -1
- package/dist/models-B3UnmjRf.js +18 -0
- package/dist/models-BmveqjOE.js +126 -0
- package/dist/models-BucP8NI1.js +760 -0
- package/dist/models-C3w7hz3K.js +18 -0
- package/dist/models-C4-eAnR7.js +157 -0
- package/dist/models-Ce7KsgeW.js +90 -0
- package/dist/models-DMLYOe4h.js +2 -0
- package/dist/models-DNNfkS3j.js +2584 -0
- package/dist/models-D_V6hTy-.js +166 -0
- package/dist/models-DkiHZi9S.js +47 -0
- package/dist/models-OhM18fW_.js +555 -0
- package/dist/models-cli-CfvtZXPd.js +198 -0
- package/dist/models-config-BLMZzgfx.js +900 -0
- package/dist/models-config.providers.secrets-rjdH8T5l.js +299 -0
- package/dist/models-yLN-WhXt.js +19 -0
- package/dist/models.fetch-D1o7sMO8.js +518 -0
- package/dist/monitor-CJdL31iS.js +4435 -0
- package/dist/monitor-DB732mUY.js +1023 -0
- package/dist/music-generation-provider-BrUTQBmG.js +169 -0
- package/dist/music-generation-provider-D6aYWSSm.js +238 -0
- package/dist/music-generation-provider-dpX_Oiuw.js +142 -0
- package/dist/node-cli-BSrC37hh.js +2374 -0
- package/dist/node-command-policy-J_sy6jJz.js +205 -0
- package/dist/node-service-Bz1OVtIc.js +69 -0
- package/dist/nodes-cli-uwgDIsqv.js +1046 -0
- package/dist/nodes-screen-EQaXZCHa.js +216 -0
- package/dist/nodes-utils-ChvZvxK1.js +196 -0
- package/dist/nodes.helpers-WGb2Q8DZ.js +34 -0
- package/dist/normalize-reply-B7T9vV8x.js +72 -0
- package/dist/note-9YcA8RtG.js +110 -0
- package/dist/notify-C9-q0Rdu.js +305 -0
- package/dist/oauth-CVAbqwnx.js +152 -0
- package/dist/oauth-RbN-L8pg.js +57 -0
- package/dist/oauth-token-shared-CCzflFLG.js +28 -0
- package/dist/oauth.credentials-BeCOUsTe.js +165 -0
- package/dist/oauth.flow-C2PFyq_h.js +122 -0
- package/dist/oauth.http-BgZeCfvj.js +23 -0
- package/dist/oauth.project-jFMmutMJ.js +123 -0
- package/dist/oauth.settings-CBmYrmAk.js +44 -0
- package/dist/oauth.token-DSow_5Ie.js +43 -0
- package/dist/onboard-8SmAjhIH.js +67 -0
- package/dist/onboard-B-ZJptUZ.js +25 -0
- package/dist/onboard-BXjJLJku.js +22 -0
- package/dist/onboard-Beu-mw_-.js +29 -0
- package/dist/onboard-BzUrcgZ5.js +25 -0
- package/dist/onboard-CPuf8esc.js +25 -0
- package/dist/onboard-CR4uUkKJ.js +36 -0
- package/dist/onboard-CRIds5S5.js +34 -0
- package/dist/onboard-CTfex1XR2.js +58 -0
- package/dist/onboard-CWwwe5B4.js +48 -0
- package/dist/onboard-Cksl3HNo.js +54 -0
- package/dist/onboard-D-ccZlbM.js +312 -0
- package/dist/onboard-DHXNhsF7.js +621 -0
- package/dist/onboard-Dd6X5k1s.js +25 -0
- package/dist/onboard-channels-BRKpgYQD.js +524 -0
- package/dist/onboard-channels-C1HMTw0C.js +3 -0
- package/dist/onboard-config-Crb6F0O5.js +2 -0
- package/dist/onboard-custom-9KIp_ybR.js +647 -0
- package/dist/onboard-custom-CbXUFVN6.js +2 -0
- package/dist/onboard-helpers-BFknCN7m.js +223 -0
- package/dist/onboard-helpers-DSJ_xWpL.js +5 -0
- package/dist/onboard-hooks-CDjwsD6n.js +35 -0
- package/dist/onboard-maT5oxKX.js +29 -0
- package/dist/onboard-remote-C28pAu4b.js +193 -0
- package/dist/onboard-remote-DQxyE18D.js +2 -0
- package/dist/onboard-search-CPHGVmos.js +324 -0
- package/dist/onboard-skills-B642NK1o.js +2 -0
- package/dist/onboard-skills-CI4B6Kx5.js +134 -0
- package/dist/openai-codex-auth-identity-PqpqYz4a.js +45 -0
- package/dist/openai-codex-cli-auth-cFTkwXjR.js +57 -0
- package/dist/openai-codex-provider-DjUpM_l9.js +299 -0
- package/dist/openai-codex-shared-o0pq7UkS.js +6 -0
- package/dist/openai-provider-ChZN4Q0c.js +283 -0
- package/dist/openai-transport-stream-DXBBlxJ9.js +1632 -0
- package/dist/openclaw-migrator-CMpCBNkK.js +2 -0
- package/dist/operator-approvals-client-RJESCyw4.js +68 -0
- package/dist/order-D863tCt-.js +794 -0
- package/dist/outbound-runtime-Bhs-eGEn.js +2 -0
- package/dist/pair-command-approve-5Jr6xo-1.js +34 -0
- package/dist/pairing-cli-BF3jieZo.js +118 -0
- package/dist/parse-DH0T3Cu9.js +168 -0
- package/dist/perplexity-web-search-provider-DqEogUCL.js +92 -0
- package/dist/perplexity-web-search-provider.runtime-Clsvb0kX.js +332 -0
- package/dist/perplexity-web-search-provider.runtime-bOr3A0b4.js +2 -0
- package/dist/perplexity-web-search-provider.runtime.js +1 -1
- package/dist/perplexity-web-search-provider.shared-DzXnzvHH.js +73 -0
- package/dist/persistent-bindings.lifecycle-CjXEQUMz.js +94 -0
- package/dist/pi-bundle-mcp-tools-DPVGNVRw.js +709 -0
- package/dist/pi-embedded-Cp3OIZy9.js +2 -0
- package/dist/pi-embedded-DJN2vlNF.js +6 -0
- package/dist/pi-embedded-runner-DXHhhGRS.js +8348 -0
- package/dist/pi-embedded-subscribe.handlers.compaction.runtime-D1jUEg-R.js +23 -0
- package/dist/pi-embedded-subscribe.handlers.compaction.runtime.js +1 -1
- package/dist/pi-embedded-utils-CtraRgVx.js +212 -0
- package/dist/pi-embedded.runtime-DQPfEvkF.js +5 -0
- package/dist/pi-embedded.runtime.js +1 -1
- package/dist/pi-model-discovery-B9q9ykaA.js +232 -0
- package/dist/pi-tools.before-tool-call.runtime-vGvkJ6V9.js +354 -0
- package/dist/pi-tools.before-tool-call.runtime.js +1 -1
- package/dist/plugin-enabled-CMdiRqJS.js +71 -0
- package/dist/plugin-install-Cgd9nFeK.js +2 -0
- package/dist/plugin-install-DpYtmnGU.js +227 -0
- package/dist/plugin-install-config-policy-32D2JJMl.js +137 -0
- package/dist/plugin-install-plan-DR1__A8c.js +50 -0
- package/dist/plugin-registration-BhPJI7wp.js +23 -0
- package/dist/plugin-registry-Bo4RF_Fn.js +2 -0
- package/dist/plugin-registry-C4M8QkVh.js +3 -0
- package/dist/plugin-registry-loader-ZzUapRh3.js +22 -0
- package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
- package/dist/plugin-sdk/account-core.js +2 -2
- package/dist/plugin-sdk/account-helpers.js +1 -1
- package/dist/plugin-sdk/account-resolution.js +2 -2
- package/dist/plugin-sdk/acp-binding-runtime.js +1 -1
- package/dist/plugin-sdk/acp-runtime.js +3 -3
- package/dist/plugin-sdk/agent-harness-runtime.js +9 -9
- package/dist/plugin-sdk/agent-runtime.js +16 -16
- package/dist/plugin-sdk/allow-from.js +1 -1
- package/dist/plugin-sdk/approval-client-runtime.js +2 -2
- package/dist/plugin-sdk/approval-gateway-runtime.js +2 -2
- package/dist/plugin-sdk/approval-handler-runtime.js +3 -3
- package/dist/plugin-sdk/approval-native-runtime.js +2 -2
- package/dist/plugin-sdk/approval-reply-runtime.js +2 -2
- package/dist/plugin-sdk/approval-runtime.js +7 -7
- package/dist/plugin-sdk/browser-config-runtime.js +2 -2
- package/dist/plugin-sdk/browser-config.js +2 -2
- package/dist/plugin-sdk/browser-control-auth.js +1 -1
- package/dist/plugin-sdk/browser-node-runtime.js +6 -6
- package/dist/plugin-sdk/browser-profiles.js +1 -1
- package/dist/plugin-sdk/browser-security-runtime.js +2 -2
- package/dist/plugin-sdk/browser-setup-tools.js +3 -3
- package/dist/plugin-sdk/browser-support.js +13 -13
- package/dist/plugin-sdk/channel-config-helpers.js +1 -1
- package/dist/plugin-sdk/channel-config-writes.js +1 -1
- package/dist/plugin-sdk/channel-core.js +2 -2
- package/dist/plugin-sdk/channel-feedback.js +2 -2
- package/dist/plugin-sdk/channel-inbound.js +4 -4
- package/dist/plugin-sdk/channel-message.js +2 -2
- package/dist/plugin-sdk/channel-policy.js +2 -2
- package/dist/plugin-sdk/channel-reply-pipeline.js +2 -2
- package/dist/plugin-sdk/channel-runtime.js +4 -4
- package/dist/plugin-sdk/channel-setup.js +1 -1
- package/dist/plugin-sdk/cli-runtime.js +2 -2
- package/dist/plugin-sdk/command-auth-native.js +1 -1
- package/dist/plugin-sdk/command-auth.js +6 -6
- package/dist/plugin-sdk/command-detection.js +1 -1
- package/dist/plugin-sdk/command-status.js +1 -1
- package/dist/plugin-sdk/command-surface.js +1 -1
- package/dist/plugin-sdk/compat.js +6 -6
- package/dist/plugin-sdk/config-mutation.js +4 -4
- package/dist/plugin-sdk/config-runtime.js +10 -10
- package/dist/plugin-sdk/conversation-binding-runtime.js +1 -1
- package/dist/plugin-sdk/conversation-runtime.js +4 -4
- package/dist/plugin-sdk/core.js +4 -4
- package/dist/plugin-sdk/device-bootstrap.js +4 -4
- package/dist/plugin-sdk/direct-dm.js +1 -1
- package/dist/plugin-sdk/extension-shared.js +1 -1
- package/dist/plugin-sdk/feishu.js +5 -5
- package/dist/plugin-sdk/fetch-runtime.js +2 -2
- package/dist/plugin-sdk/gateway-method-runtime.js +1 -1
- package/dist/plugin-sdk/gateway-runtime.js +2 -2
- package/dist/plugin-sdk/generate-text.js +1 -1
- package/dist/plugin-sdk/image-generation-core.js +2 -2
- package/dist/plugin-sdk/image-generation-runtime.js +2 -2
- package/dist/plugin-sdk/inbound-reply-dispatch.js +1 -1
- package/dist/plugin-sdk/index.js +1 -1
- package/dist/plugin-sdk/infra-runtime.js +17 -17
- package/dist/plugin-sdk/markdown-table-runtime.js +1 -1
- package/dist/plugin-sdk/media-generation-runtime-shared.js +1 -1
- package/dist/plugin-sdk/media-generation-runtime.js +1 -1
- package/dist/plugin-sdk/media-runtime.js +7 -7
- package/dist/plugin-sdk/media-understanding-runtime.js +2 -2
- package/dist/plugin-sdk/media-understanding.js +2 -2
- package/dist/plugin-sdk/memory-core-host-engine-embeddings.js +2 -2
- package/dist/plugin-sdk/memory-core-host-engine-foundation.js +3 -3
- package/dist/plugin-sdk/memory-core-host-runtime-cli.js +2 -2
- package/dist/plugin-sdk/memory-core-host-runtime-core.js +3 -3
- package/dist/plugin-sdk/memory-core.js +5 -5
- package/dist/plugin-sdk/memory-host-core.js +3 -3
- package/dist/plugin-sdk/memory-host-search.js +1 -1
- package/dist/plugin-sdk/models-provider-runtime.js +1 -1
- package/dist/plugin-sdk/native-command-registry.js +1 -1
- package/dist/plugin-sdk/outbound-media.js +2 -2
- package/dist/plugin-sdk/outbound-runtime.js +2 -2
- package/dist/plugin-sdk/plugin-test-contracts.js +1 -1
- package/dist/plugin-sdk/plugin-test-runtime.js +4 -4
- package/dist/plugin-sdk/provider-auth-api-key.js +5 -5
- package/dist/plugin-sdk/provider-auth-login.js +1 -1
- package/dist/plugin-sdk/provider-auth-runtime.js +4 -4
- package/dist/plugin-sdk/provider-auth.js +10 -10
- package/dist/plugin-sdk/provider-catalog-shared.js +1 -1
- package/dist/plugin-sdk/provider-entry.js +1 -1
- package/dist/plugin-sdk/provider-http-test-mocks.js +1 -1
- package/dist/plugin-sdk/provider-http.js +3 -3
- package/dist/plugin-sdk/provider-model-shared.js +2 -2
- package/dist/plugin-sdk/provider-setup.js +2 -2
- package/dist/plugin-sdk/provider-stream-family.js +5 -5
- package/dist/plugin-sdk/provider-stream-shared.js +3 -3
- package/dist/plugin-sdk/provider-stream.js +4 -4
- package/dist/plugin-sdk/provider-test-contracts.js +4 -4
- package/dist/plugin-sdk/provider-tools.js +1 -1
- package/dist/plugin-sdk/provider-transport-runtime.js +2 -2
- package/dist/plugin-sdk/provider-web-fetch.js +1 -1
- package/dist/plugin-sdk/provider-web-search-config-contract.js +2 -2
- package/dist/plugin-sdk/provider-web-search-contract.js +2 -2
- package/dist/plugin-sdk/provider-web-search.js +4 -4
- package/dist/plugin-sdk/provider-zai-endpoint.js +1 -1
- package/dist/plugin-sdk/reply-chunking.js +2 -2
- package/dist/plugin-sdk/reply-dispatch-runtime.js +2 -2
- package/dist/plugin-sdk/reply-runtime.js +13 -13
- package/dist/plugin-sdk/retry-runtime.js +2 -2
- package/dist/plugin-sdk/routing.js +1 -1
- package/dist/plugin-sdk/runtime-doctor.js +1 -1
- package/dist/plugin-sdk/runtime-env.js +5 -5
- package/dist/plugin-sdk/runtime-secret-resolution.js +1 -1
- package/dist/plugin-sdk/runtime.js +4 -4
- package/dist/plugin-sdk/sandbox.js +2 -2
- package/dist/plugin-sdk/self-hosted-provider-setup.js +1 -1
- package/dist/plugin-sdk/session-store-runtime.js +2 -2
- package/dist/plugin-sdk/setup-runtime.js +1 -1
- package/dist/plugin-sdk/setup-tools.js +2 -2
- package/dist/plugin-sdk/setup.js +3 -3
- package/dist/plugin-sdk/simple-completion-runtime.js +2 -2
- package/dist/plugin-sdk/skill-commands-runtime.js +1 -1
- package/dist/plugin-sdk/speech-core.js +2 -2
- package/dist/plugin-sdk/speech.js +1 -1
- package/dist/plugin-sdk/src/config/sessions/transcript.d.ts +5 -0
- package/dist/plugin-sdk/src/gateway/server-methods/stt.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/heartbeat-degeneration-guard.d.ts +31 -0
- package/dist/plugin-sdk/src/infra/heartbeat-events.d.ts +6 -0
- package/dist/plugin-sdk/ssrf-runtime.js +2 -2
- package/dist/plugin-sdk/test-env.js +1 -1
- package/dist/plugin-sdk/testing.js +6 -6
- package/dist/plugin-sdk/text-runtime.js +5 -5
- package/dist/plugin-sdk/text-utility-runtime.js +1 -1
- package/dist/plugin-sdk/video-generation-core.js +1 -1
- package/dist/plugin-sdk/video-generation-runtime.js +1 -1
- package/dist/plugin-sdk/video-generation.js +1 -1
- package/dist/plugin-sdk/web-media.js +2 -2
- package/dist/plugin-service-31XQtuZr.js +2494 -0
- package/dist/plugins/provider-discovery.runtime.js +1 -1
- package/dist/plugins/provider-runtime.runtime.js +1 -1
- package/dist/plugins/runtime/index.js +1 -1
- package/dist/plugins-cli-20A8dYUN.js +576 -0
- package/dist/plugins-command-helpers-C3Qls10N.js +117 -0
- package/dist/plugins-install-persist-DEr-zA4G.js +121 -0
- package/dist/plugins-update-command-D0Iv4BPb.js +1009 -0
- package/dist/policy-BEVsx7jw.js +172 -0
- package/dist/ports-CwmEcxRS.js +433 -0
- package/dist/ports-Dr-FwKZD.js +263 -0
- package/dist/preemptive-compaction-DlRJt7Zq.js +430 -0
- package/dist/proactive-scheduler-B3w5rW0h.js +1444 -0
- package/dist/probe-BY1GUZvs.js +178 -0
- package/dist/probe-CCTEVLB2.js +54 -0
- package/dist/probe-CcQ1ucSE.js +2 -0
- package/dist/probe-DcSW0ngD.js +426 -0
- package/dist/probe-auth-C7DjgU_m.js +69 -0
- package/dist/probe-auth-Cfwc8qaj.js +3 -0
- package/dist/profiles-BYudUysD.js +117 -0
- package/dist/program-E_Dt_QTp.js +111 -0
- package/dist/program-context-mb1YzlIX.js +2 -0
- package/dist/prompt-overlay-DsEnjhTn.js +72 -0
- package/dist/prompt-select-styled-Dtw90p2J.js +5305 -0
- package/dist/provider-api-key-auth-CerNsquw.js +113 -0
- package/dist/provider-api-key-auth.runtime-B0BpFkRm.js +14 -0
- package/dist/provider-api-key-auth.runtime.js +1 -1
- package/dist/provider-auth-DwgUXcgu.js +36 -0
- package/dist/provider-auth-api-key-BQfXwqgU.js +5 -0
- package/dist/provider-auth-choice-BKxMQwxd.js +134 -0
- package/dist/provider-auth-choice-preference-DeDdHlsY.js +62 -0
- package/dist/provider-auth-choice.runtime-BJxc73Ex.js +2 -0
- package/dist/provider-auth-choice.runtime-DBcrr0Ab.js +14 -0
- package/dist/provider-auth-choice.runtime.js +1 -1
- package/dist/provider-auth-guidance-Cqo9An-I.js +34 -0
- package/dist/provider-auth-helpers-r9kVb6L3.js +168 -0
- package/dist/provider-auth-input-BfXB22nt.js +117 -0
- package/dist/provider-auth-login-BYMTrXdl.js +8 -0
- package/dist/provider-auth-login.runtime-CCwO-k5h.js +206 -0
- package/dist/provider-auth-login.runtime.js +1 -1
- package/dist/provider-auth-runtime-p93v7b23.js +36 -0
- package/dist/provider-catalog-BA7O6Faq.js +18 -0
- package/dist/provider-catalog-BZJt3Ew2.js +75 -0
- package/dist/provider-catalog-CjNAbR9b.js +12 -0
- package/dist/provider-catalog-CpTP4D3p.js +56 -0
- package/dist/provider-catalog-CzVEmVzS.js +11 -0
- package/dist/provider-catalog-D1iJW59q.js +11 -0
- package/dist/provider-catalog-Dc48HHhB.js +11 -0
- package/dist/provider-catalog-KHD3te_R.js +61 -0
- package/dist/provider-catalog-jKq2UIeG.js +17 -0
- package/dist/provider-catalog-pmlFBXYr.js +26 -0
- package/dist/provider-catalog-shared-Cra7j-_m.js +104 -0
- package/dist/provider-catalog-vjgVLYrd.js +18 -0
- package/dist/provider-catalog-xzYpukvK.js +13 -0
- package/dist/provider-catalog-yaur8Igb.js +16 -0
- package/dist/provider-compat-CCwXKQGq.js +37 -0
- package/dist/provider-discovery-DubIrc_R.js +2 -0
- package/dist/provider-dispatcher-Dl07uV70.js +22 -0
- package/dist/provider-entry-DkwXZuZY.js +97 -0
- package/dist/provider-flow-CmI4jkWV.js +66 -0
- package/dist/provider-http-CHFd_hrC.js +26 -0
- package/dist/provider-iVtrs6XY.js +70 -0
- package/dist/provider-model-shared-CxQysvS-.js +171 -0
- package/dist/provider-models-B3FlcSqf.js +225 -0
- package/dist/provider-models-B63rx638.js +22 -0
- package/dist/provider-models-BXMZj2p1.js +119 -0
- package/dist/provider-models-Bq_MZ0xR.js +35 -0
- package/dist/provider-models-CsUYkHTw.js +116 -0
- package/dist/provider-models-DCvjBHoV.js +169 -0
- package/dist/provider-openai-codex-oauth-tls-DbmKevdp.js +99 -0
- package/dist/provider-registration-DkqLtXSj.js +57 -0
- package/dist/provider-registration-vrLHkywc.js +238 -0
- package/dist/provider-runtime-C_ebc-4l.js +2 -0
- package/dist/provider-runtime-Czioyn5w.js +366 -0
- package/dist/provider-runtime.runtime-lPuF4lqy.js +26 -0
- package/dist/provider-runtime.runtime.js +1 -1
- package/dist/provider-self-hosted-setup-Bjk91HZ7.js +249 -0
- package/dist/provider-setup-hUbxRciz.js +2 -0
- package/dist/provider-stream-DTbeHqKf.js +285 -0
- package/dist/provider-stream-family-Cz7SHqeS.js +2 -0
- package/dist/provider-stream-shared-CTpijFfV.js +80 -0
- package/dist/provider-tools-X4kNlvXF.js +332 -0
- package/dist/provider-usage-4x0im5xP.js +3 -0
- package/dist/provider-usage-CdkW3Bkb.js +289 -0
- package/dist/provider-web-search-CyGNmODH.js +55 -0
- package/dist/provider-web-search-contract-BEZzFHD8.js +12 -0
- package/dist/provider-web-search-contract-fields-DNH2_b3H.js +38 -0
- package/dist/provider-wizard-BPkIa2bk.js +166 -0
- package/dist/providers.runtime-CawuCJXc.js +125 -0
- package/dist/providers.runtime.js +1 -1
- package/dist/proxy-stream-wrappers-BcJuaE24.js +480 -0
- package/dist/push-apns-CO3sqbX3.js +1061 -0
- package/dist/pw-ai-DEf5tZLp.js +2268 -0
- package/dist/qmd-manager-CrqmeTuY.js +1799 -0
- package/dist/qr-cli-g_Pkqstu.js +359 -0
- package/dist/qr-image-DcG1bUox.js +2 -0
- package/dist/queue-BveCZpTb.js +636 -0
- package/dist/realtime-provider-shared-BIili3oc.js +21 -0
- package/dist/realtime-transcription-provider-DqEHy_Jr.js +180 -0
- package/dist/realtime-voice-provider-Dau1KlKK.js +342 -0
- package/dist/record-shared-CC55xbFE.js +10 -0
- package/dist/refresh-BXJ80ji4.js +115 -0
- package/dist/region-CPFmncMW.js +74 -0
- package/dist/register-command-groups-9L1b4CbV.js +121 -0
- package/dist/register.agent-D5el253o.js +241 -0
- package/dist/register.backup-CBhoChp-.js +234 -0
- package/dist/register.configure-DeqUaelp.js +15 -0
- package/dist/register.maintenance-Dv5x9ZE6.js +443 -0
- package/dist/register.message-e2Pbh8A_.js +601 -0
- package/dist/register.migrate-B4iac1EW.js +195 -0
- package/dist/register.onboard-COuTKpAw.js +83 -0
- package/dist/register.runtime-BjOIl4eF.js +81 -0
- package/dist/register.runtime-BzJ6RkQN.js +343 -0
- package/dist/register.runtime.js +1 -1
- package/dist/register.setup-DQYY7K4K.js +104 -0
- package/dist/register.status-health-sessions-CXNGQh_O.js +1211 -0
- package/dist/register.subclis-B6uy_ogx.js +232 -0
- package/dist/register.subclis-Cmdrfiej.js +3 -0
- package/dist/remote-env-DU45InJB.js +12 -0
- package/dist/repair-C8v1vNU-.js +112 -0
- package/dist/replay-policy-BKyiI8sk.js +10 -0
- package/dist/replay-policy-C6igC4nS.js +8 -0
- package/dist/reply-Bd8ShNWW.js +3523 -0
- package/dist/reply-payloads-CFKnBOGu.js +78 -0
- package/dist/reply-payloads-dedupe.runtime.js +1 -1
- package/dist/reply-prefix-D43zayDn.js +33 -0
- package/dist/reply.runtime-ByKwE5dg.js +2 -0
- package/dist/reply.runtime.js +1 -1
- package/dist/resolve-CSTOvc_c.js +280 -0
- package/dist/restart-C0QhPXk1.js +454 -0
- package/dist/restart-handoff-Dd9C10Ns.js +2 -0
- package/dist/restart-health-BAtQdyZh.js +203 -0
- package/dist/restart-health-CnQMSvvJ.js +2 -0
- package/dist/restart-stale-pids-CiBNQGrr.js +529 -0
- package/dist/retry-C1lmuHl8.js +76 -0
- package/dist/retry-policy-B_7wH7D2.js +58 -0
- package/dist/root-help-D2vz4lbV.js +44 -0
- package/dist/route-reply-CXZFXlfK.js +141 -0
- package/dist/route-reply.runtime-BK8V9NEg.js +2 -0
- package/dist/route-reply.runtime.js +1 -1
- package/dist/rpc-f0OkPaI1.js +61 -0
- package/dist/rpc.runtime-BQ78T_pB.js +21 -0
- package/dist/rpc.runtime.js +1 -1
- package/dist/run-main-CkwrrhfI.js +453 -0
- package/dist/run-wait-B4pXPLkF.js +118 -0
- package/dist/runner-BSA9M_M9.js +1497 -0
- package/dist/runs-CEDW87Fd.js +495 -0
- package/dist/runtime-C18YgW822.js +242 -0
- package/dist/runtime-C3OJQ1Xd.js +200 -0
- package/dist/runtime-CDNVtwVk.js +72 -0
- package/dist/runtime-CMNHfJtF.js +725 -0
- package/dist/runtime-C_o_otMV.js +355 -0
- package/dist/runtime-CiJWy5Ce.js +9 -0
- package/dist/runtime-D-PNDlkm.js +35 -0
- package/dist/runtime-D8bLKXLh.js +253 -0
- package/dist/runtime-DM4z9RVx.js +2 -0
- package/dist/runtime-Di50Fr1z.js +191 -0
- package/dist/runtime-W3qG5LHM.js +2 -0
- package/dist/runtime-api-Bx7nlc4w.js +12 -0
- package/dist/runtime-api-DCNC_FTy2.js +2 -0
- package/dist/runtime-api-_Z8MjR0l.js +3 -0
- package/dist/runtime-embedded-pi.runtime-Cv0MW9ps.js +3 -0
- package/dist/runtime-embedded-pi.runtime.js +1 -1
- package/dist/runtime-env-BeD13rEG.js +9 -0
- package/dist/runtime-internal-DclGtT-e.js +2 -0
- package/dist/runtime-manifest.runtime.js +1 -1
- package/dist/runtime-model-auth.runtime-Bjl23_fr.js +39 -0
- package/dist/runtime-model-auth.runtime.js +1 -1
- package/dist/runtime-oEwr_zQb.js +107 -0
- package/dist/runtime-plugins-CwWhqXLJ.js +69 -0
- package/dist/runtime-prepare.runtime-Bi-YD5R-.js +80 -0
- package/dist/runtime-prepare.runtime.js +1 -1
- package/dist/runtime-provider-CSEDbSxr.js +21 -0
- package/dist/runtime-registry-loader-CbbaZCXY.js +58 -0
- package/dist/runtime-registry-loader-kqiMFCUa.js +2 -0
- package/dist/runtime-schema-CDuvvU7B.js +28383 -0
- package/dist/runtime-shared-BxJFDFe6.js +249 -0
- package/dist/runtime-taskflow-RwpXng2l.js +250 -0
- package/dist/runtime-web-channel-plugin-Bw74Ar_q.js +215 -0
- package/dist/runtime-web-tools-CEaAGeYr.js +1467 -0
- package/dist/runtime-web-tools-fallback.runtime-DU8Hp_QZ.js +9 -0
- package/dist/runtime-web-tools-fallback.runtime.js +1 -1
- package/dist/runtime-web-tools-manifest.runtime.js +1 -1
- package/dist/runtime-web-tools-public-artifacts.runtime.js +1 -1
- package/dist/sandbox-BC2XUWcW.js +4 -0
- package/dist/sandbox-cli-ain0MYTB.js +447 -0
- package/dist/sandbox-epLgxWBQ.js +2586 -0
- package/dist/schtasks-CL3tJAH5.js +785 -0
- package/dist/secrets-cli-iLwRZbRt.js +2114 -0
- package/dist/security-audit-DfrokBuq.js +34 -0
- package/dist/security-cli-BqsMM550.js +486 -0
- package/dist/semantic-dedup-BBpIPaSV.js +95 -0
- package/dist/send-C5LHdZqP.js +993 -0
- package/dist/send-media-Df0E2Z_m.js +2123 -0
- package/dist/server-2CD2yd73.js +13 -0
- package/dist/server-B44RMlVT.js +77 -0
- package/dist/server-context-SulhWpXY.js +4164 -0
- package/dist/server-methods-BPzzX5VC.js +11937 -0
- package/dist/server-middleware-WQzQIrD4.js +110 -0
- package/dist/server-node-events-Ug_Atc7G.js +451 -0
- package/dist/server.impl-InfVdwPj.js +19765 -0
- package/dist/service-CK-XuLCu.js +132 -0
- package/dist/service-D9X-uqEA.js +2 -0
- package/dist/service-audit-BQx1zTWD.js +2 -0
- package/dist/service-audit-CQC1FeD7.js +254 -0
- package/dist/session-B5RmIL21.js +48 -0
- package/dist/session-archive.runtime-B1x5wHBw.js +2 -0
- package/dist/session-archive.runtime.js +1 -1
- package/dist/session-conversation-CFty7VTc.js +27 -0
- package/dist/session-cost-usage-CckjvorH.js +2 -0
- package/dist/session-cost-usage-DMRjhi4B.js +648 -0
- package/dist/session-file-DGJqy_ea.js +44 -0
- package/dist/session-fork.runtime.js +1 -1
- package/dist/session-key-D-jBcxEp.js +65 -0
- package/dist/session-meta-BijZlLS3.js +109 -0
- package/dist/session-override-1YQHEAlz.js +103 -0
- package/dist/session-reset-model.runtime-CEWrfXLr.js +120 -0
- package/dist/session-reset-model.runtime.js +1 -1
- package/dist/session-reset-service-Dphtb16d.js +474 -0
- package/dist/session-subagent-reactivation.runtime-CF4aqSpn.js +2 -0
- package/dist/session-subagent-reactivation.runtime.js +1 -1
- package/dist/session-system-events-BSVIh760.js +63 -0
- package/dist/session-tab-registry-DG9SGi0I.js +553 -0
- package/dist/session-updates-BRFvmIoC.js +234 -0
- package/dist/session-updates.runtime-CiHARWGr.js +2 -0
- package/dist/session-updates.runtime.js +1 -1
- package/dist/session-utils-Cai4P9ih.js +930 -0
- package/dist/session-utils.fs-DV8bxCEw.js +537 -0
- package/dist/sessions-BTcXDmCA.js +2 -0
- package/dist/sessions-CyYVTseV.js +45 -0
- package/dist/sessions-Fb0ep3uj.js +231 -0
- package/dist/sessions.runtime-BGyynSR4.js +2 -0
- package/dist/sessions.runtime.js +1 -1
- package/dist/setup-CjEjg8Ci.js +505 -0
- package/dist/setup-D-ypxGnK.js +329 -0
- package/dist/setup-DjympYIJ.js +15 -0
- package/dist/setup-binary-BKTpThn7.js +2 -0
- package/dist/setup-surface-QaubzT60.js +586 -0
- package/dist/setup-tools-6s2MNbj0.js +4 -0
- package/dist/setup-wizard-proxy-BscKn1FO.js +139 -0
- package/dist/setup.finalize-B3MWkUF9.js +436 -0
- package/dist/setup.gateway-config-BdK0tA_r.js +246 -0
- package/dist/shared-0JcWj8-R.js +224 -0
- package/dist/shared-BAqqhcWT.js +127 -0
- package/dist/shared-BOd3OCF0.js +36 -0
- package/dist/shared-D5_A7-ng.js +219 -0
- package/dist/shared-DICWV0-6.js +218 -0
- package/dist/shared-DiGX-JK8.js +137 -0
- package/dist/shared-DktX3NHd.js +175 -0
- package/dist/shared-runtime-BltNIfGY.js +7 -0
- package/dist/short-term-promotion-CT1zdD1r.js +1631 -0
- package/dist/simple-completion-runtime-CZyp8rJ3.js +131 -0
- package/dist/simple-completion-transport-BWyoXghG.js +32 -0
- package/dist/skill-commands-BC_2IdwF.js +82 -0
- package/dist/skill-commands.runtime-BP6BnOeq.js +2 -0
- package/dist/skill-commands.runtime.js +1 -1
- package/dist/skill-lifecycle-DssJKfEF.js +105 -0
- package/dist/skill-quality-gate-CNGgGfsz.js +127 -0
- package/dist/skill-usage-tracker-BXJov40v.js +31 -0
- package/dist/skills-BQX1AsbM.js +4 -0
- package/dist/skills-D7XPR8N-.js +1075 -0
- package/dist/skills-cli-CxmgxC7X.js +382 -0
- package/dist/skills-install-CHUWYiLs.js +822 -0
- package/dist/skills-status-DRTnP8E3.js +170 -0
- package/dist/skills-status-v28wm8HD.js +2 -0
- package/dist/soul-cli-B1-3BHbA.js +110 -0
- package/dist/speech-core-aXx4I3sB.js +126 -0
- package/dist/speech-provider-B2yBILHX.js +101 -0
- package/dist/speech-provider-BTBQ5VOv.js +103 -0
- package/dist/speech-provider-BciszvJf.js +184 -0
- package/dist/speech-provider-BoQDEC_Y.js +167 -0
- package/dist/speech-provider-C-wTEx8k.js +182 -0
- package/dist/speech-provider-DYJcz4pW.js +39 -0
- package/dist/ssh-tunnel-B-uzzPcH.js +2 -0
- package/dist/ssh-tunnel-Bu9s0zUo.js +159 -0
- package/dist/ssrf-runtime-D1skzXnx.js +6 -0
- package/dist/stage-sandbox-media.runtime-DhlTQjXA.js +230 -0
- package/dist/stage-sandbox-media.runtime.js +1 -1
- package/dist/standalone-generate-BRvNW_O7.js +2 -0
- package/dist/standalone-generate-CDfZss4x.js +217 -0
- package/dist/startup-auth-B5V0AaIU.js +151 -0
- package/dist/state-dir-env-Deo1QHMe.js +156 -0
- package/dist/state-migrations-BNib6l8O.js +823 -0
- package/dist/status-8clcfnN0.js +473 -0
- package/dist/status-C9YBVOov.js +278 -0
- package/dist/status-CNcOKUs2.js +500 -0
- package/dist/status-D1l9Tu3s.js +399 -0
- package/dist/status-DKth_wbp.js +2 -0
- package/dist/status-P3bvFirO.js +3 -0
- package/dist/status-TmH9qSMG.js +2 -0
- package/dist/status-all-BeyVXDNT.js +495 -0
- package/dist/status-json-Cj42CVZZ.js +14 -0
- package/dist/status-json-command-DWk5RiyN.js +92 -0
- package/dist/status-runtime-shared-orzti3tZ.js +271 -0
- package/dist/status.agent-local-BEtIuLEr.js +58 -0
- package/dist/status.command.text-runtime-B-tNLc3T.js +15 -0
- package/dist/status.format-VfGIeDvx.js +60 -0
- package/dist/status.gateway-connection.runtime-BrkaJ2f5.js +2 -0
- package/dist/status.gateway-connection.runtime.js +1 -1
- package/dist/status.gateway-probe-BwuiZk1h.js +16 -0
- package/dist/status.link-channel-CxzAOOKY.js +35 -0
- package/dist/status.node-mode-D0ZTWhza.js +2 -0
- package/dist/status.node-mode-DS1aLs_t.js +32 -0
- package/dist/status.scan-DegSjLE2.js +62 -0
- package/dist/status.scan-overview-CrSELCru.js +395 -0
- package/dist/status.scan.deps.runtime-DrUvBz4e.js +18 -0
- package/dist/status.scan.deps.runtime.js +1 -1
- package/dist/status.scan.fast-json-Bm5lN6IK.js +2 -0
- package/dist/status.scan.fast-json-Ch2Zw813.js +128 -0
- package/dist/status.scan.runtime-D-LvzBYN.js +417 -0
- package/dist/status.scan.runtime.js +1 -1
- package/dist/status.summary-OB-43Bvk.js +2 -0
- package/dist/status.summary-gJukahkb.js +209 -0
- package/dist/status.update-BFj-9E8m.js +79 -0
- package/dist/status.update-DYICl5t8.js +2 -0
- package/dist/store-CB-0r9De.js +296 -0
- package/dist/store-D5JODeba.js +421 -0
- package/dist/store-D_vXZ7m9.js +1112 -0
- package/dist/store-yc7MvXdd.js +1075 -0
- package/dist/store.runtime-6eaZtPq6.js +2 -0
- package/dist/store.runtime.js +1 -1
- package/dist/stream-B84y4XQY.js +76 -0
- package/dist/stream-BgcqyefI.js +649 -0
- package/dist/stream-C_VJaXT6.js +26 -0
- package/dist/stream-D5lrRuHb.js +129 -0
- package/dist/stream-DXG7L3j5.js +27 -0
- package/dist/stream-UtEiCziE.js +153 -0
- package/dist/stream-wrappers-B7-5gN0i.js +144 -0
- package/dist/strip-inbound-meta-BSHFFiJd.js +155 -0
- package/dist/subagent-announce.registry.runtime-R2bop0gW.js +3 -0
- package/dist/subagent-announce.registry.runtime.js +1 -1
- package/dist/subagent-control-UyMtkJwo.js +485 -0
- package/dist/subagent-followup.runtime-bTK0TymS.js +68 -0
- package/dist/subagent-followup.runtime.js +1 -1
- package/dist/subagent-list-c0JKZR0g.js +168 -0
- package/dist/subagent-orphan-recovery-CSEzwva5.js +214 -0
- package/dist/subagent-registry-Be219RP1.js +2889 -0
- package/dist/subagent-registry-read-IQtTTWj3.js +57 -0
- package/dist/subagent-registry-runtime-Dk57Y91p.js +2 -0
- package/dist/subagent-registry.runtime-D6h_BK2i.js +3 -0
- package/dist/subagent-registry.runtime.js +1 -1
- package/dist/subagent-spawn-BeyYZuFf.js +782 -0
- package/dist/subagents-format-ZcZBg1Vh.js +629 -0
- package/dist/subcli-descriptors-GyzJF8gS.js +174 -0
- package/dist/supervisor-DVGQ2rPX.js +737 -0
- package/dist/supervisor-log.runtime.js +1 -1
- package/dist/system-cli-_3czEwa7.js +60 -0
- package/dist/system-prompt-BBrWR8Ef.js +711 -0
- package/dist/system-prompt-Dc6Xr30m.js +2 -0
- package/dist/system-prompt-cache-boundary-BqVZ8lnu.js +25 -0
- package/dist/system-run-command-W-wf2HqZ.js +300 -0
- package/dist/systemd-BeYwG5kN.js +591 -0
- package/dist/systemd-hints-BpWajEeA.js +76 -0
- package/dist/systemd-linger-DsTUkfUn.js +68 -0
- package/dist/systemd-linger-X-aDLDla.js +2 -0
- package/dist/tables-BGTNKk6h.js +832 -0
- package/dist/tailscale-status-CCyq-VvN.js +72 -0
- package/dist/targets-BN0-h0GJ.js +300 -0
- package/dist/targets-CXrDP8_l.js +595 -0
- package/dist/targets.runtime-BvBk-CQ8.js +2 -0
- package/dist/targets.runtime.js +1 -1
- package/dist/task-executor-DNUNtRg8.js +350 -0
- package/dist/task-owner-access--E5Vkg9U.js +48 -0
- package/dist/task-registry-COE-B6MO.js +2346 -0
- package/dist/task-registry-control.runtime-BzsTfRw1.js +3 -0
- package/dist/task-registry-control.runtime.js +1 -1
- package/dist/task-registry-delivery-runtime-Cv6xz8KP.js +2 -0
- package/dist/task-registry-delivery-runtime-DSfcd2LA.js +3 -0
- package/dist/task-registry.maintenance-Bhd9abl9.js +2 -0
- package/dist/task-registry.maintenance-W3lTkY0l.js +425 -0
- package/dist/test.DNmyFkvJ-CWD5psK-.js +13549 -0
- package/dist/testing-CQ_-oCQB.js +441 -0
- package/dist/text-report-BgqWDKJR.js +587 -0
- package/dist/text-runtime-asv4kIxS.js +313 -0
- package/dist/thread-bindings-BCRWofo_.js +223 -0
- package/dist/tool-auth-shared-BWZwTobX.js +53 -0
- package/dist/tool-config-shared-BleK697I.js +19 -0
- package/dist/tool-schema-runtime-DZsW_KR4.js +1892 -0
- package/dist/tools-C7lv9rSD.js +110 -0
- package/dist/tools-effective-inventory-SB9JwX-y.js +152 -0
- package/dist/tools.runtime-J5rhfXQp.js +4 -0
- package/dist/tools.runtime.js +1 -1
- package/dist/transcript-B8bIvyol.js +2 -0
- package/dist/transcript-CxdKo8Wl.js +222 -0
- package/dist/transcript-DxWx6dVc.js +233 -0
- package/dist/transcript.runtime-CmBnobSv.js +2 -0
- package/dist/transcript.runtime.js +1 -1
- package/dist/transport-policy-BGfaKNz0.js +75 -0
- package/dist/transport-ready-MwpvBxBB.js +36 -0
- package/dist/tts-C1GyTLOi.js +31 -0
- package/dist/tts-JSdoZrZA.js +40 -0
- package/dist/tts.runtime-Bz1k778L.js +3 -0
- package/dist/tts.runtime.js +1 -1
- package/dist/tui-Cqdp1x16.js +4018 -0
- package/dist/tui-cli-BC4O3H6r.js +31 -0
- package/dist/typing-mode-BoJYxUas.js +84 -0
- package/dist/undici-global-dispatcher-BLnQvRel.js +99 -0
- package/dist/uninstall-BIQ5bjBC.js +172 -0
- package/dist/update-BrD8yWSp.js +1253 -0
- package/dist/update-check-gcnsxBqT.js +431 -0
- package/dist/update-cli-BzaCTuax.js +1779 -0
- package/dist/update-runner-Cvxezvhf.js +1492 -0
- package/dist/usage-CG1Nshi3.js +71 -0
- package/dist/usage-format-DQTT4pqY.js +507 -0
- package/dist/usage-format-sR4xu0xw.js +2 -0
- package/dist/utils-CBnbWiRL.js +189 -0
- package/dist/video-generation-CksImGdK.js +167 -0
- package/dist/video-generation-provider-7YR4_ldd.js +171 -0
- package/dist/video-generation-provider-AlAZkYIW.js +181 -0
- package/dist/video-generation-provider-BEqi4pUJ.js +104 -0
- package/dist/video-generation-provider-CraaZaR7.js +77 -0
- package/dist/video-generation-provider-CuvO2Hzh.js +246 -0
- package/dist/video-generation-provider-D-t16ACe.js +240 -0
- package/dist/video-generation-provider-DeowxvLt.js +233 -0
- package/dist/video-generation-provider-HbOZ3qzI.js +227 -0
- package/dist/video-generation-provider-_apx1yFE.js +263 -0
- package/dist/video-generation-provider-bvpb6cdV.js +64 -0
- package/dist/video-http-DRLB0lIA.js +29 -0
- package/dist/video-model-catalog-BE5LhQSo.js +187 -0
- package/dist/web-fetch-providers.runtime-m66rypbB.js +33 -0
- package/dist/web-fetch-providers.runtime.js +1 -1
- package/dist/web-media-BYZC5tOg.js +330 -0
- package/dist/web-media-DKpK9EDb.js +2 -0
- package/dist/web-search-DSDz1iyf.js +221 -0
- package/dist/web-search-provider-DnYRRBVM.js +155 -0
- package/dist/web-search-provider-common-B9jozd8T.js +206 -0
- package/dist/web-search-provider-config-DCqeS6ct.js +52 -0
- package/dist/web-search-providers.runtime-Cv56XIGr.js +206 -0
- package/dist/web-search-providers.runtime.js +1 -1
- package/dist/web-shared--44LWgiH.js +414 -0
- package/dist/webhooks-cli-DQ_JTSNA.js +321 -0
- package/dist/workspace-CuBIOQ7n.js +306 -0
- package/dist/x-search-shared-DKPdPR5_.js +109 -0
- package/docs/platforms/termux.md +47 -0
- package/package.json +1 -1
- package/scripts/postinstall-bundled-plugins.mjs +1 -1
- package/dist/abort-cutoff.runtime-D-lbC9pe.js +0 -20
- package/dist/abort-f4MVTGHG.js +0 -202
- package/dist/abort-primitives-B6Qmun6I.js +0 -93
- package/dist/abort.runtime-CT-b0BZ6.js +0 -2
- package/dist/account-action-gate-BT_vXl45.js +0 -114
- package/dist/acp-cli-BIxxrCHO.js +0 -2171
- package/dist/acp-spawn-BAWg4qLm.js +0 -1024
- package/dist/acp-stateful-target-driver-8BC9cYRV.js +0 -88
- package/dist/action-agents-DvCfYb6Z.js +0 -67
- package/dist/action-focus-CbhWsRP9.js +0 -124
- package/dist/action-help-C851nJ6a.js +0 -7
- package/dist/action-info-Dds2t3iQ.js +0 -58
- package/dist/action-kill-B37zrHxb.js +0 -33
- package/dist/action-list-IuwtwBeu.js +0 -21
- package/dist/action-log-C8PlZdLy.js +0 -30
- package/dist/action-send-BNxBDuTc.js +0 -39
- package/dist/action-spawn-DlOYaba6.js +0 -46
- package/dist/action-unfocus-BIqluT1T.js +0 -28
- package/dist/agent-3PHkVvAe.js +0 -2
- package/dist/agent-command-C5Xt1hn0.js +0 -1479
- package/dist/agent-list-3PG6_Efg.js +0 -67
- package/dist/agent-runner-utils-DJvfzu40.js +0 -202
- package/dist/agent-runner.runtime-CMkbJlNP.js +0 -2825
- package/dist/agents-DKfujTrw.js +0 -887
- package/dist/agents-zm3fl28x.js +0 -5
- package/dist/allow-from-REaY_RBI.js +0 -164
- package/dist/anthropic-cache-control-payload-CvmvKgnD.js +0 -28
- package/dist/anthropic-payload-policy-CANcBjYh.js +0 -136
- package/dist/anthropic-vertex-stream-BaVLrx0V.js +0 -5666
- package/dist/api-2zjn_e7O.js +0 -19
- package/dist/api-BQr2q6_t.js +0 -4
- package/dist/api-BUgkRX8J.js +0 -2
- package/dist/api-Bt3NjHXq.js +0 -2
- package/dist/api-Bx2CFNaV.js +0 -45
- package/dist/api-CGjh29Sn.js +0 -3
- package/dist/api-CafX9ntL.js +0 -5
- package/dist/api-Cg5HZ6tl.js +0 -35
- package/dist/api-Cl6p3xM5.js +0 -2
- package/dist/api-CvN3buT5.js +0 -3
- package/dist/api-D0lK_Z09.js +0 -4
- package/dist/api-D7OkY2ha.js +0 -5
- package/dist/api-jjRkd0P3.js +0 -2
- package/dist/apply-BsZfM6Et.js +0 -493
- package/dist/apply.runtime-5whx300m.js +0 -166
- package/dist/apply.runtime-CLuFK3gk.js +0 -2
- package/dist/approval-client-helpers-Zaq3P9hT.js +0 -82
- package/dist/approval-gateway-resolver-DR-gkHMR.js +0 -58
- package/dist/approval-gateway-runtime-Bik0UBZF.js +0 -2
- package/dist/approval-handler-runtime-ChSsiysV.js +0 -439
- package/dist/approval-native-helpers-Dy60ZISZ.js +0 -33
- package/dist/approval-native-runtime-CXWGiUWA.js +0 -709
- package/dist/approval-renderers-DIuHRnBC.js +0 -64
- package/dist/audit-B6y81bdh.js +0 -885
- package/dist/audit-extra.async-Ck--K1W3.js +0 -847
- package/dist/audit.deep.runtime-C-cBrm0D.js +0 -2
- package/dist/audit.nondeep.runtime-DoE__Egq.js +0 -859
- package/dist/audit.runtime-IolMbix9.js +0 -7
- package/dist/auth-Bn4U0W36.js +0 -181
- package/dist/auth-choice-CFCE2lnL.js +0 -353
- package/dist/auth-choice-DNT3vqLj.js +0 -71
- package/dist/auth-choice-DSvRrafM.js +0 -3
- package/dist/auth-choice-options-CjOGl86G.js +0 -104
- package/dist/auth-choice-prompt-DethoDfy.js +0 -2
- package/dist/auth-choice-prompt-gzfGxEDS.js +0 -36
- package/dist/auth-choice.apply-helpers-Dj-d59IP.js +0 -2
- package/dist/auth-choice.plugin-providers.runtime-CX8AYJqj.js +0 -11
- package/dist/auth-health-DRSKAT80.js +0 -165
- package/dist/auth-profiles-BCAAlKMo.js +0 -438
- package/dist/auth-profiles.runtime-DsG_oD9s.js +0 -7
- package/dist/auto-disable-BQOHkr64.js +0 -2
- package/dist/auto-disable-DjpDISYk.js +0 -69
- package/dist/auto-recall-D-NhJBRA.js +0 -78
- package/dist/backup-create-DOXA9k65.js +0 -391
- package/dist/banner--gau7tjH.js +0 -2
- package/dist/banner-hOncQFT2.js +0 -281
- package/dist/binding-routing-DTW9nxjk.js +0 -50
- package/dist/binding-targets-l8eRvEwa.js +0 -99
- package/dist/block-streaming-CEz8_YvV.js +0 -103
- package/dist/bootstrap-files-MSqLqaFY.js +0 -206
- package/dist/bridge-server-DwE8zfJM.js +0 -103
- package/dist/browser-config-runtime-Dh8sLJM5.js +0 -6
- package/dist/browser-control-auth-1ZBLoiPo.js +0 -120
- package/dist/browser-node-runtime-pJbk47Fh.js +0 -12
- package/dist/browser-open-BP0tUM0r.js +0 -94
- package/dist/browser-profiles-23asqolb.js +0 -170
- package/dist/browser-runtime-H_R2tXVt.js +0 -377
- package/dist/browser-security-runtime-Ci12HfND.js +0 -10
- package/dist/browser-setup-tools-Dqro1AjE.js +0 -12
- package/dist/btw-command-YUgszbXM.js +0 -17
- package/dist/call-DL6LtukH.js +0 -2
- package/dist/call-DOfj00l8.js +0 -495
- package/dist/call.runtime-TvKrmg7B.js +0 -2
- package/dist/capability-cli-D-kRACJl.js +0 -1357
- package/dist/catalog-provider-DLOYEKT0.js +0 -40
- package/dist/cdp.helpers-Bpj6w6qw.js +0 -372
- package/dist/channel-config-helpers-XmE0KJZk.js +0 -462
- package/dist/channel-core-D7a3TBGx.js +0 -5
- package/dist/channel-feedback-1aAUqgjY.js +0 -259
- package/dist/channel-plugin-resolution-Bg9imchm.js +0 -146
- package/dist/channel-policy-B4aZ_llS.js +0 -270
- package/dist/channel-reply-pipeline-CKLpE2fN.js +0 -26
- package/dist/channel-runtime-B5LPKA4v.js +0 -6
- package/dist/channel-summary-CKKb_Yip.js +0 -2
- package/dist/channel-summary-qu8GdDSR.js +0 -139
- package/dist/channel.runtime-BQ2sQS76.js +0 -399
- package/dist/channels-Dnebu-Z2.js +0 -1146
- package/dist/channels-cli-CrrYDwyP.js +0 -248
- package/dist/chat-C7d4yEQj.js +0 -213
- package/dist/chat-history-text-BzdTyI1F.js +0 -42
- package/dist/chrome-BrX1X-Xu.js +0 -1080
- package/dist/chrome.executables-D9AsUrzE.js +0 -550
- package/dist/chunk-DgPObAqu.js +0 -267
- package/dist/clack-prompter-dDhoBpFq.js +0 -113
- package/dist/clawhub-BZ4uIkf9.js +0 -400
- package/dist/cli-CbzczoYW.js +0 -57
- package/dist/cli-DUHNTnCc.js +0 -2
- package/dist/cli-DWdaFLjz.js +0 -2
- package/dist/cli-DdsJJ5_Z.js +0 -191
- package/dist/cli-DgxZqXoY.js +0 -154
- package/dist/cli-auth-seam-ms_Y9P0q.js +0 -14
- package/dist/cli-backend-8ivUo47l.js +0 -66
- package/dist/cli-migration-D4Ed8qCX.js +0 -127
- package/dist/cli-runner-Crv7rNhq.js +0 -1662
- package/dist/cli-runner.runtime-CCXup5Mk.js +0 -3
- package/dist/cli-runner.runtime-CXhvyxfI.js +0 -2
- package/dist/cli-runtime-BTdQg8Pm.js +0 -3
- package/dist/cli-shared-BlHdVi2I.js +0 -142
- package/dist/cli.runtime-DM1J_Mdq.js +0 -819
- package/dist/client-bootstrap-C-meQM4y.js +0 -28
- package/dist/codex-native-web-search-2aA4uR0A.js +0 -149
- package/dist/codex-native-web-search-Dcc5Voe_.js +0 -2
- package/dist/collector-CM6e07XI.js +0 -2
- package/dist/collector-D2Y5qkIr.js +0 -349
- package/dist/command-auth-SFBdAt8s.js +0 -75
- package/dist/command-config-resolution-00LeDa9E.js +0 -23
- package/dist/command-config-resolution-CFoxxgJv.js +0 -2
- package/dist/command-detection-q0CJzVXY.js +0 -50
- package/dist/command-execution-startup-CDFlXP-H.js +0 -269
- package/dist/command-format-C4Pb3hfN.js +0 -2
- package/dist/command-queue-pXNZboyT.js +0 -260
- package/dist/command-registry-Bo7XSe1Q.js +0 -3
- package/dist/command-registry-CIJHAcQl.js +0 -113
- package/dist/command-secret-gateway-Dge_nif2.js +0 -528
- package/dist/command-status-builders-DykmScCm.js +0 -145
- package/dist/commands-acp-DMtvZXhv.js +0 -1017
- package/dist/commands-compact.runtime-DVcam08G.js +0 -10
- package/dist/commands-context-B5MBVGe2.js +0 -34
- package/dist/commands-core.runtime-hitqnxeE.js +0 -2
- package/dist/commands-handlers.runtime-bzi2wxAt.js +0 -3762
- package/dist/commands-models-DUISkN0p.js +0 -306
- package/dist/commands-registry-vcJhtPD2.js +0 -295
- package/dist/commands-registry.runtime-BYfD9VYg.js +0 -2
- package/dist/commands-reset-hooks-Dh86NTWQ.js +0 -129
- package/dist/commands-status-BSy7MtCk.js +0 -223
- package/dist/commands-status.runtime-Ck7v0LZJ.js +0 -2
- package/dist/commands-subagents-control.runtime-BeqJMQDW.js +0 -2
- package/dist/commands-subagents-control.runtime-BqdBqL9t.js +0 -3
- package/dist/commands.runtime-Gc7qJA-c.js +0 -103
- package/dist/comment-shared-DH9DoH_x.js +0 -40
- package/dist/compact-3ebI-sS9.js +0 -11324
- package/dist/compact.runtime-BPETvMY-.js +0 -7
- package/dist/completion-cli-CjXlpMci.js +0 -468
- package/dist/completion-cli-vslfbC9X.js +0 -2
- package/dist/config-B8yp5kYn.js +0 -136
- package/dist/config-CCY-pig0.js +0 -8
- package/dist/config-DNuLuSsf.js +0 -166
- package/dist/config-DSwbWXI1.js +0 -53
- package/dist/config-cli-VD6OEYW6.js +0 -948
- package/dist/config-defaults-qktW8sQ3.js +0 -163
- package/dist/config-guard-BSmnvKrj.js +0 -94
- package/dist/config-runtime-C6I-HVna.js +0 -14
- package/dist/config-validation-1MYzzOwN.js +0 -279
- package/dist/configure-DR28xSJH.js +0 -1161
- package/dist/configure-DlDeWMkO.js +0 -2
- package/dist/connection-auth-D-SqlhKg.js +0 -30
- package/dist/context-B5SnLjZO.js +0 -249
- package/dist/context-DFv9P-FH.js +0 -2
- package/dist/context-builder-D_FDDuDM.js +0 -2
- package/dist/context-visibility-2p0h1zWp.js +0 -14
- package/dist/context-writer-CeQDqgjO.js +0 -290
- package/dist/control-auth-DnYOaHsI.js +0 -122
- package/dist/control-ui/assets/agents-C1zCMAtn.js +0 -767
- package/dist/control-ui/assets/anthropic-CJRRuMgc.js +0 -40
- package/dist/control-ui/assets/azure-openai-responses-Di59_Cmp.js +0 -2
- package/dist/control-ui/assets/cron-D6g52nqI.js +0 -744
- package/dist/control-ui/assets/dialogues-DYAUErGq.js +0 -83
- package/dist/control-ui/assets/history-DYm34nRN.js +0 -71
- package/dist/control-ui/assets/index-B2vTvM2B.js +0 -2622
- package/dist/control-ui/assets/index-d3bUvw-B.css +0 -1
- package/dist/control-ui/assets/mistral-BZ0vS_iC.js +0 -72
- package/dist/control-ui/assets/openai-codex-responses-DzDPSQ5h.js +0 -8
- package/dist/control-ui/assets/openai-completions-QU8QkVDL.js +0 -6
- package/dist/control-ui/assets/openai-responses-CcWHDwZi.js +0 -2
- package/dist/control-ui/assets/openai-responses-shared-CM1nnVm8.js +0 -13
- package/dist/control-ui-links-DEuG_GSl.js +0 -70
- package/dist/conversation-id-YKsAPevE.js +0 -140
- package/dist/conversation-runtime-CbQInS0o.js +0 -31
- package/dist/core-Ci2tfNDf.js +0 -210
- package/dist/core-command-descriptors-D4olju_R.js +0 -112
- package/dist/cron-cli-CZOqbORC.js +0 -637
- package/dist/curator-CNQLoxP-.js +0 -2
- package/dist/curator-CS2qQobF.js +0 -598
- package/dist/daemon-cli-C5yHexZ5.js +0 -476
- package/dist/daemon-install-CTt5WwKP.js +0 -70
- package/dist/delegate-DtePi541.js +0 -61
- package/dist/deliver-Ckh3gTn8.js +0 -782
- package/dist/deliver-OgIjEM9H.js +0 -3
- package/dist/deliver-runtime-Bkv7BCow.js +0 -2
- package/dist/delivery-outbound.runtime-BCeIkXYz.js +0 -6
- package/dist/delivery-queue-DkWo6Ph_.js +0 -372
- package/dist/delivery-queue-W1vbRb8L.js +0 -2
- package/dist/deps-DbatnFkY.js +0 -60
- package/dist/detect-CzoDsq6C.js +0 -113
- package/dist/device-bootstrap-D8veEU4x.js +0 -4
- package/dist/device-bootstrap-DyTx6egK.js +0 -248
- package/dist/device-bootstrap-profile-I2zbsVdf.js +0 -36
- package/dist/device-identity-HSVRQkzQ.js +0 -2
- package/dist/device-pairing-BCo5v6N5.js +0 -600
- package/dist/devices-cli-B1O89aja.js +0 -336
- package/dist/diagnostic-Ds3dY4QI.js +0 -311
- package/dist/diagnostics-DPXDETG1.js +0 -2
- package/dist/diagnostics-QjuefiNT.js +0 -33
- package/dist/direct-dm-C8F1_e3A.js +0 -139
- package/dist/directive-handling.fast-lane-C8OicY17.js +0 -64
- package/dist/directive-handling.fast-lane-Dpi7fuWl.js +0 -2
- package/dist/directive-handling.impl-C1LcSNWm.js +0 -659
- package/dist/directive-handling.impl-DkIUEEHV.js +0 -2
- package/dist/directive-handling.parse-BLNxH-OL.js +0 -376
- package/dist/directive-handling.persist-Blk7POiT.js +0 -139
- package/dist/directive-handling.persist.runtime-DfgDPqlm.js +0 -2
- package/dist/directive-handling.shared-BTc8BSk8.js +0 -159
- package/dist/directory-cli-p4-6gL8K.js +0 -240
- package/dist/dispatch-CTsZMdlK.js +0 -1126
- package/dist/dispatch-acp-D_YySGLh.js +0 -969
- package/dist/dispatch-acp-command-bypass-DxDV0zYx.js +0 -38
- package/dist/dispatch-acp-manager.runtime-BFUXpAra.js +0 -3
- package/dist/dispatch-acp-media.runtime-DTMhMdh7.js +0 -3
- package/dist/dispatch-acp-session.runtime-Bv71yGqh.js +0 -2
- package/dist/dispatch-acp-tts.runtime-C7s5Bvqa.js +0 -3
- package/dist/dispatch-acp.runtime-BRB1Cg-T.js +0 -19
- package/dist/dns-cli-C7kZ35HQ.js +0 -193
- package/dist/docker-WeeHs5I_.js +0 -826
- package/dist/docs-cli-RFkNh5UP.js +0 -156
- package/dist/doctor-completion-B0xrCws1.js +0 -90
- package/dist/doctor-config-preflight-DUoMyrCF.js +0 -148
- package/dist/doctor-config-preflight-DWWImrXw.js +0 -2
- package/dist/doctor-state-migrations-B4I2_V16.js +0 -2
- package/dist/doctor-state-migrations-nhfeI2B0.js +0 -3
- package/dist/drive--6to33M3.js +0 -718
- package/dist/embedding-provider-BtkFLfRN.js +0 -26
- package/dist/embedding-provider-DgONMEgu.js +0 -33
- package/dist/embedding-provider-ZLwH2prV.js +0 -129
- package/dist/engine-CsT7VerD.js +0 -72
- package/dist/engine-embeddings-BpEydMJi.js +0 -1489
- package/dist/entry-capabilities-DuKEdmG2.js +0 -89
- package/dist/env-overrides-6Wa5Xk0N.js +0 -347
- package/dist/env-overrides.runtime-DH3Daeun.js +0 -7
- package/dist/exec-approval-forwarder.runtime-Au-VUhpk.js +0 -3
- package/dist/exec-approval-reply-2-xn0vFY.js +0 -292
- package/dist/exec-approval-session-target-B9-fNjez.js +0 -165
- package/dist/exec-approvals-cli-DWNqy_yE.js +0 -485
- package/dist/exec-defaults-3zZOuu5Q.js +0 -1440
- package/dist/extensions/diffs/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -4
- package/dist/extensions/diffs/node_modules/typebox/build/schema/resolve/ref.mjs +0 -156
- package/dist/extensions/feishu/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -4
- package/dist/extensions/feishu/node_modules/typebox/build/schema/resolve/ref.mjs +0 -156
- package/dist/extensions/kindle-portal/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -4
- package/dist/extensions/kindle-portal/node_modules/typebox/build/schema/resolve/ref.mjs +0 -156
- package/dist/extra-params-Ujx7IlOq.js +0 -295
- package/dist/fetch-DnGnGfIj.js +0 -65
- package/dist/fetch-PlNhlY1D.js +0 -256
- package/dist/fetch-guard-DjigeYAg.js +0 -224
- package/dist/format-CcwaoG_5.js +0 -245
- package/dist/fragment-collector-BxoA9LrO.js +0 -189
- package/dist/fragment-store-CH-ruSJT.js +0 -2
- package/dist/fragment-store-lmF5kmGt.js +0 -230
- package/dist/gateway-DML9FbXS.js +0 -2
- package/dist/gateway-cli-DdtDWIYS.js +0 -1532
- package/dist/gateway-discovery-targets-D2lBNlv8.js +0 -431
- package/dist/gateway-install-token-DzTk4pqb.js +0 -284
- package/dist/gateway-lock-CeDiGyTv.js +0 -238
- package/dist/gateway-mGyPIOuQ.js +0 -119
- package/dist/gateway-rpc-DSe_1f9v.js +0 -14
- package/dist/gateway-rpc.runtime-7zGvUGmX.js +0 -23
- package/dist/gateway-secret-options-C4M1UPRj.js +0 -38
- package/dist/gemini-cli-provider-CxLrsVzr.js +0 -106
- package/dist/gemini-web-search-provider-CXr5noNb.js +0 -167
- package/dist/get-reply-from-config.runtime-22OaqrkY.js +0 -2
- package/dist/git-commit-CmbQ0R7l.js +0 -2
- package/dist/gmail-setup-utils-CYfpQJf3.js +0 -422
- package/dist/group-policy-F3YMiMAb.js +0 -202
- package/dist/hard-trigger-Cj2nYtiI.js +0 -106
- package/dist/health-BOflqD4z.js +0 -2
- package/dist/health-DJr5eOoL.js +0 -579
- package/dist/heartbeat-OI7GfQHK.js +0 -184
- package/dist/heartbeat-runner-DoT-pE2K.js +0 -4
- package/dist/heartbeat-runner-Urusnt52.js +0 -1289
- package/dist/heartbeat-runner.runtime-CyMxa8lC.js +0 -2
- package/dist/heartbeat-summary-Brqv8KYX.js +0 -58
- package/dist/heartbeat-visibility-D03CCH71.js +0 -81
- package/dist/help-DsZQFu6h.js +0 -76
- package/dist/hooks-cli-CL7QLMtO.js +0 -364
- package/dist/hooks-status-B5Zkfd83.js +0 -86
- package/dist/identity-Bxp0hRpo.js +0 -30
- package/dist/identity-avatar-Di47l4kX.js +0 -87
- package/dist/image-E9tFaoF0.js +0 -152
- package/dist/image-generation-core-BFD6kQaR.js +0 -17
- package/dist/image-generation-core.auth.runtime-BXxkxK67.js +0 -2
- package/dist/image-generation-provider-B6Mys52b.js +0 -280
- package/dist/image-generation-provider-Bkh8lMdL.js +0 -163
- package/dist/image-generation-provider-BsUqjrhi.js +0 -130
- package/dist/image-generation-provider-C_Gpk9aj.js +0 -136
- package/dist/image-generation-provider-ClCCfRD1.js +0 -94
- package/dist/image-generation-provider-CvFrycEI.js +0 -86
- package/dist/image-generation-runtime-DF454sB4.js +0 -2
- package/dist/image-runtime-Bz6kPBoi.js +0 -7
- package/dist/images-DKmW2P-z.js +0 -586
- package/dist/inbound-reply-dispatch-Bc1Q_xbX.js +0 -73
- package/dist/inbound.runtime-BBS9vn45.js +0 -4
- package/dist/inbound.runtime-CRXEfsJb.js +0 -3
- package/dist/infra-runtime-D2zkJhi6.js +0 -25
- package/dist/ingest-CaRlpNoI.js +0 -842
- package/dist/ingest-DVDjSnJ2.js +0 -2
- package/dist/input-files-CoHcEEch.js +0 -252
- package/dist/inspect-DOgFXMYn.js +0 -2
- package/dist/inspect-Ysjfnqlj.js +0 -282
- package/dist/install-8dxMsCGR.js +0 -662
- package/dist/install-security-scan-BGKx7npE.js +0 -22
- package/dist/install-security-scan.runtime-CM3pdRz_.js +0 -299
- package/dist/install-skills-CcCqsJDw.js +0 -70
- package/dist/install.runtime-BcE_gljl.js +0 -12
- package/dist/install.runtime-CXaroKqa.js +0 -27
- package/dist/io-CFug8sfU.js +0 -5
- package/dist/io-jqC0nnCj.js +0 -7181
- package/dist/issue-format-DjVI0gtD.js +0 -2
- package/dist/kaijibot-tools-CWU_rxa1.js +0 -9434
- package/dist/kaijibot-tools.runtime-BdkiUHPr.js +0 -2
- package/dist/kill-tree-0Qfa0fPs.js +0 -2
- package/dist/kimi-web-search-provider-D88yKthU.js +0 -308
- package/dist/launchd-upj2lSvL.js +0 -556
- package/dist/library-DupTA6t-.js +0 -45
- package/dist/lifecycle-core-BgkN5Ivp.js +0 -422
- package/dist/list.runtime-AlXBW4vo.js +0 -12
- package/dist/list.runtime-DayQOc4X.js +0 -9
- package/dist/llm-draft-generator-Bm97qKX4.js +0 -2
- package/dist/llm-draft-generator-DNcNszu5.js +0 -567
- package/dist/llm-engine-CiiuwTwC.js +0 -1792
- package/dist/llm-engine-Ur1T1MqO.js +0 -2
- package/dist/llm-extractor-De2TMG0s.js +0 -445
- package/dist/load-context-DegYZsvB.js +0 -51
- package/dist/logging-Cye_Xa4w.js +0 -13
- package/dist/logging-DTZsIROt.js +0 -2
- package/dist/login-B8M7ZMjk.js +0 -108
- package/dist/logs-cli-BOmoQIQo.js +0 -264
- package/dist/logs-cli.runtime-eBdNRC2O.js +0 -2
- package/dist/manager-BK_yf4TA.js +0 -3314
- package/dist/manager-D9txET8l.js +0 -2049
- package/dist/markdown-tables-DQxQ2v3M.js +0 -51
- package/dist/mcp-cli-BjyTsaR8.js +0 -733
- package/dist/mcp-config-C1hTLHpm.js +0 -115
- package/dist/media-models-CuHKr-jc.js +0 -49
- package/dist/media-runtime-to7sOM_Y.js +0 -312
- package/dist/media-understanding-BUPY06pW.js +0 -83
- package/dist/media-understanding-provider-2O5CWfpE.js +0 -21
- package/dist/media-understanding-provider-B27RH58K.js +0 -67
- package/dist/media-understanding-provider-B9cOLnSy.js +0 -13
- package/dist/media-understanding-provider-BBBobR_S.js +0 -14
- package/dist/media-understanding-provider-Btuo9DtU.js +0 -18
- package/dist/media-understanding-provider-D25JjKp6.js +0 -18
- package/dist/media-understanding-provider-D2MPF86c.js +0 -30
- package/dist/media-understanding-provider-DZRMrC7u.js +0 -123
- package/dist/media-understanding-provider-Dn1_mRNP.js +0 -112
- package/dist/media-understanding-provider-Q0qUL2Xc.js +0 -69
- package/dist/media-understanding-provider-SbIinVQB.js +0 -37
- package/dist/media-understanding-runtime-mR4yaZPY.js +0 -2
- package/dist/memory-BSChYKnu.js +0 -242
- package/dist/memory-CS0PpaBY.js +0 -3
- package/dist/memory-core-host-engine-embeddings-CwflR2IF.js +0 -2
- package/dist/memory-core-host-engine-foundation-CT4BWopI.js +0 -11
- package/dist/memory-core-host-runtime-cli-RmKhX5yL.js +0 -9
- package/dist/memory-core-host-runtime-core-CHMXUkUu.js +0 -8
- package/dist/memory-embedding-adapter-Be7sgtnM.js +0 -33
- package/dist/memory-host-search.runtime-BgQBV8Fk.js +0 -2
- package/dist/memory-index-CtBBLME7.js +0 -514
- package/dist/memory-index-DNq40JEQ.js +0 -2
- package/dist/memory-runtime-CPNFah1O.js +0 -26
- package/dist/memory-runtime-xc6oO34R.js +0 -2
- package/dist/message-BjXihlGd.js +0 -223
- package/dist/message-action-runner-BxfzjS-u.js +0 -1628
- package/dist/message-action-runner-C_LnF0uN.js +0 -2
- package/dist/message.config.runtime-DT-WFPwG.js +0 -3
- package/dist/message.gateway.runtime-D-4ACz7z.js +0 -2
- package/dist/metadata-registry-loader-Cq9GeiUK.js +0 -15
- package/dist/metadata-registry-loader-DKg37M29.js +0 -2
- package/dist/method-scopes-BNCaRohy.js +0 -2882
- package/dist/minimax-vlm-XkKlqE0H.js +0 -183
- package/dist/minimax-web-search-provider-Baj_6j_7.js +0 -165
- package/dist/mmr-CUCGW0Nx.js +0 -146
- package/dist/model-CZ_a3HtW.js +0 -630
- package/dist/model-auth-BZ5kt-1f.js +0 -427
- package/dist/model-auth-env-Ckzim7ba.js +0 -2
- package/dist/model-auth-env-qNUE5jbD.js +0 -53
- package/dist/model-auth-label-LN4o5uqO.js +0 -45
- package/dist/model-catalog-DIUg3n77.js +0 -204
- package/dist/model-definitions-DJm7w6s6.js +0 -74
- package/dist/model-definitions-DgGu9VIM.js +0 -258
- package/dist/model-discovery-live.runtime-B_7x6hLb.js +0 -419
- package/dist/model-discovery-modelsdev-B_Cpy5zK.js +0 -174
- package/dist/model-picker-D4_-5f9B.js +0 -3
- package/dist/model-picker-DvArjhst.js +0 -490
- package/dist/model-picker.runtime-Dj3FkZ-S.js +0 -15
- package/dist/model-selection-ByfoGmCG.js +0 -381
- package/dist/model-suppression-D2CmPrIy.js +0 -28
- package/dist/model-suppression.runtime-CIjX9NlA.js +0 -7
- package/dist/models-9mxq_QiD.js +0 -2
- package/dist/models-B5klbRNl.js +0 -18
- package/dist/models-BEEXc36p.js +0 -166
- package/dist/models-BcADhq5N.js +0 -126
- package/dist/models-CM9-QkVe.js +0 -19
- package/dist/models-CjYlowYN.js +0 -555
- package/dist/models-DG2rsESP.js +0 -157
- package/dist/models-DR12QL2c.js +0 -47
- package/dist/models-DaLjq4r0.js +0 -18
- package/dist/models-cli-CeRr4GDr.js +0 -198
- package/dist/models-config-BFlDXU_f.js +0 -900
- package/dist/models-config.providers.secrets-BzYBOrUA.js +0 -299
- package/dist/models-pvzUdDkE.js +0 -2584
- package/dist/models-qhmey5pY.js +0 -760
- package/dist/models.fetch-M6V7bcX_.js +0 -518
- package/dist/monitor-BLmIpjr8.js +0 -4435
- package/dist/monitor-DsXA1TBF.js +0 -1023
- package/dist/music-generation-provider-BxRuGWj1.js +0 -169
- package/dist/music-generation-provider-ByrJF4DP.js +0 -238
- package/dist/music-generation-provider-CLvSbBFV.js +0 -142
- package/dist/node-cli-CSl9YNEF.js +0 -2374
- package/dist/node-command-policy-NrFO7Yy5.js +0 -205
- package/dist/node-service-C5TgmiSv.js +0 -69
- package/dist/nodes-cli-CYYhr2Cr.js +0 -1046
- package/dist/nodes-screen-DXF9W1E2.js +0 -216
- package/dist/nodes-utils-DitAVxex.js +0 -196
- package/dist/nodes.helpers-3JZhoraJ.js +0 -34
- package/dist/normalize-reply-lOvnPpkZ.js +0 -72
- package/dist/note-C-MCr2CR.js +0 -110
- package/dist/notify-Bnyw52y9.js +0 -305
- package/dist/oauth-CPq7fFbG.js +0 -152
- package/dist/oauth-sCynaMs_.js +0 -57
- package/dist/oauth-token-shared-DsL6dJB_.js +0 -28
- package/dist/oauth.credentials-CxmXx187.js +0 -165
- package/dist/oauth.flow-BaDaI2a6.js +0 -122
- package/dist/oauth.http-BWxW_gXO.js +0 -23
- package/dist/oauth.project-Cb5OEIsJ.js +0 -123
- package/dist/oauth.settings-DTKwg34C.js +0 -44
- package/dist/oauth.token-Cq9_Mlsz.js +0 -43
- package/dist/onboard-BWi2goQe.js +0 -22
- package/dist/onboard-BX_UVeJs.js +0 -48
- package/dist/onboard-BaDvNiGt.js +0 -29
- package/dist/onboard-BmpPXiqN2.js +0 -58
- package/dist/onboard-Bxlop59E.js +0 -25
- package/dist/onboard-C1B08y2Y.js +0 -25
- package/dist/onboard-CKEn2xHD.js +0 -29
- package/dist/onboard-CRczKKEG.js +0 -621
- package/dist/onboard-CWW99Rzj.js +0 -25
- package/dist/onboard-CfYR_NXu.js +0 -25
- package/dist/onboard-DIMihTCh.js +0 -36
- package/dist/onboard-DVhexP5q.js +0 -54
- package/dist/onboard-Dpzl4IRI.js +0 -34
- package/dist/onboard-R8-I3hmu.js +0 -67
- package/dist/onboard-channels-B_4jowIn.js +0 -1260
- package/dist/onboard-channels-DHEFgumO.js +0 -2
- package/dist/onboard-config-fkSSjbwz.js +0 -2
- package/dist/onboard-custom-D6Uop5na.js +0 -647
- package/dist/onboard-custom-oMh6NPfh.js +0 -2
- package/dist/onboard-helpers-Lgk8IMHf.js +0 -223
- package/dist/onboard-helpers-Mj_BIThw.js +0 -5
- package/dist/onboard-hooks-kzEmZp3M.js +0 -35
- package/dist/onboard-nkBC9Zpi.js +0 -312
- package/dist/onboard-remote-BWvP49_r.js +0 -2
- package/dist/onboard-remote-OM6MI7-n.js +0 -193
- package/dist/onboard-search-C_yMehYl.js +0 -324
- package/dist/onboard-skills-B7QaCIP8.js +0 -2
- package/dist/onboard-skills-DnTH5fGc.js +0 -134
- package/dist/openai-codex-auth-identity-B17fKWEn.js +0 -45
- package/dist/openai-codex-cli-auth-Cl-PMKNs.js +0 -57
- package/dist/openai-codex-provider-BO9QBMyI.js +0 -299
- package/dist/openai-codex-shared-khAwBJ9v.js +0 -6
- package/dist/openai-provider-BJZNCGfx.js +0 -283
- package/dist/openai-transport-stream-Bfwyx0DL.js +0 -1632
- package/dist/openclaw-migrator-a2Mc7WOU.js +0 -2
- package/dist/operator-approvals-client-CWSFLEWa.js +0 -68
- package/dist/order-B6fzFCuC.js +0 -794
- package/dist/outbound-runtime-DhL6nVw0.js +0 -2
- package/dist/pair-command-approve-G0uqjCOh.js +0 -34
- package/dist/pairing-cli-BTMScFNF.js +0 -118
- package/dist/parse-DLTK-NVk.js +0 -168
- package/dist/perplexity-web-search-provider-uU3my6N4.js +0 -92
- package/dist/perplexity-web-search-provider.runtime-4zsB5_nx.js +0 -2
- package/dist/perplexity-web-search-provider.runtime-C7OOMB_b.js +0 -332
- package/dist/perplexity-web-search-provider.shared-BXQXODBs.js +0 -73
- package/dist/persistent-bindings.lifecycle-DZoj-DF8.js +0 -94
- package/dist/pi-bundle-mcp-tools-o-CMfj6F.js +0 -709
- package/dist/pi-embedded-CcN4r2lN.js +0 -2
- package/dist/pi-embedded-DpCl1xxW.js +0 -6
- package/dist/pi-embedded-runner-BH8m5Ek2.js +0 -8348
- package/dist/pi-embedded-subscribe.handlers.compaction.runtime-CL42c7j6.js +0 -23
- package/dist/pi-embedded-utils-qmoBiSxI.js +0 -212
- package/dist/pi-embedded.runtime-DH07ZQfG.js +0 -5
- package/dist/pi-model-discovery-DAdZXCcr.js +0 -232
- package/dist/pi-tools.before-tool-call.runtime-oD9VtK_r.js +0 -354
- package/dist/plugin-enabled-Bat2sClf.js +0 -71
- package/dist/plugin-install-BfwsbbEi.js +0 -2
- package/dist/plugin-install-Dx94fIXT.js +0 -227
- package/dist/plugin-install-config-policy-6tSijL5D.js +0 -137
- package/dist/plugin-install-plan-BmZAE503.js +0 -50
- package/dist/plugin-registration-DBPyjT8A.js +0 -23
- package/dist/plugin-registry-BxkQz7gt.js +0 -2
- package/dist/plugin-registry-Do_oXBB1.js +0 -3
- package/dist/plugin-registry-loader-2_-yHVmz.js +0 -22
- package/dist/plugin-service-DS-pRdlU.js +0 -2494
- package/dist/plugins-cli-sRXCzuRw.js +0 -576
- package/dist/plugins-command-helpers-Bj7EktUT.js +0 -117
- package/dist/plugins-install-persist-89YNeDu5.js +0 -121
- package/dist/plugins-update-command-d7lz3MHq.js +0 -1009
- package/dist/policy-aIhvOunx.js +0 -172
- package/dist/ports-2fHnkw5y.js +0 -433
- package/dist/ports-y2MKuVvs.js +0 -263
- package/dist/preemptive-compaction-BR6IYUQv.js +0 -430
- package/dist/proactive-scheduler-Du3kRlQb.js +0 -1444
- package/dist/probe-C7GwSpDS.js +0 -426
- package/dist/probe-CZ6BUVJj.js +0 -178
- package/dist/probe-auth-BB6Ja95k.js +0 -3
- package/dist/probe-auth-pWGpURUh.js +0 -69
- package/dist/probe-hJkDixY1.js +0 -2
- package/dist/probe-rf98dB-3.js +0 -54
- package/dist/profiles-BPDe8qb5.js +0 -117
- package/dist/program-context-Bk8VQcWK.js +0 -2
- package/dist/program-sIPk-Phn.js +0 -111
- package/dist/prompt-overlay-0RLiIIBU.js +0 -72
- package/dist/prompt-select-styled-CIhWc-jk.js +0 -5305
- package/dist/provider-api-key-auth-DDNqXzKj.js +0 -113
- package/dist/provider-api-key-auth.runtime-BXQ6_jmJ.js +0 -14
- package/dist/provider-auth-DTXed4qC.js +0 -36
- package/dist/provider-auth-api-key-BBpwvslY.js +0 -5
- package/dist/provider-auth-choice-CY2jmJCu.js +0 -134
- package/dist/provider-auth-choice-preference-Dr0IDF93.js +0 -62
- package/dist/provider-auth-choice.runtime-CUFjn3Mi.js +0 -14
- package/dist/provider-auth-choice.runtime-d4FyinH1.js +0 -2
- package/dist/provider-auth-guidance-DeOBKjFe.js +0 -34
- package/dist/provider-auth-helpers-Cae0FJpz.js +0 -168
- package/dist/provider-auth-input-Duh7v6fc.js +0 -117
- package/dist/provider-auth-login-BzpkiJ8a.js +0 -8
- package/dist/provider-auth-login.runtime-ClFDC4RN.js +0 -206
- package/dist/provider-auth-runtime-Bep_6xgO.js +0 -36
- package/dist/provider-catalog-BgakmlJX.js +0 -17
- package/dist/provider-catalog-Biq45Yem.js +0 -26
- package/dist/provider-catalog-BpAgZBb5.js +0 -11
- package/dist/provider-catalog-Bpqcb1Lf.js +0 -56
- package/dist/provider-catalog-Bs11UuqM.js +0 -11
- package/dist/provider-catalog-COSwNV9M.js +0 -61
- package/dist/provider-catalog-DUa_pOgJ.js +0 -75
- package/dist/provider-catalog-D_y8my55.js +0 -12
- package/dist/provider-catalog-DeCIvPpR.js +0 -18
- package/dist/provider-catalog-_qlQKmNX.js +0 -13
- package/dist/provider-catalog-e5v0B4DI.js +0 -11
- package/dist/provider-catalog-kLIlcQiR.js +0 -18
- package/dist/provider-catalog-qzO3WA-y.js +0 -16
- package/dist/provider-catalog-shared-CUCxLlCb.js +0 -104
- package/dist/provider-compat-CFb-paAS.js +0 -37
- package/dist/provider-discovery-D9udizRd.js +0 -2
- package/dist/provider-dispatcher-CpobYXeH.js +0 -22
- package/dist/provider-entry-DPuHH8KZ.js +0 -97
- package/dist/provider-flow-DpxAVxAq.js +0 -66
- package/dist/provider-http-CCWzhnsk.js +0 -26
- package/dist/provider-model-shared-TaFcxfzp.js +0 -171
- package/dist/provider-models-3mIjIjQp.js +0 -22
- package/dist/provider-models-CS0wJZJ5.js +0 -116
- package/dist/provider-models-CaZ-Aeoj.js +0 -119
- package/dist/provider-models-CvYgNrs5.js +0 -225
- package/dist/provider-models-D3D1lxRx.js +0 -169
- package/dist/provider-models-DfvyA63S.js +0 -35
- package/dist/provider-openai-codex-oauth-tls-ml4vKShG.js +0 -99
- package/dist/provider-rGfXjuTP.js +0 -70
- package/dist/provider-registration-BiwyYM-G.js +0 -57
- package/dist/provider-registration-ar6a4KcO.js +0 -238
- package/dist/provider-runtime-D60YrjWV.js +0 -2
- package/dist/provider-runtime-DlsEjiuo.js +0 -366
- package/dist/provider-runtime.runtime-BPeSkHxR.js +0 -26
- package/dist/provider-self-hosted-setup-5OmWafub.js +0 -249
- package/dist/provider-setup-tqWc26t1.js +0 -2
- package/dist/provider-stream-Dy9CFOxw.js +0 -285
- package/dist/provider-stream-family-CWsJY6l5.js +0 -2
- package/dist/provider-stream-shared-DiqyLpmc.js +0 -80
- package/dist/provider-tools-C8ePitIe.js +0 -332
- package/dist/provider-usage-DHBq1-N_.js +0 -3
- package/dist/provider-usage-DZ4vVbP6.js +0 -289
- package/dist/provider-web-search-DNrh74o2.js +0 -55
- package/dist/provider-web-search-contract-CD7a3E_j.js +0 -12
- package/dist/provider-web-search-contract-fields-CZpi7HIW.js +0 -38
- package/dist/provider-wizard-BlIgoAui.js +0 -166
- package/dist/providers.runtime-DUpqP3f8.js +0 -125
- package/dist/proxy-stream-wrappers-BBuH4e3Y.js +0 -480
- package/dist/push-apns-datkwHqM.js +0 -1061
- package/dist/pw-ai-ZAeid36y.js +0 -2268
- package/dist/qmd-manager-BFoyv6wl.js +0 -1799
- package/dist/qr-cli-CsVWBjvI.js +0 -359
- package/dist/qr-image-Clh1VoO8.js +0 -2
- package/dist/queue-D5a9w4iL.js +0 -636
- package/dist/realtime-provider-shared-CcJJy5LG.js +0 -21
- package/dist/realtime-transcription-provider-DJZBEHdh.js +0 -180
- package/dist/realtime-voice-provider-D_HLsBY-.js +0 -342
- package/dist/record-shared-CqhYuBoa.js +0 -10
- package/dist/refresh-CwNiDzvO.js +0 -115
- package/dist/region-FRlBzDc1.js +0 -74
- package/dist/register-command-groups-gxjHRBzB.js +0 -121
- package/dist/register.agent-QYak9Grv.js +0 -241
- package/dist/register.backup-BcFdIDsf.js +0 -234
- package/dist/register.configure-D20bnjIf.js +0 -15
- package/dist/register.maintenance-CFEcGADj.js +0 -443
- package/dist/register.message-CA_IJdMR.js +0 -601
- package/dist/register.migrate-CyHs2gyJ.js +0 -195
- package/dist/register.onboard-BTe7yt58.js +0 -83
- package/dist/register.runtime-CHJaT--O.js +0 -81
- package/dist/register.runtime-CjmIn42C.js +0 -343
- package/dist/register.setup-fcq_hZCH.js +0 -104
- package/dist/register.status-health-sessions-BBLhNnfs.js +0 -1211
- package/dist/register.subclis-BMKAZCX_.js +0 -232
- package/dist/register.subclis-JVDnA5Ih.js +0 -3
- package/dist/remote-env-2q04LuwQ.js +0 -12
- package/dist/repair-DNxJbWq8.js +0 -112
- package/dist/replay-policy-D4RdgaIZ.js +0 -10
- package/dist/replay-policy-DF668ume.js +0 -8
- package/dist/reply-Dp41LlFy.js +0 -3523
- package/dist/reply-payloads-DaWnvZFb.js +0 -78
- package/dist/reply-prefix-D_x6MM3Q.js +0 -33
- package/dist/reply.runtime-B3qMXkAa.js +0 -2
- package/dist/resolve-BxnY1Y0P.js +0 -280
- package/dist/restart-BTemxlpT.js +0 -454
- package/dist/restart-handoff-lV2xM09Z.js +0 -2
- package/dist/restart-health-CbsvDtnk.js +0 -2
- package/dist/restart-health-CvoNg6kT.js +0 -203
- package/dist/restart-stale-pids-DCtlWGBh.js +0 -529
- package/dist/retry-DSboRh9T.js +0 -76
- package/dist/retry-policy-CkDNftgh.js +0 -58
- package/dist/root-help-CbP63X2B.js +0 -44
- package/dist/route-reply-D4iLWqi8.js +0 -141
- package/dist/route-reply.runtime-DfhDlYwI.js +0 -2
- package/dist/rpc-BzxGDKQi.js +0 -61
- package/dist/rpc.runtime-B8npXano.js +0 -21
- package/dist/run-main-B_3B444F.js +0 -453
- package/dist/run-wait-DfwJbctd.js +0 -118
- package/dist/runner-Bq--JOxW.js +0 -1497
- package/dist/runs-B8BkTE5s.js +0 -495
- package/dist/runtime-9nd5Vnqo.js +0 -725
- package/dist/runtime-AzBVm8GH.js +0 -9
- package/dist/runtime-BsL8SByk.js +0 -253
- package/dist/runtime-Bt0p-8KG.js +0 -2
- package/dist/runtime-Czi9LJYu.js +0 -355
- package/dist/runtime-D4VTGXfu.js +0 -72
- package/dist/runtime-D4fBMloE.js +0 -200
- package/dist/runtime-DfBJ2CUS.js +0 -2
- package/dist/runtime-Di4Vh6yT2.js +0 -242
- package/dist/runtime-Gw1LMmF3.js +0 -191
- package/dist/runtime-api-38YAKTr3.js +0 -12
- package/dist/runtime-api-DVNSx5RM2.js +0 -2
- package/dist/runtime-api-DVxb5CCl.js +0 -3
- package/dist/runtime-cNtCXDff.js +0 -107
- package/dist/runtime-embedded-pi.runtime-Ca9Iylv7.js +0 -3
- package/dist/runtime-env-Clh0MW-d.js +0 -9
- package/dist/runtime-internal-D_EVbLoq.js +0 -2
- package/dist/runtime-model-auth.runtime-Db4xdojg.js +0 -39
- package/dist/runtime-plugins-CTXfWYb_.js +0 -69
- package/dist/runtime-prepare.runtime-C3ZR1iU5.js +0 -80
- package/dist/runtime-provider-DDeE81mK.js +0 -21
- package/dist/runtime-registry-loader-B2xOXVPK.js +0 -58
- package/dist/runtime-registry-loader-C5xxOfM0.js +0 -2
- package/dist/runtime-schema-Rce5jii6.js +0 -28383
- package/dist/runtime-shared-VTsPwExD.js +0 -249
- package/dist/runtime-taskflow-CHmtjSlF.js +0 -250
- package/dist/runtime-web-channel-plugin-DSXA1lnD.js +0 -215
- package/dist/runtime-web-tools-BBCJl629.js +0 -1467
- package/dist/runtime-web-tools-fallback.runtime-B2dwt38I.js +0 -9
- package/dist/sandbox-Bs4qtn7i.js +0 -4
- package/dist/sandbox-CwQ1zNXr.js +0 -2586
- package/dist/sandbox-cli-CFR4xMj0.js +0 -447
- package/dist/schtasks-jmQncr1-.js +0 -785
- package/dist/secrets-cli-D2MzNlq9.js +0 -2114
- package/dist/security-audit-MSBFxuZO.js +0 -34
- package/dist/security-cli-CyLFEXFK.js +0 -486
- package/dist/semantic-dedup-Bqflyeek.js +0 -95
- package/dist/send-D9izwSy3.js +0 -993
- package/dist/send-media-BjiwwtZH.js +0 -2123
- package/dist/server-DApOCk9r.js +0 -13
- package/dist/server-context-LZDbgxn5.js +0 -4164
- package/dist/server-methods-DLDI8rlu.js +0 -11827
- package/dist/server-middleware-B5ZNhGV1.js +0 -110
- package/dist/server-node-events-COo9ihwW.js +0 -451
- package/dist/server-wWM1a8y_.js +0 -77
- package/dist/server.impl-BhBceUhA.js +0 -19758
- package/dist/service-BI1Vz4Xe.js +0 -132
- package/dist/service-CHv4oM_x.js +0 -2
- package/dist/service-audit-DUt5vf5G.js +0 -254
- package/dist/service-audit-VJKA2Zjk.js +0 -2
- package/dist/session-BM6MJ_fx.js +0 -48
- package/dist/session-archive.runtime-6wxi7NBr.js +0 -2
- package/dist/session-conversation-CaxN7-m4.js +0 -27
- package/dist/session-cost-usage-CKgDTfyK.js +0 -2
- package/dist/session-cost-usage-rtoddk_D.js +0 -648
- package/dist/session-file-BaS8wO2e.js +0 -44
- package/dist/session-key-D12IZ26p.js +0 -65
- package/dist/session-meta-C7zPXGyf.js +0 -109
- package/dist/session-override-BWMnmq9K.js +0 -103
- package/dist/session-reset-model.runtime-BJekjjZ1.js +0 -120
- package/dist/session-reset-service-Clx7kNoI.js +0 -474
- package/dist/session-subagent-reactivation.runtime-B5VMaUf4.js +0 -2
- package/dist/session-system-events-DqUwf4D8.js +0 -63
- package/dist/session-tab-registry-a-_FAPhD.js +0 -553
- package/dist/session-updates-jTsbd65U.js +0 -234
- package/dist/session-updates.runtime-CJs2Wmpc.js +0 -2
- package/dist/session-utils-HYCaRwDS.js +0 -930
- package/dist/session-utils.fs-CYcamwPP.js +0 -537
- package/dist/sessions-D-EL9xre.js +0 -2
- package/dist/sessions-DFZL16O4.js +0 -45
- package/dist/sessions-FoJWLJgu.js +0 -226
- package/dist/sessions.runtime-DHIyM7E1.js +0 -2
- package/dist/setup-BQ53YXTC.js +0 -500
- package/dist/setup-Dm1kEe1b.js +0 -15
- package/dist/setup-DuAMFbAI.js +0 -329
- package/dist/setup-binary-BJMUy4FP.js +0 -2
- package/dist/setup-surface-D-In43nb.js +0 -586
- package/dist/setup-tools-B1DDAQcl.js +0 -4
- package/dist/setup-wizard-proxy-CXecAj2f.js +0 -139
- package/dist/setup.finalize-BSDCkR15.js +0 -436
- package/dist/setup.gateway-config-BKiYKvWk.js +0 -246
- package/dist/shared-Bzi2E64E.js +0 -218
- package/dist/shared-CIgFLTPv.js +0 -127
- package/dist/shared-CQhbwWcx.js +0 -219
- package/dist/shared-DP3EPmNx.js +0 -137
- package/dist/shared-GP6OsDGm.js +0 -224
- package/dist/shared-Kg0ysUjM.js +0 -175
- package/dist/shared-runtime-C857iT_Z.js +0 -7
- package/dist/shared-wJu1HSpr.js +0 -36
- package/dist/short-term-promotion-NMHC7sF-.js +0 -1631
- package/dist/simple-completion-runtime-CODXf2KQ.js +0 -131
- package/dist/simple-completion-transport-BqHYWL_H.js +0 -32
- package/dist/skill-commands-n4P37TTT.js +0 -82
- package/dist/skill-commands.runtime-euFmRZmn.js +0 -2
- package/dist/skill-lifecycle-ChEI3HEu.js +0 -105
- package/dist/skill-quality-gate-DYGJHgD_.js +0 -127
- package/dist/skill-usage-tracker-DOTutd6c.js +0 -31
- package/dist/skills-CDbNigal.js +0 -4
- package/dist/skills-CyZVptCK.js +0 -1075
- package/dist/skills-cli-QKIPu7mf.js +0 -382
- package/dist/skills-install-C_wDr3Yn.js +0 -822
- package/dist/skills-status-CRAMSqYC.js +0 -170
- package/dist/skills-status-Cidl9y_f.js +0 -2
- package/dist/soul-cli-BLzmjdCC.js +0 -110
- package/dist/speech-core-D6gbwLzS.js +0 -126
- package/dist/speech-provider-B9cT4Gjm.js +0 -39
- package/dist/speech-provider-BWGp5zle.js +0 -103
- package/dist/speech-provider-BraysNbH.js +0 -167
- package/dist/speech-provider-CZSo12LO.js +0 -101
- package/dist/speech-provider-ccV7I8Ix.js +0 -182
- package/dist/speech-provider-fldQqtyB.js +0 -184
- package/dist/ssh-tunnel-dSVKikW0.js +0 -159
- package/dist/ssh-tunnel-tfx0yANN.js +0 -2
- package/dist/ssrf-runtime-CGgU7d_A.js +0 -6
- package/dist/stage-sandbox-media.runtime-BFJ3cI5E.js +0 -230
- package/dist/standalone-generate-BKcScCKr.js +0 -217
- package/dist/standalone-generate-yEOzazHq.js +0 -2
- package/dist/startup-auth-DMhNYQWZ.js +0 -151
- package/dist/state-dir-env-Lo02ozFZ.js +0 -156
- package/dist/state-migrations-Dh_7NcB_.js +0 -823
- package/dist/status-BHNQZCLW.js +0 -2
- package/dist/status-BLL9siSW.js +0 -3
- package/dist/status-DEDZAhkE.js +0 -473
- package/dist/status-Dx7ATP7d.js +0 -278
- package/dist/status-Dy-2gjX4.js +0 -2
- package/dist/status-DyESaQIF.js +0 -399
- package/dist/status-all-Df45B-IL.js +0 -495
- package/dist/status-json-D4OQ-0cB.js +0 -14
- package/dist/status-json-command-BF5Ubpet.js +0 -92
- package/dist/status-pEsGMlCT.js +0 -500
- package/dist/status-runtime-shared-DBFbh_4j.js +0 -271
- package/dist/status.agent-local-DaJwHpO-.js +0 -58
- package/dist/status.command.text-runtime-DL5JjKUM.js +0 -15
- package/dist/status.format-BB7s3jni.js +0 -60
- package/dist/status.gateway-connection.runtime-DWgn4d1k.js +0 -2
- package/dist/status.gateway-probe-BpvLQ-KZ.js +0 -16
- package/dist/status.link-channel-DBwS2rj0.js +0 -35
- package/dist/status.node-mode-B7rN-_mc.js +0 -32
- package/dist/status.node-mode-CiGZWgis.js +0 -2
- package/dist/status.scan-BCSiOHpj.js +0 -62
- package/dist/status.scan-overview-CWvqkRRi.js +0 -395
- package/dist/status.scan.deps.runtime-OxqqgpNN.js +0 -18
- package/dist/status.scan.fast-json-At2BL9pr.js +0 -128
- package/dist/status.scan.fast-json-DUKoMAxG.js +0 -2
- package/dist/status.scan.runtime-CPzkdkBL.js +0 -417
- package/dist/status.summary-BJOdPDru.js +0 -209
- package/dist/status.summary-DRHwbpBE.js +0 -2
- package/dist/status.update-D0v2dhjh.js +0 -2
- package/dist/status.update-fG9weCeY.js +0 -79
- package/dist/store-CnbV_v4i.js +0 -1075
- package/dist/store-DEH_mAUq.js +0 -421
- package/dist/store-UtXO-V4U.js +0 -1112
- package/dist/store-wIjWeFYl.js +0 -296
- package/dist/store.runtime-CDPwlRWv.js +0 -2
- package/dist/stream-Cj2d1y0c.js +0 -129
- package/dist/stream-CxHR78zN.js +0 -26
- package/dist/stream-DBSqjZK_.js +0 -153
- package/dist/stream-DnQfYsj6.js +0 -27
- package/dist/stream-W2dOHnSg.js +0 -76
- package/dist/stream-pDP7GUBb.js +0 -649
- package/dist/stream-wrappers-BRVvwnDu.js +0 -144
- package/dist/strip-inbound-meta-BltI8kVf.js +0 -155
- package/dist/subagent-announce.registry.runtime-BH63IC3w.js +0 -3
- package/dist/subagent-control-Cy2-30UQ.js +0 -485
- package/dist/subagent-followup.runtime-Bv4Ek4Am.js +0 -68
- package/dist/subagent-list-Wz1QeiD7.js +0 -168
- package/dist/subagent-orphan-recovery-Dc03y0FO.js +0 -214
- package/dist/subagent-registry-I3k-o-Nd.js +0 -2889
- package/dist/subagent-registry-read-C8xgeh3J.js +0 -57
- package/dist/subagent-registry-runtime-B8EcVp4z.js +0 -2
- package/dist/subagent-registry.runtime-J1wFiENA.js +0 -3
- package/dist/subagent-spawn-B_YkzMDM.js +0 -782
- package/dist/subagents-format-mYISVAR0.js +0 -629
- package/dist/subcli-descriptors-BcYaj0tK.js +0 -174
- package/dist/supervisor-eA5CZ9ni.js +0 -737
- package/dist/system-cli-Bmr6iKmB.js +0 -60
- package/dist/system-prompt-C414pRhO.js +0 -2
- package/dist/system-prompt-T5mXJ7TP.js +0 -711
- package/dist/system-prompt-cache-boundary-NtELRwVL.js +0 -25
- package/dist/system-run-command-DKJXglyj.js +0 -300
- package/dist/systemd-CuaTSaBa.js +0 -591
- package/dist/systemd-hints-B_h09Mzm.js +0 -76
- package/dist/systemd-linger-DE_Fg46b.js +0 -68
- package/dist/systemd-linger-Mr1QtLLn.js +0 -2
- package/dist/tables-DFdELq_3.js +0 -832
- package/dist/tailscale-status-PTtL7jnj.js +0 -72
- package/dist/targets-CNCX90Yv.js +0 -595
- package/dist/targets-CRHINrER.js +0 -300
- package/dist/targets.runtime-NhznjXPy.js +0 -2
- package/dist/task-executor-esRPaf9b.js +0 -350
- package/dist/task-owner-access-DrWYhRWd.js +0 -48
- package/dist/task-registry-99Z_Z9h2.js +0 -2346
- package/dist/task-registry-control.runtime-B6ince9b.js +0 -3
- package/dist/task-registry-delivery-runtime-CvNHgv_t.js +0 -2
- package/dist/task-registry-delivery-runtime-DvtrlNwu.js +0 -3
- package/dist/task-registry.maintenance-BYQsqVxN.js +0 -425
- package/dist/task-registry.maintenance-ZYzfHTTq.js +0 -2
- package/dist/test.DNmyFkvJ-k8NJ4Bmh.js +0 -13549
- package/dist/testing-D_bofHRA.js +0 -441
- package/dist/text-report-CkkKmBEq.js +0 -587
- package/dist/text-runtime-mBCqEES4.js +0 -313
- package/dist/thread-bindings-iTrRkLzQ.js +0 -223
- package/dist/tool-auth-shared-D-QPgeom.js +0 -53
- package/dist/tool-config-shared-D6_m3gGr.js +0 -19
- package/dist/tool-schema-runtime-B_exwg7V.js +0 -1892
- package/dist/tools-DOCf-D1O.js +0 -110
- package/dist/tools-effective-inventory-ByTHgwZ3.js +0 -152
- package/dist/tools.runtime-B91t6gA1.js +0 -4
- package/dist/transcript-0fLDbW8-.js +0 -222
- package/dist/transcript-B0nNP1bi.js +0 -191
- package/dist/transcript-DQsKeQyR.js +0 -2
- package/dist/transcript.runtime-CsPaloHz.js +0 -2
- package/dist/transport-policy-BFNf1-9h.js +0 -75
- package/dist/transport-ready-CjD7QFVT.js +0 -36
- package/dist/tts-BKZmS4xr.js +0 -40
- package/dist/tts-Br2otWLy.js +0 -31
- package/dist/tts.runtime-pJ42sd4M.js +0 -3
- package/dist/tui-Dvbh1BOb.js +0 -4018
- package/dist/tui-cli-frG91oxp.js +0 -31
- package/dist/typing-mode-BueK7uiv.js +0 -84
- package/dist/undici-global-dispatcher-eRWmqD02.js +0 -99
- package/dist/uninstall-CQxsblrz.js +0 -172
- package/dist/update-CqprWvFy.js +0 -1253
- package/dist/update-check-JM7VVIJX.js +0 -431
- package/dist/update-cli-4oFlMshW.js +0 -1779
- package/dist/update-runner-BLsea7TF.js +0 -1492
- package/dist/usage-AvsukxPf.js +0 -71
- package/dist/usage-format-CxKKzsv8.js +0 -2
- package/dist/usage-format-DVbAh1EI.js +0 -507
- package/dist/utils-BwORcPSF.js +0 -189
- package/dist/video-generation-D4NjX7OM.js +0 -167
- package/dist/video-generation-provider-B6dkZGU2.js +0 -171
- package/dist/video-generation-provider-BIqnhibW.js +0 -263
- package/dist/video-generation-provider-BfUmxHum.js +0 -233
- package/dist/video-generation-provider-C2FSvm96.js +0 -181
- package/dist/video-generation-provider-C_fy5kYb.js +0 -240
- package/dist/video-generation-provider-Cqvdmy-7.js +0 -104
- package/dist/video-generation-provider-Cr5dQ5-Y.js +0 -77
- package/dist/video-generation-provider-DZF-F5Ao.js +0 -64
- package/dist/video-generation-provider-PuCcXFdo.js +0 -227
- package/dist/video-generation-provider-e-M9VqII.js +0 -246
- package/dist/video-http-CqiFyKro.js +0 -29
- package/dist/video-model-catalog-Dujyv6aJ.js +0 -187
- package/dist/web-fetch-providers.runtime-ayN9rZBJ.js +0 -33
- package/dist/web-media-B770i-06.js +0 -2
- package/dist/web-media-CfbPpWDK.js +0 -330
- package/dist/web-search-C2oRdo-K.js +0 -221
- package/dist/web-search-provider-ChE5ssV7.js +0 -155
- package/dist/web-search-provider-common-DxHMfm5S.js +0 -206
- package/dist/web-search-provider-config-DopQHA3M.js +0 -52
- package/dist/web-search-providers.runtime-Co-XwN8c.js +0 -206
- package/dist/web-shared-BQmfD1uO.js +0 -414
- package/dist/webhooks-cli-BPynigdk.js +0 -321
- package/dist/workspace-BbNiOKCq.js +0 -306
- package/dist/x-search-shared-B6nTB07f.js +0 -109
- /package/dist/{account-lookup-44DR0qFz.js → account-lookup-DvZ7IbyB.js} +0 -0
- /package/dist/{api-Bscnsaay.js → api-o6w96t-n.js} +0 -0
- /package/dist/{audit-channel.collect.runtime-BAK_7igU.js → audit-channel.collect.runtime-CmRt-Vtg.js} +0 -0
- /package/dist/{audit-log-BDrZBg3k.js → audit-log-C8AUJlPm.js} +0 -0
- /package/dist/{auth-choice-legacy-CYu9EVM5.js → auth-choice-legacy-DBeZmOvF.js} +0 -0
- /package/dist/{auth-surface-resolution-CPk6looU.js → auth-surface-resolution-8mDG-EDa.js} +0 -0
- /package/dist/{backoff-CoEL_G0O.js → backoff-D10eQVn6.js} +0 -0
- /package/dist/{block-reply-pipeline-CP-hIXtp.js → block-reply-pipeline-BFCpQM1A.js} +0 -0
- /package/dist/{channel-account-context-ChXT_QXz.js → channel-account-context-CLJUy3h3.js} +0 -0
- /package/dist/{channel-options-Gu8RxE7y.js → channel-options-BiNEyim3.js} +0 -0
- /package/dist/{channel-plugin-ids-Cdh34d9L.js → channel-plugin-ids-C_TPz1Uu.js} +0 -0
- /package/dist/{channel-selection.runtime-Dh6-3MJD.js → channel-selection.runtime-DxtxDaqe.js} +0 -0
- /package/dist/{channels-status-issues-nqyQ0Evv.js → channels-status-issues-DZCoj3wt.js} +0 -0
- /package/dist/{chat-envelope-C8CaVGEc.js → chat-envelope-C14DhfdY.js} +0 -0
- /package/dist/{chat-message-content-BmiUVjys.js → chat-message-content-N9aXPKj0.js} +0 -0
- /package/dist/{close-reason-DgNNQTUr.js → close-reason-BUP99WO2.js} +0 -0
- /package/dist/{cognitive-delivery-BQ21zS8V.js → cognitive-delivery-2v98ODTY.js} +0 -0
- /package/dist/{command-poll-backoff.runtime-BS9_DhCh.js → command-poll-backoff.runtime-CT-as2yH.js} +0 -0
- /package/dist/{command-registration-policy-CBGSxVcp.js → command-registration-policy-Cic6BBCo.js} +0 -0
- /package/dist/{commands-H3Ab0eU8.js → commands-BNMz19sX.js} +0 -0
- /package/dist/{config-xqDcwygz.js → config-Cf9PwxU0.js} +0 -0
- /package/dist/{config-value-DrQEX08M.js → config-value-CFTkgtE_.js} +0 -0
- /package/dist/{consolidation-userid-CWW9Rg3G.js → consolidation-userid-BIPR4Xb3.js} +0 -0
- /package/dist/{context-builder-Bf6cYQGQ.js → context-builder-qhLwO35b.js} +0 -0
- /package/dist/{context-manifest-AkIidQ_d.js → context-manifest-DJgFhmvf.js} +0 -0
- /package/dist/{control-ui-shared-upny-T3O.js → control-ui-shared-Bdc3sIMw.js} +0 -0
- /package/dist/{dangerous-tools-GRkSUsw5.js → dangerous-tools-Bh7pfw4x.js} +0 -0
- /package/dist/{defaults-CkfIX_lg.js → defaults-DW-KEml1.js} +0 -0
- /package/dist/{detect-binary-BF7GWFFn.js → detect-binary-DykWiFpV.js} +0 -0
- /package/dist/{device-auth-ChMjC2OY.js → device-auth-Co78c3Fk.js} +0 -0
- /package/dist/{device-identity-CnWSzhCW.js → device-identity-BbqzkeXB.js} +0 -0
- /package/dist/{device-metadata-normalization-BCk_oevU.js → device-metadata-normalization-_VVweA-R.js} +0 -0
- /package/dist/{directive-tags-C-tVOPf_.js → directive-tags-DISVLDCp.js} +0 -0
- /package/dist/{dotenv-B0Ninvzt.js → dotenv-BVFKHTQc.js} +0 -0
- /package/dist/{exec-approvals-effective-8HnjEtIL.js → exec-approvals-effective-CLbTYTav.js} +0 -0
- /package/dist/{exec-file-CMG8z0ly.js → exec-file-CJGGCNuX.js} +0 -0
- /package/dist/{extractor-zuZXdT3R.js → extractor-BB1zo9Wy.js} +0 -0
- /package/dist/{fallback-state-DxOz1LA0.js → fallback-state-DcYqyCEy.js} +0 -0
- /package/dist/{fetch-timeout-BAjBTvFf.js → fetch-timeout-BCovYv8d.js} +0 -0
- /package/dist/{fingerprint-vRPYSVrE.js → fingerprint-Dl8U2WD6.js} +0 -0
- /package/dist/{fragment-types-DaQY3JTf.js → fragment-types-D5gnAz5U.js} +0 -0
- /package/dist/{frontmatter-CtMG8SHH.js → frontmatter-BlXOniKN.js} +0 -0
- /package/dist/{gateway-presence-C9CVPS3M.js → gateway-presence-BOHdope3.js} +0 -0
- /package/dist/{gaxios-fetch-compat-C7uLN0yt.js → gaxios-fetch-compat-DBQ2FOTr.js} +0 -0
- /package/dist/{git-commit-BlgTui6o.js → git-commit-C0NqDaJx.js} +0 -0
- /package/dist/{groups.runtime-CDspPvbm.js → groups.runtime-Biyz6BVj.js} +0 -0
- /package/dist/{health-format-Dr-28EXc.js → health-format-BAdMOv0G.js} +0 -0
- /package/dist/{helpers-CbJsWCnj.js → helpers-2xO4B-57.js} +0 -0
- /package/dist/{hooks-policy-Dx4ZMX1n.js → hooks-policy-Co4GDvwp.js} +0 -0
- /package/dist/{identity-BtgZsd-F.js → identity-Dplh_aWR.js} +0 -0
- /package/dist/{includes-scan-dP1_GHm1.js → includes-scan-DQ58cU6W.js} +0 -0
- /package/dist/{info-scan-source-B7go_Oc2.js → info-scan-source-CJZU0g-3.js} +0 -0
- /package/dist/{input-provenance-CqVg_UvP.js → input-provenance-DXlFriXS.js} +0 -0
- /package/dist/{install-target-CEzsONC0.js → install-target-BePL4Kza.js} +0 -0
- /package/dist/{installs-TINOTdOb.js → installs-6mOb-tQ-.js} +0 -0
- /package/dist/{ipv4-Crsp1rWd.js → ipv4-CTuRjRc8.js} +0 -0
- /package/dist/{issue-format-BJCe7wW8.js → issue-format-CxtLa4Cu.js} +0 -0
- /package/dist/{json-mode-KT6243ws.js → json-mode-7wpPHQL6.js} +0 -0
- /package/dist/{kaijibot.plugin-DO7iROUw.js → kaijibot.plugin-DlbL2Ru2.js} +0 -0
- /package/dist/{kill-tree-cyGT7uvN.js → kill-tree-DCyfVQx0.js} +0 -0
- /package/dist/{lib-Ml3xh0LZ.js → lib-D8A9tlN-.js} +0 -0
- /package/dist/{lifecycle-DaUmjkGK.js → lifecycle-lZ5BtT_X.js} +0 -0
- /package/dist/{llm-key-probe-taLN8k5G.js → llm-key-probe-DEQ2jygx.js} +0 -0
- /package/dist/{magic-string.es-CFjqKY18.js → magic-string.es-NXfdbfy9.js} +0 -0
- /package/dist/{model-auth-markers-CrDTQj4i.js → model-auth-markers-BR92KCie.js} +0 -0
- /package/dist/{model-auth-runtime-shared-Dlg_9I8x.js → model-auth-runtime-shared-7sMIRCy3.js} +0 -0
- /package/dist/{model-definitions-DUm9_cBo.js → model-definitions-DTmWdph5.js} +0 -0
- /package/dist/{model-id-ClMKKyMX.js → model-id-josvS7_f.js} +0 -0
- /package/dist/{model-param-b-C1zLPOVI.js → model-param-b-BA2a8ys5.js} +0 -0
- /package/dist/{models-C6zeLda-.js → models-DafdVx4b.js} +0 -0
- /package/dist/{number-coercion-D1JCit9l.js → number-coercion-Cmu1aJr8.js} +0 -0
- /package/dist/{oauth-refresh-failure-Bm7PU-lI.js → oauth-refresh-failure-D4qLGlz9.js} +0 -0
- /package/dist/{onboard-DxdyhKkv.js → onboard-BQDmoIfO.js} +0 -0
- /package/dist/{onboard-z2i2uWin.js → onboard-DQ3NotUx.js} +0 -0
- /package/dist/{onboard-config-D6HSppfR.js → onboard-config-BaBypGxb.js} +0 -0
- /package/dist/{openclaw-migrator-U-BFS_Y3.js → openclaw-migrator-DDJDf_fP.js} +0 -0
- /package/dist/{package-update-utils-CPAScCHs.js → package-update-utils-CriM_ABA.js} +0 -0
- /package/dist/{parse-log-line-CC2WEGwM.js → parse-log-line-BGXLvgmK.js} +0 -0
- /package/dist/{path-env-D0YqoJmh.js → path-env-BqQ62jS8.js} +0 -0
- /package/dist/{persona-change-source-DPNY1vyZ.js → persona-change-source-BayRH7Yd.js} +0 -0
- /package/dist/{plugin-approvals-D2nSmWGQ.js → plugin-approvals-BVOH9uWd.js} +0 -0
- /package/dist/{plugin-web-search-config-CM7ac77h.js → plugin-web-search-config-Vy4SBasR.js} +0 -0
- /package/dist/{ports-lsof-rC3_YG8t.js → ports-lsof-C7nTF2Et.js} +0 -0
- /package/dist/{ports-probe-CKr2RdYw.js → ports-probe-BFA3MD3-.js} +0 -0
- /package/dist/{preference-learner-D-x6hOZc.js → preference-learner-BDRd2YZ7.js} +0 -0
- /package/dist/{probe-target-BCTuiZqm.js → probe-target-LcJauh0W.js} +0 -0
- /package/dist/{program-context-beQs52o_.js → program-context-B3G__AI_.js} +0 -0
- /package/dist/{prompt-cache-stability-DdwE3HeP.js → prompt-cache-stability-CgXAu47S.js} +0 -0
- /package/dist/{prompt-style-BCo80D6m.js → prompt-style-BCVDnx1C.js} +0 -0
- /package/dist/{provider-auth-choice-helpers-iOfeFAnv.js → provider-auth-choice-helpers-wXOAgzFT.js} +0 -0
- /package/dist/{provider-catalog-Cj1om2Fk.js → provider-catalog-CFmQ4vw9.js} +0 -0
- /package/dist/{provider-catalog-CjqnxOnp.js → provider-catalog-CSp5wIkO.js} +0 -0
- /package/dist/{provider-discovery-RmybjjET.js → provider-discovery-DfcBjamA.js} +0 -0
- /package/dist/{provider-model-compat-CsF2NGa6.js → provider-model-compat-DfOMY_2L.js} +0 -0
- /package/dist/{provider-oauth-flow-Dyp5m-iG.js → provider-oauth-flow-BlUhVfpW.js} +0 -0
- /package/dist/{qa-cli-Czvxw_Gf.js → qa-cli-DNHouwrc.js} +0 -0
- /package/dist/{register.android-install-CFC21hJx.js → register.android-install-BKTH5mXO.js} +0 -0
- /package/dist/{reply-payloads-dedupe.runtime-CQRYt4cT.js → reply-payloads-dedupe.runtime-Y6x_m1r3.js} +0 -0
- /package/dist/{resolve-CziruFEe.js → resolve-B-YGj7MS.js} +0 -0
- /package/dist/{responses-tool-shared-DQ-w_2Ok.js → responses-tool-shared-Bp63wGvZ.js} +0 -0
- /package/dist/{restart-handoff-B3HMjoAC.js → restart-handoff-CUig5xgo.js} +0 -0
- /package/dist/{root-help-metadata-B56QuaDg.js → root-help-metadata-DKln3V98.js} +0 -0
- /package/dist/{runtime-manifest.runtime-DgzvTWxI.js → runtime-manifest.runtime-BMhOQl1D.js} +0 -0
- /package/dist/{runtime-parse-D4az8KIY.js → runtime-parse-DYEtqXT6.js} +0 -0
- /package/dist/{runtime-status-Di5Hf2P6.js → runtime-status-Cph8qA_2.js} +0 -0
- /package/dist/{runtime-web-tools-manifest.runtime-9Feh8w--.js → runtime-web-tools-manifest.runtime-C9TRV0jQ.js} +0 -0
- /package/dist/{runtime-web-tools-public-artifacts.runtime-CBOtSULk.js → runtime-web-tools-public-artifacts.runtime-Pll_c9Y7.js} +0 -0
- /package/dist/{schedule-Cc2eXy4A.js → schedule-Dbhedkt2.js} +0 -0
- /package/dist/{schtasks-exec-BgQqxhbL.js → schtasks-exec-wK5FEC9N.js} +0 -0
- /package/dist/{secret-file-_eFsf9j0.js → secret-file-Da3YlfBp.js} +0 -0
- /package/dist/{session-fork.runtime-Jwj0bXs7.js → session-fork.runtime-B_FyKI81.js} +0 -0
- /package/dist/{session-transcript-files.fs-CTjDzbyc.js → session-transcript-files.fs-98DIXUOq.js} +0 -0
- /package/dist/{setup.plugin-config-CyzblkGd.js → setup.plugin-config-DicRLpNt.js} +0 -0
- /package/dist/{setup.secret-input-K_qSH6id.js → setup.secret-input-_xfjuFpR.js} +0 -0
- /package/dist/{skill-draft-generator-BdEjPAqk.js → skill-draft-generator-CEnZCApW.js} +0 -0
- /package/dist/{skill-reviewer-YJgdYe4X.js → skill-reviewer-BJ0eED6E.js} +0 -0
- /package/dist/{skill-scanner-BVHCxyxt.js → skill-scanner-4eRxi2qj.js} +0 -0
- /package/dist/{skill-writer-CrrWOMGT.js → skill-writer-CGbRGRnJ.js} +0 -0
- /package/dist/{ssh-config-BU3F9f2c.js → ssh-config-Bq3o6jik.js} +0 -0
- /package/dist/{status-config-UwTO8Wvv.js → status-config-oMZ_A68q.js} +0 -0
- /package/dist/{store-DK_u7Vxr.js → store-BqlEtQMW.js} +0 -0
- /package/dist/{store-VNDZK044.js → store-xR8gNpX6.js} +0 -0
- /package/dist/{subagent-followup-hints-BlYKyyQ0.js → subagent-followup-hints-DUbpIh2D.js} +0 -0
- /package/dist/{subagent-registry-state-zLMA_MzM.js → subagent-registry-state-CjRrrVgp.js} +0 -0
- /package/dist/{subagent-session-metrics-BgoCTpFX.js → subagent-session-metrics-8IQoh3DH.js} +0 -0
- /package/dist/{supervisor-log.runtime-D53IonaD.js → supervisor-log.runtime-DTqzZ8Bv.js} +0 -0
- /package/dist/{table-CeEBFHtM.js → table-BUbO1fqP.js} +0 -0
- /package/dist/{targets-DOJmrCN8.js → targets-uT1GHLfz.js} +0 -0
- /package/dist/{task-registry.audit.shared-DPSVqAxg.js → task-registry.audit.shared-BvC-fQTz.js} +0 -0
- /package/dist/{text-similarity-CII8oAS-.js → text-similarity-ckJcEBCN.js} +0 -0
- /package/dist/{thread-info-BvQiu1xr.js → thread-info-DjVKrfI6.js} +0 -0
- /package/dist/{tokens-DIzGgGwL.js → tokens-CB2-NTu5.js} +0 -0
- /package/dist/{transcript-events-BC4_m8-c.js → transcript-events-B4kB35M0.js} +0 -0
- /package/dist/{transcript-mirror-BlMhpuHP.js → transcript-mirror-BQwPaEwA.js} +0 -0
- /package/dist/{trust-calculator-BebDau66.js → trust-calculator-ehG2IihQ.js} +0 -0
- /package/dist/{tts.runtime-DBX6LFeO.js → tts.runtime-Bgfon7Cb.js} +0 -0
- /package/dist/{types-D-x2Rbid.js → types-DvE7xIVm.js} +0 -0
- /package/dist/{widearea-dns-atdAOupV.js → widearea-dns-BFgpZSmq.js} +0 -0
- /package/dist/{wsl-DQ0RgjjQ.js → wsl-084fnhGP.js} +0 -0
- /package/dist/{x-search-tool-shared-DX-6O1NP.js → x-search-tool-shared-BKwKoAM7.js} +0 -0
- /package/dist/{zod-parse-Cu9hgbVC.js → zod-parse-DRCmgWgX.js} +0 -0
|
@@ -0,0 +1,4018 @@
|
|
|
1
|
+
import { i as normalizeLowercaseStringOrEmpty, o as normalizeOptionalLowercaseString, s as normalizeOptionalString } from "./string-coerce-xZwG7Dq8.js";
|
|
2
|
+
import { r as formatErrorMessage } from "./errors-Ez4cKI2Y.js";
|
|
3
|
+
import { _ as GATEWAY_CLIENT_NAMES, g as GATEWAY_CLIENT_MODES, m as GATEWAY_CLIENT_CAPS } from "./message-channel-DOJZxe6w.js";
|
|
4
|
+
import { i as visibleWidth, r as stripAnsi$1 } from "./ansi-BFdeIM_K.js";
|
|
5
|
+
import { d as resolveResponseUsageMode, l as normalizeUsageDisplay } from "./thinking.shared-lXIMjxJI.js";
|
|
6
|
+
import { n as VERSION } from "./version-Dc5wRAa8.js";
|
|
7
|
+
import { s as parseAgentSessionKey } from "./session-key-utils-DEfwsZM6.js";
|
|
8
|
+
import { c as normalizeAgentId, l as normalizeMainKey, r as buildAgentMainSessionKey } from "./session-key-Dny5dRer.js";
|
|
9
|
+
import { c as resolveAgentIdByWorkspacePath, m as resolveDefaultAgentId } from "./agent-scope-z3lpbLWu.js";
|
|
10
|
+
import { o as loadConfig } from "./io-Bz-M35LC.js";
|
|
11
|
+
import "./config-DuLfQQvE.js";
|
|
12
|
+
import { t as assertExplicitGatewayAuthModeWhenBothConfigured } from "./auth-mode-policy-CTwnrT6g.js";
|
|
13
|
+
import { a as isLoopbackHost } from "./net-DHssoW_x.js";
|
|
14
|
+
import { f as GatewayClient } from "./method-scopes-BNjBMlqM.js";
|
|
15
|
+
import { r as formatTokenCount } from "./usage-format-DQTT4pqY.js";
|
|
16
|
+
import { r as extractAssistantVisibleText } from "./chat-message-content-N9aXPKj0.js";
|
|
17
|
+
import { r as stripLeadingInboundMetadata } from "./strip-inbound-meta-BSHFFiJd.js";
|
|
18
|
+
import { n as formatRawAssistantErrorForUi } from "./assistant-error-format-DAW9G39c.js";
|
|
19
|
+
import { n as listThinkingLevelLabels, t as formatThinkingLevels } from "./thinking-CHPwc2Q0.js";
|
|
20
|
+
import { l as resolveExplicitGatewayAuth, n as buildGatewayConnectionDetails, s as ensureExplicitGatewayAuth } from "./call-k_nZXTJ3.js";
|
|
21
|
+
import { r as resolveToolDisplay, t as formatToolDetail } from "./tool-display-B47WBpuF.js";
|
|
22
|
+
import { r as resolveSessionInfoModelSelection } from "./model-selection-display-ChORnb-8.js";
|
|
23
|
+
import { c as listChatCommands, l as listChatCommandsForConfig } from "./commands-registry-CJw_6JDj.js";
|
|
24
|
+
import { n as formatTimeAgo, t as formatRelativeTimestamp } from "./format-relative-D1KMnyru.js";
|
|
25
|
+
import { t as normalizeGroupActivation } from "./group-activation-BT5UFjTt.js";
|
|
26
|
+
import { t as resolveGatewayInteractiveSurfaceAuth } from "./auth-surface-resolution-8mDG-EDa.js";
|
|
27
|
+
import { spawn } from "node:child_process";
|
|
28
|
+
import chalk from "chalk";
|
|
29
|
+
import { randomUUID } from "node:crypto";
|
|
30
|
+
import { Box, CombinedAutocompleteProvider, Container, Editor, Input, Key, Loader, Markdown, ProcessTerminal, SelectList, SettingsList, Spacer, TUI, Text, isKeyRelease, matchesKey, truncateToWidth } from "@earendil-works/pi-tui";
|
|
31
|
+
import { highlight, supportsLanguage } from "cli-highlight";
|
|
32
|
+
//#region src/tui/commands.ts
|
|
33
|
+
const VERBOSE_LEVELS = ["on", "off"];
|
|
34
|
+
const FAST_LEVELS = [
|
|
35
|
+
"status",
|
|
36
|
+
"on",
|
|
37
|
+
"off"
|
|
38
|
+
];
|
|
39
|
+
const REASONING_LEVELS = ["on", "off"];
|
|
40
|
+
const ELEVATED_LEVELS = [
|
|
41
|
+
"on",
|
|
42
|
+
"off",
|
|
43
|
+
"ask",
|
|
44
|
+
"full"
|
|
45
|
+
];
|
|
46
|
+
const ACTIVATION_LEVELS = ["mention", "always"];
|
|
47
|
+
const USAGE_FOOTER_LEVELS = [
|
|
48
|
+
"off",
|
|
49
|
+
"tokens",
|
|
50
|
+
"full"
|
|
51
|
+
];
|
|
52
|
+
const COMMAND_ALIASES = {
|
|
53
|
+
elev: "elevated",
|
|
54
|
+
gwstatus: "gateway-status"
|
|
55
|
+
};
|
|
56
|
+
function createLevelCompletion(levels) {
|
|
57
|
+
return (prefix) => levels.filter((value) => value.startsWith(normalizeLowercaseStringOrEmpty(prefix))).map((value) => ({
|
|
58
|
+
value,
|
|
59
|
+
label: value
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
function parseCommand(input) {
|
|
63
|
+
const trimmed = input.replace(/^\//, "").trim();
|
|
64
|
+
if (!trimmed) return {
|
|
65
|
+
name: "",
|
|
66
|
+
args: ""
|
|
67
|
+
};
|
|
68
|
+
const [name, ...rest] = trimmed.split(/\s+/);
|
|
69
|
+
const normalized = normalizeLowercaseStringOrEmpty(name);
|
|
70
|
+
return {
|
|
71
|
+
name: COMMAND_ALIASES[normalized] ?? normalized,
|
|
72
|
+
args: rest.join(" ").trim()
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function getSlashCommands(options = {}) {
|
|
76
|
+
const thinkLevels = listThinkingLevelLabels(options.provider, options.model);
|
|
77
|
+
const verboseCompletions = createLevelCompletion(VERBOSE_LEVELS);
|
|
78
|
+
const fastCompletions = createLevelCompletion(FAST_LEVELS);
|
|
79
|
+
const reasoningCompletions = createLevelCompletion(REASONING_LEVELS);
|
|
80
|
+
const usageCompletions = createLevelCompletion(USAGE_FOOTER_LEVELS);
|
|
81
|
+
const elevatedCompletions = createLevelCompletion(ELEVATED_LEVELS);
|
|
82
|
+
const activationCompletions = createLevelCompletion(ACTIVATION_LEVELS);
|
|
83
|
+
const commands = [
|
|
84
|
+
{
|
|
85
|
+
name: "help",
|
|
86
|
+
description: "Show slash command help"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "gateway-status",
|
|
90
|
+
description: "Show gateway status summary"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "gwstatus",
|
|
94
|
+
description: "Alias for /gateway-status"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "agent",
|
|
98
|
+
description: "Switch agent (or open picker)"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "agents",
|
|
102
|
+
description: "Open agent picker"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "session",
|
|
106
|
+
description: "Switch session (or open picker)"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "sessions",
|
|
110
|
+
description: "Open session picker"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: "model",
|
|
114
|
+
description: "Set model (or open picker)"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "models",
|
|
118
|
+
description: "Open model picker"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "think",
|
|
122
|
+
description: "Set thinking level",
|
|
123
|
+
getArgumentCompletions: (prefix) => thinkLevels.filter((v) => v.startsWith(normalizeLowercaseStringOrEmpty(prefix))).map((value) => ({
|
|
124
|
+
value,
|
|
125
|
+
label: value
|
|
126
|
+
}))
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "fast",
|
|
130
|
+
description: "Set fast mode on/off",
|
|
131
|
+
getArgumentCompletions: fastCompletions
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: "verbose",
|
|
135
|
+
description: "Set verbose on/off",
|
|
136
|
+
getArgumentCompletions: verboseCompletions
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: "reasoning",
|
|
140
|
+
description: "Set reasoning on/off",
|
|
141
|
+
getArgumentCompletions: reasoningCompletions
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: "usage",
|
|
145
|
+
description: "Toggle per-response usage line",
|
|
146
|
+
getArgumentCompletions: usageCompletions
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "elevated",
|
|
150
|
+
description: "Set elevated on/off/ask/full",
|
|
151
|
+
getArgumentCompletions: elevatedCompletions
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "elev",
|
|
155
|
+
description: "Alias for /elevated",
|
|
156
|
+
getArgumentCompletions: elevatedCompletions
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "activation",
|
|
160
|
+
description: "Set group activation",
|
|
161
|
+
getArgumentCompletions: activationCompletions
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: "abort",
|
|
165
|
+
description: "Abort active run"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "new",
|
|
169
|
+
description: "Reset the session"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: "reset",
|
|
173
|
+
description: "Reset the session"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "settings",
|
|
177
|
+
description: "Open settings"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "exit",
|
|
181
|
+
description: "Exit the TUI"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: "quit",
|
|
185
|
+
description: "Exit the TUI"
|
|
186
|
+
}
|
|
187
|
+
];
|
|
188
|
+
const seen = new Set(commands.map((command) => command.name));
|
|
189
|
+
const gatewayCommands = options.cfg ? listChatCommandsForConfig(options.cfg) : listChatCommands();
|
|
190
|
+
for (const command of gatewayCommands) {
|
|
191
|
+
const aliases = command.textAliases.length > 0 ? command.textAliases : [`/${command.key}`];
|
|
192
|
+
for (const alias of aliases) {
|
|
193
|
+
const name = alias.replace(/^\//, "").trim();
|
|
194
|
+
if (!name || seen.has(name)) continue;
|
|
195
|
+
seen.add(name);
|
|
196
|
+
commands.push({
|
|
197
|
+
name,
|
|
198
|
+
description: command.description
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return commands;
|
|
203
|
+
}
|
|
204
|
+
function helpText(options = {}) {
|
|
205
|
+
return [
|
|
206
|
+
"Slash commands:",
|
|
207
|
+
"/help",
|
|
208
|
+
"/commands",
|
|
209
|
+
"/status",
|
|
210
|
+
"/gateway-status",
|
|
211
|
+
"/gwstatus",
|
|
212
|
+
"/agent <id> (or /agents)",
|
|
213
|
+
"/session <key> (or /sessions)",
|
|
214
|
+
"/model <provider/model> (or /models)",
|
|
215
|
+
`/think <${formatThinkingLevels(options.provider, options.model, "|")}>`,
|
|
216
|
+
"/fast <status|on|off>",
|
|
217
|
+
"/verbose <on|off>",
|
|
218
|
+
"/reasoning <on|off>",
|
|
219
|
+
"/usage <off|tokens|full>",
|
|
220
|
+
"/elevated <on|off|ask|full>",
|
|
221
|
+
"/elev <on|off|ask|full>",
|
|
222
|
+
"/activation <mention|always>",
|
|
223
|
+
"/new or /reset",
|
|
224
|
+
"/abort",
|
|
225
|
+
"/settings",
|
|
226
|
+
"/exit"
|
|
227
|
+
].join("\n");
|
|
228
|
+
}
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/tui/theme/syntax-theme.ts
|
|
231
|
+
/**
|
|
232
|
+
* Syntax highlighting theme for code blocks.
|
|
233
|
+
* Uses chalk functions to style different token types.
|
|
234
|
+
*/
|
|
235
|
+
function createSyntaxTheme(fallback, light = false) {
|
|
236
|
+
if (light) return {
|
|
237
|
+
keyword: chalk.hex("#AF00DB"),
|
|
238
|
+
built_in: chalk.hex("#267F99"),
|
|
239
|
+
type: chalk.hex("#267F99"),
|
|
240
|
+
literal: chalk.hex("#0000FF"),
|
|
241
|
+
number: chalk.hex("#098658"),
|
|
242
|
+
string: chalk.hex("#A31515"),
|
|
243
|
+
regexp: chalk.hex("#811F3F"),
|
|
244
|
+
symbol: chalk.hex("#098658"),
|
|
245
|
+
class: chalk.hex("#267F99"),
|
|
246
|
+
function: chalk.hex("#795E26"),
|
|
247
|
+
title: chalk.hex("#795E26"),
|
|
248
|
+
params: chalk.hex("#001080"),
|
|
249
|
+
comment: chalk.hex("#008000"),
|
|
250
|
+
doctag: chalk.hex("#008000"),
|
|
251
|
+
meta: chalk.hex("#001080"),
|
|
252
|
+
"meta-keyword": chalk.hex("#AF00DB"),
|
|
253
|
+
"meta-string": chalk.hex("#A31515"),
|
|
254
|
+
section: chalk.hex("#795E26"),
|
|
255
|
+
tag: chalk.hex("#800000"),
|
|
256
|
+
name: chalk.hex("#001080"),
|
|
257
|
+
attr: chalk.hex("#C50000"),
|
|
258
|
+
attribute: chalk.hex("#C50000"),
|
|
259
|
+
variable: chalk.hex("#001080"),
|
|
260
|
+
bullet: chalk.hex("#795E26"),
|
|
261
|
+
code: chalk.hex("#A31515"),
|
|
262
|
+
emphasis: chalk.italic,
|
|
263
|
+
strong: chalk.bold,
|
|
264
|
+
formula: chalk.hex("#AF00DB"),
|
|
265
|
+
link: chalk.hex("#267F99"),
|
|
266
|
+
quote: chalk.hex("#008000"),
|
|
267
|
+
addition: chalk.hex("#098658"),
|
|
268
|
+
deletion: chalk.hex("#A31515"),
|
|
269
|
+
"selector-tag": chalk.hex("#800000"),
|
|
270
|
+
"selector-id": chalk.hex("#800000"),
|
|
271
|
+
"selector-class": chalk.hex("#800000"),
|
|
272
|
+
"selector-attr": chalk.hex("#800000"),
|
|
273
|
+
"selector-pseudo": chalk.hex("#800000"),
|
|
274
|
+
"template-tag": chalk.hex("#AF00DB"),
|
|
275
|
+
"template-variable": chalk.hex("#001080"),
|
|
276
|
+
default: fallback
|
|
277
|
+
};
|
|
278
|
+
return {
|
|
279
|
+
keyword: chalk.hex("#C586C0"),
|
|
280
|
+
built_in: chalk.hex("#4EC9B0"),
|
|
281
|
+
type: chalk.hex("#4EC9B0"),
|
|
282
|
+
literal: chalk.hex("#569CD6"),
|
|
283
|
+
number: chalk.hex("#B5CEA8"),
|
|
284
|
+
string: chalk.hex("#CE9178"),
|
|
285
|
+
regexp: chalk.hex("#D16969"),
|
|
286
|
+
symbol: chalk.hex("#B5CEA8"),
|
|
287
|
+
class: chalk.hex("#4EC9B0"),
|
|
288
|
+
function: chalk.hex("#DCDCAA"),
|
|
289
|
+
title: chalk.hex("#DCDCAA"),
|
|
290
|
+
params: chalk.hex("#9CDCFE"),
|
|
291
|
+
comment: chalk.hex("#6A9955"),
|
|
292
|
+
doctag: chalk.hex("#608B4E"),
|
|
293
|
+
meta: chalk.hex("#9CDCFE"),
|
|
294
|
+
"meta-keyword": chalk.hex("#C586C0"),
|
|
295
|
+
"meta-string": chalk.hex("#CE9178"),
|
|
296
|
+
section: chalk.hex("#DCDCAA"),
|
|
297
|
+
tag: chalk.hex("#569CD6"),
|
|
298
|
+
name: chalk.hex("#9CDCFE"),
|
|
299
|
+
attr: chalk.hex("#9CDCFE"),
|
|
300
|
+
attribute: chalk.hex("#9CDCFE"),
|
|
301
|
+
variable: chalk.hex("#9CDCFE"),
|
|
302
|
+
bullet: chalk.hex("#D7BA7D"),
|
|
303
|
+
code: chalk.hex("#CE9178"),
|
|
304
|
+
emphasis: chalk.italic,
|
|
305
|
+
strong: chalk.bold,
|
|
306
|
+
formula: chalk.hex("#C586C0"),
|
|
307
|
+
link: chalk.hex("#4EC9B0"),
|
|
308
|
+
quote: chalk.hex("#6A9955"),
|
|
309
|
+
addition: chalk.hex("#B5CEA8"),
|
|
310
|
+
deletion: chalk.hex("#F44747"),
|
|
311
|
+
"selector-tag": chalk.hex("#D7BA7D"),
|
|
312
|
+
"selector-id": chalk.hex("#D7BA7D"),
|
|
313
|
+
"selector-class": chalk.hex("#D7BA7D"),
|
|
314
|
+
"selector-attr": chalk.hex("#D7BA7D"),
|
|
315
|
+
"selector-pseudo": chalk.hex("#D7BA7D"),
|
|
316
|
+
"template-tag": chalk.hex("#C586C0"),
|
|
317
|
+
"template-variable": chalk.hex("#9CDCFE"),
|
|
318
|
+
default: fallback
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
//#endregion
|
|
322
|
+
//#region src/tui/theme/theme.ts
|
|
323
|
+
const DARK_TEXT = "#E8E3D5";
|
|
324
|
+
const LIGHT_TEXT = "#1E1E1E";
|
|
325
|
+
const XTERM_LEVELS = [
|
|
326
|
+
0,
|
|
327
|
+
95,
|
|
328
|
+
135,
|
|
329
|
+
175,
|
|
330
|
+
215,
|
|
331
|
+
255
|
|
332
|
+
];
|
|
333
|
+
function channelToSrgb(value) {
|
|
334
|
+
const normalized = value / 255;
|
|
335
|
+
return normalized <= .03928 ? normalized / 12.92 : ((normalized + .055) / 1.055) ** 2.4;
|
|
336
|
+
}
|
|
337
|
+
function relativeLuminanceRgb(r, g, b) {
|
|
338
|
+
const red = channelToSrgb(r);
|
|
339
|
+
const green = channelToSrgb(g);
|
|
340
|
+
const blue = channelToSrgb(b);
|
|
341
|
+
return .2126 * red + .7152 * green + .0722 * blue;
|
|
342
|
+
}
|
|
343
|
+
function relativeLuminanceHex(hex) {
|
|
344
|
+
return relativeLuminanceRgb(Number.parseInt(hex.slice(1, 3), 16), Number.parseInt(hex.slice(3, 5), 16), Number.parseInt(hex.slice(5, 7), 16));
|
|
345
|
+
}
|
|
346
|
+
function contrastRatio(background, foregroundHex) {
|
|
347
|
+
const foreground = relativeLuminanceHex(foregroundHex);
|
|
348
|
+
const lighter = Math.max(background, foreground);
|
|
349
|
+
const darker = Math.min(background, foreground);
|
|
350
|
+
return (lighter + .05) / (darker + .05);
|
|
351
|
+
}
|
|
352
|
+
function pickHigherContrastText(r, g, b) {
|
|
353
|
+
const background = relativeLuminanceRgb(r, g, b);
|
|
354
|
+
return contrastRatio(background, LIGHT_TEXT) >= contrastRatio(background, DARK_TEXT);
|
|
355
|
+
}
|
|
356
|
+
function isLightBackground() {
|
|
357
|
+
const explicit = normalizeOptionalLowercaseString(process.env.KAIJIBOT_THEME);
|
|
358
|
+
if (explicit === "light") return true;
|
|
359
|
+
if (explicit === "dark") return false;
|
|
360
|
+
const colorfgbg = process.env.COLORFGBG;
|
|
361
|
+
if (colorfgbg && colorfgbg.length <= 64) {
|
|
362
|
+
const sep = colorfgbg.lastIndexOf(";");
|
|
363
|
+
const bg = Number.parseInt(sep >= 0 ? colorfgbg.slice(sep + 1) : colorfgbg, 10);
|
|
364
|
+
if (bg >= 0 && bg <= 255) {
|
|
365
|
+
if (bg <= 15) return bg === 7 || bg === 15;
|
|
366
|
+
if (bg >= 232) return bg >= 244;
|
|
367
|
+
const cubeIndex = bg - 16;
|
|
368
|
+
const bVal = XTERM_LEVELS[cubeIndex % 6];
|
|
369
|
+
const gVal = XTERM_LEVELS[Math.floor(cubeIndex / 6) % 6];
|
|
370
|
+
const rVal = XTERM_LEVELS[Math.floor(cubeIndex / 36)];
|
|
371
|
+
return pickHigherContrastText(rVal, gVal, bVal);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return false;
|
|
375
|
+
}
|
|
376
|
+
/** Whether the terminal has a light background. Exported for testing only. */
|
|
377
|
+
const lightMode = isLightBackground();
|
|
378
|
+
const palette = lightMode ? {
|
|
379
|
+
text: "#1E1E1E",
|
|
380
|
+
dim: "#5B6472",
|
|
381
|
+
accent: "#B45309",
|
|
382
|
+
accentSoft: "#C2410C",
|
|
383
|
+
border: "#5B6472",
|
|
384
|
+
userBg: "#F3F0E8",
|
|
385
|
+
userText: "#1E1E1E",
|
|
386
|
+
systemText: "#4B5563",
|
|
387
|
+
toolPendingBg: "#EFF6FF",
|
|
388
|
+
toolSuccessBg: "#ECFDF5",
|
|
389
|
+
toolErrorBg: "#FEF2F2",
|
|
390
|
+
toolTitle: "#B45309",
|
|
391
|
+
toolOutput: "#374151",
|
|
392
|
+
quote: "#1D4ED8",
|
|
393
|
+
quoteBorder: "#2563EB",
|
|
394
|
+
code: "#92400E",
|
|
395
|
+
codeBlock: "#F9FAFB",
|
|
396
|
+
codeBorder: "#92400E",
|
|
397
|
+
link: "#047857",
|
|
398
|
+
error: "#DC2626",
|
|
399
|
+
success: "#047857"
|
|
400
|
+
} : {
|
|
401
|
+
text: "#E8E3D5",
|
|
402
|
+
dim: "#7B7F87",
|
|
403
|
+
accent: "#F6C453",
|
|
404
|
+
accentSoft: "#F2A65A",
|
|
405
|
+
border: "#3C414B",
|
|
406
|
+
userBg: "#2B2F36",
|
|
407
|
+
userText: "#F3EEE0",
|
|
408
|
+
systemText: "#9BA3B2",
|
|
409
|
+
toolPendingBg: "#1F2A2F",
|
|
410
|
+
toolSuccessBg: "#1E2D23",
|
|
411
|
+
toolErrorBg: "#2F1F1F",
|
|
412
|
+
toolTitle: "#F6C453",
|
|
413
|
+
toolOutput: "#E1DACB",
|
|
414
|
+
quote: "#8CC8FF",
|
|
415
|
+
quoteBorder: "#3B4D6B",
|
|
416
|
+
code: "#F0C987",
|
|
417
|
+
codeBlock: "#1E232A",
|
|
418
|
+
codeBorder: "#343A45",
|
|
419
|
+
link: "#7DD3A5",
|
|
420
|
+
error: "#F97066",
|
|
421
|
+
success: "#7DD3A5"
|
|
422
|
+
};
|
|
423
|
+
const fg = (hex) => (text) => chalk.hex(hex)(text);
|
|
424
|
+
const bg = (hex) => (text) => chalk.bgHex(hex)(text);
|
|
425
|
+
const syntaxTheme = createSyntaxTheme(fg(palette.code), lightMode);
|
|
426
|
+
/**
|
|
427
|
+
* Highlight code with syntax coloring.
|
|
428
|
+
* Returns an array of lines with ANSI escape codes.
|
|
429
|
+
*/
|
|
430
|
+
function highlightCode(code, lang) {
|
|
431
|
+
try {
|
|
432
|
+
return highlight(code, {
|
|
433
|
+
language: lang && supportsLanguage(lang) ? lang : void 0,
|
|
434
|
+
theme: syntaxTheme,
|
|
435
|
+
ignoreIllegals: true
|
|
436
|
+
}).split("\n");
|
|
437
|
+
} catch {
|
|
438
|
+
return code.split("\n").map((line) => fg(palette.code)(line));
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
const theme = {
|
|
442
|
+
fg: fg(palette.text),
|
|
443
|
+
assistantText: (text) => text,
|
|
444
|
+
dim: fg(palette.dim),
|
|
445
|
+
accent: fg(palette.accent),
|
|
446
|
+
accentSoft: fg(palette.accentSoft),
|
|
447
|
+
success: fg(palette.success),
|
|
448
|
+
error: fg(palette.error),
|
|
449
|
+
header: (text) => chalk.bold(fg(palette.accent)(text)),
|
|
450
|
+
system: fg(palette.systemText),
|
|
451
|
+
userBg: bg(palette.userBg),
|
|
452
|
+
userText: fg(palette.userText),
|
|
453
|
+
toolTitle: fg(palette.toolTitle),
|
|
454
|
+
toolOutput: fg(palette.toolOutput),
|
|
455
|
+
toolPendingBg: bg(palette.toolPendingBg),
|
|
456
|
+
toolSuccessBg: bg(palette.toolSuccessBg),
|
|
457
|
+
toolErrorBg: bg(palette.toolErrorBg),
|
|
458
|
+
border: fg(palette.border),
|
|
459
|
+
bold: (text) => chalk.bold(text),
|
|
460
|
+
italic: (text) => chalk.italic(text)
|
|
461
|
+
};
|
|
462
|
+
const markdownTheme = {
|
|
463
|
+
heading: (text) => chalk.bold(fg(palette.accent)(text)),
|
|
464
|
+
link: (text) => fg(palette.link)(text),
|
|
465
|
+
linkUrl: (text) => chalk.dim(text),
|
|
466
|
+
code: (text) => fg(palette.code)(text),
|
|
467
|
+
codeBlock: (text) => fg(palette.code)(text),
|
|
468
|
+
codeBlockBorder: (text) => fg(palette.codeBorder)(text),
|
|
469
|
+
quote: (text) => fg(palette.quote)(text),
|
|
470
|
+
quoteBorder: (text) => fg(palette.quoteBorder)(text),
|
|
471
|
+
hr: (text) => fg(palette.border)(text),
|
|
472
|
+
listBullet: (text) => fg(palette.accentSoft)(text),
|
|
473
|
+
bold: (text) => chalk.bold(text),
|
|
474
|
+
italic: (text) => chalk.italic(text),
|
|
475
|
+
strikethrough: (text) => chalk.strikethrough(text),
|
|
476
|
+
underline: (text) => chalk.underline(text),
|
|
477
|
+
highlightCode
|
|
478
|
+
};
|
|
479
|
+
const baseSelectListTheme = {
|
|
480
|
+
selectedPrefix: (text) => fg(palette.accent)(text),
|
|
481
|
+
selectedText: (text) => chalk.bold(fg(palette.accent)(text)),
|
|
482
|
+
description: (text) => fg(palette.dim)(text),
|
|
483
|
+
scrollInfo: (text) => fg(palette.dim)(text),
|
|
484
|
+
noMatch: (text) => fg(palette.dim)(text)
|
|
485
|
+
};
|
|
486
|
+
const selectListTheme = baseSelectListTheme;
|
|
487
|
+
const filterableSelectListTheme = {
|
|
488
|
+
...baseSelectListTheme,
|
|
489
|
+
filterLabel: (text) => fg(palette.dim)(text)
|
|
490
|
+
};
|
|
491
|
+
const settingsListTheme = {
|
|
492
|
+
label: (text, selected) => selected ? chalk.bold(fg(palette.accent)(text)) : fg(palette.text)(text),
|
|
493
|
+
value: (text, selected) => selected ? fg(palette.accentSoft)(text) : fg(palette.dim)(text),
|
|
494
|
+
description: (text) => fg(palette.systemText)(text),
|
|
495
|
+
cursor: fg(palette.accent)("→ "),
|
|
496
|
+
hint: (text) => fg(palette.dim)(text)
|
|
497
|
+
};
|
|
498
|
+
const editorTheme = {
|
|
499
|
+
borderColor: (text) => fg(palette.border)(text),
|
|
500
|
+
selectList: selectListTheme
|
|
501
|
+
};
|
|
502
|
+
const searchableSelectListTheme = {
|
|
503
|
+
...baseSelectListTheme,
|
|
504
|
+
searchPrompt: (text) => fg(palette.accentSoft)(text),
|
|
505
|
+
searchInput: (text) => fg(palette.text)(text),
|
|
506
|
+
matchHighlight: (text) => chalk.bold(fg(palette.accent)(text))
|
|
507
|
+
};
|
|
508
|
+
//#endregion
|
|
509
|
+
//#region src/tui/osc8-hyperlinks.ts
|
|
510
|
+
const SGR_PATTERN = "\\x1b\\[[0-9;]*m";
|
|
511
|
+
const OSC8_PATTERN = "\\x1b\\]8;;.*?(?:\\x07|\\x1b\\\\)";
|
|
512
|
+
const ANSI_RE = new RegExp(`${SGR_PATTERN}|${OSC8_PATTERN}`, "g");
|
|
513
|
+
const SGR_START_RE = new RegExp(`^${SGR_PATTERN}`);
|
|
514
|
+
const OSC8_START_RE = new RegExp(`^${OSC8_PATTERN}`);
|
|
515
|
+
/**
|
|
516
|
+
* Extract all unique URLs from raw markdown text.
|
|
517
|
+
* Finds both bare URLs and markdown link hrefs [text](url).
|
|
518
|
+
*/
|
|
519
|
+
function extractUrls(markdown) {
|
|
520
|
+
const urls = /* @__PURE__ */ new Set();
|
|
521
|
+
const mdLinkRe = /\[(?:[^\]]*)\]\(\s*<?(https?:\/\/[^)\s>]+)>?(?:\s+["'][^"']*["'])?\s*\)/g;
|
|
522
|
+
let m;
|
|
523
|
+
while ((m = mdLinkRe.exec(markdown)) !== null) urls.add(m[1]);
|
|
524
|
+
const stripped = markdown.replace(/\[(?:[^\]]*)\]\(\s*<?https?:\/\/[^)\s>]+>?(?:\s+["'][^"']*["'])?\s*\)/g, "");
|
|
525
|
+
const bareRe = /https?:\/\/[^\s)\]>]+/g;
|
|
526
|
+
while ((m = bareRe.exec(stripped)) !== null) urls.add(m[0]);
|
|
527
|
+
return [...urls];
|
|
528
|
+
}
|
|
529
|
+
/** Strip ANSI SGR and OSC 8 sequences to get visible text. */
|
|
530
|
+
function stripAnsi(input) {
|
|
531
|
+
return input.replace(ANSI_RE, "");
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Find URL ranges in a line's visible text, handling cross-line URL splits.
|
|
535
|
+
*/
|
|
536
|
+
function findUrlRanges(visibleText, knownUrls, pending) {
|
|
537
|
+
const ranges = [];
|
|
538
|
+
let newPending = null;
|
|
539
|
+
let searchFrom = 0;
|
|
540
|
+
if (pending) {
|
|
541
|
+
const remaining = pending.url.slice(pending.consumed);
|
|
542
|
+
const trimmed = visibleText.trimStart();
|
|
543
|
+
const leadingSpaces = visibleText.length - trimmed.length;
|
|
544
|
+
let matchLen = 0;
|
|
545
|
+
for (let j = 0; j < remaining.length && j < trimmed.length; j++) if (remaining[j] === trimmed[j]) matchLen++;
|
|
546
|
+
else break;
|
|
547
|
+
if (matchLen > 0) {
|
|
548
|
+
ranges.push({
|
|
549
|
+
start: leadingSpaces,
|
|
550
|
+
end: leadingSpaces + matchLen,
|
|
551
|
+
url: pending.url
|
|
552
|
+
});
|
|
553
|
+
searchFrom = leadingSpaces + matchLen;
|
|
554
|
+
if (pending.consumed + matchLen < pending.url.length) newPending = {
|
|
555
|
+
url: pending.url,
|
|
556
|
+
consumed: pending.consumed + matchLen
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
const urlRe = /https?:\/\/[^\s)\]>]+/g;
|
|
561
|
+
urlRe.lastIndex = searchFrom;
|
|
562
|
+
let match;
|
|
563
|
+
while ((match = urlRe.exec(visibleText)) !== null) {
|
|
564
|
+
const fragment = match[0];
|
|
565
|
+
const start = match.index;
|
|
566
|
+
let resolvedUrl = fragment;
|
|
567
|
+
let found = false;
|
|
568
|
+
for (const known of knownUrls) if (known === fragment) {
|
|
569
|
+
resolvedUrl = known;
|
|
570
|
+
found = true;
|
|
571
|
+
break;
|
|
572
|
+
}
|
|
573
|
+
if (!found) {
|
|
574
|
+
let bestLen = 0;
|
|
575
|
+
for (const known of knownUrls) if (known.startsWith(fragment) && known.length > bestLen) {
|
|
576
|
+
resolvedUrl = known;
|
|
577
|
+
bestLen = known.length;
|
|
578
|
+
found = true;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
if (!found) {
|
|
582
|
+
let bestLen = 0;
|
|
583
|
+
for (const known of knownUrls) if (fragment.startsWith(known) && known.length > bestLen) {
|
|
584
|
+
resolvedUrl = known;
|
|
585
|
+
bestLen = known.length;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
ranges.push({
|
|
589
|
+
start,
|
|
590
|
+
end: start + fragment.length,
|
|
591
|
+
url: resolvedUrl
|
|
592
|
+
});
|
|
593
|
+
if (resolvedUrl.length > fragment.length && resolvedUrl.startsWith(fragment)) newPending = {
|
|
594
|
+
url: resolvedUrl,
|
|
595
|
+
consumed: fragment.length
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
return {
|
|
599
|
+
ranges,
|
|
600
|
+
pending: newPending
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Apply OSC 8 hyperlink sequences to a line based on visible-text URL ranges.
|
|
605
|
+
* Walks through the raw string character by character, inserting OSC 8
|
|
606
|
+
* open/close sequences at URL range boundaries while preserving ANSI codes.
|
|
607
|
+
*/
|
|
608
|
+
function applyOsc8Ranges(line, ranges) {
|
|
609
|
+
if (ranges.length === 0) return line;
|
|
610
|
+
const urlAt = /* @__PURE__ */ new Map();
|
|
611
|
+
for (const r of ranges) for (let p = r.start; p < r.end; p++) urlAt.set(p, r.url);
|
|
612
|
+
let result = "";
|
|
613
|
+
let visiblePos = 0;
|
|
614
|
+
let activeUrl = null;
|
|
615
|
+
let i = 0;
|
|
616
|
+
while (i < line.length) {
|
|
617
|
+
if (line.charCodeAt(i) === 27) {
|
|
618
|
+
const sgr = line.slice(i).match(SGR_START_RE);
|
|
619
|
+
if (sgr) {
|
|
620
|
+
result += sgr[0];
|
|
621
|
+
i += sgr[0].length;
|
|
622
|
+
continue;
|
|
623
|
+
}
|
|
624
|
+
const osc = line.slice(i).match(OSC8_START_RE);
|
|
625
|
+
if (osc) {
|
|
626
|
+
result += osc[0];
|
|
627
|
+
i += osc[0].length;
|
|
628
|
+
continue;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
const targetUrl = urlAt.get(visiblePos) ?? null;
|
|
632
|
+
if (targetUrl !== activeUrl) {
|
|
633
|
+
if (activeUrl !== null) result += "\x1B]8;;\x07";
|
|
634
|
+
if (targetUrl !== null) result += `\x1b]8;;${targetUrl}\x07`;
|
|
635
|
+
activeUrl = targetUrl;
|
|
636
|
+
}
|
|
637
|
+
result += line[i];
|
|
638
|
+
visiblePos++;
|
|
639
|
+
i++;
|
|
640
|
+
}
|
|
641
|
+
if (activeUrl !== null) result += "\x1B]8;;\x07";
|
|
642
|
+
return result;
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* Add OSC 8 hyperlinks to rendered lines using a pre-extracted URL list.
|
|
646
|
+
*
|
|
647
|
+
* For each line, finds URL-like substrings in the visible text, matches them
|
|
648
|
+
* against known URLs, and wraps each fragment with OSC 8 escape sequences.
|
|
649
|
+
* Handles URLs broken across multiple lines by pi-tui's word wrapping.
|
|
650
|
+
*/
|
|
651
|
+
function addOsc8Hyperlinks(lines, urls) {
|
|
652
|
+
if (urls.length === 0) return lines;
|
|
653
|
+
let pending = null;
|
|
654
|
+
return lines.map((line) => {
|
|
655
|
+
const result = findUrlRanges(stripAnsi(line), urls, pending);
|
|
656
|
+
pending = result.pending;
|
|
657
|
+
return applyOsc8Ranges(line, result.ranges);
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
//#endregion
|
|
661
|
+
//#region src/tui/components/hyperlink-markdown.ts
|
|
662
|
+
/**
|
|
663
|
+
* Wrapper around pi-tui's Markdown component that adds OSC 8 terminal
|
|
664
|
+
* hyperlinks to rendered output, making URLs clickable even when broken
|
|
665
|
+
* across multiple lines by word wrapping.
|
|
666
|
+
*/
|
|
667
|
+
var HyperlinkMarkdown = class {
|
|
668
|
+
constructor(text, paddingX, paddingY, theme, options) {
|
|
669
|
+
this.inner = new Markdown(text, paddingX, paddingY, theme, options);
|
|
670
|
+
this.urls = extractUrls(text);
|
|
671
|
+
}
|
|
672
|
+
render(width) {
|
|
673
|
+
return addOsc8Hyperlinks(this.inner.render(width), this.urls);
|
|
674
|
+
}
|
|
675
|
+
setText(text) {
|
|
676
|
+
this.inner.setText(text);
|
|
677
|
+
this.urls = extractUrls(text);
|
|
678
|
+
}
|
|
679
|
+
invalidate() {
|
|
680
|
+
this.inner.invalidate();
|
|
681
|
+
}
|
|
682
|
+
};
|
|
683
|
+
//#endregion
|
|
684
|
+
//#region src/tui/components/assistant-message.ts
|
|
685
|
+
var AssistantMessageComponent = class extends Container {
|
|
686
|
+
constructor(text) {
|
|
687
|
+
super();
|
|
688
|
+
this.body = new HyperlinkMarkdown(text, 0, 0, markdownTheme, { color: (line) => theme.assistantText(line) });
|
|
689
|
+
this.addChild(new Spacer(1));
|
|
690
|
+
this.addChild(this.body);
|
|
691
|
+
}
|
|
692
|
+
setText(text) {
|
|
693
|
+
this.body.setText(text);
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
//#endregion
|
|
697
|
+
//#region src/tui/components/btw-inline-message.ts
|
|
698
|
+
var BtwInlineMessage = class extends Container {
|
|
699
|
+
constructor(params) {
|
|
700
|
+
super();
|
|
701
|
+
this.setResult(params);
|
|
702
|
+
}
|
|
703
|
+
setResult(params) {
|
|
704
|
+
this.clear();
|
|
705
|
+
this.addChild(new Spacer(1));
|
|
706
|
+
this.addChild(new Text(theme.header(`BTW: ${params.question}`), 1, 0));
|
|
707
|
+
if (params.isError) this.addChild(new Text(theme.error(params.text), 1, 0));
|
|
708
|
+
else this.addChild(new AssistantMessageComponent(params.text));
|
|
709
|
+
this.addChild(new Text(theme.dim("Press Enter or Esc to dismiss"), 1, 0));
|
|
710
|
+
}
|
|
711
|
+
};
|
|
712
|
+
//#endregion
|
|
713
|
+
//#region src/tui/tui-formatters.ts
|
|
714
|
+
const REPLACEMENT_CHAR_RE = /\uFFFD/g;
|
|
715
|
+
const MAX_TOKEN_CHARS = 32;
|
|
716
|
+
const LONG_TOKEN_RE = /\S{33,}/g;
|
|
717
|
+
const LONG_TOKEN_TEST_RE = /\S{33,}/;
|
|
718
|
+
const BINARY_LINE_REPLACEMENT_THRESHOLD = 12;
|
|
719
|
+
const URL_PREFIX_RE = /^(https?:\/\/|file:\/\/)/i;
|
|
720
|
+
const WINDOWS_DRIVE_RE = /^[a-zA-Z]:[\\/]/;
|
|
721
|
+
const FILE_LIKE_RE = /^[a-zA-Z0-9._-]+$/;
|
|
722
|
+
const EDGE_PUNCTUATION_RE = /^[`"'([{<]+|[`"')\]}>.,:;!?]+$/g;
|
|
723
|
+
const TOKENISH_MIN_LENGTH = 24;
|
|
724
|
+
const RTL_SCRIPT_RE = /[\u0590-\u08ff\ufb1d-\ufdff\ufe70-\ufefc]/;
|
|
725
|
+
const BIDI_CONTROL_RE = /[\u202a-\u202e\u2066-\u2069]/;
|
|
726
|
+
const RTL_ISOLATE_START = "";
|
|
727
|
+
const RTL_ISOLATE_END = "";
|
|
728
|
+
function hasControlChars(text) {
|
|
729
|
+
for (const char of text) {
|
|
730
|
+
const code = char.charCodeAt(0);
|
|
731
|
+
if (code <= 31 && code !== 9 && code !== 10 && code !== 13 || code >= 127 && code <= 159) return true;
|
|
732
|
+
}
|
|
733
|
+
return false;
|
|
734
|
+
}
|
|
735
|
+
function stripControlChars(text) {
|
|
736
|
+
if (!hasControlChars(text)) return text;
|
|
737
|
+
let sanitized = "";
|
|
738
|
+
for (const char of text) {
|
|
739
|
+
const code = char.charCodeAt(0);
|
|
740
|
+
if (!(code <= 31 && code !== 9 && code !== 10 && code !== 13) && !(code >= 127 && code <= 159)) sanitized += char;
|
|
741
|
+
}
|
|
742
|
+
return sanitized;
|
|
743
|
+
}
|
|
744
|
+
function chunkToken(token, maxChars) {
|
|
745
|
+
if (token.length <= maxChars) return [token];
|
|
746
|
+
const chunks = [];
|
|
747
|
+
for (let i = 0; i < token.length; i += maxChars) chunks.push(token.slice(i, i + maxChars));
|
|
748
|
+
return chunks;
|
|
749
|
+
}
|
|
750
|
+
function isCopySensitiveToken(token) {
|
|
751
|
+
const candidate = token.replace(EDGE_PUNCTUATION_RE, "") || token;
|
|
752
|
+
if (URL_PREFIX_RE.test(token)) return true;
|
|
753
|
+
if (token.startsWith("/") || token.startsWith("~/") || token.startsWith("./") || token.startsWith("../")) return true;
|
|
754
|
+
if (WINDOWS_DRIVE_RE.test(token) || token.startsWith("\\\\")) return true;
|
|
755
|
+
if (token.includes("/") || token.includes("\\")) return true;
|
|
756
|
+
if (token.includes("_") && FILE_LIKE_RE.test(token)) return true;
|
|
757
|
+
if (candidate.length >= TOKENISH_MIN_LENGTH && /[a-z]/i.test(candidate) && /\d/.test(candidate)) return true;
|
|
758
|
+
return false;
|
|
759
|
+
}
|
|
760
|
+
function normalizeLongTokenForDisplay(token) {
|
|
761
|
+
if (isCopySensitiveToken(token)) return token;
|
|
762
|
+
return chunkToken(token, MAX_TOKEN_CHARS).join(" ");
|
|
763
|
+
}
|
|
764
|
+
function redactBinaryLikeLine(line) {
|
|
765
|
+
const replacementCount = (line.match(REPLACEMENT_CHAR_RE) || []).length;
|
|
766
|
+
if (replacementCount >= BINARY_LINE_REPLACEMENT_THRESHOLD && replacementCount * 2 >= line.length) return "[binary data omitted]";
|
|
767
|
+
return line;
|
|
768
|
+
}
|
|
769
|
+
function isolateRtlLine(line) {
|
|
770
|
+
if (!RTL_SCRIPT_RE.test(line) || BIDI_CONTROL_RE.test(line)) return line;
|
|
771
|
+
return `${RTL_ISOLATE_START}${line}${RTL_ISOLATE_END}`;
|
|
772
|
+
}
|
|
773
|
+
function applyRtlIsolation(text) {
|
|
774
|
+
if (!RTL_SCRIPT_RE.test(text)) return text;
|
|
775
|
+
return text.split("\n").map((line) => isolateRtlLine(line)).join("\n");
|
|
776
|
+
}
|
|
777
|
+
function sanitizeRenderableText(text) {
|
|
778
|
+
if (!text) return text;
|
|
779
|
+
const hasAnsi = text.includes("\x1B");
|
|
780
|
+
const hasReplacementChars = text.includes("�");
|
|
781
|
+
const hasLongTokens = LONG_TOKEN_TEST_RE.test(text);
|
|
782
|
+
const hasControls = hasControlChars(text);
|
|
783
|
+
if (!hasAnsi && !hasReplacementChars && !hasLongTokens && !hasControls) return applyRtlIsolation(text);
|
|
784
|
+
const withoutAnsi = hasAnsi ? stripAnsi$1(text) : text;
|
|
785
|
+
const withoutControlChars = hasControls ? stripControlChars(withoutAnsi) : withoutAnsi;
|
|
786
|
+
const redacted = hasReplacementChars ? withoutControlChars.split("\n").map((line) => redactBinaryLikeLine(line)).join("\n") : withoutControlChars;
|
|
787
|
+
return applyRtlIsolation(LONG_TOKEN_TEST_RE.test(redacted) ? redacted.replace(LONG_TOKEN_RE, normalizeLongTokenForDisplay) : redacted);
|
|
788
|
+
}
|
|
789
|
+
function resolveFinalAssistantText(params) {
|
|
790
|
+
const finalText = params.finalText ?? "";
|
|
791
|
+
if (finalText.trim()) return finalText;
|
|
792
|
+
const streamedText = params.streamedText ?? "";
|
|
793
|
+
if (streamedText.trim()) return streamedText;
|
|
794
|
+
const errorMessage = params.errorMessage ?? "";
|
|
795
|
+
if (errorMessage.trim()) return formatRawAssistantErrorForUi(errorMessage);
|
|
796
|
+
return "(no output)";
|
|
797
|
+
}
|
|
798
|
+
function composeThinkingAndContent(params) {
|
|
799
|
+
const thinkingText = params.thinkingText?.trim() ?? "";
|
|
800
|
+
const contentText = params.contentText?.trim() ?? "";
|
|
801
|
+
const parts = [];
|
|
802
|
+
if (params.showThinking && thinkingText) parts.push(`[thinking]\n${thinkingText}`);
|
|
803
|
+
if (contentText) parts.push(contentText);
|
|
804
|
+
return parts.join("\n\n").trim();
|
|
805
|
+
}
|
|
806
|
+
function asMessageRecord(message) {
|
|
807
|
+
if (!message || typeof message !== "object") return;
|
|
808
|
+
return message;
|
|
809
|
+
}
|
|
810
|
+
function resolveMessageRecord(message) {
|
|
811
|
+
const record = asMessageRecord(message);
|
|
812
|
+
if (!record) return;
|
|
813
|
+
return {
|
|
814
|
+
record,
|
|
815
|
+
content: record.content
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
function formatAssistantErrorFromRecord(record) {
|
|
819
|
+
if ((typeof record.stopReason === "string" ? record.stopReason : "") !== "error") return "";
|
|
820
|
+
return formatRawAssistantErrorForUi(typeof record.errorMessage === "string" ? record.errorMessage : "");
|
|
821
|
+
}
|
|
822
|
+
function collectSanitizedBlockStrings(params) {
|
|
823
|
+
if (!Array.isArray(params.content)) return [];
|
|
824
|
+
const parts = [];
|
|
825
|
+
for (const block of params.content) {
|
|
826
|
+
if (!block || typeof block !== "object") continue;
|
|
827
|
+
const rec = block;
|
|
828
|
+
if (rec.type === params.blockType && typeof rec[params.valueKey] === "string") parts.push(sanitizeRenderableText(rec[params.valueKey]));
|
|
829
|
+
}
|
|
830
|
+
return parts;
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Extract ONLY thinking blocks from message content.
|
|
834
|
+
* Model-agnostic: returns empty string if no thinking blocks exist.
|
|
835
|
+
*/
|
|
836
|
+
function extractThinkingFromMessage(message) {
|
|
837
|
+
const resolved = resolveMessageRecord(message);
|
|
838
|
+
if (!resolved) return "";
|
|
839
|
+
const { content } = resolved;
|
|
840
|
+
if (typeof content === "string") return "";
|
|
841
|
+
return collectSanitizedBlockStrings({
|
|
842
|
+
content,
|
|
843
|
+
blockType: "thinking",
|
|
844
|
+
valueKey: "thinking"
|
|
845
|
+
}).join("\n").trim();
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* Extract ONLY text content blocks from message (excludes thinking).
|
|
849
|
+
* Model-agnostic: works for any model with text content blocks.
|
|
850
|
+
*/
|
|
851
|
+
function extractContentFromMessage(message) {
|
|
852
|
+
const resolved = resolveMessageRecord(message);
|
|
853
|
+
if (!resolved) return "";
|
|
854
|
+
const { record, content } = resolved;
|
|
855
|
+
if (record.role === "assistant") {
|
|
856
|
+
if (typeof content === "string") return sanitizeRenderableText(content).trim();
|
|
857
|
+
if (Array.isArray(content)) return extractAssistantRenderableContent(record);
|
|
858
|
+
}
|
|
859
|
+
if (typeof content === "string") return sanitizeRenderableText(content).trim();
|
|
860
|
+
const parts = collectSanitizedBlockStrings({
|
|
861
|
+
content,
|
|
862
|
+
blockType: "text",
|
|
863
|
+
valueKey: "text"
|
|
864
|
+
});
|
|
865
|
+
if (parts.length > 0) return parts.join("\n").trim();
|
|
866
|
+
return formatAssistantErrorFromRecord(record);
|
|
867
|
+
}
|
|
868
|
+
function extractAssistantRenderableContent(record) {
|
|
869
|
+
const visible = sanitizeRenderableText(extractAssistantVisibleText(record) ?? "").trim();
|
|
870
|
+
if (visible) return visible;
|
|
871
|
+
return formatAssistantErrorFromRecord(record);
|
|
872
|
+
}
|
|
873
|
+
function extractTextBlocks(content, opts) {
|
|
874
|
+
if (typeof content === "string") return sanitizeRenderableText(content).trim();
|
|
875
|
+
if (!Array.isArray(content)) return "";
|
|
876
|
+
const textParts = collectSanitizedBlockStrings({
|
|
877
|
+
content,
|
|
878
|
+
blockType: "text",
|
|
879
|
+
valueKey: "text"
|
|
880
|
+
});
|
|
881
|
+
return composeThinkingAndContent({
|
|
882
|
+
thinkingText: (opts?.includeThinking === true ? collectSanitizedBlockStrings({
|
|
883
|
+
content,
|
|
884
|
+
blockType: "thinking",
|
|
885
|
+
valueKey: "thinking"
|
|
886
|
+
}) : []).join("\n").trim(),
|
|
887
|
+
contentText: textParts.join("\n").trim(),
|
|
888
|
+
showThinking: opts?.includeThinking ?? false
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
function extractTextFromMessage(message, opts) {
|
|
892
|
+
const record = asMessageRecord(message);
|
|
893
|
+
if (!record) return "";
|
|
894
|
+
if (record.role === "assistant") return composeThinkingAndContent({
|
|
895
|
+
thinkingText: extractThinkingFromMessage(record),
|
|
896
|
+
contentText: extractAssistantRenderableContent(record),
|
|
897
|
+
showThinking: opts?.includeThinking ?? false
|
|
898
|
+
});
|
|
899
|
+
const text = extractTextBlocks(record.content, opts);
|
|
900
|
+
if (text) {
|
|
901
|
+
if (record.role === "user" || record.command === true) return stripLeadingInboundMetadata(text);
|
|
902
|
+
return text;
|
|
903
|
+
}
|
|
904
|
+
const errorText = formatAssistantErrorFromRecord(record);
|
|
905
|
+
if (!errorText) return "";
|
|
906
|
+
return errorText;
|
|
907
|
+
}
|
|
908
|
+
function isCommandMessage(message) {
|
|
909
|
+
if (!message || typeof message !== "object") return false;
|
|
910
|
+
return message.command === true;
|
|
911
|
+
}
|
|
912
|
+
function formatTokens(total, context) {
|
|
913
|
+
if (total == null && context == null) return "tokens ?";
|
|
914
|
+
const totalLabel = total == null ? "?" : formatTokenCount(total);
|
|
915
|
+
if (context == null) return `tokens ${totalLabel}`;
|
|
916
|
+
const pct = typeof total === "number" && context > 0 ? Math.min(999, Math.round(total / context * 100)) : null;
|
|
917
|
+
return `tokens ${totalLabel}/${formatTokenCount(context)}${pct !== null ? ` (${pct}%)` : ""}`;
|
|
918
|
+
}
|
|
919
|
+
function formatContextUsageLine(params) {
|
|
920
|
+
const totalLabel = typeof params.total === "number" ? formatTokenCount(params.total) : "?";
|
|
921
|
+
const ctxLabel = typeof params.context === "number" ? formatTokenCount(params.context) : "?";
|
|
922
|
+
const pct = typeof params.percent === "number" ? Math.min(999, Math.round(params.percent)) : null;
|
|
923
|
+
const extra = [typeof params.remaining === "number" ? `${formatTokenCount(params.remaining)} left` : null, pct !== null ? `${pct}%` : null].filter(Boolean).join(", ");
|
|
924
|
+
return `tokens ${totalLabel}/${ctxLabel}${extra ? ` (${extra})` : ""}`;
|
|
925
|
+
}
|
|
926
|
+
function asString(value, fallback = "") {
|
|
927
|
+
if (typeof value === "string") return value;
|
|
928
|
+
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
929
|
+
return fallback;
|
|
930
|
+
}
|
|
931
|
+
//#endregion
|
|
932
|
+
//#region src/tui/components/tool-execution.ts
|
|
933
|
+
function formatArgs(toolName, args) {
|
|
934
|
+
const detail = formatToolDetail(resolveToolDisplay({
|
|
935
|
+
name: toolName,
|
|
936
|
+
args
|
|
937
|
+
}));
|
|
938
|
+
if (detail) return sanitizeRenderableText(detail);
|
|
939
|
+
if (!args || typeof args !== "object") return "";
|
|
940
|
+
try {
|
|
941
|
+
return sanitizeRenderableText(JSON.stringify(args));
|
|
942
|
+
} catch {
|
|
943
|
+
return "";
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
function extractText(result) {
|
|
947
|
+
if (!result?.content) return "";
|
|
948
|
+
const lines = [];
|
|
949
|
+
for (const entry of result.content) if (entry.type === "text" && entry.text) lines.push(sanitizeRenderableText(entry.text));
|
|
950
|
+
else if (entry.type === "image") {
|
|
951
|
+
const mime = entry.mimeType ?? "image";
|
|
952
|
+
const size = entry.bytes ? ` ${Math.round(entry.bytes / 1024)}kb` : "";
|
|
953
|
+
const omitted = entry.omitted ? " (omitted)" : "";
|
|
954
|
+
lines.push(`[${mime}${size}${omitted}]`);
|
|
955
|
+
}
|
|
956
|
+
return lines.join("\n").trim();
|
|
957
|
+
}
|
|
958
|
+
var ToolExecutionComponent = class extends Container {
|
|
959
|
+
constructor(toolName, args) {
|
|
960
|
+
super();
|
|
961
|
+
this.expanded = false;
|
|
962
|
+
this.isError = false;
|
|
963
|
+
this.isPartial = true;
|
|
964
|
+
this.toolName = toolName;
|
|
965
|
+
this.args = args;
|
|
966
|
+
this.box = new Box(1, 1, (line) => theme.toolPendingBg(line));
|
|
967
|
+
this.header = new Text("", 0, 0);
|
|
968
|
+
this.argsLine = new Text("", 0, 0);
|
|
969
|
+
this.output = new Markdown("", 0, 0, markdownTheme, { color: (line) => theme.toolOutput(line) });
|
|
970
|
+
this.addChild(new Spacer(1));
|
|
971
|
+
this.addChild(this.box);
|
|
972
|
+
this.box.addChild(this.header);
|
|
973
|
+
this.box.addChild(this.argsLine);
|
|
974
|
+
this.box.addChild(this.output);
|
|
975
|
+
this.refresh();
|
|
976
|
+
}
|
|
977
|
+
setArgs(args) {
|
|
978
|
+
this.args = args;
|
|
979
|
+
this.refresh();
|
|
980
|
+
}
|
|
981
|
+
setExpanded(expanded) {
|
|
982
|
+
this.expanded = expanded;
|
|
983
|
+
this.refresh();
|
|
984
|
+
}
|
|
985
|
+
setResult(result, opts) {
|
|
986
|
+
this.result = result;
|
|
987
|
+
this.isPartial = false;
|
|
988
|
+
this.isError = Boolean(opts?.isError);
|
|
989
|
+
this.refresh();
|
|
990
|
+
}
|
|
991
|
+
setPartialResult(result) {
|
|
992
|
+
this.result = result;
|
|
993
|
+
this.isPartial = true;
|
|
994
|
+
this.refresh();
|
|
995
|
+
}
|
|
996
|
+
refresh() {
|
|
997
|
+
const bg = this.isPartial ? theme.toolPendingBg : this.isError ? theme.toolErrorBg : theme.toolSuccessBg;
|
|
998
|
+
this.box.setBgFn((line) => bg(line));
|
|
999
|
+
const display = resolveToolDisplay({
|
|
1000
|
+
name: this.toolName,
|
|
1001
|
+
args: this.args
|
|
1002
|
+
});
|
|
1003
|
+
const status = this.isPartial ? " (running)" : this.isError ? " (error)" : " ✓";
|
|
1004
|
+
const title = `${display.emoji} ${display.label}${status}`;
|
|
1005
|
+
this.header.setText(theme.toolTitle(theme.bold(title)));
|
|
1006
|
+
if (!this.expanded) {
|
|
1007
|
+
this.argsLine.setText("");
|
|
1008
|
+
this.output.setText("");
|
|
1009
|
+
return;
|
|
1010
|
+
}
|
|
1011
|
+
const argLine = formatArgs(this.toolName, this.args);
|
|
1012
|
+
this.argsLine.setText(argLine ? theme.dim(argLine) : theme.dim(" "));
|
|
1013
|
+
const text = extractText(this.result) || (this.isPartial ? "…" : "");
|
|
1014
|
+
this.output.setText(text);
|
|
1015
|
+
}
|
|
1016
|
+
};
|
|
1017
|
+
//#endregion
|
|
1018
|
+
//#region src/tui/components/markdown-message.ts
|
|
1019
|
+
var MarkdownMessageComponent = class extends Container {
|
|
1020
|
+
constructor(text, y, options) {
|
|
1021
|
+
super();
|
|
1022
|
+
this.body = new HyperlinkMarkdown(text, 0, y, markdownTheme, options);
|
|
1023
|
+
this.addChild(new Spacer(1));
|
|
1024
|
+
this.addChild(this.body);
|
|
1025
|
+
}
|
|
1026
|
+
setText(text) {
|
|
1027
|
+
this.body.setText(text);
|
|
1028
|
+
}
|
|
1029
|
+
};
|
|
1030
|
+
//#endregion
|
|
1031
|
+
//#region src/tui/components/user-message.ts
|
|
1032
|
+
var UserMessageComponent = class extends MarkdownMessageComponent {
|
|
1033
|
+
constructor(text) {
|
|
1034
|
+
super(text, 1, {
|
|
1035
|
+
bgColor: (line) => theme.userBg(line),
|
|
1036
|
+
color: (line) => theme.userText(line)
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
//#endregion
|
|
1041
|
+
//#region src/tui/components/chat-log.ts
|
|
1042
|
+
const PENDING_HISTORY_CLOCK_SKEW_TOLERANCE_MS = 6e4;
|
|
1043
|
+
/** Lines reserved for header, status bar, footer, and editor (outside chat log) */
|
|
1044
|
+
const RESERVED_TERMINAL_LINES = 5;
|
|
1045
|
+
const SCROLL_STEP = 3;
|
|
1046
|
+
var ChatLog = class extends Container {
|
|
1047
|
+
constructor(maxComponents = 180) {
|
|
1048
|
+
super();
|
|
1049
|
+
this.toolById = /* @__PURE__ */ new Map();
|
|
1050
|
+
this.streamingRuns = /* @__PURE__ */ new Map();
|
|
1051
|
+
this.pendingUsers = /* @__PURE__ */ new Map();
|
|
1052
|
+
this.btwMessage = null;
|
|
1053
|
+
this.toolsExpanded = false;
|
|
1054
|
+
this.scrollOffset = 0;
|
|
1055
|
+
this.userScrolled = false;
|
|
1056
|
+
this.tuiRef = null;
|
|
1057
|
+
this.maxComponents = Math.max(20, Math.floor(maxComponents));
|
|
1058
|
+
}
|
|
1059
|
+
setTuiRef(ref) {
|
|
1060
|
+
this.tuiRef = ref;
|
|
1061
|
+
}
|
|
1062
|
+
scrollUp(lines = SCROLL_STEP) {
|
|
1063
|
+
this.scrollOffset += lines;
|
|
1064
|
+
this.userScrolled = true;
|
|
1065
|
+
this.tuiRef?.requestRender();
|
|
1066
|
+
}
|
|
1067
|
+
scrollDown(lines = SCROLL_STEP) {
|
|
1068
|
+
this.scrollOffset = Math.max(0, this.scrollOffset - lines);
|
|
1069
|
+
if (this.scrollOffset === 0) this.userScrolled = false;
|
|
1070
|
+
this.tuiRef?.requestRender();
|
|
1071
|
+
}
|
|
1072
|
+
scrollToBottom() {
|
|
1073
|
+
this.scrollOffset = 0;
|
|
1074
|
+
this.userScrolled = false;
|
|
1075
|
+
}
|
|
1076
|
+
isUserScrolled() {
|
|
1077
|
+
return this.userScrolled;
|
|
1078
|
+
}
|
|
1079
|
+
getScrollOffset() {
|
|
1080
|
+
return this.scrollOffset;
|
|
1081
|
+
}
|
|
1082
|
+
dropComponentReferences(component) {
|
|
1083
|
+
for (const [toolId, tool] of this.toolById.entries()) if (tool === component) this.toolById.delete(toolId);
|
|
1084
|
+
for (const [runId, message] of this.streamingRuns.entries()) if (message === component) this.streamingRuns.delete(runId);
|
|
1085
|
+
for (const [runId, entry] of this.pendingUsers.entries()) if (entry.component === component) this.pendingUsers.delete(runId);
|
|
1086
|
+
if (this.btwMessage === component) this.btwMessage = null;
|
|
1087
|
+
}
|
|
1088
|
+
pruneOverflow() {
|
|
1089
|
+
while (this.children.length > this.maxComponents) {
|
|
1090
|
+
const oldest = this.children[0];
|
|
1091
|
+
if (!oldest) return;
|
|
1092
|
+
this.removeChild(oldest);
|
|
1093
|
+
this.dropComponentReferences(oldest);
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
append(component) {
|
|
1097
|
+
this.addChild(component);
|
|
1098
|
+
this.pruneOverflow();
|
|
1099
|
+
}
|
|
1100
|
+
render(width) {
|
|
1101
|
+
const allLines = super.render(width);
|
|
1102
|
+
const totalLines = allLines.length;
|
|
1103
|
+
if (!this.tuiRef) return allLines;
|
|
1104
|
+
const termRows = this.tuiRef.terminal.rows;
|
|
1105
|
+
const maxVisibleLines = Math.max(SCROLL_STEP, termRows - RESERVED_TERMINAL_LINES);
|
|
1106
|
+
if (totalLines <= maxVisibleLines) {
|
|
1107
|
+
if (this.scrollOffset !== 0 || this.userScrolled) {
|
|
1108
|
+
this.scrollOffset = 0;
|
|
1109
|
+
this.userScrolled = false;
|
|
1110
|
+
}
|
|
1111
|
+
return allLines;
|
|
1112
|
+
}
|
|
1113
|
+
if (!this.userScrolled) {
|
|
1114
|
+
this.scrollOffset = 0;
|
|
1115
|
+
return allLines.slice(Math.max(0, totalLines - maxVisibleLines));
|
|
1116
|
+
}
|
|
1117
|
+
const effectiveOffset = Math.min(this.scrollOffset, totalLines - maxVisibleLines);
|
|
1118
|
+
this.scrollOffset = effectiveOffset;
|
|
1119
|
+
if (effectiveOffset === 0) {
|
|
1120
|
+
this.userScrolled = false;
|
|
1121
|
+
return allLines.slice(Math.max(0, totalLines - maxVisibleLines));
|
|
1122
|
+
}
|
|
1123
|
+
const startIdx = Math.max(0, totalLines - maxVisibleLines - effectiveOffset);
|
|
1124
|
+
return allLines.slice(startIdx, startIdx + maxVisibleLines);
|
|
1125
|
+
}
|
|
1126
|
+
clearAll(opts) {
|
|
1127
|
+
this.clear();
|
|
1128
|
+
this.toolById.clear();
|
|
1129
|
+
this.streamingRuns.clear();
|
|
1130
|
+
this.btwMessage = null;
|
|
1131
|
+
if (!opts?.preservePendingUsers) this.pendingUsers.clear();
|
|
1132
|
+
}
|
|
1133
|
+
restorePendingUsers() {
|
|
1134
|
+
for (const entry of this.pendingUsers.values()) {
|
|
1135
|
+
if (this.children.includes(entry.component)) continue;
|
|
1136
|
+
this.append(entry.component);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
clearPendingUsers() {
|
|
1140
|
+
for (const entry of this.pendingUsers.values()) this.removeChild(entry.component);
|
|
1141
|
+
this.pendingUsers.clear();
|
|
1142
|
+
}
|
|
1143
|
+
createSystemMessage(text) {
|
|
1144
|
+
const entry = new Container();
|
|
1145
|
+
entry.addChild(new Spacer(1));
|
|
1146
|
+
entry.addChild(new Text(theme.system(text), 1, 0));
|
|
1147
|
+
return entry;
|
|
1148
|
+
}
|
|
1149
|
+
addSystem(text) {
|
|
1150
|
+
this.append(this.createSystemMessage(text));
|
|
1151
|
+
}
|
|
1152
|
+
addUser(text) {
|
|
1153
|
+
this.append(new UserMessageComponent(text));
|
|
1154
|
+
}
|
|
1155
|
+
addPendingUser(runId, text, createdAt = Date.now()) {
|
|
1156
|
+
const existing = this.pendingUsers.get(runId);
|
|
1157
|
+
if (existing) {
|
|
1158
|
+
existing.text = text;
|
|
1159
|
+
existing.createdAt = createdAt;
|
|
1160
|
+
existing.component.setText(text);
|
|
1161
|
+
return existing.component;
|
|
1162
|
+
}
|
|
1163
|
+
const component = new UserMessageComponent(text);
|
|
1164
|
+
this.pendingUsers.set(runId, {
|
|
1165
|
+
component,
|
|
1166
|
+
text,
|
|
1167
|
+
createdAt
|
|
1168
|
+
});
|
|
1169
|
+
this.append(component);
|
|
1170
|
+
return component;
|
|
1171
|
+
}
|
|
1172
|
+
commitPendingUser(runId) {
|
|
1173
|
+
return this.pendingUsers.delete(runId);
|
|
1174
|
+
}
|
|
1175
|
+
dropPendingUser(runId) {
|
|
1176
|
+
const existing = this.pendingUsers.get(runId);
|
|
1177
|
+
if (!existing) return false;
|
|
1178
|
+
this.removeChild(existing.component);
|
|
1179
|
+
this.pendingUsers.delete(runId);
|
|
1180
|
+
return true;
|
|
1181
|
+
}
|
|
1182
|
+
hasPendingUser(runId) {
|
|
1183
|
+
return this.pendingUsers.has(runId);
|
|
1184
|
+
}
|
|
1185
|
+
reconcilePendingUsers(historyUsers) {
|
|
1186
|
+
const normalizedHistory = historyUsers.map((entry) => ({
|
|
1187
|
+
text: entry.text.trim(),
|
|
1188
|
+
timestamp: typeof entry.timestamp === "number" ? entry.timestamp : null
|
|
1189
|
+
})).filter((entry) => entry.text.length > 0 && entry.timestamp !== null);
|
|
1190
|
+
const clearedRunIds = [];
|
|
1191
|
+
for (const [runId, entry] of this.pendingUsers.entries()) {
|
|
1192
|
+
const pendingText = entry.text.trim();
|
|
1193
|
+
if (!pendingText) continue;
|
|
1194
|
+
const matchIndex = normalizedHistory.findIndex((historyEntry) => historyEntry.text === pendingText && (historyEntry.timestamp ?? 0) >= entry.createdAt - PENDING_HISTORY_CLOCK_SKEW_TOLERANCE_MS);
|
|
1195
|
+
if (matchIndex === -1) continue;
|
|
1196
|
+
if (this.children.includes(entry.component)) this.removeChild(entry.component);
|
|
1197
|
+
this.pendingUsers.delete(runId);
|
|
1198
|
+
clearedRunIds.push(runId);
|
|
1199
|
+
normalizedHistory.splice(matchIndex, 1);
|
|
1200
|
+
}
|
|
1201
|
+
return clearedRunIds;
|
|
1202
|
+
}
|
|
1203
|
+
countPendingUsers() {
|
|
1204
|
+
return this.pendingUsers.size;
|
|
1205
|
+
}
|
|
1206
|
+
resolveRunId(runId) {
|
|
1207
|
+
return runId ?? "default";
|
|
1208
|
+
}
|
|
1209
|
+
startAssistant(text, runId) {
|
|
1210
|
+
const effectiveRunId = this.resolveRunId(runId);
|
|
1211
|
+
const existing = this.streamingRuns.get(effectiveRunId);
|
|
1212
|
+
if (existing) {
|
|
1213
|
+
existing.setText(text);
|
|
1214
|
+
return existing;
|
|
1215
|
+
}
|
|
1216
|
+
const component = new AssistantMessageComponent(text);
|
|
1217
|
+
this.streamingRuns.set(effectiveRunId, component);
|
|
1218
|
+
this.append(component);
|
|
1219
|
+
return component;
|
|
1220
|
+
}
|
|
1221
|
+
updateAssistant(text, runId) {
|
|
1222
|
+
const effectiveRunId = this.resolveRunId(runId);
|
|
1223
|
+
const existing = this.streamingRuns.get(effectiveRunId);
|
|
1224
|
+
if (!existing) {
|
|
1225
|
+
this.startAssistant(text, runId);
|
|
1226
|
+
return;
|
|
1227
|
+
}
|
|
1228
|
+
existing.setText(text);
|
|
1229
|
+
}
|
|
1230
|
+
finalizeAssistant(text, runId) {
|
|
1231
|
+
const effectiveRunId = this.resolveRunId(runId);
|
|
1232
|
+
const existing = this.streamingRuns.get(effectiveRunId);
|
|
1233
|
+
if (existing) {
|
|
1234
|
+
existing.setText(text);
|
|
1235
|
+
this.streamingRuns.delete(effectiveRunId);
|
|
1236
|
+
return;
|
|
1237
|
+
}
|
|
1238
|
+
this.append(new AssistantMessageComponent(text));
|
|
1239
|
+
}
|
|
1240
|
+
dropAssistant(runId) {
|
|
1241
|
+
const effectiveRunId = this.resolveRunId(runId);
|
|
1242
|
+
const existing = this.streamingRuns.get(effectiveRunId);
|
|
1243
|
+
if (!existing) return;
|
|
1244
|
+
this.removeChild(existing);
|
|
1245
|
+
this.streamingRuns.delete(effectiveRunId);
|
|
1246
|
+
}
|
|
1247
|
+
showBtw(params) {
|
|
1248
|
+
if (this.btwMessage) {
|
|
1249
|
+
this.btwMessage.setResult(params);
|
|
1250
|
+
if (this.children[this.children.length - 1] !== this.btwMessage) {
|
|
1251
|
+
this.removeChild(this.btwMessage);
|
|
1252
|
+
this.append(this.btwMessage);
|
|
1253
|
+
}
|
|
1254
|
+
return this.btwMessage;
|
|
1255
|
+
}
|
|
1256
|
+
const component = new BtwInlineMessage(params);
|
|
1257
|
+
this.btwMessage = component;
|
|
1258
|
+
this.append(component);
|
|
1259
|
+
return component;
|
|
1260
|
+
}
|
|
1261
|
+
dismissBtw() {
|
|
1262
|
+
if (!this.btwMessage) return;
|
|
1263
|
+
this.removeChild(this.btwMessage);
|
|
1264
|
+
this.btwMessage = null;
|
|
1265
|
+
}
|
|
1266
|
+
hasVisibleBtw() {
|
|
1267
|
+
return this.btwMessage !== null;
|
|
1268
|
+
}
|
|
1269
|
+
startTool(toolCallId, toolName, args) {
|
|
1270
|
+
const existing = this.toolById.get(toolCallId);
|
|
1271
|
+
if (existing) {
|
|
1272
|
+
existing.setArgs(args);
|
|
1273
|
+
return existing;
|
|
1274
|
+
}
|
|
1275
|
+
const component = new ToolExecutionComponent(toolName, args);
|
|
1276
|
+
component.setExpanded(this.toolsExpanded);
|
|
1277
|
+
this.toolById.set(toolCallId, component);
|
|
1278
|
+
this.append(component);
|
|
1279
|
+
return component;
|
|
1280
|
+
}
|
|
1281
|
+
updateToolArgs(toolCallId, args) {
|
|
1282
|
+
const existing = this.toolById.get(toolCallId);
|
|
1283
|
+
if (!existing) return;
|
|
1284
|
+
existing.setArgs(args);
|
|
1285
|
+
}
|
|
1286
|
+
updateToolResult(toolCallId, result, opts) {
|
|
1287
|
+
const existing = this.toolById.get(toolCallId);
|
|
1288
|
+
if (!existing) return;
|
|
1289
|
+
if (opts?.partial) {
|
|
1290
|
+
existing.setPartialResult(result);
|
|
1291
|
+
return;
|
|
1292
|
+
}
|
|
1293
|
+
existing.setResult(result, { isError: opts?.isError });
|
|
1294
|
+
}
|
|
1295
|
+
setToolsExpanded(expanded) {
|
|
1296
|
+
this.toolsExpanded = expanded;
|
|
1297
|
+
for (const tool of this.toolById.values()) tool.setExpanded(expanded);
|
|
1298
|
+
}
|
|
1299
|
+
};
|
|
1300
|
+
//#endregion
|
|
1301
|
+
//#region src/tui/components/custom-editor.ts
|
|
1302
|
+
var CustomEditor = class extends Editor {
|
|
1303
|
+
handleInput(data) {
|
|
1304
|
+
if (matchesKey(data, Key.alt("enter")) && this.onAltEnter) {
|
|
1305
|
+
this.onAltEnter();
|
|
1306
|
+
return;
|
|
1307
|
+
}
|
|
1308
|
+
if (matchesKey(data, Key.alt("up")) && this.onAltUp) {
|
|
1309
|
+
this.onAltUp();
|
|
1310
|
+
return;
|
|
1311
|
+
}
|
|
1312
|
+
if (matchesKey(data, Key.ctrl("l")) && this.onCtrlL) {
|
|
1313
|
+
this.onCtrlL();
|
|
1314
|
+
return;
|
|
1315
|
+
}
|
|
1316
|
+
if (matchesKey(data, Key.ctrl("o")) && this.onCtrlO) {
|
|
1317
|
+
this.onCtrlO();
|
|
1318
|
+
return;
|
|
1319
|
+
}
|
|
1320
|
+
if (matchesKey(data, Key.ctrl("p")) && this.onCtrlP) {
|
|
1321
|
+
this.onCtrlP();
|
|
1322
|
+
return;
|
|
1323
|
+
}
|
|
1324
|
+
if (matchesKey(data, Key.ctrl("g")) && this.onCtrlG) {
|
|
1325
|
+
this.onCtrlG();
|
|
1326
|
+
return;
|
|
1327
|
+
}
|
|
1328
|
+
if (matchesKey(data, Key.ctrl("t")) && this.onCtrlT) {
|
|
1329
|
+
this.onCtrlT();
|
|
1330
|
+
return;
|
|
1331
|
+
}
|
|
1332
|
+
if (matchesKey(data, Key.shift("tab")) && this.onShiftTab) {
|
|
1333
|
+
this.onShiftTab();
|
|
1334
|
+
return;
|
|
1335
|
+
}
|
|
1336
|
+
if (matchesKey(data, Key.escape) && this.onEscape && !this.isShowingAutocomplete()) {
|
|
1337
|
+
this.onEscape();
|
|
1338
|
+
return;
|
|
1339
|
+
}
|
|
1340
|
+
if (matchesKey(data, Key.ctrl("c")) && this.onCtrlC) {
|
|
1341
|
+
this.onCtrlC();
|
|
1342
|
+
return;
|
|
1343
|
+
}
|
|
1344
|
+
if (matchesKey(data, Key.ctrl("d"))) {
|
|
1345
|
+
if (this.getText().length === 0 && this.onCtrlD) this.onCtrlD();
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
super.handleInput(data);
|
|
1349
|
+
}
|
|
1350
|
+
};
|
|
1351
|
+
//#endregion
|
|
1352
|
+
//#region src/tui/gateway-chat.ts
|
|
1353
|
+
function throwGatewayAuthResolutionError(reason) {
|
|
1354
|
+
throw new Error([
|
|
1355
|
+
reason,
|
|
1356
|
+
"Fix: set KAIJIBOT_GATEWAY_TOKEN/KAIJIBOT_GATEWAY_PASSWORD, pass --token/--password,",
|
|
1357
|
+
"or resolve the configured secret provider for this credential."
|
|
1358
|
+
].join("\n"));
|
|
1359
|
+
}
|
|
1360
|
+
var GatewayChatClient = class GatewayChatClient {
|
|
1361
|
+
constructor(connection) {
|
|
1362
|
+
this.connection = connection;
|
|
1363
|
+
this.readyPromise = new Promise((resolve) => {
|
|
1364
|
+
this.resolveReady = resolve;
|
|
1365
|
+
});
|
|
1366
|
+
this.client = new GatewayClient({
|
|
1367
|
+
url: connection.url,
|
|
1368
|
+
token: connection.token,
|
|
1369
|
+
password: connection.password,
|
|
1370
|
+
clientName: GATEWAY_CLIENT_NAMES.TUI,
|
|
1371
|
+
clientDisplayName: "kaijibot-tui",
|
|
1372
|
+
clientVersion: VERSION,
|
|
1373
|
+
platform: process.platform,
|
|
1374
|
+
mode: GATEWAY_CLIENT_MODES.UI,
|
|
1375
|
+
deviceIdentity: connection.allowInsecureLocalOperatorUi ? null : void 0,
|
|
1376
|
+
caps: [GATEWAY_CLIENT_CAPS.TOOL_EVENTS],
|
|
1377
|
+
instanceId: randomUUID(),
|
|
1378
|
+
minProtocol: 3,
|
|
1379
|
+
maxProtocol: 3,
|
|
1380
|
+
onHelloOk: (hello) => {
|
|
1381
|
+
this.hello = hello;
|
|
1382
|
+
this.resolveReady?.();
|
|
1383
|
+
this.onConnected?.();
|
|
1384
|
+
},
|
|
1385
|
+
onEvent: (evt) => {
|
|
1386
|
+
this.onEvent?.({
|
|
1387
|
+
event: evt.event,
|
|
1388
|
+
payload: evt.payload,
|
|
1389
|
+
seq: evt.seq
|
|
1390
|
+
});
|
|
1391
|
+
},
|
|
1392
|
+
onClose: (_code, reason) => {
|
|
1393
|
+
this.readyPromise = new Promise((resolve) => {
|
|
1394
|
+
this.resolveReady = resolve;
|
|
1395
|
+
});
|
|
1396
|
+
this.onDisconnected?.(reason);
|
|
1397
|
+
},
|
|
1398
|
+
onGap: (info) => {
|
|
1399
|
+
this.onGap?.(info);
|
|
1400
|
+
}
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1403
|
+
static async connect(opts) {
|
|
1404
|
+
return new GatewayChatClient(await resolveGatewayConnection(opts));
|
|
1405
|
+
}
|
|
1406
|
+
start() {
|
|
1407
|
+
this.client.start();
|
|
1408
|
+
}
|
|
1409
|
+
stop() {
|
|
1410
|
+
this.client.stop();
|
|
1411
|
+
}
|
|
1412
|
+
async waitForReady() {
|
|
1413
|
+
await this.readyPromise;
|
|
1414
|
+
}
|
|
1415
|
+
async sendChat(opts) {
|
|
1416
|
+
const runId = opts.runId ?? randomUUID();
|
|
1417
|
+
await this.client.request("chat.send", {
|
|
1418
|
+
sessionKey: opts.sessionKey,
|
|
1419
|
+
message: opts.message,
|
|
1420
|
+
thinking: opts.thinking,
|
|
1421
|
+
deliver: opts.deliver,
|
|
1422
|
+
timeoutMs: opts.timeoutMs,
|
|
1423
|
+
idempotencyKey: runId
|
|
1424
|
+
});
|
|
1425
|
+
return { runId };
|
|
1426
|
+
}
|
|
1427
|
+
async abortChat(opts) {
|
|
1428
|
+
return await this.client.request("chat.abort", {
|
|
1429
|
+
sessionKey: opts.sessionKey,
|
|
1430
|
+
runId: opts.runId
|
|
1431
|
+
});
|
|
1432
|
+
}
|
|
1433
|
+
async loadHistory(opts) {
|
|
1434
|
+
return await this.client.request("chat.history", {
|
|
1435
|
+
sessionKey: opts.sessionKey,
|
|
1436
|
+
limit: opts.limit
|
|
1437
|
+
});
|
|
1438
|
+
}
|
|
1439
|
+
async listSessions(opts) {
|
|
1440
|
+
return await this.client.request("sessions.list", {
|
|
1441
|
+
limit: opts?.limit,
|
|
1442
|
+
activeMinutes: opts?.activeMinutes,
|
|
1443
|
+
includeGlobal: opts?.includeGlobal,
|
|
1444
|
+
includeUnknown: opts?.includeUnknown,
|
|
1445
|
+
includeDerivedTitles: opts?.includeDerivedTitles,
|
|
1446
|
+
includeLastMessage: opts?.includeLastMessage,
|
|
1447
|
+
agentId: opts?.agentId
|
|
1448
|
+
});
|
|
1449
|
+
}
|
|
1450
|
+
async listAgents() {
|
|
1451
|
+
return await this.client.request("agents.list", {});
|
|
1452
|
+
}
|
|
1453
|
+
async patchSession(opts) {
|
|
1454
|
+
return await this.client.request("sessions.patch", opts);
|
|
1455
|
+
}
|
|
1456
|
+
async resetSession(key, reason) {
|
|
1457
|
+
return await this.client.request("sessions.reset", {
|
|
1458
|
+
key,
|
|
1459
|
+
...reason ? { reason } : {}
|
|
1460
|
+
});
|
|
1461
|
+
}
|
|
1462
|
+
async getGatewayStatus() {
|
|
1463
|
+
return await this.client.request("status");
|
|
1464
|
+
}
|
|
1465
|
+
async listModels() {
|
|
1466
|
+
const res = await this.client.request("models.list");
|
|
1467
|
+
return Array.isArray(res?.models) ? res.models : [];
|
|
1468
|
+
}
|
|
1469
|
+
};
|
|
1470
|
+
async function resolveGatewayConnection(opts) {
|
|
1471
|
+
const config = loadConfig();
|
|
1472
|
+
const env = process.env;
|
|
1473
|
+
const gatewayAuthMode = config.gateway?.auth?.mode;
|
|
1474
|
+
const isRemoteMode = config.gateway?.mode === "remote";
|
|
1475
|
+
const urlOverride = typeof opts.url === "string" && opts.url.trim().length > 0 ? opts.url.trim() : void 0;
|
|
1476
|
+
const explicitAuth = resolveExplicitGatewayAuth({
|
|
1477
|
+
token: opts.token,
|
|
1478
|
+
password: opts.password
|
|
1479
|
+
});
|
|
1480
|
+
ensureExplicitGatewayAuth({
|
|
1481
|
+
urlOverride,
|
|
1482
|
+
urlOverrideSource: "cli",
|
|
1483
|
+
explicitAuth,
|
|
1484
|
+
errorHint: "Fix: pass --token or --password when using --url."
|
|
1485
|
+
});
|
|
1486
|
+
const url = buildGatewayConnectionDetails({
|
|
1487
|
+
config,
|
|
1488
|
+
...urlOverride ? { url: urlOverride } : {}
|
|
1489
|
+
}).url;
|
|
1490
|
+
const allowInsecureLocalOperatorUi = (() => {
|
|
1491
|
+
if (config.gateway?.controlUi?.allowInsecureAuth !== true) return false;
|
|
1492
|
+
try {
|
|
1493
|
+
return isLoopbackHost(new URL(url).hostname);
|
|
1494
|
+
} catch {
|
|
1495
|
+
return false;
|
|
1496
|
+
}
|
|
1497
|
+
})();
|
|
1498
|
+
if (urlOverride) return {
|
|
1499
|
+
url,
|
|
1500
|
+
token: explicitAuth.token,
|
|
1501
|
+
password: explicitAuth.password,
|
|
1502
|
+
allowInsecureLocalOperatorUi
|
|
1503
|
+
};
|
|
1504
|
+
if (isRemoteMode) {
|
|
1505
|
+
const resolved = await resolveGatewayInteractiveSurfaceAuth({
|
|
1506
|
+
config,
|
|
1507
|
+
env,
|
|
1508
|
+
explicitAuth,
|
|
1509
|
+
surface: "remote"
|
|
1510
|
+
});
|
|
1511
|
+
if (resolved.failureReason) throwGatewayAuthResolutionError(resolved.failureReason);
|
|
1512
|
+
return {
|
|
1513
|
+
url,
|
|
1514
|
+
token: resolved.token,
|
|
1515
|
+
password: resolved.password,
|
|
1516
|
+
allowInsecureLocalOperatorUi: false
|
|
1517
|
+
};
|
|
1518
|
+
}
|
|
1519
|
+
if (gatewayAuthMode === "none" || gatewayAuthMode === "trusted-proxy") {
|
|
1520
|
+
const resolved = await resolveGatewayInteractiveSurfaceAuth({
|
|
1521
|
+
config,
|
|
1522
|
+
env,
|
|
1523
|
+
explicitAuth,
|
|
1524
|
+
surface: "local"
|
|
1525
|
+
});
|
|
1526
|
+
return {
|
|
1527
|
+
url,
|
|
1528
|
+
token: resolved.token,
|
|
1529
|
+
password: resolved.password,
|
|
1530
|
+
allowInsecureLocalOperatorUi
|
|
1531
|
+
};
|
|
1532
|
+
}
|
|
1533
|
+
try {
|
|
1534
|
+
assertExplicitGatewayAuthModeWhenBothConfigured(config);
|
|
1535
|
+
} catch (err) {
|
|
1536
|
+
throwGatewayAuthResolutionError(formatErrorMessage(err));
|
|
1537
|
+
}
|
|
1538
|
+
const resolved = await resolveGatewayInteractiveSurfaceAuth({
|
|
1539
|
+
config,
|
|
1540
|
+
env,
|
|
1541
|
+
explicitAuth,
|
|
1542
|
+
surface: "local"
|
|
1543
|
+
});
|
|
1544
|
+
if (resolved.failureReason) throwGatewayAuthResolutionError(resolved.failureReason);
|
|
1545
|
+
return {
|
|
1546
|
+
url,
|
|
1547
|
+
token: resolved.token,
|
|
1548
|
+
password: resolved.password,
|
|
1549
|
+
allowInsecureLocalOperatorUi
|
|
1550
|
+
};
|
|
1551
|
+
}
|
|
1552
|
+
//#endregion
|
|
1553
|
+
//#region src/tui/components/fuzzy-filter.ts
|
|
1554
|
+
/**
|
|
1555
|
+
* Shared fuzzy filtering utilities for select list components.
|
|
1556
|
+
*/
|
|
1557
|
+
/**
|
|
1558
|
+
* Word boundary characters for matching.
|
|
1559
|
+
*/
|
|
1560
|
+
const WORD_BOUNDARY_CHARS = /[\s\-_./:#@]/;
|
|
1561
|
+
/**
|
|
1562
|
+
* Check if position is at a word boundary.
|
|
1563
|
+
*/
|
|
1564
|
+
function isWordBoundary(text, index) {
|
|
1565
|
+
return index === 0 || WORD_BOUNDARY_CHARS.test(text[index - 1] ?? "");
|
|
1566
|
+
}
|
|
1567
|
+
/**
|
|
1568
|
+
* Find index where query matches at a word boundary in text.
|
|
1569
|
+
* Returns null if no match.
|
|
1570
|
+
*/
|
|
1571
|
+
function findWordBoundaryIndex(text, query) {
|
|
1572
|
+
if (!query) return null;
|
|
1573
|
+
const textLower = normalizeLowercaseStringOrEmpty(text);
|
|
1574
|
+
const queryLower = normalizeLowercaseStringOrEmpty(query);
|
|
1575
|
+
const maxIndex = textLower.length - queryLower.length;
|
|
1576
|
+
if (maxIndex < 0) return null;
|
|
1577
|
+
for (let i = 0; i <= maxIndex; i++) if (textLower.startsWith(queryLower, i) && isWordBoundary(textLower, i)) return i;
|
|
1578
|
+
return null;
|
|
1579
|
+
}
|
|
1580
|
+
/**
|
|
1581
|
+
* Fuzzy match with pre-lowercased inputs (avoids toLowerCase on every keystroke).
|
|
1582
|
+
* Returns score (lower = better) or null if no match.
|
|
1583
|
+
*/
|
|
1584
|
+
function fuzzyMatchLower(queryLower, textLower) {
|
|
1585
|
+
if (queryLower.length === 0) return 0;
|
|
1586
|
+
if (queryLower.length > textLower.length) return null;
|
|
1587
|
+
let queryIndex = 0;
|
|
1588
|
+
let score = 0;
|
|
1589
|
+
let lastMatchIndex = -1;
|
|
1590
|
+
let consecutiveMatches = 0;
|
|
1591
|
+
for (let i = 0; i < textLower.length && queryIndex < queryLower.length; i++) if (textLower[i] === queryLower[queryIndex]) {
|
|
1592
|
+
const isAtWordBoundary = isWordBoundary(textLower, i);
|
|
1593
|
+
if (lastMatchIndex === i - 1) {
|
|
1594
|
+
consecutiveMatches++;
|
|
1595
|
+
score -= consecutiveMatches * 5;
|
|
1596
|
+
} else {
|
|
1597
|
+
consecutiveMatches = 0;
|
|
1598
|
+
if (lastMatchIndex >= 0) score += (i - lastMatchIndex - 1) * 2;
|
|
1599
|
+
}
|
|
1600
|
+
if (isAtWordBoundary) score -= 10;
|
|
1601
|
+
score += i * .1;
|
|
1602
|
+
lastMatchIndex = i;
|
|
1603
|
+
queryIndex++;
|
|
1604
|
+
}
|
|
1605
|
+
return queryIndex < queryLower.length ? null : score;
|
|
1606
|
+
}
|
|
1607
|
+
/**
|
|
1608
|
+
* Filter items using pre-lowercased searchTextLower field.
|
|
1609
|
+
* Supports space-separated tokens (all must match).
|
|
1610
|
+
*/
|
|
1611
|
+
function fuzzyFilterLower(items, queryLower) {
|
|
1612
|
+
const trimmed = queryLower.trim();
|
|
1613
|
+
if (!trimmed) return items;
|
|
1614
|
+
const tokens = trimmed.split(/\s+/).filter((t) => t.length > 0);
|
|
1615
|
+
if (tokens.length === 0) return items;
|
|
1616
|
+
const results = [];
|
|
1617
|
+
for (const item of items) {
|
|
1618
|
+
const text = item.searchTextLower ?? "";
|
|
1619
|
+
let totalScore = 0;
|
|
1620
|
+
let allMatch = true;
|
|
1621
|
+
for (const token of tokens) {
|
|
1622
|
+
const score = fuzzyMatchLower(token, text);
|
|
1623
|
+
if (score !== null) totalScore += score;
|
|
1624
|
+
else {
|
|
1625
|
+
allMatch = false;
|
|
1626
|
+
break;
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
if (allMatch) results.push({
|
|
1630
|
+
item,
|
|
1631
|
+
score: totalScore
|
|
1632
|
+
});
|
|
1633
|
+
}
|
|
1634
|
+
results.sort((a, b) => a.score - b.score);
|
|
1635
|
+
return results.map((r) => r.item);
|
|
1636
|
+
}
|
|
1637
|
+
/**
|
|
1638
|
+
* Prepare items for fuzzy filtering by pre-computing lowercase search text.
|
|
1639
|
+
*/
|
|
1640
|
+
function prepareSearchItems(items) {
|
|
1641
|
+
return items.map((item) => {
|
|
1642
|
+
const parts = [];
|
|
1643
|
+
if (item.label) parts.push(item.label);
|
|
1644
|
+
if (item.description) parts.push(item.description);
|
|
1645
|
+
if (item.searchText) parts.push(item.searchText);
|
|
1646
|
+
return {
|
|
1647
|
+
...item,
|
|
1648
|
+
searchTextLower: normalizeLowercaseStringOrEmpty(parts.join(" "))
|
|
1649
|
+
};
|
|
1650
|
+
});
|
|
1651
|
+
}
|
|
1652
|
+
//#endregion
|
|
1653
|
+
//#region src/tui/components/filterable-select-list.ts
|
|
1654
|
+
/**
|
|
1655
|
+
* Combines text input filtering with a select list.
|
|
1656
|
+
* User types to filter, arrows/j/k to navigate, Enter to select, Escape to clear/cancel.
|
|
1657
|
+
*/
|
|
1658
|
+
var FilterableSelectList = class {
|
|
1659
|
+
constructor(items, maxVisible, theme) {
|
|
1660
|
+
this.filterText = "";
|
|
1661
|
+
this.allItems = prepareSearchItems(items);
|
|
1662
|
+
this.maxVisible = maxVisible;
|
|
1663
|
+
this.theme = theme;
|
|
1664
|
+
this.input = new Input();
|
|
1665
|
+
this.selectList = new SelectList(this.allItems, maxVisible, theme);
|
|
1666
|
+
}
|
|
1667
|
+
applyFilter() {
|
|
1668
|
+
const queryLower = normalizeLowercaseStringOrEmpty(this.filterText);
|
|
1669
|
+
if (!queryLower.trim()) {
|
|
1670
|
+
this.selectList = new SelectList(this.allItems, this.maxVisible, this.theme);
|
|
1671
|
+
return;
|
|
1672
|
+
}
|
|
1673
|
+
this.selectList = new SelectList(fuzzyFilterLower(this.allItems, queryLower), this.maxVisible, this.theme);
|
|
1674
|
+
}
|
|
1675
|
+
invalidate() {
|
|
1676
|
+
this.input.invalidate();
|
|
1677
|
+
this.selectList.invalidate();
|
|
1678
|
+
}
|
|
1679
|
+
render(width) {
|
|
1680
|
+
const lines = [];
|
|
1681
|
+
const filterLabel = this.theme.filterLabel("Filter: ");
|
|
1682
|
+
const inputText = this.input.render(width - 8)[0] ?? "";
|
|
1683
|
+
lines.push(filterLabel + inputText);
|
|
1684
|
+
lines.push(chalk.dim("─".repeat(Math.max(0, width))));
|
|
1685
|
+
const listLines = this.selectList.render(width);
|
|
1686
|
+
lines.push(...listLines);
|
|
1687
|
+
return lines;
|
|
1688
|
+
}
|
|
1689
|
+
handleInput(keyData) {
|
|
1690
|
+
const allowVimNav = !this.filterText.trim();
|
|
1691
|
+
if (matchesKey(keyData, "up") || matchesKey(keyData, "ctrl+p") || allowVimNav && keyData === "k") {
|
|
1692
|
+
this.selectList.handleInput("\x1B[A");
|
|
1693
|
+
return;
|
|
1694
|
+
}
|
|
1695
|
+
if (matchesKey(keyData, "down") || matchesKey(keyData, "ctrl+n") || allowVimNav && keyData === "j") {
|
|
1696
|
+
this.selectList.handleInput("\x1B[B");
|
|
1697
|
+
return;
|
|
1698
|
+
}
|
|
1699
|
+
if (matchesKey(keyData, "enter")) {
|
|
1700
|
+
const selected = this.selectList.getSelectedItem();
|
|
1701
|
+
if (selected) this.onSelect?.(selected);
|
|
1702
|
+
return;
|
|
1703
|
+
}
|
|
1704
|
+
if (matchesKey(keyData, "escape") || keyData === "") {
|
|
1705
|
+
if (this.filterText) {
|
|
1706
|
+
this.filterText = "";
|
|
1707
|
+
this.input.setValue("");
|
|
1708
|
+
this.applyFilter();
|
|
1709
|
+
} else this.onCancel?.();
|
|
1710
|
+
return;
|
|
1711
|
+
}
|
|
1712
|
+
const prevValue = this.input.getValue();
|
|
1713
|
+
this.input.handleInput(keyData);
|
|
1714
|
+
const newValue = this.input.getValue();
|
|
1715
|
+
if (newValue !== prevValue) {
|
|
1716
|
+
this.filterText = newValue;
|
|
1717
|
+
this.applyFilter();
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
getSelectedItem() {
|
|
1721
|
+
return this.selectList.getSelectedItem();
|
|
1722
|
+
}
|
|
1723
|
+
getFilterText() {
|
|
1724
|
+
return this.filterText;
|
|
1725
|
+
}
|
|
1726
|
+
};
|
|
1727
|
+
//#endregion
|
|
1728
|
+
//#region src/tui/components/searchable-select-list.ts
|
|
1729
|
+
const ANSI_SGR_REGEX = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`, "g");
|
|
1730
|
+
/**
|
|
1731
|
+
* A select list with a search input at the top for fuzzy filtering.
|
|
1732
|
+
*/
|
|
1733
|
+
var SearchableSelectList = class SearchableSelectList {
|
|
1734
|
+
static {
|
|
1735
|
+
this.DESCRIPTION_LAYOUT_MIN_WIDTH = 40;
|
|
1736
|
+
}
|
|
1737
|
+
static {
|
|
1738
|
+
this.DESCRIPTION_MIN_WIDTH = 12;
|
|
1739
|
+
}
|
|
1740
|
+
static {
|
|
1741
|
+
this.DESCRIPTION_SPACING_WIDTH = 2;
|
|
1742
|
+
}
|
|
1743
|
+
static {
|
|
1744
|
+
this.RIGHT_MARGIN_WIDTH = 2;
|
|
1745
|
+
}
|
|
1746
|
+
constructor(items, maxVisible, theme) {
|
|
1747
|
+
this.selectedIndex = 0;
|
|
1748
|
+
this.regexCache = /* @__PURE__ */ new Map();
|
|
1749
|
+
this.compareByScore = (a, b) => {
|
|
1750
|
+
if (a.tier !== b.tier) return a.tier - b.tier;
|
|
1751
|
+
if (a.score !== b.score) return a.score - b.score;
|
|
1752
|
+
return this.getItemLabel(a.item).localeCompare(this.getItemLabel(b.item));
|
|
1753
|
+
};
|
|
1754
|
+
this.items = items;
|
|
1755
|
+
this.filteredItems = items;
|
|
1756
|
+
this.maxVisible = maxVisible;
|
|
1757
|
+
this.theme = theme;
|
|
1758
|
+
this.searchInput = new Input();
|
|
1759
|
+
}
|
|
1760
|
+
getCachedRegex(pattern) {
|
|
1761
|
+
let regex = this.regexCache.get(pattern);
|
|
1762
|
+
if (!regex) {
|
|
1763
|
+
regex = new RegExp(this.escapeRegex(pattern), "gi");
|
|
1764
|
+
this.regexCache.set(pattern, regex);
|
|
1765
|
+
}
|
|
1766
|
+
return regex;
|
|
1767
|
+
}
|
|
1768
|
+
updateFilter() {
|
|
1769
|
+
const query = this.searchInput.getValue().trim();
|
|
1770
|
+
if (!query) this.filteredItems = this.items;
|
|
1771
|
+
else this.filteredItems = this.smartFilter(query);
|
|
1772
|
+
this.selectedIndex = 0;
|
|
1773
|
+
this.notifySelectionChange();
|
|
1774
|
+
}
|
|
1775
|
+
/**
|
|
1776
|
+
* Smart filtering that prioritizes:
|
|
1777
|
+
* 1. Exact substring match in label (highest priority)
|
|
1778
|
+
* 2. Word-boundary prefix match in label
|
|
1779
|
+
* 3. Exact substring in description
|
|
1780
|
+
* 4. Fuzzy match (lowest priority)
|
|
1781
|
+
*/
|
|
1782
|
+
smartFilter(query) {
|
|
1783
|
+
const q = normalizeLowercaseStringOrEmpty(query);
|
|
1784
|
+
const scoredItems = [];
|
|
1785
|
+
const fuzzyCandidates = [];
|
|
1786
|
+
for (const item of this.items) {
|
|
1787
|
+
const rawLabel = this.getItemLabel(item);
|
|
1788
|
+
const rawDesc = item.description ?? "";
|
|
1789
|
+
const label = normalizeLowercaseStringOrEmpty(stripAnsi$1(rawLabel));
|
|
1790
|
+
const desc = normalizeLowercaseStringOrEmpty(stripAnsi$1(rawDesc));
|
|
1791
|
+
const labelIndex = label.indexOf(q);
|
|
1792
|
+
if (labelIndex !== -1) {
|
|
1793
|
+
scoredItems.push({
|
|
1794
|
+
item,
|
|
1795
|
+
tier: 0,
|
|
1796
|
+
score: labelIndex
|
|
1797
|
+
});
|
|
1798
|
+
continue;
|
|
1799
|
+
}
|
|
1800
|
+
const wordBoundaryIndex = findWordBoundaryIndex(label, q);
|
|
1801
|
+
if (wordBoundaryIndex !== null) {
|
|
1802
|
+
scoredItems.push({
|
|
1803
|
+
item,
|
|
1804
|
+
tier: 1,
|
|
1805
|
+
score: wordBoundaryIndex
|
|
1806
|
+
});
|
|
1807
|
+
continue;
|
|
1808
|
+
}
|
|
1809
|
+
const descIndex = desc.indexOf(q);
|
|
1810
|
+
if (descIndex !== -1) {
|
|
1811
|
+
scoredItems.push({
|
|
1812
|
+
item,
|
|
1813
|
+
tier: 2,
|
|
1814
|
+
score: descIndex
|
|
1815
|
+
});
|
|
1816
|
+
continue;
|
|
1817
|
+
}
|
|
1818
|
+
const searchText = item.searchText ?? "";
|
|
1819
|
+
fuzzyCandidates.push({
|
|
1820
|
+
item,
|
|
1821
|
+
searchTextLower: normalizeLowercaseStringOrEmpty([
|
|
1822
|
+
rawLabel,
|
|
1823
|
+
rawDesc,
|
|
1824
|
+
searchText
|
|
1825
|
+
].map((value) => stripAnsi$1(value)).filter(Boolean).join(" "))
|
|
1826
|
+
});
|
|
1827
|
+
}
|
|
1828
|
+
scoredItems.sort(this.compareByScore);
|
|
1829
|
+
const fuzzyMatches = fuzzyFilterLower(fuzzyCandidates, q);
|
|
1830
|
+
return [...scoredItems.map((s) => s.item), ...fuzzyMatches.map((entry) => entry.item)];
|
|
1831
|
+
}
|
|
1832
|
+
escapeRegex(str) {
|
|
1833
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1834
|
+
}
|
|
1835
|
+
getItemLabel(item) {
|
|
1836
|
+
return item.label || item.value;
|
|
1837
|
+
}
|
|
1838
|
+
splitAnsiParts(text) {
|
|
1839
|
+
const parts = [];
|
|
1840
|
+
ANSI_SGR_REGEX.lastIndex = 0;
|
|
1841
|
+
let lastIndex = 0;
|
|
1842
|
+
let match;
|
|
1843
|
+
while ((match = ANSI_SGR_REGEX.exec(text)) !== null) {
|
|
1844
|
+
if (match.index > lastIndex) parts.push({
|
|
1845
|
+
text: text.slice(lastIndex, match.index),
|
|
1846
|
+
isAnsi: false
|
|
1847
|
+
});
|
|
1848
|
+
parts.push({
|
|
1849
|
+
text: match[0],
|
|
1850
|
+
isAnsi: true
|
|
1851
|
+
});
|
|
1852
|
+
lastIndex = match.index + match[0].length;
|
|
1853
|
+
}
|
|
1854
|
+
if (lastIndex < text.length) parts.push({
|
|
1855
|
+
text: text.slice(lastIndex),
|
|
1856
|
+
isAnsi: false
|
|
1857
|
+
});
|
|
1858
|
+
return parts;
|
|
1859
|
+
}
|
|
1860
|
+
highlightMatch(text, query) {
|
|
1861
|
+
const tokens = query.trim().split(/\s+/).map((token) => normalizeLowercaseStringOrEmpty(token)).filter((token) => token.length > 0);
|
|
1862
|
+
if (tokens.length === 0) return text;
|
|
1863
|
+
const uniqueTokens = Array.from(new Set(tokens)).toSorted((a, b) => b.length - a.length);
|
|
1864
|
+
let parts = this.splitAnsiParts(text);
|
|
1865
|
+
for (const token of uniqueTokens) {
|
|
1866
|
+
const regex = this.getCachedRegex(token);
|
|
1867
|
+
const nextParts = [];
|
|
1868
|
+
for (const part of parts) {
|
|
1869
|
+
if (part.isAnsi) {
|
|
1870
|
+
nextParts.push(part);
|
|
1871
|
+
continue;
|
|
1872
|
+
}
|
|
1873
|
+
regex.lastIndex = 0;
|
|
1874
|
+
const replaced = part.text.replace(regex, (match) => this.theme.matchHighlight(match));
|
|
1875
|
+
if (replaced === part.text) {
|
|
1876
|
+
nextParts.push(part);
|
|
1877
|
+
continue;
|
|
1878
|
+
}
|
|
1879
|
+
nextParts.push(...this.splitAnsiParts(replaced));
|
|
1880
|
+
}
|
|
1881
|
+
parts = nextParts;
|
|
1882
|
+
}
|
|
1883
|
+
return parts.map((part) => part.text).join("");
|
|
1884
|
+
}
|
|
1885
|
+
setSelectedIndex(index) {
|
|
1886
|
+
this.selectedIndex = Math.max(0, Math.min(index, this.filteredItems.length - 1));
|
|
1887
|
+
}
|
|
1888
|
+
invalidate() {
|
|
1889
|
+
this.searchInput.invalidate();
|
|
1890
|
+
}
|
|
1891
|
+
render(width) {
|
|
1892
|
+
const lines = [];
|
|
1893
|
+
const prompt = this.theme.searchPrompt("search: ");
|
|
1894
|
+
const inputWidth = Math.max(1, width - visibleWidth(prompt));
|
|
1895
|
+
const inputText = this.searchInput.render(inputWidth)[0] ?? "";
|
|
1896
|
+
lines.push(`${prompt}${this.theme.searchInput(inputText)}`);
|
|
1897
|
+
lines.push("");
|
|
1898
|
+
const query = this.searchInput.getValue().trim();
|
|
1899
|
+
if (this.filteredItems.length === 0) {
|
|
1900
|
+
lines.push(this.theme.noMatch(" No matches"));
|
|
1901
|
+
return lines;
|
|
1902
|
+
}
|
|
1903
|
+
const startIndex = Math.max(0, Math.min(this.selectedIndex - Math.floor(this.maxVisible / 2), this.filteredItems.length - this.maxVisible));
|
|
1904
|
+
const endIndex = Math.min(startIndex + this.maxVisible, this.filteredItems.length);
|
|
1905
|
+
for (let i = startIndex; i < endIndex; i++) {
|
|
1906
|
+
const item = this.filteredItems[i];
|
|
1907
|
+
if (!item) continue;
|
|
1908
|
+
const isSelected = i === this.selectedIndex;
|
|
1909
|
+
lines.push(this.renderItemLine(item, isSelected, width, query));
|
|
1910
|
+
}
|
|
1911
|
+
if (this.filteredItems.length > this.maxVisible) {
|
|
1912
|
+
const scrollInfo = `${this.selectedIndex + 1}/${this.filteredItems.length}`;
|
|
1913
|
+
lines.push(this.theme.scrollInfo(` ${scrollInfo}`));
|
|
1914
|
+
}
|
|
1915
|
+
return lines;
|
|
1916
|
+
}
|
|
1917
|
+
renderItemLine(item, isSelected, width, query) {
|
|
1918
|
+
const prefix = isSelected ? "→ " : " ";
|
|
1919
|
+
const prefixWidth = prefix.length;
|
|
1920
|
+
const displayValue = this.getItemLabel(item);
|
|
1921
|
+
const description = item.description;
|
|
1922
|
+
if (description) {
|
|
1923
|
+
const descriptionLayout = this.getDescriptionLayout(width, prefixWidth);
|
|
1924
|
+
if (descriptionLayout) {
|
|
1925
|
+
const truncatedValue = truncateToWidth(displayValue, descriptionLayout.maxValueWidth, "");
|
|
1926
|
+
const valueText = this.highlightMatch(truncatedValue, query);
|
|
1927
|
+
const usedByValue = visibleWidth(valueText);
|
|
1928
|
+
const descriptionWidth = descriptionLayout.availableWidth - usedByValue - descriptionLayout.spacingWidth;
|
|
1929
|
+
if (descriptionWidth >= SearchableSelectList.DESCRIPTION_MIN_WIDTH) {
|
|
1930
|
+
const spacing = " ".repeat(descriptionLayout.spacingWidth);
|
|
1931
|
+
const truncatedDesc = truncateToWidth(description, descriptionWidth, "");
|
|
1932
|
+
const highlightedDesc = this.highlightMatch(truncatedDesc, query);
|
|
1933
|
+
const line = `${prefix}${valueText}${spacing}${isSelected ? highlightedDesc : this.theme.description(highlightedDesc)}`;
|
|
1934
|
+
return isSelected ? this.theme.selectedText(line) : line;
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
const truncatedValue = truncateToWidth(displayValue, width - prefixWidth - 2, "");
|
|
1939
|
+
const line = `${prefix}${this.highlightMatch(truncatedValue, query)}`;
|
|
1940
|
+
return isSelected ? this.theme.selectedText(line) : line;
|
|
1941
|
+
}
|
|
1942
|
+
getDescriptionLayout(width, prefixWidth) {
|
|
1943
|
+
if (width <= SearchableSelectList.DESCRIPTION_LAYOUT_MIN_WIDTH) return null;
|
|
1944
|
+
const availableWidth = Math.max(1, width - prefixWidth - SearchableSelectList.RIGHT_MARGIN_WIDTH);
|
|
1945
|
+
const maxValueWidth = availableWidth - SearchableSelectList.DESCRIPTION_MIN_WIDTH - SearchableSelectList.DESCRIPTION_SPACING_WIDTH;
|
|
1946
|
+
if (maxValueWidth < 1) return null;
|
|
1947
|
+
return {
|
|
1948
|
+
availableWidth,
|
|
1949
|
+
maxValueWidth,
|
|
1950
|
+
spacingWidth: SearchableSelectList.DESCRIPTION_SPACING_WIDTH
|
|
1951
|
+
};
|
|
1952
|
+
}
|
|
1953
|
+
handleInput(keyData) {
|
|
1954
|
+
if (isKeyRelease(keyData)) return;
|
|
1955
|
+
if (matchesKey(keyData, "up") || matchesKey(keyData, "ctrl+p")) {
|
|
1956
|
+
this.selectedIndex = Math.max(0, this.selectedIndex - 1);
|
|
1957
|
+
this.notifySelectionChange();
|
|
1958
|
+
return;
|
|
1959
|
+
}
|
|
1960
|
+
if (matchesKey(keyData, "down") || matchesKey(keyData, "ctrl+n")) {
|
|
1961
|
+
this.selectedIndex = Math.min(this.filteredItems.length - 1, this.selectedIndex + 1);
|
|
1962
|
+
this.notifySelectionChange();
|
|
1963
|
+
return;
|
|
1964
|
+
}
|
|
1965
|
+
if (matchesKey(keyData, "enter")) {
|
|
1966
|
+
const item = this.filteredItems[this.selectedIndex];
|
|
1967
|
+
if (item && this.onSelect) this.onSelect(item);
|
|
1968
|
+
return;
|
|
1969
|
+
}
|
|
1970
|
+
if (matchesKey(keyData, "escape") || keyData === "") {
|
|
1971
|
+
if (this.onCancel) this.onCancel();
|
|
1972
|
+
return;
|
|
1973
|
+
}
|
|
1974
|
+
const prevValue = this.searchInput.getValue();
|
|
1975
|
+
this.searchInput.handleInput(keyData);
|
|
1976
|
+
if (prevValue !== this.searchInput.getValue()) this.updateFilter();
|
|
1977
|
+
}
|
|
1978
|
+
notifySelectionChange() {
|
|
1979
|
+
const item = this.filteredItems[this.selectedIndex];
|
|
1980
|
+
if (item && this.onSelectionChange) this.onSelectionChange(item);
|
|
1981
|
+
}
|
|
1982
|
+
getSelectedItem() {
|
|
1983
|
+
return this.filteredItems[this.selectedIndex] ?? null;
|
|
1984
|
+
}
|
|
1985
|
+
};
|
|
1986
|
+
//#endregion
|
|
1987
|
+
//#region src/tui/components/selectors.ts
|
|
1988
|
+
function createSearchableSelectList(items, maxVisible = 7) {
|
|
1989
|
+
return new SearchableSelectList(items, maxVisible, searchableSelectListTheme);
|
|
1990
|
+
}
|
|
1991
|
+
function createFilterableSelectList(items, maxVisible = 7) {
|
|
1992
|
+
return new FilterableSelectList(items, maxVisible, filterableSelectListTheme);
|
|
1993
|
+
}
|
|
1994
|
+
function createSettingsList(items, onChange, onCancel, maxVisible = 7) {
|
|
1995
|
+
return new SettingsList(items, maxVisible, settingsListTheme, onChange, onCancel);
|
|
1996
|
+
}
|
|
1997
|
+
//#endregion
|
|
1998
|
+
//#region src/tui/tui-status-summary.ts
|
|
1999
|
+
function formatStatusSummary(summary) {
|
|
2000
|
+
const lines = [];
|
|
2001
|
+
lines.push("Gateway status");
|
|
2002
|
+
if (summary.runtimeVersion) lines.push(`Version: ${summary.runtimeVersion}`);
|
|
2003
|
+
if (!summary.linkChannel) lines.push("Link channel: unknown");
|
|
2004
|
+
else {
|
|
2005
|
+
const linkLabel = summary.linkChannel.label ?? "Link channel";
|
|
2006
|
+
const linked = summary.linkChannel.linked === true;
|
|
2007
|
+
const authAge = linked && typeof summary.linkChannel.authAgeMs === "number" ? ` (last refreshed ${formatTimeAgo(summary.linkChannel.authAgeMs)})` : "";
|
|
2008
|
+
lines.push(`${linkLabel}: ${linked ? "linked" : "not linked"}${authAge}`);
|
|
2009
|
+
}
|
|
2010
|
+
const providerSummary = Array.isArray(summary.providerSummary) ? summary.providerSummary : [];
|
|
2011
|
+
if (providerSummary.length > 0) {
|
|
2012
|
+
lines.push("");
|
|
2013
|
+
lines.push("System:");
|
|
2014
|
+
for (const line of providerSummary) lines.push(` ${line}`);
|
|
2015
|
+
}
|
|
2016
|
+
const heartbeatAgents = summary.heartbeat?.agents ?? [];
|
|
2017
|
+
if (heartbeatAgents.length > 0) {
|
|
2018
|
+
const heartbeatParts = heartbeatAgents.map((agent) => {
|
|
2019
|
+
const agentId = agent.agentId ?? "unknown";
|
|
2020
|
+
if (!agent.enabled || !agent.everyMs) return `disabled (${agentId})`;
|
|
2021
|
+
return `${agent.every ?? "unknown"} (${agentId})`;
|
|
2022
|
+
});
|
|
2023
|
+
lines.push("");
|
|
2024
|
+
lines.push(`Heartbeat: ${heartbeatParts.join(", ")}`);
|
|
2025
|
+
}
|
|
2026
|
+
const sessionPaths = summary.sessions?.paths ?? [];
|
|
2027
|
+
if (sessionPaths.length === 1) lines.push(`Session store: ${sessionPaths[0]}`);
|
|
2028
|
+
else if (sessionPaths.length > 1) lines.push(`Session stores: ${sessionPaths.length}`);
|
|
2029
|
+
const defaults = summary.sessions?.defaults;
|
|
2030
|
+
const defaultModel = defaults?.model ?? "unknown";
|
|
2031
|
+
const defaultCtx = typeof defaults?.contextTokens === "number" ? ` (${formatTokenCount(defaults.contextTokens)} ctx)` : "";
|
|
2032
|
+
lines.push(`Default model: ${defaultModel}${defaultCtx}`);
|
|
2033
|
+
const sessionCount = summary.sessions?.count ?? 0;
|
|
2034
|
+
lines.push(`Active sessions: ${sessionCount}`);
|
|
2035
|
+
const recent = Array.isArray(summary.sessions?.recent) ? summary.sessions?.recent : [];
|
|
2036
|
+
if (recent.length > 0) {
|
|
2037
|
+
lines.push("Recent sessions:");
|
|
2038
|
+
for (const entry of recent) {
|
|
2039
|
+
const ageLabel = typeof entry.age === "number" ? formatTimeAgo(entry.age) : "no activity";
|
|
2040
|
+
const model = entry.model ?? "unknown";
|
|
2041
|
+
const usage = formatContextUsageLine({
|
|
2042
|
+
total: entry.totalTokens ?? null,
|
|
2043
|
+
context: entry.contextTokens ?? null,
|
|
2044
|
+
remaining: entry.remainingTokens ?? null,
|
|
2045
|
+
percent: entry.percentUsed ?? null
|
|
2046
|
+
});
|
|
2047
|
+
const flags = entry.flags?.length ? ` | flags: ${entry.flags.join(", ")}` : "";
|
|
2048
|
+
lines.push(`- ${entry.key}${entry.kind ? ` [${entry.kind}]` : ""} | ${ageLabel} | model ${model} | ${usage}${flags}`);
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
const queued = Array.isArray(summary.queuedSystemEvents) ? summary.queuedSystemEvents : [];
|
|
2052
|
+
if (queued.length > 0) {
|
|
2053
|
+
const preview = queued.slice(0, 3).join(" | ");
|
|
2054
|
+
lines.push(`Queued system events (${queued.length}): ${preview}`);
|
|
2055
|
+
}
|
|
2056
|
+
return lines;
|
|
2057
|
+
}
|
|
2058
|
+
//#endregion
|
|
2059
|
+
//#region src/tui/tui-command-handlers.ts
|
|
2060
|
+
function isBtwCommand(text) {
|
|
2061
|
+
return /^\/btw(?::|\s|$)/i.test(text.trim());
|
|
2062
|
+
}
|
|
2063
|
+
function createCommandHandlers(context) {
|
|
2064
|
+
const { client, chatLog, tui, opts, state, deliverDefault, openOverlay, closeOverlay, refreshSessionInfo, loadHistory, setSession, refreshAgents, abortActive, setActivityStatus, formatSessionKey, applySessionInfoFromPatch, noteLocalBtwRunId, forgetLocalRunId, forgetLocalBtwRunId, requestExit } = context;
|
|
2065
|
+
const setAgent = async (id) => {
|
|
2066
|
+
state.currentAgentId = normalizeAgentId(id);
|
|
2067
|
+
await setSession("");
|
|
2068
|
+
};
|
|
2069
|
+
const closeOverlayAndRender = () => {
|
|
2070
|
+
closeOverlay();
|
|
2071
|
+
tui.requestRender();
|
|
2072
|
+
};
|
|
2073
|
+
const openSelector = (selector, onSelect) => {
|
|
2074
|
+
selector.onSelect = (item) => {
|
|
2075
|
+
(async () => {
|
|
2076
|
+
await onSelect(item.value);
|
|
2077
|
+
closeOverlayAndRender();
|
|
2078
|
+
})();
|
|
2079
|
+
};
|
|
2080
|
+
selector.onCancel = closeOverlayAndRender;
|
|
2081
|
+
openOverlay(selector);
|
|
2082
|
+
tui.requestRender();
|
|
2083
|
+
};
|
|
2084
|
+
const openModelSelector = async () => {
|
|
2085
|
+
try {
|
|
2086
|
+
const models = await client.listModels();
|
|
2087
|
+
if (models.length === 0) {
|
|
2088
|
+
chatLog.addSystem("no models available");
|
|
2089
|
+
tui.requestRender();
|
|
2090
|
+
return;
|
|
2091
|
+
}
|
|
2092
|
+
openSelector(createSearchableSelectList(models.map((model) => ({
|
|
2093
|
+
value: `${model.provider}/${model.id}`,
|
|
2094
|
+
label: `${model.provider}/${model.id}`,
|
|
2095
|
+
description: model.name && model.name !== model.id ? model.name : ""
|
|
2096
|
+
})), 9), async (value) => {
|
|
2097
|
+
try {
|
|
2098
|
+
const result = await client.patchSession({
|
|
2099
|
+
key: state.currentSessionKey,
|
|
2100
|
+
model: value
|
|
2101
|
+
});
|
|
2102
|
+
chatLog.addSystem(`model set to ${value}`);
|
|
2103
|
+
applySessionInfoFromPatch(result);
|
|
2104
|
+
await refreshSessionInfo();
|
|
2105
|
+
} catch (err) {
|
|
2106
|
+
chatLog.addSystem(`model set failed: ${String(err)}`);
|
|
2107
|
+
}
|
|
2108
|
+
});
|
|
2109
|
+
} catch (err) {
|
|
2110
|
+
chatLog.addSystem(`model list failed: ${String(err)}`);
|
|
2111
|
+
tui.requestRender();
|
|
2112
|
+
}
|
|
2113
|
+
};
|
|
2114
|
+
const openAgentSelector = async () => {
|
|
2115
|
+
await refreshAgents();
|
|
2116
|
+
if (state.agents.length === 0) {
|
|
2117
|
+
chatLog.addSystem("no agents found");
|
|
2118
|
+
tui.requestRender();
|
|
2119
|
+
return;
|
|
2120
|
+
}
|
|
2121
|
+
openSelector(createSearchableSelectList(state.agents.map((agent) => ({
|
|
2122
|
+
value: agent.id,
|
|
2123
|
+
label: agent.name ? `${agent.id} (${agent.name})` : agent.id,
|
|
2124
|
+
description: agent.id === state.agentDefaultId ? "default" : ""
|
|
2125
|
+
})), 9), async (value) => {
|
|
2126
|
+
await setAgent(value);
|
|
2127
|
+
});
|
|
2128
|
+
};
|
|
2129
|
+
const openSessionSelector = async () => {
|
|
2130
|
+
try {
|
|
2131
|
+
openSelector(createFilterableSelectList((await client.listSessions({
|
|
2132
|
+
includeGlobal: false,
|
|
2133
|
+
includeUnknown: false,
|
|
2134
|
+
includeDerivedTitles: true,
|
|
2135
|
+
includeLastMessage: true,
|
|
2136
|
+
agentId: state.currentAgentId
|
|
2137
|
+
})).sessions.map((session) => {
|
|
2138
|
+
const title = session.derivedTitle ?? session.displayName;
|
|
2139
|
+
const formattedKey = formatSessionKey(session.key);
|
|
2140
|
+
const label = title && title !== formattedKey ? `${title} (${formattedKey})` : formattedKey;
|
|
2141
|
+
const timePart = session.updatedAt ? formatRelativeTimestamp(session.updatedAt, {
|
|
2142
|
+
dateFallback: true,
|
|
2143
|
+
fallback: ""
|
|
2144
|
+
}) : "";
|
|
2145
|
+
const preview = session.lastMessagePreview?.replace(/\s+/g, " ").trim();
|
|
2146
|
+
const description = timePart && preview ? `${timePart} · ${preview}` : preview ?? timePart;
|
|
2147
|
+
return {
|
|
2148
|
+
value: session.key,
|
|
2149
|
+
label,
|
|
2150
|
+
description,
|
|
2151
|
+
searchText: [
|
|
2152
|
+
session.displayName,
|
|
2153
|
+
session.label,
|
|
2154
|
+
session.subject,
|
|
2155
|
+
session.sessionId,
|
|
2156
|
+
session.key,
|
|
2157
|
+
session.lastMessagePreview
|
|
2158
|
+
].filter(Boolean).join(" ")
|
|
2159
|
+
};
|
|
2160
|
+
}), 9), async (value) => {
|
|
2161
|
+
await setSession(value);
|
|
2162
|
+
});
|
|
2163
|
+
} catch (err) {
|
|
2164
|
+
chatLog.addSystem(`sessions list failed: ${String(err)}`);
|
|
2165
|
+
tui.requestRender();
|
|
2166
|
+
}
|
|
2167
|
+
};
|
|
2168
|
+
const openSettings = () => {
|
|
2169
|
+
openOverlay(createSettingsList([{
|
|
2170
|
+
id: "tools",
|
|
2171
|
+
label: "Tool output",
|
|
2172
|
+
currentValue: state.toolsExpanded ? "expanded" : "collapsed",
|
|
2173
|
+
values: ["collapsed", "expanded"]
|
|
2174
|
+
}, {
|
|
2175
|
+
id: "thinking",
|
|
2176
|
+
label: "Show thinking",
|
|
2177
|
+
currentValue: state.showThinking ? "on" : "off",
|
|
2178
|
+
values: ["off", "on"]
|
|
2179
|
+
}], (id, value) => {
|
|
2180
|
+
if (id === "tools") {
|
|
2181
|
+
state.toolsExpanded = value === "expanded";
|
|
2182
|
+
chatLog.setToolsExpanded(state.toolsExpanded);
|
|
2183
|
+
}
|
|
2184
|
+
if (id === "thinking") {
|
|
2185
|
+
state.showThinking = value === "on";
|
|
2186
|
+
loadHistory();
|
|
2187
|
+
}
|
|
2188
|
+
tui.requestRender();
|
|
2189
|
+
}, () => {
|
|
2190
|
+
closeOverlay();
|
|
2191
|
+
tui.requestRender();
|
|
2192
|
+
}));
|
|
2193
|
+
tui.requestRender();
|
|
2194
|
+
};
|
|
2195
|
+
const handleCommand = async (raw) => {
|
|
2196
|
+
const { name, args } = parseCommand(raw);
|
|
2197
|
+
if (!name) return;
|
|
2198
|
+
switch (name) {
|
|
2199
|
+
case "help":
|
|
2200
|
+
chatLog.addSystem(helpText({
|
|
2201
|
+
provider: state.sessionInfo.modelProvider,
|
|
2202
|
+
model: state.sessionInfo.model
|
|
2203
|
+
}));
|
|
2204
|
+
break;
|
|
2205
|
+
case "gateway-status":
|
|
2206
|
+
try {
|
|
2207
|
+
const status = await client.getGatewayStatus();
|
|
2208
|
+
if (typeof status === "string") {
|
|
2209
|
+
chatLog.addSystem(status);
|
|
2210
|
+
break;
|
|
2211
|
+
}
|
|
2212
|
+
if (status && typeof status === "object") {
|
|
2213
|
+
const lines = formatStatusSummary(status);
|
|
2214
|
+
for (const line of lines) chatLog.addSystem(line);
|
|
2215
|
+
break;
|
|
2216
|
+
}
|
|
2217
|
+
chatLog.addSystem("status: unknown response");
|
|
2218
|
+
} catch (err) {
|
|
2219
|
+
chatLog.addSystem(`status failed: ${String(err)}`);
|
|
2220
|
+
}
|
|
2221
|
+
break;
|
|
2222
|
+
case "agent":
|
|
2223
|
+
if (!args) await openAgentSelector();
|
|
2224
|
+
else await setAgent(args);
|
|
2225
|
+
break;
|
|
2226
|
+
case "agents":
|
|
2227
|
+
await openAgentSelector();
|
|
2228
|
+
break;
|
|
2229
|
+
case "session":
|
|
2230
|
+
if (!args) await openSessionSelector();
|
|
2231
|
+
else await setSession(args);
|
|
2232
|
+
break;
|
|
2233
|
+
case "sessions":
|
|
2234
|
+
await openSessionSelector();
|
|
2235
|
+
break;
|
|
2236
|
+
case "model":
|
|
2237
|
+
if (!args) await openModelSelector();
|
|
2238
|
+
else try {
|
|
2239
|
+
const result = await client.patchSession({
|
|
2240
|
+
key: state.currentSessionKey,
|
|
2241
|
+
model: args
|
|
2242
|
+
});
|
|
2243
|
+
chatLog.addSystem(`model set to ${args}`);
|
|
2244
|
+
applySessionInfoFromPatch(result);
|
|
2245
|
+
await refreshSessionInfo();
|
|
2246
|
+
} catch (err) {
|
|
2247
|
+
chatLog.addSystem(`model set failed: ${String(err)}`);
|
|
2248
|
+
}
|
|
2249
|
+
break;
|
|
2250
|
+
case "models":
|
|
2251
|
+
await openModelSelector();
|
|
2252
|
+
break;
|
|
2253
|
+
case "think":
|
|
2254
|
+
if (!args) {
|
|
2255
|
+
const levels = formatThinkingLevels(state.sessionInfo.modelProvider, state.sessionInfo.model, "|");
|
|
2256
|
+
chatLog.addSystem(`usage: /think <${levels}>`);
|
|
2257
|
+
break;
|
|
2258
|
+
}
|
|
2259
|
+
try {
|
|
2260
|
+
const result = await client.patchSession({
|
|
2261
|
+
key: state.currentSessionKey,
|
|
2262
|
+
thinkingLevel: args
|
|
2263
|
+
});
|
|
2264
|
+
chatLog.addSystem(`thinking set to ${args}`);
|
|
2265
|
+
applySessionInfoFromPatch(result);
|
|
2266
|
+
await refreshSessionInfo();
|
|
2267
|
+
} catch (err) {
|
|
2268
|
+
chatLog.addSystem(`think failed: ${String(err)}`);
|
|
2269
|
+
}
|
|
2270
|
+
break;
|
|
2271
|
+
case "verbose":
|
|
2272
|
+
if (!args) {
|
|
2273
|
+
chatLog.addSystem("usage: /verbose <on|off>");
|
|
2274
|
+
break;
|
|
2275
|
+
}
|
|
2276
|
+
try {
|
|
2277
|
+
const result = await client.patchSession({
|
|
2278
|
+
key: state.currentSessionKey,
|
|
2279
|
+
verboseLevel: args
|
|
2280
|
+
});
|
|
2281
|
+
chatLog.addSystem(`verbose set to ${args}`);
|
|
2282
|
+
applySessionInfoFromPatch(result);
|
|
2283
|
+
await loadHistory();
|
|
2284
|
+
} catch (err) {
|
|
2285
|
+
chatLog.addSystem(`verbose failed: ${String(err)}`);
|
|
2286
|
+
}
|
|
2287
|
+
break;
|
|
2288
|
+
case "fast":
|
|
2289
|
+
if (!args || args === "status") {
|
|
2290
|
+
chatLog.addSystem(`fast mode: ${state.sessionInfo.fastMode ? "on" : "off"}`);
|
|
2291
|
+
break;
|
|
2292
|
+
}
|
|
2293
|
+
if (args !== "on" && args !== "off") {
|
|
2294
|
+
chatLog.addSystem("usage: /fast <status|on|off>");
|
|
2295
|
+
break;
|
|
2296
|
+
}
|
|
2297
|
+
try {
|
|
2298
|
+
const result = await client.patchSession({
|
|
2299
|
+
key: state.currentSessionKey,
|
|
2300
|
+
fastMode: args === "on"
|
|
2301
|
+
});
|
|
2302
|
+
chatLog.addSystem(`fast mode ${args === "on" ? "enabled" : "disabled"}`);
|
|
2303
|
+
applySessionInfoFromPatch(result);
|
|
2304
|
+
await refreshSessionInfo();
|
|
2305
|
+
} catch (err) {
|
|
2306
|
+
chatLog.addSystem(`fast failed: ${String(err)}`);
|
|
2307
|
+
}
|
|
2308
|
+
break;
|
|
2309
|
+
case "reasoning":
|
|
2310
|
+
if (!args) {
|
|
2311
|
+
chatLog.addSystem("usage: /reasoning <on|off>");
|
|
2312
|
+
break;
|
|
2313
|
+
}
|
|
2314
|
+
try {
|
|
2315
|
+
const result = await client.patchSession({
|
|
2316
|
+
key: state.currentSessionKey,
|
|
2317
|
+
reasoningLevel: args
|
|
2318
|
+
});
|
|
2319
|
+
chatLog.addSystem(`reasoning set to ${args}`);
|
|
2320
|
+
applySessionInfoFromPatch(result);
|
|
2321
|
+
await refreshSessionInfo();
|
|
2322
|
+
} catch (err) {
|
|
2323
|
+
chatLog.addSystem(`reasoning failed: ${String(err)}`);
|
|
2324
|
+
}
|
|
2325
|
+
break;
|
|
2326
|
+
case "usage": {
|
|
2327
|
+
const normalized = args ? normalizeUsageDisplay(args) : void 0;
|
|
2328
|
+
if (args && !normalized) {
|
|
2329
|
+
chatLog.addSystem("usage: /usage <off|tokens|full>");
|
|
2330
|
+
break;
|
|
2331
|
+
}
|
|
2332
|
+
const currentRaw = state.sessionInfo.responseUsage;
|
|
2333
|
+
const current = resolveResponseUsageMode(currentRaw);
|
|
2334
|
+
const next = normalized ?? (current === "off" ? "tokens" : current === "tokens" ? "full" : "off");
|
|
2335
|
+
try {
|
|
2336
|
+
const result = await client.patchSession({
|
|
2337
|
+
key: state.currentSessionKey,
|
|
2338
|
+
responseUsage: next === "off" ? null : next
|
|
2339
|
+
});
|
|
2340
|
+
chatLog.addSystem(`usage footer: ${next}`);
|
|
2341
|
+
applySessionInfoFromPatch(result);
|
|
2342
|
+
await refreshSessionInfo();
|
|
2343
|
+
} catch (err) {
|
|
2344
|
+
chatLog.addSystem(`usage failed: ${String(err)}`);
|
|
2345
|
+
}
|
|
2346
|
+
break;
|
|
2347
|
+
}
|
|
2348
|
+
case "elevated":
|
|
2349
|
+
if (!args) {
|
|
2350
|
+
chatLog.addSystem("usage: /elevated <on|off|ask|full>");
|
|
2351
|
+
break;
|
|
2352
|
+
}
|
|
2353
|
+
if (![
|
|
2354
|
+
"on",
|
|
2355
|
+
"off",
|
|
2356
|
+
"ask",
|
|
2357
|
+
"full"
|
|
2358
|
+
].includes(args)) {
|
|
2359
|
+
chatLog.addSystem("usage: /elevated <on|off|ask|full>");
|
|
2360
|
+
break;
|
|
2361
|
+
}
|
|
2362
|
+
try {
|
|
2363
|
+
const result = await client.patchSession({
|
|
2364
|
+
key: state.currentSessionKey,
|
|
2365
|
+
elevatedLevel: args
|
|
2366
|
+
});
|
|
2367
|
+
chatLog.addSystem(`elevated set to ${args}`);
|
|
2368
|
+
applySessionInfoFromPatch(result);
|
|
2369
|
+
await refreshSessionInfo();
|
|
2370
|
+
} catch (err) {
|
|
2371
|
+
chatLog.addSystem(`elevated failed: ${String(err)}`);
|
|
2372
|
+
}
|
|
2373
|
+
break;
|
|
2374
|
+
case "activation":
|
|
2375
|
+
if (!args) {
|
|
2376
|
+
chatLog.addSystem("usage: /activation <mention|always>");
|
|
2377
|
+
break;
|
|
2378
|
+
}
|
|
2379
|
+
const activation = normalizeGroupActivation(args);
|
|
2380
|
+
if (!activation) {
|
|
2381
|
+
chatLog.addSystem("usage: /activation <mention|always>");
|
|
2382
|
+
break;
|
|
2383
|
+
}
|
|
2384
|
+
try {
|
|
2385
|
+
const result = await client.patchSession({
|
|
2386
|
+
key: state.currentSessionKey,
|
|
2387
|
+
groupActivation: activation
|
|
2388
|
+
});
|
|
2389
|
+
chatLog.addSystem(`activation set to ${activation}`);
|
|
2390
|
+
applySessionInfoFromPatch(result);
|
|
2391
|
+
await refreshSessionInfo();
|
|
2392
|
+
} catch (err) {
|
|
2393
|
+
chatLog.addSystem(`activation failed: ${String(err)}`);
|
|
2394
|
+
}
|
|
2395
|
+
break;
|
|
2396
|
+
case "new":
|
|
2397
|
+
try {
|
|
2398
|
+
state.sessionInfo.inputTokens = null;
|
|
2399
|
+
state.sessionInfo.outputTokens = null;
|
|
2400
|
+
state.sessionInfo.totalTokens = null;
|
|
2401
|
+
tui.requestRender();
|
|
2402
|
+
const uniqueKey = `tui-${randomUUID()}`;
|
|
2403
|
+
await setSession(uniqueKey);
|
|
2404
|
+
chatLog.addSystem(`new session: ${uniqueKey}`);
|
|
2405
|
+
} catch (err) {
|
|
2406
|
+
chatLog.addSystem(`new session failed: ${sanitizeRenderableText(String(err))}`);
|
|
2407
|
+
}
|
|
2408
|
+
break;
|
|
2409
|
+
case "reset":
|
|
2410
|
+
try {
|
|
2411
|
+
state.sessionInfo.inputTokens = null;
|
|
2412
|
+
state.sessionInfo.outputTokens = null;
|
|
2413
|
+
state.sessionInfo.totalTokens = null;
|
|
2414
|
+
tui.requestRender();
|
|
2415
|
+
await client.resetSession(state.currentSessionKey, name);
|
|
2416
|
+
chatLog.addSystem(`session ${state.currentSessionKey} reset`);
|
|
2417
|
+
await loadHistory();
|
|
2418
|
+
} catch (err) {
|
|
2419
|
+
chatLog.addSystem(`reset failed: ${sanitizeRenderableText(String(err))}`);
|
|
2420
|
+
}
|
|
2421
|
+
break;
|
|
2422
|
+
case "abort":
|
|
2423
|
+
await abortActive();
|
|
2424
|
+
break;
|
|
2425
|
+
case "settings":
|
|
2426
|
+
openSettings();
|
|
2427
|
+
break;
|
|
2428
|
+
case "exit":
|
|
2429
|
+
case "quit":
|
|
2430
|
+
requestExit();
|
|
2431
|
+
break;
|
|
2432
|
+
default:
|
|
2433
|
+
await sendMessage(raw);
|
|
2434
|
+
break;
|
|
2435
|
+
}
|
|
2436
|
+
tui.requestRender();
|
|
2437
|
+
};
|
|
2438
|
+
const sendMessage = async (text) => {
|
|
2439
|
+
if (!state.isConnected) {
|
|
2440
|
+
chatLog.addSystem("not connected to gateway — message not sent");
|
|
2441
|
+
setActivityStatus("disconnected");
|
|
2442
|
+
tui.requestRender();
|
|
2443
|
+
return;
|
|
2444
|
+
}
|
|
2445
|
+
const isBtw = isBtwCommand(text);
|
|
2446
|
+
const runId = randomUUID();
|
|
2447
|
+
try {
|
|
2448
|
+
if (!isBtw) {
|
|
2449
|
+
chatLog.addUser(text);
|
|
2450
|
+
state.pendingOptimisticUserMessage = true;
|
|
2451
|
+
setActivityStatus("sending");
|
|
2452
|
+
} else noteLocalBtwRunId?.(runId);
|
|
2453
|
+
tui.requestRender();
|
|
2454
|
+
await client.sendChat({
|
|
2455
|
+
sessionKey: state.currentSessionKey,
|
|
2456
|
+
message: text,
|
|
2457
|
+
thinking: opts.thinking,
|
|
2458
|
+
deliver: deliverDefault,
|
|
2459
|
+
timeoutMs: opts.timeoutMs,
|
|
2460
|
+
runId
|
|
2461
|
+
});
|
|
2462
|
+
if (!isBtw) {
|
|
2463
|
+
setActivityStatus("waiting");
|
|
2464
|
+
tui.requestRender();
|
|
2465
|
+
}
|
|
2466
|
+
} catch (err) {
|
|
2467
|
+
if (isBtw) forgetLocalBtwRunId?.(runId);
|
|
2468
|
+
if (!isBtw && state.activeChatRunId) forgetLocalRunId?.(state.activeChatRunId);
|
|
2469
|
+
if (!isBtw) {
|
|
2470
|
+
state.pendingOptimisticUserMessage = false;
|
|
2471
|
+
state.activeChatRunId = null;
|
|
2472
|
+
}
|
|
2473
|
+
chatLog.addSystem(`${isBtw ? "btw failed" : "send failed"}: ${String(err)}`);
|
|
2474
|
+
if (!isBtw) setActivityStatus("error");
|
|
2475
|
+
tui.requestRender();
|
|
2476
|
+
}
|
|
2477
|
+
};
|
|
2478
|
+
return {
|
|
2479
|
+
handleCommand,
|
|
2480
|
+
sendMessage,
|
|
2481
|
+
openModelSelector,
|
|
2482
|
+
openAgentSelector,
|
|
2483
|
+
openSessionSelector,
|
|
2484
|
+
openSettings,
|
|
2485
|
+
setAgent
|
|
2486
|
+
};
|
|
2487
|
+
}
|
|
2488
|
+
//#endregion
|
|
2489
|
+
//#region src/tui/tui-stream-assembler.ts
|
|
2490
|
+
function extractTextBlocksAndSignals(message) {
|
|
2491
|
+
if (!message || typeof message !== "object") return {
|
|
2492
|
+
textBlocks: [],
|
|
2493
|
+
sawNonTextContentBlocks: false
|
|
2494
|
+
};
|
|
2495
|
+
const content = message.content;
|
|
2496
|
+
if (typeof content === "string") {
|
|
2497
|
+
const text = content.trim();
|
|
2498
|
+
return {
|
|
2499
|
+
textBlocks: text ? [text] : [],
|
|
2500
|
+
sawNonTextContentBlocks: false
|
|
2501
|
+
};
|
|
2502
|
+
}
|
|
2503
|
+
if (!Array.isArray(content)) return {
|
|
2504
|
+
textBlocks: [],
|
|
2505
|
+
sawNonTextContentBlocks: false
|
|
2506
|
+
};
|
|
2507
|
+
const textBlocks = [];
|
|
2508
|
+
let sawNonTextContentBlocks = false;
|
|
2509
|
+
for (const block of content) {
|
|
2510
|
+
if (!block || typeof block !== "object") continue;
|
|
2511
|
+
const rec = block;
|
|
2512
|
+
if (rec.type === "text" && typeof rec.text === "string") {
|
|
2513
|
+
const text = rec.text.trim();
|
|
2514
|
+
if (text) textBlocks.push(text);
|
|
2515
|
+
continue;
|
|
2516
|
+
}
|
|
2517
|
+
if (typeof rec.type === "string" && rec.type !== "thinking") sawNonTextContentBlocks = true;
|
|
2518
|
+
}
|
|
2519
|
+
return {
|
|
2520
|
+
textBlocks,
|
|
2521
|
+
sawNonTextContentBlocks
|
|
2522
|
+
};
|
|
2523
|
+
}
|
|
2524
|
+
function isDroppedBoundaryTextBlockSubset(params) {
|
|
2525
|
+
const { streamedTextBlocks, finalTextBlocks } = params;
|
|
2526
|
+
if (finalTextBlocks.length === 0 || finalTextBlocks.length >= streamedTextBlocks.length) return false;
|
|
2527
|
+
if (finalTextBlocks.every((block, index) => streamedTextBlocks[index] === block)) return true;
|
|
2528
|
+
const suffixStart = streamedTextBlocks.length - finalTextBlocks.length;
|
|
2529
|
+
return finalTextBlocks.every((block, index) => streamedTextBlocks[suffixStart + index] === block);
|
|
2530
|
+
}
|
|
2531
|
+
function shouldPreserveBoundaryDroppedText(params) {
|
|
2532
|
+
if (params.boundaryDropMode === "off") return false;
|
|
2533
|
+
if (!(params.boundaryDropMode === "streamed-or-incoming" ? params.streamedSawNonTextContentBlocks || params.incomingSawNonTextContentBlocks : params.streamedSawNonTextContentBlocks)) return false;
|
|
2534
|
+
return isDroppedBoundaryTextBlockSubset({
|
|
2535
|
+
streamedTextBlocks: params.streamedTextBlocks,
|
|
2536
|
+
finalTextBlocks: params.nextContentBlocks
|
|
2537
|
+
});
|
|
2538
|
+
}
|
|
2539
|
+
var TuiStreamAssembler = class {
|
|
2540
|
+
constructor() {
|
|
2541
|
+
this.runs = /* @__PURE__ */ new Map();
|
|
2542
|
+
}
|
|
2543
|
+
getOrCreateRun(runId) {
|
|
2544
|
+
let state = this.runs.get(runId);
|
|
2545
|
+
if (!state) {
|
|
2546
|
+
state = {
|
|
2547
|
+
thinkingText: "",
|
|
2548
|
+
contentText: "",
|
|
2549
|
+
contentBlocks: [],
|
|
2550
|
+
sawNonTextContentBlocks: false,
|
|
2551
|
+
displayText: ""
|
|
2552
|
+
};
|
|
2553
|
+
this.runs.set(runId, state);
|
|
2554
|
+
}
|
|
2555
|
+
return state;
|
|
2556
|
+
}
|
|
2557
|
+
updateRunState(state, message, showThinking, opts) {
|
|
2558
|
+
const thinkingText = extractThinkingFromMessage(message);
|
|
2559
|
+
const contentText = extractContentFromMessage(message);
|
|
2560
|
+
const { textBlocks, sawNonTextContentBlocks } = extractTextBlocksAndSignals(message);
|
|
2561
|
+
if (thinkingText) state.thinkingText = thinkingText;
|
|
2562
|
+
if (contentText) {
|
|
2563
|
+
const nextContentBlocks = textBlocks.length > 0 ? textBlocks : [contentText];
|
|
2564
|
+
if (!shouldPreserveBoundaryDroppedText({
|
|
2565
|
+
boundaryDropMode: opts?.boundaryDropMode ?? "off",
|
|
2566
|
+
streamedSawNonTextContentBlocks: state.sawNonTextContentBlocks,
|
|
2567
|
+
incomingSawNonTextContentBlocks: sawNonTextContentBlocks,
|
|
2568
|
+
streamedTextBlocks: state.contentBlocks,
|
|
2569
|
+
nextContentBlocks
|
|
2570
|
+
})) {
|
|
2571
|
+
state.contentText = contentText;
|
|
2572
|
+
state.contentBlocks = nextContentBlocks;
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
if (sawNonTextContentBlocks) state.sawNonTextContentBlocks = true;
|
|
2576
|
+
state.displayText = composeThinkingAndContent({
|
|
2577
|
+
thinkingText: state.thinkingText,
|
|
2578
|
+
contentText: state.contentText,
|
|
2579
|
+
showThinking
|
|
2580
|
+
});
|
|
2581
|
+
}
|
|
2582
|
+
ingestDelta(runId, message, showThinking) {
|
|
2583
|
+
const state = this.getOrCreateRun(runId);
|
|
2584
|
+
const previousDisplayText = state.displayText;
|
|
2585
|
+
this.updateRunState(state, message, showThinking, { boundaryDropMode: "streamed-or-incoming" });
|
|
2586
|
+
if (!state.displayText || state.displayText === previousDisplayText) return null;
|
|
2587
|
+
return state.displayText;
|
|
2588
|
+
}
|
|
2589
|
+
finalize(runId, message, showThinking, errorMessage) {
|
|
2590
|
+
const state = this.getOrCreateRun(runId);
|
|
2591
|
+
const streamedDisplayText = state.displayText;
|
|
2592
|
+
const streamedTextBlocks = [...state.contentBlocks];
|
|
2593
|
+
const streamedSawNonTextContentBlocks = state.sawNonTextContentBlocks;
|
|
2594
|
+
this.updateRunState(state, message, showThinking, { boundaryDropMode: "streamed-only" });
|
|
2595
|
+
const finalComposed = state.displayText;
|
|
2596
|
+
const finalText = resolveFinalAssistantText({
|
|
2597
|
+
finalText: streamedSawNonTextContentBlocks && isDroppedBoundaryTextBlockSubset({
|
|
2598
|
+
streamedTextBlocks,
|
|
2599
|
+
finalTextBlocks: state.contentBlocks
|
|
2600
|
+
}) ? streamedDisplayText : finalComposed,
|
|
2601
|
+
streamedText: streamedDisplayText,
|
|
2602
|
+
errorMessage
|
|
2603
|
+
});
|
|
2604
|
+
this.runs.delete(runId);
|
|
2605
|
+
return finalText;
|
|
2606
|
+
}
|
|
2607
|
+
drop(runId) {
|
|
2608
|
+
this.runs.delete(runId);
|
|
2609
|
+
}
|
|
2610
|
+
};
|
|
2611
|
+
//#endregion
|
|
2612
|
+
//#region src/tui/tui-event-handlers.ts
|
|
2613
|
+
function createEventHandlers(context) {
|
|
2614
|
+
const { chatLog, btw, tui, state, setActivityStatus, refreshSessionInfo, loadHistory, noteLocalRunId, isLocalRunId, forgetLocalRunId, clearLocalRunIds, isLocalBtwRunId, forgetLocalBtwRunId, clearLocalBtwRunIds } = context;
|
|
2615
|
+
const finalizedRuns = /* @__PURE__ */ new Map();
|
|
2616
|
+
const sessionRuns = /* @__PURE__ */ new Map();
|
|
2617
|
+
let streamAssembler = new TuiStreamAssembler();
|
|
2618
|
+
let lastSessionKey = state.currentSessionKey;
|
|
2619
|
+
let pendingHistoryRefresh = false;
|
|
2620
|
+
const pruneRunMap = (runs) => {
|
|
2621
|
+
if (runs.size <= 200) return;
|
|
2622
|
+
const keepUntil = Date.now() - 600 * 1e3;
|
|
2623
|
+
for (const [key, ts] of runs) {
|
|
2624
|
+
if (runs.size <= 150) break;
|
|
2625
|
+
if (ts < keepUntil) runs.delete(key);
|
|
2626
|
+
}
|
|
2627
|
+
if (runs.size > 200) for (const key of runs.keys()) {
|
|
2628
|
+
runs.delete(key);
|
|
2629
|
+
if (runs.size <= 150) break;
|
|
2630
|
+
}
|
|
2631
|
+
};
|
|
2632
|
+
const syncSessionKey = () => {
|
|
2633
|
+
if (state.currentSessionKey === lastSessionKey) return;
|
|
2634
|
+
lastSessionKey = state.currentSessionKey;
|
|
2635
|
+
finalizedRuns.clear();
|
|
2636
|
+
sessionRuns.clear();
|
|
2637
|
+
streamAssembler = new TuiStreamAssembler();
|
|
2638
|
+
pendingHistoryRefresh = false;
|
|
2639
|
+
state.pendingOptimisticUserMessage = false;
|
|
2640
|
+
clearLocalRunIds?.();
|
|
2641
|
+
clearLocalBtwRunIds?.();
|
|
2642
|
+
btw.clear();
|
|
2643
|
+
};
|
|
2644
|
+
const flushPendingHistoryRefreshIfIdle = () => {
|
|
2645
|
+
if (!pendingHistoryRefresh || state.activeChatRunId) return;
|
|
2646
|
+
pendingHistoryRefresh = false;
|
|
2647
|
+
loadHistory?.();
|
|
2648
|
+
};
|
|
2649
|
+
const noteSessionRun = (runId) => {
|
|
2650
|
+
sessionRuns.set(runId, Date.now());
|
|
2651
|
+
pruneRunMap(sessionRuns);
|
|
2652
|
+
};
|
|
2653
|
+
const noteFinalizedRun = (runId) => {
|
|
2654
|
+
finalizedRuns.set(runId, Date.now());
|
|
2655
|
+
sessionRuns.delete(runId);
|
|
2656
|
+
streamAssembler.drop(runId);
|
|
2657
|
+
pruneRunMap(finalizedRuns);
|
|
2658
|
+
};
|
|
2659
|
+
const clearActiveRunIfMatch = (runId) => {
|
|
2660
|
+
if (state.activeChatRunId === runId) state.activeChatRunId = null;
|
|
2661
|
+
};
|
|
2662
|
+
const finalizeRun = (params) => {
|
|
2663
|
+
noteFinalizedRun(params.runId);
|
|
2664
|
+
clearActiveRunIfMatch(params.runId);
|
|
2665
|
+
flushPendingHistoryRefreshIfIdle();
|
|
2666
|
+
if (!hasConcurrentActiveRun(params.runId)) setActivityStatus(params.status);
|
|
2667
|
+
refreshSessionInfo?.();
|
|
2668
|
+
};
|
|
2669
|
+
const terminateRun = (params) => {
|
|
2670
|
+
streamAssembler.drop(params.runId);
|
|
2671
|
+
sessionRuns.delete(params.runId);
|
|
2672
|
+
clearActiveRunIfMatch(params.runId);
|
|
2673
|
+
flushPendingHistoryRefreshIfIdle();
|
|
2674
|
+
if (!hasConcurrentActiveRun(params.runId)) setActivityStatus(params.status);
|
|
2675
|
+
refreshSessionInfo?.();
|
|
2676
|
+
};
|
|
2677
|
+
const hasConcurrentActiveRun = (runId) => {
|
|
2678
|
+
const activeRunId = state.activeChatRunId;
|
|
2679
|
+
if (!activeRunId || activeRunId === runId) return false;
|
|
2680
|
+
return sessionRuns.has(activeRunId);
|
|
2681
|
+
};
|
|
2682
|
+
const maybeRefreshHistoryForRun = (runId, opts) => {
|
|
2683
|
+
if (isLocalRunId?.(runId) ?? false) {
|
|
2684
|
+
forgetLocalRunId?.(runId);
|
|
2685
|
+
if (!opts?.allowLocalWithoutDisplayableFinal) return;
|
|
2686
|
+
if (state.activeChatRunId && state.activeChatRunId !== runId) {
|
|
2687
|
+
pendingHistoryRefresh = true;
|
|
2688
|
+
return;
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
if (hasConcurrentActiveRun(runId)) return;
|
|
2692
|
+
pendingHistoryRefresh = false;
|
|
2693
|
+
loadHistory?.();
|
|
2694
|
+
};
|
|
2695
|
+
const isSameSessionKey = (left, right) => {
|
|
2696
|
+
const normalizedLeft = normalizeLowercaseStringOrEmpty(left);
|
|
2697
|
+
const normalizedRight = normalizeLowercaseStringOrEmpty(right);
|
|
2698
|
+
if (!normalizedLeft || !normalizedRight) return false;
|
|
2699
|
+
if (normalizedLeft === normalizedRight) return true;
|
|
2700
|
+
const parsedLeft = parseAgentSessionKey(normalizedLeft);
|
|
2701
|
+
const parsedRight = parseAgentSessionKey(normalizedRight);
|
|
2702
|
+
if (parsedLeft && parsedRight) return parsedLeft.agentId === parsedRight.agentId && parsedLeft.rest === parsedRight.rest;
|
|
2703
|
+
if (parsedLeft) return parsedLeft.rest === normalizedRight;
|
|
2704
|
+
if (parsedRight) return normalizedLeft === parsedRight.rest;
|
|
2705
|
+
return false;
|
|
2706
|
+
};
|
|
2707
|
+
const handleChatEvent = (payload) => {
|
|
2708
|
+
if (!payload || typeof payload !== "object") return;
|
|
2709
|
+
const evt = payload;
|
|
2710
|
+
syncSessionKey();
|
|
2711
|
+
if (!isSameSessionKey(evt.sessionKey, state.currentSessionKey)) return;
|
|
2712
|
+
if (finalizedRuns.has(evt.runId)) {
|
|
2713
|
+
if (evt.state === "delta") return;
|
|
2714
|
+
if (evt.state === "final") return;
|
|
2715
|
+
}
|
|
2716
|
+
noteSessionRun(evt.runId);
|
|
2717
|
+
if (!state.activeChatRunId && !isLocalBtwRunId?.(evt.runId)) {
|
|
2718
|
+
state.activeChatRunId = evt.runId;
|
|
2719
|
+
if (state.pendingOptimisticUserMessage) {
|
|
2720
|
+
noteLocalRunId?.(evt.runId);
|
|
2721
|
+
state.pendingOptimisticUserMessage = false;
|
|
2722
|
+
}
|
|
2723
|
+
}
|
|
2724
|
+
if (evt.state === "delta") {
|
|
2725
|
+
const displayText = streamAssembler.ingestDelta(evt.runId, evt.message, state.showThinking);
|
|
2726
|
+
if (!displayText) return;
|
|
2727
|
+
chatLog.updateAssistant(displayText, evt.runId);
|
|
2728
|
+
setActivityStatus("streaming");
|
|
2729
|
+
}
|
|
2730
|
+
if (evt.state === "final") {
|
|
2731
|
+
const isLocalBtwRun = isLocalBtwRunId?.(evt.runId) ?? false;
|
|
2732
|
+
const wasActiveRun = state.activeChatRunId === evt.runId;
|
|
2733
|
+
if (!evt.message && isLocalBtwRun) {
|
|
2734
|
+
forgetLocalBtwRunId?.(evt.runId);
|
|
2735
|
+
noteFinalizedRun(evt.runId);
|
|
2736
|
+
tui.requestRender();
|
|
2737
|
+
return;
|
|
2738
|
+
}
|
|
2739
|
+
if (!evt.message) {
|
|
2740
|
+
maybeRefreshHistoryForRun(evt.runId, { allowLocalWithoutDisplayableFinal: true });
|
|
2741
|
+
chatLog.dropAssistant(evt.runId);
|
|
2742
|
+
finalizeRun({
|
|
2743
|
+
runId: evt.runId,
|
|
2744
|
+
wasActiveRun,
|
|
2745
|
+
status: "idle"
|
|
2746
|
+
});
|
|
2747
|
+
tui.requestRender();
|
|
2748
|
+
return;
|
|
2749
|
+
}
|
|
2750
|
+
if (isCommandMessage(evt.message)) {
|
|
2751
|
+
maybeRefreshHistoryForRun(evt.runId);
|
|
2752
|
+
const text = extractTextFromMessage(evt.message);
|
|
2753
|
+
if (text) chatLog.addSystem(text);
|
|
2754
|
+
finalizeRun({
|
|
2755
|
+
runId: evt.runId,
|
|
2756
|
+
wasActiveRun,
|
|
2757
|
+
status: "idle"
|
|
2758
|
+
});
|
|
2759
|
+
tui.requestRender();
|
|
2760
|
+
return;
|
|
2761
|
+
}
|
|
2762
|
+
maybeRefreshHistoryForRun(evt.runId);
|
|
2763
|
+
const stopReason = evt.message && typeof evt.message === "object" && !Array.isArray(evt.message) ? typeof evt.message.stopReason === "string" ? evt.message.stopReason : "" : "";
|
|
2764
|
+
const finalText = streamAssembler.finalize(evt.runId, evt.message, state.showThinking, evt.errorMessage);
|
|
2765
|
+
if (finalText === "(no output)" && !isLocalRunId?.(evt.runId)) chatLog.dropAssistant(evt.runId);
|
|
2766
|
+
else chatLog.finalizeAssistant(finalText, evt.runId);
|
|
2767
|
+
finalizeRun({
|
|
2768
|
+
runId: evt.runId,
|
|
2769
|
+
wasActiveRun,
|
|
2770
|
+
status: stopReason === "error" ? "error" : "idle"
|
|
2771
|
+
});
|
|
2772
|
+
}
|
|
2773
|
+
if (evt.state === "aborted") {
|
|
2774
|
+
forgetLocalBtwRunId?.(evt.runId);
|
|
2775
|
+
const wasActiveRun = state.activeChatRunId === evt.runId;
|
|
2776
|
+
chatLog.addSystem("run aborted");
|
|
2777
|
+
terminateRun({
|
|
2778
|
+
runId: evt.runId,
|
|
2779
|
+
wasActiveRun,
|
|
2780
|
+
status: "aborted"
|
|
2781
|
+
});
|
|
2782
|
+
maybeRefreshHistoryForRun(evt.runId);
|
|
2783
|
+
}
|
|
2784
|
+
if (evt.state === "error") {
|
|
2785
|
+
forgetLocalBtwRunId?.(evt.runId);
|
|
2786
|
+
const wasActiveRun = state.activeChatRunId === evt.runId;
|
|
2787
|
+
chatLog.addSystem(`run error: ${evt.errorMessage ?? "unknown"}`);
|
|
2788
|
+
terminateRun({
|
|
2789
|
+
runId: evt.runId,
|
|
2790
|
+
wasActiveRun,
|
|
2791
|
+
status: "error"
|
|
2792
|
+
});
|
|
2793
|
+
maybeRefreshHistoryForRun(evt.runId);
|
|
2794
|
+
}
|
|
2795
|
+
tui.requestRender();
|
|
2796
|
+
};
|
|
2797
|
+
const handleAgentEvent = (payload) => {
|
|
2798
|
+
if (!payload || typeof payload !== "object") return;
|
|
2799
|
+
const evt = payload;
|
|
2800
|
+
syncSessionKey();
|
|
2801
|
+
const isActiveRun = evt.runId === state.activeChatRunId;
|
|
2802
|
+
if (!(isActiveRun || sessionRuns.has(evt.runId) || finalizedRuns.has(evt.runId))) return;
|
|
2803
|
+
if (evt.stream === "tool") {
|
|
2804
|
+
const verbose = state.sessionInfo.verboseLevel ?? "off";
|
|
2805
|
+
const allowToolEvents = verbose !== "off";
|
|
2806
|
+
const allowToolOutput = verbose === "full";
|
|
2807
|
+
if (!allowToolEvents) return;
|
|
2808
|
+
const data = evt.data ?? {};
|
|
2809
|
+
const phase = asString(data.phase, "");
|
|
2810
|
+
const toolCallId = asString(data.toolCallId, "");
|
|
2811
|
+
const toolName = asString(data.name, "tool");
|
|
2812
|
+
if (!toolCallId) return;
|
|
2813
|
+
if (phase === "start") chatLog.startTool(toolCallId, toolName, data.args);
|
|
2814
|
+
else if (phase === "update") {
|
|
2815
|
+
if (!allowToolOutput) return;
|
|
2816
|
+
chatLog.updateToolResult(toolCallId, data.partialResult, { partial: true });
|
|
2817
|
+
} else if (phase === "result") if (allowToolOutput) chatLog.updateToolResult(toolCallId, data.result, { isError: Boolean(data.isError) });
|
|
2818
|
+
else chatLog.updateToolResult(toolCallId, { content: [] }, { isError: Boolean(data.isError) });
|
|
2819
|
+
tui.requestRender();
|
|
2820
|
+
return;
|
|
2821
|
+
}
|
|
2822
|
+
if (evt.stream === "lifecycle") {
|
|
2823
|
+
if (!isActiveRun) return;
|
|
2824
|
+
const phase = typeof evt.data?.phase === "string" ? evt.data.phase : "";
|
|
2825
|
+
if (phase === "start") setActivityStatus("running");
|
|
2826
|
+
if (phase === "end") setActivityStatus("idle");
|
|
2827
|
+
if (phase === "error") setActivityStatus("error");
|
|
2828
|
+
tui.requestRender();
|
|
2829
|
+
}
|
|
2830
|
+
};
|
|
2831
|
+
const handleBtwEvent = (payload) => {
|
|
2832
|
+
if (!payload || typeof payload !== "object") return;
|
|
2833
|
+
const evt = payload;
|
|
2834
|
+
syncSessionKey();
|
|
2835
|
+
if (!isSameSessionKey(evt.sessionKey, state.currentSessionKey)) return;
|
|
2836
|
+
if (evt.kind !== "btw") return;
|
|
2837
|
+
const question = evt.question.trim();
|
|
2838
|
+
const text = evt.text.trim();
|
|
2839
|
+
if (!question || !text) return;
|
|
2840
|
+
btw.showResult({
|
|
2841
|
+
question,
|
|
2842
|
+
text,
|
|
2843
|
+
isError: evt.isError
|
|
2844
|
+
});
|
|
2845
|
+
tui.requestRender();
|
|
2846
|
+
};
|
|
2847
|
+
return {
|
|
2848
|
+
handleChatEvent,
|
|
2849
|
+
handleAgentEvent,
|
|
2850
|
+
handleBtwEvent
|
|
2851
|
+
};
|
|
2852
|
+
}
|
|
2853
|
+
//#endregion
|
|
2854
|
+
//#region src/tui/tui-local-shell.ts
|
|
2855
|
+
function createLocalShellRunner(deps) {
|
|
2856
|
+
let localExecAsked = false;
|
|
2857
|
+
let localExecAllowed = false;
|
|
2858
|
+
const createSelector = deps.createSelector ?? createSearchableSelectList;
|
|
2859
|
+
const spawnCommand = deps.spawnCommand ?? spawn;
|
|
2860
|
+
const getCwd = deps.getCwd ?? (() => process.cwd());
|
|
2861
|
+
const env = deps.env ?? process.env;
|
|
2862
|
+
const maxChars = deps.maxOutputChars ?? 4e4;
|
|
2863
|
+
const ensureLocalExecAllowed = async () => {
|
|
2864
|
+
if (localExecAllowed) return true;
|
|
2865
|
+
if (localExecAsked) return false;
|
|
2866
|
+
localExecAsked = true;
|
|
2867
|
+
return await new Promise((resolve) => {
|
|
2868
|
+
deps.chatLog.addSystem("Allow local shell commands for this session?");
|
|
2869
|
+
deps.chatLog.addSystem("This runs commands on YOUR machine (not the gateway) and may delete files or reveal secrets.");
|
|
2870
|
+
deps.chatLog.addSystem("Select Yes/No (arrows + Enter), Esc to cancel.");
|
|
2871
|
+
const selector = createSelector([{
|
|
2872
|
+
value: "no",
|
|
2873
|
+
label: "No"
|
|
2874
|
+
}, {
|
|
2875
|
+
value: "yes",
|
|
2876
|
+
label: "Yes"
|
|
2877
|
+
}], 2);
|
|
2878
|
+
selector.onSelect = (item) => {
|
|
2879
|
+
deps.closeOverlay();
|
|
2880
|
+
if (item.value === "yes") {
|
|
2881
|
+
localExecAllowed = true;
|
|
2882
|
+
deps.chatLog.addSystem("local shell: enabled for this session");
|
|
2883
|
+
resolve(true);
|
|
2884
|
+
} else {
|
|
2885
|
+
deps.chatLog.addSystem("local shell: not enabled");
|
|
2886
|
+
resolve(false);
|
|
2887
|
+
}
|
|
2888
|
+
deps.tui.requestRender();
|
|
2889
|
+
};
|
|
2890
|
+
selector.onCancel = () => {
|
|
2891
|
+
deps.closeOverlay();
|
|
2892
|
+
deps.chatLog.addSystem("local shell: cancelled");
|
|
2893
|
+
deps.tui.requestRender();
|
|
2894
|
+
resolve(false);
|
|
2895
|
+
};
|
|
2896
|
+
deps.openOverlay(selector);
|
|
2897
|
+
deps.tui.requestRender();
|
|
2898
|
+
});
|
|
2899
|
+
};
|
|
2900
|
+
const runLocalShellLine = async (line) => {
|
|
2901
|
+
const cmd = line.slice(1);
|
|
2902
|
+
if (cmd === "") return;
|
|
2903
|
+
if (localExecAsked && !localExecAllowed) {
|
|
2904
|
+
deps.chatLog.addSystem("local shell: not enabled for this session");
|
|
2905
|
+
deps.tui.requestRender();
|
|
2906
|
+
return;
|
|
2907
|
+
}
|
|
2908
|
+
if (!await ensureLocalExecAllowed()) return;
|
|
2909
|
+
deps.chatLog.addSystem(`[local] $ ${cmd}`);
|
|
2910
|
+
deps.tui.requestRender();
|
|
2911
|
+
const appendWithCap = (text, chunk) => {
|
|
2912
|
+
const combined = text + chunk;
|
|
2913
|
+
return combined.length > maxChars ? combined.slice(-maxChars) : combined;
|
|
2914
|
+
};
|
|
2915
|
+
await new Promise((resolve) => {
|
|
2916
|
+
const child = spawnCommand(cmd, {
|
|
2917
|
+
shell: true,
|
|
2918
|
+
cwd: getCwd(),
|
|
2919
|
+
env: {
|
|
2920
|
+
...env,
|
|
2921
|
+
KAIJIBOT_SHELL: "tui-local"
|
|
2922
|
+
}
|
|
2923
|
+
});
|
|
2924
|
+
let stdout = "";
|
|
2925
|
+
let stderr = "";
|
|
2926
|
+
child.stdout.on("data", (buf) => {
|
|
2927
|
+
stdout = appendWithCap(stdout, buf.toString("utf8"));
|
|
2928
|
+
});
|
|
2929
|
+
child.stderr.on("data", (buf) => {
|
|
2930
|
+
stderr = appendWithCap(stderr, buf.toString("utf8"));
|
|
2931
|
+
});
|
|
2932
|
+
child.on("close", (code, signal) => {
|
|
2933
|
+
const combined = (stdout + (stderr ? (stdout ? "\n" : "") + stderr : "")).slice(0, maxChars).trimEnd();
|
|
2934
|
+
if (combined) for (const line of combined.split("\n")) deps.chatLog.addSystem(`[local] ${line}`);
|
|
2935
|
+
deps.chatLog.addSystem(`[local] exit ${code ?? "?"}${signal ? ` (signal ${String(signal)})` : ""}`);
|
|
2936
|
+
deps.tui.requestRender();
|
|
2937
|
+
resolve();
|
|
2938
|
+
});
|
|
2939
|
+
child.on("error", (err) => {
|
|
2940
|
+
deps.chatLog.addSystem(`[local] error: ${String(err)}`);
|
|
2941
|
+
deps.tui.requestRender();
|
|
2942
|
+
resolve();
|
|
2943
|
+
});
|
|
2944
|
+
});
|
|
2945
|
+
};
|
|
2946
|
+
return { runLocalShellLine };
|
|
2947
|
+
}
|
|
2948
|
+
//#endregion
|
|
2949
|
+
//#region src/tui/tui-overlays.ts
|
|
2950
|
+
function createOverlayHandlers(host, fallbackFocus) {
|
|
2951
|
+
const openOverlay = (component) => {
|
|
2952
|
+
host.showOverlay(component);
|
|
2953
|
+
};
|
|
2954
|
+
const closeOverlay = () => {
|
|
2955
|
+
if (host.hasOverlay()) {
|
|
2956
|
+
host.hideOverlay();
|
|
2957
|
+
return;
|
|
2958
|
+
}
|
|
2959
|
+
host.setFocus(fallbackFocus);
|
|
2960
|
+
};
|
|
2961
|
+
return {
|
|
2962
|
+
openOverlay,
|
|
2963
|
+
closeOverlay
|
|
2964
|
+
};
|
|
2965
|
+
}
|
|
2966
|
+
//#endregion
|
|
2967
|
+
//#region src/tui/tui-session-actions.ts
|
|
2968
|
+
function createSessionActions(context) {
|
|
2969
|
+
const { client, chatLog, btw, tui, opts, state, agentNames, initialSessionInput, initialSessionAgentId, resolveSessionKey, updateHeader, updateFooter, updateAutocompleteProvider, setActivityStatus, clearLocalRunIds } = context;
|
|
2970
|
+
let refreshSessionInfoPromise = Promise.resolve();
|
|
2971
|
+
let lastSessionDefaults = null;
|
|
2972
|
+
const applyAgentsResult = (result) => {
|
|
2973
|
+
state.agentDefaultId = normalizeAgentId(result.defaultId);
|
|
2974
|
+
state.sessionMainKey = normalizeMainKey(result.mainKey);
|
|
2975
|
+
state.sessionScope = result.scope ?? state.sessionScope;
|
|
2976
|
+
state.agents = result.agents.map((agent) => ({
|
|
2977
|
+
id: normalizeAgentId(agent.id),
|
|
2978
|
+
name: normalizeOptionalString(agent.name)
|
|
2979
|
+
}));
|
|
2980
|
+
agentNames.clear();
|
|
2981
|
+
for (const agent of state.agents) if (agent.name) agentNames.set(agent.id, agent.name);
|
|
2982
|
+
if (!state.initialSessionApplied) {
|
|
2983
|
+
if (initialSessionAgentId) {
|
|
2984
|
+
if (state.agents.some((agent) => agent.id === initialSessionAgentId)) state.currentAgentId = initialSessionAgentId;
|
|
2985
|
+
} else if (!state.agents.some((agent) => agent.id === state.currentAgentId)) state.currentAgentId = state.agents[0]?.id ?? normalizeAgentId(result.defaultId ?? state.currentAgentId);
|
|
2986
|
+
const nextSessionKey = resolveSessionKey(initialSessionInput);
|
|
2987
|
+
if (nextSessionKey !== state.currentSessionKey) state.currentSessionKey = nextSessionKey;
|
|
2988
|
+
state.initialSessionApplied = true;
|
|
2989
|
+
} else if (!state.agents.some((agent) => agent.id === state.currentAgentId)) state.currentAgentId = state.agents[0]?.id ?? normalizeAgentId(result.defaultId ?? state.currentAgentId);
|
|
2990
|
+
updateHeader();
|
|
2991
|
+
updateFooter();
|
|
2992
|
+
};
|
|
2993
|
+
const refreshAgents = async () => {
|
|
2994
|
+
try {
|
|
2995
|
+
applyAgentsResult(await client.listAgents());
|
|
2996
|
+
} catch (err) {
|
|
2997
|
+
chatLog.addSystem(`agents list failed: ${String(err)}`);
|
|
2998
|
+
}
|
|
2999
|
+
};
|
|
3000
|
+
const updateAgentFromSessionKey = (key) => {
|
|
3001
|
+
const parsed = parseAgentSessionKey(key);
|
|
3002
|
+
if (!parsed) return;
|
|
3003
|
+
const next = normalizeAgentId(parsed.agentId);
|
|
3004
|
+
if (next !== state.currentAgentId) state.currentAgentId = next;
|
|
3005
|
+
};
|
|
3006
|
+
const resolveModelSelection = (entry) => {
|
|
3007
|
+
return resolveSessionInfoModelSelection({
|
|
3008
|
+
currentProvider: state.sessionInfo.modelProvider,
|
|
3009
|
+
currentModel: state.sessionInfo.model,
|
|
3010
|
+
entryProvider: entry?.modelProvider,
|
|
3011
|
+
entryModel: entry?.model,
|
|
3012
|
+
overrideProvider: entry?.providerOverride,
|
|
3013
|
+
overrideModel: entry?.modelOverride
|
|
3014
|
+
});
|
|
3015
|
+
};
|
|
3016
|
+
const applySessionInfo = (params) => {
|
|
3017
|
+
const entry = params.entry ?? void 0;
|
|
3018
|
+
const defaults = params.defaults ?? lastSessionDefaults ?? void 0;
|
|
3019
|
+
const previousDefaults = lastSessionDefaults;
|
|
3020
|
+
const defaultsChanged = params.defaults ? previousDefaults?.model !== params.defaults.model || previousDefaults?.modelProvider !== params.defaults.modelProvider || previousDefaults?.contextTokens !== params.defaults.contextTokens : false;
|
|
3021
|
+
if (params.defaults) lastSessionDefaults = params.defaults;
|
|
3022
|
+
const entryUpdatedAt = entry?.updatedAt ?? null;
|
|
3023
|
+
const currentUpdatedAt = state.sessionInfo.updatedAt ?? null;
|
|
3024
|
+
if (!params.force && entryUpdatedAt !== null && currentUpdatedAt !== null && entryUpdatedAt < currentUpdatedAt && !defaultsChanged) return;
|
|
3025
|
+
const next = { ...state.sessionInfo };
|
|
3026
|
+
if (entry?.thinkingLevel !== void 0) next.thinkingLevel = entry.thinkingLevel;
|
|
3027
|
+
if (entry?.fastMode !== void 0) next.fastMode = entry.fastMode;
|
|
3028
|
+
if (entry?.verboseLevel !== void 0) next.verboseLevel = entry.verboseLevel;
|
|
3029
|
+
if (entry?.reasoningLevel !== void 0) next.reasoningLevel = entry.reasoningLevel;
|
|
3030
|
+
if (entry?.responseUsage !== void 0) next.responseUsage = entry.responseUsage;
|
|
3031
|
+
if (entry?.inputTokens !== void 0) next.inputTokens = entry.inputTokens;
|
|
3032
|
+
if (entry?.outputTokens !== void 0) next.outputTokens = entry.outputTokens;
|
|
3033
|
+
if (entry?.totalTokens !== void 0) next.totalTokens = entry.totalTokens;
|
|
3034
|
+
if (entry?.contextTokens !== void 0 || defaults?.contextTokens !== void 0) next.contextTokens = entry?.contextTokens ?? defaults?.contextTokens ?? state.sessionInfo.contextTokens;
|
|
3035
|
+
if (entry?.displayName !== void 0) next.displayName = entry.displayName;
|
|
3036
|
+
if (entry?.updatedAt !== void 0) next.updatedAt = entry.updatedAt;
|
|
3037
|
+
const selection = resolveModelSelection(entry);
|
|
3038
|
+
if (selection.modelProvider !== void 0) next.modelProvider = selection.modelProvider;
|
|
3039
|
+
if (selection.model !== void 0) next.model = selection.model;
|
|
3040
|
+
state.sessionInfo = next;
|
|
3041
|
+
updateAutocompleteProvider();
|
|
3042
|
+
updateFooter();
|
|
3043
|
+
tui.requestRender();
|
|
3044
|
+
};
|
|
3045
|
+
const runRefreshSessionInfo = async () => {
|
|
3046
|
+
try {
|
|
3047
|
+
const resolveListAgentId = () => {
|
|
3048
|
+
if (state.currentSessionKey === "global" || state.currentSessionKey === "unknown") return;
|
|
3049
|
+
const parsed = parseAgentSessionKey(state.currentSessionKey);
|
|
3050
|
+
return parsed?.agentId ? normalizeAgentId(parsed.agentId) : state.currentAgentId;
|
|
3051
|
+
};
|
|
3052
|
+
const listAgentId = resolveListAgentId();
|
|
3053
|
+
const result = await client.listSessions({
|
|
3054
|
+
includeGlobal: false,
|
|
3055
|
+
includeUnknown: false,
|
|
3056
|
+
agentId: listAgentId
|
|
3057
|
+
});
|
|
3058
|
+
const normalizeMatchKey = (key) => parseAgentSessionKey(key)?.rest ?? key;
|
|
3059
|
+
const currentMatchKey = normalizeMatchKey(state.currentSessionKey);
|
|
3060
|
+
const entry = result.sessions.find((row) => {
|
|
3061
|
+
if (row.key === state.currentSessionKey) return true;
|
|
3062
|
+
return normalizeMatchKey(row.key) === currentMatchKey;
|
|
3063
|
+
});
|
|
3064
|
+
if (entry?.key && entry.key !== state.currentSessionKey) {
|
|
3065
|
+
updateAgentFromSessionKey(entry.key);
|
|
3066
|
+
state.currentSessionKey = entry.key;
|
|
3067
|
+
updateHeader();
|
|
3068
|
+
}
|
|
3069
|
+
applySessionInfo({
|
|
3070
|
+
entry,
|
|
3071
|
+
defaults: result.defaults
|
|
3072
|
+
});
|
|
3073
|
+
} catch (err) {
|
|
3074
|
+
chatLog.addSystem(`sessions list failed: ${String(err)}`);
|
|
3075
|
+
}
|
|
3076
|
+
};
|
|
3077
|
+
const refreshSessionInfo = async () => {
|
|
3078
|
+
refreshSessionInfoPromise = refreshSessionInfoPromise.then(runRefreshSessionInfo, runRefreshSessionInfo);
|
|
3079
|
+
await refreshSessionInfoPromise;
|
|
3080
|
+
};
|
|
3081
|
+
const applySessionInfoFromPatch = (result) => {
|
|
3082
|
+
if (!result?.entry) return;
|
|
3083
|
+
if (result.key && result.key !== state.currentSessionKey) {
|
|
3084
|
+
updateAgentFromSessionKey(result.key);
|
|
3085
|
+
state.currentSessionKey = result.key;
|
|
3086
|
+
updateHeader();
|
|
3087
|
+
}
|
|
3088
|
+
const resolved = result.resolved;
|
|
3089
|
+
applySessionInfo({
|
|
3090
|
+
entry: resolved && (resolved.modelProvider || resolved.model) ? {
|
|
3091
|
+
...result.entry,
|
|
3092
|
+
modelProvider: resolved.modelProvider ?? result.entry.modelProvider,
|
|
3093
|
+
model: resolved.model ?? result.entry.model
|
|
3094
|
+
} : result.entry,
|
|
3095
|
+
force: true
|
|
3096
|
+
});
|
|
3097
|
+
};
|
|
3098
|
+
const loadHistory = async () => {
|
|
3099
|
+
try {
|
|
3100
|
+
const record = await client.loadHistory({
|
|
3101
|
+
sessionKey: state.currentSessionKey,
|
|
3102
|
+
limit: opts.historyLimit ?? 200
|
|
3103
|
+
});
|
|
3104
|
+
state.currentSessionId = typeof record.sessionId === "string" ? record.sessionId : null;
|
|
3105
|
+
state.sessionInfo.thinkingLevel = record.thinkingLevel ?? state.sessionInfo.thinkingLevel;
|
|
3106
|
+
state.sessionInfo.fastMode = record.fastMode ?? state.sessionInfo.fastMode;
|
|
3107
|
+
state.sessionInfo.verboseLevel = record.verboseLevel ?? state.sessionInfo.verboseLevel;
|
|
3108
|
+
const showTools = (state.sessionInfo.verboseLevel ?? "off") !== "off";
|
|
3109
|
+
chatLog.clearAll();
|
|
3110
|
+
btw.clear();
|
|
3111
|
+
chatLog.addSystem(`session ${state.currentSessionKey}`);
|
|
3112
|
+
for (const entry of record.messages ?? []) {
|
|
3113
|
+
if (!entry || typeof entry !== "object") continue;
|
|
3114
|
+
const message = entry;
|
|
3115
|
+
if (isCommandMessage(message)) {
|
|
3116
|
+
const text = extractTextFromMessage(message);
|
|
3117
|
+
if (text) chatLog.addSystem(text);
|
|
3118
|
+
continue;
|
|
3119
|
+
}
|
|
3120
|
+
if (message.role === "user") {
|
|
3121
|
+
const text = extractTextFromMessage(message);
|
|
3122
|
+
if (text) chatLog.addUser(text);
|
|
3123
|
+
continue;
|
|
3124
|
+
}
|
|
3125
|
+
if (message.role === "assistant") {
|
|
3126
|
+
const text = extractTextFromMessage(message, { includeThinking: state.showThinking });
|
|
3127
|
+
if (text) chatLog.finalizeAssistant(text);
|
|
3128
|
+
continue;
|
|
3129
|
+
}
|
|
3130
|
+
if (message.role === "toolResult") {
|
|
3131
|
+
if (!showTools) continue;
|
|
3132
|
+
const toolCallId = asString(message.toolCallId, "");
|
|
3133
|
+
const toolName = asString(message.toolName, "tool");
|
|
3134
|
+
chatLog.startTool(toolCallId, toolName, {}).setResult({
|
|
3135
|
+
content: Array.isArray(message.content) ? message.content : [],
|
|
3136
|
+
details: typeof message.details === "object" && message.details ? message.details : void 0
|
|
3137
|
+
}, { isError: Boolean(message.isError) });
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3140
|
+
state.historyLoaded = true;
|
|
3141
|
+
} catch (err) {
|
|
3142
|
+
chatLog.addSystem(`history failed: ${String(err)}`);
|
|
3143
|
+
}
|
|
3144
|
+
await refreshSessionInfo();
|
|
3145
|
+
tui.requestRender();
|
|
3146
|
+
};
|
|
3147
|
+
const setSession = async (rawKey) => {
|
|
3148
|
+
const nextKey = resolveSessionKey(rawKey);
|
|
3149
|
+
updateAgentFromSessionKey(nextKey);
|
|
3150
|
+
state.currentSessionKey = nextKey;
|
|
3151
|
+
state.activeChatRunId = null;
|
|
3152
|
+
state.currentSessionId = null;
|
|
3153
|
+
state.sessionInfo.updatedAt = null;
|
|
3154
|
+
state.historyLoaded = false;
|
|
3155
|
+
clearLocalRunIds?.();
|
|
3156
|
+
btw.clear();
|
|
3157
|
+
updateHeader();
|
|
3158
|
+
updateFooter();
|
|
3159
|
+
await loadHistory();
|
|
3160
|
+
};
|
|
3161
|
+
const abortActive = async () => {
|
|
3162
|
+
if (!state.activeChatRunId) {
|
|
3163
|
+
chatLog.addSystem("no active run");
|
|
3164
|
+
tui.requestRender();
|
|
3165
|
+
return;
|
|
3166
|
+
}
|
|
3167
|
+
try {
|
|
3168
|
+
await client.abortChat({
|
|
3169
|
+
sessionKey: state.currentSessionKey,
|
|
3170
|
+
runId: state.activeChatRunId
|
|
3171
|
+
});
|
|
3172
|
+
setActivityStatus("aborted");
|
|
3173
|
+
} catch (err) {
|
|
3174
|
+
chatLog.addSystem(`abort failed: ${String(err)}`);
|
|
3175
|
+
setActivityStatus("abort failed");
|
|
3176
|
+
}
|
|
3177
|
+
tui.requestRender();
|
|
3178
|
+
};
|
|
3179
|
+
return {
|
|
3180
|
+
applyAgentsResult,
|
|
3181
|
+
refreshAgents,
|
|
3182
|
+
refreshSessionInfo,
|
|
3183
|
+
applySessionInfoFromPatch,
|
|
3184
|
+
loadHistory,
|
|
3185
|
+
setSession,
|
|
3186
|
+
abortActive
|
|
3187
|
+
};
|
|
3188
|
+
}
|
|
3189
|
+
//#endregion
|
|
3190
|
+
//#region src/tui/tui-submit.ts
|
|
3191
|
+
function createEditorSubmitHandler(params) {
|
|
3192
|
+
return (text) => {
|
|
3193
|
+
const raw = text;
|
|
3194
|
+
const value = raw.trim();
|
|
3195
|
+
params.editor.setText("");
|
|
3196
|
+
if (!value) return;
|
|
3197
|
+
if (raw.startsWith("!") && raw !== "!") {
|
|
3198
|
+
params.editor.addToHistory(raw);
|
|
3199
|
+
params.handleBangLine(raw);
|
|
3200
|
+
return;
|
|
3201
|
+
}
|
|
3202
|
+
params.editor.addToHistory(value);
|
|
3203
|
+
if (value.startsWith("/")) {
|
|
3204
|
+
params.handleCommand(value);
|
|
3205
|
+
return;
|
|
3206
|
+
}
|
|
3207
|
+
params.sendMessage(value);
|
|
3208
|
+
};
|
|
3209
|
+
}
|
|
3210
|
+
function shouldEnableWindowsGitBashPasteFallback(params) {
|
|
3211
|
+
const platform = params?.platform ?? process.platform;
|
|
3212
|
+
const env = params?.env ?? process.env;
|
|
3213
|
+
const termProgram = normalizeLowercaseStringOrEmpty(env.TERM_PROGRAM);
|
|
3214
|
+
if (platform === "darwin") {
|
|
3215
|
+
if (termProgram.includes("iterm") || termProgram.includes("apple_terminal")) return true;
|
|
3216
|
+
return false;
|
|
3217
|
+
}
|
|
3218
|
+
if (platform !== "win32") return false;
|
|
3219
|
+
const msystem = (env.MSYSTEM ?? "").toUpperCase();
|
|
3220
|
+
const shell = env.SHELL ?? "";
|
|
3221
|
+
if (msystem.startsWith("MINGW") || msystem.startsWith("MSYS")) return true;
|
|
3222
|
+
if (normalizeLowercaseStringOrEmpty(shell).includes("bash")) return true;
|
|
3223
|
+
return termProgram.includes("mintty");
|
|
3224
|
+
}
|
|
3225
|
+
function createSubmitBurstCoalescer(params) {
|
|
3226
|
+
const windowMs = Math.max(1, params.burstWindowMs ?? 50);
|
|
3227
|
+
const now = params.now ?? (() => Date.now());
|
|
3228
|
+
const setTimer = params.setTimer ?? setTimeout;
|
|
3229
|
+
const clearTimer = params.clearTimer ?? clearTimeout;
|
|
3230
|
+
let pending = null;
|
|
3231
|
+
let pendingAt = 0;
|
|
3232
|
+
let flushTimer = null;
|
|
3233
|
+
const clearFlushTimer = () => {
|
|
3234
|
+
if (!flushTimer) return;
|
|
3235
|
+
clearTimer(flushTimer);
|
|
3236
|
+
flushTimer = null;
|
|
3237
|
+
};
|
|
3238
|
+
const flushPending = () => {
|
|
3239
|
+
if (pending === null) return;
|
|
3240
|
+
const value = pending;
|
|
3241
|
+
pending = null;
|
|
3242
|
+
pendingAt = 0;
|
|
3243
|
+
clearFlushTimer();
|
|
3244
|
+
params.submit(value);
|
|
3245
|
+
};
|
|
3246
|
+
const scheduleFlush = () => {
|
|
3247
|
+
clearFlushTimer();
|
|
3248
|
+
flushTimer = setTimer(() => {
|
|
3249
|
+
flushPending();
|
|
3250
|
+
}, windowMs);
|
|
3251
|
+
};
|
|
3252
|
+
return (value) => {
|
|
3253
|
+
if (!params.enabled) {
|
|
3254
|
+
params.submit(value);
|
|
3255
|
+
return;
|
|
3256
|
+
}
|
|
3257
|
+
if (value.includes("\n")) {
|
|
3258
|
+
flushPending();
|
|
3259
|
+
params.submit(value);
|
|
3260
|
+
return;
|
|
3261
|
+
}
|
|
3262
|
+
const ts = now();
|
|
3263
|
+
if (pending === null) {
|
|
3264
|
+
pending = value;
|
|
3265
|
+
pendingAt = ts;
|
|
3266
|
+
scheduleFlush();
|
|
3267
|
+
return;
|
|
3268
|
+
}
|
|
3269
|
+
if (ts - pendingAt <= windowMs) {
|
|
3270
|
+
pending = `${pending}\n${value}`;
|
|
3271
|
+
pendingAt = ts;
|
|
3272
|
+
scheduleFlush();
|
|
3273
|
+
return;
|
|
3274
|
+
}
|
|
3275
|
+
flushPending();
|
|
3276
|
+
pending = value;
|
|
3277
|
+
pendingAt = ts;
|
|
3278
|
+
scheduleFlush();
|
|
3279
|
+
};
|
|
3280
|
+
}
|
|
3281
|
+
//#endregion
|
|
3282
|
+
//#region src/tui/tui-waiting.ts
|
|
3283
|
+
const defaultWaitingPhrases = [
|
|
3284
|
+
"flibbertigibbeting",
|
|
3285
|
+
"kerfuffling",
|
|
3286
|
+
"dillydallying",
|
|
3287
|
+
"twiddling thumbs",
|
|
3288
|
+
"noodling",
|
|
3289
|
+
"bamboozling",
|
|
3290
|
+
"moseying",
|
|
3291
|
+
"hobnobbing",
|
|
3292
|
+
"pondering",
|
|
3293
|
+
"conjuring"
|
|
3294
|
+
];
|
|
3295
|
+
function pickWaitingPhrase(tick, phrases = defaultWaitingPhrases) {
|
|
3296
|
+
return phrases[Math.floor(tick / 10) % phrases.length] ?? phrases[0] ?? "waiting";
|
|
3297
|
+
}
|
|
3298
|
+
function shimmerText(theme, text, tick) {
|
|
3299
|
+
const width = 6;
|
|
3300
|
+
const hi = (ch) => theme.bold(theme.accentSoft(ch));
|
|
3301
|
+
const pos = tick % (text.length + width);
|
|
3302
|
+
const start = Math.max(0, pos - width);
|
|
3303
|
+
const end = Math.min(text.length - 1, pos);
|
|
3304
|
+
let out = "";
|
|
3305
|
+
for (let i = 0; i < text.length; i++) {
|
|
3306
|
+
const ch = text[i];
|
|
3307
|
+
out += i >= start && i <= end ? hi(ch) : theme.dim(ch);
|
|
3308
|
+
}
|
|
3309
|
+
return out;
|
|
3310
|
+
}
|
|
3311
|
+
function buildWaitingStatusMessage(params) {
|
|
3312
|
+
const phrase = pickWaitingPhrase(params.tick, params.phrases);
|
|
3313
|
+
return `${shimmerText(params.theme, `${phrase}…`, params.tick)} • ${params.elapsed} | ${params.connectionStatus}`;
|
|
3314
|
+
}
|
|
3315
|
+
//#endregion
|
|
3316
|
+
//#region src/tui/tui.ts
|
|
3317
|
+
function resolveTuiSessionKey(params) {
|
|
3318
|
+
const trimmed = (params.raw ?? "").trim();
|
|
3319
|
+
if (!trimmed) {
|
|
3320
|
+
if (params.sessionScope === "global") return "global";
|
|
3321
|
+
return buildAgentMainSessionKey({
|
|
3322
|
+
agentId: params.currentAgentId,
|
|
3323
|
+
mainKey: params.sessionMainKey
|
|
3324
|
+
});
|
|
3325
|
+
}
|
|
3326
|
+
if (trimmed === "global" || trimmed === "unknown") return trimmed;
|
|
3327
|
+
if (trimmed.startsWith("agent:")) return normalizeLowercaseStringOrEmpty(trimmed);
|
|
3328
|
+
return `agent:${params.currentAgentId}:${normalizeLowercaseStringOrEmpty(trimmed)}`;
|
|
3329
|
+
}
|
|
3330
|
+
function resolveInitialTuiAgentId(params) {
|
|
3331
|
+
const parsed = parseAgentSessionKey((params.initialSessionInput ?? "").trim());
|
|
3332
|
+
if (parsed?.agentId) return normalizeAgentId(parsed.agentId);
|
|
3333
|
+
const inferredFromWorkspace = resolveAgentIdByWorkspacePath(params.cfg, params.cwd ?? process.cwd());
|
|
3334
|
+
if (inferredFromWorkspace) return inferredFromWorkspace;
|
|
3335
|
+
return normalizeAgentId(params.fallbackAgentId);
|
|
3336
|
+
}
|
|
3337
|
+
function resolveGatewayDisconnectState(reason) {
|
|
3338
|
+
const reasonLabel = reason?.trim() ? reason.trim() : "closed";
|
|
3339
|
+
if (/pairing required/i.test(reasonLabel)) return {
|
|
3340
|
+
connectionStatus: `gateway disconnected: ${reasonLabel}`,
|
|
3341
|
+
activityStatus: "pairing required: run kaijibot devices list",
|
|
3342
|
+
pairingHint: "Pairing required. Run `kaijibot devices list`, approve your request ID, then reconnect."
|
|
3343
|
+
};
|
|
3344
|
+
return {
|
|
3345
|
+
connectionStatus: `gateway disconnected: ${reasonLabel}`,
|
|
3346
|
+
activityStatus: "idle"
|
|
3347
|
+
};
|
|
3348
|
+
}
|
|
3349
|
+
function createBackspaceDeduper(params) {
|
|
3350
|
+
const dedupeWindowMs = Math.max(0, Math.floor(params?.dedupeWindowMs ?? 8));
|
|
3351
|
+
const now = params?.now ?? (() => Date.now());
|
|
3352
|
+
let lastBackspaceAt = -1;
|
|
3353
|
+
return (data) => {
|
|
3354
|
+
if (!matchesKey(data, Key.backspace)) return data;
|
|
3355
|
+
const ts = now();
|
|
3356
|
+
if (lastBackspaceAt >= 0 && ts - lastBackspaceAt <= dedupeWindowMs) return "";
|
|
3357
|
+
lastBackspaceAt = ts;
|
|
3358
|
+
return data;
|
|
3359
|
+
};
|
|
3360
|
+
}
|
|
3361
|
+
function isIgnorableTuiStopError(error) {
|
|
3362
|
+
if (!error || typeof error !== "object") return false;
|
|
3363
|
+
const err = error;
|
|
3364
|
+
const code = typeof err.code === "string" ? err.code : "";
|
|
3365
|
+
const syscall = typeof err.syscall === "string" ? err.syscall : "";
|
|
3366
|
+
const message = typeof err.message === "string" ? err.message : "";
|
|
3367
|
+
if (code === "EBADF" && syscall === "setRawMode") return true;
|
|
3368
|
+
return /setRawMode/i.test(message) && /EBADF/i.test(message);
|
|
3369
|
+
}
|
|
3370
|
+
function stopTuiSafely(stop) {
|
|
3371
|
+
try {
|
|
3372
|
+
stop();
|
|
3373
|
+
} catch (error) {
|
|
3374
|
+
if (!isIgnorableTuiStopError(error)) throw error;
|
|
3375
|
+
}
|
|
3376
|
+
}
|
|
3377
|
+
async function drainAndStopTuiSafely(tui) {
|
|
3378
|
+
if (typeof tui.terminal?.drainInput === "function") try {
|
|
3379
|
+
await tui.terminal.drainInput();
|
|
3380
|
+
} catch {}
|
|
3381
|
+
stopTuiSafely(() => tui.stop());
|
|
3382
|
+
}
|
|
3383
|
+
function resolveCtrlCAction(params) {
|
|
3384
|
+
const exitWindowMs = Math.max(1, Math.floor(params.exitWindowMs ?? 1e3));
|
|
3385
|
+
if (params.hasInput) return {
|
|
3386
|
+
action: "clear",
|
|
3387
|
+
nextLastCtrlCAt: params.now
|
|
3388
|
+
};
|
|
3389
|
+
if (params.now - params.lastCtrlCAt <= exitWindowMs) return {
|
|
3390
|
+
action: "exit",
|
|
3391
|
+
nextLastCtrlCAt: params.lastCtrlCAt
|
|
3392
|
+
};
|
|
3393
|
+
return {
|
|
3394
|
+
action: "warn",
|
|
3395
|
+
nextLastCtrlCAt: params.now
|
|
3396
|
+
};
|
|
3397
|
+
}
|
|
3398
|
+
async function runTui(opts) {
|
|
3399
|
+
const config = loadConfig();
|
|
3400
|
+
const initialSessionInput = (opts.session ?? "").trim();
|
|
3401
|
+
let sessionScope = config.session?.scope ?? "per-sender";
|
|
3402
|
+
let sessionMainKey = normalizeMainKey(config.session?.mainKey);
|
|
3403
|
+
let agentDefaultId = resolveDefaultAgentId(config);
|
|
3404
|
+
let currentAgentId = resolveInitialTuiAgentId({
|
|
3405
|
+
cfg: config,
|
|
3406
|
+
fallbackAgentId: agentDefaultId,
|
|
3407
|
+
initialSessionInput,
|
|
3408
|
+
cwd: process.cwd()
|
|
3409
|
+
});
|
|
3410
|
+
let agents = [];
|
|
3411
|
+
const agentNames = /* @__PURE__ */ new Map();
|
|
3412
|
+
let currentSessionKey = "";
|
|
3413
|
+
let initialSessionApplied = false;
|
|
3414
|
+
let currentSessionId = null;
|
|
3415
|
+
let activeChatRunId = null;
|
|
3416
|
+
let pendingOptimisticUserMessage = false;
|
|
3417
|
+
let historyLoaded = false;
|
|
3418
|
+
let isConnected = false;
|
|
3419
|
+
let wasDisconnected = false;
|
|
3420
|
+
let toolsExpanded = false;
|
|
3421
|
+
let showThinking = false;
|
|
3422
|
+
let pairingHintShown = false;
|
|
3423
|
+
const localRunIds = /* @__PURE__ */ new Set();
|
|
3424
|
+
const localBtwRunIds = /* @__PURE__ */ new Set();
|
|
3425
|
+
const deliverDefault = opts.deliver ?? false;
|
|
3426
|
+
const autoMessage = opts.message?.trim();
|
|
3427
|
+
let autoMessageSent = false;
|
|
3428
|
+
let sessionInfo = {};
|
|
3429
|
+
let lastCtrlCAt = 0;
|
|
3430
|
+
let exitRequested = false;
|
|
3431
|
+
let activityStatus = "idle";
|
|
3432
|
+
let connectionStatus = "connecting";
|
|
3433
|
+
let statusTimeout = null;
|
|
3434
|
+
let statusTimer = null;
|
|
3435
|
+
let statusStartedAt = null;
|
|
3436
|
+
let lastActivityStatus = activityStatus;
|
|
3437
|
+
const state = {
|
|
3438
|
+
get agentDefaultId() {
|
|
3439
|
+
return agentDefaultId;
|
|
3440
|
+
},
|
|
3441
|
+
set agentDefaultId(value) {
|
|
3442
|
+
agentDefaultId = value;
|
|
3443
|
+
},
|
|
3444
|
+
get sessionMainKey() {
|
|
3445
|
+
return sessionMainKey;
|
|
3446
|
+
},
|
|
3447
|
+
set sessionMainKey(value) {
|
|
3448
|
+
sessionMainKey = value;
|
|
3449
|
+
},
|
|
3450
|
+
get sessionScope() {
|
|
3451
|
+
return sessionScope;
|
|
3452
|
+
},
|
|
3453
|
+
set sessionScope(value) {
|
|
3454
|
+
sessionScope = value;
|
|
3455
|
+
},
|
|
3456
|
+
get agents() {
|
|
3457
|
+
return agents;
|
|
3458
|
+
},
|
|
3459
|
+
set agents(value) {
|
|
3460
|
+
agents = value;
|
|
3461
|
+
},
|
|
3462
|
+
get currentAgentId() {
|
|
3463
|
+
return currentAgentId;
|
|
3464
|
+
},
|
|
3465
|
+
set currentAgentId(value) {
|
|
3466
|
+
currentAgentId = value;
|
|
3467
|
+
},
|
|
3468
|
+
get currentSessionKey() {
|
|
3469
|
+
return currentSessionKey;
|
|
3470
|
+
},
|
|
3471
|
+
set currentSessionKey(value) {
|
|
3472
|
+
currentSessionKey = value;
|
|
3473
|
+
},
|
|
3474
|
+
get currentSessionId() {
|
|
3475
|
+
return currentSessionId;
|
|
3476
|
+
},
|
|
3477
|
+
set currentSessionId(value) {
|
|
3478
|
+
currentSessionId = value;
|
|
3479
|
+
},
|
|
3480
|
+
get activeChatRunId() {
|
|
3481
|
+
return activeChatRunId;
|
|
3482
|
+
},
|
|
3483
|
+
set activeChatRunId(value) {
|
|
3484
|
+
activeChatRunId = value;
|
|
3485
|
+
},
|
|
3486
|
+
get pendingOptimisticUserMessage() {
|
|
3487
|
+
return pendingOptimisticUserMessage;
|
|
3488
|
+
},
|
|
3489
|
+
set pendingOptimisticUserMessage(value) {
|
|
3490
|
+
pendingOptimisticUserMessage = value;
|
|
3491
|
+
},
|
|
3492
|
+
get historyLoaded() {
|
|
3493
|
+
return historyLoaded;
|
|
3494
|
+
},
|
|
3495
|
+
set historyLoaded(value) {
|
|
3496
|
+
historyLoaded = value;
|
|
3497
|
+
},
|
|
3498
|
+
get sessionInfo() {
|
|
3499
|
+
return sessionInfo;
|
|
3500
|
+
},
|
|
3501
|
+
set sessionInfo(value) {
|
|
3502
|
+
sessionInfo = value;
|
|
3503
|
+
},
|
|
3504
|
+
get initialSessionApplied() {
|
|
3505
|
+
return initialSessionApplied;
|
|
3506
|
+
},
|
|
3507
|
+
set initialSessionApplied(value) {
|
|
3508
|
+
initialSessionApplied = value;
|
|
3509
|
+
},
|
|
3510
|
+
get isConnected() {
|
|
3511
|
+
return isConnected;
|
|
3512
|
+
},
|
|
3513
|
+
set isConnected(value) {
|
|
3514
|
+
isConnected = value;
|
|
3515
|
+
},
|
|
3516
|
+
get autoMessageSent() {
|
|
3517
|
+
return autoMessageSent;
|
|
3518
|
+
},
|
|
3519
|
+
set autoMessageSent(value) {
|
|
3520
|
+
autoMessageSent = value;
|
|
3521
|
+
},
|
|
3522
|
+
get toolsExpanded() {
|
|
3523
|
+
return toolsExpanded;
|
|
3524
|
+
},
|
|
3525
|
+
set toolsExpanded(value) {
|
|
3526
|
+
toolsExpanded = value;
|
|
3527
|
+
},
|
|
3528
|
+
get showThinking() {
|
|
3529
|
+
return showThinking;
|
|
3530
|
+
},
|
|
3531
|
+
set showThinking(value) {
|
|
3532
|
+
showThinking = value;
|
|
3533
|
+
},
|
|
3534
|
+
get connectionStatus() {
|
|
3535
|
+
return connectionStatus;
|
|
3536
|
+
},
|
|
3537
|
+
set connectionStatus(value) {
|
|
3538
|
+
connectionStatus = value;
|
|
3539
|
+
},
|
|
3540
|
+
get activityStatus() {
|
|
3541
|
+
return activityStatus;
|
|
3542
|
+
},
|
|
3543
|
+
set activityStatus(value) {
|
|
3544
|
+
activityStatus = value;
|
|
3545
|
+
},
|
|
3546
|
+
get statusTimeout() {
|
|
3547
|
+
return statusTimeout;
|
|
3548
|
+
},
|
|
3549
|
+
set statusTimeout(value) {
|
|
3550
|
+
statusTimeout = value;
|
|
3551
|
+
},
|
|
3552
|
+
get lastCtrlCAt() {
|
|
3553
|
+
return lastCtrlCAt;
|
|
3554
|
+
},
|
|
3555
|
+
set lastCtrlCAt(value) {
|
|
3556
|
+
lastCtrlCAt = value;
|
|
3557
|
+
}
|
|
3558
|
+
};
|
|
3559
|
+
const noteLocalRunId = (runId) => {
|
|
3560
|
+
if (!runId) return;
|
|
3561
|
+
localRunIds.add(runId);
|
|
3562
|
+
if (localRunIds.size > 200) {
|
|
3563
|
+
const [first] = localRunIds;
|
|
3564
|
+
if (first) localRunIds.delete(first);
|
|
3565
|
+
}
|
|
3566
|
+
};
|
|
3567
|
+
const forgetLocalRunId = (runId) => {
|
|
3568
|
+
localRunIds.delete(runId);
|
|
3569
|
+
};
|
|
3570
|
+
const isLocalRunId = (runId) => localRunIds.has(runId);
|
|
3571
|
+
const clearLocalRunIds = () => {
|
|
3572
|
+
localRunIds.clear();
|
|
3573
|
+
};
|
|
3574
|
+
const noteLocalBtwRunId = (runId) => {
|
|
3575
|
+
if (!runId) return;
|
|
3576
|
+
localBtwRunIds.add(runId);
|
|
3577
|
+
if (localBtwRunIds.size > 200) {
|
|
3578
|
+
const [first] = localBtwRunIds;
|
|
3579
|
+
if (first) localBtwRunIds.delete(first);
|
|
3580
|
+
}
|
|
3581
|
+
};
|
|
3582
|
+
const forgetLocalBtwRunId = (runId) => {
|
|
3583
|
+
localBtwRunIds.delete(runId);
|
|
3584
|
+
};
|
|
3585
|
+
const isLocalBtwRunId = (runId) => localBtwRunIds.has(runId);
|
|
3586
|
+
const clearLocalBtwRunIds = () => {
|
|
3587
|
+
localBtwRunIds.clear();
|
|
3588
|
+
};
|
|
3589
|
+
const client = await GatewayChatClient.connect({
|
|
3590
|
+
url: opts.url,
|
|
3591
|
+
token: opts.token,
|
|
3592
|
+
password: opts.password
|
|
3593
|
+
});
|
|
3594
|
+
const tui = new TUI(new ProcessTerminal());
|
|
3595
|
+
const dedupeBackspace = createBackspaceDeduper();
|
|
3596
|
+
tui.addInputListener((data) => {
|
|
3597
|
+
const next = dedupeBackspace(data);
|
|
3598
|
+
if (next.length === 0) return { consume: true };
|
|
3599
|
+
return { data: next };
|
|
3600
|
+
});
|
|
3601
|
+
const header = new Text("", 1, 0);
|
|
3602
|
+
const statusContainer = new Container();
|
|
3603
|
+
const footer = new Text("", 1, 0);
|
|
3604
|
+
const chatLog = new ChatLog();
|
|
3605
|
+
chatLog.setTuiRef(tui);
|
|
3606
|
+
const editor = new CustomEditor(tui, editorTheme);
|
|
3607
|
+
const root = new Container();
|
|
3608
|
+
root.addChild(header);
|
|
3609
|
+
root.addChild(chatLog);
|
|
3610
|
+
root.addChild(statusContainer);
|
|
3611
|
+
root.addChild(footer);
|
|
3612
|
+
root.addChild(editor);
|
|
3613
|
+
const updateAutocompleteProvider = () => {
|
|
3614
|
+
editor.setAutocompleteProvider(new CombinedAutocompleteProvider(getSlashCommands({
|
|
3615
|
+
cfg: config,
|
|
3616
|
+
provider: sessionInfo.modelProvider,
|
|
3617
|
+
model: sessionInfo.model
|
|
3618
|
+
}), process.cwd()));
|
|
3619
|
+
};
|
|
3620
|
+
tui.addChild(root);
|
|
3621
|
+
tui.setFocus(editor);
|
|
3622
|
+
const formatSessionKey = (key) => {
|
|
3623
|
+
if (key === "global" || key === "unknown") return key;
|
|
3624
|
+
return parseAgentSessionKey(key)?.rest ?? key;
|
|
3625
|
+
};
|
|
3626
|
+
const formatAgentLabel = (id) => {
|
|
3627
|
+
const name = agentNames.get(id);
|
|
3628
|
+
return name ? `${id} (${name})` : id;
|
|
3629
|
+
};
|
|
3630
|
+
const resolveSessionKey = (raw) => {
|
|
3631
|
+
return resolveTuiSessionKey({
|
|
3632
|
+
raw,
|
|
3633
|
+
sessionScope,
|
|
3634
|
+
currentAgentId,
|
|
3635
|
+
sessionMainKey
|
|
3636
|
+
});
|
|
3637
|
+
};
|
|
3638
|
+
currentSessionKey = resolveSessionKey(initialSessionInput);
|
|
3639
|
+
const updateHeader = () => {
|
|
3640
|
+
const sessionLabel = formatSessionKey(currentSessionKey);
|
|
3641
|
+
const agentLabel = formatAgentLabel(currentAgentId);
|
|
3642
|
+
header.setText(theme.header(`kaijibot tui - ${client.connection.url} - agent ${agentLabel} - session ${sessionLabel}`));
|
|
3643
|
+
};
|
|
3644
|
+
const busyStates = new Set([
|
|
3645
|
+
"sending",
|
|
3646
|
+
"waiting",
|
|
3647
|
+
"streaming",
|
|
3648
|
+
"running"
|
|
3649
|
+
]);
|
|
3650
|
+
let statusText = null;
|
|
3651
|
+
let statusLoader = null;
|
|
3652
|
+
const formatElapsed = (startMs) => {
|
|
3653
|
+
const totalSeconds = Math.max(0, Math.floor((Date.now() - startMs) / 1e3));
|
|
3654
|
+
if (totalSeconds < 60) return `${totalSeconds}s`;
|
|
3655
|
+
return `${Math.floor(totalSeconds / 60)}m ${totalSeconds % 60}s`;
|
|
3656
|
+
};
|
|
3657
|
+
const ensureStatusText = () => {
|
|
3658
|
+
if (statusText) return;
|
|
3659
|
+
statusContainer.clear();
|
|
3660
|
+
statusLoader?.stop();
|
|
3661
|
+
statusLoader = null;
|
|
3662
|
+
statusText = new Text("", 1, 0);
|
|
3663
|
+
statusContainer.addChild(statusText);
|
|
3664
|
+
};
|
|
3665
|
+
const ensureStatusLoader = () => {
|
|
3666
|
+
if (statusLoader) return;
|
|
3667
|
+
statusContainer.clear();
|
|
3668
|
+
statusText = null;
|
|
3669
|
+
statusLoader = new Loader(tui, (spinner) => theme.accent(spinner), (text) => theme.bold(theme.accentSoft(text)), "");
|
|
3670
|
+
statusContainer.addChild(statusLoader);
|
|
3671
|
+
};
|
|
3672
|
+
let waitingTick = 0;
|
|
3673
|
+
let waitingTimer = null;
|
|
3674
|
+
let waitingPhrase = null;
|
|
3675
|
+
const updateBusyStatusMessage = () => {
|
|
3676
|
+
if (!statusLoader || !statusStartedAt) return;
|
|
3677
|
+
const elapsed = formatElapsed(statusStartedAt);
|
|
3678
|
+
if (activityStatus === "waiting") {
|
|
3679
|
+
waitingTick++;
|
|
3680
|
+
statusLoader.setMessage(buildWaitingStatusMessage({
|
|
3681
|
+
theme,
|
|
3682
|
+
tick: waitingTick,
|
|
3683
|
+
elapsed,
|
|
3684
|
+
connectionStatus,
|
|
3685
|
+
phrases: waitingPhrase ? [waitingPhrase] : void 0
|
|
3686
|
+
}));
|
|
3687
|
+
return;
|
|
3688
|
+
}
|
|
3689
|
+
statusLoader.setMessage(`${activityStatus} • ${elapsed} | ${connectionStatus}`);
|
|
3690
|
+
};
|
|
3691
|
+
const startStatusTimer = () => {
|
|
3692
|
+
if (statusTimer) return;
|
|
3693
|
+
statusTimer = setInterval(() => {
|
|
3694
|
+
if (!busyStates.has(activityStatus)) return;
|
|
3695
|
+
updateBusyStatusMessage();
|
|
3696
|
+
}, 1e3);
|
|
3697
|
+
};
|
|
3698
|
+
const stopStatusTimer = () => {
|
|
3699
|
+
if (!statusTimer) return;
|
|
3700
|
+
clearInterval(statusTimer);
|
|
3701
|
+
statusTimer = null;
|
|
3702
|
+
};
|
|
3703
|
+
const startWaitingTimer = () => {
|
|
3704
|
+
if (waitingTimer) return;
|
|
3705
|
+
if (!waitingPhrase) waitingPhrase = defaultWaitingPhrases[Math.floor(Math.random() * defaultWaitingPhrases.length)] ?? defaultWaitingPhrases[0] ?? "waiting";
|
|
3706
|
+
waitingTick = 0;
|
|
3707
|
+
waitingTimer = setInterval(() => {
|
|
3708
|
+
if (activityStatus !== "waiting") return;
|
|
3709
|
+
updateBusyStatusMessage();
|
|
3710
|
+
}, 120);
|
|
3711
|
+
};
|
|
3712
|
+
const stopWaitingTimer = () => {
|
|
3713
|
+
if (!waitingTimer) return;
|
|
3714
|
+
clearInterval(waitingTimer);
|
|
3715
|
+
waitingTimer = null;
|
|
3716
|
+
waitingPhrase = null;
|
|
3717
|
+
};
|
|
3718
|
+
const renderStatus = () => {
|
|
3719
|
+
if (busyStates.has(activityStatus)) {
|
|
3720
|
+
if (!statusStartedAt || lastActivityStatus !== activityStatus) statusStartedAt = Date.now();
|
|
3721
|
+
ensureStatusLoader();
|
|
3722
|
+
if (activityStatus === "waiting") {
|
|
3723
|
+
stopStatusTimer();
|
|
3724
|
+
startWaitingTimer();
|
|
3725
|
+
} else {
|
|
3726
|
+
stopWaitingTimer();
|
|
3727
|
+
startStatusTimer();
|
|
3728
|
+
}
|
|
3729
|
+
updateBusyStatusMessage();
|
|
3730
|
+
} else {
|
|
3731
|
+
statusStartedAt = null;
|
|
3732
|
+
stopStatusTimer();
|
|
3733
|
+
stopWaitingTimer();
|
|
3734
|
+
statusLoader?.stop();
|
|
3735
|
+
statusLoader = null;
|
|
3736
|
+
ensureStatusText();
|
|
3737
|
+
const text = activityStatus ? `${connectionStatus} | ${activityStatus}` : connectionStatus;
|
|
3738
|
+
statusText?.setText(theme.dim(text));
|
|
3739
|
+
}
|
|
3740
|
+
lastActivityStatus = activityStatus;
|
|
3741
|
+
};
|
|
3742
|
+
const setConnectionStatus = (text, ttlMs) => {
|
|
3743
|
+
connectionStatus = text;
|
|
3744
|
+
renderStatus();
|
|
3745
|
+
if (statusTimeout) clearTimeout(statusTimeout);
|
|
3746
|
+
if (ttlMs && ttlMs > 0) statusTimeout = setTimeout(() => {
|
|
3747
|
+
connectionStatus = isConnected ? "connected" : "disconnected";
|
|
3748
|
+
renderStatus();
|
|
3749
|
+
}, ttlMs);
|
|
3750
|
+
};
|
|
3751
|
+
const setActivityStatus = (text) => {
|
|
3752
|
+
activityStatus = text;
|
|
3753
|
+
renderStatus();
|
|
3754
|
+
};
|
|
3755
|
+
const updateFooter = () => {
|
|
3756
|
+
const sessionKeyLabel = formatSessionKey(currentSessionKey);
|
|
3757
|
+
const sessionLabel = sessionInfo.displayName ? `${sessionKeyLabel} (${sessionInfo.displayName})` : sessionKeyLabel;
|
|
3758
|
+
const agentLabel = formatAgentLabel(currentAgentId);
|
|
3759
|
+
const modelLabel = sessionInfo.model ? sessionInfo.modelProvider ? `${sessionInfo.modelProvider}/${sessionInfo.model}` : sessionInfo.model : "unknown";
|
|
3760
|
+
const tokens = formatTokens(sessionInfo.totalTokens ?? null, sessionInfo.contextTokens ?? null);
|
|
3761
|
+
const think = sessionInfo.thinkingLevel ?? "off";
|
|
3762
|
+
const fast = sessionInfo.fastMode === true;
|
|
3763
|
+
const verbose = sessionInfo.verboseLevel ?? "off";
|
|
3764
|
+
const reasoning = sessionInfo.reasoningLevel ?? "off";
|
|
3765
|
+
const reasoningLabel = reasoning === "on" ? "reasoning" : reasoning === "stream" ? "reasoning:stream" : null;
|
|
3766
|
+
const footerParts = [
|
|
3767
|
+
`agent ${agentLabel}`,
|
|
3768
|
+
`session ${sessionLabel}`,
|
|
3769
|
+
modelLabel,
|
|
3770
|
+
think !== "off" ? `think ${think}` : null,
|
|
3771
|
+
fast ? "fast" : null,
|
|
3772
|
+
verbose !== "off" ? `verbose ${verbose}` : null,
|
|
3773
|
+
reasoningLabel,
|
|
3774
|
+
tokens
|
|
3775
|
+
].filter(Boolean);
|
|
3776
|
+
footer.setText(theme.dim(footerParts.join(" | ")));
|
|
3777
|
+
};
|
|
3778
|
+
const { openOverlay, closeOverlay } = createOverlayHandlers(tui, editor);
|
|
3779
|
+
const btw = {
|
|
3780
|
+
showResult: (params) => {
|
|
3781
|
+
chatLog.showBtw(params);
|
|
3782
|
+
},
|
|
3783
|
+
clear: () => {
|
|
3784
|
+
chatLog.dismissBtw();
|
|
3785
|
+
}
|
|
3786
|
+
};
|
|
3787
|
+
const { refreshAgents, refreshSessionInfo, applySessionInfoFromPatch, loadHistory, setSession, abortActive } = createSessionActions({
|
|
3788
|
+
client,
|
|
3789
|
+
chatLog,
|
|
3790
|
+
btw,
|
|
3791
|
+
tui,
|
|
3792
|
+
opts,
|
|
3793
|
+
state,
|
|
3794
|
+
agentNames,
|
|
3795
|
+
initialSessionInput,
|
|
3796
|
+
initialSessionAgentId: (() => {
|
|
3797
|
+
if (!initialSessionInput) return null;
|
|
3798
|
+
const parsed = parseAgentSessionKey(initialSessionInput);
|
|
3799
|
+
return parsed ? normalizeAgentId(parsed.agentId) : null;
|
|
3800
|
+
})(),
|
|
3801
|
+
resolveSessionKey,
|
|
3802
|
+
updateHeader,
|
|
3803
|
+
updateFooter,
|
|
3804
|
+
updateAutocompleteProvider,
|
|
3805
|
+
setActivityStatus,
|
|
3806
|
+
clearLocalRunIds
|
|
3807
|
+
});
|
|
3808
|
+
const { handleChatEvent, handleAgentEvent, handleBtwEvent } = createEventHandlers({
|
|
3809
|
+
chatLog,
|
|
3810
|
+
btw,
|
|
3811
|
+
tui,
|
|
3812
|
+
state,
|
|
3813
|
+
setActivityStatus,
|
|
3814
|
+
refreshSessionInfo,
|
|
3815
|
+
loadHistory,
|
|
3816
|
+
noteLocalRunId,
|
|
3817
|
+
isLocalRunId,
|
|
3818
|
+
forgetLocalRunId,
|
|
3819
|
+
clearLocalRunIds,
|
|
3820
|
+
isLocalBtwRunId,
|
|
3821
|
+
forgetLocalBtwRunId,
|
|
3822
|
+
clearLocalBtwRunIds
|
|
3823
|
+
});
|
|
3824
|
+
const requestExit = () => {
|
|
3825
|
+
if (exitRequested) return;
|
|
3826
|
+
exitRequested = true;
|
|
3827
|
+
client.stop();
|
|
3828
|
+
process.stdout.write("\x1B[?1000l\x1B[?1006l");
|
|
3829
|
+
drainAndStopTuiSafely(tui).then(() => {
|
|
3830
|
+
process.exit(0);
|
|
3831
|
+
});
|
|
3832
|
+
};
|
|
3833
|
+
const { handleCommand, sendMessage, openModelSelector, openAgentSelector, openSessionSelector } = createCommandHandlers({
|
|
3834
|
+
client,
|
|
3835
|
+
chatLog,
|
|
3836
|
+
tui,
|
|
3837
|
+
opts,
|
|
3838
|
+
state,
|
|
3839
|
+
deliverDefault,
|
|
3840
|
+
openOverlay,
|
|
3841
|
+
closeOverlay,
|
|
3842
|
+
refreshSessionInfo,
|
|
3843
|
+
applySessionInfoFromPatch,
|
|
3844
|
+
loadHistory,
|
|
3845
|
+
setSession,
|
|
3846
|
+
refreshAgents,
|
|
3847
|
+
abortActive,
|
|
3848
|
+
setActivityStatus,
|
|
3849
|
+
formatSessionKey,
|
|
3850
|
+
noteLocalRunId,
|
|
3851
|
+
noteLocalBtwRunId,
|
|
3852
|
+
forgetLocalRunId,
|
|
3853
|
+
forgetLocalBtwRunId,
|
|
3854
|
+
requestExit
|
|
3855
|
+
});
|
|
3856
|
+
const { runLocalShellLine } = createLocalShellRunner({
|
|
3857
|
+
chatLog,
|
|
3858
|
+
tui,
|
|
3859
|
+
openOverlay,
|
|
3860
|
+
closeOverlay
|
|
3861
|
+
});
|
|
3862
|
+
updateAutocompleteProvider();
|
|
3863
|
+
const rawSubmitHandler = createEditorSubmitHandler({
|
|
3864
|
+
editor,
|
|
3865
|
+
handleCommand,
|
|
3866
|
+
sendMessage,
|
|
3867
|
+
handleBangLine: runLocalShellLine
|
|
3868
|
+
});
|
|
3869
|
+
const submitHandler = (text) => {
|
|
3870
|
+
chatLog.scrollToBottom();
|
|
3871
|
+
return rawSubmitHandler(text);
|
|
3872
|
+
};
|
|
3873
|
+
editor.onSubmit = createSubmitBurstCoalescer({
|
|
3874
|
+
submit: submitHandler,
|
|
3875
|
+
enabled: shouldEnableWindowsGitBashPasteFallback()
|
|
3876
|
+
});
|
|
3877
|
+
editor.onEscape = () => {
|
|
3878
|
+
if (chatLog.hasVisibleBtw()) {
|
|
3879
|
+
chatLog.dismissBtw();
|
|
3880
|
+
tui.requestRender();
|
|
3881
|
+
return;
|
|
3882
|
+
}
|
|
3883
|
+
abortActive();
|
|
3884
|
+
};
|
|
3885
|
+
const handleCtrlC = () => {
|
|
3886
|
+
const now = Date.now();
|
|
3887
|
+
const decision = resolveCtrlCAction({
|
|
3888
|
+
hasInput: editor.getText().trim().length > 0,
|
|
3889
|
+
now,
|
|
3890
|
+
lastCtrlCAt
|
|
3891
|
+
});
|
|
3892
|
+
lastCtrlCAt = decision.nextLastCtrlCAt;
|
|
3893
|
+
if (decision.action === "clear") {
|
|
3894
|
+
editor.setText("");
|
|
3895
|
+
setActivityStatus("cleared input; press ctrl+c again to exit");
|
|
3896
|
+
tui.requestRender();
|
|
3897
|
+
return;
|
|
3898
|
+
}
|
|
3899
|
+
if (decision.action === "exit") {
|
|
3900
|
+
requestExit();
|
|
3901
|
+
return;
|
|
3902
|
+
}
|
|
3903
|
+
setActivityStatus("press ctrl+c again to exit");
|
|
3904
|
+
tui.requestRender();
|
|
3905
|
+
};
|
|
3906
|
+
editor.onCtrlC = () => {
|
|
3907
|
+
handleCtrlC();
|
|
3908
|
+
};
|
|
3909
|
+
editor.onCtrlD = () => {
|
|
3910
|
+
requestExit();
|
|
3911
|
+
};
|
|
3912
|
+
editor.onCtrlO = () => {
|
|
3913
|
+
toolsExpanded = !toolsExpanded;
|
|
3914
|
+
chatLog.setToolsExpanded(toolsExpanded);
|
|
3915
|
+
setActivityStatus(toolsExpanded ? "tools expanded" : "tools collapsed");
|
|
3916
|
+
tui.requestRender();
|
|
3917
|
+
};
|
|
3918
|
+
editor.onCtrlL = () => {
|
|
3919
|
+
openModelSelector();
|
|
3920
|
+
};
|
|
3921
|
+
editor.onCtrlG = () => {
|
|
3922
|
+
openAgentSelector();
|
|
3923
|
+
};
|
|
3924
|
+
editor.onCtrlP = () => {
|
|
3925
|
+
openSessionSelector();
|
|
3926
|
+
};
|
|
3927
|
+
editor.onCtrlT = () => {
|
|
3928
|
+
showThinking = !showThinking;
|
|
3929
|
+
loadHistory();
|
|
3930
|
+
};
|
|
3931
|
+
tui.addInputListener((data) => {
|
|
3932
|
+
if (!chatLog.hasVisibleBtw()) return;
|
|
3933
|
+
if (editor.getText().length > 0) return;
|
|
3934
|
+
if (matchesKey(data, "enter")) {
|
|
3935
|
+
chatLog.dismissBtw();
|
|
3936
|
+
tui.requestRender();
|
|
3937
|
+
return { consume: true };
|
|
3938
|
+
}
|
|
3939
|
+
});
|
|
3940
|
+
const SGR_MOUSE_WHEEL = new RegExp(`^\\[<(64|65);\\d+;\\d+[Mm]$`);
|
|
3941
|
+
tui.addInputListener((data) => {
|
|
3942
|
+
const match = data.match(SGR_MOUSE_WHEEL);
|
|
3943
|
+
if (!match) return;
|
|
3944
|
+
const button = parseInt(match[1], 10);
|
|
3945
|
+
if (button === 64) chatLog.scrollUp();
|
|
3946
|
+
else if (button === 65) chatLog.scrollDown();
|
|
3947
|
+
return { consume: true };
|
|
3948
|
+
});
|
|
3949
|
+
client.onEvent = (evt) => {
|
|
3950
|
+
if (evt.event === "chat") handleChatEvent(evt.payload);
|
|
3951
|
+
if (evt.event === "chat.side_result") handleBtwEvent(evt.payload);
|
|
3952
|
+
if (evt.event === "agent") handleAgentEvent(evt.payload);
|
|
3953
|
+
};
|
|
3954
|
+
client.onConnected = () => {
|
|
3955
|
+
isConnected = true;
|
|
3956
|
+
pairingHintShown = false;
|
|
3957
|
+
const reconnected = wasDisconnected;
|
|
3958
|
+
wasDisconnected = false;
|
|
3959
|
+
setConnectionStatus("connected");
|
|
3960
|
+
(async () => {
|
|
3961
|
+
await refreshAgents();
|
|
3962
|
+
updateHeader();
|
|
3963
|
+
await loadHistory();
|
|
3964
|
+
setConnectionStatus(reconnected ? "gateway reconnected" : "gateway connected", 4e3);
|
|
3965
|
+
tui.requestRender();
|
|
3966
|
+
if (!autoMessageSent && autoMessage) {
|
|
3967
|
+
autoMessageSent = true;
|
|
3968
|
+
await sendMessage(autoMessage);
|
|
3969
|
+
}
|
|
3970
|
+
updateFooter();
|
|
3971
|
+
tui.requestRender();
|
|
3972
|
+
})();
|
|
3973
|
+
};
|
|
3974
|
+
client.onDisconnected = (reason) => {
|
|
3975
|
+
isConnected = false;
|
|
3976
|
+
wasDisconnected = true;
|
|
3977
|
+
historyLoaded = false;
|
|
3978
|
+
state.activeChatRunId = null;
|
|
3979
|
+
chatLog.scrollToBottom();
|
|
3980
|
+
const disconnectState = resolveGatewayDisconnectState(reason);
|
|
3981
|
+
setConnectionStatus(disconnectState.connectionStatus, 5e3);
|
|
3982
|
+
setActivityStatus(disconnectState.activityStatus);
|
|
3983
|
+
if (disconnectState.pairingHint && !pairingHintShown) {
|
|
3984
|
+
pairingHintShown = true;
|
|
3985
|
+
chatLog.addSystem(disconnectState.pairingHint);
|
|
3986
|
+
}
|
|
3987
|
+
updateFooter();
|
|
3988
|
+
tui.requestRender();
|
|
3989
|
+
};
|
|
3990
|
+
client.onGap = (info) => {
|
|
3991
|
+
setConnectionStatus(`event gap: expected ${info.expected}, got ${info.received}`, 5e3);
|
|
3992
|
+
tui.requestRender();
|
|
3993
|
+
};
|
|
3994
|
+
updateHeader();
|
|
3995
|
+
setConnectionStatus("connecting");
|
|
3996
|
+
updateFooter();
|
|
3997
|
+
const sigintHandler = () => {
|
|
3998
|
+
handleCtrlC();
|
|
3999
|
+
};
|
|
4000
|
+
const sigtermHandler = () => {
|
|
4001
|
+
requestExit();
|
|
4002
|
+
};
|
|
4003
|
+
process.on("SIGINT", sigintHandler);
|
|
4004
|
+
process.on("SIGTERM", sigtermHandler);
|
|
4005
|
+
tui.start();
|
|
4006
|
+
process.stdout.write("\x1B[?1006h\x1B[?1000h");
|
|
4007
|
+
client.start();
|
|
4008
|
+
await new Promise((resolve) => {
|
|
4009
|
+
const finish = () => {
|
|
4010
|
+
process.removeListener("SIGINT", sigintHandler);
|
|
4011
|
+
process.removeListener("SIGTERM", sigtermHandler);
|
|
4012
|
+
resolve();
|
|
4013
|
+
};
|
|
4014
|
+
process.once("exit", finish);
|
|
4015
|
+
});
|
|
4016
|
+
}
|
|
4017
|
+
//#endregion
|
|
4018
|
+
export { runTui as t };
|