botmux 3.4.3 → 3.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +10 -7
- package/README.md +11 -6
- package/dist/adapters/backend/herdr-backend.d.ts +43 -6
- package/dist/adapters/backend/herdr-backend.d.ts.map +1 -1
- package/dist/adapters/backend/herdr-backend.js +362 -28
- package/dist/adapters/backend/herdr-backend.js.map +1 -1
- package/dist/adapters/backend/reproduce-command.d.ts +39 -0
- package/dist/adapters/backend/reproduce-command.d.ts.map +1 -0
- package/dist/adapters/backend/reproduce-command.js +63 -0
- package/dist/adapters/backend/reproduce-command.js.map +1 -0
- package/dist/adapters/backend/sandbox.d.ts +99 -279
- package/dist/adapters/backend/sandbox.d.ts.map +1 -1
- package/dist/adapters/backend/sandbox.js +424 -826
- package/dist/adapters/backend/sandbox.js.map +1 -1
- package/dist/adapters/backend/session-backend-selector.d.ts +10 -1
- package/dist/adapters/backend/session-backend-selector.d.ts.map +1 -1
- package/dist/adapters/backend/session-backend-selector.js +73 -4
- package/dist/adapters/backend/session-backend-selector.js.map +1 -1
- package/dist/adapters/backend/types.d.ts +16 -0
- package/dist/adapters/backend/types.d.ts.map +1 -1
- package/dist/adapters/backend/types.js.map +1 -1
- package/dist/adapters/cli/codex.d.ts.map +1 -1
- package/dist/adapters/cli/codex.js +4 -0
- package/dist/adapters/cli/codex.js.map +1 -1
- package/dist/adapters/cli/fs-policy.d.ts +244 -0
- package/dist/adapters/cli/fs-policy.d.ts.map +1 -0
- package/dist/adapters/cli/fs-policy.js +539 -0
- package/dist/adapters/cli/fs-policy.js.map +1 -0
- package/dist/adapters/cli/pi-initial-prompt.d.ts.map +1 -1
- package/dist/adapters/cli/pi-initial-prompt.js +5 -1
- package/dist/adapters/cli/pi-initial-prompt.js.map +1 -1
- package/dist/adapters/cli/read-isolation.d.ts +14 -200
- package/dist/adapters/cli/read-isolation.d.ts.map +1 -1
- package/dist/adapters/cli/read-isolation.js +18 -477
- package/dist/adapters/cli/read-isolation.js.map +1 -1
- package/dist/adapters/cli/traex.d.ts.map +1 -1
- package/dist/adapters/cli/traex.js +5 -0
- package/dist/adapters/cli/traex.js.map +1 -1
- package/dist/adapters/cli/types.d.ts +3 -3
- package/dist/adapters/cli/types.d.ts.map +1 -1
- package/dist/adapters/hook-installer.d.ts +7 -0
- package/dist/adapters/hook-installer.d.ts.map +1 -1
- package/dist/adapters/hook-installer.js +56 -0
- package/dist/adapters/hook-installer.js.map +1 -1
- package/dist/bot-registry.d.ts +39 -23
- package/dist/bot-registry.d.ts.map +1 -1
- package/dist/bot-registry.js +134 -2
- package/dist/bot-registry.js.map +1 -1
- package/dist/cli/capabilities.d.ts +24 -0
- package/dist/cli/capabilities.d.ts.map +1 -0
- package/dist/cli/capabilities.js +25 -0
- package/dist/cli/capabilities.js.map +1 -0
- package/dist/cli/create-group-resolver.d.ts +24 -0
- package/dist/cli/create-group-resolver.d.ts.map +1 -1
- package/dist/cli/create-group-resolver.js +23 -0
- package/dist/cli/create-group-resolver.js.map +1 -1
- package/dist/cli/daemon-lifecycle-env.d.ts +5 -7
- package/dist/cli/daemon-lifecycle-env.d.ts.map +1 -1
- package/dist/cli/daemon-lifecycle-env.js +13 -7
- package/dist/cli/daemon-lifecycle-env.js.map +1 -1
- package/dist/cli/exact-chat-grant-client.d.ts +48 -0
- package/dist/cli/exact-chat-grant-client.d.ts.map +1 -0
- package/dist/cli/exact-chat-grant-client.js +108 -0
- package/dist/cli/exact-chat-grant-client.js.map +1 -0
- package/dist/cli/exact-chat-grant.d.ts +18 -0
- package/dist/cli/exact-chat-grant.d.ts.map +1 -0
- package/dist/cli/exact-chat-grant.js +97 -0
- package/dist/cli/exact-chat-grant.js.map +1 -0
- package/dist/cli.d.ts +10 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +795 -144
- package/dist/cli.js.map +1 -1
- package/dist/codex-rpc-engine.d.ts +26 -0
- package/dist/codex-rpc-engine.d.ts.map +1 -1
- package/dist/codex-rpc-engine.js +113 -2
- package/dist/codex-rpc-engine.js.map +1 -1
- package/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +16 -0
- package/dist/config.js.map +1 -1
- package/dist/core/bot-live-control.d.ts +41 -0
- package/dist/core/bot-live-control.d.ts.map +1 -0
- package/dist/core/bot-live-control.js +135 -0
- package/dist/core/bot-live-control.js.map +1 -0
- package/dist/core/command-handler.d.ts.map +1 -1
- package/dist/core/command-handler.js +44 -66
- package/dist/core/command-handler.js.map +1 -1
- package/dist/core/daemon-config-fence.d.ts +8 -0
- package/dist/core/daemon-config-fence.d.ts.map +1 -0
- package/dist/core/daemon-config-fence.js +13 -0
- package/dist/core/daemon-config-fence.js.map +1 -0
- package/dist/core/dashboard-events.d.ts +5 -0
- package/dist/core/dashboard-events.d.ts.map +1 -1
- package/dist/core/dashboard-events.js.map +1 -1
- package/dist/core/dashboard-ipc-server.d.ts +21 -2
- package/dist/core/dashboard-ipc-server.d.ts.map +1 -1
- package/dist/core/dashboard-ipc-server.js +258 -32
- package/dist/core/dashboard-ipc-server.js.map +1 -1
- package/dist/core/dispatch-registry.d.ts +12 -0
- package/dist/core/dispatch-registry.d.ts.map +1 -0
- package/dist/core/dispatch-registry.js +33 -0
- package/dist/core/dispatch-registry.js.map +1 -0
- package/dist/core/dispatch.d.ts +99 -0
- package/dist/core/dispatch.d.ts.map +1 -1
- package/dist/core/dispatch.js +136 -0
- package/dist/core/dispatch.js.map +1 -1
- package/dist/core/maintenance.d.ts.map +1 -1
- package/dist/core/maintenance.js +10 -3
- package/dist/core/maintenance.js.map +1 -1
- package/dist/core/passthrough-commands.d.ts.map +1 -1
- package/dist/core/passthrough-commands.js +1 -1
- package/dist/core/passthrough-commands.js.map +1 -1
- package/dist/core/persistent-backend.d.ts +16 -2
- package/dist/core/persistent-backend.d.ts.map +1 -1
- package/dist/core/persistent-backend.js +40 -0
- package/dist/core/persistent-backend.js.map +1 -1
- package/dist/core/plugins/mcp/gateway-installer.d.ts.map +1 -1
- package/dist/core/plugins/mcp/gateway-installer.js +14 -2
- package/dist/core/plugins/mcp/gateway-installer.js.map +1 -1
- package/dist/core/session-discovery.d.ts +8 -1
- package/dist/core/session-discovery.d.ts.map +1 -1
- package/dist/core/session-discovery.js +140 -8
- package/dist/core/session-discovery.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +102 -68
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-title.d.ts +8 -0
- package/dist/core/session-title.d.ts.map +1 -1
- package/dist/core/session-title.js +54 -0
- package/dist/core/session-title.js.map +1 -1
- package/dist/core/terminal-write-auth.d.ts +15 -0
- package/dist/core/terminal-write-auth.d.ts.map +1 -1
- package/dist/core/terminal-write-auth.js +20 -0
- package/dist/core/terminal-write-auth.js.map +1 -1
- package/dist/core/trigger-session.d.ts.map +1 -1
- package/dist/core/trigger-session.js +3 -2
- package/dist/core/trigger-session.js.map +1 -1
- package/dist/core/types.d.ts +33 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/worker-pool.d.ts +51 -8
- package/dist/core/worker-pool.d.ts.map +1 -1
- package/dist/core/worker-pool.js +439 -25
- package/dist/core/worker-pool.js.map +1 -1
- package/dist/daemon.d.ts +4 -2
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +403 -26
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard/bot-onboarding.d.ts +127 -1
- package/dist/dashboard/bot-onboarding.d.ts.map +1 -1
- package/dist/dashboard/bot-onboarding.js +1104 -25
- package/dist/dashboard/bot-onboarding.js.map +1 -1
- package/dist/dashboard/bot-payload.d.ts +5 -0
- package/dist/dashboard/bot-payload.d.ts.map +1 -1
- package/dist/dashboard/bot-payload.js +7 -0
- package/dist/dashboard/bot-payload.js.map +1 -1
- package/dist/dashboard/debug-terminal.d.ts +18 -0
- package/dist/dashboard/debug-terminal.d.ts.map +1 -0
- package/dist/dashboard/debug-terminal.js +338 -0
- package/dist/dashboard/debug-terminal.js.map +1 -0
- package/dist/dashboard/public-redact.d.ts +2 -0
- package/dist/dashboard/public-redact.d.ts.map +1 -1
- package/dist/dashboard/public-redact.js +12 -3
- package/dist/dashboard/public-redact.js.map +1 -1
- package/dist/dashboard/registry.d.ts +8 -0
- package/dist/dashboard/registry.d.ts.map +1 -1
- package/dist/dashboard/registry.js +13 -0
- package/dist/dashboard/registry.js.map +1 -1
- package/dist/dashboard/settings-write-applier.d.ts +47 -1
- package/dist/dashboard/settings-write-applier.d.ts.map +1 -1
- package/dist/dashboard/settings-write-applier.js +102 -1
- package/dist/dashboard/settings-write-applier.js.map +1 -1
- package/dist/dashboard/web/app.d.ts.map +1 -1
- package/dist/dashboard/web/app.js +2 -0
- package/dist/dashboard/web/app.js.map +1 -1
- package/dist/dashboard/web/bot-defaults-page.d.ts +17 -0
- package/dist/dashboard/web/bot-defaults-page.d.ts.map +1 -1
- package/dist/dashboard/web/bot-defaults-page.js +249 -11
- package/dist/dashboard/web/bot-defaults-page.js.map +1 -1
- package/dist/dashboard/web/bot-defaults.d.ts +22 -0
- package/dist/dashboard/web/bot-defaults.d.ts.map +1 -1
- package/dist/dashboard/web/bot-defaults.js +19 -0
- package/dist/dashboard/web/bot-defaults.js.map +1 -1
- package/dist/dashboard/web/i18n.d.ts.map +1 -1
- package/dist/dashboard/web/i18n.js +114 -28
- package/dist/dashboard/web/i18n.js.map +1 -1
- package/dist/dashboard/web/icon-tooltip.d.ts +3 -0
- package/dist/dashboard/web/icon-tooltip.d.ts.map +1 -0
- package/dist/dashboard/web/icon-tooltip.js +108 -0
- package/dist/dashboard/web/icon-tooltip.js.map +1 -0
- package/dist/dashboard/web/sessions-kanban.js +2 -2
- package/dist/dashboard/web/sessions-kanban.js.map +1 -1
- package/dist/dashboard/web/sessions-page.d.ts.map +1 -1
- package/dist/dashboard/web/sessions-page.js +49 -53
- package/dist/dashboard/web/sessions-page.js.map +1 -1
- package/dist/dashboard/web/sessions.d.ts +2 -0
- package/dist/dashboard/web/sessions.d.ts.map +1 -1
- package/dist/dashboard/web/sessions.js +46 -2
- package/dist/dashboard/web/sessions.js.map +1 -1
- package/dist/dashboard/web/settings-page.d.ts +78 -0
- package/dist/dashboard/web/settings-page.d.ts.map +1 -1
- package/dist/dashboard/web/settings-page.js +88 -1
- package/dist/dashboard/web/settings-page.js.map +1 -1
- package/dist/dashboard/web/store.d.ts +2 -0
- package/dist/dashboard/web/store.d.ts.map +1 -1
- package/dist/dashboard/web/store.js +13 -1
- package/dist/dashboard/web/store.js.map +1 -1
- package/dist/dashboard-web/app.js +1 -1
- package/dist/dashboard-web/chunks/bot-defaults-page-AUKV7P4L.js +10 -0
- package/dist/dashboard-web/chunks/{chunk-P6GO5KT4.js → chunk-KPQAUX7V.js} +1 -1
- package/dist/dashboard-web/chunks/{chunk-UBOLHQCK.js → chunk-NRL6CVAS.js} +1 -1
- package/dist/dashboard-web/chunks/{chunk-JNRSPKLS.js → chunk-R7IAKAYX.js} +1 -1
- package/dist/dashboard-web/chunks/{chunk-CUV65BIQ.js → chunk-X2L65IOM.js} +8 -8
- package/dist/dashboard-web/chunks/{connectors-page-KTC2QWNW.js → connectors-page-HDQFEXZI.js} +1 -1
- package/dist/dashboard-web/chunks/{groups-page-B3EKGOLY.js → groups-page-6DKXBYOM.js} +1 -1
- package/dist/dashboard-web/chunks/{insights-page-X6RXNCWX.js → insights-page-NWARTJ6J.js} +1 -1
- package/dist/dashboard-web/chunks/{monitor-room-LLRA5LQW.js → monitor-room-AGX3XRJX.js} +1 -1
- package/dist/dashboard-web/chunks/{monitoring-page-7MT5FEOS.js → monitoring-page-GGGIWN4C.js} +1 -1
- package/dist/dashboard-web/chunks/{office-page-KD46D5TD.js → office-page-6SIVKSK3.js} +1 -1
- package/dist/dashboard-web/chunks/{overview-page-JUWNH32O.js → overview-page-FVR3NKAF.js} +1 -1
- package/dist/dashboard-web/chunks/{roles-page-P6F7NLOI.js → roles-page-WE2YB7KN.js} +1 -1
- package/dist/dashboard-web/chunks/{schedules-page-XIHWZST4.js → schedules-page-TB3I24XN.js} +1 -1
- package/dist/dashboard-web/chunks/sessions-page-KOOOASIL.js +2 -0
- package/dist/dashboard-web/chunks/settings-page-IEBR7TGN.js +2 -0
- package/dist/dashboard-web/chunks/{skills-page-A46KVWBL.js → skills-page-3QAT2IWD.js} +1 -1
- package/dist/dashboard-web/chunks/{team-federation-page-SDUC56DF.js → team-federation-page-K4VVAVAK.js} +1 -1
- package/dist/dashboard-web/chunks/{v3-page-J5JOTUSQ.js → v3-page-V6IOJR2B.js} +1 -1
- package/dist/dashboard-web/chunks/{whiteboards-page-U7LSOAWI.js → whiteboards-page-V6CGKRNX.js} +1 -1
- package/dist/dashboard-web/style.css +218 -10
- package/dist/dashboard.js +380 -8
- package/dist/dashboard.js.map +1 -1
- package/dist/features/codex-notifier/adoption.d.ts +11 -0
- package/dist/features/codex-notifier/adoption.d.ts.map +1 -0
- package/dist/features/codex-notifier/adoption.js +11 -0
- package/dist/features/codex-notifier/adoption.js.map +1 -0
- package/dist/features/codex-notifier/app-opener.d.ts +21 -0
- package/dist/features/codex-notifier/app-opener.d.ts.map +1 -0
- package/dist/features/codex-notifier/app-opener.js +33 -0
- package/dist/features/codex-notifier/app-opener.js.map +1 -0
- package/dist/features/codex-notifier/card-action.d.ts +27 -0
- package/dist/features/codex-notifier/card-action.d.ts.map +1 -0
- package/dist/features/codex-notifier/card-action.js +84 -0
- package/dist/features/codex-notifier/card-action.js.map +1 -0
- package/dist/features/codex-notifier/card.d.ts +12 -0
- package/dist/features/codex-notifier/card.d.ts.map +1 -0
- package/dist/features/codex-notifier/card.js +150 -0
- package/dist/features/codex-notifier/card.js.map +1 -0
- package/dist/features/codex-notifier/codex-context.d.ts +12 -0
- package/dist/features/codex-notifier/codex-context.d.ts.map +1 -0
- package/dist/features/codex-notifier/codex-context.js +161 -0
- package/dist/features/codex-notifier/codex-context.js.map +1 -0
- package/dist/features/codex-notifier/config.d.ts +9 -0
- package/dist/features/codex-notifier/config.d.ts.map +1 -0
- package/dist/features/codex-notifier/config.js +11 -0
- package/dist/features/codex-notifier/config.js.map +1 -0
- package/dist/features/codex-notifier/confirmed-turn.d.ts +20 -0
- package/dist/features/codex-notifier/confirmed-turn.d.ts.map +1 -0
- package/dist/features/codex-notifier/confirmed-turn.js +130 -0
- package/dist/features/codex-notifier/confirmed-turn.js.map +1 -0
- package/dist/features/codex-notifier/emitter.d.ts +13 -0
- package/dist/features/codex-notifier/emitter.d.ts.map +1 -0
- package/dist/features/codex-notifier/emitter.js +33 -0
- package/dist/features/codex-notifier/emitter.js.map +1 -0
- package/dist/features/codex-notifier/event-store.d.ts +29 -0
- package/dist/features/codex-notifier/event-store.d.ts.map +1 -0
- package/dist/features/codex-notifier/event-store.js +217 -0
- package/dist/features/codex-notifier/event-store.js.map +1 -0
- package/dist/features/codex-notifier/event.d.ts +46 -0
- package/dist/features/codex-notifier/event.d.ts.map +1 -0
- package/dist/features/codex-notifier/event.js +188 -0
- package/dist/features/codex-notifier/event.js.map +1 -0
- package/dist/features/codex-notifier/hook-cli.d.ts +23 -0
- package/dist/features/codex-notifier/hook-cli.d.ts.map +1 -0
- package/dist/features/codex-notifier/hook-cli.js +130 -0
- package/dist/features/codex-notifier/hook-cli.js.map +1 -0
- package/dist/features/codex-notifier/hook-installer.d.ts +19 -0
- package/dist/features/codex-notifier/hook-installer.d.ts.map +1 -0
- package/dist/features/codex-notifier/hook-installer.js +158 -0
- package/dist/features/codex-notifier/hook-installer.js.map +1 -0
- package/dist/features/codex-notifier/index.d.ts +21 -0
- package/dist/features/codex-notifier/index.d.ts.map +1 -0
- package/dist/features/codex-notifier/index.js +19 -0
- package/dist/features/codex-notifier/index.js.map +1 -0
- package/dist/features/codex-notifier/internal-turn.d.ts +5 -0
- package/dist/features/codex-notifier/internal-turn.d.ts.map +1 -0
- package/dist/features/codex-notifier/internal-turn.js +43 -0
- package/dist/features/codex-notifier/internal-turn.js.map +1 -0
- package/dist/features/codex-notifier/outbox-worker.d.ts +71 -0
- package/dist/features/codex-notifier/outbox-worker.d.ts.map +1 -0
- package/dist/features/codex-notifier/outbox-worker.js +290 -0
- package/dist/features/codex-notifier/outbox-worker.js.map +1 -0
- package/dist/features/codex-notifier/outbox.d.ts +25 -0
- package/dist/features/codex-notifier/outbox.d.ts.map +1 -0
- package/dist/features/codex-notifier/outbox.js +225 -0
- package/dist/features/codex-notifier/outbox.js.map +1 -0
- package/dist/features/codex-notifier/paths.d.ts +7 -0
- package/dist/features/codex-notifier/paths.d.ts.map +1 -0
- package/dist/features/codex-notifier/paths.js +20 -0
- package/dist/features/codex-notifier/paths.js.map +1 -0
- package/dist/features/codex-notifier/screen-lock.d.ts +12 -0
- package/dist/features/codex-notifier/screen-lock.d.ts.map +1 -0
- package/dist/features/codex-notifier/screen-lock.js +47 -0
- package/dist/features/codex-notifier/screen-lock.js.map +1 -0
- package/dist/features/codex-notifier/side-conversation-monitor.d.ts +102 -0
- package/dist/features/codex-notifier/side-conversation-monitor.d.ts.map +1 -0
- package/dist/features/codex-notifier/side-conversation-monitor.js +774 -0
- package/dist/features/codex-notifier/side-conversation-monitor.js.map +1 -0
- package/dist/features/codex-notifier/types.d.ts +42 -0
- package/dist/features/codex-notifier/types.d.ts.map +1 -0
- package/dist/features/codex-notifier/types.js +2 -0
- package/dist/features/codex-notifier/types.js.map +1 -0
- package/dist/features/codex-notifier/worker-lock.d.ts +8 -0
- package/dist/features/codex-notifier/worker-lock.d.ts.map +1 -0
- package/dist/features/codex-notifier/worker-lock.js +108 -0
- package/dist/features/codex-notifier/worker-lock.js.map +1 -0
- package/dist/global-config.d.ts +13 -0
- package/dist/global-config.d.ts.map +1 -1
- package/dist/global-config.js +34 -1
- package/dist/global-config.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +1 -19
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +1 -19
- package/dist/i18n/zh.js.map +1 -1
- package/dist/im/lark/card-builder.d.ts +0 -13
- package/dist/im/lark/card-builder.d.ts.map +1 -1
- package/dist/im/lark/card-builder.js +2 -36
- package/dist/im/lark/card-builder.js.map +1 -1
- package/dist/im/lark/card-handler.d.ts +2 -0
- package/dist/im/lark/card-handler.d.ts.map +1 -1
- package/dist/im/lark/card-handler.js +166 -64
- package/dist/im/lark/card-handler.js.map +1 -1
- package/dist/im/lark/client.d.ts +98 -4
- package/dist/im/lark/client.d.ts.map +1 -1
- package/dist/im/lark/client.js +317 -29
- package/dist/im/lark/client.js.map +1 -1
- package/dist/im/lark/event-dispatcher.d.ts.map +1 -1
- package/dist/im/lark/event-dispatcher.js +48 -33
- package/dist/im/lark/event-dispatcher.js.map +1 -1
- package/dist/services/codex-app-threads.d.ts +47 -0
- package/dist/services/codex-app-threads.d.ts.map +1 -1
- package/dist/services/codex-app-threads.js +502 -10
- package/dist/services/codex-app-threads.js.map +1 -1
- package/dist/services/exact-chat-grant.d.ts +83 -0
- package/dist/services/exact-chat-grant.d.ts.map +1 -0
- package/dist/services/exact-chat-grant.js +249 -0
- package/dist/services/exact-chat-grant.js.map +1 -0
- package/dist/services/group-creator.d.ts +11 -0
- package/dist/services/group-creator.d.ts.map +1 -1
- package/dist/services/group-creator.js +18 -9
- package/dist/services/group-creator.js.map +1 -1
- package/dist/services/local-cli-opener.d.ts.map +1 -1
- package/dist/services/local-cli-opener.js +10 -5
- package/dist/services/local-cli-opener.js.map +1 -1
- package/dist/services/sandbox-migration.d.ts +14 -0
- package/dist/services/sandbox-migration.d.ts.map +1 -0
- package/dist/services/sandbox-migration.js +85 -0
- package/dist/services/sandbox-migration.js.map +1 -0
- package/dist/services/sandbox-store.d.ts +28 -0
- package/dist/services/sandbox-store.d.ts.map +1 -1
- package/dist/services/sandbox-store.js +82 -0
- package/dist/services/sandbox-store.js.map +1 -1
- package/dist/services/traex-user-input.d.ts +19 -0
- package/dist/services/traex-user-input.d.ts.map +1 -0
- package/dist/services/traex-user-input.js +57 -0
- package/dist/services/traex-user-input.js.map +1 -0
- package/dist/setup/open-platform-automation.d.ts +24 -3
- package/dist/setup/open-platform-automation.d.ts.map +1 -1
- package/dist/setup/open-platform-automation.js +45 -8
- package/dist/setup/open-platform-automation.js.map +1 -1
- package/dist/setup/verify-permissions.d.ts +18 -0
- package/dist/setup/verify-permissions.d.ts.map +1 -1
- package/dist/setup/verify-permissions.js +60 -0
- package/dist/setup/verify-permissions.js.map +1 -1
- package/dist/types.d.ts +83 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/child-env.d.ts +2 -2
- package/dist/utils/child-env.d.ts.map +1 -1
- package/dist/utils/child-env.js +14 -0
- package/dist/utils/child-env.js.map +1 -1
- package/dist/utils/stuck-detector.d.ts +45 -0
- package/dist/utils/stuck-detector.d.ts.map +1 -0
- package/dist/utils/stuck-detector.js +188 -0
- package/dist/utils/stuck-detector.js.map +1 -0
- package/dist/utils/stuck-key-guard.d.ts +75 -0
- package/dist/utils/stuck-key-guard.d.ts.map +1 -0
- package/dist/utils/stuck-key-guard.js +77 -0
- package/dist/utils/stuck-key-guard.js.map +1 -0
- package/dist/worker.js +1119 -588
- package/dist/worker.js.map +1 -1
- package/dist/workflows/events/payloads.d.ts +56 -0
- package/dist/workflows/events/payloads.d.ts.map +1 -1
- package/dist/workflows/events/payloads.js +9 -0
- package/dist/workflows/events/payloads.js.map +1 -1
- package/dist/workflows/events/schema.d.ts +86 -0
- package/dist/workflows/events/schema.d.ts.map +1 -1
- package/dist/workflows/shared/sandbox-policy.d.ts +10 -1
- package/dist/workflows/shared/sandbox-policy.d.ts.map +1 -1
- package/dist/workflows/shared/sandbox-policy.js +12 -0
- package/dist/workflows/shared/sandbox-policy.js.map +1 -1
- package/dist/workflows/v3/bot-resolve.d.ts.map +1 -1
- package/dist/workflows/v3/bot-resolve.js +36 -0
- package/dist/workflows/v3/bot-resolve.js.map +1 -1
- package/dist/workflows/v3/contract.d.ts +8 -0
- package/dist/workflows/v3/contract.d.ts.map +1 -1
- package/dist/workflows/v3/contract.js.map +1 -1
- package/package.json +1 -1
- package/dist/dashboard-web/chunks/bot-defaults-page-B5AY4B2J.js +0 -5
- package/dist/dashboard-web/chunks/sessions-page-2VECQ27T.js +0 -3
- package/dist/dashboard-web/chunks/settings-page-HMIUE2JA.js +0 -2
- package/dist/services/sandbox-land.d.ts +0 -45
- package/dist/services/sandbox-land.d.ts.map +0 -1
- package/dist/services/sandbox-land.js +0 -394
- package/dist/services/sandbox-land.js.map +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BotConfig } from '../bot-registry.js';
|
|
2
|
+
/**
|
|
3
|
+
* An explicit PM2 daemon may never retain a pre-bootstrap config snapshot.
|
|
4
|
+
* Re-read its original raw bots.json slot immediately before registration and
|
|
5
|
+
* reject removal, pending state, or an App ID replacement as a fatal drift.
|
|
6
|
+
*/
|
|
7
|
+
export declare function reloadExactDaemonBotConfig(index: number, originalAppId: string, loadAtIndex: (index: number) => BotConfig): BotConfig;
|
|
8
|
+
//# sourceMappingURL=daemon-config-fence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemon-config-fence.d.ts","sourceRoot":"","sources":["../../src/core/daemon-config-fence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,SAAS,GACxC,SAAS,CAMX"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An explicit PM2 daemon may never retain a pre-bootstrap config snapshot.
|
|
3
|
+
* Re-read its original raw bots.json slot immediately before registration and
|
|
4
|
+
* reject removal, pending state, or an App ID replacement as a fatal drift.
|
|
5
|
+
*/
|
|
6
|
+
export function reloadExactDaemonBotConfig(index, originalAppId, loadAtIndex) {
|
|
7
|
+
const reloaded = loadAtIndex(index);
|
|
8
|
+
if (reloaded.larkAppId !== originalAppId) {
|
|
9
|
+
throw new Error(`BOTMUX_BOT_INDEX=${index} target drifted during profile bootstrap`);
|
|
10
|
+
}
|
|
11
|
+
return reloaded;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=daemon-config-fence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemon-config-fence.js","sourceRoot":"","sources":["../../src/core/daemon-config-fence.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CACxC,KAAa,EACb,aAAqB,EACrB,WAAyC;IAEzC,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACpC,IAAI,QAAQ,CAAC,SAAS,KAAK,aAAa,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,oBAAoB,KAAK,0CAA0C,CAAC,CAAC;IACvF,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-events.d.ts","sourceRoot":"","sources":["../../src/core/dashboard-events.ts"],"names":[],"mappings":"AAGA,wDAAwD;AACxD,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAG,IAAI,EAAE;QAAE,OAAO,EAAE,GAAG,CAAA;KAAmB,CAAA;CAAE,GACtE;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAI,IAAI,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,CAAA;CAAE,GACtF;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAI,IAAI,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;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;IAAE,IAAI,EAAE,WAAW,CAAC;IAAS,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC;AAExD,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;AAEzD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,IAAI,CAAyB;IAErC,SAAS,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM,IAAI;IAKrC,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;CAQrC;AAED,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-events.js","sourceRoot":"","sources":["../../src/core/dashboard-events.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard-events.js","sourceRoot":"","sources":["../../src/core/dashboard-events.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAiB5C,MAAM,OAAO,iBAAiB;IACpB,IAAI,GAAG,IAAI,GAAG,EAAc,CAAC;IAErC,SAAS,CAAC,EAAc;QACtB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAClB,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,CAAC,KAAqB;QAC3B,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YAC3B,IAAI,CAAC;gBAAC,EAAE,CAAC,KAAK,CAAC,CAAC;YAAC,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBAC9B,+CAA+C;gBAC/C,MAAM,CAAC,KAAK,CAAC,wCAAwC,GAAG,EAAE,CAAC,CAAC;YAC9D,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAED,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { type IncomingMessage, type ServerResponse } from 'node:http';
|
|
2
|
+
import { applyExactChatGrantRequest } from '../services/exact-chat-grant.js';
|
|
3
|
+
/** Test seam: replace the exact-grant service without touching live Feishu/config state. */
|
|
4
|
+
export declare function setExactChatGrantHandler(handler: typeof applyExactChatGrantRequest | null): void;
|
|
2
5
|
export type BotRenameOutcome = {
|
|
3
6
|
ok: true;
|
|
4
7
|
name: string;
|
|
@@ -29,14 +32,30 @@ export declare function isTrustedHostIpcRequest(req: IncomingMessage): boolean;
|
|
|
29
32
|
/** Register a handler. Path supports `:name` segments captured into the params object. */
|
|
30
33
|
export declare function ipcRoute(method: string, path: string, handler: Handler): void;
|
|
31
34
|
export declare function jsonRes(res: ServerResponse, status: number, body: unknown): void;
|
|
32
|
-
export declare
|
|
35
|
+
export declare class JsonBodyTooLargeError extends Error {
|
|
36
|
+
readonly maxBytes: number;
|
|
37
|
+
constructor(maxBytes: number);
|
|
38
|
+
}
|
|
39
|
+
export declare class AbortDeadlineError extends Error {
|
|
40
|
+
readonly label: string;
|
|
41
|
+
readonly timeoutMs: number;
|
|
42
|
+
constructor(label: string, timeoutMs: number);
|
|
43
|
+
}
|
|
44
|
+
/** 校验跨进程 JSON envelope,只接受普通对象和完整、精确的自有字段集合。 */
|
|
45
|
+
export declare function hasExactSafeJsonKeys(value: unknown, expectedKeys: readonly string[]): value is Record<string, unknown>;
|
|
46
|
+
/**
|
|
47
|
+
* 为支持 AbortSignal 的底层操作设置硬截止时间。Promise.race 保证调用方按时释放
|
|
48
|
+
* in-flight 状态,AbortController 同时取消仍在执行的网络或子进程操作。
|
|
49
|
+
*/
|
|
50
|
+
export declare function runWithAbortDeadline<T>(label: string, timeoutMs: number, task: (signal: AbortSignal, deadlineAt: number) => Promise<T>): Promise<T>;
|
|
51
|
+
export declare function readJsonBody<T = unknown>(req: IncomingMessage, maxBytes?: number): Promise<T>;
|
|
33
52
|
/** Test seam: override the secret used to verify token-route HMAC. */
|
|
34
53
|
export declare function setIpcAuthSecret(secret: string | null): void;
|
|
35
54
|
/** Authenticate legacy terminal-token routes with the machine-local dashboard
|
|
36
55
|
* secret. Workflow v3 mutations intentionally use their separate, full-request
|
|
37
56
|
* protocol (`workflows/v3/daemon-ipc-auth`) and must never call this bare
|
|
38
57
|
* ts:nonce verifier. */
|
|
39
|
-
export declare function ipcHmacAuthorized(req: IncomingMessage): boolean;
|
|
58
|
+
export declare function ipcHmacAuthorized(req: IncomingMessage, bind?: string): boolean;
|
|
40
59
|
export type { SessionRow };
|
|
41
60
|
export { composeRowFromActive, composeRowFromClosed };
|
|
42
61
|
export declare function setBotName(name: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-ipc-server.d.ts","sourceRoot":"","sources":["../../src/core/dashboard-ipc-server.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,eAAe,EAAE,KAAK,cAAc,EAAe,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard-ipc-server.d.ts","sourceRoot":"","sources":["../../src/core/dashboard-ipc-server.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,eAAe,EAAE,KAAK,cAAc,EAAe,MAAM,WAAW,CAAC;AAmDjG,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AA4C7E,4FAA4F;AAC5F,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,0BAA0B,GAAG,IAAI,GAAG,IAAI,CAEhG;AAID,MAAM,MAAM,gBAAgB,GACxB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC1B;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,M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from '../services/observed-bots-store.js';
|
|
|
53
53
|
import { getDeploymentIdentity } from '../services/deployment-identity.js';
|
|
54
54
|
import { getBotUnionId } from '../services/bot-union-ids-store.js';
|
|
55
55
|
import * as grantPrefsStore from '../services/grant-prefs-store.js';
|
|
56
|
+
import { applyExactChatGrantRequest } from '../services/exact-chat-grant.js';
|
|
56
57
|
import { findConfigField, applyConfigField, coerceConfigValue } from '../services/bot-config-store.js';
|
|
57
58
|
import { globalBuiltinSkillInjectionDefault, resolveSkillInjectionSupport } from '../skills/injection-mode.js';
|
|
58
59
|
import { summaryRangeFromBotConfig, updateDashboardSummaryRange } from '../services/summary-range-store.js';
|
|
59
60
|
import { config } from '../config.js';
|
|
60
|
-
import { computeSandboxDiff, applySandboxDiff } from '../services/sandbox-land.js';
|
|
61
61
|
import { buildSafeInsightConversation, buildSafeInsightOverview, buildSafeInsightReport, buildSafeInsightTurnDetail } from '../services/insight/report.js';
|
|
62
62
|
import { readRawConfig, findEntryIndex, requireConfigPath, rmwBotEntry } from '../services/config-store.js';
|
|
63
63
|
import { setDefaultLocale, localeForBot, t } from '../i18n/index.js';
|
|
@@ -85,6 +85,11 @@ import { validateTriggerRequest } from '../services/trigger-types.js';
|
|
|
85
85
|
import { resolveCliSelection, selectionKeyForBot } from '../setup/cli-selection.js';
|
|
86
86
|
import { checkCliAvailability } from '../setup/cli-availability.js';
|
|
87
87
|
import { enrichHistorySenders } from '../dashboard/history-senders.js';
|
|
88
|
+
let exactChatGrantHandler = applyExactChatGrantRequest;
|
|
89
|
+
/** Test seam: replace the exact-grant service without touching live Feishu/config state. */
|
|
90
|
+
export function setExactChatGrantHandler(handler) {
|
|
91
|
+
exactChatGrantHandler = handler ?? applyExactChatGrantRequest;
|
|
92
|
+
}
|
|
88
93
|
let botRenamer = null;
|
|
89
94
|
export function setBotRenamer(fn) {
|
|
90
95
|
botRenamer = fn;
|
|
@@ -124,10 +129,138 @@ export function jsonRes(res, status, body) {
|
|
|
124
129
|
res.writeHead(status, { 'content-type': 'application/json' });
|
|
125
130
|
res.end(JSON.stringify(body));
|
|
126
131
|
}
|
|
127
|
-
export
|
|
132
|
+
export class JsonBodyTooLargeError extends Error {
|
|
133
|
+
maxBytes;
|
|
134
|
+
constructor(maxBytes) {
|
|
135
|
+
super(`JSON request body exceeds ${maxBytes} bytes`);
|
|
136
|
+
this.maxBytes = maxBytes;
|
|
137
|
+
this.name = 'JsonBodyTooLargeError';
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
export class AbortDeadlineError extends Error {
|
|
141
|
+
label;
|
|
142
|
+
timeoutMs;
|
|
143
|
+
constructor(label, timeoutMs) {
|
|
144
|
+
super(`${label} timed out after ${timeoutMs}ms`);
|
|
145
|
+
this.label = label;
|
|
146
|
+
this.timeoutMs = timeoutMs;
|
|
147
|
+
this.name = 'AbortDeadlineError';
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/** 校验跨进程 JSON envelope,只接受普通对象和完整、精确的自有字段集合。 */
|
|
151
|
+
export function hasExactSafeJsonKeys(value, expectedKeys) {
|
|
152
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
153
|
+
return false;
|
|
154
|
+
const prototype = Object.getPrototypeOf(value);
|
|
155
|
+
if (prototype !== Object.prototype && prototype !== null)
|
|
156
|
+
return false;
|
|
157
|
+
const keys = Object.keys(value);
|
|
158
|
+
if (keys.length !== expectedKeys.length)
|
|
159
|
+
return false;
|
|
160
|
+
if (['__proto__', 'prototype', 'constructor'].some(key => Object.hasOwn(value, key))) {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
const expected = new Set(expectedKeys);
|
|
164
|
+
return keys.every(key => expected.has(key));
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* 为支持 AbortSignal 的底层操作设置硬截止时间。Promise.race 保证调用方按时释放
|
|
168
|
+
* in-flight 状态,AbortController 同时取消仍在执行的网络或子进程操作。
|
|
169
|
+
*/
|
|
170
|
+
export async function runWithAbortDeadline(label, timeoutMs, task) {
|
|
171
|
+
if (!Number.isSafeInteger(timeoutMs) || timeoutMs <= 0) {
|
|
172
|
+
throw new RangeError('timeoutMs must be a positive safe integer');
|
|
173
|
+
}
|
|
174
|
+
const controller = new AbortController();
|
|
175
|
+
const deadlineAt = Date.now() + timeoutMs;
|
|
176
|
+
let timer;
|
|
177
|
+
const timeout = new Promise((_resolve, reject) => {
|
|
178
|
+
timer = setTimeout(() => {
|
|
179
|
+
const error = new AbortDeadlineError(label, timeoutMs);
|
|
180
|
+
controller.abort(error);
|
|
181
|
+
reject(error);
|
|
182
|
+
}, timeoutMs);
|
|
183
|
+
timer.unref?.();
|
|
184
|
+
});
|
|
185
|
+
try {
|
|
186
|
+
return await Promise.race([task(controller.signal, deadlineAt), timeout]);
|
|
187
|
+
}
|
|
188
|
+
finally {
|
|
189
|
+
if (timer)
|
|
190
|
+
clearTimeout(timer);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
export async function readJsonBody(req, maxBytes) {
|
|
194
|
+
if (maxBytes !== undefined && (!Number.isSafeInteger(maxBytes) || maxBytes <= 0)) {
|
|
195
|
+
throw new RangeError('maxBytes must be a positive safe integer');
|
|
196
|
+
}
|
|
197
|
+
if (maxBytes !== undefined) {
|
|
198
|
+
const declared = req.headers?.['content-length'];
|
|
199
|
+
const declaredBytes = typeof declared === 'string' && /^\d+$/.test(declared)
|
|
200
|
+
? Number(declared)
|
|
201
|
+
: undefined;
|
|
202
|
+
if (declaredBytes !== undefined && declaredBytes > maxBytes) {
|
|
203
|
+
req.once('error', () => { });
|
|
204
|
+
req.resume();
|
|
205
|
+
throw new JsonBodyTooLargeError(maxBytes);
|
|
206
|
+
}
|
|
207
|
+
const body = await new Promise((resolve, reject) => {
|
|
208
|
+
const chunks = [];
|
|
209
|
+
let totalBytes = 0;
|
|
210
|
+
let settled = false;
|
|
211
|
+
const cleanup = () => {
|
|
212
|
+
req.off('data', onData);
|
|
213
|
+
req.off('end', onEnd);
|
|
214
|
+
req.off('error', onError);
|
|
215
|
+
req.off('aborted', onAborted);
|
|
216
|
+
};
|
|
217
|
+
const rejectOnce = (error, drain = false) => {
|
|
218
|
+
if (settled)
|
|
219
|
+
return;
|
|
220
|
+
settled = true;
|
|
221
|
+
cleanup();
|
|
222
|
+
if (drain) {
|
|
223
|
+
// 不销毁 keep-alive socket,只丢弃剩余正文,让调用方仍能返回 413。
|
|
224
|
+
req.once('error', () => { });
|
|
225
|
+
req.resume();
|
|
226
|
+
}
|
|
227
|
+
reject(error);
|
|
228
|
+
};
|
|
229
|
+
const onData = (raw) => {
|
|
230
|
+
if (settled)
|
|
231
|
+
return;
|
|
232
|
+
const chunk = Buffer.isBuffer(raw) ? raw : Buffer.from(raw);
|
|
233
|
+
totalBytes += chunk.byteLength;
|
|
234
|
+
if (totalBytes > maxBytes) {
|
|
235
|
+
chunks.length = 0;
|
|
236
|
+
rejectOnce(new JsonBodyTooLargeError(maxBytes), true);
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
chunks.push(chunk);
|
|
240
|
+
};
|
|
241
|
+
const onEnd = () => {
|
|
242
|
+
if (settled)
|
|
243
|
+
return;
|
|
244
|
+
settled = true;
|
|
245
|
+
cleanup();
|
|
246
|
+
resolve(Buffer.concat(chunks, totalBytes));
|
|
247
|
+
};
|
|
248
|
+
const onError = (error) => rejectOnce(error);
|
|
249
|
+
const onAborted = () => rejectOnce(new Error('request aborted'));
|
|
250
|
+
req.on('data', onData);
|
|
251
|
+
req.once('end', onEnd);
|
|
252
|
+
req.once('error', onError);
|
|
253
|
+
req.once('aborted', onAborted);
|
|
254
|
+
});
|
|
255
|
+
if (body.byteLength === 0)
|
|
256
|
+
return {};
|
|
257
|
+
return JSON.parse(body.toString('utf8'));
|
|
258
|
+
}
|
|
128
259
|
const chunks = [];
|
|
129
|
-
for await (const c of req)
|
|
130
|
-
|
|
260
|
+
for await (const c of req) {
|
|
261
|
+
const chunk = Buffer.isBuffer(c) ? c : Buffer.from(c);
|
|
262
|
+
chunks.push(chunk);
|
|
263
|
+
}
|
|
131
264
|
if (chunks.length === 0)
|
|
132
265
|
return {};
|
|
133
266
|
return JSON.parse(Buffer.concat(chunks).toString('utf8'));
|
|
@@ -159,7 +292,7 @@ function ipcAuthSecret() {
|
|
|
159
292
|
* secret. Workflow v3 mutations intentionally use their separate, full-request
|
|
160
293
|
* protocol (`workflows/v3/daemon-ipc-auth`) and must never call this bare
|
|
161
294
|
* ts:nonce verifier. */
|
|
162
|
-
export function ipcHmacAuthorized(req) {
|
|
295
|
+
export function ipcHmacAuthorized(req, bind) {
|
|
163
296
|
if (trustedHostRequests.has(req))
|
|
164
297
|
return true;
|
|
165
298
|
const secret = ipcAuthSecret();
|
|
@@ -170,7 +303,10 @@ export function ipcHmacAuthorized(req) {
|
|
|
170
303
|
const sig = req.headers['x-botmux-cli-auth'];
|
|
171
304
|
if (typeof ts !== 'string' || typeof nonce !== 'string' || typeof sig !== 'string')
|
|
172
305
|
return false;
|
|
173
|
-
return verifyHmac(secret, { ts, nonce, sig }, req.socket.remoteAddress ?? '').ok;
|
|
306
|
+
return verifyHmac(secret, { ts, nonce, sig }, req.socket.remoteAddress ?? '', bind).ok;
|
|
307
|
+
}
|
|
308
|
+
function tokenRouteAuthorized(req, bind) {
|
|
309
|
+
return ipcHmacAuthorized(req, bind);
|
|
174
310
|
}
|
|
175
311
|
function routeHasPublicAccess(method, pathname) {
|
|
176
312
|
// Liveness contains no data and performs no mutation.
|
|
@@ -945,6 +1081,29 @@ ipcRoute('GET', '/api/sessions/:sessionId/write-link', (req, res, params) => {
|
|
|
945
1081
|
return jsonRes(res, 409, { ok: false, error: 'terminal_unavailable' });
|
|
946
1082
|
jsonRes(res, 200, { ok: true, url: buildTerminalUrl(ds, { write: true }) });
|
|
947
1083
|
});
|
|
1084
|
+
/**
|
|
1085
|
+
* Dashboard「复现命令」:返回该 active session 本次冷启的**近似**可复现 CLI 调用
|
|
1086
|
+
* (bin + argv + cwd + 权威注入 env),供用户粘到调试终端改参数复现。命令原样保留
|
|
1087
|
+
* (含 write token / --append-system-prompt / 凭证 env),与 write-link 同一把
|
|
1088
|
+
* loopback-HMAC 锁:匿名浏览器在 dashboard HTTP 边界就 401(该路径不在 allow-list),
|
|
1089
|
+
* 本机知道 ipcPort 的进程也过不了 ipcHmacAuthorized。仅持管理 cookie 的写权限视图能取。
|
|
1090
|
+
*
|
|
1091
|
+
* 只读 active session 的**内存**字段(DaemonSession.spawnCommand):命令含凭证,
|
|
1092
|
+
* 绝不落盘,也绝不从 closed/持久化 session 取(那既无值也避免误暴露)。daemon 重启后
|
|
1093
|
+
* 到 worker 再次 ready 之前返回 unavailable——可接受。warm reattach 不重算命令,此时
|
|
1094
|
+
* 亦为空。riff 后端无本地 bin/args,worker 侧不产出命令,这里同样 unavailable。
|
|
1095
|
+
*/
|
|
1096
|
+
ipcRoute('GET', '/api/sessions/:sessionId/spawn-command', (req, res, params) => {
|
|
1097
|
+
if (!ipcHmacAuthorized(req))
|
|
1098
|
+
return jsonRes(res, 401, { ok: false, error: 'unauthorized' });
|
|
1099
|
+
const ds = findActiveBySessionId(params.sessionId);
|
|
1100
|
+
if (!ds)
|
|
1101
|
+
return jsonRes(res, 404, { ok: false, error: 'session_not_active' });
|
|
1102
|
+
const cmd = ds.spawnCommand;
|
|
1103
|
+
if (!cmd)
|
|
1104
|
+
return jsonRes(res, 404, { ok: false, error: 'spawn_command_unavailable' });
|
|
1105
|
+
jsonRes(res, 200, { ok: true, command: cmd });
|
|
1106
|
+
});
|
|
948
1107
|
/**
|
|
949
1108
|
* Deliver the writable-terminal card privately to the bot's owner(s) — the
|
|
950
1109
|
* `botmux term-link <id>` CLI command's backend. Unlike the GET route above
|
|
@@ -974,32 +1133,6 @@ function workingDirForSession(sessionId) {
|
|
|
974
1133
|
return ds.session.workingDir;
|
|
975
1134
|
return sessionStore.listSessions().find(s => s.sessionId === sessionId)?.workingDir;
|
|
976
1135
|
}
|
|
977
|
-
ipcRoute('GET', '/api/sessions/:sessionId/sandbox-diff', (_req, res, params) => {
|
|
978
|
-
const d = computeSandboxDiff(config.session.dataDir, params.sessionId, localeForBot(cachedLarkAppId));
|
|
979
|
-
if (!d.ok)
|
|
980
|
-
return jsonRes(res, 200, { ok: false, error: d.error });
|
|
981
|
-
jsonRes(res, 200, {
|
|
982
|
-
ok: true, empty: d.empty, files: d.files, insertions: d.insertions, deletions: d.deletions,
|
|
983
|
-
statText: d.statText, patch: d.patch, workingDir: workingDirForSession(params.sessionId) ?? null,
|
|
984
|
-
});
|
|
985
|
-
});
|
|
986
|
-
ipcRoute('POST', '/api/sessions/:sessionId/sandbox-land/:action', (_req, res, params) => {
|
|
987
|
-
if (params.action === 'discard')
|
|
988
|
-
return jsonRes(res, 200, { ok: true, discarded: true });
|
|
989
|
-
if (params.action !== 'apply')
|
|
990
|
-
return jsonRes(res, 400, { ok: false, error: 'unknown action' });
|
|
991
|
-
const locLand = localeForBot(cachedLarkAppId);
|
|
992
|
-
const wd = workingDirForSession(params.sessionId);
|
|
993
|
-
if (!wd)
|
|
994
|
-
return jsonRes(res, 404, { ok: false, error: t('sandbox.workingdir_not_found', undefined, locLand) });
|
|
995
|
-
const d = computeSandboxDiff(config.session.dataDir, params.sessionId, locLand);
|
|
996
|
-
if (!d.ok)
|
|
997
|
-
return jsonRes(res, 200, { ok: false, error: d.error });
|
|
998
|
-
if (d.empty)
|
|
999
|
-
return jsonRes(res, 200, { ok: false, error: t('sandbox.no_changes_left', undefined, locLand) });
|
|
1000
|
-
const a = applySandboxDiff(wd, config.session.dataDir, params.sessionId, locLand);
|
|
1001
|
-
jsonRes(res, 200, a.ok ? { ok: true, files: d.files, insertions: d.insertions, deletions: d.deletions, workingDir: wd } : { ok: false, error: a.error });
|
|
1002
|
-
});
|
|
1003
1136
|
/**
|
|
1004
1137
|
* Reactivate a closed session — counterpart to `/close`. Used by both the
|
|
1005
1138
|
* "▶️ 恢复会话" card button (via card-handler) and the `botmux resume <id>`
|
|
@@ -1531,6 +1664,73 @@ ipcRoute('POST', '/api/trigger', async (req, res) => {
|
|
|
1531
1664
|
return jsonRes(res, 500, { ok: false, errorCode: 'trigger_failed', error: e?.message ?? String(e) });
|
|
1532
1665
|
}
|
|
1533
1666
|
});
|
|
1667
|
+
// ─── Exact chat grants (talk-only) ─────────────────────────────────────────
|
|
1668
|
+
/**
|
|
1669
|
+
* Apply/read/revoke a receiver-scoped chatGrant. The receiver identity comes
|
|
1670
|
+
* from this daemon's cached larkAppId, never from the caller. The body repeats
|
|
1671
|
+
* it only as an anti-misrouting assertion (e.g. a stale daemon descriptor).
|
|
1672
|
+
*
|
|
1673
|
+
* This permission write is loopback-HMAC protected: a sandboxed worker that
|
|
1674
|
+
* merely discovers an ipcPort must not be able to grant itself access.
|
|
1675
|
+
*/
|
|
1676
|
+
ipcRoute('POST', '/api/grants/chat', async (req, res) => {
|
|
1677
|
+
const localPort = req.socket.localPort;
|
|
1678
|
+
const authBind = localPort ? cliAuthBind('POST', '/api/grants/chat', localPort) : undefined;
|
|
1679
|
+
if (!authBind || !tokenRouteAuthorized(req, authBind)) {
|
|
1680
|
+
return jsonRes(res, 401, { ok: false, error: 'unauthorized' });
|
|
1681
|
+
}
|
|
1682
|
+
if (!cachedLarkAppId) {
|
|
1683
|
+
return jsonRes(res, 503, { ok: false, error: 'larkAppId_not_set' });
|
|
1684
|
+
}
|
|
1685
|
+
let body;
|
|
1686
|
+
try {
|
|
1687
|
+
body = await readJsonBody(req);
|
|
1688
|
+
}
|
|
1689
|
+
catch {
|
|
1690
|
+
return jsonRes(res, 400, { ok: false, error: 'bad_json' });
|
|
1691
|
+
}
|
|
1692
|
+
if (body.receiverLarkAppId !== cachedLarkAppId) {
|
|
1693
|
+
return jsonRes(res, 409, {
|
|
1694
|
+
ok: false,
|
|
1695
|
+
error: 'receiver_mismatch',
|
|
1696
|
+
receiverLarkAppId: cachedLarkAppId,
|
|
1697
|
+
});
|
|
1698
|
+
}
|
|
1699
|
+
const hasSubjectOpenIds = Object.prototype.hasOwnProperty.call(body, 'subjectOpenIds');
|
|
1700
|
+
const hasSubjectLarkAppIds = Object.prototype.hasOwnProperty.call(body, 'subjectLarkAppIds');
|
|
1701
|
+
if (hasSubjectOpenIds === hasSubjectLarkAppIds) {
|
|
1702
|
+
return jsonRes(res, 400, {
|
|
1703
|
+
ok: false,
|
|
1704
|
+
error: 'exactly_one_subject_identity_required',
|
|
1705
|
+
message: 'Provide exactly one of subjectOpenIds or subjectLarkAppIds',
|
|
1706
|
+
});
|
|
1707
|
+
}
|
|
1708
|
+
if (hasSubjectLarkAppIds && body.operation !== 'grant') {
|
|
1709
|
+
return jsonRes(res, 400, {
|
|
1710
|
+
ok: false,
|
|
1711
|
+
error: 'subject_lark_app_ids_grant_only',
|
|
1712
|
+
message: 'subjectLarkAppIds may only be used with operation=grant',
|
|
1713
|
+
});
|
|
1714
|
+
}
|
|
1715
|
+
const result = hasSubjectLarkAppIds
|
|
1716
|
+
? await exactChatGrantHandler({
|
|
1717
|
+
operation: body.operation,
|
|
1718
|
+
receiverLarkAppId: cachedLarkAppId,
|
|
1719
|
+
chatId: body.chatId,
|
|
1720
|
+
subjectLarkAppIds: body.subjectLarkAppIds,
|
|
1721
|
+
})
|
|
1722
|
+
: await exactChatGrantHandler({
|
|
1723
|
+
operation: body.operation,
|
|
1724
|
+
receiverLarkAppId: cachedLarkAppId,
|
|
1725
|
+
chatId: body.chatId,
|
|
1726
|
+
subjectOpenIds: body.subjectOpenIds,
|
|
1727
|
+
});
|
|
1728
|
+
if (!result.ok) {
|
|
1729
|
+
const { status, ...responseBody } = result;
|
|
1730
|
+
return jsonRes(res, status, responseBody);
|
|
1731
|
+
}
|
|
1732
|
+
return jsonRes(res, 200, result);
|
|
1733
|
+
});
|
|
1534
1734
|
// ─── Groups (Phase B) ──────────────────────────────────────────────────────
|
|
1535
1735
|
ipcRoute('GET', '/api/groups', async (_req, res) => {
|
|
1536
1736
|
if (!cachedLarkAppId)
|
|
@@ -2029,6 +2229,7 @@ ipcRoute('GET', '/api/bot-default-oncall', async (_req, res) => {
|
|
|
2029
2229
|
autoboundChatCount: autoboundChats.length,
|
|
2030
2230
|
brandLabel: brandStore.getBotBrandLabel(cachedLarkAppId) ?? null,
|
|
2031
2231
|
sandbox: sandboxStore.getBotSandbox(cachedLarkAppId),
|
|
2232
|
+
sandboxPaths: sandboxStore.getBotSandboxPaths(cachedLarkAppId) ?? null,
|
|
2032
2233
|
readIsolation: sandboxStore.getBotReadIsolation(cachedLarkAppId),
|
|
2033
2234
|
// Full enforceability (adapter support + no wrapperCli + macOS) — the UI
|
|
2034
2235
|
// disables the toggle wherever the worker would fail-close on it.
|
|
@@ -2777,6 +2978,31 @@ ipcRoute('PUT', '/api/bot-sandbox', async (req, res) => {
|
|
|
2777
2978
|
return jsonRes(res, 400, { ok: false, error: r.reason });
|
|
2778
2979
|
jsonRes(res, 200, { ok: true, sandbox: r.sandbox });
|
|
2779
2980
|
});
|
|
2981
|
+
// Per-bot sandboxPaths (three-tier whitelist: readWrite / readOnly / deny).
|
|
2982
|
+
// Body `{ readWrite?: string[]; readOnly?: string[]; deny?: string[] }`. Highest-
|
|
2983
|
+
// precedence layer of the FsPolicy — an empty/absent tier falls back to the
|
|
2984
|
+
// deny-by-default baseline. Passing all-empty CLEARS the field. next-session
|
|
2985
|
+
// 生效:running sessions keep their spawn-time policy, only new spawns re-read it.
|
|
2986
|
+
ipcRoute('PUT', '/api/bot-sandbox-paths', async (req, res) => {
|
|
2987
|
+
if (!cachedLarkAppId)
|
|
2988
|
+
return jsonRes(res, 503, { error: 'larkAppId_not_set' });
|
|
2989
|
+
let body;
|
|
2990
|
+
try {
|
|
2991
|
+
body = await readJsonBody(req);
|
|
2992
|
+
}
|
|
2993
|
+
catch {
|
|
2994
|
+
return jsonRes(res, 400, { ok: false, error: 'bad_json' });
|
|
2995
|
+
}
|
|
2996
|
+
const asList = (v) => Array.isArray(v) ? v.filter((x) => typeof x === 'string') : undefined;
|
|
2997
|
+
const r = await sandboxStore.updateBotSandboxPaths(cachedLarkAppId, {
|
|
2998
|
+
readWrite: asList(body.readWrite),
|
|
2999
|
+
readOnly: asList(body.readOnly),
|
|
3000
|
+
deny: asList(body.deny),
|
|
3001
|
+
});
|
|
3002
|
+
if (!r.ok)
|
|
3003
|
+
return jsonRes(res, 400, { ok: false, error: r.reason });
|
|
3004
|
+
jsonRes(res, 200, { ok: true, sandboxPaths: r.sandboxPaths ?? null });
|
|
3005
|
+
});
|
|
2780
3006
|
// Per-bot read-isolation toggle. Body `{ enabled: boolean }`. When on, this bot's
|
|
2781
3007
|
// CLI sessions run under macOS Seatbelt read-deny (siblings' creds/sessions/content
|
|
2782
3008
|
// unreadable). The macOS counterpart of the file sandbox above.
|