@cortex-agent/server 2026.10.2 → 2026.10.6
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 +31 -31
- package/defaults/AGENTS.md +3 -3
- package/defaults/config/{thread-templates/agents/direct.json → environments/main.json} +2 -2
- package/defaults/context/AGENTS.md +0 -2
- package/defaults/context/projects/AGENTS.md +0 -2
- package/defaults/context/user/AGENTS.md +1 -1
- package/defaults/hooks/cortex-hook-api.mjs +1 -3
- package/defaults/hooks/new-session-hook.mjs +2 -3
- package/defaults/hooks/status-md-guard.mjs +5 -5
- package/defaults/plugins/cortex-system/.claude-plugin/plugin.json +2 -2
- package/defaults/plugins/cortex-system/plugin.json +2 -2
- package/defaults/plugins/cortex-system/skills/project-init/SKILL.md +4 -4
- package/defaults/plugins/cortex-system/skills/schedule/SKILL.md +11 -13
- package/defaults/plugins/cortex-system/skills/user-learn/SKILL.md +1 -1
- package/defaults/prompts/systemPrompts/web-opus-4-6.md +2 -2
- package/defaults/prompts/systemPrompts/web-sonnet-4-6.md +2 -2
- package/defaults/rules/issues-md.md +2 -2
- package/defaults/rules/meta-conventions.md +1 -2
- package/defaults/rules/mission-md.md +1 -1
- package/defaults/rules/overview-md.md +1 -1
- package/defaults/rules/roadmap-md.md +1 -1
- package/defaults/rules/status-md.md +4 -4
- package/dist/agent-adapter/claude/adapter.d.ts +6 -1
- package/dist/agent-adapter/claude/adapter.js +15 -4
- package/dist/agent-adapter/claude/compact-window.d.ts +11 -3
- package/dist/agent-adapter/claude/compact-window.js +12 -3
- package/dist/agent-adapter/claude/defaults.d.ts +0 -1
- package/dist/agent-adapter/claude/defaults.js +0 -1
- package/dist/agent-adapter/claude/event-translator.d.ts +2 -2
- package/dist/agent-adapter/claude/event-translator.js +2 -1
- package/dist/agent-adapter/claude/hooks-builder.d.ts +0 -5
- package/dist/agent-adapter/claude/hooks-builder.js +0 -13
- package/dist/agent-adapter/claude/spawn-args.d.ts +5 -12
- package/dist/agent-adapter/claude/spawn-args.js +45 -38
- package/dist/agent-adapter/claude/turn-machine.d.ts +2 -2
- package/dist/agent-adapter/claude/turn-machine.js +6 -3
- package/dist/agent-adapter/continuation-phase.js +2 -1
- package/dist/agent-adapter/normalize/event-types.d.ts +4 -1
- package/dist/agent-adapter/normalize/tool-result-images.d.ts +11 -0
- package/dist/agent-adapter/normalize/tool-result-images.js +32 -0
- package/dist/agent-adapter/pi/child-events.js +3 -0
- package/dist/agent-adapter/pi/child-runner.d.ts +1 -2
- package/dist/agent-adapter/pi/child-runner.js +6 -6
- package/dist/agent-adapter/pi/child-session.d.ts +1 -1
- package/dist/agent-adapter/pi/event-parser.d.ts +13 -2
- package/dist/agent-adapter/pi/event-parser.js +38 -11
- package/dist/agent-adapter/pi/mcp-bridge-logic.d.ts +0 -1
- package/dist/agent-adapter/pi/mcp-bridge-logic.js +0 -3
- package/dist/agent-adapter/pi/mcp-bridge.js +4 -4
- package/dist/agent-adapter/pi/pi-session.d.ts +4 -2
- package/dist/agent-adapter/pi/pi-session.js +18 -9
- package/dist/agent-adapter/pi/runtime-settings.d.ts +7 -0
- package/dist/agent-adapter/pi/runtime-settings.js +23 -0
- package/dist/agent-adapter/pi/runtime.d.ts +2 -3
- package/dist/agent-adapter/pi/session-options.d.ts +4 -1
- package/dist/agent-adapter/pi/session-options.js +13 -21
- package/dist/agent-adapter/pi/session-support.d.ts +2 -0
- package/dist/agent-adapter/run-events.d.ts +3 -1
- package/dist/agent-adapter/types.d.ts +6 -12
- package/dist/agent-adapter/types.js +2 -4
- package/dist/core/agents/roles.d.ts +1 -1
- package/dist/core/agents/subagent/attribution.js +1 -0
- package/dist/core/agents/subagent/catalog.d.ts +8 -0
- package/dist/core/agents/subagent/catalog.js +21 -10
- package/dist/core/agents/subagent/types.d.ts +4 -1
- package/dist/core/config-generator.d.ts +0 -6
- package/dist/core/config-generator.js +1 -35
- package/dist/core/icons.d.ts +33 -33
- package/dist/core/locales/en.d.ts +863 -1030
- package/dist/core/locales/slices/commands.d.ts +282 -349
- package/dist/core/locales/slices/commands.js +20 -160
- package/dist/core/locales/slices/init.d.ts +152 -152
- package/dist/core/locales/slices/interactions.d.ts +44 -45
- package/dist/core/locales/slices/interactions.js +0 -4
- package/dist/core/locales/slices/lang.d.ts +5 -5
- package/dist/core/locales/slices/notices.d.ts +75 -118
- package/dist/core/locales/slices/notices.js +13 -99
- package/dist/core/locales/slices/scheduling.d.ts +31 -31
- package/dist/core/locales/slices/startup.d.ts +5 -5
- package/dist/core/locales/slices/status.d.ts +43 -43
- package/dist/core/locales/slices/tui.d.ts +91 -114
- package/dist/core/locales/slices/tui.js +0 -46
- package/dist/core/locales/slices/uiextra.d.ts +41 -61
- package/dist/core/locales/slices/uiextra.js +11 -51
- package/dist/core/locales/slices/uimsg.d.ts +86 -99
- package/dist/core/locales/slices/uimsg.js +6 -32
- package/dist/core/mcp-bundles.d.ts +1 -1
- package/dist/core/mcp-bundles.js +7 -5
- package/dist/core/mcp-tool-gate.js +8 -5
- package/dist/core/platform-settings-spec.d.ts +3 -3
- package/dist/core/production-benchmark-evidence.d.ts +1 -9
- package/dist/core/production-benchmark-evidence.js +0 -22
- package/dist/core/rebuild-progress.d.ts +3 -2
- package/dist/core/rebuild-progress.js +5 -2
- package/dist/core/run-registry.d.ts +7 -28
- package/dist/core/run-registry.js +6 -51
- package/dist/core/session-retention-liveness.d.ts +0 -2
- package/dist/core/session-retention-liveness.js +0 -13
- package/dist/core/session-state.d.ts +1 -2
- package/dist/core/session-state.js +2 -3
- package/dist/core/settings-spec.d.ts +19 -60
- package/dist/core/settings-spec.js +30 -60
- package/dist/core/status-format.d.ts +0 -14
- package/dist/core/status-format.js +2 -24
- package/dist/core/types/agent-types.d.ts +26 -9
- package/dist/core/types/benchmark-types.d.ts +17 -0
- package/dist/core/types/environment-types.d.ts +64 -0
- package/dist/core/types/environment-types.js +1 -0
- package/dist/core/utils.d.ts +14 -4
- package/dist/core/utils.js +32 -6
- package/dist/domain/agents/agent-switch.js +2 -4
- package/dist/domain/agents/config.js +1 -1
- package/dist/domain/agents/environments/entities.d.ts +49 -0
- package/dist/domain/agents/environments/entities.js +94 -0
- package/dist/domain/agents/environments/file-refs.d.ts +19 -0
- package/dist/domain/agents/environments/file-refs.js +48 -0
- package/dist/domain/agents/environments/index.d.ts +6 -0
- package/dist/domain/agents/environments/index.js +8 -0
- package/dist/domain/agents/environments/paths.d.ts +7 -0
- package/dist/domain/agents/environments/paths.js +9 -0
- package/dist/domain/{threads/template-resolver.js → agents/environments/prompt-includes.js} +2 -2
- package/dist/domain/agents/environments/registry.d.ts +17 -0
- package/dist/domain/agents/environments/registry.js +159 -0
- package/dist/domain/agents/environments/schema.d.ts +68 -0
- package/dist/domain/agents/environments/schema.js +111 -0
- package/dist/domain/agents/environments/schema.parity.d.ts +1 -0
- package/dist/domain/agents/environments/schema.parity.js +7 -0
- package/dist/domain/agents/environments/slot-config.d.ts +14 -0
- package/dist/domain/agents/environments/slot-config.js +78 -0
- package/dist/domain/agents/model-selection.d.ts +3 -0
- package/dist/domain/agents/model-selection.js +1 -1
- package/dist/domain/agents/subagent/runner.js +3 -2
- package/dist/domain/benchmark/accounting-reconciliation.d.ts +1 -1
- package/dist/domain/benchmark/atif.d.ts +4 -4
- package/dist/domain/benchmark/atif.js +7 -7
- package/dist/domain/benchmark/attempt-record.d.ts +16 -55
- package/dist/domain/benchmark/attempt-record.js +3 -17
- package/dist/domain/benchmark/composite-manifest.d.ts +4 -4
- package/dist/domain/benchmark/composite-manifest.js +5 -11
- package/dist/domain/benchmark/journal.d.ts +6 -4
- package/dist/domain/benchmark/journal.js +6 -4
- package/dist/domain/benchmark/manifest-contract.d.ts +1 -1
- package/dist/domain/benchmark/production-attempt-identity.d.ts +11 -16
- package/dist/domain/benchmark/production-attempt-identity.js +31 -94
- package/dist/domain/benchmark/production-attempt-journal.js +14 -7
- package/dist/domain/benchmark/production-evidence-journal.js +8 -6
- package/dist/domain/benchmark/production-evidence-projection.d.ts +1 -11
- package/dist/domain/benchmark/production-evidence-projection.js +32 -143
- package/dist/domain/benchmark/session-evidence.d.ts +6 -0
- package/dist/domain/benchmark/session-evidence.js +27 -0
- package/dist/domain/costs/cost-tracker.d.ts +1 -7
- package/dist/domain/costs/cost-tracker.js +0 -4
- package/dist/domain/costs/resume-registry.d.ts +9 -20
- package/dist/domain/costs/resume-registry.js +24 -39
- package/dist/domain/executions/registry.d.ts +3 -18
- package/dist/domain/executions/registry.js +4 -158
- package/dist/domain/mcp/bundled-server.js +20 -27
- package/dist/domain/mcp/tools/commission-tools.js +0 -1
- package/dist/domain/mcp/tools/context.d.ts +2 -9
- package/dist/domain/mcp/tools/context.js +2 -7
- package/dist/domain/mcp/tools/executions.js +6 -19
- package/dist/domain/mcp/tools/interaction-ask.js +0 -1
- package/dist/domain/mcp/tools/interaction-plan.d.ts +0 -1
- package/dist/domain/mcp/tools/interaction-plan.js +0 -2
- package/dist/domain/mcp/tools/{task-ops.d.ts → remote-ops.d.ts} +1 -1
- package/dist/domain/mcp/tools/{task-ops.js → remote-ops.js} +1 -1
- package/dist/domain/mcp/tools/schedule.d.ts +3 -3
- package/dist/domain/mcp/tools/schedule.js +10 -32
- package/dist/domain/mcp/tools/subagent.d.ts +4 -0
- package/dist/domain/mcp/tools/subagent.js +10 -8
- package/dist/domain/mcp/tools/ui-view.js +3 -2
- package/dist/domain/mcp/tools/waitpoint.js +2 -3
- package/dist/domain/mcp/tools/{thread-ops.d.ts → workers.d.ts} +1 -1
- package/dist/domain/mcp/tools/workers.js +84 -0
- package/dist/domain/memory/user-context.d.ts +2 -3
- package/dist/domain/memory/user-context.js +2 -3
- package/dist/domain/monitor/gpu-monitor.js +1 -1
- package/dist/domain/pi-providers/custom-provider-model.d.ts +1 -1
- package/dist/domain/projects/project-store.d.ts +1 -2
- package/dist/domain/projects/project-store.js +1 -9
- package/dist/domain/remote/client-manager.d.ts +1 -1
- package/dist/domain/remote/client-manager.js +1 -1
- package/dist/domain/remote/client-remove.d.ts +1 -1
- package/dist/domain/remote/machine-registry.d.ts +54 -0
- package/dist/domain/{tasks/dispatch-utils.js → remote/machine-registry.js} +1 -61
- package/dist/domain/runs/attempt.js +3 -8
- package/dist/domain/runs/builders.d.ts +2 -3
- package/dist/domain/runs/builders.js +2 -3
- package/dist/domain/runs/engine-spec.js +3 -10
- package/dist/domain/runs/fallback.d.ts +1 -3
- package/dist/domain/runs/fallback.js +1 -3
- package/dist/domain/runs/observers/resume-recorder.d.ts +0 -15
- package/dist/domain/runs/observers/resume-recorder.js +0 -17
- package/dist/domain/runs/prompt.d.ts +23 -8
- package/dist/domain/runs/prompt.js +31 -5
- package/dist/domain/runs/request.d.ts +6 -15
- package/dist/domain/runs/run.js +0 -2
- package/dist/domain/runs/service.js +0 -2
- package/dist/domain/runs/spec-loader.d.ts +4 -6
- package/dist/domain/runs/spec-loader.js +3 -5
- package/dist/domain/scheduling/builtin-job-migration.js +3 -3
- package/dist/domain/scheduling/builtin-jobs.js +0 -13
- package/dist/domain/scheduling/job-registry.d.ts +12 -27
- package/dist/domain/scheduling/job-registry.js +2 -3
- package/dist/domain/scheduling/jobs/scheduled-task.d.ts +18 -6
- package/dist/domain/scheduling/jobs/scheduled-task.js +66 -125
- package/dist/domain/scheduling/run-guards.d.ts +6 -0
- package/dist/domain/scheduling/run-guards.js +18 -0
- package/dist/domain/scheduling/runner.d.ts +0 -1
- package/dist/domain/scheduling/runner.js +0 -1
- package/dist/domain/scheduling/schedule-cli.js +1 -1
- package/dist/domain/scheduling/scheduler.d.ts +0 -4
- package/dist/domain/scheduling/scheduler.js +2 -6
- package/dist/domain/sessions/session-hooks.d.ts +2 -2
- package/dist/domain/sessions/session-lifecycle.d.ts +23 -9
- package/dist/domain/sessions/session-lifecycle.js +27 -15
- package/dist/domain/sessions/session-retention.d.ts +8 -0
- package/dist/domain/sessions/session-retention.js +139 -34
- package/dist/domain/sessions/team.d.ts +18 -0
- package/dist/domain/sessions/team.js +21 -0
- package/dist/domain/system/install-cli.js +5 -5
- package/dist/domain/system/rebuild-hold.d.ts +1 -1
- package/dist/domain/system/server-update-check.js +2 -1
- package/dist/domain/ui-service/app-router.d.ts +41 -154
- package/dist/domain/ui-service/app-router.js +9 -30
- package/dist/domain/ui-service/input-schemas.d.ts +64 -205
- package/dist/domain/ui-service/input-schemas.js +26 -71
- package/dist/domain/ui-service/mutate/environments.d.ts +23 -0
- package/dist/domain/ui-service/mutate/environments.js +51 -0
- package/dist/domain/ui-service/mutate/plugin-packages.js +3 -9
- package/dist/domain/ui-service/mutate/plugins.js +7 -109
- package/dist/domain/ui-service/mutate/schedules.js +1 -2
- package/dist/domain/ui-service/plugins-shared.d.ts +0 -3
- package/dist/domain/ui-service/plugins-shared.js +0 -14
- package/dist/domain/ui-service/query/config.js +10 -13
- package/dist/domain/ui-service/query/environments.d.ts +12 -0
- package/dist/domain/ui-service/query/environments.js +72 -0
- package/dist/domain/ui-service/query/executions.js +1 -1
- package/dist/domain/ui-service/query/hooks.d.ts +1 -1
- package/dist/domain/ui-service/query/hooks.js +13 -24
- package/dist/domain/ui-service/query/memory.js +1 -1
- package/dist/domain/ui-service/query/plugins.js +6 -82
- package/dist/domain/ui-service/query/schedules.js +0 -1
- package/dist/domain/ui-service/query/sessions.js +23 -5
- package/dist/domain/ui-service/query/system.js +0 -1
- package/dist/domain/ui-service/query-input-schemas.d.ts +5 -26
- package/dist/domain/ui-service/query-input-schemas.js +0 -18
- package/dist/domain/ui-service/types.d.ts +68 -330
- package/dist/domain/ui-service/ui-service.js +7 -23
- package/dist/domain/waitpoints/notices.d.ts +1 -1
- package/dist/domain/waitpoints/notices.js +1 -1
- package/dist/entry/app.js +70 -146
- package/dist/entry/cli-help.js +0 -1
- package/dist/entry/cli.js +1 -6
- package/dist/entry/daemon.d.ts +27 -23
- package/dist/entry/daemon.js +61 -49
- package/dist/entry/fast-install.d.ts +13 -2
- package/dist/entry/fast-install.js +43 -11
- package/dist/entry/hook-cli.d.ts +0 -1
- package/dist/entry/hook-cli.js +20 -49
- package/dist/entry/init.js +8 -11
- package/dist/entry/local-ui.d.ts +1 -1
- package/dist/entry/platform-connect.d.ts +23 -0
- package/dist/entry/platform-connect.js +94 -0
- package/dist/entry/production-evidence-export-cli.js +0 -2
- package/dist/events/event-logger.js +1 -0
- package/dist/events/event-types.d.ts +13 -62
- package/dist/hooks/cortex-hook-api.mjs +1 -3
- package/dist/hooks/new-session-hook.mjs +2 -3
- package/dist/hooks/status-md-guard.mjs +5 -5
- package/dist/orchestration/agent-runner.d.ts +3 -0
- package/dist/orchestration/agent-runner.js +21 -19
- package/dist/orchestration/agent-view-send.d.ts +7 -0
- package/dist/orchestration/agent-view-send.js +12 -0
- package/dist/orchestration/benchmark-session-webhook.d.ts +19 -0
- package/dist/orchestration/benchmark-session-webhook.js +130 -0
- package/dist/orchestration/conversation-request.d.ts +39 -1
- package/dist/orchestration/conversation-request.js +71 -15
- package/dist/orchestration/interactions/answer-question.d.ts +16 -0
- package/dist/orchestration/interactions/answer-question.js +38 -0
- package/dist/orchestration/interactions/ask-user-question.d.ts +2 -3
- package/dist/orchestration/interactions/ask-user-question.js +1 -3
- package/dist/orchestration/interactions/ask-user-resume.d.ts +1 -3
- package/dist/orchestration/interactions/ask-user-resume.js +2 -14
- package/dist/orchestration/interactions/interaction-handlers.js +6 -35
- package/dist/orchestration/interactions/plan-response.d.ts +2 -1
- package/dist/orchestration/interactions/plan-response.js +2 -2
- package/dist/orchestration/orchestrator.d.ts +1 -7
- package/dist/orchestration/orchestrator.js +2 -11
- package/dist/orchestration/resume-dispatcher.d.ts +0 -22
- package/dist/orchestration/resume-dispatcher.js +8 -72
- package/dist/orchestration/routing/commands/cancel.d.ts +1 -7
- package/dist/orchestration/routing/commands/cancel.js +17 -37
- package/dist/orchestration/routing/commands/channel.js +1 -1
- package/dist/orchestration/routing/commands/device.js +1 -1
- package/dist/orchestration/routing/commands/index.d.ts +0 -7
- package/dist/orchestration/routing/commands/index.js +1 -9
- package/dist/orchestration/routing/commands/mode.js +7 -7
- package/dist/orchestration/routing/commands/nvtop.js +1 -1
- package/dist/orchestration/routing/commands/sendfile.js +1 -1
- package/dist/orchestration/routing/commands/status.js +8 -14
- package/dist/orchestration/routing/hook-bridge-subscribers.d.ts +4 -1
- package/dist/orchestration/routing/hook-bridge-subscribers.js +19 -12
- package/dist/orchestration/routing/hook-bridge.d.ts +3 -3
- package/dist/orchestration/routing/hook-bridge.js +9 -9
- package/dist/orchestration/routing/message-router.js +2 -25
- package/dist/orchestration/routing/webhook.js +24 -350
- package/dist/orchestration/session-events.d.ts +13 -0
- package/dist/orchestration/session-events.js +8 -0
- package/dist/orchestration/session-gateway.d.ts +4 -2
- package/dist/orchestration/session-gateway.js +17 -12
- package/dist/orchestration/session-retention-controller.d.ts +5 -2
- package/dist/orchestration/session-retention-controller.js +7 -4
- package/dist/orchestration/status-helpers.d.ts +1 -4
- package/dist/orchestration/status-helpers.js +3 -5
- package/dist/orchestration/team-delivery.d.ts +64 -0
- package/dist/orchestration/team-delivery.js +224 -0
- package/dist/orchestration/team-state.d.ts +48 -0
- package/dist/orchestration/team-state.js +146 -0
- package/dist/orchestration/team-webhook.d.ts +48 -0
- package/dist/orchestration/team-webhook.js +295 -0
- package/dist/orchestration/transcript-sink.d.ts +18 -4
- package/dist/orchestration/transcript-sink.js +31 -3
- package/dist/orchestration/turn/background-hold.d.ts +2 -2
- package/dist/orchestration/turn/background-hold.js +1 -1
- package/dist/orchestration/turn/hold-render-platform.d.ts +2 -2
- package/dist/orchestration/turn/hold-render-platform.js +2 -2
- package/dist/orchestration/turn/hold-render-web.d.ts +3 -3
- package/dist/orchestration/turn/hold-render-web.js +2 -2
- package/dist/orchestration/turn/terminal.d.ts +5 -2
- package/dist/orchestration/turn/terminal.js +11 -10
- package/dist/orchestration/turn/turn.d.ts +13 -1
- package/dist/orchestration/turn/turn.js +58 -15
- package/dist/platform/adapters/composite-adapter.d.ts +2 -0
- package/dist/platform/adapters/composite-adapter.js +7 -4
- package/dist/platform/adapters/feishu.d.ts +6 -0
- package/dist/platform/adapters/feishu.js +50 -4
- package/dist/platform/index.d.ts +1 -1
- package/dist/platform/index.js +1 -1
- package/dist/platform/tui/protocol.d.ts +2 -2
- package/dist/platform/types.d.ts +3 -3
- package/dist/platform/types.js +3 -3
- package/dist/store/conversation-history-reader.js +17 -3
- package/dist/store/conversation-history-repo.d.ts +18 -4
- package/dist/store/conversation-history-repo.js +14 -5
- package/dist/store/conversation-ledger-repo.js +1 -16
- package/dist/store/execution-repo.d.ts +17 -40
- package/dist/store/execution-repo.js +46 -116
- package/dist/store/hook-registry.d.ts +4 -16
- package/dist/store/hook-registry.js +5 -65
- package/dist/store/plugin-sync.js +4 -0
- package/dist/store/profile-repo.js +1 -1
- package/dist/store/prompt-migration-replacements.d.ts +0 -1
- package/dist/store/prompt-migration-replacements.js +0 -49
- package/dist/store/retention-candidate-repo.d.ts +2 -0
- package/dist/store/retention-candidate-repo.js +5 -0
- package/dist/store/schedule-repo.d.ts +3 -15
- package/dist/store/schedule-repo.js +18 -4
- package/dist/store/session-registry-journal.d.ts +15 -0
- package/dist/store/session-registry-journal.js +68 -10
- package/dist/store/session-registry-repo.d.ts +13 -0
- package/dist/store/session-registry-repo.js +74 -21
- package/dist/store/session-totals.d.ts +3 -3
- package/dist/store/session-totals.js +3 -3
- package/dist/store/team-outbox-repo.d.ts +20 -0
- package/dist/store/team-outbox-repo.js +39 -0
- package/dist/store/tool-image-files.d.ts +12 -0
- package/dist/store/tool-image-files.js +40 -0
- package/dist/store/version-migrations.d.ts +31 -8
- package/dist/store/version-migrations.js +307 -87
- package/dist/store/waitpoint-repo.d.ts +0 -2
- package/dist/tui/App.js +1 -1
- package/dist/tui/components/Dashboard.js +0 -8
- package/dist/tui/components/InputBox.js +1 -7
- package/dist/tui/components/StatusLine.js +1 -1
- package/dist/tui/hooks/useDashboardData.d.ts +1 -1
- package/dist/tui/hooks/useDashboardData.js +0 -4
- package/dist/tui/hooks/useNotifications.d.ts +1 -1
- package/dist/tui/slash-commands.js +1 -4
- package/package.json +4 -5
- package/web/dist/assets/index-BU_kY1rV.js +449 -0
- package/web/dist/assets/{index-zvUjPRjt.js → index-CDjsmgsy.js} +1 -1
- package/web/dist/assets/index-DzPDbcY1.css +1 -0
- package/web/dist/index.html +2 -2
- package/defaults/config/hooks/02-tasks-yaml-guard.json +0 -11
- package/defaults/config/hooks/11-task-status-check.json +0 -14
- package/defaults/config/thread-templates/agents/coder-reviewer.json +0 -17
- package/defaults/config/thread-templates/agents/coder.json +0 -17
- package/defaults/config/thread-templates/agents/direct-review.json +0 -14
- package/defaults/config/thread-templates/agents/direct-web.json +0 -14
- package/defaults/config/thread-templates/agents/director.json +0 -11
- package/defaults/config/thread-templates/agents/doc-reviewer.json +0 -13
- package/defaults/config/thread-templates/agents/doc-writer.json +0 -24
- package/defaults/config/thread-templates/agents/executor-reviewer.json +0 -13
- package/defaults/config/thread-templates/agents/executor.json +0 -24
- package/defaults/config/thread-templates/agents/main.json +0 -14
- package/defaults/config/thread-templates/agents/manager.json +0 -14
- package/defaults/config/thread-templates/agents/scheduler-main.json +0 -13
- package/defaults/config/thread-templates/shells/worker-review.json +0 -12
- package/defaults/config/thread-templates/templates/coder-review.json +0 -20
- package/defaults/config/thread-templates/templates/default.json +0 -10
- package/defaults/config/thread-templates/templates/doc-review.json +0 -6
- package/defaults/config/thread-templates/templates/execute-review.json +0 -6
- package/defaults/config/thread-templates/templates/manager.json +0 -11
- package/defaults/config/thread-templates/templates/scheduler.json +0 -10
- package/defaults/hooks/task-status-check.mjs +0 -166
- package/defaults/hooks/tasks-yaml-guard.mjs +0 -225
- package/defaults/plugins/cortex-system/skills/task/SKILL.md +0 -547
- package/defaults/plugins/cortex-system/skills/thread/SKILL.md +0 -505
- package/defaults/prompts/directives/coder-reviewer.md +0 -7
- package/defaults/prompts/directives/coder.md +0 -7
- package/defaults/prompts/directives/director.md +0 -7
- package/defaults/prompts/directives/doc-reviewer.md +0 -6
- package/defaults/prompts/directives/doc-writer.md +0 -7
- package/defaults/prompts/directives/executor-reviewer.md +0 -6
- package/defaults/prompts/directives/executor.md +0 -7
- package/defaults/prompts/directives/manager.md +0 -24
- package/defaults/prompts/systemPrompts/coder.md +0 -10
- package/defaults/prompts/systemPrompts/worker.md +0 -10
- package/defaults/rules/task-system.md +0 -53
- package/dist/core/task-node.d.ts +0 -7
- package/dist/core/task-node.js +0 -21
- package/dist/core/task-parser.d.ts +0 -86
- package/dist/core/task-parser.js +0 -436
- package/dist/core/types/thread-types.d.ts +0 -506
- package/dist/domain/benchmark/production-evidence-topology.d.ts +0 -14
- package/dist/domain/benchmark/production-evidence-topology.js +0 -257
- package/dist/domain/mcp/tools/manager-qa.d.ts +0 -4
- package/dist/domain/mcp/tools/manager-qa.js +0 -63
- package/dist/domain/mcp/tools/task-monitor.d.ts +0 -3
- package/dist/domain/mcp/tools/task-monitor.js +0 -92
- package/dist/domain/mcp/tools/thread-ops.js +0 -73
- package/dist/domain/scheduling/jobs/register-thread-session.d.ts +0 -15
- package/dist/domain/scheduling/jobs/register-thread-session.js +0 -32
- package/dist/domain/scheduling/jobs/target-dispatch.d.ts +0 -30
- package/dist/domain/scheduling/jobs/target-dispatch.js +0 -33
- package/dist/domain/scheduling/jobs/task-archive.d.ts +0 -2
- package/dist/domain/scheduling/jobs/task-archive.js +0 -16
- package/dist/domain/scheduling/jobs/task-dispatch.d.ts +0 -12
- package/dist/domain/scheduling/jobs/task-dispatch.js +0 -402
- package/dist/domain/tasks/acceptance-ledger.d.ts +0 -39
- package/dist/domain/tasks/acceptance-ledger.js +0 -133
- package/dist/domain/tasks/archiver.d.ts +0 -10
- package/dist/domain/tasks/archiver.js +0 -133
- package/dist/domain/tasks/claim-recovery.d.ts +0 -9
- package/dist/domain/tasks/claim-recovery.js +0 -54
- package/dist/domain/tasks/dispatch-utils.d.ts +0 -117
- package/dist/domain/tasks/dispatcher.d.ts +0 -49
- package/dist/domain/tasks/dispatcher.js +0 -305
- package/dist/domain/tasks/lint.d.ts +0 -12
- package/dist/domain/tasks/lint.js +0 -130
- package/dist/domain/tasks/mutator.d.ts +0 -39
- package/dist/domain/tasks/mutator.js +0 -176
- package/dist/domain/tasks/production-topology-ledger.d.ts +0 -106
- package/dist/domain/tasks/production-topology-ledger.js +0 -161
- package/dist/domain/tasks/system/task-cli.d.ts +0 -7
- package/dist/domain/tasks/system/task-cli.js +0 -991
- package/dist/domain/tasks/system/task-completion.d.ts +0 -44
- package/dist/domain/tasks/system/task-completion.js +0 -262
- package/dist/domain/tasks/system/task-file-input.d.ts +0 -10
- package/dist/domain/tasks/system/task-file-input.js +0 -53
- package/dist/domain/tasks/system/task-id-utils.d.ts +0 -24
- package/dist/domain/tasks/system/task-id-utils.js +0 -90
- package/dist/domain/tasks/system/task-lifecycle-edit.d.ts +0 -40
- package/dist/domain/tasks/system/task-lifecycle-edit.js +0 -419
- package/dist/domain/tasks/system/task-lock.d.ts +0 -44
- package/dist/domain/tasks/system/task-lock.js +0 -137
- package/dist/domain/tasks/system/task-mutations.d.ts +0 -86
- package/dist/domain/tasks/system/task-mutations.js +0 -336
- package/dist/domain/tasks/system/task-state.d.ts +0 -140
- package/dist/domain/tasks/system/task-state.js +0 -287
- package/dist/domain/threads/artifact-io.d.ts +0 -4
- package/dist/domain/threads/artifact-io.js +0 -57
- package/dist/domain/threads/contract.d.ts +0 -17
- package/dist/domain/threads/contract.js +0 -54
- package/dist/domain/threads/evidence-context.d.ts +0 -2
- package/dist/domain/threads/evidence-context.js +0 -40
- package/dist/domain/threads/hook-runner.d.ts +0 -7
- package/dist/domain/threads/hook-runner.js +0 -237
- package/dist/domain/threads/index.d.ts +0 -7
- package/dist/domain/threads/index.js +0 -13
- package/dist/domain/threads/pending-user-inputs.d.ts +0 -3
- package/dist/domain/threads/pending-user-inputs.js +0 -33
- package/dist/domain/threads/prompt-builder.d.ts +0 -55
- package/dist/domain/threads/prompt-builder.js +0 -245
- package/dist/domain/threads/runner.d.ts +0 -150
- package/dist/domain/threads/runner.js +0 -832
- package/dist/domain/threads/shell-templates.d.ts +0 -9
- package/dist/domain/threads/shell-templates.js +0 -108
- package/dist/domain/threads/state-machine.d.ts +0 -96
- package/dist/domain/threads/state-machine.js +0 -646
- package/dist/domain/threads/template-loader.d.ts +0 -37
- package/dist/domain/threads/template-loader.js +0 -487
- package/dist/domain/threads/template-validate.d.ts +0 -287
- package/dist/domain/threads/template-validate.js +0 -575
- package/dist/domain/threads/template-validate.parity.d.ts +0 -1
- package/dist/domain/threads/template-validate.parity.js +0 -39
- package/dist/domain/threads/template-writer.d.ts +0 -57
- package/dist/domain/threads/template-writer.js +0 -126
- package/dist/domain/threads/thread-transcript.d.ts +0 -60
- package/dist/domain/threads/thread-transcript.js +0 -117
- package/dist/domain/threads/tree.d.ts +0 -46
- package/dist/domain/threads/tree.js +0 -196
- package/dist/domain/threads/utils.d.ts +0 -24
- package/dist/domain/threads/utils.js +0 -55
- package/dist/domain/ui-service/mutate/tasks.d.ts +0 -23
- package/dist/domain/ui-service/mutate/tasks.js +0 -58
- package/dist/domain/ui-service/mutate/thread-templates.d.ts +0 -4
- package/dist/domain/ui-service/mutate/thread-templates.js +0 -46
- package/dist/domain/ui-service/mutate/threads.d.ts +0 -4
- package/dist/domain/ui-service/mutate/threads.js +0 -19
- package/dist/domain/ui-service/query/task-verification.d.ts +0 -2
- package/dist/domain/ui-service/query/task-verification.js +0 -58
- package/dist/domain/ui-service/query/tasks.d.ts +0 -3
- package/dist/domain/ui-service/query/tasks.js +0 -73
- package/dist/domain/ui-service/query/thread-template-detail.d.ts +0 -2
- package/dist/domain/ui-service/query/thread-template-detail.js +0 -57
- package/dist/domain/ui-service/query/thread-templates.d.ts +0 -15
- package/dist/domain/ui-service/query/thread-templates.js +0 -79
- package/dist/domain/ui-service/query/threads.d.ts +0 -3
- package/dist/domain/ui-service/query/threads.js +0 -180
- package/dist/hooks/task-status-check.mjs +0 -166
- package/dist/hooks/tasks-yaml-guard.mjs +0 -225
- package/dist/orchestration/dispatch-reconciler.d.ts +0 -1
- package/dist/orchestration/dispatch-reconciler.js +0 -19
- package/dist/orchestration/human-answer-backstop.d.ts +0 -36
- package/dist/orchestration/human-answer-backstop.js +0 -69
- package/dist/orchestration/manager-qa.d.ts +0 -66
- package/dist/orchestration/manager-qa.js +0 -356
- package/dist/orchestration/routing/commands/dispatch.d.ts +0 -2
- package/dist/orchestration/routing/commands/dispatch.js +0 -48
- package/dist/orchestration/routing/commands/task.d.ts +0 -4
- package/dist/orchestration/routing/commands/task.js +0 -140
- package/dist/orchestration/routing/commands/thread-handlers.d.ts +0 -2
- package/dist/orchestration/routing/commands/thread-handlers.js +0 -152
- package/dist/orchestration/thread-callback.d.ts +0 -107
- package/dist/orchestration/thread-callback.js +0 -555
- package/dist/orchestration/thread-delivery.d.ts +0 -40
- package/dist/orchestration/thread-delivery.js +0 -76
- package/dist/orchestration/thread-executor.d.ts +0 -25
- package/dist/orchestration/thread-executor.js +0 -180
- package/dist/orchestration/thread-input.d.ts +0 -15
- package/dist/orchestration/thread-input.js +0 -50
- package/dist/orchestration/thread-notices.d.ts +0 -43
- package/dist/orchestration/thread-notices.js +0 -195
- package/dist/orchestration/thread-run/index.d.ts +0 -3
- package/dist/orchestration/thread-run/index.js +0 -2
- package/dist/orchestration/thread-run/render-summary.d.ts +0 -57
- package/dist/orchestration/thread-run/render-summary.js +0 -109
- package/dist/orchestration/thread-run/render-task.d.ts +0 -94
- package/dist/orchestration/thread-run/render-task.js +0 -154
- package/dist/orchestration/thread-run/settle.d.ts +0 -11
- package/dist/orchestration/thread-run/settle.js +0 -18
- package/dist/orchestration/thread-run/thread-run.d.ts +0 -114
- package/dist/orchestration/thread-run/thread-run.js +0 -181
- package/dist/orchestration/thread-run/thread-surface.d.ts +0 -41
- package/dist/orchestration/thread-run/thread-surface.js +0 -23
- package/dist/orchestration/thread-run/verdict.d.ts +0 -11
- package/dist/orchestration/thread-run/verdict.js +0 -20
- package/dist/store/plugin-retirement.d.ts +0 -37
- package/dist/store/plugin-retirement.js +0 -144
- package/dist/store/task-repo.d.ts +0 -43
- package/dist/store/task-repo.js +0 -143
- package/dist/store/thread-repo.d.ts +0 -65
- package/dist/store/thread-repo.js +0 -294
- package/dist/tui/components/DashboardTasksTab.d.ts +0 -12
- package/dist/tui/components/DashboardTasksTab.js +0 -196
- package/dist/tui/components/DashboardThreadsTab.d.ts +0 -11
- package/dist/tui/components/DashboardThreadsTab.js +0 -96
- package/web/dist/assets/index-C9sEss8T.css +0 -1
- package/web/dist/assets/index-fVf_wSMQ.js +0 -447
- /package/defaults/config/{thread-templates/agents → environments}/creative.json +0 -0
- /package/dist/core/types/{thread-types.js → benchmark-types.js} +0 -0
- /package/dist/domain/{threads/template-resolver.d.ts → agents/environments/prompt-includes.d.ts} +0 -0
|
@@ -4,10 +4,6 @@ import { CONFIG_DIR, HOOKS_DIR } from '../../../core/paths.js';
|
|
|
4
4
|
import { loadMountedHooks } from '../../../store/hook-registry.js';
|
|
5
5
|
import { hookAppliesAt, hookMountTargets, legalResultModes } from '../../hooks/hook-view.js';
|
|
6
6
|
function runInfo(hook) {
|
|
7
|
-
if (hook.kind === 'template') {
|
|
8
|
-
// Template hooks are raw commands with a millisecond timeout; only the command is comparable.
|
|
9
|
-
return { script: null, command: hook.run.command, timeoutSec: null };
|
|
10
|
-
}
|
|
11
7
|
const run = hook.entry.run;
|
|
12
8
|
return {
|
|
13
9
|
script: run.script ?? null,
|
|
@@ -16,8 +12,6 @@ function runInfo(hook) {
|
|
|
16
12
|
};
|
|
17
13
|
}
|
|
18
14
|
function scopeInfo(hook) {
|
|
19
|
-
if (hook.kind === 'template')
|
|
20
|
-
return null;
|
|
21
15
|
const scope = hook.entry.scope;
|
|
22
16
|
if (!scope)
|
|
23
17
|
return null;
|
|
@@ -28,16 +22,13 @@ function scopeInfo(hook) {
|
|
|
28
22
|
}
|
|
29
23
|
/** Present only when the declaration names a script we can resolve on disk. */
|
|
30
24
|
function scriptExists(hook, scriptsDir) {
|
|
31
|
-
if (hook.kind === 'template')
|
|
32
|
-
return null;
|
|
33
25
|
const script = hook.entry.run.script;
|
|
34
26
|
if (script === undefined)
|
|
35
27
|
return null;
|
|
36
28
|
return fs.existsSync(path.join(scriptsDir, script));
|
|
37
29
|
}
|
|
38
30
|
function toDetail(hook, order, scriptsDir) {
|
|
39
|
-
const matcher = hook.
|
|
40
|
-
const isTemplate = hook.kind === 'template';
|
|
31
|
+
const matcher = hook.entry.matcher;
|
|
41
32
|
return {
|
|
42
33
|
id: hook.id,
|
|
43
34
|
event: hook.event,
|
|
@@ -45,27 +36,25 @@ function toDetail(hook, order, scriptsDir) {
|
|
|
45
36
|
matcherFilters: typeof matcher === 'object' && matcher !== null ? matcher : null,
|
|
46
37
|
run: runInfo(hook),
|
|
47
38
|
scope: scopeInfo(hook),
|
|
48
|
-
blocking:
|
|
49
|
-
result:
|
|
39
|
+
blocking: hook.entry.blocking ?? null,
|
|
40
|
+
result: hook.entry.result ?? null,
|
|
50
41
|
enabled: hook.enabled,
|
|
51
42
|
source: hook.source,
|
|
52
|
-
version:
|
|
53
|
-
fileName:
|
|
43
|
+
version: hook.entry.version ?? null,
|
|
44
|
+
fileName: path.basename(hook.filePath),
|
|
54
45
|
order,
|
|
55
|
-
|
|
56
|
-
// the derived view is computed from a synthetic entry carrying just the event.
|
|
57
|
-
mountsOn: hookMountTargets(isTemplate ? { event: hook.event } : hook.entry),
|
|
46
|
+
mountsOn: hookMountTargets(hook.entry),
|
|
58
47
|
legalResults: legalResultModes(hook.event),
|
|
59
48
|
appliesAt: hookAppliesAt(hook.event),
|
|
60
49
|
scriptExists: scriptExists(hook, scriptsDir),
|
|
61
50
|
editable: hook.source === 'user',
|
|
62
|
-
template:
|
|
63
|
-
phase:
|
|
51
|
+
template: null,
|
|
52
|
+
phase: null,
|
|
64
53
|
};
|
|
65
54
|
}
|
|
66
55
|
/**
|
|
67
|
-
* Whether a hook references a script. `run.script` is the declared form, but
|
|
68
|
-
*
|
|
56
|
+
* Whether a hook references a script. `run.script` is the declared form, but command-based entries
|
|
57
|
+
* invoke scripts through a shell string instead (`node ~/.cortex/hooks/x.mjs`),
|
|
69
58
|
* so the command is scanned too — matching whole path segments, not substrings, so `task.mjs` is
|
|
70
59
|
* not considered used by a command that runs `post-task.mjs`. Reporting a live script as unused
|
|
71
60
|
* would invite deleting it.
|
|
@@ -97,10 +86,10 @@ function listScripts(scriptsDir, hooks) {
|
|
|
97
86
|
* Build the hooks overview from explicit directories. Pure over its arguments (no global paths) so
|
|
98
87
|
* it is hermetically testable against fixtures, mirroring `readConfigSnapshot`.
|
|
99
88
|
*/
|
|
100
|
-
export function readHooksOverview(registryDir,
|
|
101
|
-
const hooks = loadMountedHooks(registryDir
|
|
89
|
+
export function readHooksOverview(registryDir, scriptsDir) {
|
|
90
|
+
const hooks = loadMountedHooks(registryDir).map((hook, index) => toDetail(hook, index, scriptsDir));
|
|
102
91
|
return { hooks, scripts: listScripts(scriptsDir, hooks), hooksDir: scriptsDir };
|
|
103
92
|
}
|
|
104
93
|
export async function handleHooksList(_deps, _params) {
|
|
105
|
-
return readHooksOverview(path.join(CONFIG_DIR, 'hooks'),
|
|
94
|
+
return readHooksOverview(path.join(CONFIG_DIR, 'hooks'), HOOKS_DIR);
|
|
106
95
|
}
|
|
@@ -2,7 +2,7 @@ import * as fs from 'node:fs';
|
|
|
2
2
|
import * as path from 'node:path';
|
|
3
3
|
import { runFile } from '../../../core/exec-async.js';
|
|
4
4
|
// Canonical top-level memory files, in display order. Missing ones are omitted (not errored).
|
|
5
|
-
const TOP_LEVEL_FILES = ['mission.md', 'roadmap.md', 'STATUS.md'
|
|
5
|
+
const TOP_LEVEL_FILES = ['mission.md', 'roadmap.md', 'STATUS.md'];
|
|
6
6
|
// Memory subdirectories whose `*.md` entries are counted (excluding the auto-generated index.md).
|
|
7
7
|
const MEMORY_DIRS = ['experiments', 'knowledge', 'patterns', 'decisions'];
|
|
8
8
|
function notFound(message) {
|
|
@@ -1,28 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { listEntityNames, readEntity, readRawRegistry } from '../../threads/template-writer.js';
|
|
4
|
-
import { normalizePluginDirs, pluginDirsOf, readPluginCatalogSnapshot, refName, sanitizePluginEntry, } from '../plugins-shared.js';
|
|
5
|
-
function templateSlotState(registry, ref, snapshot) {
|
|
6
|
-
if (ref && typeof ref === 'object' && Array.isArray(pluginDirsOf(ref))) {
|
|
7
|
-
const normalized = normalizePluginDirs(pluginDirsOf(ref), snapshot);
|
|
8
|
-
return {
|
|
9
|
-
mode: 'custom',
|
|
10
|
-
managedPluginIds: normalized.managedIds,
|
|
11
|
-
unmanagedPluginCount: normalized.unmanaged.length,
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
const name = refName(ref);
|
|
15
|
-
const normalized = normalizePluginDirs(name ? pluginDirsOf(registry.agents[name]) : undefined, snapshot);
|
|
16
|
-
return {
|
|
17
|
-
mode: 'inherit',
|
|
18
|
-
managedPluginIds: normalized.managedIds,
|
|
19
|
-
unmanagedPluginCount: normalized.unmanaged.length,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
1
|
+
import { ENVIRONMENTS_DIR, listEnvironmentNames, readEnvironment } from '../../agents/environments/index.js';
|
|
2
|
+
import { normalizePluginDirs, pluginDirsOf, readPluginCatalogSnapshot, sanitizePluginEntry, } from '../plugins-shared.js';
|
|
22
3
|
function readAgentTargets(snapshot) {
|
|
23
4
|
const out = [];
|
|
24
|
-
|
|
25
|
-
|
|
5
|
+
// Agent targets are the execution environments.
|
|
6
|
+
for (const name of listEnvironmentNames(ENVIRONMENTS_DIR)) {
|
|
7
|
+
const entity = readEnvironment(ENVIRONMENTS_DIR, name);
|
|
26
8
|
if (!entity.body)
|
|
27
9
|
continue;
|
|
28
10
|
const normalized = normalizePluginDirs(pluginDirsOf(entity.body), snapshot);
|
|
@@ -37,68 +19,10 @@ function readAgentTargets(snapshot) {
|
|
|
37
19
|
}
|
|
38
20
|
return out;
|
|
39
21
|
}
|
|
40
|
-
function readTemplateTargets(registry, snapshot) {
|
|
41
|
-
const out = [];
|
|
42
|
-
for (const name of listEntityNames(CONFIG_TEMPLATES_DIR, 'template')) {
|
|
43
|
-
const entity = readEntity(CONFIG_TEMPLATES_DIR, 'template', name);
|
|
44
|
-
const body = entity.body;
|
|
45
|
-
if (!body || typeof body !== 'object')
|
|
46
|
-
continue;
|
|
47
|
-
if (isShellBinding(body)) {
|
|
48
|
-
out.push({
|
|
49
|
-
kind: 'template-shell',
|
|
50
|
-
templateName: name,
|
|
51
|
-
editable: false,
|
|
52
|
-
baseHash: entity.sha256,
|
|
53
|
-
readOnlyReason: 'shell-binding',
|
|
54
|
-
});
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
const refs = Array.isArray(body.agents) ? body.agents : [];
|
|
58
|
-
refs.forEach((value, index) => {
|
|
59
|
-
out.push(makeTemplateSlotTarget(name, entity.sha256, registry, snapshot, value, index));
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
return out;
|
|
63
|
-
}
|
|
64
|
-
function activeTemplateSlotTarget(templateName, index, baseHash) {
|
|
65
|
-
return {
|
|
66
|
-
kind: 'template-slot',
|
|
67
|
-
templateName,
|
|
68
|
-
index,
|
|
69
|
-
ref: '__active__',
|
|
70
|
-
editable: false,
|
|
71
|
-
baseHash,
|
|
72
|
-
mode: 'inherit',
|
|
73
|
-
managedPluginIds: [],
|
|
74
|
-
unmanagedPluginCount: 0,
|
|
75
|
-
readOnlyReason: 'active-agent',
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
function editableTemplateSlotTarget(templateName, index, ref, baseHash, state) {
|
|
79
|
-
return {
|
|
80
|
-
kind: 'template-slot',
|
|
81
|
-
templateName,
|
|
82
|
-
index,
|
|
83
|
-
ref,
|
|
84
|
-
editable: true,
|
|
85
|
-
baseHash,
|
|
86
|
-
mode: state.mode,
|
|
87
|
-
managedPluginIds: state.managedPluginIds,
|
|
88
|
-
unmanagedPluginCount: state.unmanagedPluginCount,
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
function makeTemplateSlotTarget(templateName, baseHash, registry, snapshot, ref, index) {
|
|
92
|
-
const name = refName(ref) ?? '';
|
|
93
|
-
if (name === '__active__')
|
|
94
|
-
return activeTemplateSlotTarget(templateName, index, baseHash);
|
|
95
|
-
return editableTemplateSlotTarget(templateName, index, name, baseHash, templateSlotState(registry, ref, snapshot));
|
|
96
|
-
}
|
|
97
22
|
export async function handlePluginsList(_deps, _params) {
|
|
98
23
|
const snapshot = readPluginCatalogSnapshot();
|
|
99
|
-
const registry = readRawRegistry(CONFIG_TEMPLATES_DIR);
|
|
100
24
|
return {
|
|
101
25
|
plugins: snapshot.entries.map((entry) => sanitizePluginEntry(entry)),
|
|
102
|
-
targets:
|
|
26
|
+
targets: readAgentTargets(snapshot),
|
|
103
27
|
};
|
|
104
28
|
}
|
|
@@ -3,6 +3,7 @@ import { countWaitingOn } from './waitpoints.js';
|
|
|
3
3
|
import { sessionTotalsCarry } from '../../../store/session-totals-repo.js';
|
|
4
4
|
import { addTotalsAcc, emptyTotalsAcc, foldExecution, toSessionTotals, } from '../../../store/session-totals.js';
|
|
5
5
|
import { isDebugMode } from '../../../core/debug-mode.js';
|
|
6
|
+
import { isTeamWorker } from '../../sessions/team.js';
|
|
6
7
|
export async function handleSessionsList(deps, params) {
|
|
7
8
|
const { projectId, resumable, origin } = params;
|
|
8
9
|
let sessions;
|
|
@@ -87,7 +88,7 @@ export async function handleSessionsList(deps, params) {
|
|
|
87
88
|
return liveNumTurns;
|
|
88
89
|
return sessionId ? (lastRunBySession.get(sessionId)?.numTurns ?? null) : null;
|
|
89
90
|
};
|
|
90
|
-
// Last run's cost: idle → this session's latest
|
|
91
|
+
// Last run's cost: idle → this session's latest run's finalized cost; running → null
|
|
91
92
|
// (no live source).
|
|
92
93
|
const resolveCost = (sessionId, running) => {
|
|
93
94
|
if (running)
|
|
@@ -99,6 +100,13 @@ export async function handleSessionsList(deps, params) {
|
|
|
99
100
|
// disagree. Absent dep (fixtures / TUI) ⇒ every session reports 0.
|
|
100
101
|
const armedWaitpoints = deps.waitpointRegistry ? await deps.waitpointRegistry.listArmed() : [];
|
|
101
102
|
const waitingOnBySession = countWaitingOn(armedWaitpoints, sessions.map((s) => ({ sessionId: s.sessionId, channel: s.channel ?? null })));
|
|
103
|
+
// Team mode: a worker's questions and plans go to its lead, so a worker blocked on one is waiting
|
|
104
|
+
// on the lead (hollow ring), not on the user (amber). Only while the lead still exists.
|
|
105
|
+
const routedLeads = new Set();
|
|
106
|
+
for (const leadId of new Set(sessions.filter((s) => isTeamWorker(s)).map((s) => s.teamLeadId))) {
|
|
107
|
+
if (await deps.sessionStore.getById(leadId).catch(() => null))
|
|
108
|
+
routedLeads.add(leadId);
|
|
109
|
+
}
|
|
102
110
|
const infos = sessions.map((s) => {
|
|
103
111
|
// Busy snapshot: the registry's single answer for this session. Snapshot + delta — this field
|
|
104
112
|
// is the queryable snapshot, the `session.status` event stream is the delta.
|
|
@@ -118,7 +126,11 @@ export async function handleSessionsList(deps, params) {
|
|
|
118
126
|
// (keyed by the session's channel). This is the ONLY signal that turns the rail dot amber —
|
|
119
127
|
// running/background stay blue. A non-blocking ask does not stall the session, so it stays
|
|
120
128
|
// blue too. Absent deps (fixtures/TUI) ⇒ false.
|
|
121
|
-
const
|
|
129
|
+
const blockedAsk = deps.getPendingAskUser?.(s.channel)?.blocking === true;
|
|
130
|
+
const blockedPlan = !!deps.getPendingPlan?.(s.channel);
|
|
131
|
+
const routedToLead = isTeamWorker(s) && routedLeads.has(s.teamLeadId);
|
|
132
|
+
const awaitingInput = !routedToLead && (blockedAsk || blockedPlan);
|
|
133
|
+
const waitingOnLead = routedToLead ? Number(blockedAsk) + Number(blockedPlan) : 0;
|
|
122
134
|
return {
|
|
123
135
|
sessionId: s.sessionId,
|
|
124
136
|
// Backend CLI resume target (the registry's `backendSessionId` snapshot, falling back to the
|
|
@@ -133,6 +145,9 @@ export async function handleSessionsList(deps, params) {
|
|
|
133
145
|
scheduleId: s.scheduleId ?? null,
|
|
134
146
|
commissionId: s.commissionId ?? null,
|
|
135
147
|
commissionDraft: s.commissionDraft ?? null,
|
|
148
|
+
teamLeadId: s.teamLeadId ?? null,
|
|
149
|
+
workerName: s.workerName ?? null,
|
|
150
|
+
workerRetiredAt: s.workerRetiredAt ?? null,
|
|
136
151
|
createdAt: s.createdAt,
|
|
137
152
|
lastUsedAt: s.lastUsedAt,
|
|
138
153
|
resumable: s.kind !== 'scheduled',
|
|
@@ -153,6 +168,7 @@ export async function handleSessionsList(deps, params) {
|
|
|
153
168
|
backgroundRunning: bgHeld,
|
|
154
169
|
awaitingInput,
|
|
155
170
|
waitingOn: waitingOnBySession.get(s.sessionId) ?? 0,
|
|
171
|
+
waitingOnLead,
|
|
156
172
|
numTurns: resolveNumTurns(s.sessionId, inTurn, state.numTurns),
|
|
157
173
|
costUsd: resolveCost(s.sessionId, inTurn),
|
|
158
174
|
// Cumulative over every finished run this session has had (plus its Agent-tool children's
|
|
@@ -162,9 +178,10 @@ export async function handleSessionsList(deps, params) {
|
|
|
162
178
|
// (sessions.markRead → lastReadAt). Legacy DIRECT records without lastReadAt → read
|
|
163
179
|
// (no unread flood on first deploy). SCHEDULED runs invert the default: a run the user
|
|
164
180
|
// never opened IS the unread state (27c result → blue dot until opened).
|
|
165
|
-
unread
|
|
181
|
+
// Workers never contribute unread state, including retired workers or team mode off.
|
|
182
|
+
unread: !s.teamLeadId && (s.origin === 'scheduled'
|
|
166
183
|
? (!s.lastReadAt || s.lastUsedAt > s.lastReadAt)
|
|
167
|
-
: (!!s.lastReadAt && s.lastUsedAt > s.lastReadAt),
|
|
184
|
+
: (!!s.lastReadAt && s.lastUsedAt > s.lastReadAt)),
|
|
168
185
|
};
|
|
169
186
|
});
|
|
170
187
|
// Title label-less sessions from their first user message so the left rail shows the conversation's
|
|
@@ -267,7 +284,8 @@ function messageFromEvent(deps, event, elapsedMs) {
|
|
|
267
284
|
...(event.type === 'tool' && event.toolDevice ? { toolDevice: event.toolDevice } : {}),
|
|
268
285
|
ts: event.ts,
|
|
269
286
|
elapsedMs,
|
|
270
|
-
|
|
287
|
+
// Tool rows carry the images the call returned (see `appendToolImages`).
|
|
288
|
+
...((event.type === 'user' || event.type === 'assistant' || event.type === 'tool') && event.attachments !== undefined ? { attachments: event.attachments } : {}),
|
|
271
289
|
...(event.type === 'user' && event.systemOrigin !== undefined ? { systemOrigin: event.systemOrigin } : {}),
|
|
272
290
|
...(event.type === 'assistant' && event.decisions !== undefined ? { decisions: event.decisions } : {}),
|
|
273
291
|
...(event.type === 'assistant' && event.noticeLevel !== undefined ? { noticeLevel: event.noticeLevel } : {}),
|
|
@@ -132,7 +132,6 @@ export async function handleSystemRateLimitStatus(_params) {
|
|
|
132
132
|
provider: provider.provider,
|
|
133
133
|
displayName: provider.displayName,
|
|
134
134
|
waitingSessions: waiting[provider.provider]?.sessions ?? 0,
|
|
135
|
-
waitingThreads: waiting[provider.provider]?.threads ?? 0,
|
|
136
135
|
windows: provider.windows.map((window) => ({ ...window })),
|
|
137
136
|
}));
|
|
138
137
|
return { providers };
|
|
@@ -4,8 +4,8 @@ export declare const sessionsListInput: z.ZodObject<{
|
|
|
4
4
|
resumable: z.ZodOptional<z.ZodBoolean>;
|
|
5
5
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
6
6
|
direct: "direct";
|
|
7
|
-
thread: "thread";
|
|
8
7
|
scheduled: "scheduled";
|
|
8
|
+
thread: "thread";
|
|
9
9
|
}>>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export declare const sessionsTranscriptInput: z.ZodObject<{
|
|
@@ -24,27 +24,6 @@ export declare const sessionsDebugDetailsInput: z.ZodObject<{
|
|
|
24
24
|
export declare const sessionsPendingInteractionInput: z.ZodObject<{
|
|
25
25
|
sessionId: z.ZodString;
|
|
26
26
|
}, z.core.$strip>;
|
|
27
|
-
export declare const threadsListInput: z.ZodObject<{
|
|
28
|
-
projectId: z.ZodOptional<z.ZodString>;
|
|
29
|
-
status: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
30
|
-
sessionId: z.ZodOptional<z.ZodString>;
|
|
31
|
-
}, z.core.$strip>;
|
|
32
|
-
export declare const threadsGetInput: z.ZodObject<{
|
|
33
|
-
threadId: z.ZodString;
|
|
34
|
-
includeArtifactContent: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
-
}, z.core.$strip>;
|
|
36
|
-
export declare const tasksListInput: z.ZodObject<{
|
|
37
|
-
projectId: z.ZodOptional<z.ZodString>;
|
|
38
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
39
|
-
open: "open";
|
|
40
|
-
done: "done";
|
|
41
|
-
}>>;
|
|
42
|
-
actionable: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
-
}, z.core.$strip>;
|
|
44
|
-
export declare const taskVerificationInput: z.ZodObject<{
|
|
45
|
-
projectId: z.ZodString;
|
|
46
|
-
taskId: z.ZodString;
|
|
47
|
-
}, z.core.$strip>;
|
|
48
27
|
export declare const schedulesListInput: z.ZodObject<{
|
|
49
28
|
projectId: z.ZodOptional<z.ZodString>;
|
|
50
29
|
paused: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -52,9 +31,9 @@ export declare const schedulesListInput: z.ZodObject<{
|
|
|
52
31
|
export declare const commissionsListInput: z.ZodObject<{
|
|
53
32
|
projectId: z.ZodOptional<z.ZodString>;
|
|
54
33
|
status: z.ZodOptional<z.ZodEnum<{
|
|
55
|
-
done: "done";
|
|
56
|
-
active: "active";
|
|
57
34
|
abandoned: "abandoned";
|
|
35
|
+
active: "active";
|
|
36
|
+
done: "done";
|
|
58
37
|
}>>;
|
|
59
38
|
}, z.core.$strip>;
|
|
60
39
|
export declare const commissionsGetInput: z.ZodObject<{
|
|
@@ -82,9 +61,9 @@ export declare const memoryFileInput: z.ZodObject<{
|
|
|
82
61
|
}, z.core.$strip>;
|
|
83
62
|
export declare const approvalsListInput: z.ZodObject<{
|
|
84
63
|
status: z.ZodOptional<z.ZodEnum<{
|
|
85
|
-
pending: "pending";
|
|
86
|
-
failed: "failed";
|
|
87
64
|
approved: "approved";
|
|
65
|
+
failed: "failed";
|
|
66
|
+
pending: "pending";
|
|
88
67
|
rejected: "rejected";
|
|
89
68
|
}>>;
|
|
90
69
|
}, z.core.$strip>;
|
|
@@ -21,24 +21,6 @@ export const sessionsDebugDetailsInput = z.object({
|
|
|
21
21
|
export const sessionsPendingInteractionInput = z.object({
|
|
22
22
|
sessionId: z.string().min(1),
|
|
23
23
|
});
|
|
24
|
-
export const threadsListInput = z.object({
|
|
25
|
-
projectId: z.string().optional(),
|
|
26
|
-
status: z.array(z.string()).optional(),
|
|
27
|
-
sessionId: z.string().optional(),
|
|
28
|
-
});
|
|
29
|
-
export const threadsGetInput = z.object({
|
|
30
|
-
threadId: z.string(),
|
|
31
|
-
includeArtifactContent: z.boolean().optional(),
|
|
32
|
-
});
|
|
33
|
-
export const tasksListInput = z.object({
|
|
34
|
-
projectId: z.string().optional(),
|
|
35
|
-
status: z.enum(['open', 'done']).optional(),
|
|
36
|
-
actionable: z.boolean().optional(),
|
|
37
|
-
});
|
|
38
|
-
export const taskVerificationInput = z.object({
|
|
39
|
-
projectId: z.string(),
|
|
40
|
-
taskId: z.string(),
|
|
41
|
-
});
|
|
42
24
|
export const schedulesListInput = z.object({
|
|
43
25
|
projectId: z.string().optional(),
|
|
44
26
|
paused: z.boolean().optional(),
|