botmux 2.46.1 → 2.47.0
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 +5 -10
- package/README.md +5 -10
- package/dist/adapters/backend/tmux-backend.d.ts.map +1 -1
- package/dist/adapters/backend/tmux-backend.js +0 -11
- package/dist/adapters/backend/tmux-backend.js.map +1 -1
- package/dist/adapters/cli/claude-code.d.ts.map +1 -1
- package/dist/adapters/cli/claude-code.js +9 -36
- package/dist/adapters/cli/claude-code.js.map +1 -1
- package/dist/adapters/cli/coco.d.ts.map +1 -1
- package/dist/adapters/cli/coco.js +1 -26
- package/dist/adapters/cli/coco.js.map +1 -1
- package/dist/adapters/cli/codex.d.ts.map +1 -1
- package/dist/adapters/cli/codex.js +1 -6
- package/dist/adapters/cli/codex.js.map +1 -1
- package/dist/adapters/cli/cursor.d.ts.map +1 -1
- package/dist/adapters/cli/cursor.js +12 -58
- package/dist/adapters/cli/cursor.js.map +1 -1
- package/dist/adapters/cli/gemini.d.ts.map +1 -1
- package/dist/adapters/cli/gemini.js +1 -5
- package/dist/adapters/cli/gemini.js.map +1 -1
- package/dist/adapters/cli/opencode.d.ts.map +1 -1
- package/dist/adapters/cli/opencode.js +1 -19
- package/dist/adapters/cli/opencode.js.map +1 -1
- package/dist/adapters/cli/registry.d.ts +1 -5
- package/dist/adapters/cli/registry.d.ts.map +1 -1
- package/dist/adapters/cli/registry.js +2 -22
- package/dist/adapters/cli/registry.js.map +1 -1
- package/dist/adapters/cli/shared-hints.d.ts +1 -1
- package/dist/adapters/cli/shared-hints.d.ts.map +1 -1
- package/dist/adapters/cli/shared-hints.js +1 -2
- package/dist/adapters/cli/shared-hints.js.map +1 -1
- package/dist/adapters/cli/types.d.ts +2 -35
- package/dist/adapters/cli/types.d.ts.map +1 -1
- package/dist/bot-registry.d.ts +0 -59
- package/dist/bot-registry.d.ts.map +1 -1
- package/dist/bot-registry.js +0 -67
- package/dist/bot-registry.js.map +1 -1
- package/dist/cli/bots-list-output.d.ts +0 -8
- package/dist/cli/bots-list-output.d.ts.map +1 -1
- package/dist/cli/bots-list-output.js +0 -9
- package/dist/cli/bots-list-output.js.map +1 -1
- package/dist/cli.d.ts +1 -15
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +106 -603
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +2 -11
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +4 -17
- package/dist/config.js.map +1 -1
- package/dist/core/command-handler.d.ts +0 -20
- package/dist/core/command-handler.d.ts.map +1 -1
- package/dist/core/command-handler.js +313 -762
- package/dist/core/command-handler.js.map +1 -1
- package/dist/core/dashboard-ipc-server.d.ts +0 -2
- package/dist/core/dashboard-ipc-server.d.ts.map +1 -1
- package/dist/core/dashboard-ipc-server.js +2 -222
- package/dist/core/dashboard-ipc-server.js.map +1 -1
- package/dist/core/role-resolver.d.ts +1 -17
- package/dist/core/role-resolver.d.ts.map +1 -1
- package/dist/core/role-resolver.js +10 -64
- package/dist/core/role-resolver.js.map +1 -1
- package/dist/core/session-discovery.d.ts.map +1 -1
- package/dist/core/session-discovery.js +5 -19
- package/dist/core/session-discovery.js.map +1 -1
- package/dist/core/session-manager.d.ts +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +20 -37
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/types.d.ts +0 -5
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/worker-pool.d.ts +0 -141
- package/dist/core/worker-pool.d.ts.map +1 -1
- package/dist/core/worker-pool.js +24 -543
- package/dist/core/worker-pool.js.map +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +58 -213
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard/auth.d.ts +1 -6
- package/dist/dashboard/auth.d.ts.map +1 -1
- package/dist/dashboard/auth.js +1 -9
- package/dist/dashboard/auth.js.map +1 -1
- package/dist/dashboard/web/app.js +0 -8
- package/dist/dashboard/web/app.js.map +1 -1
- package/dist/dashboard/web/bot-defaults.d.ts.map +1 -1
- package/dist/dashboard/web/bot-defaults.js +21 -205
- 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 +5 -43
- package/dist/dashboard/web/i18n.js.map +1 -1
- package/dist/dashboard/web/sessions.d.ts.map +1 -1
- package/dist/dashboard/web/sessions.js +0 -4
- package/dist/dashboard/web/sessions.js.map +1 -1
- package/dist/dashboard/web/workflows.js +3 -3
- package/dist/dashboard/web/workflows.js.map +1 -1
- package/dist/dashboard/workflow-api.d.ts +1 -8
- package/dist/dashboard/workflow-api.d.ts.map +1 -1
- package/dist/dashboard/workflow-api.js +4 -19
- package/dist/dashboard/workflow-api.js.map +1 -1
- package/dist/dashboard-web/app.js +375 -539
- package/dist/dashboard-web/index.html +1 -3
- package/dist/dashboard-web/style.css +0 -22
- package/dist/dashboard.js +2 -199
- package/dist/dashboard.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +11 -104
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +11 -104
- package/dist/i18n/zh.js.map +1 -1
- package/dist/im/lark/card-builder.d.ts +3 -108
- package/dist/im/lark/card-builder.d.ts.map +1 -1
- package/dist/im/lark/card-builder.js +50 -480
- package/dist/im/lark/card-builder.js.map +1 -1
- package/dist/im/lark/card-handler.d.ts.map +1 -1
- package/dist/im/lark/card-handler.js +18 -241
- package/dist/im/lark/card-handler.js.map +1 -1
- package/dist/im/lark/client.d.ts +0 -83
- package/dist/im/lark/client.d.ts.map +1 -1
- package/dist/im/lark/client.js +70 -286
- 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 +4 -29
- package/dist/im/lark/event-dispatcher.js.map +1 -1
- package/dist/im/lark/grant-command.d.ts +1 -2
- package/dist/im/lark/grant-command.d.ts.map +1 -1
- package/dist/im/lark/grant-command.js +2 -3
- package/dist/im/lark/grant-command.js.map +1 -1
- package/dist/im/lark/identity-cache.d.ts.map +1 -1
- package/dist/im/lark/identity-cache.js +3 -3
- package/dist/im/lark/identity-cache.js.map +1 -1
- package/dist/im/lark/md-card.d.ts +2 -20
- package/dist/im/lark/md-card.d.ts.map +1 -1
- package/dist/im/lark/md-card.js +17 -49
- package/dist/im/lark/md-card.js.map +1 -1
- package/dist/im/lark/message-parser.d.ts.map +1 -1
- package/dist/im/lark/message-parser.js +31 -87
- package/dist/im/lark/message-parser.js.map +1 -1
- package/dist/im/lark/workflow-card-handler.d.ts +2 -2
- package/dist/im/lark/workflow-card-handler.d.ts.map +1 -1
- package/dist/im/lark/workflow-card-handler.js +1 -12
- package/dist/im/lark/workflow-card-handler.js.map +1 -1
- package/dist/im/lark/workflow-progress-card.d.ts.map +1 -1
- package/dist/im/lark/workflow-progress-card.js +0 -53
- package/dist/im/lark/workflow-progress-card.js.map +1 -1
- package/dist/services/codex-bridge-queue.d.ts +0 -1
- package/dist/services/codex-bridge-queue.d.ts.map +1 -1
- package/dist/services/codex-bridge-queue.js +0 -23
- package/dist/services/codex-bridge-queue.js.map +1 -1
- package/dist/services/codex-transcript.d.ts +0 -1
- package/dist/services/codex-transcript.d.ts.map +1 -1
- package/dist/services/codex-transcript.js.map +1 -1
- package/dist/services/feishu-task-client.d.ts +28 -0
- package/dist/services/feishu-task-client.d.ts.map +1 -0
- package/dist/services/feishu-task-client.js +123 -0
- package/dist/services/feishu-task-client.js.map +1 -0
- package/dist/services/grant-store.d.ts +2 -12
- package/dist/services/grant-store.d.ts.map +1 -1
- package/dist/services/grant-store.js +4 -51
- package/dist/services/grant-store.js.map +1 -1
- package/dist/services/group-creator.d.ts +0 -10
- package/dist/services/group-creator.d.ts.map +1 -1
- package/dist/services/group-creator.js +1 -26
- package/dist/services/group-creator.js.map +1 -1
- package/dist/services/groups-store.d.ts +0 -30
- package/dist/services/groups-store.d.ts.map +1 -1
- package/dist/services/groups-store.js +12 -85
- package/dist/services/groups-store.js.map +1 -1
- package/dist/services/project-scanner.d.ts +0 -10
- package/dist/services/project-scanner.d.ts.map +1 -1
- package/dist/services/project-scanner.js +0 -11
- package/dist/services/project-scanner.js.map +1 -1
- package/dist/services/session-store.js +1 -1
- package/dist/services/session-store.js.map +1 -1
- package/dist/services/task-store.d.ts +37 -0
- package/dist/services/task-store.d.ts.map +1 -0
- package/dist/services/task-store.js +115 -0
- package/dist/services/task-store.js.map +1 -0
- package/dist/setup/bot-config-editor.d.ts +1 -8
- package/dist/setup/bot-config-editor.d.ts.map +1 -1
- package/dist/setup/bot-config-editor.js +2 -20
- package/dist/setup/bot-config-editor.js.map +1 -1
- package/dist/setup/ensure-tmux.d.ts +22 -0
- package/dist/setup/ensure-tmux.d.ts.map +1 -1
- package/dist/setup/ensure-tmux.js +1 -25
- package/dist/setup/ensure-tmux.js.map +1 -1
- package/dist/setup/verify-permissions.d.ts.map +1 -1
- package/dist/setup/verify-permissions.js +1 -15
- package/dist/setup/verify-permissions.js.map +1 -1
- package/dist/skills/definitions.d.ts +0 -2
- package/dist/skills/definitions.d.ts.map +1 -1
- package/dist/skills/definitions.js +12 -178
- package/dist/skills/definitions.js.map +1 -1
- package/dist/skills/installer.d.ts +0 -34
- package/dist/skills/installer.d.ts.map +1 -1
- package/dist/skills/installer.js +2 -119
- package/dist/skills/installer.js.map +1 -1
- package/dist/types.d.ts +0 -25
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/bot-routing.d.ts +0 -50
- package/dist/utils/bot-routing.d.ts.map +1 -1
- package/dist/utils/bot-routing.js +0 -83
- package/dist/utils/bot-routing.js.map +1 -1
- package/dist/utils/user-token.d.ts.map +1 -1
- package/dist/utils/user-token.js +2 -0
- package/dist/utils/user-token.js.map +1 -1
- package/dist/worker.js +27 -198
- package/dist/worker.js.map +1 -1
- package/dist/workflows/attempt-resume.d.ts.map +1 -1
- package/dist/workflows/attempt-resume.js +2 -2
- package/dist/workflows/attempt-resume.js.map +1 -1
- package/dist/workflows/definition.d.ts +9 -412
- package/dist/workflows/definition.d.ts.map +1 -1
- package/dist/workflows/definition.js +3 -238
- package/dist/workflows/definition.js.map +1 -1
- package/dist/workflows/events/payloads.d.ts +11 -114
- package/dist/workflows/events/payloads.d.ts.map +1 -1
- package/dist/workflows/events/payloads.js +0 -46
- package/dist/workflows/events/payloads.js.map +1 -1
- package/dist/workflows/events/replay.d.ts +0 -21
- package/dist/workflows/events/replay.d.ts.map +1 -1
- package/dist/workflows/events/replay.js +0 -103
- package/dist/workflows/events/replay.js.map +1 -1
- package/dist/workflows/events/schema.d.ts +1017 -1712
- package/dist/workflows/events/schema.d.ts.map +1 -1
- package/dist/workflows/events/schema.js +1 -37
- package/dist/workflows/events/schema.js.map +1 -1
- package/dist/workflows/events/types.d.ts +1 -5
- package/dist/workflows/events/types.d.ts.map +1 -1
- package/dist/workflows/loader.d.ts +0 -14
- package/dist/workflows/loader.d.ts.map +1 -1
- package/dist/workflows/loader.js +0 -27
- package/dist/workflows/loader.js.map +1 -1
- package/dist/workflows/loop.js +0 -58
- package/dist/workflows/loop.js.map +1 -1
- package/dist/workflows/ops-projection.d.ts +0 -58
- package/dist/workflows/ops-projection.d.ts.map +1 -1
- package/dist/workflows/ops-projection.js +0 -74
- package/dist/workflows/ops-projection.js.map +1 -1
- package/dist/workflows/orchestrator.d.ts +1 -65
- package/dist/workflows/orchestrator.d.ts.map +1 -1
- package/dist/workflows/orchestrator.js +74 -486
- package/dist/workflows/orchestrator.js.map +1 -1
- package/dist/workflows/output-binding.d.ts +1 -8
- package/dist/workflows/output-binding.d.ts.map +1 -1
- package/dist/workflows/output-binding.js +11 -75
- package/dist/workflows/output-binding.js.map +1 -1
- package/dist/workflows/runtime.d.ts +1 -1
- package/dist/workflows/runtime.d.ts.map +1 -1
- package/dist/workflows/runtime.js +4 -39
- package/dist/workflows/runtime.js.map +1 -1
- package/dist/workflows/wait.d.ts +2 -23
- package/dist/workflows/wait.d.ts.map +1 -1
- package/dist/workflows/wait.js +17 -39
- package/dist/workflows/wait.js.map +1 -1
- package/package.json +1 -1
- package/dist/adapters/adopt-route.d.ts +0 -63
- package/dist/adapters/adopt-route.d.ts.map +0 -1
- package/dist/adapters/adopt-route.js +0 -195
- package/dist/adapters/adopt-route.js.map +0 -1
- package/dist/adapters/cli/codex-app.d.ts +0 -4
- package/dist/adapters/cli/codex-app.d.ts.map +0 -1
- package/dist/adapters/cli/codex-app.js +0 -72
- package/dist/adapters/cli/codex-app.js.map +0 -1
- package/dist/adapters/cli/hermes.d.ts +0 -4
- package/dist/adapters/cli/hermes.d.ts.map +0 -1
- package/dist/adapters/cli/hermes.js +0 -40
- package/dist/adapters/cli/hermes.js.map +0 -1
- package/dist/adapters/cli/mira.d.ts +0 -4
- package/dist/adapters/cli/mira.d.ts.map +0 -1
- package/dist/adapters/cli/mira.js +0 -67
- package/dist/adapters/cli/mira.js.map +0 -1
- package/dist/adapters/cli/mtr.d.ts +0 -5
- package/dist/adapters/cli/mtr.d.ts.map +0 -1
- package/dist/adapters/cli/mtr.js +0 -62
- package/dist/adapters/cli/mtr.js.map +0 -1
- package/dist/adapters/hook-command.d.ts +0 -18
- package/dist/adapters/hook-command.d.ts.map +0 -1
- package/dist/adapters/hook-command.js +0 -38
- package/dist/adapters/hook-command.js.map +0 -1
- package/dist/adapters/hook-installer.d.ts +0 -14
- package/dist/adapters/hook-installer.d.ts.map +0 -1
- package/dist/adapters/hook-installer.js +0 -192
- package/dist/adapters/hook-installer.js.map +0 -1
- package/dist/codex-app-runner.d.ts +0 -3
- package/dist/codex-app-runner.d.ts.map +0 -1
- package/dist/codex-app-runner.js +0 -512
- package/dist/codex-app-runner.js.map +0 -1
- package/dist/core/ask-api.d.ts +0 -47
- package/dist/core/ask-api.d.ts.map +0 -1
- package/dist/core/ask-api.js +0 -139
- package/dist/core/ask-api.js.map +0 -1
- package/dist/core/ask-args.d.ts +0 -53
- package/dist/core/ask-args.d.ts.map +0 -1
- package/dist/core/ask-args.js +0 -122
- package/dist/core/ask-args.js.map +0 -1
- package/dist/core/ask-broker.d.ts +0 -98
- package/dist/core/ask-broker.d.ts.map +0 -1
- package/dist/core/ask-broker.js +0 -329
- package/dist/core/ask-broker.js.map +0 -1
- package/dist/core/ask-hook/claude-code.d.ts +0 -50
- package/dist/core/ask-hook/claude-code.d.ts.map +0 -1
- package/dist/core/ask-hook/claude-code.js +0 -145
- package/dist/core/ask-hook/claude-code.js.map +0 -1
- package/dist/core/ask-hook/codex.d.ts +0 -43
- package/dist/core/ask-hook/codex.d.ts.map +0 -1
- package/dist/core/ask-hook/codex.js +0 -69
- package/dist/core/ask-hook/codex.js.map +0 -1
- package/dist/core/ask-hook/opencode.d.ts +0 -41
- package/dist/core/ask-hook/opencode.d.ts.map +0 -1
- package/dist/core/ask-hook/opencode.js +0 -108
- package/dist/core/ask-hook/opencode.js.map +0 -1
- package/dist/core/ask-hook/registry.d.ts +0 -3
- package/dist/core/ask-hook/registry.d.ts.map +0 -1
- package/dist/core/ask-hook/registry.js +0 -12
- package/dist/core/ask-hook/registry.js.map +0 -1
- package/dist/core/ask-hook/types.d.ts +0 -26
- package/dist/core/ask-hook/types.d.ts.map +0 -1
- package/dist/core/ask-hook/types.js +0 -2
- package/dist/core/ask-hook/types.js.map +0 -1
- package/dist/core/ask-types.d.ts +0 -146
- package/dist/core/ask-types.d.ts.map +0 -1
- package/dist/core/ask-types.js +0 -18
- package/dist/core/ask-types.js.map +0 -1
- package/dist/core/trigger-session.d.ts +0 -9
- package/dist/core/trigger-session.d.ts.map +0 -1
- package/dist/core/trigger-session.js +0 -158
- package/dist/core/trigger-session.js.map +0 -1
- package/dist/dashboard/connector-api.d.ts +0 -3
- package/dist/dashboard/connector-api.d.ts.map +0 -1
- package/dist/dashboard/connector-api.js +0 -351
- package/dist/dashboard/connector-api.js.map +0 -1
- package/dist/dashboard/federated-group-core.d.ts +0 -54
- package/dist/dashboard/federated-group-core.d.ts.map +0 -1
- package/dist/dashboard/federated-group-core.js +0 -165
- package/dist/dashboard/federated-group-core.js.map +0 -1
- package/dist/dashboard/federation-api.d.ts +0 -42
- package/dist/dashboard/federation-api.d.ts.map +0 -1
- package/dist/dashboard/federation-api.js +0 -408
- package/dist/dashboard/federation-api.js.map +0 -1
- package/dist/dashboard/federation-spoke-api.d.ts +0 -76
- package/dist/dashboard/federation-spoke-api.d.ts.map +0 -1
- package/dist/dashboard/federation-spoke-api.js +0 -618
- package/dist/dashboard/federation-spoke-api.js.map +0 -1
- package/dist/dashboard/team-group.d.ts +0 -18
- package/dist/dashboard/team-group.d.ts.map +0 -1
- package/dist/dashboard/team-group.js +0 -7
- package/dist/dashboard/team-group.js.map +0 -1
- package/dist/dashboard/trigger-api.d.ts +0 -13
- package/dist/dashboard/trigger-api.d.ts.map +0 -1
- package/dist/dashboard/trigger-api.js +0 -77
- package/dist/dashboard/trigger-api.js.map +0 -1
- package/dist/dashboard/web/connectors.d.ts +0 -2
- package/dist/dashboard/web/connectors.d.ts.map +0 -1
- package/dist/dashboard/web/connectors.js +0 -187
- package/dist/dashboard/web/connectors.js.map +0 -1
- package/dist/dashboard/web/team-federation.d.ts +0 -3
- package/dist/dashboard/web/team-federation.d.ts.map +0 -1
- package/dist/dashboard/web/team-federation.js +0 -487
- package/dist/dashboard/web/team-federation.js.map +0 -1
- package/dist/dashboard/webhook-routes.d.ts +0 -19
- package/dist/dashboard/webhook-routes.d.ts.map +0 -1
- package/dist/dashboard/webhook-routes.js +0 -321
- package/dist/dashboard/webhook-routes.js.map +0 -1
- package/dist/im/lark/ask-card.d.ts +0 -55
- package/dist/im/lark/ask-card.d.ts.map +0 -1
- package/dist/im/lark/ask-card.js +0 -328
- package/dist/im/lark/ask-card.js.map +0 -1
- package/dist/mira-output.d.ts +0 -3
- package/dist/mira-output.d.ts.map +0 -1
- package/dist/mira-output.js +0 -136
- package/dist/mira-output.js.map +0 -1
- package/dist/mira-runner.d.ts +0 -3
- package/dist/mira-runner.d.ts.map +0 -1
- package/dist/mira-runner.js +0 -534
- package/dist/mira-runner.js.map +0 -1
- package/dist/services/bot-owner-store.d.ts +0 -28
- package/dist/services/bot-owner-store.d.ts.map +0 -1
- package/dist/services/bot-owner-store.js +0 -82
- package/dist/services/bot-owner-store.js.map +0 -1
- package/dist/services/bot-profile-store.d.ts +0 -16
- package/dist/services/bot-profile-store.d.ts.map +0 -1
- package/dist/services/bot-profile-store.js +0 -98
- package/dist/services/bot-profile-store.js.map +0 -1
- package/dist/services/brand-store.d.ts +0 -15
- package/dist/services/brand-store.d.ts.map +0 -1
- package/dist/services/brand-store.js +0 -47
- package/dist/services/brand-store.js.map +0 -1
- package/dist/services/card-prefs-store.d.ts +0 -20
- package/dist/services/card-prefs-store.d.ts.map +0 -1
- package/dist/services/card-prefs-store.js +0 -82
- package/dist/services/card-prefs-store.js.map +0 -1
- package/dist/services/connector-store.d.ts +0 -58
- package/dist/services/connector-store.d.ts.map +0 -1
- package/dist/services/connector-store.js +0 -79
- package/dist/services/connector-store.js.map +0 -1
- package/dist/services/deployment-identity.d.ts +0 -22
- package/dist/services/deployment-identity.d.ts.map +0 -1
- package/dist/services/deployment-identity.js +0 -67
- package/dist/services/deployment-identity.js.map +0 -1
- package/dist/services/federation-membership-store.d.ts +0 -23
- package/dist/services/federation-membership-store.d.ts.map +0 -1
- package/dist/services/federation-membership-store.js +0 -66
- package/dist/services/federation-membership-store.js.map +0 -1
- package/dist/services/federation-roster.d.ts +0 -54
- package/dist/services/federation-roster.d.ts.map +0 -1
- package/dist/services/federation-roster.js +0 -51
- package/dist/services/federation-roster.js.map +0 -1
- package/dist/services/federation-store.d.ts +0 -76
- package/dist/services/federation-store.d.ts.map +0 -1
- package/dist/services/federation-store.js +0 -133
- package/dist/services/federation-store.js.map +0 -1
- package/dist/services/hermes-transcript.d.ts +0 -7
- package/dist/services/hermes-transcript.d.ts.map +0 -1
- package/dist/services/hermes-transcript.js +0 -117
- package/dist/services/hermes-transcript.js.map +0 -1
- package/dist/services/invite-store.d.ts +0 -28
- package/dist/services/invite-store.d.ts.map +0 -1
- package/dist/services/invite-store.js +0 -85
- package/dist/services/invite-store.js.map +0 -1
- package/dist/services/pairing-store.d.ts +0 -47
- package/dist/services/pairing-store.d.ts.map +0 -1
- package/dist/services/pairing-store.js +0 -132
- package/dist/services/pairing-store.js.map +0 -1
- package/dist/services/relay-picker.d.ts +0 -22
- package/dist/services/relay-picker.d.ts.map +0 -1
- package/dist/services/relay-picker.js +0 -62
- package/dist/services/relay-picker.js.map +0 -1
- package/dist/services/send-policy.d.ts +0 -55
- package/dist/services/send-policy.d.ts.map +0 -1
- package/dist/services/send-policy.js +0 -47
- package/dist/services/send-policy.js.map +0 -1
- package/dist/services/team-roster.d.ts +0 -38
- package/dist/services/team-roster.d.ts.map +0 -1
- package/dist/services/team-roster.js +0 -82
- package/dist/services/team-roster.js.map +0 -1
- package/dist/services/team-store.d.ts +0 -54
- package/dist/services/team-store.d.ts.map +0 -1
- package/dist/services/team-store.js +0 -156
- package/dist/services/team-store.js.map +0 -1
- package/dist/services/trigger-log-store.d.ts +0 -46
- package/dist/services/trigger-log-store.d.ts.map +0 -1
- package/dist/services/trigger-log-store.js +0 -132
- package/dist/services/trigger-log-store.js.map +0 -1
- package/dist/services/trigger-types.d.ts +0 -57
- package/dist/services/trigger-types.d.ts.map +0 -1
- package/dist/services/trigger-types.js +0 -28
- package/dist/services/trigger-types.js.map +0 -1
- package/dist/services/webhook-key.d.ts +0 -16
- package/dist/services/webhook-key.d.ts.map +0 -1
- package/dist/services/webhook-key.js +0 -123
- package/dist/services/webhook-key.js.map +0 -1
- package/dist/services/webhook-lifecycle-extractors.d.ts +0 -15
- package/dist/services/webhook-lifecycle-extractors.d.ts.map +0 -1
- package/dist/services/webhook-lifecycle-extractors.js +0 -59
- package/dist/services/webhook-lifecycle-extractors.js.map +0 -1
- package/dist/services/webhook-lifecycle-store.d.ts +0 -45
- package/dist/services/webhook-lifecycle-store.d.ts.map +0 -1
- package/dist/services/webhook-lifecycle-store.js +0 -159
- package/dist/services/webhook-lifecycle-store.js.map +0 -1
- package/dist/utils/daemon-discovery.d.ts +0 -11
- package/dist/utils/daemon-discovery.d.ts.map +0 -1
- package/dist/utils/daemon-discovery.js +0 -59
- package/dist/utils/daemon-discovery.js.map +0 -1
- package/dist/workflows/trigger-from-envelope.d.ts +0 -13
- package/dist/workflows/trigger-from-envelope.d.ts.map +0 -1
- package/dist/workflows/trigger-from-envelope.js +0 -67
- package/dist/workflows/trigger-from-envelope.js.map +0 -1
package/dist/worker.js
CHANGED
|
@@ -22,7 +22,6 @@ import { shouldRunQuietRotation, evaluatePidResolverPullback, decideFingerprintS
|
|
|
22
22
|
import { CodexBridgeQueue } from './services/codex-bridge-queue.js';
|
|
23
23
|
import { drainCodexRollout, findCodexRolloutBySessionId, findCodexRolloutByPid, splitCodexEventsByCutoff, extractLastCodexTurn } from './services/codex-transcript.js';
|
|
24
24
|
import { cocoEventsPathForSession, drainCocoEvents, findCocoSessionByPid } from './services/coco-transcript.js';
|
|
25
|
-
import { currentHermesStateOffset, drainHermesStateDb } from './services/hermes-transcript.js';
|
|
26
25
|
import { baselineJsonlCursor } from './services/jsonl-cursor.js';
|
|
27
26
|
import { dirname } from 'node:path';
|
|
28
27
|
import { createServer as createHttpServer } from 'node:http';
|
|
@@ -64,7 +63,7 @@ const clientPtys = new Map();
|
|
|
64
63
|
const writeToken = randomBytes(16).toString('hex');
|
|
65
64
|
let sessionId = '';
|
|
66
65
|
let lastInitConfig = null;
|
|
67
|
-
const CLI_DISPLAY_NAMES = { 'claude-code': 'Claude', aiden: 'Aiden', coco: 'CoCo', codex: 'Codex',
|
|
66
|
+
const CLI_DISPLAY_NAMES = { 'claude-code': 'Claude', aiden: 'Aiden', coco: 'CoCo', codex: 'Codex', cursor: 'Cursor', gemini: 'Gemini', opencode: 'OpenCode', antigravity: 'Antigravity' };
|
|
68
67
|
function cliName() { return CLI_DISPLAY_NAMES[lastInitConfig?.cliId ?? ''] ?? 'CLI'; }
|
|
69
68
|
let isPromptReady = false;
|
|
70
69
|
/** Mutex for async flushPending — prevents concurrent flush loops. */
|
|
@@ -200,8 +199,6 @@ let codexBridgeBaselineDone = false;
|
|
|
200
199
|
const codexBridgeQueue = new CodexBridgeQueue();
|
|
201
200
|
let codexBridgeWatcher = null;
|
|
202
201
|
let codexBridgeTimer = null;
|
|
203
|
-
let hermesBridgeOffset = 0;
|
|
204
|
-
let hermesBridgeBaselineDone = false;
|
|
205
202
|
/** Codex sessionId we received via writeInput but haven't yet resolved a
|
|
206
203
|
* rollout file for. The poller keeps retrying — the file appears on
|
|
207
204
|
* Codex's first user submit, but with some race delay after our submit
|
|
@@ -265,11 +262,6 @@ function formatHeadlessLocalTurnContent(assistantText) {
|
|
|
265
262
|
// needed. Append-only over a shared file (instead of a per-turn marker) is
|
|
266
263
|
// type-ahead safe: type-ahead'd turns each have their own [markTimeMs,
|
|
267
264
|
// nextTurn.markTimeMs) window, and a stray send only fills its own bucket.
|
|
268
|
-
// This relies on each turn's markTimeMs reflecting when it ACTUALLY started
|
|
269
|
-
// processing, not when the worker marked it — the structured queue overrides
|
|
270
|
-
// markTimeMs to the dequeue-time transcript event (CodexBridgeQueue.ingest)
|
|
271
|
-
// and emitReadyCodexTurns only treats a STARTED next turn as a boundary, so
|
|
272
|
-
// the early back-to-back marks type-ahead produces don't collapse the windows.
|
|
273
265
|
function bridgeMarkerPath() {
|
|
274
266
|
if (!process.env.SESSION_DATA_DIR || !sessionId)
|
|
275
267
|
return undefined;
|
|
@@ -1331,23 +1323,18 @@ function drainPathInto(path, fromOffset) {
|
|
|
1331
1323
|
// shared with the Claude path.
|
|
1332
1324
|
function codexBridgeFallbackActive() {
|
|
1333
1325
|
// True for transcript-backed CLIs whose final output can be harvested
|
|
1334
|
-
// when the model forgets to call `botmux send`.
|
|
1335
|
-
|
|
1326
|
+
// from append-only JSONL when the model forgets to call `botmux send`.
|
|
1327
|
+
// Codex uses ~/.codex rollouts; CoCo uses ~/.cache/coco events. Both
|
|
1328
|
+
// work in adopt mode now that CoCo's PID→sessionId discovery is wired.
|
|
1329
|
+
return lastInitConfig?.cliId === 'codex' || lastInitConfig?.cliId === 'coco';
|
|
1336
1330
|
}
|
|
1337
1331
|
function structuredBridgeIsCodex() {
|
|
1338
1332
|
return lastInitConfig?.cliId === 'codex';
|
|
1339
1333
|
}
|
|
1340
|
-
function structuredBridgeIsHermes() {
|
|
1341
|
-
return lastInitConfig?.cliId === 'hermes';
|
|
1342
|
-
}
|
|
1343
1334
|
function structuredBridgeIngestPath(path, offset) {
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
const result = drainHermesStateDb(offset);
|
|
1348
|
-
return { events: result.events, newOffset: result.newOffset, pendingTail: '' };
|
|
1349
|
-
}
|
|
1350
|
-
return drainCocoEvents(path, offset);
|
|
1335
|
+
return structuredBridgeIsCodex()
|
|
1336
|
+
? drainCodexRollout(path, offset)
|
|
1337
|
+
: drainCocoEvents(path, offset);
|
|
1351
1338
|
}
|
|
1352
1339
|
function codexBridgeStartTimer() {
|
|
1353
1340
|
if (codexBridgeTimer)
|
|
@@ -1365,14 +1352,6 @@ function codexBridgeStartTimer() {
|
|
|
1365
1352
|
// publish a half-streamed response.
|
|
1366
1353
|
codexBridgeTimer = setInterval(() => {
|
|
1367
1354
|
try {
|
|
1368
|
-
if (structuredBridgeIsHermes()) {
|
|
1369
|
-
if (!hermesBridgeBaselineDone)
|
|
1370
|
-
hermesBridgeAttach(lastInitConfig?.resume ? 'baseline-existing' : 'fresh-empty');
|
|
1371
|
-
hermesBridgeIngest();
|
|
1372
|
-
if (isPromptReady)
|
|
1373
|
-
emitReadyCodexTurns();
|
|
1374
|
-
return;
|
|
1375
|
-
}
|
|
1376
1355
|
if (!codexBridgeRolloutPath) {
|
|
1377
1356
|
// Two discovery paths, in order: cliSessionId (known via writeInput
|
|
1378
1357
|
// result for non-adopt or daemon-side probe for adopt) → exact
|
|
@@ -1426,22 +1405,6 @@ function codexBridgeStartTimer() {
|
|
|
1426
1405
|
}
|
|
1427
1406
|
}, 1000);
|
|
1428
1407
|
}
|
|
1429
|
-
function hermesBridgeAttach(mode) {
|
|
1430
|
-
hermesBridgeOffset = currentHermesStateOffset();
|
|
1431
|
-
hermesBridgeBaselineDone = true;
|
|
1432
|
-
log(`Hermes bridge ${mode}: state.db offset=${hermesBridgeOffset}`);
|
|
1433
|
-
codexBridgeStartTimer();
|
|
1434
|
-
}
|
|
1435
|
-
function hermesBridgeIngest() {
|
|
1436
|
-
if (!hermesBridgeBaselineDone)
|
|
1437
|
-
return;
|
|
1438
|
-
const result = drainHermesStateDb(hermesBridgeOffset);
|
|
1439
|
-
hermesBridgeOffset = result.newOffset;
|
|
1440
|
-
codexBridgeQueue.ingest(result.events);
|
|
1441
|
-
if (result.events.some(e => e.kind === 'assistant_final')) {
|
|
1442
|
-
idleDetector?.fireIdle();
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
1408
|
function codexBridgeAttach(rolloutPath, mode) {
|
|
1446
1409
|
codexBridgeRolloutPath = rolloutPath;
|
|
1447
1410
|
if (mode === 'fresh-empty') {
|
|
@@ -1536,10 +1499,6 @@ function codexBridgeNotifyCliSessionId(cliSessionId) {
|
|
|
1536
1499
|
}
|
|
1537
1500
|
}
|
|
1538
1501
|
function codexBridgeIngest() {
|
|
1539
|
-
if (structuredBridgeIsHermes()) {
|
|
1540
|
-
hermesBridgeIngest();
|
|
1541
|
-
return;
|
|
1542
|
-
}
|
|
1543
1502
|
if (!codexBridgeRolloutPath || !codexBridgeBaselineDone)
|
|
1544
1503
|
return;
|
|
1545
1504
|
const result = structuredBridgeIngestPath(codexBridgeRolloutPath, codexBridgeOffset);
|
|
@@ -1569,7 +1528,7 @@ function codexBridgeMarkPendingTurn(messageText) {
|
|
|
1569
1528
|
function codexBridgeDrainAndMaybeEmit() {
|
|
1570
1529
|
if (!codexBridgeFallbackActive())
|
|
1571
1530
|
return;
|
|
1572
|
-
if (
|
|
1531
|
+
if (codexBridgeRolloutPath && codexBridgeBaselineDone) {
|
|
1573
1532
|
try {
|
|
1574
1533
|
codexBridgeIngest();
|
|
1575
1534
|
}
|
|
@@ -1589,17 +1548,7 @@ function emitReadyCodexTurns() {
|
|
|
1589
1548
|
// should reach the thread. Skip marker IO entirely.
|
|
1590
1549
|
const markers = adoptMode ? [] : readSendMarkers();
|
|
1591
1550
|
const remaining = codexBridgeQueue.peek();
|
|
1592
|
-
|
|
1593
|
-
// An unstarted turn hasn't been dequeued yet (its user event hasn't landed),
|
|
1594
|
-
// so it has produced no sends to leak backwards — and under type-ahead its
|
|
1595
|
-
// markTimeMs is still the early flush-time mark, which would prematurely
|
|
1596
|
-
// (often invalidly, lower>upper) close the ready turn's window and let its
|
|
1597
|
-
// own send escape suppression → duplicate. A started-but-not-final turn
|
|
1598
|
-
// (model mid-tool-use for N+1) keeps its real overridden markTimeMs as the
|
|
1599
|
-
// boundary, preserving the original leak guard.
|
|
1600
|
-
const nextPendingMarkTimeMs = remaining.length > 0 && remaining[0].started
|
|
1601
|
-
? remaining[0].markTimeMs
|
|
1602
|
-
: undefined;
|
|
1551
|
+
const nextPendingMarkTimeMs = remaining.length > 0 ? remaining[0].markTimeMs : undefined;
|
|
1603
1552
|
for (let i = 0; i < ready.length; i++) {
|
|
1604
1553
|
const turn = ready[i];
|
|
1605
1554
|
if (!turn.finalText)
|
|
@@ -1646,8 +1595,6 @@ function stopCodexBridge() {
|
|
|
1646
1595
|
codexBridgeOffset = 0;
|
|
1647
1596
|
codexBridgePendingTail = '';
|
|
1648
1597
|
codexBridgeBaselineDone = false;
|
|
1649
|
-
hermesBridgeOffset = 0;
|
|
1650
|
-
hermesBridgeBaselineDone = false;
|
|
1651
1598
|
codexBridgeQueue.clearPending();
|
|
1652
1599
|
codexBridgeQueue.setLocalTurns(false);
|
|
1653
1600
|
codexBridgePendingSessionId = undefined;
|
|
@@ -2179,88 +2126,8 @@ async function handleTuiTextInput(keys, text) {
|
|
|
2179
2126
|
// in a single PTY chunk)
|
|
2180
2127
|
const TRUST_DIALOG_PATTERN = /Yes, I trust this folder|Yes, continue/;
|
|
2181
2128
|
let trustHandled = false;
|
|
2182
|
-
// Codex App runner sends botmux control messages as OSC sequences so they do
|
|
2183
|
-
// not pollute the visible terminal. Strip them before xterm rendering and
|
|
2184
|
-
// translate them back into worker IPC.
|
|
2185
|
-
const CODEX_APP_OSC_PREFIX = '\x1b]777;botmux:';
|
|
2186
|
-
const APP_RUNNER_OSC_CLI_IDS = new Set(['codex-app', 'mira']);
|
|
2187
|
-
let codexAppOscPending = '';
|
|
2188
|
-
function decodeCodexAppPayload(payload) {
|
|
2189
|
-
try {
|
|
2190
|
-
return JSON.parse(Buffer.from(payload, 'base64').toString('utf8'));
|
|
2191
|
-
}
|
|
2192
|
-
catch {
|
|
2193
|
-
return undefined;
|
|
2194
|
-
}
|
|
2195
|
-
}
|
|
2196
|
-
function handleCodexAppMarker(body) {
|
|
2197
|
-
const sep = body.indexOf(':');
|
|
2198
|
-
if (sep < 0)
|
|
2199
|
-
return;
|
|
2200
|
-
const kind = body.slice(0, sep);
|
|
2201
|
-
const payload = decodeCodexAppPayload(body.slice(sep + 1));
|
|
2202
|
-
if (!payload || typeof payload !== 'object')
|
|
2203
|
-
return;
|
|
2204
|
-
if (kind === 'thread' && typeof payload.threadId === 'string') {
|
|
2205
|
-
persistCliSessionId(payload.threadId);
|
|
2206
|
-
return;
|
|
2207
|
-
}
|
|
2208
|
-
if (kind === 'final' && typeof payload.content === 'string') {
|
|
2209
|
-
const startedAtMs = typeof payload.startedAtMs === 'number' ? payload.startedAtMs : undefined;
|
|
2210
|
-
const completedAtMs = typeof payload.completedAtMs === 'number' ? payload.completedAtMs : Date.now();
|
|
2211
|
-
if (startedAtMs !== undefined) {
|
|
2212
|
-
const sentByModel = readSendMarkers().some(m => m.sentAtMs >= startedAtMs && m.sentAtMs <= completedAtMs + 5_000);
|
|
2213
|
-
if (sentByModel) {
|
|
2214
|
-
log(`${cliName()} final_output suppressed (model already called botmux send)`);
|
|
2215
|
-
return;
|
|
2216
|
-
}
|
|
2217
|
-
}
|
|
2218
|
-
const turnId = typeof payload.turnId === 'string' ? payload.turnId : `${lastInitConfig?.cliId ?? 'app'}-${Date.now()}`;
|
|
2219
|
-
send({
|
|
2220
|
-
type: 'final_output',
|
|
2221
|
-
content: payload.content,
|
|
2222
|
-
lastUuid: turnId,
|
|
2223
|
-
turnId,
|
|
2224
|
-
});
|
|
2225
|
-
}
|
|
2226
|
-
}
|
|
2227
|
-
function splitCodexAppControl(data) {
|
|
2228
|
-
if (!APP_RUNNER_OSC_CLI_IDS.has(lastInitConfig?.cliId ?? '') && codexAppOscPending.length === 0)
|
|
2229
|
-
return data;
|
|
2230
|
-
const input = codexAppOscPending + data;
|
|
2231
|
-
codexAppOscPending = '';
|
|
2232
|
-
let out = '';
|
|
2233
|
-
let cursor = 0;
|
|
2234
|
-
for (;;) {
|
|
2235
|
-
const start = input.indexOf(CODEX_APP_OSC_PREFIX, cursor);
|
|
2236
|
-
if (start < 0) {
|
|
2237
|
-
let tailStart = input.length;
|
|
2238
|
-
const tail = input.slice(cursor);
|
|
2239
|
-
for (let n = Math.min(CODEX_APP_OSC_PREFIX.length - 1, tail.length); n > 0; n--) {
|
|
2240
|
-
if (CODEX_APP_OSC_PREFIX.startsWith(tail.slice(tail.length - n))) {
|
|
2241
|
-
tailStart = input.length - n;
|
|
2242
|
-
break;
|
|
2243
|
-
}
|
|
2244
|
-
}
|
|
2245
|
-
out += input.slice(cursor, tailStart);
|
|
2246
|
-
codexAppOscPending = input.slice(tailStart);
|
|
2247
|
-
return out;
|
|
2248
|
-
}
|
|
2249
|
-
out += input.slice(cursor, start);
|
|
2250
|
-
const end = input.indexOf('\x07', start + CODEX_APP_OSC_PREFIX.length);
|
|
2251
|
-
if (end < 0) {
|
|
2252
|
-
codexAppOscPending = input.slice(start);
|
|
2253
|
-
return out;
|
|
2254
|
-
}
|
|
2255
|
-
handleCodexAppMarker(input.slice(start + CODEX_APP_OSC_PREFIX.length, end));
|
|
2256
|
-
cursor = end + 1;
|
|
2257
|
-
}
|
|
2258
|
-
}
|
|
2259
2129
|
// ─── Prompt Detection ────────────────────────────────────────────────────────
|
|
2260
2130
|
function onPtyData(data) {
|
|
2261
|
-
data = splitCodexAppControl(data);
|
|
2262
|
-
if (data.length === 0)
|
|
2263
|
-
return;
|
|
2264
2131
|
captureWorkflowTranscript(data);
|
|
2265
2132
|
renderer?.write(data);
|
|
2266
2133
|
// In tmux-attach mode, each web client has its own tmux attach PTY —
|
|
@@ -2446,23 +2313,10 @@ async function flushPending() {
|
|
|
2446
2313
|
// Lark message. Now that the queue handles queued_command identically to
|
|
2447
2314
|
// role:user (and overrides markTimeMs to the dequeue-time event timestamp
|
|
2448
2315
|
// so the gate window is correct), Claude bridge can run with type-ahead
|
|
2449
|
-
// again.
|
|
2450
|
-
//
|
|
2451
|
-
// CoCo (0.120.32+) also tolerates type-ahead, but for a different reason
|
|
2452
|
-
// than Claude: it parks a submit-while-busy message in its own TUI queue
|
|
2453
|
-
// ("↑ Press up to edit queued messages") and only writes the user event to
|
|
2454
|
-
// events.jsonl when it DEQUEUES and starts processing it — i.e. AFTER the
|
|
2455
|
-
// previous turn's assistant_final. So the transcript stays strictly
|
|
2456
|
-
// interleaved (user1 → asst1 → user2 → asst2) and CodexBridgeQueue's
|
|
2457
|
-
// single-`collecting` attribution stays correct without the queued_command
|
|
2458
|
-
// upgrade Claude needed. (The submit log history.jsonl, which the adapter's
|
|
2459
|
-
// writeInput verification polls, IS written at submit time even for a queued
|
|
2460
|
-
// message, so verification doesn't spuriously fail either.) Only the Codex
|
|
2461
|
-
// rollout bridge stays serial — its queue hasn't been validated for the
|
|
2462
|
-
// back-to-back user_message ordering that type-ahead can produce there.
|
|
2316
|
+
// again. Codex bridge stays serial because its queue hasn't been upgraded.
|
|
2463
2317
|
const claudeBridgeActive = !!bridgeJsonlPath && !lastInitConfig?.adoptMode;
|
|
2464
2318
|
const codexBridgeActive = codexBridgeFallbackActive();
|
|
2465
|
-
const typeAheadAllowed = cliAdapter.supportsTypeAhead && !
|
|
2319
|
+
const typeAheadAllowed = cliAdapter.supportsTypeAhead && !codexBridgeActive;
|
|
2466
2320
|
if (!isPromptReady && !typeAheadAllowed)
|
|
2467
2321
|
return;
|
|
2468
2322
|
isFlushing = true;
|
|
@@ -2535,18 +2389,16 @@ async function flushPending() {
|
|
|
2535
2389
|
if (result && result.submitted === false && backend) {
|
|
2536
2390
|
scheduleSubmitFailureNotify(msg, result.recheck, '会话 JSONL', bridgeTurnId, result.failureReason, turnSeq);
|
|
2537
2391
|
}
|
|
2538
|
-
// Codex
|
|
2539
|
-
//
|
|
2540
|
-
//
|
|
2392
|
+
// Codex bridge: stop after one writeInput per idle cycle. Codex's
|
|
2393
|
+
// bridge queue doesn't yet attribute queued_command-equivalents, so
|
|
2394
|
+
// type-ahead'd submits would have their assistant text dropped or
|
|
2541
2395
|
// mis-attributed. We resume on the next idle, by which point Codex
|
|
2542
2396
|
// has finished and the next message can be a normal user_message
|
|
2543
|
-
// submit. Claude bridge
|
|
2397
|
+
// submit. Claude bridge no longer takes this break — its
|
|
2544
2398
|
// BridgeTurnQueue handles `attachment(queued_command)` events
|
|
2545
|
-
// identically to `role:user`,
|
|
2546
|
-
//
|
|
2547
|
-
|
|
2548
|
-
// WANT CoCo to drain all pending here so they land in its TUI queue.
|
|
2549
|
-
if (structuredBridgeIsCodex() && pendingMessages.length > 0)
|
|
2399
|
+
// identically to `role:user`, so type-ahead'd turns are correctly
|
|
2400
|
+
// attributed and no longer need the serial-per-idle guard.
|
|
2401
|
+
if (codexBridgeActive && pendingMessages.length > 0)
|
|
2550
2402
|
break;
|
|
2551
2403
|
}
|
|
2552
2404
|
}
|
|
@@ -2571,12 +2423,12 @@ function sendToPty(content) {
|
|
|
2571
2423
|
// Tear down the prompt card so the user doesn't see stale options.
|
|
2572
2424
|
send({ type: 'tui_prompt_resolved', selectedText: 'user-override' });
|
|
2573
2425
|
}
|
|
2574
|
-
// See flushPending: only
|
|
2575
|
-
//
|
|
2576
|
-
// identically to `role:user`,
|
|
2577
|
-
//
|
|
2578
|
-
|
|
2579
|
-
const typeAheadAllowed = cliAdapter.supportsTypeAhead && !
|
|
2426
|
+
// See flushPending: only Codex bridge still serialises type-ahead.
|
|
2427
|
+
// Claude bridge now attributes `attachment(queued_command)` events
|
|
2428
|
+
// identically to `role:user`, so type-ahead'd submits land in the right
|
|
2429
|
+
// turn and we no longer need to gate the entry path on claudeBridgeActive.
|
|
2430
|
+
const codexBridgeActive = codexBridgeFallbackActive();
|
|
2431
|
+
const typeAheadAllowed = cliAdapter.supportsTypeAhead && !codexBridgeActive;
|
|
2580
2432
|
if (isPromptReady || isFlushing || typeAheadAllowed) {
|
|
2581
2433
|
log(`Writing to PTY: "${content.substring(0, 80)}"`);
|
|
2582
2434
|
flushPending(); // fire-and-forget async; no-op if already flushing
|
|
@@ -2857,7 +2709,6 @@ function spawnCli(cfg) {
|
|
|
2857
2709
|
botName: cfg.botName,
|
|
2858
2710
|
botOpenId: cfg.botOpenId,
|
|
2859
2711
|
locale: cfg.locale,
|
|
2860
|
-
model: cfg.model,
|
|
2861
2712
|
});
|
|
2862
2713
|
// Extra args from env (CLI_DISABLE_DEFAULT_ARGS is removed — adapters own their defaults)
|
|
2863
2714
|
const extra = (process.env.CLI_EXTRA_ARGS ?? '').trim();
|
|
@@ -2872,15 +2723,6 @@ function spawnCli(cfg) {
|
|
|
2872
2723
|
if (injectClaudeSandbox) {
|
|
2873
2724
|
log('Detected root user — injecting IS_SANDBOX=1 for Claude Code');
|
|
2874
2725
|
}
|
|
2875
|
-
// Claude Code 2.1.x:`--resume` 一个「空闲 >70min 且累计 >10 万 token」的会话会弹
|
|
2876
|
-
// 交互式菜单(Resume from summary / full / Don't ask again),botmux 无法导航 →
|
|
2877
|
-
// 进程卡死(issue #62)。把 token 阈值顶到极大让触发门永远命中 `tokens < threshold`
|
|
2878
|
-
// 而 return null → 菜单不弹、按 full session 原样续(走 summary 会触发 /compact,
|
|
2879
|
-
// 破坏 bridge 的会话连续性追踪)。用户显式设了就尊重。注意:该 key 必须同时进
|
|
2880
|
-
// BOTMUX_INJECTED_ENV_KEYS 白名单,否则 tmux backend 不会把它透传进 pane。
|
|
2881
|
-
const claudeResumeTokenThreshold = cfg.cliId === 'claude-code'
|
|
2882
|
-
? process.env.CLAUDE_CODE_RESUME_TOKEN_THRESHOLD ?? '2147483647'
|
|
2883
|
-
: undefined;
|
|
2884
2726
|
// Predict reattach vs fresh so the log line tells the truth. When a bmx-*
|
|
2885
2727
|
// tmux session is still alive, TmuxBackend.spawn ignores the bin/args and
|
|
2886
2728
|
// just `tmux attach-session`s — logging `Spawning: <new bin>` in that case
|
|
@@ -2900,15 +2742,7 @@ function spawnCli(cfg) {
|
|
|
2900
2742
|
env: {
|
|
2901
2743
|
...process.env,
|
|
2902
2744
|
CLAUDECODE: undefined,
|
|
2903
|
-
// §5 of botmux ask v0.1.7 — `botmux ask buttons` reads these to find
|
|
2904
|
-
// the daemon socket, route the card back to this thread, and resolve
|
|
2905
|
-
// the approver allowlist against session.owner. Missing env → exit 2.
|
|
2906
|
-
BOTMUX_SESSION_ID: cfg.sessionId,
|
|
2907
|
-
BOTMUX_CHAT_ID: cfg.chatId,
|
|
2908
|
-
BOTMUX_LARK_APP_ID: cfg.larkAppId,
|
|
2909
|
-
BOTMUX_ROOT_MESSAGE_ID: cfg.rootMessageId,
|
|
2910
2745
|
...(injectClaudeSandbox ? { IS_SANDBOX: '1' } : {}),
|
|
2911
|
-
...(claudeResumeTokenThreshold ? { CLAUDE_CODE_RESUME_TOKEN_THRESHOLD: claudeResumeTokenThreshold } : {}),
|
|
2912
2746
|
},
|
|
2913
2747
|
});
|
|
2914
2748
|
// Write CLI PID marker so agent-facing subcommands (`botmux send`, etc.)
|
|
@@ -2963,12 +2797,8 @@ function spawnCli(cfg) {
|
|
|
2963
2797
|
// calling `botmux send`, harvest the final answer from the CLI transcript
|
|
2964
2798
|
// and post it to Lark. Codex needs late attach because its rollout id is
|
|
2965
2799
|
// discovered after the first submit; CoCo's events path is deterministic
|
|
2966
|
-
// from botmux sessionId.
|
|
2967
|
-
|
|
2968
|
-
if (cfg.cliId === 'hermes') {
|
|
2969
|
-
hermesBridgeAttach(cfg.resume ? 'baseline-existing' : 'fresh-empty');
|
|
2970
|
-
}
|
|
2971
|
-
else if (cfg.cliId === 'codex') {
|
|
2800
|
+
// from botmux sessionId.
|
|
2801
|
+
if (cfg.cliId === 'codex') {
|
|
2972
2802
|
if (cfg.cliSessionId) {
|
|
2973
2803
|
const rolloutPath = findCodexRolloutBySessionId(cfg.cliSessionId);
|
|
2974
2804
|
if (rolloutPath) {
|
|
@@ -3070,7 +2900,6 @@ function killCli() {
|
|
|
3070
2900
|
scrollback = '';
|
|
3071
2901
|
altBufferActive = false;
|
|
3072
2902
|
trustHandled = false;
|
|
3073
|
-
codexAppOscPending = '';
|
|
3074
2903
|
}
|
|
3075
2904
|
// ─── HTTP + WebSocket Server ─────────────────────────────────────────────────
|
|
3076
2905
|
function startWebServer(host, preferredPort) {
|