limixbot 0.3.51 → 0.3.52
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/assets/{ActivityPanel-C74ksK5_.js → ActivityPanel-DoWrjUz7.js} +1 -1
- package/dist/assets/App-DmJM-bVw.js +243 -0
- package/dist/assets/{AppEventEditor-Derw3FHd.js → AppEventEditor-emHq_cA0.js} +1 -1
- package/dist/assets/BotSettingsDialog-BshbTnT_.js +16 -0
- package/dist/assets/{BrowserPanel-BUwH6i3q.js → BrowserPanel-PLHN7znJ.js} +2 -2
- package/dist/assets/{BrowserProfilesManager-LPWaNOTL.js → BrowserProfilesManager-ChG7MrYQ.js} +1 -1
- package/dist/assets/CloudAddDialog-CyKmG4VN.js +1 -0
- package/dist/assets/ComputerFilesPane-BPu6_l8N.js +1 -0
- package/dist/assets/{ComputerPanel-BKSAp5BV.js → ComputerPanel-Df-QaAS2.js} +2 -2
- package/dist/assets/{DataPanel-C8JFQXPW.js → DataPanel-QSdW8P4h.js} +1 -1
- package/dist/assets/{DesktopViewer-DFhYwHIq.js → DesktopViewer-Du64Zar0.js} +1 -1
- package/dist/assets/{FilesView-uvhFDVLX.js → FilesView-0Ijtj6CN.js} +1 -1
- package/dist/assets/{GrokMoveDialog-DqtBggcO.js → GrokMoveDialog-BVG5-cPU.js} +1 -1
- package/dist/assets/{InspectorPanel-B9946G8k.js → InspectorPanel-CtBr7aZo.js} +2 -2
- package/dist/assets/{KeyboardShortcutsModal-3p8-Y0gj.js → KeyboardShortcutsModal-Co3LHjUp.js} +1 -1
- package/dist/assets/{LimixChannelReview-BDF1Ho_G.js → LimixChannelReview-LNSDJ-cn.js} +1 -1
- package/dist/assets/{LiveDesktop-csn9EgQr.js → LiveDesktop-DPs1lypu.js} +1 -1
- package/dist/assets/{LocalVmWorkspace-CY-cK25P.js → LocalVmWorkspace-Bf2EXh1s.js} +1 -1
- package/dist/assets/{MacLocalControl-tjDKmfaz.js → MacLocalControl-BGeq2FOD.js} +1 -1
- package/dist/assets/{MarkdownFilePreview-C9270gON.js → MarkdownFilePreview-BDNgFKxV.js} +1 -1
- package/dist/assets/{MenuMotion-CtV49YrJ.js → MenuMotion-DFWzLAOE.js} +1 -1
- package/dist/assets/{NewBotDialog-QR0H-5OX.js → NewBotDialog-itNxT2iU.js} +1 -1
- package/dist/assets/{PhoneAppDialog-4jvBw2u6.js → PhoneAppDialog-CMtCT9Xu.js} +1 -1
- package/dist/assets/PlacesRail-i-4ph-KR.js +1 -0
- package/dist/assets/{PluginsPanel-DHUbnE7N.js → PluginsPanel-49ZWw79q.js} +2 -2
- package/dist/assets/ProIntroduction-CyKL7OF8.js +1 -0
- package/dist/assets/{RemoteAgentSettingsPanel-Dllevm4e.js → RemoteAgentSettingsPanel-Bbp1t8mD.js} +1 -1
- package/dist/assets/{RoomPanel-Bd_Xtwqu.js → RoomPanel-Gw0rFOk7.js} +1 -1
- package/dist/assets/{RoutinesPage-QcfeQgTy.js → RoutinesPage-Bo4NVg7D.js} +2 -2
- package/dist/assets/SettingsModal-D4XZMVXS.js +19 -0
- package/dist/assets/{ShareTeamDialog-DMqi3pEn.js → ShareTeamDialog-CeT0rE7W.js} +1 -1
- package/dist/assets/{SignedInSites-DayALoO-.js → SignedInSites-BGpe1m04.js} +1 -1
- package/dist/assets/{TeamLibraryPanel-DMAGl5Yz.js → TeamLibraryPanel-SJebr72G.js} +1 -1
- package/dist/assets/{TeamMapPage-MEkKU-EN.js → TeamMapPage-DIiHaEPP.js} +1 -1
- package/dist/assets/{TriggersPage-D3KTWX3z.js → TriggersPage-Dz_RBgRC.js} +1 -1
- package/dist/assets/VisibilitySection-BLgOrAop.js +22 -0
- package/dist/assets/{WebhookTrigger-DJlTvzBb.js → WebhookTrigger-Cw7eIur5.js} +1 -1
- package/dist/assets/{WorksOnGrid-CW82h_3C.js → WorksOnGrid-DJiQ_gRM.js} +1 -1
- package/dist/assets/{abnfDiagram-YUKMZFIV-DmWI1Mtg.js → abnfDiagram-YUKMZFIV-CAhmS2rs.js} +1 -1
- package/dist/assets/{activity-WfPBvs3Z.js → activity-Bi0tXcsw.js} +1 -1
- package/dist/assets/{architectureDiagram-47P4ROYG-rzc3-Q0w.js → architectureDiagram-47P4ROYG-B6w0Yu0g.js} +1 -1
- package/dist/assets/{blockDiagram-E7TT5TSB-VPDyKlQ7.js → blockDiagram-E7TT5TSB-BYtaJu6s.js} +1 -1
- package/dist/assets/{c4Diagram-CRA5TL53-C9OGckku.js → c4Diagram-CRA5TL53-B_FsOyDV.js} +1 -1
- package/dist/assets/{calendar-days-W4JHp6-m.js → calendar-days-B8SfZLZO.js} +1 -1
- package/dist/assets/channel-DVwNbGUM.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-EpYkwMC8.js → chunk-2Q5K7J3B-BdKiuWEd.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-DyJEI8X6.js → chunk-5VM5RSS4-CgItQr02.js} +1 -1
- package/dist/assets/{chunk-7TKQ45FW-CJvVxQ2I.js → chunk-7TKQ45FW-BFsWqiRT.js} +1 -1
- package/dist/assets/{chunk-AW2ZBBNX-s78zNrhy.js → chunk-AW2ZBBNX-Cnj5ddTo.js} +1 -1
- package/dist/assets/{chunk-FVRAUYC3-CUPjaz9e.js → chunk-FVRAUYC3-BCqqreNP.js} +2 -2
- package/dist/assets/{chunk-HTAEGDNF-BhuM2dxl.js → chunk-HTAEGDNF-BOE8LQps.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-DAj1UgJ8.js → chunk-JWPE2WC7-DhA4nyzx.js} +1 -1
- package/dist/assets/{chunk-KQW6MTUR-BgfdtkJI.js → chunk-KQW6MTUR-DzXl5ZXS.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-Vak43p0S.js → chunk-XXDRQBXY-C6tPSut7.js} +1 -1
- package/dist/assets/{classDiagram-v2-K4WV4PDN-Cjvbs86l.js → classDiagram-v2-K4WV4PDN-DQW9NJQl.js} +1 -1
- package/dist/assets/{core-x2kyD7fr.js → core-B3WlSEbe.js} +1 -1
- package/dist/assets/{cose-bilkent-JH36ORCC-BEekB3gO.js → cose-bilkent-JH36ORCC-6jNO5GSL.js} +1 -1
- package/dist/assets/{cynefin-EF2NZ3EQ-D3g3_jPk.js → cynefin-EF2NZ3EQ-mnQt4_3K.js} +1 -1
- package/dist/assets/{cynefinDiagram-3GCD6N5R-13xmjXZj.js → cynefinDiagram-3GCD6N5R-DoEMDFuf.js} +1 -1
- package/dist/assets/{dagre-W4DXFKR2-CHAV8s2t.js → dagre-W4DXFKR2-DoKMCbtK.js} +1 -1
- package/dist/assets/de-C8GllVmL.js +8 -0
- package/dist/assets/{diagram-2UJZ2QOL-DgwdzZN7.js → diagram-2UJZ2QOL-dVwBPQ-y.js} +1 -1
- package/dist/assets/{diagram-OVF4WLC6-DobmWwa_.js → diagram-OVF4WLC6-xIwVUznT.js} +1 -1
- package/dist/assets/{diagram-PFPMY2P6-CWjTVc0N.js → diagram-PFPMY2P6-DAkRkPXu.js} +1 -1
- package/dist/assets/{diagram-UMYRVEAY-CAruZkhk.js → diagram-UMYRVEAY-YE49n-np.js} +1 -1
- package/dist/assets/{diagram-YEKJPTXX-Bcs89mQN.js → diagram-YEKJPTXX-DQkmy5qU.js} +1 -1
- package/dist/assets/{diagram-ZIFT7M5P-Dz-O18tl.js → diagram-ZIFT7M5P-u9Uj06_B.js} +1 -1
- package/dist/assets/{ebnfDiagram-VR2GEFS7-CJX4rMIs.js → ebnfDiagram-VR2GEFS7-DoxIDWDW.js} +1 -1
- package/dist/assets/{elk-IJKZMXRS-Byop6FtW.js → elk-IJKZMXRS-DPDeQQIg.js} +1 -1
- package/dist/assets/{erDiagram-O2IAPWRE-ChpLnNCF.js → erDiagram-O2IAPWRE-BHdTvU5H.js} +1 -1
- package/dist/assets/{file-up-G3qWGpEB.js → file-up-BkYyRMzo.js} +1 -1
- package/dist/assets/{flowDiagram-OXPTDLAJ-CWWhkNOE.js → flowDiagram-OXPTDLAJ-ChNmwKMG.js} +1 -1
- package/dist/assets/{ganttDiagram-R7TSEDQI-DMXicWgq.js → ganttDiagram-R7TSEDQI-3Sx3AKf_.js} +1 -1
- package/dist/assets/{gitGraphDiagram-XJZIOB7I-CpiCnPUQ.js → gitGraphDiagram-XJZIOB7I-C67fsohV.js} +1 -1
- package/dist/assets/{import-name-Dob2tT-n.js → import-name-zOg5ckYf.js} +1 -1
- package/dist/assets/index-DhTEAf1-.js +3 -0
- package/dist/assets/{index-B7zM90O2.js → index-Uvk6r9xX.js} +1 -1
- package/dist/assets/{infoDiagram-5W2HQ5XZ-BU9zbv9f.js → infoDiagram-5W2HQ5XZ-CBtxWn_a.js} +1 -1
- package/dist/assets/{ishikawaDiagram-K3B6WC7H-KEjUVvmG.js → ishikawaDiagram-K3B6WC7H-B0368JQ8.js} +1 -1
- package/dist/assets/{journeyDiagram-COXZFDF6-DGU1V_40.js → journeyDiagram-COXZFDF6-BlyoIOJv.js} +1 -1
- package/dist/assets/{kanban-definition-P3RFRI5V-weJ2OFB2.js → kanban-definition-P3RFRI5V-Cn5CUDI2.js} +1 -1
- package/dist/assets/{mcp-servers-Cki_Gh83.js → mcp-servers-BffOs9kX.js} +1 -1
- package/dist/assets/{mermaid.core-DhSRukyE.js → mermaid.core-BitzuZjJ.js} +4 -4
- package/dist/assets/{mindmap-definition-LZFPQGKD-DKKO0DWj.js → mindmap-definition-LZFPQGKD-Jg9lbPrn.js} +1 -1
- package/dist/assets/{minimize-C16JX5N8.js → minimize-CIbeUlkc.js} +1 -1
- package/dist/assets/{monitor-Bben4nuu.js → monitor-CQgH3Q9j.js} +1 -1
- package/dist/assets/{new-bot-Cdx_YpVT.js → new-bot-D75cIR6C.js} +2 -2
- package/dist/assets/org-library-pEzmTM3q.js +1 -0
- package/dist/assets/{package-format-C4A5Q4UD.js → package-format-C8RU0HIi.js} +2 -2
- package/dist/assets/{pegDiagram-BGZESJAR-CNNprTkt.js → pegDiagram-BGZESJAR-CnAlnJHt.js} +1 -1
- package/dist/assets/{pieDiagram-CAPJLFHJ-pS8U8zdK.js → pieDiagram-CAPJLFHJ-DaL17-zU.js} +1 -1
- package/dist/assets/pt-br-DiNqB940.js +13 -0
- package/dist/assets/{quadrantDiagram-GDMTTRAM-CLk_fr2j.js → quadrantDiagram-GDMTTRAM-BJHzyXHs.js} +1 -1
- package/dist/assets/rail-BDfsZpav.js +1 -0
- package/dist/assets/{railroadDiagram-SM67HX2B-DH8VPMJG.js → railroadDiagram-SM67HX2B-Cw9re6eo.js} +1 -1
- package/dist/assets/{remote-desktop-panel-XKcfTfrc.js → remote-desktop-panel-BI4lP7pc.js} +1 -1
- package/dist/assets/{requirementDiagram-X7JNWC4A-CoHRI7dx.js → requirementDiagram-X7JNWC4A-Cd7X7PJA.js} +1 -1
- package/dist/assets/{sankeyDiagram-UM26HJRW-2zcVfvWw.js → sankeyDiagram-UM26HJRW-nufeOHip.js} +1 -1
- package/dist/assets/{sequenceDiagram-ZO4K6R2Y-B0d21eid.js → sequenceDiagram-ZO4K6R2Y-CMZoHw7j.js} +1 -1
- package/dist/assets/{sizeCapture-INFHLROL-CcYkvoh7.js → sizeCapture-INFHLROL-DPZOqMVW.js} +1 -1
- package/dist/assets/{stateDiagram-v2-TBUQTH76-B5EilR72.js → stateDiagram-v2-TBUQTH76-BpWOIyFw.js} +1 -1
- package/dist/assets/styles-BvB4UlHn.js +79 -0
- package/dist/assets/styles-Ce5Qc_2r.css +1 -0
- package/dist/assets/{swimlanes-N4OXWK64-xM7mNll9.js → swimlanes-N4OXWK64-BNx8ZaTX.js} +1 -1
- package/dist/assets/swimlanesDiagram-K3J5GTZL-BO73RuC_.js +8 -0
- package/dist/assets/{team-share-Bp69YR8I.js → team-share-CNY994iy.js} +1 -1
- package/dist/assets/{timeline-definition-YOQAKGHF-DM6SmhCQ.js → timeline-definition-YOQAKGHF-L78B2xWx.js} +1 -1
- package/dist/assets/{usecaseDiagram-VIAY4XPW-DiUdGN3G.js → usecaseDiagram-VIAY4XPW-gU5zWpPp.js} +1 -1
- package/dist/assets/{vennDiagram-BLWOH2XV-DrtmNBp4.js → vennDiagram-BLWOH2XV-pdiz8880.js} +1 -1
- package/dist/assets/vi-Cbg_srO_.js +15 -0
- package/dist/assets/{wardleyDiagram-YMQ3BMBF-D7jihWm5.js → wardleyDiagram-YMQ3BMBF-F-D92MhK.js} +1 -1
- package/dist/assets/{xychartDiagram-TAQBALBS-BCk-D9Uj.js → xychartDiagram-TAQBALBS-DKMdsWWR.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/rail.html +5 -5
- package/dist-server/bot-box/box-check.js +10 -10
- package/dist-server/cloud-home-start.js +5 -5
- package/dist-server/container-mcp.js +2 -2
- package/dist-server/drivers/agents-proxy.js +128 -126
- package/dist-server/index.js +8241 -7922
- package/dist-server/mcp-gate.js +18 -17
- package/dist-server/openmausbot.js +1153 -1119
- package/dist-server/package.json +1 -1
- package/dist-server/pair-cli.js +1028 -997
- package/dist-server/server/activity.js +1 -0
- package/dist-server/server/agents-turn.js +2 -1
- package/dist-server/server/app-settings/host.js +187 -0
- package/dist-server/server/app-settings/picture-file.js +62 -0
- package/dist-server/server/app-settings/registry-bots.js +147 -0
- package/dist-server/server/app-settings/registry-config.js +190 -0
- package/dist-server/server/app-settings/registry-pictures.js +59 -0
- package/dist-server/server/app-settings/registry-window.js +35 -0
- package/dist-server/server/app-settings/registry.js +287 -0
- package/dist-server/server/attachments.js +16 -12
- package/dist-server/server/automation-reports.js +11 -1
- package/dist-server/server/bot-attachment.js +34 -10
- package/dist-server/server/bot-box/env.js +2 -2
- package/dist-server/server/bot-box/plan.js +1 -1
- package/dist-server/server/cloud-home-start.js +2 -0
- package/dist-server/server/config.js +1 -0
- package/dist-server/server/drivers/acp/client-path.js +39 -0
- package/dist-server/server/drivers/acp/core.js +9 -37
- package/dist-server/server/drivers/agents-app-settings-tool.js +22 -0
- package/dist-server/server/drivers/agents-call.js +8 -3
- package/dist-server/server/drivers/agents-catalog-profile.js +2 -1
- package/dist-server/server/drivers/agents-catalog.js +19 -2
- package/dist-server/server/drivers/agents-claude-defer.js +38 -0
- package/dist-server/server/drivers/agents-mcp-env.js +2 -2
- package/dist-server/server/drivers/agents-mcp.js +2 -1
- package/dist-server/server/drivers/agents-proxy.js +0 -1
- package/dist-server/server/drivers/agents-tool-groups.js +45 -0
- package/dist-server/server/drivers/antigravity-acp.js +6 -2
- package/dist-server/server/drivers/antigravity-skills.js +107 -0
- package/dist-server/server/drivers/antigravity.js +9 -1
- package/dist-server/server/drivers/claude-bot-settings.js +22 -1
- package/dist-server/server/drivers/claude-tool-search.js +20 -2
- package/dist-server/server/drivers/claude.js +12 -12
- package/dist-server/server/drivers/ollama-context.js +5 -2
- package/dist-server/server/drivers/openai-chat.js +10 -10
- package/dist-server/server/drivers/retry.js +3 -2
- package/dist-server/server/email/host.js +6 -2
- package/dist-server/server/engine-handshake.js +1 -0
- package/dist-server/server/generated-image.js +1 -1
- package/dist-server/server/host/bot-holds.js +76 -0
- package/dist-server/server/host/fill-login-turn.js +2 -2
- package/dist-server/server/host/handoff-limits.js +30 -0
- package/dist-server/server/host/limit-takeover.js +11 -0
- package/dist-server/server/host/peer-limit-resend.js +147 -0
- package/dist-server/server/host/skills-library.js +15 -1
- package/dist-server/server/host/trust-answers.js +42 -0
- package/dist-server/server/imported-skills.js +15 -4
- package/dist-server/server/index.js +109 -125
- package/dist-server/server/limit-poll.js +32 -0
- package/dist-server/server/limit-reset-owed.js +15 -0
- package/dist-server/server/limit-resets.js +33 -8
- package/dist-server/server/login-fill.js +37 -9
- package/dist-server/server/mcp-gate-config.js +28 -0
- package/dist-server/server/mcp-gate.js +8 -2
- package/dist-server/server/message-file.js +10 -1
- package/dist-server/server/quota-switch.js +7 -5
- package/dist-server/server/replies.js +1 -1
- package/dist-server/server/request-auth.js +7 -4
- package/dist-server/server/routes/app-settings.js +46 -0
- package/dist-server/server/routes/bot-holds.js +24 -0
- package/dist-server/server/routes/bot-patch.js +7 -0
- package/dist-server/server/routes/call-route.js +16 -0
- package/dist-server/server/routes/channels.js +45 -38
- package/dist-server/server/routes/custom-domain.js +36 -0
- package/dist-server/server/routes/sidebar-sections.js +1 -0
- package/dist-server/server/routes/threads.js +1 -1
- package/dist-server/server/routine-lines.js +25 -0
- package/dist-server/server/routines.js +9 -5
- package/dist-server/server/runtime/envelope.js +3 -0
- package/dist-server/server/runtime/store.js +1 -0
- package/dist-server/server/send-idempotency.js +43 -0
- package/dist-server/server/shared-computers.js +35 -6
- package/dist-server/server/themes/history.js +54 -0
- package/dist-server/server/themes/routes.js +136 -0
- package/dist-server/server/themes/store.js +266 -0
- package/dist-server/server/themes/tool.js +151 -0
- package/dist-server/server/tool-groups.js +12 -0
- package/dist-server/server/turn-continuation.js +6 -6
- package/dist-server/shared/app-settings.js +60 -0
- package/dist-server/shared/bot-limit.js +2 -0
- package/dist-server/shared/plain-preview.js +3 -2
- package/dist-server/shared/theme.js +240 -0
- package/dist-server/shared/tool-groups.js +27 -0
- package/dist-server/src/lib/composer-attachments.js +22 -6
- package/dist-server/vps-container-mcp.js +12 -12
- package/dist-server/workspace-backup.worker.js +2 -2
- package/package.json +1 -1
- package/dist/assets/App-BjHYb_ps.js +0 -243
- package/dist/assets/BotSettingsDialog-D8LUP9Jn.js +0 -16
- package/dist/assets/CloudAddDialog-BbmxUPbT.js +0 -1
- package/dist/assets/ComputerFilesPane-Df6Y0sr2.js +0 -1
- package/dist/assets/PlacesRail-COZEZH0n.js +0 -57
- package/dist/assets/ProIntroduction-Cc_7SVv1.js +0 -1
- package/dist/assets/SettingsModal-MzznkaJe.js +0 -19
- package/dist/assets/VisibilitySection-ajWCQrhN.js +0 -22
- package/dist/assets/channel-DAFePtOr.js +0 -1
- package/dist/assets/de-CJcRve_J.js +0 -8
- package/dist/assets/index-C2Sr_aMA.js +0 -2
- package/dist/assets/org-library-tRxkixxQ.js +0 -1
- package/dist/assets/pt-br-Dr9a700a.js +0 -13
- package/dist/assets/rail-CpM5o3ti.js +0 -1
- package/dist/assets/styles-Cbtcp5Re.js +0 -23
- package/dist/assets/styles-rYmbSF4Y.css +0 -1
- package/dist/assets/swimlanesDiagram-K3J5GTZL-CnVwW_RC.js +0 -8
- package/dist/assets/vi-vTat5qyz.js +0 -15
- package/dist-server/server/limix-managed-grant.js +0 -110
|
@@ -13,19 +13,19 @@ import { brokerSocketPath, describeSpawnFailure, execCli, killCliTree, spawnCli
|
|
|
13
13
|
import { cliVersionProbe } from "../cli-version-probe.js";
|
|
14
14
|
import { claudeAuthStatus } from "./claude-auth-status.js";
|
|
15
15
|
import { projectMcpServers } from "./claude-project-mcp.js";
|
|
16
|
-
import { botSettingsFor, withBotSettings } from "./claude-bot-settings.js";
|
|
16
|
+
import { botSettingsFor, folderSettingsEnv, withBotSettings } from "./claude-bot-settings.js";
|
|
17
17
|
import { claudeBilling, claudeCallUsage } from "./claude-billing.js";
|
|
18
18
|
import { claudeAuthFailure, claudeAuthRecovery, claudeOAuthExpired } from "./claude-auth-recovery.js";
|
|
19
19
|
import { AWS_CREDENTIAL_ENV_KEYS, bedrockResultError, withBedrockCredentialError } from "./claude-bedrock-aws.js";
|
|
20
20
|
import { CLAUDE_MODEL_ID, STATIC_CLAUDE_MODELS, claudeModelExtras, currentEngineCatalog, endpointModelCatalog, withCliVersionGate } from "./claude-model-extras.js";
|
|
21
|
-
import { claudeToolSearchSetting } from "./claude-tool-search.js";
|
|
21
|
+
import { claudeAgentsMount, claudeToolSearchSetting } from "./claude-tool-search.js";
|
|
22
22
|
import { claudeDisabledNativeSkillRules, unusableBuiltIns } from "./claude-unusable-tools.js";
|
|
23
23
|
import { EMAIL_READ_TOOL_NAMES } from "../../shared/email.js";
|
|
24
24
|
import { claudeElicitations } from "./claude-elicitation.js";
|
|
25
25
|
import { readCostHistory, recordCostState } from "./claude-cost-history.js";
|
|
26
26
|
import { classifyResumeFailure, mayReplay, rebuiltSessionNotice, recoveryPromptFor } from "../resume-recovery.js";
|
|
27
27
|
import { ClaudeLoginController } from "./claude-login-auth.js";
|
|
28
|
-
import { appMountFor, customServerGate, gateQueryTools, gateServer } from "../mcp-gate-config.js";
|
|
28
|
+
import { appMountFor, customServerGate, gateQueryTools, gateServer, limitUngatedOutput } from "../mcp-gate-config.js";
|
|
29
29
|
import { canUseMcpServer } from "../../shared/tool-scope.js";
|
|
30
30
|
import { assertToolScopeSupported } from "../../shared/tool-scope-support.js";
|
|
31
31
|
import { newEventId, newId } from "../contracts.js";
|
|
@@ -894,6 +894,7 @@ export const ClaudeDriver = {
|
|
|
894
894
|
if (replaysUserMessages)
|
|
895
895
|
args.push("--replay-user-messages");
|
|
896
896
|
const isolated = !inheritsUserConfig(turnEnvironment);
|
|
897
|
+
const projectSettingsOnly = isolated && claudeCliSupports(cliVersion, "--setting-sources");
|
|
897
898
|
const disallowed = [...(config.disallowedTools ?? []), ...unusableBuiltIns({ isolated, listsTools: config.tools !== undefined, guest: Boolean(turn.guestConfined) }), ...claudeDisabledNativeSkillRules(botId)];
|
|
898
899
|
if (disallowed.length)
|
|
899
900
|
args.push("--disallowedTools", disallowed.join(","));
|
|
@@ -904,7 +905,7 @@ export const ClaudeDriver = {
|
|
|
904
905
|
// Without these every turn gets this machine's MCP servers, connectors, skills, hooks and CLAUDE.md (one desktop: 407 tools, ~10k tokens).
|
|
905
906
|
if (!turn.mcpFromUserConfig && claudeCliSupports(cliVersion, "--strict-mcp-config"))
|
|
906
907
|
args.push("--strict-mcp-config");
|
|
907
|
-
if (
|
|
908
|
+
if (projectSettingsOnly)
|
|
908
909
|
args.push("--setting-sources", "project");
|
|
909
910
|
if (turn.userSkillsDir)
|
|
910
911
|
args.push("--add-dir", turn.userSkillsDir);
|
|
@@ -944,10 +945,10 @@ export const ClaudeDriver = {
|
|
|
944
945
|
if (!controlsHost)
|
|
945
946
|
allowed.push("mcp__computer");
|
|
946
947
|
}
|
|
948
|
+
const cwd = turn.cwd ?? homedir(), toolSearch = claudeToolSearchSetting(cwd, turnEnvironment);
|
|
947
949
|
// Pre-allowed, or the CLI's own ListAgents look-alike shadows it.
|
|
948
950
|
if (turn.integrations?.agents) {
|
|
949
|
-
|
|
950
|
-
mcpServers.agents = { ...turn.integrations.agents, alwaysLoad: true };
|
|
951
|
+
mcpServers.agents = claudeAgentsMount(turn.integrations.agents, toolSearch);
|
|
951
952
|
allowed.push("mcp__agents");
|
|
952
953
|
}
|
|
953
954
|
if (turn.integrations?.phone) {
|
|
@@ -1048,9 +1049,7 @@ export const ClaudeDriver = {
|
|
|
1048
1049
|
if (process.versions.electron)
|
|
1049
1050
|
env.ELECTRON_RUN_AS_NODE = "1";
|
|
1050
1051
|
}
|
|
1051
|
-
const cwd = turn.cwd ?? homedir();
|
|
1052
1052
|
// Every MCP server without alwaysLoad loads on demand behind ToolSearch (claude-tool-search.ts).
|
|
1053
|
-
const toolSearch = claudeToolSearchSetting(cwd, env);
|
|
1054
1053
|
const own = { ...authSettings, env: { ...authSettings.env, ENABLE_TOOL_SEARCH: toolSearch, ...(isolated ? CLAUDE_OWN_MEMORY_OFF : {}) } };
|
|
1055
1054
|
// Project-only settings still find the personal memory via ancestors when the bot lives under HOME.
|
|
1056
1055
|
if (isolated)
|
|
@@ -1059,10 +1058,11 @@ export const ClaudeDriver = {
|
|
|
1059
1058
|
own.hooks = claudeHookSettings(HOOK_HELPER_PATH);
|
|
1060
1059
|
if (turn.guestConfined)
|
|
1061
1060
|
own.permissions = GUEST_CLAUDE_PERMISSIONS;
|
|
1062
|
-
// Approvals and browser credentials expire at the turn boundary; native background workers must not outlive it.
|
|
1063
|
-
env.CLAUDE_CODE_DISABLE_BACKGROUND_TASKS = "1";
|
|
1064
|
-
// Never for a guest: --restricted leaves project settings out, and a hook is a command.
|
|
1061
|
+
// Approvals and browser credentials expire at the turn boundary; native background workers and cron jobs must not outlive it.
|
|
1062
|
+
env.CLAUDE_CODE_DISABLE_BACKGROUND_TASKS = env.CLAUDE_CODE_DISABLE_CRON = "1";
|
|
1063
|
+
// Never for a guest: --restricted leaves project settings out, and a hook is a command. The MCP output limit comes after, so one the bot set there is kept.
|
|
1065
1064
|
const botSettings = turn.guestConfined ? {} : botSettingsFor(turn.botSettingsFile, cwd, env);
|
|
1065
|
+
limitUngatedOutput(env, mcpServers, botOwned, turn.integrations?.customResultBudgets, botSettings.env?.MAX_MCP_OUTPUT_TOKENS ?? (turn.guestConfined ? undefined : folderSettingsEnv(cwd, "MAX_MCP_OUTPUT_TOKENS", projectSettingsOnly)));
|
|
1066
1066
|
const settings = withBotSettings(botSettings, own);
|
|
1067
1067
|
const authSettingsPath = mcpConfigPath && Object.keys(settings).length
|
|
1068
1068
|
? join(dirname(mcpConfigPath), "auth-settings.json") : null;
|
|
@@ -1080,7 +1080,7 @@ export const ClaudeDriver = {
|
|
|
1080
1080
|
base: env.ANTHROPIC_BASE_URL ?? null,
|
|
1081
1081
|
configDir: env.CLAUDE_CONFIG_DIR ?? null,
|
|
1082
1082
|
hooks: Boolean(hooks),
|
|
1083
|
-
toolSearch,
|
|
1083
|
+
toolSearch, mcpOutputTokens: env.MAX_MCP_OUTPUT_TOKENS ?? null,
|
|
1084
1084
|
botSettings: createHash("sha256").update(JSON.stringify(botSettings)).digest("hex"),
|
|
1085
1085
|
// Rotating an account's key/helper must not reuse the old process.
|
|
1086
1086
|
auth: createHash("sha256").update(JSON.stringify({
|
|
@@ -13,6 +13,9 @@ const WINDOW_BYTES_PER_TOKEN = 64 * 1024;
|
|
|
13
13
|
const MEMORY_SHARE = 0.75;
|
|
14
14
|
const nameFor = (model, window) => `${model.includes(":") ? model : `${model}:latest`}-omb-${window / 1024}k`;
|
|
15
15
|
export const isContextName = (model) => SUFFIX.test(model);
|
|
16
|
+
/** Ollama's own rule (internal/modelref, v0.40.16): a tag of `cloud`, or one ending in `-cloud`, runs on ollama.com, whose
|
|
17
|
+
* /api/show answer carries no remote_host or remote_model. */
|
|
18
|
+
const CLOUD_TAG = /:(?:[^:/]*-)?cloud$/i;
|
|
16
19
|
/** The name a person picked, for one of ours coming back in a server's lists. */
|
|
17
20
|
export const pickedName = (model) => model.replace(SUFFIX, "");
|
|
18
21
|
/** The largest power of two that leaves the weights room, between what an agent needs and what stays fast on a laptop. */
|
|
@@ -47,8 +50,8 @@ async function json(fetchImpl, url, init, timeoutMs) {
|
|
|
47
50
|
const post = (body) => ({ method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(body) });
|
|
48
51
|
async function decide(origin, model, fetchImpl, memoryBytes) {
|
|
49
52
|
const facts = showFacts(await json(fetchImpl, `${origin}/api/show`, post({ model }), 3_000));
|
|
50
|
-
if (facts.remote)
|
|
51
|
-
return { model };
|
|
53
|
+
if (facts.remote || CLOUD_TAG.test(model))
|
|
54
|
+
return { model, ...(facts.trained ? { window: facts.trained } : {}) };
|
|
52
55
|
if (facts.pinned)
|
|
53
56
|
return { model, window: facts.pinned };
|
|
54
57
|
const running = await json(fetchImpl, `${origin}/api/ps`, {}, 3_000).catch(() => null);
|
|
@@ -489,6 +489,7 @@ export function createOpenAIChatRuntime(options) {
|
|
|
489
489
|
const seenCalls = new Set();
|
|
490
490
|
let nudges = 0;
|
|
491
491
|
let unread = [];
|
|
492
|
+
const deliveredAsides = [];
|
|
492
493
|
let callsAtNudge = -1;
|
|
493
494
|
const repeats = options.localModel ? new ChatRepeatGuard() : undefined;
|
|
494
495
|
let unreadable = false, askedAgain = false;
|
|
@@ -512,8 +513,10 @@ export function createOpenAIChatRuntime(options) {
|
|
|
512
513
|
abort.signal.throwIfAborted();
|
|
513
514
|
// Between rounds, never inside a tool batch.
|
|
514
515
|
unread = turnEntry.asides.splice(0);
|
|
515
|
-
if (unread.length)
|
|
516
|
+
if (unread.length) {
|
|
516
517
|
messages.push({ role: "user", content: unread.join("\n\n") });
|
|
518
|
+
deliveredAsides.push(...unread);
|
|
519
|
+
}
|
|
517
520
|
turnEntry.ending = round === MAX_CHAT_ROUNDS - 1;
|
|
518
521
|
native("out", options.nativeLog.outgoing(turn, messages, model, tools.definitions));
|
|
519
522
|
let attempt = 0;
|
|
@@ -717,8 +720,9 @@ export function createOpenAIChatRuntime(options) {
|
|
|
717
720
|
let fatal, title = call.function.name, skipRepeatCount = false;
|
|
718
721
|
try {
|
|
719
722
|
let args;
|
|
723
|
+
const rawArguments = call.function.arguments.trim() ? call.function.arguments : "{}";
|
|
720
724
|
try {
|
|
721
|
-
args = JSON.parse(
|
|
725
|
+
args = JSON.parse(rawArguments);
|
|
722
726
|
}
|
|
723
727
|
catch {
|
|
724
728
|
throw new ChatProtocolError("tool arguments are not complete JSON");
|
|
@@ -860,14 +864,10 @@ export function createOpenAIChatRuntime(options) {
|
|
|
860
864
|
const continuable = classifyContinuable(stopReason, failure);
|
|
861
865
|
if (continuable) {
|
|
862
866
|
const handoffPath = writeTurnHandoff({
|
|
863
|
-
threadId: turn.threadId,
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
hasUsage,
|
|
868
|
-
failure,
|
|
869
|
-
toolCalls: seenCalls.size,
|
|
870
|
-
messages,
|
|
867
|
+
threadId: turn.threadId, turnId, model,
|
|
868
|
+
usage, hasUsage, failure, toolCalls: seenCalls.size,
|
|
869
|
+
task: turn.text, updates: deliveredAsides,
|
|
870
|
+
messages: messages.slice(messages.indexOf(request) + 1),
|
|
871
871
|
});
|
|
872
872
|
if (handoffPath)
|
|
873
873
|
emit({ ...base(turn.threadId, turnId), type: "cap.exhausted", handoffPath, reason: continuable });
|
|
@@ -5,11 +5,11 @@ export const BACKOFF_BASE_MS = [1_000, 3_000, 8_000];
|
|
|
5
5
|
const TRANSIENT_PATTERNS = [
|
|
6
6
|
{ pattern: /\b(?:429|rate.?limit|too many requests)\b/i, reason: "rate_limited" },
|
|
7
7
|
{ pattern: /\boverloaded\b|\bcapacity\b/i, reason: "overloaded" },
|
|
8
|
-
{ pattern: /\b5\d{2}\b|\binternal server error\b|\bbad gateway\b|\bservice unavailable\b/i, reason: "server_error" },
|
|
8
|
+
{ pattern: /\b5\d{2}\b|\binternal server error\b|\binternal service failure\b|\bServiceUnavailableError\b|\bbad gateway\b|\bservice unavailable\b/i, reason: "server_error" },
|
|
9
9
|
// Codex's ChatGPT workspace routing lookup (codex-cli 0.160); only its "unauthorized" variant is a sign-in problem.
|
|
10
10
|
{ pattern: /\bworkspace routing discovery (?:failed|timed out)\b/i, reason: "server_error" },
|
|
11
11
|
{
|
|
12
|
-
pattern: /\b(?:econnreset|econnrefused|epipe|etimedout|eai_again|connection reset|connection refused|socket hang up|network error|fetch failed)\b/i,
|
|
12
|
+
pattern: /\b(?:econnreset|econnrefused|epipe|etimedout|eai_again|unexpected_eof_while_reading|connection reset|connection refused|socket hang up|network error|fetch failed)\b/i,
|
|
13
13
|
reason: "connection_reset",
|
|
14
14
|
},
|
|
15
15
|
{ pattern: /\btimeout(ed)?\b|\btimed? out\b/i, reason: "timeout" },
|
|
@@ -31,6 +31,7 @@ const TERMINAL_PATTERNS = [
|
|
|
31
31
|
{ pattern: /\b404\b|\bno such thread\b|\bthread gone\b/i, reason: "not_found" },
|
|
32
32
|
// A turn the user stopped must never come back as an auto-retry.
|
|
33
33
|
{ pattern: /\b(?:interrupted|cancelled by user)\b/i, reason: "interrupted" },
|
|
34
|
+
{ pattern: /\bcertificate[ _]verify[ _]failed\b/i, reason: "unknown" },
|
|
34
35
|
];
|
|
35
36
|
const messageOf = (err) => {
|
|
36
37
|
if (!err)
|
|
@@ -15,6 +15,7 @@ import { EmailError, LASTING_SENDING_FAULTS, LIST_MAX, listMailboxes, listMessag
|
|
|
15
15
|
import { EMAIL_CANT_SEND_PROMPT, EMAIL_CANT_SEND_TEXT, EMAIL_INSTRUCTIONS, EMAIL_NOT_CONNECTED_TEXT, EMAIL_NOT_SENT_TEXT, EMAIL_PROMPT, EMAIL_TO_CONNECT_PROMPT } from "./instructions.js";
|
|
16
16
|
import { sendingProblem } from "./service.js";
|
|
17
17
|
import { EMAIL_TOOLS, emailError, emailText, emailToolCallProblem, isEmailRead, isEmailToolName } from "./tools.js";
|
|
18
|
+
import { serverTurnedOff } from "../drivers/agents-tool-groups.js";
|
|
18
19
|
export const EMAIL_INTERNAL_MCP_PATH = "/api/internal/email/mcp";
|
|
19
20
|
/** Whether this bot gets the Email tools at all: off with connected apps off, or with a scope or grant record that leaves it out. */
|
|
20
21
|
export function emailAllowedFor(bot) {
|
|
@@ -64,7 +65,8 @@ export function createEmailHost(deps) {
|
|
|
64
65
|
});
|
|
65
66
|
const run = { listMailboxes, listMessages, readMessage, searchMessages, sendMessage, ...deps.run };
|
|
66
67
|
const allowedHere = () => deps.appAllowed?.() ?? true;
|
|
67
|
-
const
|
|
68
|
+
const shown = (bot) => emailAllowedFor(bot) && !serverTurnedOff(bot.toolsOff, "email");
|
|
69
|
+
const mounts = (bot) => allowedHere() && service.mounted() && shown(bot);
|
|
68
70
|
function account(address) {
|
|
69
71
|
const accounts = service.store.list();
|
|
70
72
|
if (!accounts.length)
|
|
@@ -98,13 +100,15 @@ export function createEmailHost(deps) {
|
|
|
98
100
|
}
|
|
99
101
|
return {
|
|
100
102
|
mounts,
|
|
103
|
+
/** A mailbox is connected here, so a bot can be given the Email tools. */
|
|
104
|
+
available: () => allowedHere() && service.mounted(),
|
|
101
105
|
integration(bot, mint, harnessUrl) {
|
|
102
106
|
if (!mounts(bot))
|
|
103
107
|
return null;
|
|
104
108
|
return { command: process.execPath, args: [SPAWNED_PROXIES.harnessMcp, EMAIL_MCP_SERVER], env: { ...AGENTS_NODE_FLAG, [harnessMcpTokenEnv("email")]: mint(), OMB_HARNESS_URL: harnessUrl } };
|
|
105
109
|
},
|
|
106
110
|
prompt(bot) {
|
|
107
|
-
if (!allowedHere() || service.status().state === "unavailable" || !
|
|
111
|
+
if (!allowedHere() || service.status().state === "unavailable" || !shown(bot))
|
|
108
112
|
return "";
|
|
109
113
|
if (!service.mounted())
|
|
110
114
|
return EMAIL_TO_CONNECT_PROMPT;
|
|
@@ -28,6 +28,7 @@ export function acpHandshake(command, args, env, timeoutMs = HANDSHAKE_TIMEOUT_M
|
|
|
28
28
|
const timer = setTimeout(() => finish("it did not answer the ACP handshake in time"), timeoutMs);
|
|
29
29
|
timer.unref?.();
|
|
30
30
|
child.once("error", (error) => finish(error.message));
|
|
31
|
+
child.stdin.on("error", (error) => finish(error.message));
|
|
31
32
|
child.once("exit", (code) => {
|
|
32
33
|
const said = stripVTControlCharacters(stderr).split(/\r?\n/u).map((line) => line.trim()).find(Boolean);
|
|
33
34
|
finish(said ? said.slice(0, 400) : `it stopped with exit code ${code} before the ACP handshake`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IMAGE_MAX_BYTES } from "./attachments.js";
|
|
2
2
|
const MAX_BASE64_CHARS = Math.ceil(IMAGE_MAX_BYTES / 3) * 4 + 8;
|
|
3
|
-
function sniffRaster(bytes) {
|
|
3
|
+
export function sniffRaster(bytes) {
|
|
4
4
|
if (bytes.length >= 8 && bytes.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]))) {
|
|
5
5
|
return "image/png";
|
|
6
6
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Bots the person paused: one bot, or every bot in a department, takes no new work until it is resumed.
|
|
2
|
+
// <data>/paused-bots.json keeps which bots and departments are paused; a bot is paused when it is named, or its
|
|
3
|
+
// department is. Every way work starts asks here, beside the Starter plan's own pause (starter-caps.ts): a person's
|
|
4
|
+
// message, the bot API, a routine or webhook run, a hand-off from another bot, and its turn in a room.
|
|
5
|
+
import { readFileSync } from "node:fs";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
import { writeFileAtomic } from "../atomic.js";
|
|
8
|
+
import { sectionKey } from "../store.js";
|
|
9
|
+
export function createBotHolds(deps) {
|
|
10
|
+
const file = join(deps.dataDir, "paused-bots.json");
|
|
11
|
+
let state = load();
|
|
12
|
+
function load() {
|
|
13
|
+
try {
|
|
14
|
+
const raw = JSON.parse(readFileSync(file, "utf8"));
|
|
15
|
+
const list = (value) => (Array.isArray(value) ? [...new Set(value.filter((item) => typeof item === "string" && item.length > 0 && item.length <= 200))] : []);
|
|
16
|
+
return { bots: list(raw.bots), departments: list(raw.departments) };
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return { bots: [], departments: [] };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const save = () => {
|
|
23
|
+
writeFileAtomic(file, `${JSON.stringify({ v: 1, ...state }, null, 2)}\n`, { mode: 0o600 });
|
|
24
|
+
deps.changed();
|
|
25
|
+
};
|
|
26
|
+
const bot = (botId) => deps.bots().find((candidate) => candidate.id === botId);
|
|
27
|
+
/** The department that pauses this bot, if one does. */
|
|
28
|
+
const department = (found) => {
|
|
29
|
+
const key = sectionKey(found?.section);
|
|
30
|
+
return key && state.departments.includes(key) ? key : null;
|
|
31
|
+
};
|
|
32
|
+
const held = (botId) => state.bots.includes(botId) || department(bot(botId)) !== null;
|
|
33
|
+
return {
|
|
34
|
+
held,
|
|
35
|
+
heldBots: () => deps.bots().filter((candidate) => state.bots.includes(candidate.id) || department(candidate) !== null).map((candidate) => candidate.id),
|
|
36
|
+
state: () => ({ bots: [...state.bots], departments: [...state.departments] }),
|
|
37
|
+
text(botId, language) {
|
|
38
|
+
const found = bot(botId);
|
|
39
|
+
if (!found || !held(botId))
|
|
40
|
+
return null;
|
|
41
|
+
const by = state.bots.includes(botId) ? null : department(found);
|
|
42
|
+
return by ? deps.line(language, "server.botHeldDepartment", { bot: found.name, department: by }) : deps.line(language, "server.botHeld", { bot: found.name });
|
|
43
|
+
},
|
|
44
|
+
handoff(botId) {
|
|
45
|
+
const found = bot(botId);
|
|
46
|
+
if (!found || !held(botId))
|
|
47
|
+
return null;
|
|
48
|
+
return `@${found.name} is paused by the person${state.bots.includes(botId) ? "" : ` (its ${department(found)} department is paused)`}, so nothing was handed to it. `
|
|
49
|
+
+ "Tell the person in one line that they can resume it from its menu in the sidebar. Do not retry, and do not hand this to another bot to work around the pause.";
|
|
50
|
+
},
|
|
51
|
+
set(kind, id, paused) {
|
|
52
|
+
const before = new Set(this.heldBots());
|
|
53
|
+
const key = kind === "department" ? sectionKey(id) : id;
|
|
54
|
+
const list = kind === "bot" ? state.bots : state.departments;
|
|
55
|
+
const next = paused ? [...new Set([...list, key])] : list.filter((item) => item !== key);
|
|
56
|
+
state = kind === "bot" ? { ...state, bots: next } : { ...state, departments: next };
|
|
57
|
+
save();
|
|
58
|
+
return { state: this.state(), newlyHeld: this.heldBots().filter((botId) => !before.has(botId)) };
|
|
59
|
+
},
|
|
60
|
+
forget(kind, id) {
|
|
61
|
+
const list = kind === "bot" ? state.bots : state.departments;
|
|
62
|
+
const key = kind === "department" ? sectionKey(id) : id;
|
|
63
|
+
if (!list.includes(key))
|
|
64
|
+
return;
|
|
65
|
+
state = kind === "bot" ? { ...state, bots: list.filter((item) => item !== key) } : { ...state, departments: list.filter((item) => item !== key) };
|
|
66
|
+
save();
|
|
67
|
+
},
|
|
68
|
+
rename(from, to) {
|
|
69
|
+
const key = sectionKey(from);
|
|
70
|
+
if (!state.departments.includes(key))
|
|
71
|
+
return;
|
|
72
|
+
state = { ...state, departments: [...new Set(state.departments.map((item) => (item === key ? sectionKey(to) : item)))] };
|
|
73
|
+
save();
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -2,13 +2,13 @@ import { BROWSER_CONTROL_REFUSAL } from "../browser-runtime.js";
|
|
|
2
2
|
import { CODE_FROM_INBOX, fillLogin } from "../login-fill.js";
|
|
3
3
|
import { redactSecretsInText } from "../redact.js";
|
|
4
4
|
import { surfaceLabel } from "../surface.js";
|
|
5
|
-
const ONLY_IN_BROWSER = "
|
|
5
|
+
const ONLY_IN_BROWSER = "Saved logins are filled only in your own browser, the one your browser tools drive, where Limix Bot checks the page's site before it types a password";
|
|
6
6
|
export function createFillLoginTurn(deps) {
|
|
7
7
|
// Security: on a screen the server cannot prove which site a focused box belongs to, so a secret is never typed there.
|
|
8
8
|
function elsewhere(bot, turn, place, signsInByEmail) {
|
|
9
9
|
const current = deps.current(bot, turn.threadId);
|
|
10
10
|
const where = place ? surfaceLabel(place) : null;
|
|
11
|
-
const notHere = where ?
|
|
11
|
+
const notHere = where ? `. On the screen of ${where} it cannot prove which site a box belongs to, so it never types one there` : "";
|
|
12
12
|
const signIn = where ? `Call request_sign_in so the person signs in on ${where}.` : "Call request_sign_in instead.";
|
|
13
13
|
if (!deps.browserSelectable(current)) {
|
|
14
14
|
const why = current.browser === false || current.computer === "off" || !deps.builtInBrowserOn()
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const LIMIT_CARRIED_NOTE = "Your previous turn stopped because its AI reached its usage limit or was signed out, and another AI carries this request on now; continue from where it stopped.";
|
|
2
|
+
function progressUnknownUnlessMade(evidence) {
|
|
3
|
+
const { okToolCalls, ...rest } = evidence ?? {};
|
|
4
|
+
return okToolCalls ? { ...rest, okToolCalls } : rest;
|
|
5
|
+
}
|
|
6
|
+
export function createHandoffLimits(deps) {
|
|
7
|
+
const hold = (selection, refusal) => {
|
|
8
|
+
if (refusal.scope === "signed-out")
|
|
9
|
+
deps.takeover.noteSignedOut(selection.instanceId);
|
|
10
|
+
else if (refusal.scope === "engine")
|
|
11
|
+
deps.limitClock.noteLimit(selection.instanceId, refusal.resetsAt);
|
|
12
|
+
else
|
|
13
|
+
deps.takeover.holdModel(selection, refusal.scope, refusal.resetsAt);
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
servedBy(node) {
|
|
17
|
+
const ran = deps.store.projectBotForTask(node.botId, node.threadId)?.modelSelection, own = deps.store.bot(node.botId)?.modelSelection;
|
|
18
|
+
return ran && own && (ran.instanceId !== own.instanceId || ran.model !== own.model) ? { servedBy: `${deps.engineName(ran.instanceId)} ${ran.model}` } : {};
|
|
19
|
+
},
|
|
20
|
+
carriedOn(node, result) {
|
|
21
|
+
const refusal = result.refusedBy, thread = deps.store.projectBotForTask(node.botId, node.threadId);
|
|
22
|
+
if (result.ok || !refusal || !node.parentId || node.groupId || !thread || !deps.enabled())
|
|
23
|
+
return undefined;
|
|
24
|
+
hold(thread.modelSelection, refusal);
|
|
25
|
+
if (deps.takeover.heldAtStart(thread, thread.modelSelection) === null)
|
|
26
|
+
return undefined;
|
|
27
|
+
return { ...result, evidence: progressUnknownUnlessMade(result.evidence), cap: { note: LIMIT_CARRIED_NOTE } };
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -27,6 +27,17 @@ const EVERY_BOT = "every-bot";
|
|
|
27
27
|
export function signedOutStop(stopReason, said) {
|
|
28
28
|
return stopReason === "auth_required" && !(said && (engineFailureKind(said) === "credits" || classifyError({ text: said }).reason === "quota"));
|
|
29
29
|
}
|
|
30
|
+
export function takeoverRefusal(stopReason, said, limit) {
|
|
31
|
+
if (signedOutStop(stopReason, said))
|
|
32
|
+
return "signed-out";
|
|
33
|
+
// A tool call's failure names the tool, never the engine's own limit, whatever its words.
|
|
34
|
+
return limit ?? (stopReason !== "tool_error" && classifyError({ text: said ?? "" }).reason === "quota" ? "engine" : undefined);
|
|
35
|
+
}
|
|
36
|
+
export function turnRefusal(stopReason, said, flags) {
|
|
37
|
+
const scope = takeoverRefusal(stopReason, said, flags?.limit);
|
|
38
|
+
const resetsAt = scope === "signed-out" ? undefined : flags?.limitResetsAt;
|
|
39
|
+
return scope ? { scope, ...(resetsAt ? { resetsAt } : {}) } : undefined;
|
|
40
|
+
}
|
|
30
41
|
export function createLimitTakeover(deps) {
|
|
31
42
|
const now = deps.now ?? Date.now;
|
|
32
43
|
const notices = new LimitNotices(deps.file, now);
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { approvalModeFor } from "../../shared/approval-mode.js";
|
|
2
|
+
import { recoveryCapabilityError } from "../automatic-recovery.js";
|
|
3
|
+
import { limitBackupAllowed } from "../limit-failover.js";
|
|
4
|
+
import { turnLimitScope } from "../quota-switch.js";
|
|
5
|
+
/**
|
|
6
|
+
* True when the failed turn left nothing behind: no tool call, no reply, no file. Its own failure row, the
|
|
7
|
+
* engine's limit sentence (`stopError`, sometimes sent as reply text) and the hand-off's request card, written
|
|
8
|
+
* just before the turn (sometimes in the same millisecond), do not count.
|
|
9
|
+
*/
|
|
10
|
+
export function nothingRan(rows, since, turnId, stopError) {
|
|
11
|
+
const said = stopError?.trim();
|
|
12
|
+
// The turn's digest is written after it ends and only sums it up.
|
|
13
|
+
return !rows.some((row) => row.at >= since && row.role === "bot" && row.kind !== "digest" && row.roomRequest?.phase !== "request" && (!turnId || !row.turnId || row.turnId === turnId) && (row.kind === "activity" ? Boolean(row.tool?.itemId)
|
|
14
|
+
: row.kind === "text" ? Boolean(row.text?.trim()) && row.text.trim() !== said
|
|
15
|
+
: true));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Resends a bot-to-bot turn once to the bot's backup AI when its own AI hit a usage limit before anything ran. The
|
|
19
|
+
* resend keeps the turn's options as they were (sender, provenance, the hand-off it answers), so it never gains authority.
|
|
20
|
+
*/
|
|
21
|
+
export function createPeerLimitResend(deps) {
|
|
22
|
+
const { store, registry } = deps;
|
|
23
|
+
/** The thread's running bot-to-bot turn. */
|
|
24
|
+
const running = new Map();
|
|
25
|
+
/** Turns that met a limit before anything ran, until their resend is taken. */
|
|
26
|
+
const claimed = new Map();
|
|
27
|
+
/** A tracked turn's end that came before its dispatch named the turn, until the dispatch binds it. */
|
|
28
|
+
const unbound = new Map();
|
|
29
|
+
/** Generations whose thread settled before their turn's end was bound: the bind resends at once. */
|
|
30
|
+
const settledEarly = new Set();
|
|
31
|
+
/** At a turn's start: follows a relayed ask or a teammate's assignment, never the person's own, a routine's or a guest's. */
|
|
32
|
+
function track(turn) {
|
|
33
|
+
const { opts } = turn;
|
|
34
|
+
if (opts.peerLimitResent || opts.computerSelectionContinuation || opts.goalRunId || opts.automationSource || opts.compactOnly
|
|
35
|
+
|| opts.coordination?.resumed || deps.guest(turn.threadId))
|
|
36
|
+
return;
|
|
37
|
+
if (opts.coordination ? !deps.handedOff(opts.coordination.id) : opts.cardContinuation || !(opts.peerAsk ?? turn.userMessage.peerAsk))
|
|
38
|
+
return;
|
|
39
|
+
running.set(turn.threadId, { ...turn, since: Date.now() });
|
|
40
|
+
unbound.delete(turn.threadId);
|
|
41
|
+
}
|
|
42
|
+
/** At the turn's end, before its hand-off hears the outcome: keeps it for a resend only for a usage limit met before anything ran. */
|
|
43
|
+
function ended(event, generation, capped) {
|
|
44
|
+
const turn = running.get(event.threadId);
|
|
45
|
+
if (turn?.generation !== generation)
|
|
46
|
+
return;
|
|
47
|
+
running.delete(event.threadId);
|
|
48
|
+
unbound.delete(event.threadId);
|
|
49
|
+
const settled = settledEarly.delete(generation);
|
|
50
|
+
// Held only where the bot's own turn end resends it or reports the failure (never a room's thread).
|
|
51
|
+
const stop = event.ok || capped || !store.botByThread(event.threadId) || !deps.quotaSwitchEnabled() ? undefined : deps.turnStops.read(event.threadId, event.turnId);
|
|
52
|
+
const scope = stop && turnLimitScope(event, stop.flags, deps.turnStops.failureCause(event));
|
|
53
|
+
if (!scope || scope === "signed-out" || !nothingRan(store.activePath(event.threadId), turn.since, event.turnId, stop?.error))
|
|
54
|
+
return;
|
|
55
|
+
claimed.set(event.threadId, { ...turn, scope, turnId: event.turnId, stopError: stop?.error });
|
|
56
|
+
// The thread settled before the dispatch named this turn: resend now, once its hand-off has held the outcome.
|
|
57
|
+
if (settled)
|
|
58
|
+
setImmediate(() => resend(event.threadId));
|
|
59
|
+
}
|
|
60
|
+
/** A tracked thread's turn ended before its dispatch named the turn: kept until bound() gives its generation. */
|
|
61
|
+
function endedUnbound(event, capped) {
|
|
62
|
+
if (event.turnId && running.has(event.threadId))
|
|
63
|
+
unbound.set(event.threadId, { event, capped });
|
|
64
|
+
}
|
|
65
|
+
/** The dispatch named the turn after it had already ended: judges that end as ended() would have. */
|
|
66
|
+
function bound(threadId, turnId, generation) {
|
|
67
|
+
const early = unbound.get(threadId);
|
|
68
|
+
if (early?.event.turnId !== turnId)
|
|
69
|
+
return;
|
|
70
|
+
ended(early.event, generation, early.capped);
|
|
71
|
+
}
|
|
72
|
+
/** Keeps the failed attempt's outcome for its hand-off while the resend is pending; false when none is. */
|
|
73
|
+
function hold(generation, outcome) {
|
|
74
|
+
const turn = [...claimed.values()].find((candidate) => candidate.generation === generation);
|
|
75
|
+
if (!turn)
|
|
76
|
+
return false;
|
|
77
|
+
turn.held ??= outcome;
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
/** The claimed turn, once: whoever takes it resends it or settles its held outcome. */
|
|
81
|
+
function take(threadId) {
|
|
82
|
+
const turn = claimed.get(threadId);
|
|
83
|
+
claimed.delete(threadId);
|
|
84
|
+
return turn;
|
|
85
|
+
}
|
|
86
|
+
/** Once the turn has settled: resends a claimed turn on the backup AI; true when it will. Otherwise its hand-off hears the failure as before. */
|
|
87
|
+
function resend(threadId, generation) {
|
|
88
|
+
const turn = take(threadId);
|
|
89
|
+
if (!turn) {
|
|
90
|
+
// Settled before its end was bound to this generation: the bind resends instead.
|
|
91
|
+
if (generation && running.get(threadId)?.generation === generation && unbound.has(threadId))
|
|
92
|
+
settledEarly.add(generation);
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
const giveUp = (detail) => {
|
|
96
|
+
if (detail && store.taskByThread(turn.botId, threadId))
|
|
97
|
+
store.appendMessage(threadId, { role: "bot", kind: "activity", tool: { name: deps.failedLine(threadId, detail), ok: false } });
|
|
98
|
+
if (turn.held)
|
|
99
|
+
deps.settle(turn.generation, turn.held);
|
|
100
|
+
return false;
|
|
101
|
+
};
|
|
102
|
+
if (deps.generation(threadId) !== turn.generation)
|
|
103
|
+
return giveUp();
|
|
104
|
+
setImmediate(() => {
|
|
105
|
+
// Stop, deletion, a new send, or any replacement generation wins.
|
|
106
|
+
const current = store.projectBotForTask(turn.botId, threadId);
|
|
107
|
+
if (!current || deps.generation(threadId) !== turn.generation || deps.blocked(turn.botId, threadId)
|
|
108
|
+
|| (turn.latestUser && store.activePath(threadId).findLast(m => m.role === "user" && m.kind === "text")?.id !== turn.latestUser)
|
|
109
|
+
// A file the turn made lands after its end was judged: anything it left by now still means no resend.
|
|
110
|
+
|| !nothingRan(store.activePath(threadId), turn.since, turn.turnId, turn.stopError))
|
|
111
|
+
return giveUp();
|
|
112
|
+
const from = current.modelSelection, instance = registry.get(from.instanceId);
|
|
113
|
+
const backup = deps.takeover().backups(turn.botId, from, turn.scope, approvalModeFor(current)).find(candidate => {
|
|
114
|
+
const target = registry.get(candidate.instanceId);
|
|
115
|
+
return target?.enabled && (candidate.instanceId !== from.instanceId || candidate.model !== from.model)
|
|
116
|
+
&& (candidate.instanceId === from.instanceId ? turn.scope !== "engine" : !instance || limitBackupAllowed(instance, target, deps.providerConfigs()[candidate.instanceId]));
|
|
117
|
+
});
|
|
118
|
+
if (!backup)
|
|
119
|
+
return giveUp();
|
|
120
|
+
const checked = deps.checkedTaskModelSwitch(current, backup, false, false, true);
|
|
121
|
+
const target = checked.ok ? registry.get(checked.selection.instanceId) : null;
|
|
122
|
+
const refusal = !checked.ok ? checked.error : !target || !target.enabled ? "The backup AI is unavailable."
|
|
123
|
+
: !store.taskByThread(turn.botId, threadId)?.cwd ? "This older thread has no pinned working folder. Choose its backup manually."
|
|
124
|
+
: deps.policyModelRefusal(target) ?? (instance ? recoveryCapabilityError({ driverKind: instance.driverKind, capabilities: instance.adapter.capabilities }, { driverKind: target.driverKind, capabilities: target.adapter.capabilities }) : undefined);
|
|
125
|
+
if (refusal || !checked.ok)
|
|
126
|
+
return giveUp(refusal);
|
|
127
|
+
try {
|
|
128
|
+
deps.assertWithinBudget();
|
|
129
|
+
store.switchTaskModel(turn.botId, threadId, checked.selection, false, false, { ...deps.hostedModels?.resetTask(from, checked.selection), rewound: true });
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
return giveUp(error instanceof Error ? error.message : String(error));
|
|
133
|
+
}
|
|
134
|
+
for (const tool of deps.takeover().carriedOn(current, threadId, from, checked.selection, { scope: turn.scope }))
|
|
135
|
+
store.appendMessage(threadId, { role: "bot", kind: "activity", tool });
|
|
136
|
+
deps.release(turn.generation);
|
|
137
|
+
void deps.startTurn(turn.botId, turn.text, { ...turn.opts, threadId, userMessage: turn.userMessage, editedMessageId: undefined, peerLimitResent: true }).catch(error => {
|
|
138
|
+
const detail = error instanceof Error ? error.message : String(error), why = `Could not resend this to the backup AI: ${detail}`;
|
|
139
|
+
(turn.opts.coordination?.settle ?? turn.opts.onSettled)?.({ ok: false, text: turn.held ? `${turn.held.text} ${why}` : why });
|
|
140
|
+
if (store.taskByThread(turn.botId, threadId))
|
|
141
|
+
store.appendMessage(threadId, { role: "bot", kind: "activity", tool: { name: deps.failedLine(threadId, detail), ok: false } });
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
return { track, ended, endedUnbound, bound, hold, resend };
|
|
147
|
+
}
|
|
@@ -14,7 +14,7 @@ import { readSectionContext } from "../section-context.js";
|
|
|
14
14
|
import { librarySkillOptOuts, listLibrarySkills, readLibrarySkillFile, readSkillLibraryIndex, skillsLibraryEnabled } from "../skill-library.js";
|
|
15
15
|
import { conversationAssignedSkills, prepareShareNote, shareLearnedSkill, shareLearnedSkillsMode, SHARED_REVISION_CHARS, sharedSkillEditable, undoSharedLearnedSkill, updateSharedLearnedSkill, } from "../skill-share.js";
|
|
16
16
|
import { enabledSkillFiles, listSkills, readSkillFile, resolveBotSkills, skillsSystemPrompt } from "../skills.js";
|
|
17
|
-
import { claudeUserSkillsEnabled } from "../turn-settings.js";
|
|
17
|
+
import { claudeUserSkillsEnabled, settingsTurnFields } from "../turn-settings.js";
|
|
18
18
|
import { typedWords } from "../typed-sends.js";
|
|
19
19
|
import { TASK_WORKSPACES_DIR } from "../workspace.js";
|
|
20
20
|
const NO_TURN_NOTE = { text: "", after: (dispatch) => dispatch };
|
|
@@ -70,6 +70,13 @@ export function createSkillsLibraryHost(deps) {
|
|
|
70
70
|
// An empty list, not undefined, while the library is on: every-bot skills still reach a bot with no assignments.
|
|
71
71
|
const liveAssigned = (bot) => store.bot(bot.id)?.assignedSkills ?? bot.assignedSkills ?? [];
|
|
72
72
|
const conversationSkills = (bot, threadId) => skillsLibraryEnabled(cfg) ? conversationAssignedSkills(bot.id, liveAssigned(bot), conversationStartedAt(threadId)) : undefined;
|
|
73
|
+
const turnSkillFiles = (bot, threadId, instance) => {
|
|
74
|
+
const assigned = skillsLibraryEnabled(cfg) ? liveAssigned(bot) : undefined;
|
|
75
|
+
const names = resolveBotSkills(bot.id, assigned).filter((skill) => skill.enabled).map((skill) => skill.name);
|
|
76
|
+
return [...new Set([...enabledSkillFiles(bot.id, names, assigned).values(),
|
|
77
|
+
...importsFor(bot, conversationSkills(bot, threadId), instance).map((skill) => skill.file),
|
|
78
|
+
...importsFor(bot, assigned, instance).map((skill) => skill.file)])];
|
|
79
|
+
};
|
|
73
80
|
const engineOf = (instance) => {
|
|
74
81
|
if (!instance)
|
|
75
82
|
return undefined;
|
|
@@ -189,6 +196,13 @@ export function createSkillsLibraryHost(deps) {
|
|
|
189
196
|
turnImports(bot, threadId, instance) {
|
|
190
197
|
return listedImports(bot, importsFor(bot, conversationSkills(bot, threadId), instance));
|
|
191
198
|
},
|
|
199
|
+
turnSkillFiles,
|
|
200
|
+
turnSettings(bot, threadId, instance, restrictsMcp) {
|
|
201
|
+
return {
|
|
202
|
+
...settingsTurnFields(cfg, DATA_DIR, restrictsMcp),
|
|
203
|
+
...(instance.driverKind === "antigravityAgent" ? { skillFiles: turnSkillFiles(bot, threadId, instance) } : {}),
|
|
204
|
+
};
|
|
205
|
+
},
|
|
192
206
|
/** Each `/name` called for one of the bot's own, library or imported skills, or one its engine loads by itself. `lines`
|
|
193
207
|
* are the turn's own lines when it is a person's turn: only words they typed can call a skill past the start of the text. */
|
|
194
208
|
expandSkillCommand(bot, threadId, text, instance, lines = [], ownStart = false) {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { appendDecision } from "../decision-log.js";
|
|
2
|
+
import { json } from "../harness/http.js";
|
|
3
|
+
/** The person's answer to a team-memory, outside-write or "Send on your behalf?" card. */
|
|
4
|
+
export function createTrustAnswers(deps) {
|
|
5
|
+
const { store, teamMemoryRequests, outsideWrites, outboundRequests } = deps;
|
|
6
|
+
const DATA_DIR = deps.dataDir;
|
|
7
|
+
function resolveAndSendTrust(res, threadId, requestId, behavior) {
|
|
8
|
+
const remembered = teamMemoryRequests.resolve(threadId, requestId, behavior) ?? outsideWrites.resolve(threadId, requestId, behavior);
|
|
9
|
+
if (remembered) {
|
|
10
|
+
json(res, 200, remembered);
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
const outboundCard = store.messagesFor(threadId).find((message) => message.card?.requestId === requestId && message.card.outboundRequest);
|
|
14
|
+
if (outboundCard?.card?.outboundRequest) {
|
|
15
|
+
const outboundBot = outboundCard.from?.botId ? store.bot(outboundCard.from.botId) : store.botByThread(threadId);
|
|
16
|
+
const result = outboundRequests.resolve({ threadId, requestId, behavior });
|
|
17
|
+
if (!result.claimed) {
|
|
18
|
+
if (!outboundCard.card.answered) {
|
|
19
|
+
store.patchMessage(threadId, outboundCard.id, { card: { ...outboundCard.card, answered: "unavailable", dismissed: true } });
|
|
20
|
+
}
|
|
21
|
+
json(res, 200, { ok: true, outcome: "unavailable" });
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
if (result.state === "already_settled") {
|
|
25
|
+
json(res, 200, { ok: true, outcome: result.behavior === "allow" ? "allowed-once" : "rejected", alreadySettled: true });
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
store.patchMessage(threadId, outboundCard.id, {
|
|
29
|
+
card: { ...outboundCard.card, answered: result.state === "allowed" ? "allow" : "deny" },
|
|
30
|
+
});
|
|
31
|
+
appendDecision(DATA_DIR, {
|
|
32
|
+
threadId, requestId, botId: outboundBot?.id, botName: outboundBot?.name,
|
|
33
|
+
tool: outboundCard.card.tool, summary: outboundCard.card.subtitle,
|
|
34
|
+
decision: result.state === "allowed" ? "user-approved" : "user-denied", source: "user",
|
|
35
|
+
});
|
|
36
|
+
json(res, 200, { ok: true, outcome: result.state === "allowed" ? "allowed-once" : "rejected" });
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
return { resolveAndSendTrust };
|
|
42
|
+
}
|