@cortex-agent/server 2026.9.25 → 2026.10.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 +1 -1
- package/defaults/hooks/agents-md-injector.mjs +1 -25
- package/defaults/hooks/cortex-hook-api.mjs +1 -4
- package/defaults/hooks/memory-ref-tracker.mjs +0 -3
- package/defaults/hooks/new-session-hook.mjs +3 -9
- package/defaults/hooks/rules-loader.mjs +3 -12
- package/defaults/hooks/session-activity-tracker.mjs +1 -21
- package/defaults/hooks/status-md-guard.mjs +0 -11
- package/defaults/hooks/task-status-check.mjs +0 -4
- package/defaults/hooks/tasks-yaml-guard.mjs +0 -6
- package/defaults/plugins/cortex-system/skills/task/SKILL.md +3 -6
- package/dist/agent-adapter/bg-wait.d.ts +0 -5
- package/dist/agent-adapter/bg-wait.js +1 -16
- package/dist/agent-adapter/capabilities.d.ts +0 -11
- package/dist/agent-adapter/capabilities.js +2 -39
- package/dist/agent-adapter/claude/active-capture-registry.d.ts +0 -1
- package/dist/agent-adapter/claude/active-capture-registry.js +1 -4
- package/dist/agent-adapter/claude/adapter.d.ts +8 -25
- package/dist/agent-adapter/claude/adapter.js +18 -53
- package/dist/agent-adapter/claude/bg-task-tracker.d.ts +4 -4
- package/dist/agent-adapter/claude/bg-task-tracker.js +2 -4
- package/dist/agent-adapter/claude/defaults.d.ts +1 -13
- package/dist/agent-adapter/claude/defaults.js +1 -13
- package/dist/agent-adapter/claude/engine.d.ts +3 -9
- package/dist/agent-adapter/claude/engine.js +2 -12
- package/dist/agent-adapter/claude/event-parser.d.ts +1 -6
- package/dist/agent-adapter/claude/event-parser.js +4 -17
- package/dist/agent-adapter/claude/event-translator.d.ts +0 -3
- package/dist/agent-adapter/claude/event-translator.js +0 -7
- package/dist/agent-adapter/claude/tmux-control.d.ts +0 -48
- package/dist/agent-adapter/claude/tmux-control.js +0 -133
- package/dist/agent-adapter/claude/transcript-path.d.ts +10 -0
- package/dist/agent-adapter/claude/transcript-path.js +78 -1
- package/dist/agent-adapter/claude/turn-machine.d.ts +4 -3
- package/dist/agent-adapter/claude/turn-machine.js +11 -13
- package/dist/agent-adapter/pi/adapter.js +3 -5
- package/dist/agent-adapter/pi/agent-dir.d.ts +0 -2
- package/dist/agent-adapter/pi/agent-dir.js +3 -7
- package/dist/agent-adapter/pi/background-subagent.d.ts +9 -4
- package/dist/agent-adapter/pi/child-events.d.ts +1 -18
- package/dist/agent-adapter/pi/child-events.js +0 -23
- package/dist/agent-adapter/pi/child-session.js +13 -16
- package/dist/agent-adapter/pi/defaults.d.ts +0 -2
- package/dist/agent-adapter/pi/defaults.js +1 -3
- package/dist/agent-adapter/pi/discovery.d.ts +1 -5
- package/dist/agent-adapter/pi/discovery.js +0 -8
- package/dist/agent-adapter/pi/engine.d.ts +3 -8
- package/dist/agent-adapter/pi/engine.js +3 -15
- package/dist/agent-adapter/pi/event-parser.d.ts +1 -34
- package/dist/agent-adapter/pi/extensions.d.ts +2 -2
- package/dist/agent-adapter/pi/extensions.js +4 -2
- package/dist/agent-adapter/pi/hook-bridge.d.ts +5 -32
- package/dist/agent-adapter/pi/hook-bridge.js +14 -46
- package/dist/agent-adapter/pi/image-first.d.ts +3 -0
- package/dist/agent-adapter/pi/image-first.js +31 -0
- package/dist/agent-adapter/pi/mcp-bridge.js +9 -22
- package/dist/agent-adapter/pi/pi-session.d.ts +2 -11
- package/dist/agent-adapter/pi/pi-session.js +2 -15
- package/dist/agent-adapter/pi/providers-config.d.ts +1 -7
- package/dist/agent-adapter/pi/providers-config.js +1 -2
- package/dist/agent-adapter/pi/runtime-settings.d.ts +2 -0
- package/dist/agent-adapter/pi/runtime-settings.js +17 -0
- package/dist/agent-adapter/pi/runtime.js +20 -29
- package/dist/agent-adapter/pi/session-support.d.ts +1 -5
- package/dist/agent-adapter/pi/session-support.js +0 -9
- package/dist/agent-adapter/pi/subagent.d.ts +2 -8
- package/dist/agent-adapter/pi/subagent.js +57 -54
- package/dist/agent-adapter/pi/tool-shims.d.ts +1 -1
- package/dist/agent-adapter/pi/tool-shims.js +5 -2
- package/dist/agent-adapter/types.d.ts +2 -8
- package/dist/core/agents/subagent/attribution.d.ts +5 -1
- package/dist/core/agents/subagent/attribution.js +6 -0
- package/dist/core/agents/subagent/types.d.ts +21 -0
- package/dist/core/anthropic-model-discovery.d.ts +0 -6
- package/dist/core/anthropic-model-discovery.js +2 -11
- package/dist/core/anthropic-models.js +0 -4
- package/dist/core/atomic-write.js +4 -4
- package/dist/core/auth.js +1 -6
- package/dist/core/cached-scan.js +0 -6
- package/dist/core/claude-credentials.d.ts +8 -2
- package/dist/core/claude-credentials.js +14 -9
- package/dist/core/cli-utils.d.ts +7 -1
- package/dist/core/codex-quota.d.ts +0 -4
- package/dist/core/codex-quota.js +0 -37
- package/dist/core/config-generator.d.ts +1 -1
- package/dist/core/config-generator.js +6 -24
- package/dist/core/gateway-generator.d.ts +0 -8
- package/dist/core/gateway-generator.js +2 -50
- package/dist/core/i18n.js +2 -5
- package/dist/core/locales/en.d.ts +394 -17
- package/dist/core/locales/en.js +8 -4
- package/dist/core/locales/slices/commands.d.ts +1 -6
- package/dist/core/locales/slices/commands.js +10 -20
- package/dist/core/locales/slices/init.js +2 -5
- package/dist/core/locales/slices/interactions.d.ts +0 -5
- package/dist/core/locales/slices/interactions.js +6 -19
- package/dist/core/locales/slices/lang.js +0 -3
- package/dist/core/locales/slices/notices.d.ts +121 -0
- package/dist/core/locales/slices/notices.js +242 -0
- package/dist/core/locales/slices/providers.d.ts +0 -2
- package/dist/core/locales/slices/providers.js +0 -4
- package/dist/core/locales/slices/scheduling.d.ts +0 -2
- package/dist/core/locales/slices/scheduling.js +0 -7
- package/dist/core/locales/slices/startup.js +0 -3
- package/dist/core/locales/slices/status.d.ts +0 -2
- package/dist/core/locales/slices/status.js +0 -4
- package/dist/core/locales/slices/tui.d.ts +117 -0
- package/dist/core/locales/slices/tui.js +240 -0
- package/dist/core/locales/slices/uiextra.d.ts +65 -0
- package/dist/core/locales/slices/uiextra.js +134 -0
- package/dist/core/locales/slices/uimsg.d.ts +102 -0
- package/dist/core/locales/slices/uimsg.js +214 -0
- package/dist/core/locales/zh.js +8 -3
- package/dist/core/mcp-tool-gate.js +1 -4
- package/dist/core/paths.js +0 -4
- package/dist/core/pi-sdk.d.ts +0 -8
- package/dist/core/pi-sdk.js +0 -12
- package/dist/core/platform-settings-spec.js +0 -4
- package/dist/core/settings-spec.js +0 -4
- package/dist/core/settings.js +2 -8
- package/dist/core/status-format.js +5 -5
- package/dist/core/task-node.d.ts +4 -7
- package/dist/core/task-node.js +8 -23
- package/dist/core/task-parser.d.ts +1 -3
- package/dist/core/task-parser.js +2 -35
- package/dist/core/tool-names.d.ts +0 -4
- package/dist/core/tool-names.js +0 -9
- package/dist/core/types/agent-types.d.ts +17 -0
- package/dist/core/utils.d.ts +1 -2
- package/dist/core/utils.js +2 -7
- package/dist/domain/agents/agent-state.d.ts +0 -3
- package/dist/domain/agents/agent-state.js +0 -3
- package/dist/domain/agents/agent-switch.js +0 -11
- package/dist/domain/agents/config.d.ts +1 -12
- package/dist/domain/agents/config.js +8 -88
- package/dist/domain/agents/index.d.ts +0 -1
- package/dist/domain/agents/index.js +0 -4
- package/dist/domain/agents/profile-manager.d.ts +4 -4
- package/dist/domain/agents/profile-manager.js +4 -4
- package/dist/domain/agents/profile-switch.js +0 -9
- package/dist/domain/agents/provider-run-lifecycle.d.ts +1 -1
- package/dist/domain/agents/subagent/foreign.js +0 -1
- package/dist/domain/agents/subagent/registry.d.ts +8 -4
- package/dist/domain/agents/subagent/registry.js +32 -7
- package/dist/domain/agents/subagent/runner.d.ts +1 -2
- package/dist/domain/agents/subagent/runner.js +0 -4
- package/dist/domain/agents/subagent/service.d.ts +1 -1
- package/dist/domain/agents/subagent/service.js +4 -4
- package/dist/domain/auth/auth-format.js +3 -4
- package/dist/domain/auth/auth-status.js +2 -1
- package/dist/domain/auth/cc-auth-cli.d.ts +1 -1
- package/dist/domain/auth/cc-auth-cli.js +3 -3
- package/dist/domain/auth/cc-login.js +2 -1
- package/dist/domain/auth/cc-subscription.d.ts +2 -5
- package/dist/domain/auth/cc-subscription.js +8 -13
- package/dist/domain/auth/claude-user-settings.js +1 -10
- package/dist/domain/auth/login-flow.d.ts +1 -1
- package/dist/domain/auth/login-flow.js +5 -4
- package/dist/domain/auth/logout.d.ts +2 -4
- package/dist/domain/auth/logout.js +13 -16
- package/dist/domain/auth/pi-login.d.ts +1 -13
- package/dist/domain/auth/pi-login.js +7 -13
- package/dist/domain/auth/pi-oauth.d.ts +1 -13
- package/dist/domain/auth/pi-oauth.js +8 -14
- package/dist/domain/benchmark/atif.d.ts +3 -34
- package/dist/domain/benchmark/atif.js +15 -38
- package/dist/domain/benchmark/attempt-record.d.ts +0 -74
- package/dist/domain/benchmark/attempt-record.js +0 -51
- package/dist/domain/benchmark/composite-manifest.d.ts +2 -39
- package/dist/domain/benchmark/composite-manifest.js +2 -131
- package/dist/domain/benchmark/decimal-text.d.ts +0 -5
- package/dist/domain/benchmark/decimal-text.js +0 -21
- package/dist/domain/benchmark/identity.d.ts +0 -10
- package/dist/domain/benchmark/identity.js +0 -18
- package/dist/domain/benchmark/journal.d.ts +0 -8
- package/dist/domain/benchmark/journal.js +5 -13
- package/dist/domain/benchmark/manifest-contract.d.ts +1 -15
- package/dist/domain/benchmark/manifest-contract.js +1 -1
- package/dist/domain/benchmark/production-attempt-identity.d.ts +0 -3
- package/dist/domain/benchmark/production-attempt-identity.js +2 -19
- package/dist/domain/benchmark/production-attempt-journal.d.ts +3 -3
- package/dist/domain/benchmark/production-attempt-journal.js +9 -11
- package/dist/domain/benchmark/production-evidence-export.d.ts +1 -2
- package/dist/domain/benchmark/production-evidence-export.js +0 -1
- package/dist/domain/benchmark/production-evidence-projection.d.ts +1 -2
- package/dist/domain/benchmark/production-evidence-projection.js +4 -6
- package/dist/domain/benchmark/role-surface.js +1 -8
- package/dist/domain/commissions/decision-projection.d.ts +0 -3
- package/dist/domain/commissions/decision-projection.js +3 -3
- package/dist/domain/costs/cost-tracker.d.ts +2 -15
- package/dist/domain/costs/cost-tracker.js +47 -96
- package/dist/domain/costs/gateway-manager.js +1 -1
- package/dist/domain/costs/rate-limit-throttle.d.ts +2 -9
- package/dist/domain/costs/rate-limit-throttle.js +12 -26
- package/dist/domain/costs/resume-registry.d.ts +1 -4
- package/dist/domain/costs/resume-registry.js +1 -13
- package/dist/domain/costs/usage-service.d.ts +2 -2
- package/dist/domain/costs/usage-service.js +16 -20
- package/dist/domain/costs/usage-store.d.ts +2 -3
- package/dist/domain/costs/usage-store.js +2 -5
- package/dist/domain/executions/registry.d.ts +6 -13
- package/dist/domain/executions/registry.js +5 -31
- package/dist/domain/mcp/bundled-server.js +3 -3
- package/dist/domain/mcp/feishu/client.js +0 -6
- package/dist/domain/mcp/feishu/file.js +3 -27
- package/dist/domain/mcp/feishu/types.d.ts +1 -1
- package/dist/domain/mcp/feishu/user-auth.js +1 -8
- package/dist/domain/mcp/tools/agents-md.d.ts +0 -1
- package/dist/domain/mcp/tools/context.d.ts +1 -2
- package/dist/domain/mcp/tools/cost.js +11 -14
- package/dist/domain/mcp/tools/interaction-plan.d.ts +0 -3
- package/dist/domain/mcp/tools/interaction-plan.js +0 -1
- package/dist/domain/mcp/tools/remote-file.d.ts +4 -0
- package/dist/domain/mcp/tools/remote-file.js +8 -0
- package/dist/domain/mcp/tools/schedule.d.ts +2 -16
- package/dist/domain/mcp/tools/schedule.js +4 -8
- package/dist/domain/mcp/tools/slack.d.ts +1 -3
- package/dist/domain/mcp/tools/slack.js +4 -45
- package/dist/domain/mcp/tools/task-monitor.js +0 -7
- package/dist/domain/mcp/tools/task-ops.js +2 -4
- package/dist/domain/mcp/tools/ui-file.js +56 -30
- package/dist/domain/memory/agents-md-injector.d.ts +0 -1
- package/dist/domain/memory/agents-md-injector.js +2 -4
- package/dist/domain/memory/consolidate.d.ts +0 -1
- package/dist/domain/memory/consolidate.js +3 -9
- package/dist/domain/memory/index-regen.d.ts +1 -7
- package/dist/domain/memory/index-regen.js +3 -2
- package/dist/domain/memory/rules-loader.d.ts +3 -25
- package/dist/domain/memory/rules-loader.js +8 -49
- package/dist/domain/memory/skill-scanner.d.ts +1 -2
- package/dist/domain/memory/skill-scanner.js +2 -10
- package/dist/domain/memory/user-context.js +1 -1
- package/dist/domain/memory/watcher.d.ts +0 -1
- package/dist/domain/memory/watcher.js +1 -17
- package/dist/domain/monitor/disk-monitor.d.ts +1 -4
- package/dist/domain/monitor/disk-monitor.js +4 -6
- package/dist/domain/monitor/event-loop-monitor.d.ts +1 -5
- package/dist/domain/monitor/event-loop-monitor.js +1 -9
- package/dist/domain/pi-providers/custom-provider-model.d.ts +2 -6
- package/dist/domain/pi-providers/custom-provider-model.js +1 -3
- package/dist/domain/pi-providers/custom-provider-service.d.ts +0 -2
- package/dist/domain/pi-providers/custom-provider-service.js +1 -1
- package/dist/domain/pi-providers/index.d.ts +3 -4
- package/dist/domain/pi-providers/index.js +1 -2
- package/dist/domain/pi-providers/models-json-store.d.ts +1 -1
- package/dist/domain/pi-providers/models-json-store.js +1 -1
- package/dist/domain/plugins/agent-plugins-v1.d.ts +0 -3
- package/dist/domain/plugins/authoring.js +7 -7
- package/dist/domain/plugins/catalog-types.d.ts +3 -0
- package/dist/domain/plugins/catalog-types.js +11 -0
- package/dist/domain/plugins/catalog.d.ts +1 -2
- package/dist/domain/plugins/catalog.js +13 -27
- package/dist/domain/plugins/fs-helpers.d.ts +2 -1
- package/dist/domain/plugins/fs-helpers.js +2 -5
- package/dist/domain/plugins/mcp.js +3 -13
- package/dist/domain/plugins/runtime.js +4 -11
- package/dist/domain/plugins/skill-projection.js +0 -3
- package/dist/domain/remote/client-hot-reload.js +4 -3
- package/dist/domain/remote/client-manager.d.ts +8 -6
- package/dist/domain/remote/client-manager.js +21 -2
- package/dist/domain/remote/client-remove.d.ts +61 -0
- package/dist/domain/remote/client-remove.js +137 -0
- package/dist/domain/remote/client-ssh-tunnel.d.ts +5 -0
- package/dist/domain/remote/client-ssh-tunnel.js +12 -1
- package/dist/domain/remote/device-chrome-commands.d.ts +0 -3
- package/dist/domain/remote/device-chrome-commands.js +1 -10
- package/dist/domain/remote/device-port.d.ts +2 -8
- package/dist/domain/remote/device-port.js +7 -15
- package/dist/domain/runs/adapters.js +2 -2
- package/dist/domain/runs/attempt.js +1 -5
- package/dist/domain/runs/engine-spec.d.ts +0 -13
- package/dist/domain/runs/engine-spec.js +0 -42
- package/dist/domain/runs/engines.d.ts +3 -4
- package/dist/domain/runs/engines.js +2 -8
- package/dist/domain/runs/events.js +0 -6
- package/dist/domain/runs/prompt.js +1 -1
- package/dist/domain/runs/request.d.ts +1 -2
- package/dist/domain/runs/run.d.ts +0 -1
- package/dist/domain/runs/run.js +6 -16
- package/dist/domain/scheduling/job-registry.d.ts +0 -5
- package/dist/domain/scheduling/job-registry.js +0 -24
- package/dist/domain/scheduling/jobs/auth-expiry-scan.d.ts +1 -0
- package/dist/domain/scheduling/jobs/auth-expiry-scan.js +6 -13
- package/dist/domain/scheduling/jobs/memory-index-regen.js +3 -5
- package/dist/domain/scheduling/jobs/register-thread-session.d.ts +3 -4
- package/dist/domain/scheduling/jobs/register-thread-session.js +2 -7
- package/dist/domain/scheduling/jobs/scheduled-task.js +5 -15
- package/dist/domain/scheduling/jobs/sync-public.d.ts +3 -0
- package/dist/domain/scheduling/jobs/sync-public.js +7 -8
- package/dist/domain/scheduling/jobs/target-dispatch.js +0 -5
- package/dist/domain/scheduling/jobs/task-archive.js +4 -6
- package/dist/domain/scheduling/jobs/task-dispatch.js +8 -14
- package/dist/domain/scheduling/runner.d.ts +0 -3
- package/dist/domain/scheduling/runner.js +10 -11
- package/dist/domain/scheduling/schedule-cli.d.ts +0 -4
- package/dist/domain/scheduling/schedule-cli.js +7 -8
- package/dist/domain/scheduling/schedule-command.js +1 -39
- package/dist/domain/scheduling/scheduler.d.ts +4 -18
- package/dist/domain/scheduling/scheduler.js +8 -45
- package/dist/domain/sessions/session-backup.d.ts +3 -3
- package/dist/domain/sessions/session-backup.js +8 -73
- package/dist/domain/sessions/session-hooks.d.ts +5 -23
- package/dist/domain/sessions/session-hooks.js +20 -45
- package/dist/domain/sessions/session-lifecycle.d.ts +1 -8
- package/dist/domain/sessions/session-lifecycle.js +6 -6
- package/dist/domain/sessions/session-retention.d.ts +1 -1
- package/dist/domain/sessions/session-use.d.ts +0 -4
- package/dist/domain/sessions/session-use.js +0 -18
- package/dist/domain/sessions/session.d.ts +3 -3
- package/dist/domain/sessions/session.js +6 -6
- package/dist/domain/system/doctor.js +4 -8
- package/dist/domain/system/github-release.d.ts +0 -2
- package/dist/domain/system/github-release.js +0 -5
- package/dist/domain/system/install-cli.js +1 -1
- package/dist/domain/system/notice-history.js +0 -4
- package/dist/domain/system/preferences.js +1 -7
- package/dist/domain/system/rebuild-hold.d.ts +1 -11
- package/dist/domain/system/rebuild-hold.js +3 -16
- package/dist/domain/system/server-update-check.d.ts +3 -2
- package/dist/domain/system/server-update-check.js +15 -65
- package/dist/domain/system/server-update-coordinator.d.ts +43 -0
- package/dist/domain/system/server-update-coordinator.js +137 -0
- package/dist/domain/system/system-notice.d.ts +2 -1
- package/dist/domain/system/update-state.js +1 -4
- package/dist/domain/system/update-ui-state.js +0 -7
- package/dist/domain/tasks/acceptance-ledger.d.ts +1 -7
- package/dist/domain/tasks/acceptance-ledger.js +7 -9
- package/dist/domain/tasks/archiver.js +2 -2
- package/dist/domain/tasks/claim-recovery.d.ts +0 -1
- package/dist/domain/tasks/claim-recovery.js +0 -13
- package/dist/domain/tasks/dispatch-utils.d.ts +2 -3
- package/dist/domain/tasks/dispatch-utils.js +19 -22
- package/dist/domain/tasks/dispatcher.d.ts +5 -8
- package/dist/domain/tasks/dispatcher.js +9 -15
- package/dist/domain/tasks/lint.js +1 -1
- package/dist/domain/tasks/mutator.d.ts +1 -12
- package/dist/domain/tasks/mutator.js +8 -124
- package/dist/domain/tasks/system/task-cli.d.ts +1 -51
- package/dist/domain/tasks/system/task-cli.js +6 -22
- package/dist/domain/tasks/system/task-completion.js +8 -14
- package/dist/domain/tasks/system/task-id-utils.js +2 -1
- package/dist/domain/tasks/system/task-lifecycle-edit.d.ts +2 -5
- package/dist/domain/tasks/system/task-lifecycle-edit.js +4 -10
- package/dist/domain/tasks/system/task-lock.d.ts +1 -5
- package/dist/domain/tasks/system/task-lock.js +5 -45
- package/dist/domain/tasks/system/task-mutations.d.ts +1 -12
- package/dist/domain/tasks/system/task-mutations.js +2 -19
- package/dist/domain/tasks/system/task-state.d.ts +2 -6
- package/dist/domain/tasks/system/task-state.js +1 -6
- package/dist/domain/threads/artifact-io.d.ts +0 -2
- package/dist/domain/threads/artifact-io.js +2 -17
- package/dist/domain/threads/contract.js +0 -4
- package/dist/domain/threads/hook-runner.d.ts +0 -2
- package/dist/domain/threads/hook-runner.js +2 -5
- package/dist/domain/threads/index.js +1 -2
- package/dist/domain/threads/prompt-builder.d.ts +3 -4
- package/dist/domain/threads/prompt-builder.js +3 -3
- package/dist/domain/threads/runner.d.ts +2 -3
- package/dist/domain/threads/runner.js +40 -40
- package/dist/domain/threads/shell-templates.js +0 -8
- package/dist/domain/threads/state-machine.d.ts +1 -1
- package/dist/domain/threads/state-machine.js +10 -18
- package/dist/domain/threads/template-loader.d.ts +2 -2
- package/dist/domain/threads/template-loader.js +7 -11
- package/dist/domain/threads/template-validate.d.ts +3 -0
- package/dist/domain/threads/template-validate.js +49 -51
- package/dist/domain/threads/template-validate.parity.js +0 -7
- package/dist/domain/threads/template-writer.d.ts +3 -1
- package/dist/domain/threads/template-writer.js +16 -20
- package/dist/domain/threads/tree.d.ts +0 -1
- package/dist/domain/threads/tree.js +0 -10
- package/dist/domain/threads/utils.d.ts +0 -2
- package/dist/domain/threads/utils.js +0 -10
- package/dist/domain/tui-session/index.js +0 -2
- package/dist/domain/tui-session/tui-session-service.js +16 -26
- package/dist/domain/tui-session/types.d.ts +1 -36
- package/dist/domain/tui-session/types.js +0 -3
- package/dist/domain/ui-service/app-router.d.ts +30 -12
- package/dist/domain/ui-service/app-router.js +4 -6
- package/dist/domain/ui-service/assistant-snapshots.d.ts +10 -0
- package/dist/domain/ui-service/assistant-snapshots.js +43 -0
- package/dist/domain/ui-service/index.d.ts +1 -2
- package/dist/domain/ui-service/index.js +0 -2
- package/dist/domain/ui-service/input-schemas.d.ts +16 -23
- package/dist/domain/ui-service/input-schemas.js +22 -77
- package/dist/domain/ui-service/mutate/approvals.js +10 -18
- package/dist/domain/ui-service/mutate/auth.js +14 -12
- package/dist/domain/ui-service/mutate/commissions.js +4 -3
- package/dist/domain/ui-service/mutate/config.js +5 -14
- package/dist/domain/ui-service/mutate/errors.d.ts +7 -0
- package/dist/domain/ui-service/mutate/errors.js +14 -0
- package/dist/domain/ui-service/mutate/executions.js +2 -4
- package/dist/domain/ui-service/mutate/hooks.d.ts +0 -4
- package/dist/domain/ui-service/mutate/hooks.js +4 -28
- package/dist/domain/ui-service/mutate/issues.js +4 -15
- package/dist/domain/ui-service/mutate/platform-settings.js +3 -6
- package/dist/domain/ui-service/mutate/plugin-packages.js +10 -19
- package/dist/domain/ui-service/mutate/plugins.js +11 -40
- package/dist/domain/ui-service/mutate/profiles.d.ts +15 -0
- package/dist/domain/ui-service/mutate/profiles.js +10 -9
- package/dist/domain/ui-service/mutate/projects.js +0 -3
- package/dist/domain/ui-service/mutate/schedules.js +14 -34
- package/dist/domain/ui-service/mutate/session-metadata.d.ts +3 -0
- package/dist/domain/ui-service/mutate/session-metadata.js +28 -0
- package/dist/domain/ui-service/mutate/sessions.js +55 -45
- package/dist/domain/ui-service/mutate/system.d.ts +2 -1
- package/dist/domain/ui-service/mutate/system.js +24 -36
- package/dist/domain/ui-service/mutate/tasks.d.ts +5 -5
- package/dist/domain/ui-service/mutate/tasks.js +18 -20
- package/dist/domain/ui-service/mutate/thread-templates.js +4 -28
- package/dist/domain/ui-service/mutate/threads.js +3 -5
- package/dist/domain/ui-service/mutate/waitpoints.js +3 -7
- package/dist/domain/ui-service/platform-settings.js +3 -6
- package/dist/domain/ui-service/plugins-shared.d.ts +3 -0
- package/dist/domain/ui-service/plugins-shared.js +17 -25
- package/dist/domain/ui-service/query/approvals.js +0 -5
- package/dist/domain/ui-service/query/config.d.ts +3 -3
- package/dist/domain/ui-service/query/config.js +5 -23
- package/dist/domain/ui-service/query/cost.js +0 -3
- package/dist/domain/ui-service/query/executions.js +2 -4
- package/dist/domain/ui-service/query/issues.js +0 -7
- package/dist/domain/ui-service/query/machine-detail.js +3 -2
- package/dist/domain/ui-service/query/machines.js +0 -7
- package/dist/domain/ui-service/query/memory.js +0 -5
- package/dist/domain/ui-service/query/notes.js +2 -1
- package/dist/domain/ui-service/query/plugins.js +3 -23
- package/dist/domain/ui-service/query/projects.js +0 -3
- package/dist/domain/ui-service/query/schedules.d.ts +3 -0
- package/dist/domain/ui-service/query/schedules.js +15 -14
- package/dist/domain/ui-service/query/sessions.js +18 -28
- package/dist/domain/ui-service/query/skills.js +0 -7
- package/dist/domain/ui-service/query/system.d.ts +1 -0
- package/dist/domain/ui-service/query/system.js +5 -16
- package/dist/domain/ui-service/query/task-verification.js +2 -4
- package/dist/domain/ui-service/query/thread-template-detail.d.ts +1 -7
- package/dist/domain/ui-service/query/thread-template-detail.js +6 -42
- package/dist/domain/ui-service/query/thread-templates.d.ts +8 -3
- package/dist/domain/ui-service/query/thread-templates.js +6 -17
- package/dist/domain/ui-service/query/threads.js +2 -1
- package/dist/domain/ui-service/query/waitpoints.js +0 -7
- package/dist/domain/ui-service/query-input-schemas.d.ts +1 -1
- package/dist/domain/ui-service/session-metadata-schemas.d.ts +13 -0
- package/dist/domain/ui-service/session-metadata-schemas.js +9 -0
- package/dist/domain/ui-service/subscribe.d.ts +2 -1
- package/dist/domain/ui-service/subscribe.js +31 -50
- package/dist/domain/ui-service/trpc.js +2 -5
- package/dist/domain/ui-service/types.d.ts +37 -32
- package/dist/domain/ui-service/types.js +0 -4
- package/dist/domain/ui-service/ui-service.js +8 -6
- package/dist/domain/waitpoints/notices.js +0 -5
- package/dist/domain/waitpoints/service.d.ts +1 -1
- package/dist/domain/waitpoints/service.js +0 -5
- package/dist/entry/app.js +29 -37
- package/dist/entry/auth-cli.d.ts +2 -6
- package/dist/entry/auth-cli.js +1 -5
- package/dist/entry/auth-login-cli.d.ts +2 -2
- package/dist/entry/auth-login-cli.js +0 -4
- package/dist/entry/auth-login-terminal.js +0 -4
- package/dist/entry/cli-help.d.ts +1 -0
- package/dist/entry/cli-help.js +28 -0
- package/dist/entry/cli.d.ts +1 -6
- package/dist/entry/cli.js +30 -62
- package/dist/entry/client-cli.d.ts +4 -0
- package/dist/entry/client-cli.js +62 -0
- package/dist/entry/daemon-notice.js +3 -2
- package/dist/entry/daemon.d.ts +0 -10
- package/dist/entry/daemon.js +8 -4
- package/dist/entry/doctor-cli.d.ts +1 -5
- package/dist/entry/doctor-cli.js +0 -5
- package/dist/entry/fast-install.d.ts +0 -2
- package/dist/entry/fast-install.js +1 -1
- package/dist/entry/feishu-login.d.ts +1 -5
- package/dist/entry/feishu-login.js +1 -1
- package/dist/entry/hook-cli.d.ts +2 -7
- package/dist/entry/hook-cli.js +8 -32
- package/dist/entry/init-auth.js +0 -4
- package/dist/entry/init.d.ts +4 -7
- package/dist/entry/init.js +17 -32
- package/dist/entry/local-ui.js +4 -8
- package/dist/entry/provider-cli.d.ts +2 -6
- package/dist/entry/signal-cli.d.ts +2 -7
- package/dist/entry/signal-cli.js +1 -7
- package/dist/entry/start-ui-http.d.ts +0 -21
- package/dist/entry/start-ui-http.js +8 -19
- package/dist/entry/startup-notify.d.ts +2 -6
- package/dist/entry/startup-notify.js +2 -2
- package/dist/entry/ui-cli.d.ts +1 -5
- package/dist/entry/ui-http-gate.d.ts +3 -1
- package/dist/entry/ui-http-gate.js +5 -5
- package/dist/events/event-logger.d.ts +1 -1
- package/dist/events/event-types.d.ts +2 -9
- package/dist/hooks/agents-md-injector.mjs +1 -25
- package/dist/hooks/cortex-hook-api.mjs +1 -4
- package/dist/hooks/memory-ref-tracker.mjs +0 -3
- package/dist/hooks/new-session-hook.mjs +3 -9
- package/dist/hooks/rules-loader.mjs +3 -12
- package/dist/hooks/session-activity-tracker.mjs +1 -21
- package/dist/hooks/status-md-guard.mjs +0 -11
- package/dist/hooks/task-status-check.mjs +0 -4
- package/dist/hooks/tasks-yaml-guard.mjs +0 -6
- package/dist/orchestration/agent-file-send.d.ts +17 -8
- package/dist/orchestration/agent-file-send.js +30 -17
- package/dist/orchestration/agent-runner.d.ts +1 -4
- package/dist/orchestration/agent-runner.js +5 -19
- package/dist/orchestration/attachments-store.js +2 -30
- package/dist/orchestration/conversation-request.d.ts +0 -5
- package/dist/orchestration/conversation-request.js +5 -16
- package/dist/orchestration/delta-coalescer.d.ts +0 -2
- package/dist/orchestration/delta-coalescer.js +1 -8
- package/dist/orchestration/dispatch-reconciler.js +1 -3
- package/dist/orchestration/durable-helpers.d.ts +0 -1
- package/dist/orchestration/durable-helpers.js +0 -1
- package/dist/orchestration/edit-retry.d.ts +4 -9
- package/dist/orchestration/edit-retry.js +4 -11
- package/dist/orchestration/human-answer-backstop.js +0 -10
- package/dist/orchestration/interactions/ask-user-question.d.ts +1 -4
- package/dist/orchestration/interactions/ask-user-question.js +2 -26
- package/dist/orchestration/interactions/ask-user-resume.d.ts +1 -1
- package/dist/orchestration/interactions/ask-user-resume.js +1 -1
- package/dist/orchestration/interactions/command-action-router.d.ts +1 -17
- package/dist/orchestration/interactions/command-action-router.js +0 -42
- package/dist/orchestration/interactions/interaction-handlers.js +4 -6
- package/dist/orchestration/interactions/interaction-records.d.ts +0 -3
- package/dist/orchestration/interactions/interaction-records.js +8 -30
- package/dist/orchestration/interactions/plan-approvals.d.ts +0 -14
- package/dist/orchestration/interactions/plan-approvals.js +1 -13
- package/dist/orchestration/interactions/plan-handler.d.ts +1 -4
- package/dist/orchestration/interactions/plan-handler.js +6 -6
- package/dist/orchestration/interactions/plan-response.js +0 -10
- package/dist/orchestration/interactions/ui-update-prompt.js +31 -39
- package/dist/orchestration/interactions/update-prompt.js +0 -4
- package/dist/orchestration/manager-qa.d.ts +0 -6
- package/dist/orchestration/manager-qa.js +1 -10
- package/dist/orchestration/mid-turn-inject.d.ts +0 -2
- package/dist/orchestration/mid-turn-inject.js +0 -5
- package/dist/orchestration/outputs-store.d.ts +5 -0
- package/dist/orchestration/outputs-store.js +5 -7
- package/dist/orchestration/pi-background-subagent.js +4 -2
- package/dist/orchestration/resume-dispatcher.d.ts +1 -2
- package/dist/orchestration/resume-dispatcher.js +3 -6
- package/dist/orchestration/resume-target-sink.js +0 -4
- package/dist/orchestration/routing/commands/cancel.js +1 -1
- package/dist/orchestration/routing/commands/channel.d.ts +0 -4
- package/dist/orchestration/routing/commands/channel.js +0 -10
- package/dist/orchestration/routing/commands/command-context.d.ts +0 -15
- package/dist/orchestration/routing/commands/command-context.js +0 -3
- package/dist/orchestration/routing/commands/compact.d.ts +2 -6
- package/dist/orchestration/routing/commands/device.d.ts +0 -2
- package/dist/orchestration/routing/commands/device.js +1 -18
- package/dist/orchestration/routing/commands/dispatch.js +0 -3
- package/dist/orchestration/routing/commands/index.js +6 -9
- package/dist/orchestration/routing/commands/lang.js +0 -5
- package/dist/orchestration/routing/commands/login.d.ts +0 -3
- package/dist/orchestration/routing/commands/login.js +1 -1
- package/dist/orchestration/routing/commands/mode.d.ts +0 -4
- package/dist/orchestration/routing/commands/mode.js +1 -11
- package/dist/orchestration/routing/commands/restart.js +1 -4
- package/dist/orchestration/routing/commands/schedule.js +0 -2
- package/dist/orchestration/routing/commands/sendfile.js +1 -1
- package/dist/orchestration/routing/commands/session.d.ts +0 -2
- package/dist/orchestration/routing/commands/session.js +3 -38
- package/dist/orchestration/routing/commands/status.d.ts +0 -2
- package/dist/orchestration/routing/commands/status.js +0 -5
- package/dist/orchestration/routing/commands/tail.js +1 -1
- package/dist/orchestration/routing/commands/task.d.ts +0 -2
- package/dist/orchestration/routing/commands/task.js +2 -7
- package/dist/orchestration/routing/commands/time-ago.d.ts +2 -0
- package/dist/orchestration/routing/commands/time-ago.js +14 -0
- package/dist/orchestration/routing/edit-handler.d.ts +0 -1
- package/dist/orchestration/routing/edit-handler.js +6 -11
- package/dist/orchestration/routing/file-handler.d.ts +3 -13
- package/dist/orchestration/routing/file-handler.js +7 -2
- package/dist/orchestration/routing/hook-bridge-subscribers.js +5 -9
- package/dist/orchestration/routing/hook-bridge.d.ts +1 -6
- package/dist/orchestration/routing/hook-bridge.js +1 -13
- package/dist/orchestration/routing/webhook.d.ts +2 -8
- package/dist/orchestration/routing/webhook.js +15 -13
- package/dist/orchestration/session-compact.js +0 -2
- package/dist/orchestration/session-retention-controller.d.ts +0 -2
- package/dist/orchestration/session-retention-controller.js +5 -7
- package/dist/orchestration/session-rewind.d.ts +3 -0
- package/dist/orchestration/session-rewind.js +8 -6
- package/dist/orchestration/status-helpers.d.ts +1 -6
- package/dist/orchestration/status-helpers.js +3 -8
- package/dist/orchestration/subagent-adopt.d.ts +2 -19
- package/dist/orchestration/subagent-adopt.js +7 -18
- package/dist/orchestration/subagent-attribution.d.ts +22 -2
- package/dist/orchestration/subagent-attribution.js +8 -9
- package/dist/orchestration/subagent-delivery.js +6 -14
- package/dist/orchestration/subagent-rows.d.ts +1 -6
- package/dist/orchestration/subagent-rows.js +1 -10
- package/dist/orchestration/subagent-webhook.js +7 -15
- package/dist/orchestration/thread-callback.js +2 -2
- package/dist/orchestration/thread-delivery.js +0 -8
- package/dist/orchestration/thread-executor.d.ts +1 -1
- package/dist/orchestration/thread-executor.js +14 -12
- package/dist/orchestration/thread-input.d.ts +0 -2
- package/dist/orchestration/thread-input.js +4 -14
- package/dist/orchestration/thread-notices.d.ts +0 -2
- package/dist/orchestration/thread-notices.js +0 -13
- package/dist/orchestration/thread-run/index.d.ts +3 -3
- package/dist/orchestration/thread-run/index.js +2 -3
- package/dist/orchestration/thread-run/render-summary.js +7 -15
- package/dist/orchestration/thread-run/render-task.d.ts +0 -2
- package/dist/orchestration/thread-run/render-task.js +13 -24
- package/dist/orchestration/thread-run/settle.js +0 -6
- package/dist/orchestration/thread-run/thread-run.d.ts +0 -17
- package/dist/orchestration/thread-run/thread-run.js +4 -14
- package/dist/orchestration/thread-run/thread-surface.js +0 -6
- package/dist/orchestration/thread-run/verdict.js +0 -4
- package/dist/orchestration/transcript-sink.d.ts +2 -0
- package/dist/orchestration/transcript-sink.js +1 -7
- package/dist/orchestration/turn/active-turns.d.ts +3 -23
- package/dist/orchestration/turn/active-turns.js +3 -40
- package/dist/orchestration/turn/background-hold.d.ts +0 -15
- package/dist/orchestration/turn/background-hold.js +4 -23
- package/dist/orchestration/turn/hold-render-platform.js +0 -9
- package/dist/orchestration/turn/hold-render-web.d.ts +3 -3
- package/dist/orchestration/turn/hold-render-web.js +2 -14
- package/dist/orchestration/turn/terminal.js +1 -8
- package/dist/orchestration/turn/turn-prep.d.ts +1 -15
- package/dist/orchestration/turn/turn-prep.js +3 -69
- package/dist/orchestration/turn/turn.d.ts +1 -3
- package/dist/orchestration/turn/turn.js +8 -33
- package/dist/orchestration/waitpoint-ingress.d.ts +0 -10
- package/dist/orchestration/waitpoint-ingress.js +8 -24
- package/dist/orchestration/waitpoint-notifier.js +0 -7
- package/dist/orchestration/waitpoint-remote-drain.d.ts +2 -0
- package/dist/orchestration/waitpoint-remote-drain.js +2 -7
- package/dist/orchestration/waitpoint-sweep.d.ts +1 -2
- package/dist/orchestration/waitpoint-sweep.js +2 -9
- package/dist/platform/adapters/chunked-output-stream.d.ts +71 -0
- package/dist/platform/adapters/chunked-output-stream.js +382 -0
- package/dist/platform/adapters/composite-adapter.d.ts +1 -1
- package/dist/platform/adapters/composite-adapter.js +1 -1
- package/dist/platform/adapters/feishu-http.d.ts +6 -11
- package/dist/platform/adapters/feishu-http.js +11 -9
- package/dist/platform/adapters/feishu-image.js +0 -7
- package/dist/platform/adapters/feishu-output-stream.d.ts +4 -42
- package/dist/platform/adapters/feishu-output-stream.js +14 -336
- package/dist/platform/adapters/feishu.d.ts +10 -3
- package/dist/platform/adapters/feishu.js +47 -73
- package/dist/platform/adapters/index.d.ts +0 -21
- package/dist/platform/adapters/index.js +0 -28
- package/dist/platform/adapters/project-conduits.js +0 -5
- package/dist/platform/adapters/slack-output-stream.d.ts +4 -44
- package/dist/platform/adapters/slack-output-stream.js +14 -377
- package/dist/platform/adapters/slack.d.ts +2 -6
- package/dist/platform/adapters/slack.js +30 -48
- package/dist/platform/adapters/tui/index.d.ts +0 -7
- package/dist/platform/adapters/tui/index.js +0 -4
- package/dist/platform/adapters/tui/ports.d.ts +27 -0
- package/dist/platform/adapters/tui/ports.js +0 -3
- package/dist/platform/adapters/tui/tui-conduit-state.d.ts +0 -2
- package/dist/platform/adapters/tui/tui-conduit-state.js +0 -3
- package/dist/platform/adapters/tui/tui-connection.d.ts +0 -10
- package/dist/platform/adapters/tui/tui-connection.js +0 -5
- package/dist/platform/adapters/tui/tui-gateway.d.ts +4 -42
- package/dist/platform/adapters/tui/tui-gateway.js +12 -35
- package/dist/platform/adapters/tui/tui-output-stream.d.ts +0 -2
- package/dist/platform/adapters/tui/tui-output-stream.js +1 -3
- package/dist/platform/adapters/tui/tui-transcript.js +2 -5
- package/dist/platform/browser/display.d.ts +0 -2
- package/dist/platform/browser/display.js +0 -1
- package/dist/platform/browser/managed-browser.d.ts +4 -9
- package/dist/platform/browser/managed-browser.js +5 -10
- package/dist/platform/index.d.ts +3 -9
- package/dist/platform/index.js +3 -5
- package/dist/platform/output-stream-chunk.js +0 -3
- package/dist/platform/output-stream-helpers.js +0 -3
- package/dist/platform/testing.d.ts +0 -2
- package/dist/platform/testing.js +3 -11
- package/dist/platform/tool-trace.d.ts +0 -11
- package/dist/platform/tool-trace.js +0 -1
- package/dist/platform/ui-http/access-jwt.js +0 -13
- package/dist/platform/ui-http/app-update.js +3 -17
- package/dist/platform/ui-http/device-ports.js +3 -20
- package/dist/platform/ui-http/http-json.d.ts +8 -0
- package/dist/platform/ui-http/http-json.js +33 -0
- package/dist/platform/ui-http/listening-ports.js +4 -6
- package/dist/platform/ui-http/port-forward.d.ts +1 -2
- package/dist/platform/ui-http/port-forward.js +1 -2
- package/dist/platform/ui-http/ui-auth-routes.d.ts +3 -3
- package/dist/platform/ui-http/ui-auth-routes.js +2 -29
- package/dist/platform/ui-http/ui-http-server.d.ts +4 -12
- package/dist/platform/ui-http/ui-ota.js +4 -26
- package/dist/platform/ui-http/ui-session.js +0 -10
- package/dist/platform/ui-http/zip-writer.js +0 -8
- package/dist/platform/utils/rate-limiter.d.ts +0 -2
- package/dist/platform/utils/rate-limiter.js +0 -6
- package/dist/platform/utils/reaction-diagnostics.d.ts +1 -1
- package/dist/platform/utils/reaction-diagnostics.js +3 -3
- package/dist/platform/utils/readable-file.d.ts +9 -0
- package/dist/platform/utils/readable-file.js +18 -0
- package/dist/store/conversation-display-projection.d.ts +3 -2
- package/dist/store/conversation-display-projection.js +10 -23
- package/dist/store/conversation-history-reader.d.ts +1 -2
- package/dist/store/conversation-history-reader.js +1 -19
- package/dist/store/conversation-history-repo.d.ts +11 -29
- package/dist/store/conversation-history-repo.js +12 -13
- package/dist/store/conversation-ledger-repo.d.ts +0 -2
- package/dist/store/conversation-ledger-repo.js +0 -10
- package/dist/store/cost-repo.d.ts +1 -1
- package/dist/store/cost-repo.js +7 -12
- package/dist/store/execution-repo.d.ts +3 -25
- package/dist/store/execution-repo.js +4 -29
- package/dist/store/hook-registry.d.ts +7 -1
- package/dist/store/hook-registry.js +31 -6
- package/dist/store/hook-sync.d.ts +1 -1
- package/dist/store/hook-sync.js +1 -8
- package/dist/store/hook-writer.d.ts +1 -3
- package/dist/store/hook-writer.js +2 -2
- package/dist/store/outbound-queue.d.ts +1 -8
- package/dist/store/outbound-queue.js +3 -8
- package/dist/store/pending-injection-repo.d.ts +2 -8
- package/dist/store/plugin-retirement.d.ts +0 -4
- package/dist/store/plugin-retirement.js +3 -12
- package/dist/store/plugin-sync.js +0 -6
- package/dist/store/profile-repo.d.ts +3 -13
- package/dist/store/profile-repo.js +3 -36
- package/dist/store/project-dir-repo.js +0 -4
- package/dist/store/retention-candidate-repo.d.ts +0 -1
- package/dist/store/retention-candidate-repo.js +0 -6
- package/dist/store/schedule-repo.d.ts +0 -1
- package/dist/store/schedule-repo.js +0 -2
- package/dist/store/session-registry-import.js +0 -9
- package/dist/store/session-registry-journal.d.ts +2 -0
- package/dist/store/session-registry-journal.js +17 -38
- package/dist/store/session-registry-repo.d.ts +5 -2
- package/dist/store/session-registry-repo.js +12 -12
- package/dist/store/session-totals-repo.js +0 -4
- package/dist/store/task-repo.d.ts +0 -1
- package/dist/store/task-repo.js +1 -10
- package/dist/store/version-migrations.d.ts +3 -3
- package/dist/store/version-migrations.js +4 -8
- package/dist/store/waitpoint-repo.d.ts +0 -3
- package/dist/store/waitpoint-repo.js +0 -16
- package/dist/tui/App.js +22 -31
- package/dist/tui/components/AskUserModal.d.ts +1 -2
- package/dist/tui/components/AskUserModal.js +6 -8
- package/dist/tui/components/ConfirmModal.js +3 -5
- package/dist/tui/components/Dashboard.d.ts +1 -2
- package/dist/tui/components/Dashboard.js +16 -19
- package/dist/tui/components/DashboardCostTab.js +6 -5
- package/dist/tui/components/DashboardExecutionsTab.js +7 -9
- package/dist/tui/components/DashboardSchedulesTab.js +14 -11
- package/dist/tui/components/DashboardTasksTab.js +12 -21
- package/dist/tui/components/DashboardThreadsTab.js +8 -11
- package/dist/tui/components/InputBox.js +3 -5
- package/dist/tui/components/Notifications.d.ts +1 -8
- package/dist/tui/components/Notifications.js +6 -24
- package/dist/tui/components/ProjectSwitcher.d.ts +1 -2
- package/dist/tui/components/ProjectSwitcher.js +7 -15
- package/dist/tui/components/SessionPicker.js +4 -6
- package/dist/tui/components/SidePanel.d.ts +1 -3
- package/dist/tui/components/SidePanel.js +2 -4
- package/dist/tui/components/SlashMenu.js +3 -2
- package/dist/tui/components/StatusLine.js +7 -16
- package/dist/tui/components/Transcript.d.ts +2 -3
- package/dist/tui/components/Transcript.js +2 -13
- package/dist/tui/components/dashboard-constants.js +0 -6
- package/dist/tui/hooks/useDashboardData.d.ts +1 -9
- package/dist/tui/hooks/useDashboardData.js +8 -33
- package/dist/tui/hooks/useKeybindings.d.ts +0 -1
- package/dist/tui/hooks/useKeybindings.js +0 -7
- package/dist/tui/hooks/useMouseHandler.d.ts +2 -4
- package/dist/tui/hooks/useMouseHandler.js +1 -14
- package/dist/tui/hooks/useMutate.js +2 -4
- package/dist/tui/hooks/useNotifications.d.ts +0 -2
- package/dist/tui/hooks/useNotifications.js +0 -10
- package/dist/tui/hooks/useTranscript.d.ts +0 -2
- package/dist/tui/hooks/useTranscript.js +0 -7
- package/dist/tui/index.js +7 -5
- package/dist/tui/logic.d.ts +0 -15
- package/dist/tui/logic.js +0 -61
- package/dist/tui/raf-batch.d.ts +0 -2
- package/dist/tui/raf-batch.js +0 -14
- package/dist/tui/render/markdown.js +0 -3
- package/dist/tui/render-output.d.ts +2 -6
- package/dist/tui/render-output.js +0 -5
- package/dist/tui/slash-commands.js +33 -32
- package/dist/tui/turn-status.js +3 -8
- package/dist/tui/ws-client.d.ts +1 -6
- package/dist/tui/ws-client.js +0 -18
- package/package.json +4 -4
- package/web/dist/assets/index-C9sEss8T.css +1 -0
- package/web/dist/assets/index-fVf_wSMQ.js +447 -0
- package/web/dist/assets/{index-BAeLybF0.js → index-zvUjPRjt.js} +1 -1
- package/web/dist/index.html +2 -5
- package/web/dist/theme.css +3 -5
- package/defaults/config/AGENTS.md +0 -10
- package/defaults/config/hooks/AGENTS.md +0 -15
- package/defaults/config/mcp-config-empty.json +0 -3
- package/defaults/hooks/AGENTS.md +0 -15
- package/defaults/mcp-config-slack.json +0 -12
- package/defaults/mcp-config-web.json +0 -12
- package/dist/agent-adapter/index.d.ts +0 -5
- package/dist/agent-adapter/index.js +0 -5
- package/dist/agent-adapter/normalize/event-stream.d.ts +0 -9
- package/dist/agent-adapter/normalize/event-stream.js +0 -43
- package/dist/agent-adapter/normalize/hooks.d.ts +0 -26
- package/dist/agent-adapter/normalize/hooks.js +0 -1
- package/dist/domain/commissions/prompt-block.d.ts +0 -19
- package/dist/domain/commissions/prompt-block.js +0 -76
- package/dist/domain/mcp/core-server.d.ts +0 -1
- package/dist/domain/mcp/core-server.js +0 -26
- package/dist/domain/mcp/feishu/index.d.ts +0 -4
- package/dist/domain/mcp/feishu/index.js +0 -9
- package/dist/domain/mcp/feishu-server.d.ts +0 -1
- package/dist/domain/mcp/feishu-server.js +0 -34
- package/dist/domain/mcp/interaction-server.d.ts +0 -1
- package/dist/domain/mcp/interaction-server.js +0 -38
- package/dist/domain/mcp/manager-qa-server.d.ts +0 -1
- package/dist/domain/mcp/manager-qa-server.js +0 -22
- package/dist/domain/mcp/server.d.ts +0 -1
- package/dist/domain/mcp/server.js +0 -33
- package/dist/domain/mcp/slack-server.d.ts +0 -2
- package/dist/domain/mcp/slack-server.js +0 -35
- package/dist/domain/mcp/tasks-server.d.ts +0 -1
- package/dist/domain/mcp/tasks-server.js +0 -22
- package/dist/domain/mcp/thread-server.d.ts +0 -1
- package/dist/domain/mcp/thread-server.js +0 -26
- package/dist/domain/mcp/web-server.d.ts +0 -1
- package/dist/domain/mcp/web-server.js +0 -30
- package/dist/domain/remote/cortex-client-config.d.ts +0 -32
- package/dist/domain/remote/cortex-client-config.js +0 -45
- package/dist/domain/tasks/parser.d.ts +0 -1
- package/dist/domain/tasks/parser.js +0 -5
- package/dist/domain/tasks/pending-tracker.d.ts +0 -70
- package/dist/domain/tasks/pending-tracker.js +0 -165
- package/dist/domain/tasks/recommendation/extractor.d.ts +0 -12
- package/dist/domain/tasks/recommendation/extractor.js +0 -559
- package/dist/domain/tasks/recommendation/patterns.d.ts +0 -11
- package/dist/domain/tasks/recommendation/patterns.js +0 -95
- package/dist/domain/tasks/recommendation/types.d.ts +0 -67
- package/dist/domain/tasks/recommendation/types.js +0 -1
- package/dist/domain/tasks/store.d.ts +0 -1
- package/dist/domain/tasks/store.js +0 -3
- package/dist/domain/tasks/system/task-process.d.ts +0 -37
- package/dist/domain/tasks/system/task-process.js +0 -117
- package/dist/domain/threads/auto-thread.d.ts +0 -3
- package/dist/domain/threads/auto-thread.js +0 -15
- package/dist/events/event-replay.d.ts +0 -1
- package/dist/events/event-replay.js +0 -47
- package/dist/orchestration/interactions/update-prompt-slack.d.ts +0 -6
- package/dist/orchestration/interactions/update-prompt-slack.js +0 -100
- package/dist/orchestration/routing/commands/thread.d.ts +0 -2
- package/dist/orchestration/routing/commands/thread.js +0 -2
- package/dist/platform/adapters/slack-project-conduits.d.ts +0 -1
- package/dist/platform/adapters/slack-project-conduits.js +0 -5
- package/dist/platform/adapters/tui/tui-notifications.d.ts +0 -12
- package/dist/platform/adapters/tui/tui-notifications.js +0 -56
- package/dist/store/in-memory-repository.d.ts +0 -14
- package/dist/store/in-memory-repository.js +0 -27
- package/dist/tui/components/PlanFeedbackModal.d.ts +0 -11
- package/dist/tui/components/PlanFeedbackModal.js +0 -161
- package/dist/tui/hooks/useWsClient.d.ts +0 -29
- package/dist/tui/hooks/useWsClient.js +0 -69
- package/dist/tui/render/rich-blocks.d.ts +0 -11
- package/dist/tui/render/rich-blocks.js +0 -26
- package/web/dist/AGENTS.md +0 -10
- package/web/dist/assets/index-B1dBi8Za.css +0 -1
- package/web/dist/assets/index-BcQI8Fh5.js +0 -445
|
@@ -1,46 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// questions the editor needs before it lets anyone type: is this entity currently valid,
|
|
5
|
-
// what else depends on it, and is anything running on it right now — because transitions
|
|
6
|
-
// are re-read on every step, so a save can reroute or stall a live thread.
|
|
7
|
-
// For a shell-binding template it also returns the expanded graph, which is otherwise
|
|
8
|
-
// impossible to see: `execute-review.json` is four lines that bind a shell.
|
|
9
|
-
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
10
|
-
import * as path from 'node:path';
|
|
11
|
-
import { DEFAULTS_DIR } from '../../../core/paths.js';
|
|
12
|
-
import { validateEntity, rawRegistryFromDir, dependentTemplates, } from '../../threads/template-validate.js';
|
|
13
|
-
import { readEntity } from '../../threads/template-writer.js';
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { validateEntity, dependentTemplates, } from '../../threads/template-validate.js';
|
|
3
|
+
import { readEntity, readRawRegistry } from '../../threads/template-writer.js';
|
|
14
4
|
import { loaderRefResolver, CONFIG_TEMPLATES_DIR } from '../../threads/template-loader.js';
|
|
15
5
|
import { isShellBinding, expandShell } from '../../threads/shell-templates.js';
|
|
16
|
-
|
|
17
|
-
readdirSync: (p) => readdirSync(p),
|
|
18
|
-
readFileSync: (p, enc) => readFileSync(p, enc),
|
|
19
|
-
existsSync,
|
|
20
|
-
join: path.join,
|
|
21
|
-
};
|
|
22
|
-
const SUBDIR = {
|
|
23
|
-
template: 'templates',
|
|
24
|
-
agent: 'agents',
|
|
25
|
-
shell: 'shells',
|
|
26
|
-
};
|
|
6
|
+
import { classifyOrigin } from './thread-templates.js';
|
|
27
7
|
const TERMINAL_THREAD_STATUSES = new Set(['completed', 'failed', 'cancelled', 'aborted']);
|
|
28
|
-
/**
|
|
29
|
-
* Compare against the shipped defaults. `mergeThreadTemplates` is copy-if-missing and never
|
|
30
|
-
* overwrites, so a user file that differs from its default has forked permanently — it will not
|
|
31
|
-
* receive upstream changes. Worth knowing before editing.
|
|
32
|
-
*/
|
|
33
|
-
export function classifyOrigin(defaultsRoot, kind, name, userContent) {
|
|
34
|
-
const shipped = path.join(defaultsRoot, 'config', 'thread-templates', SUBDIR[kind], `${name}.json`);
|
|
35
|
-
if (!existsSync(shipped))
|
|
36
|
-
return 'custom';
|
|
37
|
-
try {
|
|
38
|
-
return readFileSync(shipped, 'utf8') === userContent ? 'stock' : 'modified';
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
return 'custom';
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
8
|
/** Expand a shell-binding template so the editor can show the graph it actually runs. */
|
|
45
9
|
function expandBinding(name, body, registry) {
|
|
46
10
|
if (!isShellBinding(body))
|
|
@@ -63,7 +27,7 @@ function expandBinding(name, body, registry) {
|
|
|
63
27
|
export async function handleThreadTemplatesDetail(deps, params) {
|
|
64
28
|
const { kind, name } = params;
|
|
65
29
|
const entity = readEntity(CONFIG_TEMPLATES_DIR, kind, name);
|
|
66
|
-
const registry =
|
|
30
|
+
const registry = readRawRegistry(CONFIG_TEMPLATES_DIR);
|
|
67
31
|
const { errors, warnings } = validateEntity(kind, name, entity.body, registry, loaderRefResolver());
|
|
68
32
|
const rawContent = existsSync(entity.filePath) ? readFileSync(entity.filePath, 'utf8') : null;
|
|
69
33
|
// Transitions are re-read every step, so a live thread on this template is the thing a user most
|
|
@@ -81,7 +45,7 @@ export async function handleThreadTemplatesDetail(deps, params) {
|
|
|
81
45
|
description,
|
|
82
46
|
body: entity.body,
|
|
83
47
|
filePath: entity.filePath,
|
|
84
|
-
origin: classifyOrigin(
|
|
48
|
+
origin: await classifyOrigin(kind, name, rawContent),
|
|
85
49
|
sha256: entity.sha256,
|
|
86
50
|
errors,
|
|
87
51
|
warnings,
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import type { UiServiceDeps, ThreadTemplatesGetParams, ThreadTemplateEntry } from '../types.js';
|
|
1
|
+
import type { UiServiceDeps, ThreadTemplatesGetParams, ThreadTemplateEntry, ThreadTemplateOrigin } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Relationship to the shipped default of the same name. `mergeThreadTemplates` is copy-if-missing
|
|
4
|
+
* and never overwrites, so a user file that differs has forked from upstream permanently.
|
|
5
|
+
*/
|
|
6
|
+
export declare function classifyOrigin(kind: ThreadTemplateEntry['kind'], name: string, content: string | null): Promise<ThreadTemplateOrigin>;
|
|
2
7
|
/**
|
|
3
8
|
* Read all thread-template entries from config/thread-templates/{templates,agents,shells}/*.json.
|
|
4
|
-
* Pure over configDir
|
|
9
|
+
* Pure over configDir (hermetically testable). Returns templates first, then agents,
|
|
5
10
|
* then shells, each group sorted alphabetically by basename. body is null when the file cannot be
|
|
6
11
|
* parsed. Each entry carries its validation verdict so the list can flag a broken entity without a
|
|
7
12
|
* round trip per row.
|
|
8
13
|
*/
|
|
9
|
-
export declare function readThreadTemplates(configDir: string
|
|
14
|
+
export declare function readThreadTemplates(configDir: string): Promise<ThreadTemplateEntry[]>;
|
|
10
15
|
export declare function handleThreadTemplatesGet(_deps: UiServiceDeps, _params: ThreadTemplatesGetParams): Promise<ThreadTemplateEntry[]>;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
// input: UiServiceDeps + ThreadTemplatesGetParams (empty)
|
|
2
|
-
// output: threadTemplates.get handler → ThreadTemplateEntry[] — full body of every
|
|
3
|
-
// thread-template JSON file under config/thread-templates/{templates,agents,shells}/
|
|
4
|
-
// pos: query handler for 'threadTemplates.get' (plan §12 A item 3 / 9c). Pure
|
|
5
|
-
// `readThreadTemplates(configDir)` + thin `handleThreadTemplatesGet` binding CONFIG_DIR.
|
|
6
|
-
// No secrets in template JSON files; body is the full parsed content, null on parse error.
|
|
7
|
-
// Kind order: templates → agents → shells. Within each kind: alphabetical by filename.
|
|
8
1
|
import fs from 'node:fs/promises';
|
|
9
2
|
import path from 'node:path';
|
|
10
3
|
import { CONFIG_DIR, DEFAULTS_DIR } from '../../../core/paths.js';
|
|
11
4
|
import { validateRegistry } from '../../threads/template-validate.js';
|
|
12
5
|
import { loaderRefResolver } from '../../threads/template-loader.js';
|
|
6
|
+
import { entityPath } from '../../threads/template-writer.js';
|
|
13
7
|
async function readJson(file) {
|
|
14
8
|
try {
|
|
15
9
|
const raw = JSON.parse(await fs.readFile(file, 'utf8'));
|
|
@@ -21,11 +15,6 @@ async function readJson(file) {
|
|
|
21
15
|
return null;
|
|
22
16
|
}
|
|
23
17
|
}
|
|
24
|
-
const SUBDIR = {
|
|
25
|
-
template: 'templates',
|
|
26
|
-
agent: 'agents',
|
|
27
|
-
shell: 'shells',
|
|
28
|
-
};
|
|
29
18
|
async function readEntriesForKind(dir, kind) {
|
|
30
19
|
try {
|
|
31
20
|
const files = await fs.readdir(dir);
|
|
@@ -47,8 +36,8 @@ async function readEntriesForKind(dir, kind) {
|
|
|
47
36
|
* Relationship to the shipped default of the same name. `mergeThreadTemplates` is copy-if-missing
|
|
48
37
|
* and never overwrites, so a user file that differs has forked from upstream permanently.
|
|
49
38
|
*/
|
|
50
|
-
async function classifyOrigin(
|
|
51
|
-
const shipped = path.join(
|
|
39
|
+
export async function classifyOrigin(kind, name, content) {
|
|
40
|
+
const shipped = entityPath(path.join(DEFAULTS_DIR, 'config', 'thread-templates'), kind, name);
|
|
52
41
|
const stock = await fs.readFile(shipped, 'utf8').catch(() => null);
|
|
53
42
|
if (stock === null)
|
|
54
43
|
return 'custom';
|
|
@@ -56,12 +45,12 @@ async function classifyOrigin(defaultsRoot, kind, name, content) {
|
|
|
56
45
|
}
|
|
57
46
|
/**
|
|
58
47
|
* Read all thread-template entries from config/thread-templates/{templates,agents,shells}/*.json.
|
|
59
|
-
* Pure over configDir
|
|
48
|
+
* Pure over configDir (hermetically testable). Returns templates first, then agents,
|
|
60
49
|
* then shells, each group sorted alphabetically by basename. body is null when the file cannot be
|
|
61
50
|
* parsed. Each entry carries its validation verdict so the list can flag a broken entity without a
|
|
62
51
|
* round trip per row.
|
|
63
52
|
*/
|
|
64
|
-
export async function readThreadTemplates(configDir
|
|
53
|
+
export async function readThreadTemplates(configDir) {
|
|
65
54
|
const tt = path.join(configDir, 'thread-templates');
|
|
66
55
|
const [templates, agents, shells] = await Promise.all([
|
|
67
56
|
readEntriesForKind(path.join(tt, 'templates'), 'template'),
|
|
@@ -81,7 +70,7 @@ export async function readThreadTemplates(configDir, defaultsRoot = DEFAULTS_DIR
|
|
|
81
70
|
...entry,
|
|
82
71
|
valid: errorCount === 0,
|
|
83
72
|
errorCount,
|
|
84
|
-
origin: await classifyOrigin(
|
|
73
|
+
origin: await classifyOrigin(entry.kind, entry.name, content),
|
|
85
74
|
};
|
|
86
75
|
}));
|
|
87
76
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as i18n from '../../../core/i18n.js';
|
|
1
2
|
import { readFile } from 'node:fs/promises';
|
|
2
3
|
import { toTaskInfo } from './tasks.js';
|
|
3
4
|
function mapStatus(status) {
|
|
@@ -66,7 +67,7 @@ function buildArtifactRefs(t, content) {
|
|
|
66
67
|
export async function handleThreadsGet(deps, params) {
|
|
67
68
|
const t = deps.threadStore.get(params.threadId);
|
|
68
69
|
if (!t)
|
|
69
|
-
throw new Error(
|
|
70
|
+
throw new Error(i18n.t('ui.thread.notFound', { id: params.threadId }));
|
|
70
71
|
const steps = buildSteps(t);
|
|
71
72
|
const content = await readArtifactContent(t.artifactPath ?? null, params.includeArtifactContent);
|
|
72
73
|
return {
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
// input: UiServiceDeps + WaitpointsListParams
|
|
2
|
-
// output: handleWaitpointsList → WaitpointInfo[]; ownsWaitpoint (the ownership rule, shared with
|
|
3
|
-
// query/sessions.ts); toWaitpointInfo (the redacting serialiser)
|
|
4
|
-
// pos: query handler for 'waitpoints.list' — the operator-facing view of the waitpoints a
|
|
5
|
-
// session is still waiting on. Deliberately NOT domain/waitpoints' `publicView`: that one
|
|
6
|
-
// is written for the agent and hides exactly the fields a human needs (delivery state, wake
|
|
7
|
-
// budget, rate-limit latch). Records reach this file only through UiServiceDeps.
|
|
8
1
|
import { getSettings } from '../../../core/settings.js';
|
|
9
2
|
const HOUR_MS = 60 * 60 * 1000;
|
|
10
3
|
/**
|
|
@@ -3,8 +3,8 @@ export declare const sessionsListInput: z.ZodObject<{
|
|
|
3
3
|
projectId: z.ZodOptional<z.ZodString>;
|
|
4
4
|
resumable: z.ZodOptional<z.ZodBoolean>;
|
|
5
5
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
6
|
-
thread: "thread";
|
|
7
6
|
direct: "direct";
|
|
7
|
+
thread: "thread";
|
|
8
8
|
scheduled: "scheduled";
|
|
9
9
|
}>>;
|
|
10
10
|
}, z.core.$strip>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const sessionsSetStarredInput: z.ZodObject<{
|
|
3
|
+
sessionId: z.ZodString;
|
|
4
|
+
starred: z.ZodBoolean;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const sessionsRenameInput: z.ZodObject<{
|
|
7
|
+
sessionId: z.ZodString;
|
|
8
|
+
label: z.ZodString;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type SessionsSetStarredArgs = z.infer<typeof sessionsSetStarredInput>;
|
|
11
|
+
export type SessionsSetStarredReturn = SessionsSetStarredArgs;
|
|
12
|
+
export type SessionsRenameArgs = z.infer<typeof sessionsRenameInput>;
|
|
13
|
+
export type SessionsRenameReturn = SessionsRenameArgs;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const sessionsSetStarredInput = z.object({
|
|
3
|
+
sessionId: z.string().min(1),
|
|
4
|
+
starred: z.boolean(),
|
|
5
|
+
});
|
|
6
|
+
export const sessionsRenameInput = z.object({
|
|
7
|
+
sessionId: z.string().min(1),
|
|
8
|
+
label: z.string().trim().min(1).max(60),
|
|
9
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EventBus } from '../../events/index.js';
|
|
2
|
+
import type { AssistantSnapshots } from './assistant-snapshots.js';
|
|
2
3
|
import type { SubscribeFilter, UiEvent } from './types.js';
|
|
3
|
-
export declare function createSubscription(bus: EventBus, filter: SubscribeFilter): AsyncIterable<UiEvent> & {
|
|
4
|
+
export declare function createSubscription(bus: EventBus, filter: SubscribeFilter, assistantSnapshots?: AssistantSnapshots): AsyncIterable<UiEvent> & {
|
|
4
5
|
close(): void;
|
|
5
6
|
};
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
// input: EventBus + SubscribeFilter
|
|
2
|
-
// output: AsyncIterable<UiEvent> & { close() } — bounded queue, overflow emits synthetic dropped event
|
|
3
|
-
// pos: subscribe primitive for UiService. Scope filters are applied BEFORE enqueueing, and the
|
|
4
|
-
// high-volume types in SESSION_SCOPED_ONLY require a matching sessionId to be delivered.
|
|
5
1
|
const QUEUE_CAP = 256;
|
|
6
2
|
/**
|
|
7
3
|
* Event types that a subscription only receives when it names the session they belong to.
|
|
@@ -75,11 +71,7 @@ function createAsyncQueue(cap, onOverflow) {
|
|
|
75
71
|
},
|
|
76
72
|
};
|
|
77
73
|
}
|
|
78
|
-
|
|
79
|
-
const eventTypes = filter.events;
|
|
80
|
-
const projectId = filter.projectId ?? null;
|
|
81
|
-
const executionId = filter.executionId ?? null;
|
|
82
|
-
const sessionId = filter.sessionId ?? null;
|
|
74
|
+
function createUiQueue() {
|
|
83
75
|
let droppedCount = 0;
|
|
84
76
|
// Wire overflow handler: push a synthetic UiEvent onto the queue.
|
|
85
77
|
// The queue's _inOverflow guard ensures push() from this callback does
|
|
@@ -94,51 +86,40 @@ export function createSubscription(bus, filter) {
|
|
|
94
86
|
// push() from within the guard: no overflow shift, item always appended.
|
|
95
87
|
queue.push(synthetic);
|
|
96
88
|
});
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const uiEvent = {
|
|
120
|
-
type: event.type,
|
|
121
|
-
ts: event.ts,
|
|
122
|
-
payload: event,
|
|
123
|
-
};
|
|
124
|
-
queue.push(uiEvent);
|
|
125
|
-
});
|
|
126
|
-
return sub;
|
|
127
|
-
});
|
|
89
|
+
return queue;
|
|
90
|
+
}
|
|
91
|
+
function matchesScope(event, { projectId, sessionId }) {
|
|
92
|
+
// Scope-required types must be filtered BEFORE reaching the bounded queue.
|
|
93
|
+
if (SESSION_SCOPED_ONLY.has(event.type) && (!sessionId || event.sessionId !== sessionId))
|
|
94
|
+
return false;
|
|
95
|
+
if (projectId && ((event.projectId && event.projectId !== projectId)
|
|
96
|
+
|| (event.payload?.projectId && event.payload.projectId !== projectId)))
|
|
97
|
+
return false;
|
|
98
|
+
return !(sessionId && event.sessionId && event.sessionId !== sessionId);
|
|
99
|
+
}
|
|
100
|
+
export function createSubscription(bus, filter, assistantSnapshots) {
|
|
101
|
+
const queue = createUiQueue();
|
|
102
|
+
const subscriptions = filter.events.map((type) => bus.subscribe(type, (event) => {
|
|
103
|
+
if (matchesScope(event, filter))
|
|
104
|
+
queue.push({ type: event.type, ts: event.ts, payload: event });
|
|
105
|
+
}));
|
|
106
|
+
// Registration and seed enqueue are synchronous: no publish can fall between the snapshot
|
|
107
|
+
// and forwarding. Seeds are never published onto the bus or sent to unscoped subscribers.
|
|
108
|
+
if (filter.sessionId && filter.events.includes('session.message.delta') && assistantSnapshots) {
|
|
109
|
+
queue.push(assistantSnapshots.snapshot(filter.sessionId));
|
|
110
|
+
}
|
|
128
111
|
let closed = false;
|
|
129
|
-
const close = () => {
|
|
130
|
-
if (closed)
|
|
131
|
-
return;
|
|
132
|
-
closed = true;
|
|
133
|
-
for (const sub of subscriptions) {
|
|
134
|
-
sub.unsubscribe();
|
|
135
|
-
}
|
|
136
|
-
queue.close();
|
|
137
|
-
};
|
|
138
112
|
return {
|
|
139
113
|
[Symbol.asyncIterator]() {
|
|
140
114
|
return queue[Symbol.asyncIterator]();
|
|
141
115
|
},
|
|
142
|
-
close
|
|
116
|
+
close() {
|
|
117
|
+
if (closed)
|
|
118
|
+
return;
|
|
119
|
+
closed = true;
|
|
120
|
+
for (const sub of subscriptions)
|
|
121
|
+
sub.unsubscribe();
|
|
122
|
+
queue.close();
|
|
123
|
+
},
|
|
143
124
|
};
|
|
144
125
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// output: router, publicProcedure and createCallerFactory
|
|
3
|
-
// pos: UI router foundation with credential-error redaction
|
|
4
|
-
// >>> Once updated, update this header and parent AGENTS.md <<<
|
|
1
|
+
import * as i18n from '../../core/i18n.js';
|
|
5
2
|
import { initTRPC } from '@trpc/server';
|
|
6
3
|
/**
|
|
7
4
|
* Keepalive for the SSE subscription that carries the whole UI's live state.
|
|
@@ -37,7 +34,7 @@ const t = initTRPC.create({
|
|
|
37
34
|
errorFormatter({ shape, path }) {
|
|
38
35
|
if (path !== 'config.setPlatform')
|
|
39
36
|
return shape;
|
|
40
|
-
return { ...shape, message: '
|
|
37
|
+
return { ...shape, message: i18n.t('ui.platform.requestFailed'),
|
|
41
38
|
data: { ...shape.data, stack: undefined } };
|
|
42
39
|
},
|
|
43
40
|
});
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import type { PlatformSettingsPatch, PlatformSettingsSnapshot } from '../../core/platform-settings-spec.js';
|
|
2
2
|
export type { PlatformSettingsPatch, PlatformSettingsSnapshot, PlatformFieldSnapshot, PlatformFieldKey } from '../../core/platform-settings-spec.js';
|
|
3
|
+
import type { SessionsSetStarredArgs, SessionsSetStarredReturn, SessionsRenameArgs, SessionsRenameReturn } from './session-metadata-schemas.js';
|
|
4
|
+
export type { SessionsSetStarredArgs, SessionsSetStarredReturn, SessionsRenameArgs, SessionsRenameReturn, } from './session-metadata-schemas.js';
|
|
3
5
|
import type { Project, CreateProjectResult } from '../projects/index.js';
|
|
4
6
|
import type { CostSummary } from '../costs/cost-tracker.js';
|
|
5
7
|
import type { ProviderUsage } from '../costs/usage-store.js';
|
|
6
8
|
export type { ProviderUsage, UsageBilling, UsageFreshness, UsageWindow } from '../costs/usage-store.js';
|
|
7
9
|
import type { ServerUpdateStatus } from '../system/update-ui-state.js';
|
|
10
|
+
import type { SystemUpdateCheckResult } from '../system/server-update-coordinator.js';
|
|
11
|
+
export type { SystemUpdateCheckResult } from '../system/server-update-coordinator.js';
|
|
8
12
|
export type { ServerUpdateState, ServerUpdateStatus } from '../system/update-ui-state.js';
|
|
9
13
|
import type { EventBus } from '../../events/index.js';
|
|
10
14
|
import type { SessionStateReader } from '../../core/session-state.js';
|
|
11
15
|
import type { Settings, SettingSnapshotEntry } from '../../core/settings-spec.js';
|
|
12
|
-
import type { AuthNoticeAction, ChatNoticeLevel, NoticeAction, SessionContextUsage, SystemTurnOrigin, TodoSnapshot } from '../../core/types/agent-types.js';
|
|
16
|
+
import type { AttachmentMeta, AuthNoticeAction, ChatNoticeLevel, NoticeAction, SessionContextUsage, SystemTurnOrigin, TodoSnapshot } from '../../core/types/agent-types.js';
|
|
13
17
|
export type { AuthNoticeAction, ChatNoticeLevel, NoticeAction, SessionContextUsage, SystemTurnOrigin, TodoItem, TodoSnapshot, TodoStatus, } from '../../core/types/agent-types.js';
|
|
14
18
|
import type { PlatformAdapter } from '../../platform/adapter.js';
|
|
15
19
|
import type { SubagentSpawnRef } from '../../agent-adapter/normalize/event-types.js';
|
|
@@ -40,13 +44,13 @@ export type Err = {
|
|
|
40
44
|
message: string;
|
|
41
45
|
};
|
|
42
46
|
export type Result<T> = Ok<T> | Err;
|
|
43
|
-
|
|
44
|
-
export type
|
|
47
|
+
/** Every query scope — the keys of `QueryParamMap` (mirrored by `QueryReturnMap`). */
|
|
48
|
+
export type QueryScope = keyof QueryParamMap;
|
|
49
|
+
/** Every mutate op — the keys of `MutateArgsMap` (mirrored by `MutateReturnMap`). */
|
|
50
|
+
export type MutateOp = keyof MutateArgsMap;
|
|
45
51
|
export interface SubscribeFilter {
|
|
46
52
|
events: string[];
|
|
47
53
|
projectId?: string | null;
|
|
48
|
-
/** Scope execution-carrying events (agent.*) to a single execution. */
|
|
49
|
-
executionId?: string | null;
|
|
50
54
|
/** Scope `session.message` events to a single session (S4 chat live stream). REQUIRED for
|
|
51
55
|
* `session.message.delta`: token-level previews are delivered to session-scoped subscriptions
|
|
52
56
|
* only, so an app-wide stream is never flooded with another session's deltas. */
|
|
@@ -250,21 +254,7 @@ export interface SessionsCreateArgs {
|
|
|
250
254
|
commissionId: string;
|
|
251
255
|
} | null;
|
|
252
256
|
}
|
|
253
|
-
export
|
|
254
|
-
name: string;
|
|
255
|
-
path: string;
|
|
256
|
-
size: number;
|
|
257
|
-
mimeType: string;
|
|
258
|
-
/**
|
|
259
|
-
* `view` is an agent-authored HTML document meant to be RENDERED in the chat (the `send_view`
|
|
260
|
-
* MCP tool), not merely downloaded. It is minted only by the server-side view sender — the
|
|
261
|
-
* upload classifiers (`classifyMime`, `classifyAttachment`) can never produce it, so a file a
|
|
262
|
-
* user uploads is never executable no matter what its extension says. Renderers must treat this
|
|
263
|
-
* bucket as untrusted content and load it in a `sandbox="allow-scripts"` frame WITHOUT
|
|
264
|
-
* `allow-same-origin` (see web/src/features/media/html-sandbox.ts).
|
|
265
|
-
*/
|
|
266
|
-
type: 'image' | 'video' | 'file' | 'view';
|
|
267
|
-
}
|
|
257
|
+
export type { AttachmentMeta } from '../../core/types/agent-types.js';
|
|
268
258
|
export interface SessionsSendArgs {
|
|
269
259
|
sessionId: string;
|
|
270
260
|
text: string;
|
|
@@ -636,6 +626,10 @@ export interface SessionInfo {
|
|
|
636
626
|
lastUsedAt: string;
|
|
637
627
|
resumable: boolean;
|
|
638
628
|
label: string | null;
|
|
629
|
+
/** Optional for older fixtures/clients; sessions.list always supplies a boolean. */
|
|
630
|
+
starred?: boolean;
|
|
631
|
+
/** Explicitly renamed labels take precedence over generated scheduled-run titles. */
|
|
632
|
+
labelRenamed?: boolean;
|
|
639
633
|
/** The session's active agent profile (registry record). Null when never explicitly set — the
|
|
640
634
|
* client falls back to the config default. Kept in sync by the shared profile-switch rule. */
|
|
641
635
|
profileName: string | null;
|
|
@@ -855,6 +849,8 @@ export interface TranscriptSubagentSummary {
|
|
|
855
849
|
toolCount: number;
|
|
856
850
|
hasDetails: boolean;
|
|
857
851
|
structurallyOpen: boolean;
|
|
852
|
+
/** Explicit per-child lifecycle authority; absent for legacy structural inference. */
|
|
853
|
+
status?: 'running' | 'completed' | 'failed' | 'killed';
|
|
858
854
|
}
|
|
859
855
|
/** Rows that changed since a client's cursor, addressed by flat position across the transcript. */
|
|
860
856
|
export interface TranscriptDeltaRow {
|
|
@@ -1933,13 +1929,11 @@ export interface DaemonProcessInfo {
|
|
|
1933
1929
|
pid: number | null;
|
|
1934
1930
|
uptime: string | null;
|
|
1935
1931
|
port: number | null;
|
|
1936
|
-
extras: Record<string, string | number> | null;
|
|
1937
1932
|
}
|
|
1938
1933
|
export interface SystemDaemonStatus {
|
|
1939
1934
|
processes: DaemonProcessInfo[];
|
|
1940
1935
|
lastRestart: {
|
|
1941
1936
|
at: string | null;
|
|
1942
|
-
reason: string | null;
|
|
1943
1937
|
};
|
|
1944
1938
|
/** The supervisor's hot-rebuild pipeline: the run in flight, or the last one it finished. Null
|
|
1945
1939
|
* when no rebuild has run (production installs never rebuild) or when the record belongs to a
|
|
@@ -1990,6 +1984,7 @@ export interface SystemRestartReturn {
|
|
|
1990
1984
|
}
|
|
1991
1985
|
export type SystemUpdateStatusParams = Record<string, never>;
|
|
1992
1986
|
export type SystemUpdateStatus = ServerUpdateStatus;
|
|
1987
|
+
export type SystemCheckUpdateArgs = Record<string, never>;
|
|
1993
1988
|
export type SystemApplyUpdateArgs = Record<string, never>;
|
|
1994
1989
|
export type SystemSkipUpdateArgs = Record<string, never>;
|
|
1995
1990
|
export interface SystemUpdateDecisionReturn {
|
|
@@ -2218,6 +2213,8 @@ export interface MutateArgsMap {
|
|
|
2218
2213
|
'sessions.setSelection': SessionsSetSelectionArgs;
|
|
2219
2214
|
'sessions.setCommission': SessionsSetCommissionArgs;
|
|
2220
2215
|
'sessions.createAndSend': SessionsCreateAndSendArgs;
|
|
2216
|
+
'sessions.setStarred': SessionsSetStarredArgs;
|
|
2217
|
+
'sessions.rename': SessionsRenameArgs;
|
|
2221
2218
|
'sessions.markRead': SessionsMarkReadArgs;
|
|
2222
2219
|
'sessions.markManyRead': SessionsMarkManyReadArgs;
|
|
2223
2220
|
'sessions.answerQuestion': SessionsAnswerQuestionArgs;
|
|
@@ -2282,6 +2279,7 @@ export interface MutateArgsMap {
|
|
|
2282
2279
|
'system.restart': SystemRestartArgs;
|
|
2283
2280
|
'system.clearRateLimit': SystemClearRateLimitArgs;
|
|
2284
2281
|
'system.refreshUsage': SystemRefreshUsageArgs;
|
|
2282
|
+
'system.checkUpdate': SystemCheckUpdateArgs;
|
|
2285
2283
|
'system.applyUpdate': SystemApplyUpdateArgs;
|
|
2286
2284
|
'system.skipUpdate': SystemSkipUpdateArgs;
|
|
2287
2285
|
}
|
|
@@ -2296,6 +2294,8 @@ export interface MutateReturnMap {
|
|
|
2296
2294
|
'sessions.setSelection': SessionsSetSelectionReturn;
|
|
2297
2295
|
'sessions.setCommission': SessionsSetCommissionReturn;
|
|
2298
2296
|
'sessions.createAndSend': SessionsCreateAndSendReturn;
|
|
2297
|
+
'sessions.setStarred': SessionsSetStarredReturn;
|
|
2298
|
+
'sessions.rename': SessionsRenameReturn;
|
|
2299
2299
|
'sessions.markRead': void;
|
|
2300
2300
|
'sessions.markManyRead': SessionsMarkManyReadReturn;
|
|
2301
2301
|
'sessions.answerQuestion': SessionsInteractionMutateReturn;
|
|
@@ -2363,13 +2363,14 @@ export interface MutateReturnMap {
|
|
|
2363
2363
|
'system.restart': SystemRestartReturn;
|
|
2364
2364
|
'system.clearRateLimit': SystemClearRateLimitReturn;
|
|
2365
2365
|
'system.refreshUsage': SystemRefreshUsageReturn;
|
|
2366
|
+
'system.checkUpdate': SystemUpdateCheckResult;
|
|
2366
2367
|
'system.applyUpdate': SystemUpdateDecisionReturn;
|
|
2367
2368
|
'system.skipUpdate': SystemUpdateDecisionReturn;
|
|
2368
2369
|
}
|
|
2369
|
-
export type QueryParams<S extends QueryScope> =
|
|
2370
|
-
export type QueryReturn<S extends QueryScope> =
|
|
2371
|
-
export type MutateArgs<O extends MutateOp> =
|
|
2372
|
-
export type MutateReturn<O extends MutateOp> =
|
|
2370
|
+
export type QueryParams<S extends QueryScope> = QueryParamMap[S];
|
|
2371
|
+
export type QueryReturn<S extends QueryScope> = QueryReturnMap[S];
|
|
2372
|
+
export type MutateArgs<O extends MutateOp> = MutateArgsMap[O];
|
|
2373
|
+
export type MutateReturn<O extends MutateOp> = MutateReturnMap[O];
|
|
2373
2374
|
export interface UiService {
|
|
2374
2375
|
query<S extends QueryScope>(scope: S, params: QueryParams<S>): Promise<Result<QueryReturn<S>>>;
|
|
2375
2376
|
mutate<O extends MutateOp>(op: O, args: MutateArgs<O>): Promise<Result<MutateReturn<O>>>;
|
|
@@ -2378,6 +2379,8 @@ export interface UiService {
|
|
|
2378
2379
|
};
|
|
2379
2380
|
}
|
|
2380
2381
|
export interface UiServiceDeps {
|
|
2382
|
+
/** Shared with background timers; bounded discovery, never waits for update consent. */
|
|
2383
|
+
checkServerUpdate?: () => Promise<SystemUpdateCheckResult>;
|
|
2381
2384
|
/** Optional seams for deterministic authentication dispatch tests. */
|
|
2382
2385
|
getAuthStatus?: () => Promise<AuthStatusSnapshot>;
|
|
2383
2386
|
authLogin?: AuthLoginService;
|
|
@@ -2406,6 +2409,9 @@ export interface UiServiceDeps {
|
|
|
2406
2409
|
/** Stamp lastReadAt=now (unread tracking; backs `sessions.markRead`). Optional so existing
|
|
2407
2410
|
* facade/test fixtures need not provide it (the handler no-ops when absent). */
|
|
2408
2411
|
markRead?(sessionId: string): Promise<void>;
|
|
2412
|
+
/** Atomic metadata-only writes. Optional for read-only/legacy fixtures, not silent no-ops. */
|
|
2413
|
+
setStarred?(sessionId: string, starred: boolean): Promise<Session | null>;
|
|
2414
|
+
rename?(sessionId: string, label: string): Promise<Session | null>;
|
|
2409
2415
|
};
|
|
2410
2416
|
/** Capability hint for sessions.list; execution revalidates inside orchestration. Narrowed to
|
|
2411
2417
|
* the two fields the answer depends on so the list can answer it once per distinct profile
|
|
@@ -2425,19 +2431,19 @@ export interface UiServiceDeps {
|
|
|
2425
2431
|
ok: false;
|
|
2426
2432
|
reason: 'not-found' | 'unsupported' | 'running';
|
|
2427
2433
|
}>;
|
|
2434
|
+
/** Snapshot of started Cortex-managed children only; native CLI tasks use their own tracker. */
|
|
2435
|
+
getSubagentChildStatuses?: (sessionId: string) => ReadonlyMap<string, NonNullable<TranscriptSubagentSummary['status']>>;
|
|
2428
2436
|
/** Backend-independent conversation history — read source for `sessions.transcript` (S4 chat). */
|
|
2429
2437
|
conversationHistory: {
|
|
2430
2438
|
getHistory(sessionId: string, options?: {
|
|
2431
2439
|
includeToolDebug?: boolean;
|
|
2432
2440
|
}): Promise<SessionHistory | null>;
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
* it simply never serves deltas. */
|
|
2436
|
-
getCompactHistoryAt?(sessionId: string): Promise<{
|
|
2441
|
+
/** Compact history plus the cursor that makes the next read a delta. */
|
|
2442
|
+
getCompactHistoryAt(sessionId: string): Promise<{
|
|
2437
2443
|
value: import('../../store/conversation-history-repo.js').CompactConversationHistory | null;
|
|
2438
2444
|
cursor: string;
|
|
2439
2445
|
}>;
|
|
2440
|
-
getSubagentHistory
|
|
2446
|
+
getSubagentHistory(sessionId: string, subagentId: string): Promise<import('../../store/conversation-history-repo.js').SubagentConversationHistory>;
|
|
2441
2447
|
getToolDebugDetails?(sessionId: string, toolRef: string): Promise<TranscriptDebugDetails | null>;
|
|
2442
2448
|
/** First user message text — used to title a label-less session in `sessions.list`. Optional so
|
|
2443
2449
|
* facade/test fixtures need not provide it (the handler skips titling when absent). */
|
|
@@ -2468,7 +2474,6 @@ export interface UiServiceDeps {
|
|
|
2468
2474
|
* callback so the ui-service domain never imports orchestration (layer safety / depcruise).
|
|
2469
2475
|
*/
|
|
2470
2476
|
sendSessionMessage: (opts: {
|
|
2471
|
-
sessionId: string;
|
|
2472
2477
|
channel: string;
|
|
2473
2478
|
text: string;
|
|
2474
2479
|
attachments?: AttachmentMeta[];
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
// input: UI dependencies and operation handlers
|
|
2
|
-
// output: UI dispatcher with credential-safe mutation audit
|
|
3
|
-
// pos: Transport-neutral UI-service dispatcher
|
|
4
|
-
// >>> Once updated, update this header and parent AGENTS.md <<<
|
|
5
1
|
import { handleProjectsList } from './query/projects.js';
|
|
2
|
+
import { handleSetStarred, handleRenameSession } from './mutate/session-metadata.js';
|
|
6
3
|
import { handleSessionsList, handleSessionsTranscript, handleSessionsSubagentTranscript, handleSessionsDebugDetails, handleSessionsPendingInteraction, } from './query/sessions.js';
|
|
7
4
|
import { handleThreadsList, handleThreadsGet } from './query/threads.js';
|
|
8
5
|
import { handleTasksList } from './query/tasks.js';
|
|
@@ -47,10 +44,11 @@ import { handleClaimTask, handleUnclaimTask, handleCompleteTask, handleBlockTask
|
|
|
47
44
|
import { handleApproveApproval, handleRejectApproval, handleRequestApproval } from './mutate/approvals.js';
|
|
48
45
|
import { handleIssuesDelete, handleIssuesHandle } from './mutate/issues.js';
|
|
49
46
|
import { handleNotesAdd, handleNotesClearCompleted, handleNotesDelete, handleNotesSetCompleted, handleNotesUpdate, } from './mutate/notes.js';
|
|
50
|
-
import { handleSystemRestart, handleSystemClearRateLimit, handleSystemRefreshUsage, handleSystemApplyUpdate, handleSystemSkipUpdate, } from './mutate/system.js';
|
|
47
|
+
import { handleSystemRestart, handleSystemClearRateLimit, handleSystemRefreshUsage, handleSystemCheckUpdate, handleSystemApplyUpdate, handleSystemSkipUpdate, } from './mutate/system.js';
|
|
51
48
|
import { handleAuthCancelFlow, handleAuthLogout, handleAuthSyncGateway, handleAuthRespondPrompt, handleAuthStartLogin, } from './mutate/auth.js';
|
|
52
49
|
import { handleCustomProviderRemove, handleCustomProviderUpsert, } from './mutate/custom-providers.js';
|
|
53
50
|
import { createSubscription } from './subscribe.js';
|
|
51
|
+
import { AssistantSnapshots } from './assistant-snapshots.js';
|
|
54
52
|
const queryHandlers = {
|
|
55
53
|
'projects.list': (deps) => handleProjectsList(deps),
|
|
56
54
|
'sessions.list': (deps, params) => handleSessionsList(deps, params),
|
|
@@ -106,6 +104,8 @@ const mutateHandlers = {
|
|
|
106
104
|
'sessions.setSelection': (deps, args) => handleSetSelection(deps, args),
|
|
107
105
|
'sessions.setCommission': (deps, args) => handleSetCommission(deps, args),
|
|
108
106
|
'sessions.createAndSend': (deps, args) => handleCreateAndSend(deps, args),
|
|
107
|
+
'sessions.setStarred': (deps, args) => handleSetStarred(deps, args),
|
|
108
|
+
'sessions.rename': (deps, args) => handleRenameSession(deps, args),
|
|
109
109
|
'sessions.markRead': (deps, args) => handleMarkReadSession(deps, args),
|
|
110
110
|
'sessions.markManyRead': (deps, args) => handleMarkManyReadSessions(deps, args),
|
|
111
111
|
'sessions.answerQuestion': (deps, args) => handleAnswerQuestion(deps, args),
|
|
@@ -170,6 +170,7 @@ const mutateHandlers = {
|
|
|
170
170
|
'system.restart': (_deps, args) => handleSystemRestart(args),
|
|
171
171
|
'system.clearRateLimit': (_deps, args) => handleSystemClearRateLimit(args),
|
|
172
172
|
'system.refreshUsage': (_deps, args) => handleSystemRefreshUsage(args),
|
|
173
|
+
'system.checkUpdate': handleSystemCheckUpdate,
|
|
173
174
|
'system.applyUpdate': (_deps, args) => handleSystemApplyUpdate(args),
|
|
174
175
|
'system.skipUpdate': (_deps, args) => handleSystemSkipUpdate(args),
|
|
175
176
|
};
|
|
@@ -192,6 +193,7 @@ export function redactMutationAuditArgs(op, args) {
|
|
|
192
193
|
return safe;
|
|
193
194
|
}
|
|
194
195
|
export function createUiService(deps) {
|
|
196
|
+
const assistantSnapshots = new AssistantSnapshots(deps.bus);
|
|
195
197
|
return {
|
|
196
198
|
async query(scope, params) {
|
|
197
199
|
const handler = queryHandlers[scope];
|
|
@@ -235,7 +237,7 @@ export function createUiService(deps) {
|
|
|
235
237
|
}
|
|
236
238
|
},
|
|
237
239
|
subscribe(filter) {
|
|
238
|
-
return createSubscription(deps.bus, filter);
|
|
240
|
+
return createSubscription(deps.bus, filter, assistantSnapshots);
|
|
239
241
|
},
|
|
240
242
|
};
|
|
241
243
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
// input: Waitpoint records
|
|
2
|
-
// output: buildSignalNotice / buildExpiryNotice / describeWaitFor
|
|
3
|
-
// pos: Wake-notice text for waitpoints. Pure string building — no repo, no delivery.
|
|
4
|
-
// The notice is read by an agent whose turn ended hours ago, so it must be self-contained:
|
|
5
|
-
// it restates the intent captured at creation, and it frames the external payload as data.
|
|
6
1
|
/** Rendered payload ceiling. The per-signal values are already clipped by the service; this bounds
|
|
7
2
|
* the *assembled* notice so a large quorum cannot add up to an oversized turn. */
|
|
8
3
|
const NOTICE_DATA_BUDGET = 8000;
|
|
@@ -8,7 +8,7 @@ export declare const DEFAULT_COALESCE_MS = 3000;
|
|
|
8
8
|
export declare const MESSAGE_MAX_CHARS = 2000;
|
|
9
9
|
export declare const DATA_MAX_CHARS = 16000;
|
|
10
10
|
export interface WaitpointServiceDeps {
|
|
11
|
-
repo: Pick<WaitpointRepo, 'get' | 'list' | '
|
|
11
|
+
repo: Pick<WaitpointRepo, 'get' | 'list' | 'insert' | 'update' | 'mutate'>;
|
|
12
12
|
now: () => number;
|
|
13
13
|
/** Sliding-window cap on wakes per waitpoint per hour. */
|
|
14
14
|
maxWakesPerHour: () => number;
|