@cortex-agent/server 2026.6.24 → 2026.8.3-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.md +26 -14
- package/defaults/.claude/settings.json +4 -0
- package/defaults/CORTEX.md +1 -0
- package/defaults/config/CORTEX.md +10 -0
- package/defaults/config/hooks/01-sensitive-file-edit.json +11 -0
- package/defaults/config/hooks/02-tasks-yaml-guard.json +11 -0
- package/defaults/config/hooks/03-ask-user-question-hook.json +19 -0
- package/defaults/config/hooks/04-exit-plan-mode-hook.json +19 -0
- package/defaults/config/hooks/05-memory-ref-tracker.json +10 -0
- package/defaults/config/hooks/06-rules-loader.json +10 -0
- package/defaults/config/hooks/07-session-activity-tracker.json +10 -0
- package/defaults/config/hooks/08-cortex-md-injector-post-tool.json +10 -0
- package/defaults/config/hooks/09-permission-request-auto-allow.json +11 -0
- package/defaults/config/hooks/10-cortex-md-injector-session-start.json +10 -0
- package/defaults/config/hooks/11-task-status-check.json +14 -0
- package/defaults/config/hooks/12-session-new-hook.json +11 -0
- package/defaults/config/hooks/13-status-md-guard.json +11 -0
- package/defaults/config/hooks/CORTEX.md +19 -0
- package/defaults/config/mcp-config-empty.json +3 -0
- package/defaults/config/thread-templates/agents/benchmark-coder.json +22 -0
- package/defaults/config/thread-templates/agents/benchmark-reviewer.json +22 -0
- package/defaults/config/thread-templates/agents/coder-reviewer.json +20 -0
- package/defaults/config/thread-templates/agents/coder.json +20 -0
- package/defaults/config/thread-templates/agents/direct-review.json +17 -0
- package/defaults/config/thread-templates/agents/direct-web.json +16 -0
- package/defaults/config/thread-templates/agents/direct.json +16 -0
- package/defaults/config/thread-templates/agents/director.json +14 -0
- package/defaults/config/thread-templates/agents/doc-reviewer.json +14 -0
- package/defaults/config/thread-templates/agents/doc-writer.json +25 -0
- package/defaults/config/thread-templates/agents/executor-reviewer.json +14 -0
- package/defaults/config/thread-templates/agents/executor.json +25 -0
- package/defaults/config/thread-templates/agents/main.json +16 -0
- package/defaults/config/thread-templates/agents/manager.json +17 -0
- package/defaults/config/thread-templates/agents/scheduler-main.json +16 -0
- package/defaults/config/thread-templates/shells/worker-review.json +19 -0
- package/defaults/config/thread-templates/templates/benchmark-coder-review.json +37 -0
- package/defaults/config/thread-templates/templates/coder-review.json +29 -0
- package/defaults/config/thread-templates/templates/default.json +10 -0
- package/defaults/config/thread-templates/templates/doc-review.json +6 -0
- package/defaults/config/thread-templates/templates/execute-review.json +6 -0
- package/defaults/config/thread-templates/templates/manager.json +11 -0
- package/defaults/config/thread-templates/templates/scheduler.json +19 -0
- package/defaults/context/decisions/DR-0012.md +1 -1
- package/defaults/context/projects/CORTEX.md +1 -1
- package/defaults/data/schedules.json +12 -0
- package/defaults/gitignore +3 -0
- package/defaults/hooks/CORTEX.md +19 -0
- package/defaults/hooks/cortex-hook-api.mjs +84 -0
- package/defaults/hooks/cortex-md-injector.mjs +99 -49
- package/defaults/hooks/new-session-hook.mjs +2 -2
- package/defaults/hooks/session-activity-tracker.mjs +8 -101
- package/defaults/hooks/status-md-guard.mjs +193 -0
- package/defaults/hooks/task-status-check.mjs +10 -11
- package/defaults/mcp-config-web.json +11 -0
- package/defaults/pi/agents/explore.md +9 -0
- package/defaults/pi/agents/general-purpose.md +6 -0
- package/defaults/pi/agents/plan.md +9 -0
- package/defaults/plugins/cortex-coder/.claude-plugin/plugin.json +1 -1
- package/defaults/plugins/cortex-coder/skills/cli-standards/SKILL.md +2 -2
- package/defaults/plugins/cortex-coder/skills/develop/SKILL.md +60 -1
- package/defaults/plugins/cortex-common/.claude-plugin/plugin.json +2 -2
- package/defaults/plugins/cortex-common/skills/compound/SKILL.md +1 -1
- package/defaults/plugins/cortex-common/skills/compound-simple/SKILL.md +4 -2
- package/defaults/plugins/cortex-common/skills/debug-campaign/SKILL.md +16 -16
- package/defaults/plugins/cortex-common/skills/execute-method/SKILL.md +53 -0
- package/defaults/plugins/cortex-common/skills/execute-review-rubric/SKILL.md +102 -0
- package/defaults/plugins/cortex-common/skills/manager-method/SKILL.md +67 -0
- package/defaults/plugins/cortex-common/skills/postmortem/SKILL.md +1 -1
- package/defaults/plugins/cortex-common/skills/solution-design/SKILL.md +3 -3
- package/defaults/plugins/cortex-stage-gate/.claude-plugin/plugin.json +2 -2
- package/defaults/plugins/cortex-stage-gate/skills/director-method/SKILL.md +54 -0
- package/defaults/plugins/cortex-stage-gate/skills/need-approval/SKILL.md +1 -0
- package/defaults/plugins/cortex-stage-gate/skills/reorient/SKILL.md +2 -2
- package/defaults/plugins/cortex-stage-gate/skills/task/SKILL.md +138 -115
- package/defaults/plugins/cortex-system/.claude-plugin/plugin.json +1 -1
- package/defaults/plugins/cortex-system/skills/client-manage/SKILL.md +17 -10
- package/defaults/plugins/cortex-system/skills/feedback/SKILL.md +3 -3
- package/defaults/plugins/cortex-system/skills/orient/SKILL.md +1 -1
- package/defaults/plugins/cortex-system/skills/orient-project/SKILL.md +2 -2
- package/defaults/plugins/cortex-system/skills/project-init/SKILL.md +13 -16
- package/defaults/plugins/cortex-system/skills/thread/SKILL.md +66 -17
- package/defaults/prompts/directives/coder-reviewer.md +24 -20
- package/defaults/prompts/directives/coder.md +11 -36
- package/defaults/prompts/directives/director.md +7 -26
- package/defaults/prompts/directives/doc-reviewer.md +2 -35
- package/defaults/prompts/directives/doc-writer.md +2 -7
- package/defaults/prompts/directives/executor-reviewer.md +2 -39
- package/defaults/prompts/directives/executor.md +2 -7
- package/defaults/prompts/directives/manager.md +20 -36
- package/defaults/prompts/systemPrompts/coder.md +1 -1
- package/defaults/prompts/systemPrompts/direct.md +1 -1
- package/defaults/prompts/systemPrompts/web.md +5 -0
- package/defaults/prompts/systemPrompts/worker.md +3 -3
- package/defaults/rules/cortex-md.md +31 -0
- package/defaults/rules/experiment-format.md +8 -1
- package/defaults/rules/issues-md.md +10 -9
- package/defaults/rules/meta-conventions.md +5 -4
- package/defaults/rules/mission-md.md +2 -1
- package/defaults/rules/status-md.md +39 -21
- package/dist/agent-adapter/bg-wait.d.ts +42 -0
- package/dist/agent-adapter/bg-wait.js +277 -0
- package/dist/agent-adapter/capabilities.d.ts +7 -1
- package/dist/agent-adapter/capabilities.js +18 -9
- package/dist/agent-adapter/claude/adapter-tui.d.ts +5 -1
- package/dist/agent-adapter/claude/adapter-tui.js +9 -5
- package/dist/agent-adapter/claude/adapter.d.ts +127 -14
- package/dist/agent-adapter/claude/adapter.js +627 -146
- package/dist/agent-adapter/claude/bg-task-tracker.d.ts +22 -15
- package/dist/agent-adapter/claude/bg-task-tracker.js +48 -32
- package/dist/agent-adapter/claude/compact-window.d.ts +9 -0
- package/dist/agent-adapter/claude/compact-window.js +46 -0
- package/dist/agent-adapter/claude/context-usage.d.ts +28 -0
- package/dist/agent-adapter/claude/context-usage.js +177 -0
- package/dist/agent-adapter/claude/defaults.d.ts +19 -3
- package/dist/agent-adapter/claude/defaults.js +27 -11
- package/dist/agent-adapter/claude/event-parser.d.ts +25 -0
- package/dist/agent-adapter/claude/event-parser.js +66 -5
- package/dist/agent-adapter/claude/hooks-builder.d.ts +23 -23
- package/dist/agent-adapter/claude/hooks-builder.js +64 -7
- package/dist/agent-adapter/claude/jsonl-tail.js +54 -35
- package/dist/agent-adapter/claude/spawn-args.d.ts +29 -7
- package/dist/agent-adapter/claude/spawn-args.js +78 -32
- package/dist/agent-adapter/claude/tmux-control.d.ts +4 -17
- package/dist/agent-adapter/claude/tmux-control.js +39 -32
- package/dist/agent-adapter/event-tee.d.ts +19 -0
- package/dist/agent-adapter/event-tee.js +145 -0
- package/dist/agent-adapter/index.d.ts +1 -0
- package/dist/agent-adapter/index.js +7 -5
- package/dist/agent-adapter/normalize/event-types.d.ts +25 -10
- package/dist/agent-adapter/normalize/event-types.js +4 -4
- package/dist/agent-adapter/normalize/tool-names.js +0 -9
- package/dist/agent-adapter/pi/adapter.d.ts +17 -35
- package/dist/agent-adapter/pi/adapter.js +512 -247
- package/dist/agent-adapter/pi/agent-dir.d.ts +6 -0
- package/dist/agent-adapter/pi/agent-dir.js +24 -14
- package/dist/agent-adapter/pi/defaults.d.ts +4 -0
- package/dist/agent-adapter/pi/defaults.js +11 -0
- package/dist/agent-adapter/pi/discovery.d.ts +20 -0
- package/dist/agent-adapter/pi/discovery.js +101 -0
- package/dist/agent-adapter/pi/event-parser.d.ts +13 -2
- package/dist/agent-adapter/pi/event-parser.js +142 -70
- package/dist/agent-adapter/pi/hook-bridge.d.ts +13 -28
- package/dist/agent-adapter/pi/hook-bridge.js +272 -167
- package/dist/agent-adapter/pi/mcp-bridge-logic.d.ts +24 -0
- package/dist/agent-adapter/pi/mcp-bridge-logic.js +39 -0
- package/dist/agent-adapter/pi/mcp-bridge.d.ts +13 -35
- package/dist/agent-adapter/pi/mcp-bridge.js +147 -137
- package/dist/agent-adapter/pi/pi-ext-types.d.ts +30 -0
- package/dist/agent-adapter/pi/pi-ext-types.js +2 -2
- package/dist/agent-adapter/pi/session-support.d.ts +96 -0
- package/dist/agent-adapter/pi/session-support.js +213 -0
- package/dist/agent-adapter/pi/spawn-args.d.ts +17 -4
- package/dist/agent-adapter/pi/spawn-args.js +50 -6
- package/dist/agent-adapter/pi/subagent.d.ts +68 -0
- package/dist/agent-adapter/pi/subagent.js +521 -0
- package/dist/agent-adapter/pi/tool-shims.d.ts +1 -13
- package/dist/agent-adapter/pi/tool-shims.js +182 -198
- package/dist/agent-adapter/pi/web-fetch.d.ts +13 -0
- package/dist/agent-adapter/pi/web-fetch.js +201 -0
- package/dist/agent-adapter/pi/web-search.d.ts +9 -0
- package/dist/agent-adapter/pi/web-search.js +513 -0
- package/dist/agent-adapter/types.d.ts +104 -12
- package/dist/agent-adapter/types.js +9 -5
- package/dist/core/atomic-write.d.ts +9 -6
- package/dist/core/atomic-write.js +206 -16
- package/dist/core/bg-held-sessions.d.ts +35 -0
- package/dist/core/bg-held-sessions.js +79 -0
- package/dist/core/calver.d.ts +1 -0
- package/dist/core/calver.js +29 -0
- package/dist/core/cli-utils.d.ts +15 -2
- package/dist/core/cli-utils.js +46 -41
- package/dist/core/config-generator.d.ts +17 -2
- package/dist/core/config-generator.js +78 -15
- package/dist/core/debug-mode.d.ts +14 -0
- package/dist/core/debug-mode.js +32 -0
- package/dist/core/gateway-generator.js +5 -10
- package/dist/core/hook-bus.d.ts +23 -0
- package/dist/core/hook-bus.js +111 -0
- package/dist/core/hook-exec.d.ts +15 -0
- package/dist/core/hook-exec.js +90 -0
- package/dist/core/icons.d.ts +2 -0
- package/dist/core/icons.js +2 -0
- package/dist/core/json-repository.d.ts +4 -0
- package/dist/core/json-repository.js +6 -3
- package/dist/core/locales/en.d.ts +118 -7
- package/dist/core/locales/en.js +4 -1
- package/dist/core/locales/slices/commands.d.ts +88 -2
- package/dist/core/locales/slices/commands.js +185 -7
- package/dist/core/locales/slices/init.d.ts +1 -1
- package/dist/core/locales/slices/init.js +2 -2
- package/dist/core/locales/slices/status.d.ts +25 -3
- package/dist/core/locales/slices/status.js +59 -10
- package/dist/core/log.d.ts +5 -0
- package/dist/core/log.js +27 -24
- package/dist/core/paths.d.ts +9 -0
- package/dist/core/paths.js +20 -1
- package/dist/core/pi-session-filename.d.ts +2 -0
- package/dist/core/pi-session-filename.js +18 -0
- package/dist/core/profile-generator.d.ts +2 -2
- package/dist/core/profile-generator.js +6 -9
- package/dist/core/resume-reminder.d.ts +5 -0
- package/dist/core/resume-reminder.js +18 -0
- package/dist/core/running-executions.d.ts +10 -1
- package/dist/core/running-executions.js +10 -0
- package/dist/core/runtime-env.d.ts +1 -0
- package/dist/core/runtime-env.js +15 -0
- package/dist/core/settings-migration.d.ts +5 -0
- package/dist/core/settings-migration.js +128 -0
- package/dist/core/settings-spec.d.ts +174 -0
- package/dist/core/settings-spec.js +150 -0
- package/dist/core/settings.d.ts +10 -0
- package/dist/core/settings.js +235 -0
- package/dist/core/task-node.d.ts +7 -0
- package/dist/core/task-node.js +29 -0
- package/dist/core/task-parser.d.ts +11 -1
- package/dist/core/task-parser.js +34 -3
- package/dist/core/types/agent-types.d.ts +42 -2
- package/dist/core/types/agent-types.js +2 -2
- package/dist/core/types/thread-types.d.ts +133 -16
- package/dist/core/types/thread-types.js +3 -3
- package/dist/core/utils.d.ts +22 -2
- package/dist/core/utils.js +39 -3
- package/dist/domain/agent-run/access-probe-cli.d.ts +7 -0
- package/dist/domain/agent-run/access-probe-cli.js +139 -0
- package/dist/domain/agent-run/access-probe-policy.d.ts +61 -0
- package/dist/domain/agent-run/access-probe-policy.js +614 -0
- package/dist/domain/agent-run/access-probe.d.ts +21 -0
- package/dist/domain/agent-run/access-probe.js +194 -0
- package/dist/domain/agent-run/agent-run-cli.d.ts +19 -0
- package/dist/domain/agent-run/agent-run-cli.js +171 -0
- package/dist/domain/agent-run/atif.d.ts +54 -0
- package/dist/domain/agent-run/atif.js +211 -0
- package/dist/domain/agent-run/benchmark-local-thread-orchestrator.d.ts +32 -0
- package/dist/domain/agent-run/benchmark-local-thread-orchestrator.js +616 -0
- package/dist/domain/agent-run/benchmark-thread-identity.d.ts +34 -0
- package/dist/domain/agent-run/benchmark-thread-identity.js +106 -0
- package/dist/domain/agent-run/identity.d.ts +62 -0
- package/dist/domain/agent-run/identity.js +118 -0
- package/dist/domain/agent-run/journal.d.ts +51 -0
- package/dist/domain/agent-run/journal.js +259 -0
- package/dist/domain/agent-run/manifest-contract.d.ts +44 -0
- package/dist/domain/agent-run/manifest-contract.js +134 -0
- package/dist/domain/agent-run/manifest.d.ts +51 -0
- package/dist/domain/agent-run/manifest.js +801 -0
- package/dist/domain/agent-run/pinned-node-process.d.ts +35 -0
- package/dist/domain/agent-run/pinned-node-process.js +206 -0
- package/dist/domain/agent-run/role-surface.d.ts +4 -0
- package/dist/domain/agent-run/role-surface.js +99 -0
- package/dist/domain/agent-run/run-config.d.ts +22 -0
- package/dist/domain/agent-run/run-config.js +135 -0
- package/dist/domain/agent-run/runner.d.ts +7 -0
- package/dist/domain/agent-run/runner.js +518 -0
- package/dist/domain/agent-run/supervisor.d.ts +78 -0
- package/dist/domain/agent-run/supervisor.js +425 -0
- package/dist/domain/agent-run/trajectory-merge-cli.d.ts +11 -0
- package/dist/domain/agent-run/trajectory-merge-cli.js +111 -0
- package/dist/domain/agent-run/trajectory-merge.d.ts +39 -0
- package/dist/domain/agent-run/trajectory-merge.js +505 -0
- package/dist/domain/agents/config.d.ts +16 -5
- package/dist/domain/agents/config.js +162 -45
- package/dist/domain/agents/facade.d.ts +98 -12
- package/dist/domain/agents/facade.js +395 -143
- package/dist/domain/agents/index.d.ts +1 -0
- package/dist/domain/agents/index.js +1 -0
- package/dist/domain/agents/profile-manager.d.ts +14 -7
- package/dist/domain/agents/profile-manager.js +23 -7
- package/dist/domain/agents/profile-switch.d.ts +53 -0
- package/dist/domain/agents/profile-switch.js +79 -0
- package/dist/domain/agents/provider-run-lifecycle.d.ts +18 -0
- package/dist/domain/agents/provider-run-lifecycle.js +60 -0
- package/dist/domain/auth/auth-events.d.ts +18 -0
- package/dist/domain/auth/auth-events.js +38 -0
- package/dist/domain/auth/auth-format.d.ts +2 -0
- package/dist/domain/auth/auth-format.js +58 -0
- package/dist/domain/auth/auth-status.d.ts +61 -0
- package/dist/domain/auth/auth-status.js +304 -0
- package/dist/domain/auth/auth-watch.d.ts +16 -0
- package/dist/domain/auth/auth-watch.js +125 -0
- package/dist/domain/auth/cc-login.d.ts +7 -0
- package/dist/domain/auth/cc-login.js +16 -0
- package/dist/domain/auth/cc-subscription.d.ts +38 -0
- package/dist/domain/auth/cc-subscription.js +204 -0
- package/dist/domain/auth/index.d.ts +12 -0
- package/dist/domain/auth/index.js +16 -0
- package/dist/domain/auth/login-flow.d.ts +120 -0
- package/dist/domain/auth/login-flow.js +253 -0
- package/dist/domain/auth/login-service.d.ts +32 -0
- package/dist/domain/auth/login-service.js +97 -0
- package/dist/domain/auth/logout.d.ts +32 -0
- package/dist/domain/auth/logout.js +123 -0
- package/dist/domain/auth/pi-login.d.ts +36 -0
- package/dist/domain/auth/pi-login.js +72 -0
- package/dist/domain/auth/pi-oauth.d.ts +36 -0
- package/dist/domain/auth/pi-oauth.js +84 -0
- package/dist/domain/auth/pi-runtime.d.ts +72 -0
- package/dist/domain/auth/pi-runtime.js +86 -0
- package/dist/domain/costs/cost-tracker.d.ts +21 -1
- package/dist/domain/costs/cost-tracker.js +54 -26
- package/dist/domain/costs/gateway-manager.js +5 -3
- package/dist/domain/costs/rate-limit-throttle.d.ts +44 -19
- package/dist/domain/costs/rate-limit-throttle.js +331 -103
- package/dist/domain/costs/resume-registry.d.ts +17 -9
- package/dist/domain/costs/resume-registry.js +63 -8
- package/dist/domain/executions/log-tailer.d.ts +71 -0
- package/dist/domain/executions/log-tailer.js +195 -0
- package/dist/domain/executions/registry.d.ts +10 -1
- package/dist/domain/executions/registry.js +14 -0
- package/dist/domain/hooks/hook-view.d.ts +22 -0
- package/dist/domain/hooks/hook-view.js +38 -0
- package/dist/domain/mcp/benchmark-thread-server.d.ts +1 -0
- package/dist/domain/mcp/benchmark-thread-server.js +26 -0
- package/dist/domain/mcp/core-server.d.ts +0 -1
- package/dist/domain/mcp/core-server.js +8 -40
- package/dist/domain/mcp/feishu/file.js +1 -11
- package/dist/domain/mcp/feishu/index.d.ts +0 -2
- package/dist/domain/mcp/feishu/index.js +3 -8
- package/dist/domain/mcp/feishu-server.d.ts +0 -1
- package/dist/domain/mcp/feishu-server.js +4 -6
- package/dist/domain/mcp/manager-qa-server.d.ts +1 -0
- package/dist/domain/mcp/manager-qa-server.js +23 -0
- package/dist/domain/mcp/server.d.ts +0 -1
- package/dist/domain/mcp/server.js +5 -31
- package/dist/domain/mcp/slack-server.d.ts +0 -1
- package/dist/domain/mcp/slack-server.js +3 -5
- package/dist/domain/mcp/tasks-server.d.ts +1 -0
- package/dist/domain/mcp/tasks-server.js +23 -0
- package/dist/domain/mcp/thread-server.d.ts +1 -0
- package/dist/domain/mcp/thread-server.js +25 -0
- package/dist/domain/mcp/tools/benchmark-thread-run.d.ts +23 -0
- package/dist/domain/mcp/tools/benchmark-thread-run.js +146 -0
- package/dist/domain/mcp/tools/context.d.ts +3 -10
- package/dist/domain/mcp/tools/context.js +13 -29
- package/dist/domain/mcp/tools/manager-qa.d.ts +2 -1
- package/dist/domain/mcp/tools/manager-qa.js +49 -53
- package/dist/domain/mcp/tools/schedule.d.ts +1 -2
- package/dist/domain/mcp/tools/schedule.js +7 -10
- package/dist/domain/mcp/tools/slack.d.ts +0 -1
- package/dist/domain/mcp/tools/slack.js +2 -13
- package/dist/domain/mcp/tools/task-ops.js +10 -137
- package/dist/domain/mcp/tools/thread-ops.js +6 -11
- package/dist/domain/mcp/tools/tui-ask.d.ts +2 -0
- package/dist/domain/mcp/tools/tui-ask.js +8 -0
- package/dist/domain/mcp/tools/ui-file.d.ts +2 -0
- package/dist/domain/mcp/tools/ui-file.js +49 -0
- package/dist/domain/mcp/tui-server.d.ts +0 -1
- package/dist/domain/mcp/tui-server.js +39 -24
- package/dist/domain/mcp/web-server.d.ts +1 -0
- package/dist/domain/mcp/web-server.js +25 -0
- package/dist/domain/memory/cortex-md-injector.d.ts +4 -10
- package/dist/domain/memory/cortex-md-injector.js +113 -77
- package/dist/domain/memory/cortex-md-scanner.d.ts +1 -0
- package/dist/domain/memory/cortex-md-scanner.js +5 -2
- package/dist/domain/memory/skill-scanner.d.ts +3 -1
- package/dist/domain/memory/skill-scanner.js +8 -12
- package/dist/domain/memory/user-context.js +6 -8
- package/dist/domain/monitor/disk-monitor.js +49 -19
- package/dist/domain/projects/index.d.ts +1 -0
- package/dist/domain/projects/project-store.d.ts +18 -0
- package/dist/domain/projects/project-store.js +61 -8
- package/dist/domain/remote/client-hot-reload.d.ts +9 -1
- package/dist/domain/remote/client-hot-reload.js +64 -15
- package/dist/domain/remote/client-manager.d.ts +15 -1
- package/dist/domain/remote/client-manager.js +84 -14
- package/dist/domain/remote/cortex-client.js +6 -48
- package/dist/domain/scheduling/job-registry.d.ts +0 -2
- package/dist/domain/scheduling/job-registry.js +2 -6
- package/dist/domain/scheduling/jobs/_shared.d.ts +5 -1
- package/dist/domain/scheduling/jobs/_shared.js +2 -1
- package/dist/domain/scheduling/jobs/auth-expiry-scan.d.ts +14 -0
- package/dist/domain/scheduling/jobs/auth-expiry-scan.js +86 -0
- package/dist/domain/scheduling/jobs/scheduled-task.js +1 -3
- package/dist/domain/scheduling/jobs/task-dispatch.js +62 -58
- package/dist/domain/scheduling/runner.d.ts +2 -0
- package/dist/domain/scheduling/runner.js +7 -4
- package/dist/domain/scheduling/scheduler.d.ts +0 -10
- package/dist/domain/scheduling/scheduler.js +9 -9
- package/dist/domain/sessions/session-backup.d.ts +14 -20
- package/dist/domain/sessions/session-backup.js +57 -68
- package/dist/domain/sessions/session-hooks.d.ts +7 -14
- package/dist/domain/sessions/session-hooks.js +66 -112
- package/dist/domain/sessions/session-lifecycle.d.ts +38 -1
- package/dist/domain/sessions/session-lifecycle.js +41 -4
- package/dist/domain/sessions/session-registry.d.ts +3 -1
- package/dist/domain/system/doctor.d.ts +4 -0
- package/dist/domain/system/doctor.js +116 -34
- package/dist/domain/system/install-cli.js +8 -3
- package/dist/domain/system/server-update-check.d.ts +2 -1
- package/dist/domain/system/server-update-check.js +11 -28
- package/dist/domain/system/system-notice.d.ts +20 -0
- package/dist/domain/system/system-notice.js +29 -0
- package/dist/domain/tasks/acceptance-ledger.d.ts +31 -0
- package/dist/domain/tasks/acceptance-ledger.js +83 -0
- package/dist/domain/tasks/archiver.d.ts +1 -0
- package/dist/domain/tasks/archiver.js +13 -7
- package/dist/domain/tasks/claim-recovery.d.ts +10 -0
- package/dist/domain/tasks/claim-recovery.js +68 -0
- package/dist/domain/tasks/dispatch-utils.d.ts +34 -14
- package/dist/domain/tasks/dispatch-utils.js +22 -18
- package/dist/domain/tasks/dispatcher.d.ts +1 -0
- package/dist/domain/tasks/dispatcher.js +10 -8
- package/dist/domain/tasks/mutator.d.ts +28 -12
- package/dist/domain/tasks/mutator.js +83 -25
- package/dist/domain/tasks/pending-tracker.d.ts +5 -2
- package/dist/domain/tasks/pending-tracker.js +11 -5
- package/dist/domain/tasks/recommendation/extractor.js +3 -3
- package/dist/domain/tasks/system/cortex-run.d.ts +2 -1
- package/dist/domain/tasks/system/cortex-run.js +24 -4
- package/dist/domain/tasks/system/task-cli.d.ts +3 -0
- package/dist/domain/tasks/system/task-cli.js +102 -25
- package/dist/domain/tasks/system/task-completion.d.ts +19 -2
- package/dist/domain/tasks/system/task-completion.js +165 -45
- package/dist/domain/tasks/system/task-file-input.d.ts +10 -0
- package/dist/domain/tasks/system/task-file-input.js +57 -0
- package/dist/domain/tasks/system/task-id-utils.d.ts +9 -9
- package/dist/domain/tasks/system/task-id-utils.js +13 -4
- package/dist/domain/tasks/system/task-lifecycle-edit.d.ts +6 -2
- package/dist/domain/tasks/system/task-lifecycle-edit.js +203 -6
- package/dist/domain/tasks/system/task-lock.js +19 -5
- package/dist/domain/tasks/system/task-mutations.d.ts +22 -12
- package/dist/domain/tasks/system/task-mutations.js +28 -4
- package/dist/domain/tasks/system/task-process.js +10 -8
- package/dist/domain/tasks/system/task-state.d.ts +65 -11
- package/dist/domain/tasks/system/task-state.js +86 -13
- package/dist/domain/threads/artifact-io.d.ts +3 -15
- package/dist/domain/threads/artifact-io.js +13 -119
- package/dist/domain/threads/hook-runner.d.ts +7 -2
- package/dist/domain/threads/hook-runner.js +68 -85
- package/dist/domain/threads/index.js +6 -1
- package/dist/domain/threads/local-runtime-deps.d.ts +32 -0
- package/dist/domain/threads/local-runtime-deps.js +91 -0
- package/dist/domain/threads/local-runtime-scope.d.ts +6 -0
- package/dist/domain/threads/local-runtime-scope.js +12 -0
- package/dist/domain/threads/pending-user-inputs.d.ts +3 -0
- package/dist/domain/threads/pending-user-inputs.js +37 -0
- package/dist/domain/threads/prompt-builder.d.ts +19 -1
- package/dist/domain/threads/prompt-builder.js +98 -34
- package/dist/domain/threads/runner.d.ts +34 -8
- package/dist/domain/threads/runner.js +435 -146
- package/dist/domain/threads/shell-templates.d.ts +9 -0
- package/dist/domain/threads/shell-templates.js +117 -0
- package/dist/domain/threads/state-machine.d.ts +35 -7
- package/dist/domain/threads/state-machine.js +179 -29
- package/dist/domain/threads/template-loader.d.ts +15 -7
- package/dist/domain/threads/template-loader.js +204 -87
- package/dist/domain/threads/thread-transcript.d.ts +47 -0
- package/dist/domain/threads/thread-transcript.js +64 -0
- package/dist/domain/threads/utils.d.ts +8 -1
- package/dist/domain/threads/utils.js +17 -1
- package/dist/domain/tui-session/tui-session-service.js +9 -16
- package/dist/domain/tui-session/types.d.ts +12 -0
- package/dist/domain/ui-service/app-router.d.ts +750 -0
- package/dist/domain/ui-service/app-router.js +233 -0
- package/dist/domain/ui-service/index.d.ts +1 -1
- package/dist/domain/ui-service/input-schemas.d.ts +766 -0
- package/dist/domain/ui-service/input-schemas.js +439 -0
- package/dist/domain/ui-service/mutate/approvals.d.ts +32 -0
- package/dist/domain/ui-service/mutate/approvals.js +141 -0
- package/dist/domain/ui-service/mutate/auth.d.ts +6 -0
- package/dist/domain/ui-service/mutate/auth.js +83 -0
- package/dist/domain/ui-service/mutate/config.d.ts +16 -0
- package/dist/domain/ui-service/mutate/config.js +73 -0
- package/dist/domain/ui-service/mutate/hooks.d.ts +16 -0
- package/dist/domain/ui-service/mutate/hooks.js +138 -0
- package/dist/domain/ui-service/mutate/issues.d.ts +18 -0
- package/dist/domain/ui-service/mutate/issues.js +111 -0
- package/dist/domain/ui-service/mutate/notes.d.ts +6 -0
- package/dist/domain/ui-service/mutate/notes.js +36 -0
- package/dist/domain/ui-service/mutate/projects.d.ts +4 -0
- package/dist/domain/ui-service/mutate/projects.js +10 -0
- package/dist/domain/ui-service/mutate/schedules.d.ts +2 -1
- package/dist/domain/ui-service/mutate/schedules.js +57 -3
- package/dist/domain/ui-service/mutate/sessions.d.ts +11 -0
- package/dist/domain/ui-service/mutate/sessions.js +198 -0
- package/dist/domain/ui-service/mutate/system.d.ts +2 -0
- package/dist/domain/ui-service/mutate/system.js +97 -0
- package/dist/domain/ui-service/query/approvals.d.ts +10 -0
- package/dist/domain/ui-service/query/approvals.js +112 -0
- package/dist/domain/ui-service/query/auth.d.ts +6 -0
- package/dist/domain/ui-service/query/auth.js +12 -0
- package/dist/domain/ui-service/query/config.d.ts +8 -0
- package/dist/domain/ui-service/query/config.js +148 -0
- package/dist/domain/ui-service/query/executions.d.ts +2 -1
- package/dist/domain/ui-service/query/executions.js +47 -3
- package/dist/domain/ui-service/query/hooks.d.ts +7 -0
- package/dist/domain/ui-service/query/hooks.js +110 -0
- package/dist/domain/ui-service/query/issues.d.ts +14 -0
- package/dist/domain/ui-service/query/issues.js +85 -0
- package/dist/domain/ui-service/query/machines.d.ts +2 -0
- package/dist/domain/ui-service/query/machines.js +39 -0
- package/dist/domain/ui-service/query/memory.d.ts +5 -0
- package/dist/domain/ui-service/query/memory.js +199 -0
- package/dist/domain/ui-service/query/notes.d.ts +3 -0
- package/dist/domain/ui-service/query/notes.js +18 -0
- package/dist/domain/ui-service/query/schedules.js +1 -0
- package/dist/domain/ui-service/query/sessions.d.ts +3 -1
- package/dist/domain/ui-service/query/sessions.js +227 -15
- package/dist/domain/ui-service/query/skills.d.ts +2 -0
- package/dist/domain/ui-service/query/skills.js +14 -0
- package/dist/domain/ui-service/query/system.d.ts +3 -0
- package/dist/domain/ui-service/query/system.js +132 -0
- package/dist/domain/ui-service/query/task-verification.d.ts +2 -0
- package/dist/domain/ui-service/query/task-verification.js +60 -0
- package/dist/domain/ui-service/query/tasks.d.ts +1 -0
- package/dist/domain/ui-service/query/tasks.js +74 -27
- package/dist/domain/ui-service/query/thread-templates.d.ts +8 -0
- package/dist/domain/ui-service/query/thread-templates.js +54 -0
- package/dist/domain/ui-service/query/threads.d.ts +2 -1
- package/dist/domain/ui-service/query/threads.js +215 -6
- package/dist/domain/ui-service/subscribe.js +27 -1
- package/dist/domain/ui-service/trpc.d.ts +13 -0
- package/dist/domain/ui-service/trpc.js +12 -0
- package/dist/domain/ui-service/types.d.ts +1325 -4
- package/dist/domain/ui-service/types.js +4 -4
- package/dist/domain/ui-service/ui-service.d.ts +2 -1
- package/dist/domain/ui-service/ui-service.js +126 -10
- package/dist/entry/admin-channel-hot-reload.d.ts +4 -0
- package/dist/entry/admin-channel-hot-reload.js +22 -0
- package/dist/entry/app.js +287 -40
- package/dist/entry/auth-cli.d.ts +10 -0
- package/dist/entry/auth-cli.js +52 -0
- package/dist/entry/cli-help.d.ts +5 -0
- package/dist/entry/cli-help.js +130 -0
- package/dist/entry/cli.d.ts +5 -5
- package/dist/entry/cli.js +174 -248
- package/dist/entry/daemon-notice.d.ts +17 -0
- package/dist/entry/daemon-notice.js +26 -0
- package/dist/entry/daemon.d.ts +34 -1
- package/dist/entry/daemon.js +321 -135
- package/dist/entry/draft-attachments.d.ts +8 -0
- package/dist/entry/draft-attachments.js +83 -0
- package/dist/entry/feishu-login.d.ts +2 -6
- package/dist/entry/feishu-login.js +16 -21
- package/dist/entry/hook-cli.d.ts +18 -0
- package/dist/entry/hook-cli.js +468 -0
- package/dist/entry/init.js +24 -18
- package/dist/entry/start-ui-http.d.ts +38 -0
- package/dist/entry/start-ui-http.js +262 -0
- package/dist/entry/startup-notify.js +5 -9
- package/dist/entry/ui-http-gate.d.ts +11 -0
- package/dist/entry/ui-http-gate.js +29 -0
- package/dist/events/event-bus.d.ts +7 -2
- package/dist/events/event-bus.js +5 -2
- package/dist/events/event-logger.js +25 -13
- package/dist/events/event-types.d.ts +128 -0
- package/dist/events/event-types.js +4 -4
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.js +3 -3
- package/dist/hooks/cortex-hook-api.mjs +84 -0
- package/dist/hooks/cortex-md-injector.mjs +99 -49
- package/dist/hooks/new-session-hook.mjs +2 -2
- package/dist/hooks/session-activity-tracker.mjs +8 -101
- package/dist/hooks/status-md-guard.mjs +193 -0
- package/dist/hooks/task-status-check.mjs +10 -11
- package/dist/orchestration/agent-file-send.d.ts +54 -0
- package/dist/orchestration/agent-file-send.js +140 -0
- package/dist/orchestration/agent-runner.d.ts +55 -2
- package/dist/orchestration/agent-runner.js +396 -60
- package/dist/orchestration/bg-continuation.d.ts +51 -9
- package/dist/orchestration/bg-continuation.js +53 -15
- package/dist/orchestration/bg-wait-guard.d.ts +28 -0
- package/dist/orchestration/bg-wait-guard.js +73 -0
- package/dist/orchestration/conduit-queue.d.ts +2 -0
- package/dist/orchestration/conduit-queue.js +14 -1
- package/dist/orchestration/conversation-runner.d.ts +41 -5
- package/dist/orchestration/conversation-runner.js +82 -18
- package/dist/orchestration/delta-coalescer.d.ts +69 -0
- package/dist/orchestration/delta-coalescer.js +128 -0
- package/dist/orchestration/interactions/ask-user-question.d.ts +11 -3
- package/dist/orchestration/interactions/ask-user-question.js +27 -3
- package/dist/orchestration/interactions/interaction-handlers.js +11 -36
- package/dist/orchestration/interactions/interaction-records.d.ts +59 -0
- package/dist/orchestration/interactions/interaction-records.js +156 -0
- package/dist/orchestration/interactions/plan-approvals.d.ts +5 -0
- package/dist/orchestration/interactions/plan-approvals.js +8 -0
- package/dist/orchestration/interactions/plan-response.d.ts +8 -0
- package/dist/orchestration/interactions/plan-response.js +37 -0
- package/dist/orchestration/lifecycle.d.ts +30 -3
- package/dist/orchestration/lifecycle.js +231 -87
- package/dist/orchestration/manager-qa.d.ts +12 -2
- package/dist/orchestration/manager-qa.js +34 -33
- package/dist/orchestration/mid-turn-inject.d.ts +107 -0
- package/dist/orchestration/mid-turn-inject.js +314 -0
- package/dist/orchestration/pending-injection-recovery.d.ts +35 -0
- package/dist/orchestration/pending-injection-recovery.js +92 -0
- package/dist/orchestration/resume-dispatcher.d.ts +23 -8
- package/dist/orchestration/resume-dispatcher.js +75 -53
- package/dist/orchestration/routing/commands/cancel.d.ts +26 -0
- package/dist/orchestration/routing/commands/cancel.js +64 -18
- package/dist/orchestration/routing/commands/compact.d.ts +10 -0
- package/dist/orchestration/routing/commands/compact.js +26 -0
- package/dist/orchestration/routing/commands/index.d.ts +6 -1
- package/dist/orchestration/routing/commands/index.js +89 -58
- package/dist/orchestration/routing/commands/login-notice.d.ts +21 -0
- package/dist/orchestration/routing/commands/login-notice.js +97 -0
- package/dist/orchestration/routing/commands/login.d.ts +12 -0
- package/dist/orchestration/routing/commands/login.js +555 -0
- package/dist/orchestration/routing/commands/mode.js +24 -11
- package/dist/orchestration/routing/commands/restart.d.ts +22 -0
- package/dist/orchestration/routing/commands/restart.js +49 -0
- package/dist/orchestration/routing/commands/session.js +4 -0
- package/dist/orchestration/routing/commands/status.js +48 -57
- package/dist/orchestration/routing/edit-handler.d.ts +5 -0
- package/dist/orchestration/routing/edit-handler.js +127 -73
- package/dist/orchestration/routing/hook-bridge-subscribers.d.ts +2 -1
- package/dist/orchestration/routing/hook-bridge-subscribers.js +45 -4
- package/dist/orchestration/routing/hook-bridge.d.ts +10 -3
- package/dist/orchestration/routing/hook-bridge.js +26 -14
- package/dist/orchestration/routing/webhook.js +114 -22
- package/dist/orchestration/session-compact.d.ts +58 -0
- package/dist/orchestration/session-compact.js +82 -0
- package/dist/orchestration/session-events.d.ts +111 -0
- package/dist/orchestration/session-events.js +113 -0
- package/dist/orchestration/session-rewind.d.ts +76 -0
- package/dist/orchestration/session-rewind.js +148 -0
- package/dist/orchestration/session-send.d.ts +21 -0
- package/dist/orchestration/session-send.js +38 -0
- package/dist/orchestration/status-helpers.d.ts +5 -2
- package/dist/orchestration/status-helpers.js +25 -10
- package/dist/orchestration/thread-callback.d.ts +92 -16
- package/dist/orchestration/thread-callback.js +409 -87
- package/dist/orchestration/thread-executor.d.ts +1 -0
- package/dist/orchestration/thread-executor.js +59 -57
- package/dist/orchestration/turn-mutation-lock.d.ts +3 -0
- package/dist/orchestration/turn-mutation-lock.js +36 -0
- package/dist/orchestration/turn-notify.d.ts +2 -5
- package/dist/orchestration/turn-notify.js +9 -21
- package/dist/orchestration/web-bg-hold.d.ts +52 -0
- package/dist/orchestration/web-bg-hold.js +105 -0
- package/dist/platform/adapter.d.ts +4 -0
- package/dist/platform/adapter.js +3 -3
- package/dist/platform/adapters/composite-adapter.d.ts +8 -1
- package/dist/platform/adapters/composite-adapter.js +75 -5
- package/dist/platform/adapters/feishu.d.ts +8 -5
- package/dist/platform/adapters/feishu.js +89 -70
- package/dist/platform/adapters/index.d.ts +1 -1
- package/dist/platform/adapters/index.js +13 -12
- package/dist/platform/adapters/slack.d.ts +3 -2
- package/dist/platform/adapters/slack.js +52 -43
- package/dist/platform/adapters/tui/index.d.ts +1 -1
- package/dist/platform/adapters/tui/ports.d.ts +8 -7
- package/dist/platform/adapters/tui/tui-gateway.d.ts +7 -0
- package/dist/platform/adapters/tui/tui-gateway.js +48 -5
- package/dist/platform/adapters/tui/tui-transcript.js +17 -29
- package/dist/platform/index.d.ts +3 -2
- package/dist/platform/index.js +4 -4
- package/dist/platform/interactive-builder.d.ts +7 -0
- package/dist/platform/interactive-builder.js +22 -2
- package/dist/platform/testing.d.ts +6 -0
- package/dist/platform/testing.js +19 -5
- package/dist/platform/tool-trace.js +6 -11
- package/dist/platform/tui/protocol.d.ts +0 -2
- package/dist/platform/tui/protocol.js +4 -53
- package/dist/platform/types.d.ts +12 -0
- package/dist/platform/types.js +5 -0
- package/dist/platform/ui-http/access-jwt.d.ts +28 -0
- package/dist/platform/ui-http/access-jwt.js +67 -0
- package/dist/platform/ui-http/app-update.d.ts +58 -0
- package/dist/platform/ui-http/app-update.js +155 -0
- package/dist/platform/ui-http/ui-http-server.d.ts +56 -0
- package/dist/platform/ui-http/ui-http-server.js +219 -0
- package/dist/platform/ui-http/ui-ota.d.ts +20 -0
- package/dist/platform/ui-http/ui-ota.js +128 -0
- package/dist/platform/ui-http/zip-writer.d.ts +13 -0
- package/dist/platform/ui-http/zip-writer.js +102 -0
- package/dist/platform/utils/reaction-diagnostics.d.ts +4 -0
- package/dist/platform/utils/reaction-diagnostics.js +23 -0
- package/dist/store/conversation-history-repo.d.ts +243 -0
- package/dist/store/conversation-history-repo.js +399 -0
- package/dist/store/execution-repo.d.ts +36 -2
- package/dist/store/execution-repo.js +73 -5
- package/dist/store/hook-registry.d.ts +83 -0
- package/dist/store/hook-registry.js +318 -0
- package/dist/store/hook-sync.d.ts +12 -16
- package/dist/store/hook-sync.js +169 -70
- package/dist/store/hook-writer.d.ts +49 -0
- package/dist/store/hook-writer.js +132 -0
- package/dist/store/outbound-queue.d.ts +8 -0
- package/dist/store/outbound-queue.js +24 -3
- package/dist/store/pending-injection-repo.d.ts +30 -0
- package/dist/store/pending-injection-repo.js +51 -0
- package/dist/store/profile-repo.d.ts +2 -1
- package/dist/store/profile-repo.js +6 -11
- package/dist/store/project-notes-repo.d.ts +27 -0
- package/dist/store/project-notes-repo.js +214 -0
- package/dist/store/prompt-migration-replacements.d.ts +4 -0
- package/dist/store/prompt-migration-replacements.js +149 -0
- package/dist/store/provider-state-repo.d.ts +18 -0
- package/dist/store/provider-state-repo.js +107 -0
- package/dist/store/schedule-repo.d.ts +0 -21
- package/dist/store/schedule-repo.js +4 -25
- package/dist/store/session-registry-repo.d.ts +47 -1
- package/dist/store/session-registry-repo.js +71 -3
- package/dist/store/thread-repo.d.ts +15 -4
- package/dist/store/thread-repo.js +61 -24
- package/dist/store/version-migrations.d.ts +2 -0
- package/dist/store/version-migrations.js +221 -9
- package/dist/tui/App.js +208 -20
- package/dist/tui/components/Dashboard.d.ts +3 -1
- package/dist/tui/components/Dashboard.js +5 -1
- package/dist/tui/components/DashboardCostTab.js +17 -2
- package/dist/tui/components/DashboardExecutionsTab.js +21 -1
- package/dist/tui/components/DashboardSchedulesTab.js +8 -3
- package/dist/tui/components/DashboardTasksTab.js +11 -6
- package/dist/tui/components/DashboardThreadsTab.js +20 -2
- package/dist/tui/components/InputBox.d.ts +17 -1
- package/dist/tui/components/InputBox.js +237 -21
- package/dist/tui/components/Notifications.js +7 -2
- package/dist/tui/components/ProjectSwitcher.js +7 -2
- package/dist/tui/components/SessionPicker.js +10 -1
- package/dist/tui/components/SidePanel.d.ts +3 -1
- package/dist/tui/components/SidePanel.js +4 -2
- package/dist/tui/components/SlashMenu.d.ts +8 -0
- package/dist/tui/components/SlashMenu.js +14 -0
- package/dist/tui/components/StatusLine.d.ts +12 -3
- package/dist/tui/components/StatusLine.js +29 -10
- package/dist/tui/components/Transcript.d.ts +9 -0
- package/dist/tui/components/Transcript.js +131 -26
- package/dist/tui/components/dashboard-constants.d.ts +1 -0
- package/dist/tui/components/dashboard-constants.js +7 -0
- package/dist/tui/hooks/useKeybindings.d.ts +1 -0
- package/dist/tui/hooks/useKeybindings.js +9 -14
- package/dist/tui/hooks/useMouseHandler.d.ts +17 -0
- package/dist/tui/hooks/useMouseHandler.js +103 -0
- package/dist/tui/hooks/useTranscript.d.ts +7 -2
- package/dist/tui/hooks/useTranscript.js +76 -57
- package/dist/tui/index.js +106 -10
- package/dist/tui/logic.d.ts +146 -2
- package/dist/tui/logic.js +411 -6
- package/dist/tui/raf-batch.d.ts +33 -0
- package/dist/tui/raf-batch.js +103 -0
- package/dist/tui/render/inline-markdown.d.ts +22 -0
- package/dist/tui/render/inline-markdown.js +99 -0
- package/dist/tui/render/rich-blocks.js +10 -8
- package/dist/tui/render-output.d.ts +46 -0
- package/dist/tui/render-output.js +86 -0
- package/dist/tui/slash-commands.d.ts +21 -0
- package/dist/tui/slash-commands.js +73 -0
- package/dist/tui/turn-status.d.ts +10 -0
- package/dist/tui/turn-status.js +53 -0
- package/native/cortex-supervisor/dist/build-manifest.json +22 -0
- package/native/cortex-supervisor/dist/cortex-supervisor +0 -0
- package/package.json +20 -7
- package/web/dist/apple-touch-icon.png +0 -0
- package/web/dist/assets/index-DCgngTJG.js +1 -0
- package/web/dist/assets/index-XqBCYtkw.js +139 -0
- package/web/dist/assets/index-zpf3OSKC.css +1 -0
- package/web/dist/assets/pdf-worker-DIEXcFxP.js +55 -0
- package/web/dist/assets/pdf.worker.min-DqNZU1-t.js +53 -0
- package/web/dist/favicon-32.png +0 -0
- package/web/dist/favicon.svg +7 -0
- package/web/dist/index.html +37 -0
- package/defaults/config/session-hooks.json +0 -7
- package/defaults/config/thread-templates.json +0 -600
- package/defaults/prompts/directives/milestone-executor.md +0 -119
- package/defaults/prompts/directives/milestone-reviewer.md +0 -108
- package/defaults/prompts/directives/plan-executor.md +0 -121
- package/defaults/prompts/directives/plan-reviewer.md +0 -99
- package/dist/agent-adapter/codex/adapter.d.ts +0 -42
- package/dist/agent-adapter/codex/adapter.js +0 -916
- package/dist/agent-adapter/codex/event-parser.d.ts +0 -17
- package/dist/agent-adapter/codex/event-parser.js +0 -41
- package/dist/agent-adapter/codex/spawn-args.d.ts +0 -6
- package/dist/agent-adapter/codex/spawn-args.js +0 -30
- package/dist/domain/costs/codex-event-format.d.ts +0 -4
- package/dist/domain/costs/codex-event-format.js +0 -66
- package/dist/domain/costs/codex-usage-monitor.d.ts +0 -6
- package/dist/domain/costs/codex-usage-monitor.js +0 -73
- package/dist/domain/costs/rate-limit-parser.d.ts +0 -11
- package/dist/domain/costs/rate-limit-parser.js +0 -87
- package/dist/domain/mcp/feishu/block-types.d.ts +0 -44
- package/dist/domain/mcp/feishu/block-types.js +0 -127
- package/dist/tui/components/Header.d.ts +0 -11
- package/dist/tui/components/Header.js +0 -5
- package/dist/tui/components/MessageRow.d.ts +0 -7
- package/dist/tui/components/MessageRow.js +0 -10
|
@@ -10,7 +10,22 @@ export function DashboardCostTab({ data }) {
|
|
|
10
10
|
if (!data.data || (Array.isArray(data.data) && data.data.length === 0)) {
|
|
11
11
|
return _jsx(Text, { dimColor: true, children: "No cost data" });
|
|
12
12
|
}
|
|
13
|
-
//
|
|
13
|
+
// The server returns a CostSummary object (domain/costs/cost-tracker.ts): top-level
|
|
14
|
+
// today/week/month/total are USD numbers; byMode maps mode → { today, week, month, total }.
|
|
15
|
+
// useDashboardData wraps a non-array response in a single-element array.
|
|
14
16
|
const costData = Array.isArray(data.data) ? data.data[0] : data.data;
|
|
15
|
-
|
|
17
|
+
const usd = (v) => `$${typeof v === 'number' ? v.toFixed(4) : String(v)}`;
|
|
18
|
+
// byMode is keyed by PERIOD (today/week/month/total); each value is a ModeBuckets
|
|
19
|
+
// { total, api, plan, ... } breaking that period down by cost type. The all-time
|
|
20
|
+
// bucket (byMode.total) gives the api/plan split; skip the 'total' meta key.
|
|
21
|
+
const allTime = costData?.byMode?.total && typeof costData.byMode.total === 'object' ? costData.byMode.total : {};
|
|
22
|
+
const modeEntries = Object.entries(allTime)
|
|
23
|
+
.filter(([k, v]) => k !== 'total' && typeof v === 'number' && v > 0);
|
|
24
|
+
const hasAnyTotal = costData?.total != null || costData?.month != null || costData?.today != null;
|
|
25
|
+
if (!hasAnyTotal && modeEntries.length === 0) {
|
|
26
|
+
return _jsx(Text, { dimColor: true, children: "No cost summary available" });
|
|
27
|
+
}
|
|
28
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, children: "Cost Summary" }) }), costData?.total != null ? (_jsxs(Box, { children: [_jsx(Text, { children: "Total: " }), _jsx(Text, { children: usd(costData.total) })] })) : null, costData?.month != null ? (_jsxs(Box, { children: [_jsx(Text, { children: "This month: " }), _jsx(Text, { children: usd(costData.month) })] })) : null, costData?.week != null ? (_jsxs(Box, { children: [_jsx(Text, { children: "This week: " }), _jsx(Text, { children: usd(costData.week) })] })) : null, costData?.today != null ? (_jsxs(Box, { children: [_jsx(Text, { children: "Today: " }), _jsx(Text, { children: usd(costData.today) })] })) : null, modeEntries.length > 0 ? (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { dimColor: true, children: "By cost type (all-time):" }), modeEntries
|
|
29
|
+
.sort(([, a], [, b]) => b - a)
|
|
30
|
+
.map(([mode, v]) => (_jsxs(Box, { marginLeft: 1, children: [_jsxs(Text, { dimColor: true, children: [mode, ": "] }), _jsx(Text, { children: usd(v) })] }, mode)))] })) : null] }));
|
|
16
31
|
}
|
|
@@ -5,6 +5,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
import { useState, useCallback, useRef, useEffect } from 'react';
|
|
6
6
|
import { Box, Text, useInput } from 'ink';
|
|
7
7
|
import { ConfirmModal } from './ConfirmModal.js';
|
|
8
|
+
import { computeFocusWindow } from '../logic.js';
|
|
9
|
+
import { DASHBOARD_MAX_VISIBLE_ROWS } from './dashboard-constants.js';
|
|
8
10
|
export function DashboardExecutionsTab({ data, mutate, active = true }) {
|
|
9
11
|
const [focusedIndex, setFocusedIndex] = useState(0);
|
|
10
12
|
const [showConfirm, setShowConfirm] = useState(false);
|
|
@@ -66,6 +68,9 @@ export function DashboardExecutionsTab({ data, mutate, active = true }) {
|
|
|
66
68
|
}
|
|
67
69
|
// Clamp focused index to valid range
|
|
68
70
|
const safeFocused = Math.min(focusedIndex, data.data.length - 1);
|
|
71
|
+
// Cap the rendered slice so a long list can't overflow the terminal (ghost-row corruption).
|
|
72
|
+
const { start, end, hiddenAbove, hiddenBelow } = computeFocusWindow(data.data.length, safeFocused, DASHBOARD_MAX_VISIBLE_ROWS);
|
|
73
|
+
const visible = data.data.slice(start, end);
|
|
69
74
|
const focusedExec = showConfirm ? data.data[confirmIndexRef.current] : null;
|
|
70
75
|
// Build ConfirmModal body from focused execution fields
|
|
71
76
|
let confirmBody = '';
|
|
@@ -80,7 +85,22 @@ export function DashboardExecutionsTab({ data, mutate, active = true }) {
|
|
|
80
85
|
}
|
|
81
86
|
confirmBody = parts.join(' | ');
|
|
82
87
|
}
|
|
83
|
-
return (_jsxs(Box, { flexDirection: "column", children: [
|
|
88
|
+
return (_jsxs(Box, { flexDirection: "column", children: [hiddenAbove > 0 ? _jsxs(Text, { dimColor: true, children: ["\u2191 ", hiddenAbove, " more above"] }) : null, visible.map((exec, vi) => {
|
|
89
|
+
const i = start + vi;
|
|
90
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [_jsx(Text, { children: i === safeFocused ? '>' : ' ' }), _jsx(Text, { children: " " }), _jsx(ExecStatusIcon, { status: exec.status }), _jsx(Text, { children: " " }), _jsx(Text, { bold: i === safeFocused, children: exec.type ?? 'local' }), exec.machine ? _jsxs(Text, { dimColor: true, children: [" @", exec.machine] }) : null] }), _jsx(Box, { marginLeft: 2, children: _jsx(Text, { dimColor: true, children: execDetailLine(exec) }) }), notFoundMsg?.index === i ? (_jsx(Box, { marginLeft: 2, children: _jsx(Text, { color: "red", children: notFoundMsg.message }) })) : null] }, exec.id ?? i));
|
|
91
|
+
}), hiddenBelow > 0 ? _jsxs(Text, { dimColor: true, children: ["\u2193 ", hiddenBelow, " more below"] }) : null, showConfirm && focusedExec ? (_jsx(ConfirmModal, { title: "Cancel execution?", body: confirmBody, onConfirm: handleConfirm, onCancel: handleCancel })) : null] }));
|
|
92
|
+
}
|
|
93
|
+
/** Compose the "45.2s | $0.1234 | <time>" detail line, omitting any missing field so a
|
|
94
|
+
* zero/absent duration no longer renders a dangling leading " | ". */
|
|
95
|
+
function execDetailLine(exec) {
|
|
96
|
+
const parts = [];
|
|
97
|
+
if (exec.durationMs)
|
|
98
|
+
parts.push(`${(exec.durationMs / 1000).toFixed(1)}s`);
|
|
99
|
+
if (exec.cost != null)
|
|
100
|
+
parts.push(`$${typeof exec.cost === 'number' ? exec.cost.toFixed(4) : exec.cost}`);
|
|
101
|
+
if (exec.finishedAt)
|
|
102
|
+
parts.push(new Date(exec.finishedAt).toLocaleString());
|
|
103
|
+
return parts.join(' | ');
|
|
84
104
|
}
|
|
85
105
|
function ExecStatusIcon({ status }) {
|
|
86
106
|
switch (status) {
|
|
@@ -5,6 +5,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
6
6
|
import { Box, Text, useInput } from 'ink';
|
|
7
7
|
import { ConfirmModal } from './ConfirmModal.js';
|
|
8
|
+
import { computeFocusWindow } from '../logic.js';
|
|
9
|
+
import { DASHBOARD_MAX_VISIBLE_ROWS } from './dashboard-constants.js';
|
|
8
10
|
export function DashboardSchedulesTab({ data, mutate, active = true }) {
|
|
9
11
|
if (data.loading && data.data.length === 0) {
|
|
10
12
|
return _jsx(Text, { dimColor: true, children: "Loading schedules..." });
|
|
@@ -89,8 +91,11 @@ function SchedulesList({ data, mutate, active = true }) {
|
|
|
89
91
|
removingScheduleIdRef.current = sched.id;
|
|
90
92
|
}
|
|
91
93
|
}, { isActive: isInputActive });
|
|
92
|
-
// ── Build schedule rows ──
|
|
93
|
-
const
|
|
94
|
+
// ── Build schedule rows (windowed so a long list can't overflow the terminal) ──
|
|
95
|
+
const safeFocused = Math.min(focusedRowIndex, schedules.length - 1);
|
|
96
|
+
const { start, end, hiddenAbove, hiddenBelow } = computeFocusWindow(schedules.length, safeFocused, DASHBOARD_MAX_VISIBLE_ROWS);
|
|
97
|
+
const rows = schedules.slice(start, end).map((sched, vi) => {
|
|
98
|
+
const i = start + vi;
|
|
94
99
|
const isFocused = i === focusedRowIndex;
|
|
95
100
|
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [isFocused ? _jsx(Text, { bold: true, children: '> ' }) : _jsx(Text, { children: " " }), _jsx(ScheduleTypeBadge, { type: sched.type, paused: sched.paused, focused: isFocused }), _jsx(Text, { children: " " }), _jsxs(Text, { bold: isFocused, dimColor: !isFocused, children: [String(sched.message ?? '').slice(0, 25), (sched.message ?? '').length > 25 ? '…' : ''] })] }), _jsx(Box, { marginLeft: 2, children: _jsx(Text, { dimColor: true, children: sched.paused
|
|
96
101
|
? `paused by ${sched.pausedBy ?? '?'}`
|
|
@@ -115,7 +120,7 @@ function SchedulesList({ data, mutate, active = true }) {
|
|
|
115
120
|
removingScheduleIdRef.current = null;
|
|
116
121
|
} }));
|
|
117
122
|
}
|
|
118
|
-
return (_jsxs(Box, { flexDirection: "column", children: [rows, confirmModal] }));
|
|
123
|
+
return (_jsxs(Box, { flexDirection: "column", children: [hiddenAbove > 0 ? _jsxs(Text, { dimColor: true, children: ["\u2191 ", hiddenAbove, " more above"] }) : null, rows, hiddenBelow > 0 ? _jsxs(Text, { dimColor: true, children: ["\u2193 ", hiddenBelow, " more below"] }) : null, confirmModal] }));
|
|
119
124
|
}
|
|
120
125
|
function ScheduleTypeBadge({ type, paused, focused }) {
|
|
121
126
|
const color = paused ? 'yellow' : 'green';
|
|
@@ -5,6 +5,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
6
6
|
import { Box, Text, useInput } from 'ink';
|
|
7
7
|
import { ConfirmModal } from './ConfirmModal.js';
|
|
8
|
+
import { computeFocusWindow } from '../logic.js';
|
|
9
|
+
import { DASHBOARD_MAX_VISIBLE_ROWS } from './dashboard-constants.js';
|
|
8
10
|
// ── Component ──
|
|
9
11
|
export function DashboardTasksTab({ data, mutate, projectId, active = true }) {
|
|
10
12
|
if (data.loading && data.data.length === 0) {
|
|
@@ -174,12 +176,15 @@ function TasksList({ data, mutate, projectId, active = true }) {
|
|
|
174
176
|
}
|
|
175
177
|
}
|
|
176
178
|
// ── Task list ──
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
const safeFocused = Math.min(focusedIndex, tasks.length - 1);
|
|
180
|
+
const { start, end, hiddenAbove, hiddenBelow } = computeFocusWindow(tasks.length, safeFocused, DASHBOARD_MAX_VISIBLE_ROWS);
|
|
181
|
+
return (_jsxs(Box, { flexDirection: "column", children: [hiddenAbove > 0 ? _jsxs(Text, { dimColor: true, children: ["\u2191 ", hiddenAbove, " more above"] }) : null, tasks.slice(start, end).map((task, vi) => {
|
|
182
|
+
const i = start + vi;
|
|
183
|
+
const isFocused = i === focusedIndex;
|
|
184
|
+
const isLockBusy = lockBusyRows.has(i);
|
|
185
|
+
const hasError = errorState?.index === i;
|
|
186
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [isFocused ? _jsx(Text, { color: "cyan", children: "\u25B8 " }) : _jsx(Text, { children: " " }), _jsx(TaskStatusIcon, { status: task.status }), _jsx(Text, { children: " " }), _jsx(PriorityBadge, { priority: task.priority }), _jsx(Text, { children: " " }), _jsxs(Text, { bold: isFocused, children: [String(task.text ?? '').slice(0, 30), (task.text ?? '').length > 30 ? '…' : ''] })] }), _jsx(Box, { marginLeft: 2, children: _jsxs(Text, { dimColor: true, children: [task.claimedBy ? `👤 ${task.claimedBy}` : 'unclaimed', task.blockedBy ? ` | blocked: ${task.blockedBy}` : ''] }) }), isFocused && mutate ? (_jsx(Box, { marginLeft: 2, children: _jsx(Text, { dimColor: true, children: "[c] Claim [u] Unclaim [d] Done [b] Block [B] Unblock" }) })) : null, isLockBusy ? (_jsx(Box, { marginLeft: 2, children: _jsx(Text, { color: "yellow", children: "busy \u2014 another agent holds the lock (auto-expires in 20m)" }) })) : null, hasError ? (_jsx(Box, { marginLeft: 2, children: _jsxs(Text, { color: "red", children: [errorState.code, ": ", errorState.message] }) })) : null] }, task.id ?? i));
|
|
187
|
+
}), hiddenBelow > 0 ? _jsxs(Text, { dimColor: true, children: ["\u2193 ", hiddenBelow, " more below"] }) : null] }));
|
|
183
188
|
}
|
|
184
189
|
// ── Sub-components ──
|
|
185
190
|
function TaskStatusIcon({ status }) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
// input: TabData for threads tab
|
|
3
3
|
// output: Threads list — status icon + template name + step progress
|
|
4
4
|
// pos: Dashboard tab: read-only thread list
|
|
@@ -6,6 +6,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
import { useState, useEffect, useRef } from 'react';
|
|
7
7
|
import { Box, Text, useInput } from 'ink';
|
|
8
8
|
import { ConfirmModal } from './ConfirmModal.js';
|
|
9
|
+
import { computeFocusWindow } from '../logic.js';
|
|
10
|
+
import { DASHBOARD_MAX_VISIBLE_ROWS } from './dashboard-constants.js';
|
|
9
11
|
export function DashboardThreadsTab({ data, mutate, active = true }) {
|
|
10
12
|
const [focusedIndex, setFocusedIndex] = useState(0);
|
|
11
13
|
const [confirmingIndex, setConfirmingIndex] = useState(null);
|
|
@@ -66,7 +68,23 @@ export function DashboardThreadsTab({ data, mutate, active = true }) {
|
|
|
66
68
|
feedbackTimeoutRef.current = () => clearTimeout(timer);
|
|
67
69
|
}
|
|
68
70
|
setConfirmingIndex(null);
|
|
69
|
-
}, onCancel: () => setConfirmingIndex(null) })) : (
|
|
71
|
+
}, onCancel: () => setConfirmingIndex(null) })) : ((() => {
|
|
72
|
+
const safeFocused = Math.min(focusedIndex, data.data.length - 1);
|
|
73
|
+
const { start, end, hiddenAbove, hiddenBelow } = computeFocusWindow(data.data.length, safeFocused, DASHBOARD_MAX_VISIBLE_ROWS);
|
|
74
|
+
return (_jsxs(_Fragment, { children: [hiddenAbove > 0 ? _jsxs(Text, { dimColor: true, children: ["\u2191 ", hiddenAbove, " more above"] }) : null, data.data.slice(start, end).map((t, vi) => {
|
|
75
|
+
const i = start + vi;
|
|
76
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [i === focusedIndex ? _jsx(Text, { color: "cyan", children: "\u25B8 " }) : _jsx(Text, { children: " " }), _jsx(StatusIcon, { status: t.status }), _jsx(Text, { children: " " }), _jsx(Text, { bold: i === focusedIndex, children: t.templateName ?? 'unnamed' })] }), _jsx(Box, { marginLeft: 2, children: _jsxs(Text, { dimColor: true, children: [t.status, t.currentStep ? ` — step ${stepLabel(t.currentStep.index, t.totalSteps)}` : ''] }) }), alreadyTerminalRows.has(i) ? (_jsx(Box, { marginLeft: 2, children: _jsx(Text, { dimColor: true, children: "(already finished)" }) })) : null] }, t.id ?? i));
|
|
77
|
+
}), hiddenBelow > 0 ? _jsxs(Text, { dimColor: true, children: ["\u2193 ", hiddenBelow, " more below"] }) : null] }));
|
|
78
|
+
})()) }));
|
|
79
|
+
}
|
|
80
|
+
/** "<current>/<total>" step label. A completed thread can report a final step index at or
|
|
81
|
+
* past totalSteps (e.g. index 2 with 2 steps → "3/2"); clamp the numerator so the display
|
|
82
|
+
* never exceeds the total. */
|
|
83
|
+
function stepLabel(index, totalSteps) {
|
|
84
|
+
const current = index + 1;
|
|
85
|
+
if (totalSteps == null)
|
|
86
|
+
return String(current);
|
|
87
|
+
return `${Math.min(current, totalSteps)}/${totalSteps}`;
|
|
70
88
|
}
|
|
71
89
|
function StatusIcon({ status }) {
|
|
72
90
|
switch (status) {
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type SlashCommand } from '../slash-commands.js';
|
|
2
3
|
interface InputBoxProps {
|
|
3
4
|
onSubmit: (text: string) => void;
|
|
5
|
+
/** Run a slash command chosen from the palette. */
|
|
6
|
+
onCommand?: (name: string, args: string) => void;
|
|
7
|
+
/** Command registry shown in the palette. Defaults to the built-in set. */
|
|
8
|
+
commands?: SlashCommand[];
|
|
4
9
|
/** While true the user can still type, but Enter does not send (text preserved). */
|
|
5
10
|
awaitingResponse?: boolean;
|
|
6
11
|
/** Whether this input owns the keyboard (false when dashboard/modal has focus). */
|
|
7
12
|
focus?: boolean;
|
|
13
|
+
/** Whether the bottom shortcuts overlay is currently shown (any key dismisses it). */
|
|
14
|
+
showShortcuts?: boolean;
|
|
15
|
+
/** Toggle the shortcuts overlay (fired by '?' on an empty input). */
|
|
16
|
+
onToggleShortcuts?: () => void;
|
|
17
|
+
/** Dismiss the shortcuts overlay (fired by any key while it is shown). */
|
|
18
|
+
onDismissShortcuts?: () => void;
|
|
19
|
+
/** Optional turn-status line (state · time · turns · cost) rendered tight above the input. */
|
|
20
|
+
statusLine?: string | null;
|
|
21
|
+
/** Optional toast message (e.g. "Copied!") shown briefly in place of the status line. */
|
|
22
|
+
toast?: string | null;
|
|
8
23
|
}
|
|
9
|
-
|
|
24
|
+
declare function InputBoxImpl({ onSubmit, onCommand, commands, awaitingResponse, focus, showShortcuts, onToggleShortcuts, onDismissShortcuts, statusLine, toast }: InputBoxProps): React.JSX.Element;
|
|
25
|
+
export declare const InputBox: React.MemoExoticComponent<typeof InputBoxImpl>;
|
|
10
26
|
export {};
|
|
@@ -8,31 +8,217 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
// cancel) are ignored instead of leaking their letter into the message buffer.
|
|
9
9
|
// ink-text-input inserts the bare character for unhandled Ctrl combos, which left a
|
|
10
10
|
// stray 'd' in the box every time the dashboard was toggled.
|
|
11
|
-
import { useCallback, useState } from 'react';
|
|
12
|
-
import { Box, Text, useInput } from 'ink';
|
|
13
|
-
|
|
11
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
12
|
+
import { Box, Text, useInput, useStdin } from 'ink';
|
|
13
|
+
import { SlashMenu } from './SlashMenu.js';
|
|
14
|
+
import { SLASH_COMMANDS, parseSlashInput, filterSlashCommands, findSlashCommand } from '../slash-commands.js';
|
|
15
|
+
import { historyPrev, historyNext, pushHistory, isMouseSequence, cursorToRowCol, moveCursorVertical, sanitizePastedText, classifyDeleteChunk, } from '../logic.js';
|
|
16
|
+
// Memoized (React.memo below) so App re-renders driven by unrelated state (drag-selection,
|
|
17
|
+
// queued/notification counts, dashboard data) skip reconciling the input while it owns purely
|
|
18
|
+
// local editing state. It still re-renders when its own props change (statusLine/toast/focus/…).
|
|
19
|
+
function InputBoxImpl({ onSubmit, onCommand, commands = SLASH_COMMANDS, awaitingResponse, focus = true, showShortcuts = false, onToggleShortcuts, onDismissShortcuts, statusLine, toast }) {
|
|
14
20
|
const [value, setValue] = useState('');
|
|
15
21
|
const [cursor, setCursor] = useState(0);
|
|
22
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
23
|
+
// Input history (shell-style ↑/↓ recall of submitted messages).
|
|
24
|
+
const [history, setHistory] = useState([]);
|
|
25
|
+
const [histState, setHistState] = useState({ index: null, draft: '' });
|
|
26
|
+
// The `/` palette is open while the input starts with '/' and owns the keyboard.
|
|
27
|
+
const parsed = parseSlashInput(value);
|
|
28
|
+
const menuOpen = focus && parsed.isSlash && parsed.args.length === 0;
|
|
29
|
+
const matches = menuOpen ? filterSlashCommands(parsed.query, commands) : [];
|
|
30
|
+
const safeSelected = matches.length > 0 ? Math.min(selectedIndex, matches.length - 1) : 0;
|
|
31
|
+
const clear = useCallback(() => {
|
|
32
|
+
setValue('');
|
|
33
|
+
setCursor(0);
|
|
34
|
+
setSelectedIndex(0);
|
|
35
|
+
setHistState({ index: null, draft: '' });
|
|
36
|
+
}, []);
|
|
37
|
+
// Insert literal text at the cursor (used by typing, paste, and newline insertion).
|
|
38
|
+
const insertText = useCallback((text) => {
|
|
39
|
+
if (!text)
|
|
40
|
+
return;
|
|
41
|
+
setValue(v => v.slice(0, cursor) + text + v.slice(cursor));
|
|
42
|
+
setCursor(c => c + text.length);
|
|
43
|
+
setSelectedIndex(0);
|
|
44
|
+
setHistState({ index: null, draft: '' }); // editing detaches history navigation
|
|
45
|
+
}, [cursor]);
|
|
16
46
|
const handleSubmit = useCallback((text) => {
|
|
17
47
|
if (awaitingResponse)
|
|
18
48
|
return; // block send, keep typed text
|
|
19
49
|
if (text.trim().length === 0)
|
|
20
50
|
return;
|
|
21
51
|
onSubmit(text);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}, [awaitingResponse, onSubmit]);
|
|
52
|
+
setHistory(h => pushHistory(h, text));
|
|
53
|
+
clear();
|
|
54
|
+
}, [awaitingResponse, onSubmit, clear]);
|
|
55
|
+
// Apply a history-navigation result to the input buffer.
|
|
56
|
+
const applyHistory = useCallback((next) => {
|
|
57
|
+
setValue(next.value);
|
|
58
|
+
setCursor(next.value.length);
|
|
59
|
+
setHistState(next.state);
|
|
60
|
+
setSelectedIndex(0);
|
|
61
|
+
}, []);
|
|
62
|
+
// Run a slash command id, or fall back to sending the raw text as a message.
|
|
63
|
+
const runSlash = useCallback(() => {
|
|
64
|
+
const exact = findSlashCommand(parsed.query, commands);
|
|
65
|
+
const chosen = exact ?? matches[safeSelected] ?? null;
|
|
66
|
+
if (chosen && onCommand) {
|
|
67
|
+
onCommand(chosen.name, parsed.args);
|
|
68
|
+
clear();
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
// No matching command — send the typed text through as a normal message so the
|
|
72
|
+
// server's own command dispatch (or a plain message) still gets a chance.
|
|
73
|
+
handleSubmit(value);
|
|
74
|
+
}, [parsed.query, parsed.args, matches, safeSelected, onCommand, commands, handleSubmit, value, clear]);
|
|
75
|
+
const isMultiline = value.includes('\n');
|
|
76
|
+
// Cursor position as (row, col) for the multi-line render below.
|
|
77
|
+
const { row: cursorRow, col: cursorCol } = cursorToRowCol(value, cursor);
|
|
78
|
+
// ── Raw stdin handler for Backspace vs forward-Delete ──
|
|
79
|
+
// Ink can't distinguish them in useInput (both are `key.delete`), so we read the raw chunk from
|
|
80
|
+
// Ink's internal input emitter (the same feed useMouseHandler uses) and classify it. A ref keeps
|
|
81
|
+
// the latest value/cursor/focus so the (once-subscribed) listener never goes stale.
|
|
82
|
+
const editRef = useRef({ value, cursor, focus });
|
|
83
|
+
editRef.current = { value, cursor, focus };
|
|
84
|
+
const { internal_eventEmitter } = useStdin();
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
const emitter = internal_eventEmitter;
|
|
87
|
+
if (!emitter)
|
|
88
|
+
return;
|
|
89
|
+
const onChunk = (chunk) => {
|
|
90
|
+
const s = typeof chunk === 'string' ? chunk : chunk.toString('utf8');
|
|
91
|
+
// Shift+Enter (kitty CSI u protocol): ESC[13;2u -> insert newline
|
|
92
|
+
if (s === '\x1b[13;2u') {
|
|
93
|
+
const { value: v, cursor: c, focus: f } = editRef.current;
|
|
94
|
+
if (!f)
|
|
95
|
+
return;
|
|
96
|
+
setValue(v.slice(0, c) + '\n' + v.slice(c));
|
|
97
|
+
setCursor(c + 1);
|
|
98
|
+
setSelectedIndex(0);
|
|
99
|
+
setHistState({ index: null, draft: '' });
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const kind = classifyDeleteChunk(s);
|
|
103
|
+
if (!kind)
|
|
104
|
+
return;
|
|
105
|
+
const { value: v, cursor: c, focus: f } = editRef.current;
|
|
106
|
+
if (!f)
|
|
107
|
+
return; // only edit when the input owns the keyboard
|
|
108
|
+
if (kind === 'backspace') {
|
|
109
|
+
if (c > 0) {
|
|
110
|
+
setValue(v.slice(0, c - 1) + v.slice(c));
|
|
111
|
+
setCursor(c - 1);
|
|
112
|
+
setSelectedIndex(0);
|
|
113
|
+
setHistState({ index: null, draft: '' });
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else { // forward-delete: remove the char AFTER the cursor, cursor stays put
|
|
117
|
+
if (c < v.length) {
|
|
118
|
+
setValue(v.slice(0, c) + v.slice(c + 1));
|
|
119
|
+
setSelectedIndex(0);
|
|
120
|
+
setHistState({ index: null, draft: '' });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
emitter.on('input', onChunk);
|
|
125
|
+
return () => { emitter.removeListener('input', onChunk); };
|
|
126
|
+
}, [internal_eventEmitter]);
|
|
25
127
|
useInput((input, key) => {
|
|
26
|
-
//
|
|
27
|
-
if (
|
|
128
|
+
// While the shortcuts overlay is shown, ANY key just dismisses it (no other action).
|
|
129
|
+
if (showShortcuts) {
|
|
130
|
+
onDismissShortcuts?.();
|
|
28
131
|
return;
|
|
29
|
-
|
|
30
|
-
|
|
132
|
+
}
|
|
133
|
+
// ── Newline insertion (multi-line input) ──
|
|
134
|
+
// Alt/Option+Enter inserts a literal newline (terminal-dependent). The terminal-agnostic
|
|
135
|
+
// fallback is a trailing backslash + Enter (handled in the Enter branch below).
|
|
136
|
+
if (key.return && key.meta) {
|
|
137
|
+
insertText('\n');
|
|
31
138
|
return;
|
|
32
|
-
|
|
33
|
-
|
|
139
|
+
}
|
|
140
|
+
// ── Bracketed paste (wrapped in ESC[200~ … ESC[201~, possibly with the ESC already stripped
|
|
141
|
+
// by Ink so it arrives as a bare [200~ / [201~) ──
|
|
142
|
+
// Strip the markers + escape residue and insert literally (newlines included) so a multi-line
|
|
143
|
+
// paste never submits per embedded Enter. Handled before the modifier guard (a paste carries
|
|
144
|
+
// no ctrl/meta) so it cannot be mistaken for a key.
|
|
145
|
+
// eslint-disable-next-line no-control-regex
|
|
146
|
+
if (/(?:\x1b)?\[20[01]~/.test(input)) {
|
|
147
|
+
insertText(sanitizePastedText(input));
|
|
34
148
|
return;
|
|
35
149
|
}
|
|
150
|
+
// Ignore modifier combos so global hotkeys never leak their letter into the box.
|
|
151
|
+
if (key.ctrl || key.meta)
|
|
152
|
+
return;
|
|
153
|
+
// ── Palette navigation (only while the menu owns the input) ──
|
|
154
|
+
if (menuOpen) {
|
|
155
|
+
if (key.upArrow) {
|
|
156
|
+
setSelectedIndex(i => Math.max(0, i - 1));
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (key.downArrow) {
|
|
160
|
+
setSelectedIndex(i => Math.min(Math.max(0, matches.length - 1), i + 1));
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (key.escape) {
|
|
164
|
+
clear();
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (key.tab) {
|
|
168
|
+
// Complete the highlighted command into the buffer (ready for args).
|
|
169
|
+
const chosen = matches[safeSelected];
|
|
170
|
+
if (chosen) {
|
|
171
|
+
const next = `/${chosen.name} `;
|
|
172
|
+
setValue(next);
|
|
173
|
+
setCursor(next.length);
|
|
174
|
+
setSelectedIndex(0);
|
|
175
|
+
}
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (key.return) {
|
|
179
|
+
runSlash();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
// fall through to normal editing (typing filters the menu)
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
// Escape / Tab are owned by other zones; PgUp/PgDn scroll the transcript.
|
|
186
|
+
if (key.escape || key.tab || key.pageUp || key.pageDown)
|
|
187
|
+
return;
|
|
188
|
+
// ↑/↓: in multi-line input they move the cursor between lines; otherwise they cycle the
|
|
189
|
+
// shell-style input history.
|
|
190
|
+
if (key.upArrow) {
|
|
191
|
+
if (isMultiline) {
|
|
192
|
+
setCursor(c => moveCursorVertical(value, c, -1));
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
applyHistory(historyPrev(history, histState, value));
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (key.downArrow) {
|
|
199
|
+
if (isMultiline) {
|
|
200
|
+
setCursor(c => moveCursorVertical(value, c, 1));
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
applyHistory(historyNext(history, histState, value));
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (key.return) {
|
|
207
|
+
// Trailing backslash + Enter → newline (terminal-agnostic multi-line entry).
|
|
208
|
+
if (cursor > 0 && value[cursor - 1] === '\\') {
|
|
209
|
+
setValue(v => v.slice(0, cursor - 1) + '\n' + v.slice(cursor));
|
|
210
|
+
setHistState({ index: null, draft: '' });
|
|
211
|
+
return; // cursor index is unchanged: it now sits just after the inserted newline
|
|
212
|
+
}
|
|
213
|
+
// A slash invocation with args (menu closed) still runs the command, forwarding args.
|
|
214
|
+
if (parsed.isSlash) {
|
|
215
|
+
runSlash();
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
handleSubmit(value);
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
36
222
|
if (key.leftArrow) {
|
|
37
223
|
setCursor(c => Math.max(0, c - 1));
|
|
38
224
|
return;
|
|
@@ -41,18 +227,48 @@ export function InputBox({ onSubmit, awaitingResponse, focus = true }) {
|
|
|
41
227
|
setCursor(c => Math.min(value.length, c + 1));
|
|
42
228
|
return;
|
|
43
229
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
230
|
+
// NOTE: Backspace / forward-Delete are NOT handled here. Ink reports BOTH the Backspace key
|
|
231
|
+
// (\x7f) and the forward-Delete key (\x1b[3~) as `key.delete` with empty input, so they can't
|
|
232
|
+
// be told apart in useInput. They're handled from the raw stdin chunk instead (see the
|
|
233
|
+
// useEffect below), which can distinguish them via classifyDeleteChunk.
|
|
234
|
+
if (key.backspace || key.delete)
|
|
235
|
+
return;
|
|
236
|
+
// Drop mouse-tracking escape residue (e.g. "[<64;30;10M") that Ink forwards as text when
|
|
237
|
+
// SGR mouse mode is on — it must never land in the message buffer.
|
|
238
|
+
if (isMouseSequence(input))
|
|
239
|
+
return;
|
|
240
|
+
// A multi-character chunk (terminal without bracketed paste, or a fast paste) is text — insert
|
|
241
|
+
// it literally so multi-line pastes keep their newlines instead of triggering a submit.
|
|
242
|
+
if (input.length > 1) {
|
|
243
|
+
insertText(sanitizePastedText(input));
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
// '?' on an empty input toggles the shortcuts overlay instead of typing a literal '?'.
|
|
247
|
+
if (input === '?' && value.length === 0 && !menuOpen) {
|
|
248
|
+
onToggleShortcuts?.();
|
|
49
249
|
return;
|
|
50
250
|
}
|
|
51
|
-
//
|
|
251
|
+
// Single printable character.
|
|
52
252
|
if (input && input.length > 0) {
|
|
53
|
-
|
|
54
|
-
setCursor(c => c + input.length);
|
|
253
|
+
insertText(input);
|
|
55
254
|
}
|
|
56
255
|
}, { isActive: focus });
|
|
57
|
-
return (
|
|
256
|
+
return (
|
|
257
|
+
// flexShrink={0}: the input must NEVER be squeezed by the transcript. If the transcript's line
|
|
258
|
+
// slice momentarily exceeds its flex height (a transition where reservedRows lags the actual
|
|
259
|
+
// bottom height), Ink would otherwise shrink the input's content box to 0 — leaving the two
|
|
260
|
+
// borders touching with "Type a message..." overrunning the bottom border. Pinning the input's
|
|
261
|
+
// size forces the (flex-end) transcript to absorb the overflow by clipping its top instead.
|
|
262
|
+
_jsxs(Box, { flexDirection: "column", marginTop: 1, flexShrink: 0, children: [menuOpen ? _jsx(SlashMenu, { commands: matches, selectedIndex: safeSelected }) : null, toast ? _jsx(Text, { color: "cyan", dimColor: true, children: toast })
|
|
263
|
+
: statusLine ? _jsx(Text, { dimColor: true, children: statusLine })
|
|
264
|
+
: null, _jsx(Box, { borderStyle: "single", borderDimColor: true, paddingX: 1, children: _jsx(Box, { flexDirection: "column", flexGrow: 1, children: value.length === 0 && !focus ? (_jsx(Text, { dimColor: true, children: "Type a message..." })) : value.length === 0 ? (_jsxs(Text, { children: [_jsx(Text, { inverse: true, children: " " }), _jsx(Text, { dimColor: true, children: "Type a message..." })] })) : (
|
|
265
|
+
// Multi-line aware: render each logical line; on the cursor's row draw the inverse
|
|
266
|
+
// cursor block. A single-line value collapses to one row (identical to the old look).
|
|
267
|
+
value.split('\n').map((line, r) => {
|
|
268
|
+
if (focus && r === cursorRow) {
|
|
269
|
+
return (_jsxs(Text, { children: [line.slice(0, cursorCol), _jsx(Text, { inverse: true, children: line.slice(cursorCol, cursorCol + 1) || ' ' }), line.slice(cursorCol + 1)] }, r));
|
|
270
|
+
}
|
|
271
|
+
return _jsx(Text, { children: line.length > 0 ? line : ' ' }, r);
|
|
272
|
+
})) }) }), awaitingResponse ? (_jsx(Text, { dimColor: true, children: "Waiting for response \u2014 Enter is disabled until the agent replies (Ctrl+C to cancel)" })) : null] }));
|
|
58
273
|
}
|
|
274
|
+
export const InputBox = React.memo(InputBoxImpl);
|
|
@@ -19,9 +19,14 @@ export function NotificationsModal({ open, notifications, ids, onMarkRead, onClo
|
|
|
19
19
|
setFocusedId(null);
|
|
20
20
|
}
|
|
21
21
|
}, [open]);
|
|
22
|
-
useInput((
|
|
22
|
+
useInput((input, key) => {
|
|
23
23
|
if (!open)
|
|
24
24
|
return;
|
|
25
|
+
// Re-pressing the toggle hotkey (Ctrl+N) closes the panel, same as Esc.
|
|
26
|
+
if (input === 'n' && key.ctrl) {
|
|
27
|
+
onClose();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
25
30
|
if (key.escape) {
|
|
26
31
|
if (focusedId) {
|
|
27
32
|
setFocusedId(null); // Back to list
|
|
@@ -68,5 +73,5 @@ export function NotificationsModal({ open, notifications, ids, onMarkRead, onClo
|
|
|
68
73
|
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, borderStyle: "single", paddingX: 1, children: [_jsx(Text, { bold: true, children: notif.title }), _jsxs(Text, { dimColor: true, children: [notif.kind, " | ", new Date(notif.ts).toLocaleTimeString()] }), _jsx(Text, { children: notif.body }), _jsx(Text, { dimColor: true, children: "\u2014 Press Enter to mark read, Esc to go back" })] }, id));
|
|
69
74
|
}
|
|
70
75
|
return (_jsxs(Box, { marginBottom: 0, children: [_jsx(Text, { children: i === selectedIdx ? '▶' : ' ' }), _jsx(Text, { children: " " }), _jsx(Text, { dimColor: notif.read, children: notif.read ? '✓' : '○' }), _jsx(Text, { children: " " }), _jsxs(Text, { bold: !notif.read, dimColor: notif.read, children: [String(notif.title).slice(0, 30), notif.title.length > 30 ? '…' : ''] })] }, id));
|
|
71
|
-
})) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "\u2191/\u2193 navigate \u00B7 Enter detail \u00B7 Esc close" }) })] }));
|
|
76
|
+
})) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "\u2191/\u2193 navigate \u00B7 Enter detail \u00B7 Ctrl+N/Esc close" }) })] }));
|
|
72
77
|
}
|
|
@@ -13,9 +13,14 @@ export function ProjectSwitcher({ open, projects, loading, error, onSelect, onCl
|
|
|
13
13
|
onRequestRefresh();
|
|
14
14
|
}
|
|
15
15
|
}, [open, onRequestRefresh]);
|
|
16
|
-
useInput((
|
|
16
|
+
useInput((input, key) => {
|
|
17
17
|
if (!open)
|
|
18
18
|
return;
|
|
19
|
+
// Re-pressing the toggle hotkey (Ctrl+P) closes the panel, same as Esc.
|
|
20
|
+
if (input === 'p' && key.ctrl) {
|
|
21
|
+
onClose();
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
19
24
|
if (key.escape) {
|
|
20
25
|
onClose();
|
|
21
26
|
return;
|
|
@@ -39,5 +44,5 @@ export function ProjectSwitcher({ open, projects, loading, error, onSelect, onCl
|
|
|
39
44
|
});
|
|
40
45
|
if (!open)
|
|
41
46
|
return null;
|
|
42
|
-
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, paddingY: 1, children: [_jsx(Text, { bold: true, children: "Switch Project" }), loading ? (_jsx(Text, { dimColor: true, children: "Loading projects..." })) : error ? (_jsxs(Text, { color: "red", children: ["Error: ", error] })) : projects.length === 0 ? (_jsx(Text, { dimColor: true, children: "No projects found" })) : (_jsx(Box, { flexDirection: "column", marginTop: 1, children: projects.map((proj, i) => (_jsxs(Box, { marginBottom: 0, children: [_jsx(Text, { children: i === selectedIdx ? '▶' : ' ' }), _jsx(Text, { children: " " }), _jsx(Text, { bold: i === selectedIdx, children: proj.id }), proj.kind ? _jsxs(Text, { dimColor: true, children: [" (", proj.kind, ")"] }) : null, proj.hasMission ? _jsx(Text, { color: "green", children: " \u2605" }) : null] }, proj.id))) })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "\u2191/\u2193 navigate \u00B7 Enter switch \u00B7 Esc cancel" }) })] }));
|
|
47
|
+
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, paddingY: 1, children: [_jsx(Text, { bold: true, children: "Switch Project" }), loading ? (_jsx(Text, { dimColor: true, children: "Loading projects..." })) : error ? (_jsxs(Text, { color: "red", children: ["Error: ", error] })) : projects.length === 0 ? (_jsx(Text, { dimColor: true, children: "No projects found" })) : (_jsx(Box, { flexDirection: "column", marginTop: 1, children: projects.map((proj, i) => (_jsxs(Box, { marginBottom: 0, children: [_jsx(Text, { children: i === selectedIdx ? '▶' : ' ' }), _jsx(Text, { children: " " }), _jsx(Text, { bold: i === selectedIdx, children: proj.id }), proj.kind ? _jsxs(Text, { dimColor: true, children: [" (", proj.kind, ")"] }) : null, proj.hasMission ? _jsx(Text, { color: "green", children: " \u2605" }) : null] }, proj.id))) })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "\u2191/\u2193 navigate \u00B7 Enter switch \u00B7 Ctrl+P/Esc cancel" }) })] }));
|
|
43
48
|
}
|
|
@@ -4,6 +4,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
// pos: Pick a session to resume before the main App renders
|
|
5
5
|
import { useState } from 'react';
|
|
6
6
|
import { Box, Text, useInput } from 'ink';
|
|
7
|
+
import { computeFocusWindow } from '../logic.js';
|
|
8
|
+
/** Max session rows shown at once — the list is windowed around the selection so a long
|
|
9
|
+
* session history can't overflow the terminal (Ink can't clear rows scrolled past the
|
|
10
|
+
* top, which left permanent ghost rows and hid the header/nav hint). */
|
|
11
|
+
const PICKER_MAX_VISIBLE = 12;
|
|
7
12
|
export function SessionPicker({ sessions, onSelect, onCancel }) {
|
|
8
13
|
const [selectedIdx, setSelectedIdx] = useState(0);
|
|
9
14
|
useInput((_input, key) => {
|
|
@@ -30,5 +35,9 @@ export function SessionPicker({ sessions, onSelect, onCancel }) {
|
|
|
30
35
|
if (sessions.length === 0) {
|
|
31
36
|
return _jsx(Text, { dimColor: true, children: "No resumable sessions" });
|
|
32
37
|
}
|
|
33
|
-
|
|
38
|
+
const { start, end, hiddenAbove, hiddenBelow } = computeFocusWindow(sessions.length, selectedIdx, PICKER_MAX_VISIBLE);
|
|
39
|
+
return (_jsxs(Box, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [_jsxs(Text, { bold: true, children: ["Select a session to resume (", sessions.length, "):"] }), _jsxs(Box, { flexDirection: "column", marginTop: 1, children: [hiddenAbove > 0 ? _jsxs(Text, { dimColor: true, children: [" \u2191 ", hiddenAbove, " more above"] }) : null, sessions.slice(start, end).map((s, vi) => {
|
|
40
|
+
const i = start + vi;
|
|
41
|
+
return (_jsxs(Box, { marginBottom: 0, children: [_jsx(Text, { children: i === selectedIdx ? '▶' : ' ' }), _jsx(Text, { children: " " }), _jsx(Text, { bold: i === selectedIdx, children: s.name }), _jsxs(Text, { dimColor: true, children: [" (", s.projectId, ")"] }), s.label ? _jsxs(Text, { dimColor: true, children: [" \u2014 ", s.label] }) : null] }, s.sessionId));
|
|
42
|
+
}), hiddenBelow > 0 ? _jsxs(Text, { dimColor: true, children: [" \u2193 ", hiddenBelow, " more below"] }) : null] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "\u2191/\u2193 navigate \u00B7 Enter resume \u00B7 Esc fresh session" }) })] }));
|
|
34
43
|
}
|
|
@@ -14,6 +14,8 @@ interface SidePanelProps {
|
|
|
14
14
|
activeTab: string;
|
|
15
15
|
onSetActiveTab: (tab: string) => void;
|
|
16
16
|
onMutate?: (op: string, args: Record<string, unknown>) => Promise<MutateResult>;
|
|
17
|
+
/** Close the panel (Esc while the dashboard owns the keyboard). */
|
|
18
|
+
onClose?: () => void;
|
|
17
19
|
}
|
|
18
|
-
export declare function SidePanel({ visible, active, sendFrame, projectId, dashState, onMarkPending, onRegisterSubscription, onUnregisterSubscription, activeTab, onSetActiveTab, onMutate, }: SidePanelProps): React.JSX.Element | null;
|
|
20
|
+
export declare function SidePanel({ visible, active, sendFrame, projectId, dashState, onMarkPending, onRegisterSubscription, onUnregisterSubscription, activeTab, onSetActiveTab, onMutate, onClose, }: SidePanelProps): React.JSX.Element | null;
|
|
19
21
|
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from 'ink';
|
|
3
3
|
import { Dashboard } from './Dashboard.js';
|
|
4
|
-
export function SidePanel({ visible, active, sendFrame, projectId, dashState, onMarkPending, onRegisterSubscription, onUnregisterSubscription, activeTab, onSetActiveTab, onMutate, }) {
|
|
4
|
+
export function SidePanel({ visible, active, sendFrame, projectId, dashState, onMarkPending, onRegisterSubscription, onUnregisterSubscription, activeTab, onSetActiveTab, onMutate, onClose, }) {
|
|
5
5
|
if (!visible)
|
|
6
6
|
return null;
|
|
7
|
-
|
|
7
|
+
// No marginLeft: the parent row centers this panel horizontally (App.tsx wraps the row in
|
|
8
|
+
// justifyContent="center"). Width stays fixed so the dashboard reads as a centered card.
|
|
9
|
+
return (_jsx(Box, { width: 44, borderStyle: "single", borderDimColor: true, flexShrink: 0, children: _jsx(Dashboard, { active: active, sendFrame: sendFrame, projectId: projectId, dashState: dashState, onMarkPending: onMarkPending, onRegisterSubscription: onRegisterSubscription, onUnregisterSubscription: onUnregisterSubscription, activeTab: activeTab, onSetActiveTab: onSetActiveTab, mutate: onMutate, onClose: onClose }) }));
|
|
8
10
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SlashCommand } from '../slash-commands.js';
|
|
3
|
+
interface SlashMenuProps {
|
|
4
|
+
commands: SlashCommand[];
|
|
5
|
+
selectedIndex: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function SlashMenu({ commands, selectedIndex }: SlashMenuProps): React.JSX.Element;
|
|
8
|
+
export {};
|