limixbot 0.3.51 → 0.3.53
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-DIQkh4hc.js} +1 -1
- package/dist/assets/App-CxKkZhGV.js +243 -0
- package/dist/assets/{AppEventEditor-Derw3FHd.js → AppEventEditor-FVbe8Mvz.js} +1 -1
- package/dist/assets/BotSettingsDialog-BKWvg7df.js +16 -0
- package/dist/assets/{BrowserPanel-BUwH6i3q.js → BrowserPanel-CkiqrVEm.js} +2 -2
- package/dist/assets/{BrowserProfilesManager-LPWaNOTL.js → BrowserProfilesManager-C2OqwZn1.js} +1 -1
- package/dist/assets/CloudAddDialog-BH5eLBvi.js +1 -0
- package/dist/assets/ComputerFilesPane-iOrAAtHV.js +1 -0
- package/dist/assets/{ComputerPanel-BKSAp5BV.js → ComputerPanel-le89nav2.js} +2 -2
- package/dist/assets/{DataPanel-C8JFQXPW.js → DataPanel-CcOlPY1d.js} +1 -1
- package/dist/assets/{DesktopViewer-DFhYwHIq.js → DesktopViewer-Du64Zar0.js} +1 -1
- package/dist/assets/{FilesView-uvhFDVLX.js → FilesView-hGRu-0jv.js} +1 -1
- package/dist/assets/{GrokMoveDialog-DqtBggcO.js → GrokMoveDialog-Dy6gcobX.js} +1 -1
- package/dist/assets/{InspectorPanel-B9946G8k.js → InspectorPanel-BzC5WSUu.js} +2 -2
- package/dist/assets/{KeyboardShortcutsModal-3p8-Y0gj.js → KeyboardShortcutsModal-BtAZADk0.js} +1 -1
- package/dist/assets/{LimixChannelReview-BDF1Ho_G.js → LimixChannelReview-BFN0ep6x.js} +1 -1
- package/dist/assets/{LiveDesktop-csn9EgQr.js → LiveDesktop-IxdGhD-Q.js} +1 -1
- package/dist/assets/{LocalVmWorkspace-CY-cK25P.js → LocalVmWorkspace-Gt1f31fp.js} +1 -1
- package/dist/assets/{MacLocalControl-tjDKmfaz.js → MacLocalControl-oEzEDSQg.js} +1 -1
- package/dist/assets/{MarkdownFilePreview-C9270gON.js → MarkdownFilePreview-DJwfsd44.js} +1 -1
- package/dist/assets/{MenuMotion-CtV49YrJ.js → MenuMotion-DFWzLAOE.js} +1 -1
- package/dist/assets/{NewBotDialog-QR0H-5OX.js → NewBotDialog-D35bddr4.js} +1 -1
- package/dist/assets/{PhoneAppDialog-4jvBw2u6.js → PhoneAppDialog-KUYTOj7D.js} +1 -1
- package/dist/assets/PlacesRail-i-4ph-KR.js +1 -0
- package/dist/assets/{PluginsPanel-DHUbnE7N.js → PluginsPanel-CuagbyMf.js} +2 -2
- package/dist/assets/ProIntroduction-__lUgknC.js +1 -0
- package/dist/assets/{RemoteAgentSettingsPanel-Dllevm4e.js → RemoteAgentSettingsPanel-cEvDuPCS.js} +1 -1
- package/dist/assets/{RoomPanel-Bd_Xtwqu.js → RoomPanel-BD90s9Gm.js} +1 -1
- package/dist/assets/{RoutinesPage-QcfeQgTy.js → RoutinesPage-D9Iluc9-.js} +2 -2
- package/dist/assets/SettingsModal-9sV2Uiaz.js +19 -0
- package/dist/assets/{ShareTeamDialog-DMqi3pEn.js → ShareTeamDialog-DtorqFJu.js} +1 -1
- package/dist/assets/{SignedInSites-DayALoO-.js → SignedInSites-C25nZIiv.js} +1 -1
- package/dist/assets/{TeamLibraryPanel-DMAGl5Yz.js → TeamLibraryPanel-DOdfbGyQ.js} +1 -1
- package/dist/assets/{TeamMapPage-MEkKU-EN.js → TeamMapPage-DMQdbBL9.js} +1 -1
- package/dist/assets/{TriggersPage-D3KTWX3z.js → TriggersPage-Yhbyd0Ek.js} +1 -1
- package/dist/assets/VisibilitySection-C2HwkrIB.js +22 -0
- package/dist/assets/{WebhookTrigger-DJlTvzBb.js → WebhookTrigger-BV_b2cuN.js} +1 -1
- package/dist/assets/{WorksOnGrid-CW82h_3C.js → WorksOnGrid-ag2h-J0c.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-wXrRNESU.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-CtM6o0iP.js} +1 -1
- package/dist/assets/{index-B7zM90O2.js → index-Bsx9nj0X.js} +1 -1
- package/dist/assets/index-CNJBUMXg.js +3 -0
- 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-2qPA-IkI.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-B_VdIM0S.js} +2 -2
- package/dist/assets/org-library-Dh8-yJT-.js +1 -0
- package/dist/assets/{package-format-C4A5Q4UD.js → package-format-DjWXsBZ0.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-BmTQ50TK.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
|
@@ -65,6 +65,7 @@ const TEAM_ACTION_KEYS = {
|
|
|
65
65
|
list_waits: "activity.tool.team.listWaits",
|
|
66
66
|
wait_until: "activity.tool.team.waitUntil",
|
|
67
67
|
add_mcp_server: "activity.tool.team.addMcpServer",
|
|
68
|
+
app_settings: "activity.tool.team.appSettings",
|
|
68
69
|
ask_bot: "activity.tool.team.askBot",
|
|
69
70
|
assignment_status: "activity.tool.team.assignmentStatus",
|
|
70
71
|
attach_file: "activity.tool.team.attachFile",
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// when it calls it.
|
|
5
5
|
import { AGENTS_PROXY_ENV } from "./agents-bridge-switch.js";
|
|
6
6
|
import { roleToolEnv } from "./chief-level.js";
|
|
7
|
+
import { TOOLS_OFF_ENV } from "../shared/tool-groups.js";
|
|
7
8
|
const flag = (on) => (on ? "1" : "0");
|
|
8
9
|
export function agentsServerEnv(conversation, turn, bearer, harnessUrl) {
|
|
9
10
|
const { bot, host } = conversation;
|
|
@@ -13,7 +14,6 @@ export function agentsServerEnv(conversation, turn, bearer, harnessUrl) {
|
|
|
13
14
|
OMB_BOT_ID: bot.id,
|
|
14
15
|
OMB_THREAD_ID: conversation.threadId,
|
|
15
16
|
OMB_COMMS_TOKEN: bearer(turn),
|
|
16
|
-
OMB_TURN_DEPTH: String(turn.depth),
|
|
17
17
|
OMB_SKILL_AUTHORING_ENABLED: flag(host.skillAuthoring),
|
|
18
18
|
OMB_MEMORY_ENABLED: flag(bot.memoryEnabled !== false),
|
|
19
19
|
OMB_SHARED_COMPUTERS_ENABLED: flag(host.sharedComputers),
|
|
@@ -25,6 +25,7 @@ export function agentsServerEnv(conversation, turn, bearer, harnessUrl) {
|
|
|
25
25
|
OMB_IMAGE_GENERATION: "1",
|
|
26
26
|
OMB_MEETINGS: flag(host.meetings === true && !conversation.room),
|
|
27
27
|
OMB_COMPUTER_SELECTION: flag(!conversation.room && bot.computer !== "off" && !conversation.teamComputer && !conversation.botDriven),
|
|
28
|
+
[TOOLS_OFF_ENV]: (bot.toolsOff ?? []).join(","),
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
31
|
/** A conversation a bot opened, the Bot API's, or a routine's run: a fact of the conversation, so its tool list stays the same turn to turn. */
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
// The app_settings tool for one turn: find, get and set over the registry, where the entry's tier is the whole policy.
|
|
2
|
+
// Writes happen only in the owner's own turn and apply at once with Undo, a secret never passes through the bot, and an
|
|
3
|
+
// owner-only setting is only explained.
|
|
4
|
+
import { randomUUID } from "node:crypto";
|
|
5
|
+
import { appendDecision } from "../decision-log.js";
|
|
6
|
+
import { UNDO_STALE } from "../direct-apply.js";
|
|
7
|
+
import { serverLine } from "../server-lines.js";
|
|
8
|
+
import { findSettings, personOnly } from "./registry.js";
|
|
9
|
+
export const TOOL = "app_settings";
|
|
10
|
+
export const WRITE_BUDGET = 10;
|
|
11
|
+
const THEME_ACTIONS = ["theme", "set_theme", "add_theme_asset", "theme_history", "undo_theme"];
|
|
12
|
+
const FIND_LIMIT = 8;
|
|
13
|
+
const NOT_SET = "not set";
|
|
14
|
+
const text = (value) => value || NOT_SET;
|
|
15
|
+
const said = ({ before, after }) => (before === undefined ? after : `${text(before)} → ${text(after)}`);
|
|
16
|
+
/** The tool sends every value as text so strict-schema providers accept it; numbers, true/false and JSON are read back
|
|
17
|
+
* from it when the text alone does not fit the setting. A JSON object or list is judged as itself. */
|
|
18
|
+
function parseValue(entry, value) {
|
|
19
|
+
const direct = entry.value.safeParse(value);
|
|
20
|
+
if (direct.success || typeof value !== "string")
|
|
21
|
+
return direct;
|
|
22
|
+
try {
|
|
23
|
+
const json = JSON.parse(value);
|
|
24
|
+
const read = entry.value.safeParse(json);
|
|
25
|
+
return read.success || (typeof json === "object" && json !== null) ? read : direct;
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return direct;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export function createAppSettings(deps) {
|
|
32
|
+
const { store, entries } = deps;
|
|
33
|
+
const undoable = new Map();
|
|
34
|
+
const writes = new Map();
|
|
35
|
+
const byId = new Map(entries.map((entry) => [entry.id, entry]));
|
|
36
|
+
const reply = (status, body) => ({ status, body });
|
|
37
|
+
const refuse = (status, error) => reply(status, { error });
|
|
38
|
+
const describe = (entry) => ({ id: entry.id, label: entry.label, tier: entry.tier, value: text(entry.read()), where: entry.where });
|
|
39
|
+
const from = (bot, threadId) => (deps.connectorThread(bot.id, threadId)?.group ? { from: { botId: bot.id, name: bot.name, color: bot.color } } : {});
|
|
40
|
+
const spendWrite = (turn) => {
|
|
41
|
+
const spent = writes.get(turn.generation) ?? 0;
|
|
42
|
+
if (spent >= WRITE_BUDGET)
|
|
43
|
+
return `This turn has already changed ${WRITE_BUDGET} settings. Ask the user to send a new message before changing more.`;
|
|
44
|
+
writes.set(turn.generation, spent + 1);
|
|
45
|
+
if (writes.size > 200)
|
|
46
|
+
writes.delete(writes.keys().next().value);
|
|
47
|
+
return null;
|
|
48
|
+
};
|
|
49
|
+
/** Applies the change, posts its applied card with Undo, and logs it in the decision log. */
|
|
50
|
+
async function apply(turn, bot, entry, value, change) {
|
|
51
|
+
const before = await entry.current(value);
|
|
52
|
+
const was = entry.read();
|
|
53
|
+
const refusal = await entry.write(value);
|
|
54
|
+
if (refusal)
|
|
55
|
+
return refuse(409, refusal);
|
|
56
|
+
const after = entry.read();
|
|
57
|
+
const shown = change === undefined ? { before: was, after } : { after: change };
|
|
58
|
+
const requestId = randomUUID();
|
|
59
|
+
const language = deps.language(turn.threadId);
|
|
60
|
+
const notSet = (value) => value || serverLine(language, "server.appSettings.notSet");
|
|
61
|
+
const appSettingRequest = { settingId: entry.id, label: entry.label, ...(shown.before === undefined ? {} : { before: shown.before }), after: shown.after, tier: entry.tier };
|
|
62
|
+
store.appendMessage(turn.threadId, {
|
|
63
|
+
role: "bot", kind: "options", ...from(bot, turn.threadId),
|
|
64
|
+
card: { title: serverLine(language, "server.appSettings.changed", { label: entry.label }), subtitle: shown.before === undefined ? shown.after : `${notSet(shown.before)} → ${notSet(shown.after)}`,
|
|
65
|
+
options: [], requestId, tool: TOOL, fixedOptions: true, appSettingRequest, answered: "allow", dismissed: true, autoApplied: true },
|
|
66
|
+
});
|
|
67
|
+
undoable.set(requestId, { entry, before, after });
|
|
68
|
+
appendDecision(deps.dataDir, { threadId: turn.threadId, requestId, botId: turn.botId, botName: bot.name, tool: TOOL, summary: `${entry.id}: ${said(shown)}`, decision: "auto-approved", source: "app-settings" });
|
|
69
|
+
const done = change === undefined ? `Changed ${entry.label} from ${text(was)} to ${text(after)}.` : `Done: ${change}. ${entry.label} now: ${text(after)}.`;
|
|
70
|
+
return reply(200, { text: `${done} The user can undo it from the card in the conversation.` });
|
|
71
|
+
}
|
|
72
|
+
async function set(turn, body) {
|
|
73
|
+
const entry = typeof body.id === "string" ? byId.get(body.id) : undefined;
|
|
74
|
+
if (!entry)
|
|
75
|
+
return refuse(404, `No setting with id ${JSON.stringify(body.id ?? null)}. Use action find first.`);
|
|
76
|
+
const bot = store.bot(turn.botId);
|
|
77
|
+
if (!bot)
|
|
78
|
+
return refuse(404, "This bot no longer exists.");
|
|
79
|
+
if (entry.tier === "owner-only")
|
|
80
|
+
return refuse(403, personOnly(entry.label, entry.where));
|
|
81
|
+
if (deps.guestDriven(turn.threadId) || deps.turnOwner(turn) === null)
|
|
82
|
+
return refuse(403, "Settings change only in the owner's own conversation. This turn was not started by the owner here, so nothing changed; you may still read settings.");
|
|
83
|
+
if (entry.tier === "secret") {
|
|
84
|
+
if (body.value !== undefined)
|
|
85
|
+
return refuse(400, `Never send a key or token as a value. Call set on ${entry.id} with no value: a secure card asks the user for it, and you never see it.`);
|
|
86
|
+
const budget = spendWrite(turn);
|
|
87
|
+
if (budget)
|
|
88
|
+
return refuse(429, budget);
|
|
89
|
+
const posted = await deps.requestCredential(bot, turn.threadId, { credentialId: entry.credentialId, reason: typeof body.reason === "string" ? body.reason : undefined });
|
|
90
|
+
if (!posted.body.error && posted.body.alreadyConfigured === true)
|
|
91
|
+
return reply(200, { text: `${entry.label} is already set. To replace it, the user changes it in ${entry.where}.` });
|
|
92
|
+
if (posted.status >= 300)
|
|
93
|
+
return refuse(posted.status, String(posted.body.error ?? "The secure card could not be shown."));
|
|
94
|
+
return reply(200, { text: `A secure card for ${entry.label} is ready in MausBot. End this turn now and say in one line that you are waiting for it; MausBot resumes you when the user saves it or declines. You never see the key.` });
|
|
95
|
+
}
|
|
96
|
+
const parsed = parseValue(entry, body.value);
|
|
97
|
+
if (!parsed.success)
|
|
98
|
+
return refuse(400, `${entry.label} takes ${entry.allowed}. ${parsed.error.issues.map((issue) => issue.message).join("; ")}`);
|
|
99
|
+
const described = entry.describe?.(parsed.data);
|
|
100
|
+
if (described && "refusal" in described)
|
|
101
|
+
return refuse(409, described.refusal);
|
|
102
|
+
const budget = spendWrite(turn);
|
|
103
|
+
if (budget)
|
|
104
|
+
return refuse(429, budget);
|
|
105
|
+
const picture = entry.fromFile ? await takePicture(turn, parsed.data) : { value: parsed.data };
|
|
106
|
+
if ("refusal" in picture)
|
|
107
|
+
return refuse(400, picture.refusal);
|
|
108
|
+
const applied = await apply(turn, bot, entry, picture.value, described?.change);
|
|
109
|
+
if (picture.stored && applied.status >= 300)
|
|
110
|
+
deps.pictures?.discard(picture.stored);
|
|
111
|
+
return applied;
|
|
112
|
+
}
|
|
113
|
+
/** A value naming a picture file by `path` goes on as the stored picture's `avatarUrl`; an empty path stays, to remove it. */
|
|
114
|
+
async function takePicture(turn, value) {
|
|
115
|
+
const { path, ...rest } = value;
|
|
116
|
+
if (typeof path !== "string" || !path)
|
|
117
|
+
return { value };
|
|
118
|
+
if (!deps.pictures)
|
|
119
|
+
return { refusal: "Pictures can't be set from a file here." };
|
|
120
|
+
const taken = await deps.pictures.take(turn, path);
|
|
121
|
+
return "refusal" in taken ? taken : { value: { ...rest, avatarUrl: taken.avatarUrl }, stored: taken.avatarUrl };
|
|
122
|
+
}
|
|
123
|
+
/** A theme is the person's whose own message began the work, never a teammate's or a guest's. */
|
|
124
|
+
async function theme(turn, body) {
|
|
125
|
+
const themes = deps.themes;
|
|
126
|
+
if (!themes)
|
|
127
|
+
return refuse(404, "Themes are not available on this server.");
|
|
128
|
+
const bot = store.bot(turn.botId);
|
|
129
|
+
if (!bot)
|
|
130
|
+
return refuse(404, "This bot no longer exists.");
|
|
131
|
+
const person = deps.guestDriven(turn.threadId) ? null : themes.person(turn);
|
|
132
|
+
if (!person)
|
|
133
|
+
return refuse(403, "A theme changes only for the person who asked, in their own conversation. This turn was not started by them here, so nothing changed.");
|
|
134
|
+
if (body.action === "theme")
|
|
135
|
+
return themes.overview(person, body.id);
|
|
136
|
+
if (body.action === "theme_history")
|
|
137
|
+
return themes.history(person);
|
|
138
|
+
const asked = body.action === "set_theme" ? themes.wanted(person, body) : body.action === "undo_theme" ? themes.undo(person, body) : null;
|
|
139
|
+
if (asked && "error" in asked)
|
|
140
|
+
return refuse(400, asked.error);
|
|
141
|
+
const budget = spendWrite(turn);
|
|
142
|
+
if (budget)
|
|
143
|
+
return refuse(429, budget);
|
|
144
|
+
return asked ? apply(turn, bot, themes.entry(person), asked.wear, asked.change) : themes.addAsset(turn, person, body);
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
async handle(body, turn) {
|
|
148
|
+
if (body.action === "find") {
|
|
149
|
+
const query = typeof body.query === "string" ? body.query : "";
|
|
150
|
+
const hits = findSettings(entries, query, FIND_LIMIT).map(describe);
|
|
151
|
+
return reply(200, { text: hits.length ? JSON.stringify(hits) : `No setting matches ${JSON.stringify(query)}. Try other words, or tell the user it is not something bots can change.` });
|
|
152
|
+
}
|
|
153
|
+
if (body.action === "get") {
|
|
154
|
+
const entry = typeof body.id === "string" ? byId.get(body.id) : undefined;
|
|
155
|
+
if (!entry)
|
|
156
|
+
return refuse(404, `No setting with id ${JSON.stringify(body.id ?? null)}. Use action find first.`);
|
|
157
|
+
return reply(200, { text: JSON.stringify({ ...describe(entry), help: entry.help, ...("allowed" in entry ? { allowed: entry.allowed } : {}),
|
|
158
|
+
change: entry.tier === "owner-only" ? `only the person, in ${entry.where}` : entry.tier === "secret" ? "set with no value opens a secure card" : "set applies at once, with Undo on the card" }) });
|
|
159
|
+
}
|
|
160
|
+
if (body.action === "set")
|
|
161
|
+
return set(turn, body);
|
|
162
|
+
if (typeof body.action === "string" && THEME_ACTIONS.includes(body.action))
|
|
163
|
+
return theme(turn, body);
|
|
164
|
+
return refuse(400, `action must be find, get, set, ${THEME_ACTIONS.join(", ")}.`);
|
|
165
|
+
},
|
|
166
|
+
/** Undo on an applied card: restores the value read before the change, unless it changed since. */
|
|
167
|
+
async undo(args) {
|
|
168
|
+
const message = store.messagesFor(args.threadId).find((candidate) => candidate.card?.requestId === args.requestId && candidate.card.appSettingRequest);
|
|
169
|
+
const current = message?.card;
|
|
170
|
+
if (!message || !current)
|
|
171
|
+
return { claimed: false };
|
|
172
|
+
if (current.undone)
|
|
173
|
+
return { claimed: true, state: "already_undone" };
|
|
174
|
+
const change = undoable.get(args.requestId);
|
|
175
|
+
if (!change || current.answered !== "allow")
|
|
176
|
+
return { claimed: true, state: "invalid", error: "This change can't be undone here.", status: 409 };
|
|
177
|
+
if (change.entry.read() !== change.after)
|
|
178
|
+
return { claimed: true, state: "invalid", error: UNDO_STALE, status: 409, stale: true };
|
|
179
|
+
const refusal = change.before === undefined ? "The earlier value is not one that can be set back." : await change.entry.write(change.before);
|
|
180
|
+
if (refusal)
|
|
181
|
+
return { claimed: true, state: "invalid", error: refusal, status: 409 };
|
|
182
|
+
undoable.delete(args.requestId);
|
|
183
|
+
store.patchMessage(args.threadId, message.id, { card: { ...current, undone: true } });
|
|
184
|
+
return { claimed: true, state: "undone" };
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// A picture a bot names by path, for a bot's picture or the person's own: copied into the attachment store, so it is
|
|
2
|
+
// served and kept like a picture the person picks in Settings.
|
|
3
|
+
import { realpath } from "node:fs/promises";
|
|
4
|
+
import { basename, isAbsolute, join, relative, sep } from "node:path";
|
|
5
|
+
import { botAvatarUrlFromStoredPath } from "../../shared/bot-avatar.js";
|
|
6
|
+
import { sniffRaster } from "../generated-image.js";
|
|
7
|
+
import { openMessageFile } from "../message-file.js";
|
|
8
|
+
export const PICTURE_FILE_MAX_BYTES = 5 * 1024 * 1024;
|
|
9
|
+
export const PICTURE_FILE_KINDS = "a PNG, JPEG, GIF or WebP picture";
|
|
10
|
+
const inside = (root, path) => {
|
|
11
|
+
const rest = relative(root, path);
|
|
12
|
+
return rest !== "" && rest !== ".." && !rest.startsWith(`..${sep}`) && !isAbsolute(rest);
|
|
13
|
+
};
|
|
14
|
+
const outside = (path) => `${path} is outside your workspace, your working folder and this conversation's files, so it can't be a picture.`;
|
|
15
|
+
function refusalFor(error, path) {
|
|
16
|
+
const { status, code } = (error ?? {});
|
|
17
|
+
if (status === 404)
|
|
18
|
+
return `No file was found at ${path}. Save the picture in your workspace or working folder and pass its exact path.`;
|
|
19
|
+
if (code === "outside_workspace")
|
|
20
|
+
return outside(path);
|
|
21
|
+
if (status === 413)
|
|
22
|
+
return `That file is over ${PICTURE_FILE_MAX_BYTES / 1024 / 1024} MB. Use a smaller picture.`;
|
|
23
|
+
return error instanceof Error ? error.message : "That file could not be read.";
|
|
24
|
+
}
|
|
25
|
+
export function createPictureFiles(deps) {
|
|
26
|
+
return {
|
|
27
|
+
/** Security: the file opens through the message-file resolver (its real path inside the bot's folders, no link at the
|
|
28
|
+
* end, the size cap), a stored attachment only when this conversation carries it, and its bytes, never its name,
|
|
29
|
+
* must be a PNG, JPEG, GIF or WebP. */
|
|
30
|
+
async take(turn, path) {
|
|
31
|
+
let opened;
|
|
32
|
+
try {
|
|
33
|
+
opened = await openMessageFile(path, [...deps.ownFolders(turn), deps.attachmentsDir], PICTURE_FILE_MAX_BYTES);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
return { refusal: refusalFor(error, path) };
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
const store = await realpath(deps.attachmentsDir).catch(() => null);
|
|
40
|
+
if (store && inside(store, opened.path) && !deps.inConversation(turn, basename(opened.path)))
|
|
41
|
+
return { refusal: outside(path) };
|
|
42
|
+
const bytes = await opened.handle.readFile();
|
|
43
|
+
const mime = sniffRaster(bytes);
|
|
44
|
+
if (!mime)
|
|
45
|
+
return { refusal: `${basename(opened.path)} is not ${PICTURE_FILE_KINDS}.` };
|
|
46
|
+
const saved = deps.save(bytes, mime);
|
|
47
|
+
const avatarUrl = botAvatarUrlFromStoredPath(saved);
|
|
48
|
+
if (avatarUrl)
|
|
49
|
+
return { avatarUrl };
|
|
50
|
+
deps.remove(saved);
|
|
51
|
+
return { refusal: "That picture could not be stored." };
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
await opened.handle.close().catch(() => undefined);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
/** Takes back a picture `take` stored for a change that did not happen. */
|
|
58
|
+
discard(avatarUrl) {
|
|
59
|
+
deps.remove(join(deps.attachmentsDir, basename(avatarUrl)));
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// One bot's own settings, as its Settings panel edits them: each change applies with Undo on a card naming the bot and the
|
|
2
|
+
// exact effect, written through PATCH /api/bots/:id so that route's checks still run.
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { approvalModeFor } from "../../shared/approval-mode.js";
|
|
5
|
+
import { BOT_PROFILE_LIMITS } from "../../shared/bot-profile.js";
|
|
6
|
+
import { TOOL_GROUP_LABELS, TOOL_GROUPS } from "../../shared/tool-groups.js";
|
|
7
|
+
import { EFFORT_LEVELS, MAUS_COLOR_NAMES } from "../../shared/wire.js";
|
|
8
|
+
import { withoutKeys } from "./registry.js";
|
|
9
|
+
const botId = z.string().regex(/^[\w-]{1,120}$/);
|
|
10
|
+
const forBot = (shape) => withoutKeys(z.object({ botId, ...shape }).strict());
|
|
11
|
+
const APPROVAL = {
|
|
12
|
+
ask: { label: "Ask for approval", effect: (name) => `Make ${name} ask you before each command or file change` },
|
|
13
|
+
edits: { label: "Auto-accept edits", effect: (name) => `Let ${name} edit files without asking; other actions still ask you` },
|
|
14
|
+
auto: { label: "Approve for me", effect: (name) => `Let ${name}'s engine approve routine actions and ask you about the rest` },
|
|
15
|
+
full: { label: "Full access", effect: (name) => `Let ${name} act without asking` },
|
|
16
|
+
};
|
|
17
|
+
const approvalName = (mode) => (mode === "custom" ? "Custom" : APPROVAL[mode].label);
|
|
18
|
+
const COMPUTER = {
|
|
19
|
+
auto: "pick its own computer", cloud: "use a cloud desktop", vm: "use a private desktop on this computer",
|
|
20
|
+
local: "use this computer's own desktop, as you", browser: "use only the built-in browser", off: "use no computer",
|
|
21
|
+
};
|
|
22
|
+
const onOff = (on) => (on === null ? "follow the app's setting" : on ? "on" : "off");
|
|
23
|
+
const on = (field) => field !== false;
|
|
24
|
+
const set = (field) => field === true;
|
|
25
|
+
/** The other fields the bot panel edits that a loopback caller may set while a bot works; the route checks each one.
|
|
26
|
+
* `was` reads the bot's value as it runs on, defaults included, for Undo. */
|
|
27
|
+
const OTHER = {
|
|
28
|
+
title: { label: "title", value: z.string().max(BOT_PROFILE_LIMITS.title), shown: (text) => `"${String(text)}"`, was: (one) => one.title ?? "" },
|
|
29
|
+
description: { label: "description", value: z.string().max(BOT_PROFILE_LIMITS.description), shown: (text) => `"${String(text)}"`, was: (one) => one.description ?? "" },
|
|
30
|
+
soul: { label: "instructions", value: z.string().max(4000), shown: (text) => `"${String(text).slice(0, 120)}${String(text).length > 120 ? "…" : ""}"`, was: (one) => one.soul ?? "" },
|
|
31
|
+
notifications: { label: "notifications", value: z.boolean(), shown: onOff, was: (one) => on(one.notifications) },
|
|
32
|
+
speakReplies: { label: "spoken replies", value: z.boolean(), shown: onOff, was: (one) => set(one.speakReplies) },
|
|
33
|
+
replyStyle: { label: "reply style", value: z.enum(["default", "conversational"]), shown: String, was: (one) => one.replyStyle ?? "default" },
|
|
34
|
+
voice: { label: "voice", value: z.string().max(BOT_PROFILE_LIMITS.voice), shown: String, was: (one) => one.voice ?? "" },
|
|
35
|
+
voiceNotes: { label: "voice notes", value: z.boolean(), shown: onOff, was: (one) => on(one.voiceNotes) },
|
|
36
|
+
voiceNoteEveryReply: { label: "a voice note with every reply", value: z.boolean().nullable(), shown: onOff, was: (one) => one.voiceNoteEveryReply ?? null },
|
|
37
|
+
memoryEnabled: { label: "memory", value: z.boolean(), shown: onOff, was: (one) => on(one.memoryEnabled) },
|
|
38
|
+
memoryUpkeep: { label: "memory upkeep", value: z.boolean(), shown: onOff, was: (one) => on(one.memoryUpkeep) },
|
|
39
|
+
helperModel: { label: "helper model", value: z.boolean(), shown: onOff, was: (one) => on(one.helperModel) },
|
|
40
|
+
browser: { label: "built-in browser", value: z.boolean(), shown: onOff, was: (one) => on(one.browser) },
|
|
41
|
+
recordBrowserSteps: { label: "saving browser steps", value: z.boolean(), shown: onOff, was: (one) => set(one.recordBrowserSteps) },
|
|
42
|
+
composio: { label: "Composio apps", value: z.boolean(), shown: onOff, was: (one) => on(one.composio) },
|
|
43
|
+
xResearch: { label: "X research", value: z.boolean(), shown: onOff, was: (one) => set(one.xResearch) },
|
|
44
|
+
parkDirectMessages: { label: "holding direct messages behind delegated work", value: z.boolean(), shown: onOff, was: (one) => set(one.parkDirectMessages) },
|
|
45
|
+
cacheKeepWarm: { label: "keeping its cache warm", value: z.boolean().nullable(), shown: onOff, was: (one) => one.cacheKeepWarm ?? null },
|
|
46
|
+
autoStartVps: { label: "starting its own server", value: z.boolean(), shown: onOff, was: (one) => set(one.autoStartVps) },
|
|
47
|
+
computer: { label: "computer", value: z.enum(["auto", "cloud", "vm", "local", "browser", "off"]), shown: (kind) => COMPUTER[kind], was: (one) => one.computer ?? "auto" },
|
|
48
|
+
};
|
|
49
|
+
const toolGroups = z.array(z.enum(TOOL_GROUPS)).max(TOOL_GROUPS.length).optional();
|
|
50
|
+
const offNow = (one) => TOOL_GROUPS.filter((group) => one.toolsOff?.includes(group));
|
|
51
|
+
const groupNames = (groups) => groups.map((group) => TOOL_GROUP_LABELS[group]).join(", ");
|
|
52
|
+
export function botEntries(deps, writable) {
|
|
53
|
+
const bot = (id) => deps.bots().find((candidate) => candidate.id === id);
|
|
54
|
+
const missing = (id) => ({ refusal: `No bot has the id ${id}. Use list_bots for the ids.` });
|
|
55
|
+
const everyBot = (line) => () => deps.bots().map((one) => `${one.name}: ${line(one)}`).join("; ");
|
|
56
|
+
/** A per-bot entry: `effect` names the change for the card, or refuses it, once the bot is known to exist; `was` is the
|
|
57
|
+
* same bot's value before it, for Undo. */
|
|
58
|
+
const perBot = (spec) => writable({
|
|
59
|
+
...spec, current: (value) => { const one = bot(value.botId); return one ? spec.was(one, value) : undefined; },
|
|
60
|
+
describe: (value) => { const one = bot(value.botId); return one ? spec.effect(one, value) : missing(value.botId); },
|
|
61
|
+
write: (value) => { const one = bot(value.botId); return one ? deps.patchBot(one.id, spec.patch(one, value)) : Promise.resolve(missing(value.botId).refusal); },
|
|
62
|
+
});
|
|
63
|
+
return [
|
|
64
|
+
perBot({
|
|
65
|
+
id: "bots.approvalModes", label: "Approval mode", help: "What one bot may do without asking you, on every one of its conversations.", where: "a bot's Settings",
|
|
66
|
+
synonyms: ["permissions", "full access", "approve", "ask", "approval", "autonomy", "approve for me", "auto-accept edits"],
|
|
67
|
+
value: forBot({ mode: z.enum(["ask", "edits", "auto", "full"]) }),
|
|
68
|
+
allowed: '{"botId","mode"} with mode ask (Ask for approval), edits (Auto-accept edits), auto (Approve for me) or full (Full access). Custom is chosen only in the desktop app',
|
|
69
|
+
read: everyBot((one) => approvalName(approvalModeFor(one))),
|
|
70
|
+
effect: (one, { mode }) => {
|
|
71
|
+
if (approvalModeFor(one) === "custom")
|
|
72
|
+
return { refusal: `${one.name} is on Custom approval, which is changed only in the desktop app, in ${one.name}'s Settings. Tell the user where.` };
|
|
73
|
+
// The route takes Approve for me on this computer's own desktop only with the warning its Settings dialog shows.
|
|
74
|
+
if (mode === "auto" && one.computer === "local")
|
|
75
|
+
return { refusal: `Approve for me while ${one.name} uses this computer's own desktop needs a warning only ${one.name}'s Settings shows. Tell the user to choose it there.` };
|
|
76
|
+
return { change: `${APPROVAL[mode].effect(one.name)} (${APPROVAL[mode].label})` };
|
|
77
|
+
},
|
|
78
|
+
was: (one, { botId }) => ({ botId, mode: approvalModeFor(one) }),
|
|
79
|
+
patch: (_one, { mode }) => ({ approvalMode: mode, applyToAllThreads: true }),
|
|
80
|
+
}),
|
|
81
|
+
perBot({
|
|
82
|
+
id: "bots.name", label: "Bot name", help: "A bot's name, as the sidebar and chats show it.", where: "a bot's Settings", synonyms: ["rename", "name", "call", "bot name"],
|
|
83
|
+
value: forBot({ name: z.string().trim().min(1).max(BOT_PROFILE_LIMITS.name) }), allowed: '{"botId","name"}', read: everyBot((one) => one.name),
|
|
84
|
+
effect: (one, { name }) => ({ change: `Rename ${one.name} to "${name}"` }), was: (one, { botId }) => ({ botId, name: one.name }), patch: (_one, { name }) => ({ name }),
|
|
85
|
+
}),
|
|
86
|
+
perBot({
|
|
87
|
+
id: "bots.color", label: "Bot colour", help: "A bot's colour in the sidebar and its chat.", where: "a bot's Settings", synonyms: ["color", "colour", "tint", "bot color"],
|
|
88
|
+
value: forBot({ color: z.enum(MAUS_COLOR_NAMES) }), allowed: `{"botId","color"} with color one of ${MAUS_COLOR_NAMES.join(", ")}`, read: everyBot((one) => one.color),
|
|
89
|
+
effect: (one, { color }) => ({ change: `Make ${one.name} ${color}` }), was: (one, { botId }) => ({ botId, color: one.color }), patch: (_one, { color }) => ({ color }),
|
|
90
|
+
}),
|
|
91
|
+
perBot({
|
|
92
|
+
id: "bots.model", label: "Bot model", help: "The engine and model one bot runs on, for its conversations. Ids come from list_models.", where: "a bot's Settings",
|
|
93
|
+
synonyms: ["model", "engine", "switch model", "change model", "effort", "reasoning"],
|
|
94
|
+
value: forBot({ instanceId: z.string().min(1).max(120), model: z.string().min(1).max(200), effort: z.enum(EFFORT_LEVELS).optional() }),
|
|
95
|
+
allowed: '{"botId","instanceId","model","effort"?} from list_models', read: everyBot((one) => `${one.modelSelection.instanceId} / ${one.modelSelection.model}`),
|
|
96
|
+
effect: (one, { instanceId, model, effort }) => {
|
|
97
|
+
const engine = deps.engines().find((candidate) => candidate.instanceId === instanceId);
|
|
98
|
+
if (!engine)
|
|
99
|
+
return { refusal: `No engine has the id ${instanceId}. Use list_models for engine and model ids.` };
|
|
100
|
+
return { change: `Move ${one.name} to ${engine.name}, model ${model}${effort ? `, ${effort} effort` : ""}` };
|
|
101
|
+
},
|
|
102
|
+
was: (one, { botId }) => ({ botId, instanceId: one.modelSelection.instanceId, model: one.modelSelection.model, ...(one.modelSelection.effort ? { effort: one.modelSelection.effort } : {}) }),
|
|
103
|
+
patch: (_one, { instanceId, model, effort }) => ({ modelSelection: { instanceId, model, ...(effort ? { effort } : {}) }, requireAvailableModel: true }),
|
|
104
|
+
}),
|
|
105
|
+
perBot({
|
|
106
|
+
id: "bots.archived", label: "Archived bots", help: "Archive a bot to take it out of the sidebar, keeping its chats; false brings it back.", where: "the sidebar",
|
|
107
|
+
synonyms: ["archive", "unarchive", "restore bot", "hide bot", "show bot", "hidden"],
|
|
108
|
+
value: forBot({ archived: z.boolean() }), allowed: '{"botId","archived":true|false}', read: () => deps.bots().filter((one) => one.hidden).map((one) => one.name).join(", "),
|
|
109
|
+
effect: (one, { archived }) => one.defaultBot && archived ? { refusal: `${one.name} is this place's own bot and is never archived. To take it out of the sidebar use sidebar.showHelper.` }
|
|
110
|
+
: { change: archived ? `Archive ${one.name}: it leaves the sidebar and keeps its chats${one.chiefOfStaff ? ", and stops being Chief of Staff" : ""}` : `Bring ${one.name} back to the sidebar` },
|
|
111
|
+
was: (one, { botId }) => ({ botId, archived: one.hidden === true }),
|
|
112
|
+
patch: (one, { archived }) => ({ hidden: archived, ...(archived && one.chiefOfStaff ? { chiefOfStaff: false } : {}) }),
|
|
113
|
+
}),
|
|
114
|
+
writable({
|
|
115
|
+
id: "sidebar.showHelper", label: "Show MausBot in the sidebar", help: "Whether this place's own bot, MausBot, has a row in the sidebar; it keeps working either way.", where: "Settings → Overview",
|
|
116
|
+
synonyms: ["helper", "starter", "default bot", "mausbot", "show helper"], value: z.boolean(), allowed: "true or false",
|
|
117
|
+
current: () => { const helper = deps.bots().find((one) => one.defaultBot); return helper ? !helper.sidebarHidden : undefined; },
|
|
118
|
+
describe: (show) => (deps.bots().some((one) => one.defaultBot) ? { change: show ? "Show MausBot in the sidebar" : "Take MausBot out of the sidebar; it keeps working" } : { refusal: "This place has no MausBot of its own." }),
|
|
119
|
+
write: (show) => { const helper = deps.bots().find((one) => one.defaultBot); return helper ? deps.patchBot(helper.id, { sidebarHidden: !show }) : Promise.resolve("This place has no MausBot of its own."); },
|
|
120
|
+
}),
|
|
121
|
+
perBot({
|
|
122
|
+
id: "bots.tools", label: "Bot tool groups", where: "a bot's Settings",
|
|
123
|
+
help: `Turn groups of one bot's built-in tools off to make every request smaller, or back on: ${TOOL_GROUPS.map((group) => `${group} (${TOOL_GROUP_LABELS[group]})`).join(", ")}. Memory, X research, the browser and connected apps have their own settings.`,
|
|
124
|
+
synonyms: ["tools", "tool groups", "turn off tools", "meetings", "data", "pages", "publish", "images", "email", "tokens", "smaller requests"],
|
|
125
|
+
value: forBot({ turnOff: toolGroups, turnOn: toolGroups })
|
|
126
|
+
.refine((value) => Boolean(value.turnOff?.length || value.turnOn?.length), "name a group in turnOff or turnOn")
|
|
127
|
+
.refine((value) => !value.turnOff?.some((group) => value.turnOn?.includes(group)), "a group can't be in both turnOff and turnOn"),
|
|
128
|
+
allowed: `{"botId","turnOff"?:[...],"turnOn"?:[...]} with groups from ${TOOL_GROUPS.join(", ")}`,
|
|
129
|
+
read: everyBot((one) => (offNow(one).length ? `off: ${groupNames(offNow(one))}` : "all on")),
|
|
130
|
+
effect: (one, { turnOff = [], turnOn = [] }) => ({ change: `${one.name}: ${[turnOff.length ? `turn off ${groupNames(turnOff)}` : "", turnOn.length ? `turn on ${groupNames(turnOn)}` : ""].filter(Boolean).join("; ")}` }),
|
|
131
|
+
was: (one, { botId }) => ({ botId, turnOff: offNow(one), turnOn: TOOL_GROUPS.filter((group) => !offNow(one).includes(group)) }),
|
|
132
|
+
patch: (one, { turnOff = [], turnOn = [] }) => ({ toolsOff: TOOL_GROUPS.filter((group) => turnOff.includes(group) || (offNow(one).includes(group) && !turnOn.includes(group))) }),
|
|
133
|
+
}),
|
|
134
|
+
perBot({
|
|
135
|
+
id: "bots.settings", label: "Other bot settings", help: `More of one bot's own settings: ${Object.values(OTHER).map((field) => field.label).join(", ")}.`, where: "a bot's Settings",
|
|
136
|
+
synonyms: ["voice", "voice notes", "memory", "notifications", "browser", "instructions", "soul", "title", "description", "reply style", "computer", "desktop", "composio", "x research", "keep warm"],
|
|
137
|
+
value: forBot(Object.fromEntries(Object.entries(OTHER).map(([field, spec]) => [field, spec.value.optional()])))
|
|
138
|
+
.refine((value) => Object.keys(value).length > 1, "name at least one setting besides botId"),
|
|
139
|
+
allowed: `{"botId", ...one or more of ${Object.keys(OTHER).join(", ")}}`,
|
|
140
|
+
read: () => "use get on a bot's own fields through list_bots",
|
|
141
|
+
effect: (one, value) => ({ change: `${one.name}: ${Object.keys(value).filter((field) => field !== "botId")
|
|
142
|
+
.map((field) => `${OTHER[field].label} ${OTHER[field].shown(value[field])}`).join("; ")}` }),
|
|
143
|
+
was: (one, value) => ({ botId: one.id, ...Object.fromEntries(Object.keys(value).filter((field) => field !== "botId").map((field) => [field, OTHER[field].was(one)])) }),
|
|
144
|
+
patch: (_one, { botId: _id, computer, ...rest }) => ({ ...rest, ...(computer ? { computer: computer === "auto" ? null : computer } : {}) }),
|
|
145
|
+
}),
|
|
146
|
+
];
|
|
147
|
+
}
|