@cortex-agent/server 2026.10.15 → 2026.10.25
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 +81 -51
- package/defaults/board/board.css +140 -62
- package/defaults/board/scaffold.html +36 -13
- package/defaults/config/environments/creative.json +0 -1
- package/defaults/config/environments/main.json +1 -2
- package/defaults/context/projects/AGENTS.md +1 -1
- package/defaults/gitignore +3 -3
- package/defaults/hooks/new-session-hook.mjs +1 -1
- package/defaults/hooks/status-md-guard.mjs +6 -6
- package/defaults/plugins/cortex-board/skills/board/SKILL.md +30 -22
- package/defaults/plugins/cortex-system/plugin.json +2 -2
- package/defaults/plugins/cortex-system/skills/browser/SKILL.md +56 -0
- package/defaults/plugins/cortex-system/skills/client-manage/SKILL.md +16 -9
- package/defaults/plugins/cortex-system/skills/project-init/SKILL.md +2 -2
- package/defaults/rules/agents-md.md +1 -1
- package/defaults/rules/issues-md.md +1 -1
- package/defaults/rules/meta-conventions.md +3 -3
- package/defaults/rules/mission-md.md +1 -1
- package/defaults/rules/status-md.md +1 -1
- package/dist/agent-adapter/claude/adapter.d.ts +2 -5
- package/dist/agent-adapter/claude/adapter.js +6 -5
- package/dist/agent-adapter/claude/assistant-blocks.d.ts +5 -0
- package/dist/agent-adapter/claude/assistant-blocks.js +61 -0
- package/dist/agent-adapter/claude/bg-task-tracker.d.ts +3 -1
- package/dist/agent-adapter/claude/bg-task-tracker.js +6 -2
- package/dist/agent-adapter/claude/cache-refresh.d.ts +58 -0
- package/dist/agent-adapter/claude/cache-refresh.js +145 -0
- package/dist/agent-adapter/claude/cache-touch.d.ts +12 -0
- package/dist/agent-adapter/claude/cache-touch.js +75 -0
- package/dist/agent-adapter/claude/event-parser.d.ts +8 -3
- package/dist/agent-adapter/claude/event-parser.js +33 -17
- package/dist/agent-adapter/claude/event-translator.d.ts +2 -0
- package/dist/agent-adapter/claude/event-translator.js +2 -0
- package/dist/agent-adapter/claude/mcp-config.js +11 -0
- package/dist/agent-adapter/claude/session-options.d.ts +6 -13
- package/dist/agent-adapter/claude/session-options.js +2 -13
- package/dist/agent-adapter/claude/spawn-args.d.ts +4 -21
- package/dist/agent-adapter/claude/spawn-args.js +17 -24
- package/dist/agent-adapter/claude/transcript-clear.d.ts +42 -0
- package/dist/agent-adapter/claude/transcript-clear.js +217 -0
- package/dist/agent-adapter/claude/turn-machine.d.ts +5 -3
- package/dist/agent-adapter/claude/turn-machine.js +29 -73
- package/dist/agent-adapter/claude/window-warmup.d.ts +13 -0
- package/dist/agent-adapter/claude/window-warmup.js +38 -0
- package/dist/agent-adapter/continuation-phase.d.ts +6 -3
- package/dist/agent-adapter/continuation-phase.js +11 -3
- package/dist/agent-adapter/normalize/event-types.d.ts +8 -0
- package/dist/agent-adapter/pi/adapter.d.ts +0 -1
- package/dist/agent-adapter/pi/adapter.js +5 -13
- package/dist/agent-adapter/pi/event-parser.d.ts +1 -1
- package/dist/agent-adapter/pi/event-parser.js +43 -27
- package/dist/agent-adapter/pi/mcp-bridge.d.ts +1 -1
- package/dist/agent-adapter/pi/pi-session.d.ts +2 -0
- package/dist/agent-adapter/pi/pi-session.js +15 -0
- package/dist/agent-adapter/pi/providers-config.d.ts +2 -2
- package/dist/agent-adapter/pi/providers-config.js +1 -1
- package/dist/agent-adapter/pi/quota-sink.d.ts +3 -3
- package/dist/agent-adapter/pi/quota-sink.js +3 -3
- package/dist/agent-adapter/pi/runtime.js +6 -1
- package/dist/agent-adapter/pi/session-options.d.ts +9 -13
- package/dist/agent-adapter/pi/session-options.js +12 -25
- package/dist/agent-adapter/run-events.d.ts +15 -10
- package/dist/agent-adapter/run-events.js +2 -0
- package/dist/agent-adapter/types.d.ts +14 -6
- package/dist/build-info.json +1 -0
- package/dist/client-bundle/client.mjs +10 -5
- package/dist/client-bundle/manifest.json +3 -3
- package/dist/core/claude-credentials.d.ts +6 -0
- package/dist/core/claude-credentials.js +11 -0
- package/dist/core/codex-quota.d.ts +1 -1
- package/dist/core/codex-quota.js +1 -1
- package/dist/core/gateway-generator.d.ts +26 -11
- package/dist/core/gateway-generator.js +73 -62
- package/dist/core/hook-bus.d.ts +1 -1
- package/dist/core/hook-bus.js +1 -8
- package/dist/core/locales/en.d.ts +52 -77
- package/dist/core/locales/slices/commands.d.ts +26 -31
- package/dist/core/locales/slices/commands.js +54 -64
- package/dist/core/locales/slices/init.d.ts +9 -19
- package/dist/core/locales/slices/init.js +19 -53
- package/dist/core/locales/slices/interactions.d.ts +3 -3
- package/dist/core/locales/slices/interactions.js +6 -6
- package/dist/core/locales/slices/notices.d.ts +1 -3
- package/dist/core/locales/slices/notices.js +2 -6
- package/dist/core/locales/slices/scheduling.d.ts +9 -9
- package/dist/core/locales/slices/scheduling.js +18 -18
- package/dist/core/locales/slices/status.d.ts +0 -4
- package/dist/core/locales/slices/status.js +0 -8
- package/dist/core/locales/slices/tui.d.ts +0 -1
- package/dist/core/locales/slices/tui.js +0 -2
- package/dist/core/locales/slices/uimsg.d.ts +4 -7
- package/dist/core/locales/slices/uimsg.js +9 -15
- package/dist/core/log.d.ts +3 -0
- package/dist/core/log.js +18 -1
- package/dist/core/models-generator.d.ts +29 -0
- package/dist/core/models-generator.js +82 -0
- package/dist/core/paths.d.ts +1 -1
- package/dist/core/paths.js +1 -1
- package/dist/core/settings-spec.d.ts +30 -0
- package/dist/core/settings-spec.js +38 -0
- package/dist/core/status-format.d.ts +3 -2
- package/dist/core/status-format.js +2 -2
- package/dist/core/types/agent-types.d.ts +3 -1
- package/dist/core/types/environment-types.d.ts +1 -8
- package/dist/domain/agents/agent-state.d.ts +11 -56
- package/dist/domain/agents/agent-state.js +48 -115
- package/dist/domain/agents/agent-switch.d.ts +2 -24
- package/dist/domain/agents/agent-switch.js +9 -72
- package/dist/domain/agents/config.d.ts +11 -61
- package/dist/domain/agents/config.js +47 -154
- package/dist/domain/agents/engine-selection.d.ts +21 -0
- package/dist/domain/agents/engine-selection.js +37 -0
- package/dist/domain/agents/environments/registry.js +4 -2
- package/dist/domain/agents/environments/resolve.js +0 -1
- package/dist/domain/agents/environments/schema.d.ts +3 -3
- package/dist/domain/agents/environments/schema.js +4 -4
- package/dist/domain/agents/index.d.ts +2 -1
- package/dist/domain/agents/index.js +3 -7
- package/dist/domain/agents/model-selection.d.ts +18 -70
- package/dist/domain/agents/model-selection.js +100 -150
- package/dist/domain/agents/models.d.ts +12 -0
- package/dist/domain/agents/models.js +94 -0
- package/dist/domain/agents/subagent/registry.d.ts +2 -0
- package/dist/domain/agents/subagent/registry.js +8 -0
- package/dist/domain/agents/subagent/runner.d.ts +5 -5
- package/dist/domain/agents/subagent/runner.js +12 -35
- package/dist/domain/auth/auth-status.d.ts +4 -4
- package/dist/domain/auth/auth-status.js +17 -28
- package/dist/domain/auth/auth-watch.js +48 -18
- package/dist/domain/auth/gateway-sync.d.ts +6 -26
- package/dist/domain/auth/gateway-sync.js +31 -75
- package/dist/domain/benchmark/identity.d.ts +3 -5
- package/dist/domain/benchmark/identity.js +0 -1
- package/dist/domain/benchmark/production-attempt-identity.d.ts +6 -5
- package/dist/domain/benchmark/production-attempt-identity.js +32 -35
- package/dist/domain/benchmark/session-evidence.d.ts +2 -1
- package/dist/domain/benchmark/session-evidence.js +8 -1
- package/dist/domain/browser/broker.d.ts +99 -0
- package/dist/domain/browser/broker.js +487 -0
- package/dist/domain/costs/claude-account.js +21 -0
- package/dist/domain/costs/rate-limit-throttle.js +3 -1
- package/dist/domain/costs/reset-account.d.ts +2 -0
- package/dist/domain/costs/usage-service.d.ts +1 -1
- package/dist/domain/costs/usage-service.js +20 -7
- package/dist/domain/mcp/tools/context.d.ts +5 -7
- package/dist/domain/mcp/tools/context.js +17 -4
- package/dist/domain/mcp/tools/subagent.js +1 -1
- package/dist/domain/mcp/tools/ui-file.js +1 -1
- package/dist/domain/monitor/event-loop-monitor.d.ts +2 -0
- package/dist/domain/monitor/event-loop-monitor.js +5 -1
- package/dist/domain/pi-providers/custom-provider-model.d.ts +1 -1
- package/dist/domain/pi-providers/custom-provider-model.js +1 -1
- package/dist/domain/plugins/authoring.d.ts +8 -1
- package/dist/domain/plugins/authoring.js +24 -9
- package/dist/domain/plugins/runtime-gc.d.ts +7 -0
- package/dist/domain/plugins/runtime-gc.js +52 -19
- package/dist/domain/plugins/runtime.js +2 -1
- package/dist/domain/remote/client-bootstrap.js +1 -1
- package/dist/domain/remote/client-manager.js +6 -1
- package/dist/domain/remote/device-browser.js +1 -1
- package/dist/domain/remote/device-chrome-commands.js +2 -0
- package/dist/domain/remote/device-port.js +2 -2
- package/dist/domain/runs/attempt.d.ts +3 -3
- package/dist/domain/runs/attempt.js +2 -3
- package/dist/domain/runs/builders.d.ts +4 -4
- package/dist/domain/runs/builders.js +4 -5
- package/dist/domain/runs/compact.d.ts +4 -17
- package/dist/domain/runs/compact.js +14 -56
- package/dist/domain/runs/config-resolver.d.ts +15 -83
- package/dist/domain/runs/config-resolver.js +24 -150
- package/dist/domain/runs/engine-spec.d.ts +8 -8
- package/dist/domain/runs/engine-spec.js +15 -31
- package/dist/domain/runs/events.d.ts +1 -1
- package/dist/domain/runs/fallback.d.ts +6 -38
- package/dist/domain/runs/fallback.js +10 -72
- package/dist/domain/runs/notices.d.ts +1 -11
- package/dist/domain/runs/notices.js +3 -30
- package/dist/domain/runs/request.d.ts +4 -3
- package/dist/domain/runs/retryable-errors.d.ts +0 -13
- package/dist/domain/runs/retryable-errors.js +3 -18
- package/dist/domain/runs/run.d.ts +12 -42
- package/dist/domain/runs/run.js +40 -147
- package/dist/domain/runs/service.d.ts +0 -9
- package/dist/domain/runs/service.js +33 -14
- package/dist/domain/runs/spec-loader.d.ts +1 -1
- package/dist/domain/runs/spend.d.ts +1 -1
- package/dist/domain/runs/spend.js +1 -1
- package/dist/domain/scheduling/builtin-job-controller.d.ts +3 -1
- package/dist/domain/scheduling/builtin-job-controller.js +5 -2
- package/dist/domain/scheduling/builtin-jobs.js +7 -0
- package/dist/domain/scheduling/jobs/scheduled-task.d.ts +3 -2
- package/dist/domain/scheduling/jobs/scheduled-task.js +25 -19
- package/dist/domain/scheduling/schedule-ops.d.ts +0 -1
- package/dist/domain/scheduling/schedule-ops.js +2 -5
- package/dist/domain/scheduling/schedule-selection.d.ts +3 -0
- package/dist/domain/scheduling/schedule-selection.js +16 -0
- package/dist/domain/scheduling/schedule-spec.d.ts +6 -5
- package/dist/domain/scheduling/schedule-spec.js +6 -6
- package/dist/domain/scheduling/scheduler.d.ts +3 -1
- package/dist/domain/scheduling/scheduler.js +36 -26
- package/dist/domain/sessions/session-hooks.d.ts +5 -4
- package/dist/domain/sessions/session-hooks.js +15 -33
- package/dist/domain/sessions/session-lifecycle.d.ts +19 -51
- package/dist/domain/sessions/session-lifecycle.js +34 -96
- package/dist/domain/system/doctor.d.ts +3 -3
- package/dist/domain/system/doctor.js +22 -26
- package/dist/domain/system/own-bin-path.d.ts +13 -0
- package/dist/domain/system/own-bin-path.js +36 -0
- package/dist/domain/system/server-update-check.js +2 -1
- package/dist/domain/system/terminal-cli/index.d.ts +58 -0
- package/dist/domain/system/terminal-cli/index.js +100 -0
- package/dist/domain/system/terminal-cli/posix-profiles.d.ts +23 -0
- package/dist/domain/system/terminal-cli/posix-profiles.js +74 -0
- package/dist/domain/system/terminal-cli/registrar.d.ts +12 -0
- package/dist/domain/system/terminal-cli/registrar.js +1 -0
- package/dist/domain/system/terminal-cli/shims.d.ts +27 -0
- package/dist/domain/system/terminal-cli/shims.js +108 -0
- package/dist/domain/system/terminal-cli/state.d.ts +7 -0
- package/dist/domain/system/terminal-cli/state.js +36 -0
- package/dist/domain/system/terminal-cli/windows-user-path.d.ts +13 -0
- package/dist/domain/system/terminal-cli/windows-user-path.js +67 -0
- package/dist/domain/telemetry/bus-collector.d.ts +3 -0
- package/dist/domain/telemetry/bus-collector.js +22 -0
- package/dist/domain/telemetry/child-exit.d.ts +11 -0
- package/dist/domain/telemetry/child-exit.js +36 -0
- package/dist/domain/telemetry/client-kind.d.ts +4 -0
- package/dist/domain/telemetry/client-kind.js +7 -0
- package/dist/domain/telemetry/crash-limits.d.ts +15 -0
- package/dist/domain/telemetry/crash-limits.js +50 -0
- package/dist/domain/telemetry/crash.d.ts +25 -0
- package/dist/domain/telemetry/crash.js +70 -0
- package/dist/domain/telemetry/daily-upload.d.ts +5 -0
- package/dist/domain/telemetry/daily-upload.js +20 -0
- package/dist/domain/telemetry/daily.d.ts +5 -0
- package/dist/domain/telemetry/daily.js +104 -0
- package/dist/domain/telemetry/endpoint.d.ts +7 -0
- package/dist/domain/telemetry/endpoint.js +40 -0
- package/dist/domain/telemetry/envelope.d.ts +6 -0
- package/dist/domain/telemetry/envelope.js +35 -0
- package/dist/domain/telemetry/error-digest.d.ts +7 -0
- package/dist/domain/telemetry/error-digest.js +43 -0
- package/dist/domain/telemetry/funnel.d.ts +6 -0
- package/dist/domain/telemetry/funnel.js +22 -0
- package/dist/domain/telemetry/gate.d.ts +19 -0
- package/dist/domain/telemetry/gate.js +67 -0
- package/dist/domain/telemetry/heartbeat.d.ts +17 -0
- package/dist/domain/telemetry/heartbeat.js +49 -0
- package/dist/domain/telemetry/info.d.ts +9 -0
- package/dist/domain/telemetry/info.js +12 -0
- package/dist/domain/telemetry/init-answer.d.ts +12 -0
- package/dist/domain/telemetry/init-answer.js +42 -0
- package/dist/domain/telemetry/install-id.d.ts +5 -0
- package/dist/domain/telemetry/install-id.js +42 -0
- package/dist/domain/telemetry/normalize.d.ts +33 -0
- package/dist/domain/telemetry/normalize.js +88 -0
- package/dist/domain/telemetry/outbox.d.ts +18 -0
- package/dist/domain/telemetry/outbox.js +93 -0
- package/dist/domain/telemetry/panic-group.d.ts +4 -0
- package/dist/domain/telemetry/panic-group.js +51 -0
- package/dist/domain/telemetry/paths.d.ts +7 -0
- package/dist/domain/telemetry/paths.js +11 -0
- package/dist/domain/telemetry/redact.d.ts +18 -0
- package/dist/domain/telemetry/redact.js +109 -0
- package/dist/domain/telemetry/rollup-types.d.ts +81 -0
- package/dist/domain/telemetry/rollup-types.js +31 -0
- package/dist/domain/telemetry/rollup.d.ts +16 -0
- package/dist/domain/telemetry/rollup.js +102 -0
- package/dist/domain/telemetry/schema.d.ts +931 -0
- package/dist/domain/telemetry/schema.js +275 -0
- package/dist/domain/telemetry/service.d.ts +34 -0
- package/dist/domain/telemetry/service.js +146 -0
- package/dist/domain/telemetry/state.d.ts +17 -0
- package/dist/domain/telemetry/state.js +29 -0
- package/dist/domain/telemetry/turns.d.ts +17 -0
- package/dist/domain/telemetry/turns.js +176 -0
- package/dist/domain/telemetry/upgrade.d.ts +14 -0
- package/dist/domain/telemetry/upgrade.js +87 -0
- package/dist/domain/telemetry/uploader.d.ts +21 -0
- package/dist/domain/telemetry/uploader.js +82 -0
- package/dist/domain/telemetry/usage.d.ts +25 -0
- package/dist/domain/telemetry/usage.js +153 -0
- package/dist/domain/telemetry/web-report.d.ts +8 -0
- package/dist/domain/telemetry/web-report.js +15 -0
- package/dist/domain/tui-session/tui-session-service.js +1 -1
- package/dist/domain/tui-session/types.d.ts +2 -2
- package/dist/domain/ui-service/app-router.d.ts +117 -95
- package/dist/domain/ui-service/app-router.js +17 -14
- package/dist/domain/ui-service/assistant-snapshots.js +2 -0
- package/dist/domain/ui-service/contract.parity.d.ts +19 -0
- package/dist/domain/ui-service/contract.parity.js +1 -0
- package/dist/domain/ui-service/inline-media-types.d.ts +18 -0
- package/dist/domain/ui-service/inline-media-types.js +1 -0
- package/dist/domain/ui-service/input-schemas.d.ts +120 -119
- package/dist/domain/ui-service/input-schemas.js +47 -85
- package/dist/domain/ui-service/mutate/approvals.d.ts +3 -2
- package/dist/domain/ui-service/mutate/approvals.js +3 -2
- package/dist/domain/ui-service/mutate/auth.d.ts +1 -1
- package/dist/domain/ui-service/mutate/auth.js +3 -2
- package/dist/domain/ui-service/mutate/config.d.ts +0 -8
- package/dist/domain/ui-service/mutate/config.js +0 -22
- package/dist/domain/ui-service/mutate/models.d.ts +13 -0
- package/dist/domain/ui-service/mutate/models.js +137 -0
- package/dist/domain/ui-service/mutate/plugin-packages.js +1 -1
- package/dist/domain/ui-service/mutate/resolve-media.d.ts +4 -0
- package/dist/domain/ui-service/mutate/resolve-media.js +17 -0
- package/dist/domain/ui-service/mutate/sessions.d.ts +2 -2
- package/dist/domain/ui-service/mutate/sessions.js +29 -126
- package/dist/domain/ui-service/mutate/telemetry.d.ts +5 -0
- package/dist/domain/ui-service/mutate/telemetry.js +6 -0
- package/dist/domain/ui-service/query/approvals.js +4 -3
- package/dist/domain/ui-service/query/config.js +22 -42
- package/dist/domain/ui-service/query/machine-probe.d.ts +1 -1
- package/dist/domain/ui-service/query/machine-probe.js +3 -2
- package/dist/domain/ui-service/query/models.d.ts +3 -0
- package/dist/domain/ui-service/query/models.js +49 -32
- package/dist/domain/ui-service/query/plugin-source.js +4 -3
- package/dist/domain/ui-service/query/schedules.js +1 -1
- package/dist/domain/ui-service/query/sessions.js +8 -13
- package/dist/domain/ui-service/query/telemetry.d.ts +3 -0
- package/dist/domain/ui-service/query/telemetry.js +4 -0
- package/dist/domain/ui-service/trpc.d.ts +8 -3
- package/dist/domain/ui-service/trpc.js +1 -1
- package/dist/domain/ui-service/types.d.ts +71 -179
- package/dist/domain/ui-service/ui-service.d.ts +56 -53
- package/dist/domain/ui-service/ui-service.js +27 -24
- package/dist/entry/app.js +62 -21
- package/dist/entry/browser-cli.d.ts +39 -0
- package/dist/entry/browser-cli.js +317 -0
- package/dist/entry/cli-help.d.ts +1 -0
- package/dist/entry/cli-help.js +64 -20
- package/dist/entry/cli.js +16 -14
- package/dist/entry/daemon.d.ts +1 -1
- package/dist/entry/daemon.js +88 -72
- package/dist/entry/init-auth.js +1 -1
- package/dist/entry/init.d.ts +10 -8
- package/dist/entry/init.js +138 -276
- package/dist/entry/path-cli.d.ts +4 -0
- package/dist/entry/path-cli.js +65 -0
- package/dist/entry/schedule-cli.js +13 -6
- package/dist/entry/shutdown.d.ts +1 -1
- package/dist/entry/shutdown.js +11 -1
- package/dist/entry/signal-cli.js +8 -11
- package/dist/entry/start-ui-http.js +48 -18
- package/dist/entry/telemetry-wiring.d.ts +12 -0
- package/dist/entry/telemetry-wiring.js +56 -0
- package/dist/entry/ui-cli.d.ts +0 -11
- package/dist/entry/ui-cli.js +42 -33
- package/dist/entry/ui-service-wiring.js +8 -10
- package/dist/events/event-types.d.ts +4 -6
- package/dist/orchestration/agent-runner.d.ts +2 -2
- package/dist/orchestration/agent-runner.js +10 -9
- package/dist/orchestration/benchmark-session-webhook.js +13 -1
- package/dist/orchestration/browser-webhook.d.ts +11 -0
- package/dist/orchestration/browser-webhook.js +28 -0
- package/dist/orchestration/cache-keep-warm.d.ts +77 -0
- package/dist/orchestration/cache-keep-warm.js +213 -0
- package/dist/orchestration/claude-window-warmup.d.ts +40 -0
- package/dist/orchestration/claude-window-warmup.js +126 -0
- package/dist/orchestration/conversation-request.d.ts +6 -10
- package/dist/orchestration/conversation-request.js +5 -23
- package/dist/orchestration/delta-coalescer.d.ts +4 -2
- package/dist/orchestration/delta-coalescer.js +5 -5
- package/dist/orchestration/edit-retry.js +9 -11
- package/dist/orchestration/inline-media-eager.d.ts +13 -0
- package/dist/orchestration/inline-media-eager.js +58 -0
- package/dist/orchestration/inline-media.d.ts +22 -0
- package/dist/orchestration/inline-media.js +151 -0
- package/dist/orchestration/interactions/ask-user-resume.js +3 -7
- package/dist/orchestration/interactions/interaction-handlers.js +6 -6
- package/dist/orchestration/mid-turn-inject.d.ts +2 -1
- package/dist/orchestration/mid-turn-inject.js +1 -1
- package/dist/orchestration/pending-injection-recovery.d.ts +2 -1
- package/dist/orchestration/pending-injection-recovery.js +1 -1
- package/dist/orchestration/routing/commands/index.js +4 -4
- package/dist/orchestration/routing/commands/mode.d.ts +5 -44
- package/dist/orchestration/routing/commands/mode.js +98 -272
- package/dist/orchestration/routing/commands/schedule.js +29 -18
- package/dist/orchestration/routing/commands/session.js +9 -9
- package/dist/orchestration/routing/commands/status.js +1 -1
- package/dist/orchestration/routing/commands/usage-format.js +3 -0
- package/dist/orchestration/routing/message-router.js +2 -0
- package/dist/orchestration/routing/webhook.js +6 -0
- package/dist/orchestration/session-compact.d.ts +0 -1
- package/dist/orchestration/session-compact.js +5 -7
- package/dist/orchestration/session-events.d.ts +2 -1
- package/dist/orchestration/session-events.js +1 -0
- package/dist/orchestration/status-helpers.d.ts +0 -4
- package/dist/orchestration/status-helpers.js +0 -18
- package/dist/orchestration/subagent-webhook.js +9 -34
- package/dist/orchestration/team-webhook.d.ts +8 -9
- package/dist/orchestration/team-webhook.js +16 -42
- package/dist/orchestration/transcript-sink.d.ts +12 -0
- package/dist/orchestration/transcript-sink.js +38 -2
- package/dist/orchestration/turn/terminal.js +7 -7
- package/dist/orchestration/turn/turn-prep.d.ts +0 -8
- package/dist/orchestration/turn/turn-prep.js +0 -51
- package/dist/orchestration/turn/turn-tracking.d.ts +2 -2
- package/dist/orchestration/turn/turn-tracking.js +8 -5
- package/dist/orchestration/turn/turn.d.ts +0 -2
- package/dist/orchestration/turn/turn.js +13 -15
- package/dist/orchestration/waitpoint-ingress.js +3 -0
- package/dist/platform/adapters/tui/ports.d.ts +1 -1
- package/dist/platform/adapters/tui/tui-transcript.js +2 -0
- package/dist/platform/browser/agent-browser.d.ts +50 -0
- package/dist/platform/browser/agent-browser.js +165 -0
- package/dist/platform/browser/managed-browser.d.ts +1 -11
- package/dist/platform/browser/managed-browser.js +4 -12
- package/dist/platform/ui-http/browser-stream.d.ts +110 -0
- package/dist/platform/ui-http/browser-stream.js +447 -0
- package/dist/platform/ui-http/ui-auth-routes.d.ts +2 -0
- package/dist/platform/ui-http/ui-auth-routes.js +9 -2
- package/dist/platform/ui-http/ui-device-routes.d.ts +13 -0
- package/dist/platform/ui-http/ui-device-routes.js +81 -0
- package/dist/platform/ui-http/ui-devices.d.ts +24 -0
- package/dist/platform/ui-http/ui-devices.js +107 -0
- package/dist/platform/ui-http/ui-http-server.d.ts +22 -3
- package/dist/platform/ui-http/ui-http-server.js +33 -12
- package/dist/platform/ui-http/ui-pairing.d.ts +25 -0
- package/dist/platform/ui-http/ui-pairing.js +98 -0
- package/dist/store/conversation-history-reader.js +8 -0
- package/dist/store/conversation-history-repo.d.ts +8 -1
- package/dist/store/conversation-history-repo.js +5 -0
- package/dist/store/conversation-ledger-repo.d.ts +6 -6
- package/dist/store/conversation-ledger-repo.js +4 -4
- package/dist/store/gitignore-migration.d.ts +2 -0
- package/dist/store/gitignore-migration.js +16 -0
- package/dist/store/hook-registry.d.ts +1 -1
- package/dist/store/hook-registry.js +11 -6
- package/dist/store/models-repo.d.ts +18 -0
- package/dist/store/models-repo.js +74 -0
- package/dist/store/pending-injection-repo.d.ts +2 -1
- package/dist/store/pending-injection-repo.js +3 -1
- package/dist/store/retire-profiles-migration.d.ts +28 -0
- package/dist/store/retire-profiles-migration.js +335 -0
- package/dist/store/schedule-repo.d.ts +2 -1
- package/dist/store/session-registry-import.js +3 -2
- package/dist/store/session-registry-journal.d.ts +10 -13
- package/dist/store/session-registry-journal.js +51 -25
- package/dist/store/session-registry-repo.d.ts +4 -4
- package/dist/store/session-registry-repo.js +4 -5
- package/dist/store/version-migrations.d.ts +7 -3
- package/dist/store/version-migrations.js +133 -80
- package/dist/tui/components/Dashboard.js +4 -3
- package/dist/tui/hooks/useDashboardData.js +1 -1
- package/dist/tui/slash-commands.js +2 -2
- package/dist/tui/turn-status.js +1 -1
- package/package.json +6 -4
- package/web/dist/assets/board-math-css-spk7yR6n.js +2 -0
- package/web/dist/assets/index-BQ69u-92.css +1 -0
- package/web/dist/assets/{index-CndZZ1IQ.js → index-CKNLatCd.js} +1 -1
- package/web/dist/assets/index-CkzWfC98.js +525 -0
- package/web/dist/index.html +3 -2
- package/web/dist/theme.css +6 -0
- package/dist/agent-adapter/browser-mcp-server.d.ts +0 -13
- package/dist/agent-adapter/browser-mcp-server.js +0 -28
- package/dist/agent-adapter/claude/browser-mcp.d.ts +0 -9
- package/dist/agent-adapter/claude/browser-mcp.js +0 -10
- package/dist/core/profile-generator.d.ts +0 -79
- package/dist/core/profile-generator.js +0 -215
- package/dist/domain/agents/profile-manager.d.ts +0 -103
- package/dist/domain/agents/profile-manager.js +0 -286
- package/dist/domain/agents/profile-switch.d.ts +0 -49
- package/dist/domain/agents/profile-switch.js +0 -62
- package/dist/domain/ui-service/mutate/profiles.d.ts +0 -36
- package/dist/domain/ui-service/mutate/profiles.js +0 -151
- package/dist/store/profile-repo.d.ts +0 -20
- package/dist/store/profile-repo.js +0 -97
- package/web/dist/assets/index-B76ueW3q.js +0 -494
- package/web/dist/assets/index-C8O0yxg8.css +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// >>> Keep en and zh keys in lockstep (zh typed against keyof typeof schedulingEn) <<<
|
|
2
2
|
export const schedulingEn = {
|
|
3
3
|
'schedule.help.title': '*Schedule commands:*',
|
|
4
|
-
'schedule.help.addInterval': '`!schedule add interval <duration> [--
|
|
5
|
-
'schedule.help.addDaily': '`!schedule add daily <HH:MM> [--
|
|
6
|
-
'schedule.help.addWeekly': '`!schedule add weekly <day> <HH:MM> [--
|
|
7
|
-
'schedule.help.addOnce': '`!schedule add once <duration> [--
|
|
4
|
+
'schedule.help.addInterval': '`!schedule add interval <duration> [--model [provider/]model] [--thinking L] <message>` — repeat every duration (e.g. `30m`, `2h`, `1d`)',
|
|
5
|
+
'schedule.help.addDaily': '`!schedule add daily <HH:MM> [--model [provider/]model] [--thinking L] <message>` — run every day at a fixed time (24-hour)',
|
|
6
|
+
'schedule.help.addWeekly': '`!schedule add weekly <day> <HH:MM> [--model [provider/]model] [--thinking L] <message>` — run every week (day: mon,tue,wed,thu,fri,sat,sun)',
|
|
7
|
+
'schedule.help.addOnce': '`!schedule add once <duration> [--model [provider/]model] [--thinking L] <message>` — run once after a delay',
|
|
8
8
|
'schedule.help.list': '`!schedule list` — show all scheduled tasks',
|
|
9
9
|
'schedule.help.pause': '`!schedule pause <id>` — pause a recurring task',
|
|
10
10
|
'schedule.help.resume': '`!schedule resume <id>` — resume a paused recurring task',
|
|
11
11
|
'schedule.help.remove': '`!schedule remove <id>` — remove a task by id',
|
|
12
|
-
'schedule.help.
|
|
12
|
+
'schedule.help.availableModels': 'Favorite models: ${modelNames}',
|
|
13
13
|
'schedule.remove.usage': 'Usage: `!schedule remove <id>`',
|
|
14
14
|
'schedule.remove.ok': 'Removed task `${id}`.',
|
|
15
15
|
'schedule.taskNotFound': 'Task not found: `${id}`',
|
|
@@ -21,10 +21,10 @@ export const schedulingEn = {
|
|
|
21
21
|
'schedule.invalidDuration': 'Invalid duration: `${duration}`. Use e.g. `30s`, `5m`, `2h`, `1d`',
|
|
22
22
|
'schedule.invalidTime': 'Invalid time: `${time}`. Use 24-hour HH:MM, e.g. `${example}`',
|
|
23
23
|
'schedule.invalidDay': 'Invalid day: `${day}`. Use: mon, tue, wed, thu, fri, sat, sun',
|
|
24
|
-
'schedule.add.intervalUsage': 'Usage: `!schedule add interval <duration> [--
|
|
25
|
-
'schedule.add.dailyUsage': 'Usage: `!schedule add daily <HH:MM> [--
|
|
26
|
-
'schedule.add.weeklyUsage': 'Usage: `!schedule add weekly <day> <HH:MM> [--
|
|
27
|
-
'schedule.add.onceUsage': 'Usage: `!schedule add once <duration> [--
|
|
24
|
+
'schedule.add.intervalUsage': 'Usage: `!schedule add interval <duration> [--model [provider/]model] [--thinking L] <message>`',
|
|
25
|
+
'schedule.add.dailyUsage': 'Usage: `!schedule add daily <HH:MM> [--model [provider/]model] [--thinking L] <message>`',
|
|
26
|
+
'schedule.add.weeklyUsage': 'Usage: `!schedule add weekly <day> <HH:MM> [--model [provider/]model] [--thinking L] <message>`',
|
|
27
|
+
'schedule.add.onceUsage': 'Usage: `!schedule add once <duration> [--model [provider/]model] [--thinking L] <message>`',
|
|
28
28
|
'schedule.add.scheduledInterval': 'Scheduled every *${duration}*: "${message}"',
|
|
29
29
|
'schedule.add.scheduledDaily': 'Scheduled daily at *${time}*: "${message}"',
|
|
30
30
|
'schedule.add.scheduledWeekly': 'Scheduled weekly *${day} ${time}*: "${message}"',
|
|
@@ -33,15 +33,15 @@ export const schedulingEn = {
|
|
|
33
33
|
};
|
|
34
34
|
export const schedulingZh = {
|
|
35
35
|
'schedule.help.title': '*定时任务命令:*',
|
|
36
|
-
'schedule.help.addInterval': '`!schedule add interval <duration> [--
|
|
37
|
-
'schedule.help.addDaily': '`!schedule add daily <HH:MM> [--
|
|
38
|
-
'schedule.help.addWeekly': '`!schedule add weekly <day> <HH:MM> [--
|
|
39
|
-
'schedule.help.addOnce': '`!schedule add once <duration> [--
|
|
36
|
+
'schedule.help.addInterval': '`!schedule add interval <duration> [--model [provider/]model] [--thinking L] <message>` — 每隔指定时长重复(例如 `30m`、`2h`、`1d`)',
|
|
37
|
+
'schedule.help.addDaily': '`!schedule add daily <HH:MM> [--model [provider/]model] [--thinking L] <message>` — 每天在固定时间运行(24 小时制)',
|
|
38
|
+
'schedule.help.addWeekly': '`!schedule add weekly <day> <HH:MM> [--model [provider/]model] [--thinking L] <message>` — 每周运行(day:mon,tue,wed,thu,fri,sat,sun)',
|
|
39
|
+
'schedule.help.addOnce': '`!schedule add once <duration> [--model [provider/]model] [--thinking L] <message>` — 延迟一段时间后运行一次',
|
|
40
40
|
'schedule.help.list': '`!schedule list` — 显示所有定时任务',
|
|
41
41
|
'schedule.help.pause': '`!schedule pause <id>` — 暂停一个周期任务',
|
|
42
42
|
'schedule.help.resume': '`!schedule resume <id>` — 恢复一个已暂停的周期任务',
|
|
43
43
|
'schedule.help.remove': '`!schedule remove <id>` — 按 id 删除任务',
|
|
44
|
-
'schedule.help.
|
|
44
|
+
'schedule.help.availableModels': '收藏模型:${modelNames}',
|
|
45
45
|
'schedule.remove.usage': '用法:`!schedule remove <id>`',
|
|
46
46
|
'schedule.remove.ok': '已删除任务 `${id}`。',
|
|
47
47
|
'schedule.taskNotFound': '未找到任务:`${id}`',
|
|
@@ -53,10 +53,10 @@ export const schedulingZh = {
|
|
|
53
53
|
'schedule.invalidDuration': '无效的时长:`${duration}`。请使用例如 `30s`、`5m`、`2h`、`1d`',
|
|
54
54
|
'schedule.invalidTime': '无效的时间:`${time}`。请使用 24 小时制 HH:MM,例如 `${example}`',
|
|
55
55
|
'schedule.invalidDay': '无效的星期:`${day}`。请使用:mon, tue, wed, thu, fri, sat, sun',
|
|
56
|
-
'schedule.add.intervalUsage': '用法:`!schedule add interval <duration> [--
|
|
57
|
-
'schedule.add.dailyUsage': '用法:`!schedule add daily <HH:MM> [--
|
|
58
|
-
'schedule.add.weeklyUsage': '用法:`!schedule add weekly <day> <HH:MM> [--
|
|
59
|
-
'schedule.add.onceUsage': '用法:`!schedule add once <duration> [--
|
|
56
|
+
'schedule.add.intervalUsage': '用法:`!schedule add interval <duration> [--model [provider/]model] [--thinking L] <message>`',
|
|
57
|
+
'schedule.add.dailyUsage': '用法:`!schedule add daily <HH:MM> [--model [provider/]model] [--thinking L] <message>`',
|
|
58
|
+
'schedule.add.weeklyUsage': '用法:`!schedule add weekly <day> <HH:MM> [--model [provider/]model] [--thinking L] <message>`',
|
|
59
|
+
'schedule.add.onceUsage': '用法:`!schedule add once <duration> [--model [provider/]model] [--thinking L] <message>`',
|
|
60
60
|
'schedule.add.scheduledInterval': '已设定每 *${duration}* 运行一次:"${message}"',
|
|
61
61
|
'schedule.add.scheduledDaily': '已设定每天 *${time}* 运行:"${message}"',
|
|
62
62
|
'schedule.add.scheduledWeekly': '已设定每周 *${day} ${time}* 运行:"${message}"',
|
|
@@ -13,14 +13,10 @@ export declare const statusEn: {
|
|
|
13
13
|
readonly 'status.rateLimitedExhausted': 'Rate limited';
|
|
14
14
|
readonly 'status.supersededSeeNewReply': 'see new reply';
|
|
15
15
|
readonly 'status.errorBody': 'Error: ${message}';
|
|
16
|
-
readonly 'status.notRetriedAfterTools': '${message} — the turn had already run tools, so it was not retried on the fallback model (that would run them again). Send the message again to continue.';
|
|
17
|
-
readonly 'status.rateLimitedMidTurn': 'Rate limited mid-turn (${message}). The turn had already run tools, so it was not retried on the fallback model (that would run them again). Send the message again to continue.';
|
|
18
16
|
readonly 'notify.turnComplete': 'Turn complete';
|
|
19
17
|
readonly 'notify.turnFailed': 'Turn failed';
|
|
20
18
|
readonly 'notify.contextCompacted': 'Context auto-compacted.';
|
|
21
19
|
readonly 'notify.agentFallback': 'Model fallback: ${from} → ${to}.';
|
|
22
|
-
readonly 'notify.attemptFallback.rateLimited': '${from} is rate limited; falling back to ${to}.';
|
|
23
|
-
readonly 'notify.attemptFallback.transportError': 'Could not reach ${from}; falling back to ${to}.';
|
|
24
20
|
readonly 'notify.backendSessionReset': 'Previous backend session was unavailable; started a fresh session.';
|
|
25
21
|
readonly 'notify.pluginsUnavailable': 'Some plugin skills or MCP servers could not be loaded and are missing from this turn:\n${detail}';
|
|
26
22
|
readonly 'notify.pluginsUnavailableMore': '…and ${n} more.';
|
|
@@ -15,16 +15,12 @@ export const statusEn = {
|
|
|
15
15
|
'status.rateLimitedExhausted': 'Rate limited',
|
|
16
16
|
'status.supersededSeeNewReply': 'see new reply',
|
|
17
17
|
'status.errorBody': 'Error: ${message}',
|
|
18
|
-
'status.notRetriedAfterTools': '${message} — the turn had already run tools, so it was not retried on the fallback model (that would run them again). Send the message again to continue.',
|
|
19
|
-
'status.rateLimitedMidTurn': 'Rate limited mid-turn (${message}). The turn had already run tools, so it was not retried on the fallback model (that would run them again). Send the message again to continue.',
|
|
20
18
|
// --- Turn-completion notification ---
|
|
21
19
|
'notify.turnComplete': 'Turn complete',
|
|
22
20
|
'notify.turnFailed': 'Turn failed',
|
|
23
21
|
// --- Semantic chat notices ---
|
|
24
22
|
'notify.contextCompacted': 'Context auto-compacted.',
|
|
25
23
|
'notify.agentFallback': 'Model fallback: ${from} → ${to}.',
|
|
26
|
-
'notify.attemptFallback.rateLimited': '${from} is rate limited; falling back to ${to}.',
|
|
27
|
-
'notify.attemptFallback.transportError': 'Could not reach ${from}; falling back to ${to}.',
|
|
28
24
|
'notify.backendSessionReset': 'Previous backend session was unavailable; started a fresh session.',
|
|
29
25
|
'notify.pluginsUnavailable': 'Some plugin skills or MCP servers could not be loaded and are missing from this turn:\n${detail}',
|
|
30
26
|
'notify.pluginsUnavailableMore': '…and ${n} more.',
|
|
@@ -73,16 +69,12 @@ export const statusZh = {
|
|
|
73
69
|
'status.rateLimitedExhausted': '触发限流',
|
|
74
70
|
'status.supersededSeeNewReply': '查看新回复',
|
|
75
71
|
'status.errorBody': '错误:${message}',
|
|
76
|
-
'status.notRetriedAfterTools': '${message}——本回合已执行过工具,切换备用模型重试会重复执行它们,因此没有重试。请重新发送消息继续。',
|
|
77
|
-
'status.rateLimitedMidTurn': '回合进行中触发限流(${message})。本回合已执行过工具,切换备用模型重试会重复执行它们,因此没有重试。请重新发送消息继续。',
|
|
78
72
|
// --- Turn-completion notification ---
|
|
79
73
|
'notify.turnComplete': '回合完成',
|
|
80
74
|
'notify.turnFailed': '回合失败',
|
|
81
75
|
// --- Semantic chat notices ---
|
|
82
76
|
'notify.contextCompacted': '上下文已自动压缩。',
|
|
83
77
|
'notify.agentFallback': '模型回退:${from} → ${to}。',
|
|
84
|
-
'notify.attemptFallback.rateLimited': '${from} 触发限流,回退到 ${to}。',
|
|
85
|
-
'notify.attemptFallback.transportError': '无法连接 ${from},回退到 ${to}。',
|
|
86
78
|
'notify.backendSessionReset': '之前的后端会话不可用,已启动新会话。',
|
|
87
79
|
'notify.pluginsUnavailable': '部分插件技能或 MCP server 未能加载,本轮不可用:\n${detail}',
|
|
88
80
|
'notify.pluginsUnavailableMore': '……另有 ${n} 项。',
|
|
@@ -14,7 +14,6 @@ export declare const tuiEn: {
|
|
|
14
14
|
readonly 'tui.slash.mode': 'Show the current runtime mode';
|
|
15
15
|
readonly 'tui.slash.model': 'Show or switch the model — /model [name]';
|
|
16
16
|
readonly 'tui.slash.backend': 'Show or switch the agent backend — /backend [name]';
|
|
17
|
-
readonly 'tui.slash.profile': 'Show or switch the agent profile — /profile [name]';
|
|
18
17
|
readonly 'tui.slash.skills': 'List available skills';
|
|
19
18
|
readonly 'tui.slash.devices': 'List connected client devices';
|
|
20
19
|
readonly 'tui.slash.nvtop': 'GPU usage snapshot (nvtop) — /nvtop [device]';
|
|
@@ -17,7 +17,6 @@ export const tuiEn = {
|
|
|
17
17
|
'tui.slash.mode': 'Show the current runtime mode',
|
|
18
18
|
'tui.slash.model': 'Show or switch the model — /model [name]',
|
|
19
19
|
'tui.slash.backend': 'Show or switch the agent backend — /backend [name]',
|
|
20
|
-
'tui.slash.profile': 'Show or switch the agent profile — /profile [name]',
|
|
21
20
|
'tui.slash.skills': 'List available skills',
|
|
22
21
|
'tui.slash.devices': 'List connected client devices',
|
|
23
22
|
'tui.slash.nvtop': 'GPU usage snapshot (nvtop) — /nvtop [device]',
|
|
@@ -115,7 +114,6 @@ export const tuiZh = {
|
|
|
115
114
|
'tui.slash.mode': '查看当前运行模式',
|
|
116
115
|
'tui.slash.model': '查看或切换模型——/model [名称]',
|
|
117
116
|
'tui.slash.backend': '查看或切换 agent 后端——/backend [名称]',
|
|
118
|
-
'tui.slash.profile': '查看或切换 agent profile——/profile [名称]',
|
|
119
117
|
'tui.slash.skills': '列出可用的 skill',
|
|
120
118
|
'tui.slash.devices': '列出已连接的客户端设备',
|
|
121
119
|
'tui.slash.nvtop': 'GPU 使用快照(nvtop)——/nvtop [设备]',
|
|
@@ -3,7 +3,7 @@ export declare const uimsgEn: {
|
|
|
3
3
|
readonly 'ui.session.textOrAttachments': 'Either text or attachments required';
|
|
4
4
|
readonly 'ui.session.runningCompact': 'Session is running — stop it before compacting context';
|
|
5
5
|
readonly 'ui.session.compactUnsupported': 'This session backend does not support manual context compaction';
|
|
6
|
-
readonly 'ui.session.
|
|
6
|
+
readonly 'ui.session.invalidSelection': 'Invalid engine selection: ${name}';
|
|
7
7
|
readonly 'ui.session.unknownAgent': 'Unknown environment: ${name}';
|
|
8
8
|
readonly 'ui.session.backendLockedNamed': 'Can\'t switch to "${name}" (${target}) — this conversation runs on ${current}. Start a new session to change backend.';
|
|
9
9
|
readonly 'ui.session.backendLocked': 'Can\'t switch to ${target} — this conversation runs on ${current}. Start a new session to change backend.';
|
|
@@ -51,12 +51,9 @@ export declare const uimsgEn: {
|
|
|
51
51
|
readonly 'ui.platform.saveFailed': 'Could not save platform configuration';
|
|
52
52
|
readonly 'ui.platform.readFailed': 'Could not read platform configuration';
|
|
53
53
|
readonly 'ui.platform.requestFailed': 'Platform configuration request failed';
|
|
54
|
-
readonly 'ui.
|
|
55
|
-
readonly 'ui.
|
|
56
|
-
readonly 'ui.
|
|
57
|
-
readonly 'ui.profile.notFound': 'profile "${name}" not found in profiles.json';
|
|
58
|
-
readonly 'ui.profile.isDefault': 'profile "${name}" is the default profile — point the default at another profile first';
|
|
59
|
-
readonly 'ui.profile.lastOne': 'cannot remove the last profile in profiles.json';
|
|
54
|
+
readonly 'ui.models.fileUnreadable': 'models.json is missing or unreadable';
|
|
55
|
+
readonly 'ui.models.noDefault': 'models.json has no default selection';
|
|
56
|
+
readonly 'ui.models.notFound': 'Model "${name}" is not in favorites';
|
|
60
57
|
readonly 'ui.plugin.unassignable': 'Unassignable plugin ids: ${ids}';
|
|
61
58
|
readonly 'ui.plugin.builtin': '\'${id}\' is built into Cortex and cannot be removed; switch it off per environment instead';
|
|
62
59
|
readonly 'ui.plugin.skillBuiltin': '\'${id}\' is a built-in skill: it can be edited or reverted, but not moved or deleted';
|
|
@@ -6,7 +6,7 @@ export const uimsgEn = {
|
|
|
6
6
|
'ui.session.textOrAttachments': 'Either text or attachments required',
|
|
7
7
|
'ui.session.runningCompact': 'Session is running — stop it before compacting context',
|
|
8
8
|
'ui.session.compactUnsupported': 'This session backend does not support manual context compaction',
|
|
9
|
-
'ui.session.
|
|
9
|
+
'ui.session.invalidSelection': 'Invalid engine selection: ${name}',
|
|
10
10
|
'ui.session.unknownAgent': 'Unknown environment: ${name}',
|
|
11
11
|
'ui.session.backendLockedNamed': 'Can\'t switch to "${name}" (${target}) — this conversation runs on ${current}. Start a new session to change backend.',
|
|
12
12
|
'ui.session.backendLocked': 'Can\'t switch to ${target} — this conversation runs on ${current}. Start a new session to change backend.',
|
|
@@ -60,13 +60,10 @@ export const uimsgEn = {
|
|
|
60
60
|
'ui.platform.saveFailed': 'Could not save platform configuration',
|
|
61
61
|
'ui.platform.readFailed': 'Could not read platform configuration',
|
|
62
62
|
'ui.platform.requestFailed': 'Platform configuration request failed',
|
|
63
|
-
//
|
|
64
|
-
'ui.
|
|
65
|
-
'ui.
|
|
66
|
-
'ui.
|
|
67
|
-
'ui.profile.notFound': 'profile "${name}" not found in profiles.json',
|
|
68
|
-
'ui.profile.isDefault': 'profile "${name}" is the default profile — point the default at another profile first',
|
|
69
|
-
'ui.profile.lastOne': 'cannot remove the last profile in profiles.json',
|
|
63
|
+
// models
|
|
64
|
+
'ui.models.fileUnreadable': 'models.json is missing or unreadable',
|
|
65
|
+
'ui.models.noDefault': 'models.json has no default selection',
|
|
66
|
+
'ui.models.notFound': 'Model "${name}" is not in favorites',
|
|
70
67
|
// plugins
|
|
71
68
|
'ui.plugin.unassignable': 'Unassignable plugin ids: ${ids}',
|
|
72
69
|
'ui.plugin.builtin': '\'${id}\' is built into Cortex and cannot be removed; switch it off per environment instead',
|
|
@@ -91,7 +88,7 @@ export const uimsgZh = {
|
|
|
91
88
|
'ui.session.textOrAttachments': '请输入文字或添加附件。',
|
|
92
89
|
'ui.session.runningCompact': '会话正在运行——请先停止,再压缩上下文。',
|
|
93
90
|
'ui.session.compactUnsupported': '该会话的后端不支持手动压缩上下文。',
|
|
94
|
-
'ui.session.
|
|
91
|
+
'ui.session.invalidSelection': '无效的引擎选择:${name}',
|
|
95
92
|
'ui.session.unknownAgent': '未知执行环境:${name}',
|
|
96
93
|
'ui.session.backendLockedNamed': '无法切换到「${name}」(${target})——当前会话运行在 ${current} 上。如需更换后端,请新建会话。',
|
|
97
94
|
'ui.session.backendLocked': '无法切换到 ${target}——当前会话运行在 ${current} 上。如需更换后端,请新建会话。',
|
|
@@ -139,12 +136,9 @@ export const uimsgZh = {
|
|
|
139
136
|
'ui.platform.saveFailed': '无法保存平台配置。',
|
|
140
137
|
'ui.platform.readFailed': '无法读取平台配置。',
|
|
141
138
|
'ui.platform.requestFailed': '平台配置请求失败。',
|
|
142
|
-
'ui.
|
|
143
|
-
'ui.
|
|
144
|
-
'ui.
|
|
145
|
-
'ui.profile.notFound': 'profiles.json 中找不到 Profile「${name}」。',
|
|
146
|
-
'ui.profile.isDefault': 'Profile「${name}」是默认 Profile——请先把默认 Profile 改为其他 Profile。',
|
|
147
|
-
'ui.profile.lastOne': '不能删除 profiles.json 中的最后一个 Profile。',
|
|
139
|
+
'ui.models.fileUnreadable': 'models.json 不存在或无法读取。',
|
|
140
|
+
'ui.models.noDefault': 'models.json 中没有默认引擎选择。',
|
|
141
|
+
'ui.models.notFound': '收藏中找不到模型「${name}」。',
|
|
148
142
|
'ui.plugin.unassignable': '以下插件无法分配:${ids}',
|
|
149
143
|
'ui.plugin.builtin': '「${id}」是 Cortex 内置插件,不能删除;可以在各环境中关闭它。',
|
|
150
144
|
'ui.plugin.skillBuiltin': '「${id}」是内置技能:可以编辑或还原,但不能移动或删除。',
|
package/dist/core/log.d.ts
CHANGED
|
@@ -10,4 +10,7 @@ export interface Logger {
|
|
|
10
10
|
error(...args: unknown[]): void;
|
|
11
11
|
debug(...args: unknown[]): void;
|
|
12
12
|
}
|
|
13
|
+
/** Observer of every `log.error` call (the telemetry error digest). Set once by the app. */
|
|
14
|
+
export type ErrorLogSink = (module: string, args: unknown[]) => void;
|
|
15
|
+
export declare function setErrorLogSink(sink: ErrorLogSink | null): void;
|
|
13
16
|
export declare function createLogger(mod: string): Logger;
|
package/dist/core/log.js
CHANGED
|
@@ -114,6 +114,23 @@ function formatArg(a) {
|
|
|
114
114
|
}
|
|
115
115
|
return String(a);
|
|
116
116
|
}
|
|
117
|
+
let errorSink = null;
|
|
118
|
+
let inErrorSink = false;
|
|
119
|
+
export function setErrorLogSink(sink) {
|
|
120
|
+
errorSink = sink;
|
|
121
|
+
}
|
|
122
|
+
function notifyErrorSink(mod, args) {
|
|
123
|
+
if (!errorSink || inErrorSink)
|
|
124
|
+
return;
|
|
125
|
+
inErrorSink = true;
|
|
126
|
+
try {
|
|
127
|
+
errorSink(mod, args);
|
|
128
|
+
}
|
|
129
|
+
catch { /* an observer never breaks logging */ }
|
|
130
|
+
finally {
|
|
131
|
+
inErrorSink = false;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
117
134
|
// ── Core write ──────────────────────────────────────────
|
|
118
135
|
function writeConsole(level, prefix, args) {
|
|
119
136
|
if (processLogPolicy.consoleToStderr)
|
|
@@ -148,7 +165,7 @@ export function createLogger(mod) {
|
|
|
148
165
|
return {
|
|
149
166
|
info: (...args) => write('INFO', mod, args),
|
|
150
167
|
warn: (...args) => write('WARN', mod, args),
|
|
151
|
-
error: (...args) => write('ERROR', mod, args),
|
|
168
|
+
error: (...args) => { write('ERROR', mod, args); notifyErrorSink(mod, args); },
|
|
152
169
|
debug: (...args) => { if (isDebugMode())
|
|
153
170
|
write('DEBUG', mod, args); },
|
|
154
171
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { DiscoveredEndpoint } from './gateway-generator.js';
|
|
2
|
+
import type { EngineSelection, ModelsFile } from '../domain/agents/engine-selection.js';
|
|
3
|
+
export interface ModelChoice {
|
|
4
|
+
mode: string;
|
|
5
|
+
model: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GenerateOpts {
|
|
8
|
+
defaultChoice?: ModelChoice;
|
|
9
|
+
favorites?: ModelChoice[];
|
|
10
|
+
}
|
|
11
|
+
export interface WriteModelsOpts extends GenerateOpts {
|
|
12
|
+
outputDir?: string;
|
|
13
|
+
overwrite?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface ModelEntry extends ModelChoice {
|
|
16
|
+
backend: EngineSelection['backend'];
|
|
17
|
+
endpoint: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function resolveBackend(endpoint: string, mode: string): EngineSelection['backend'];
|
|
20
|
+
export declare function flattenModels(endpoints: DiscoveredEndpoint[]): ModelEntry[];
|
|
21
|
+
export declare function listChoices(endpoints: DiscoveredEndpoint[]): ModelChoice[];
|
|
22
|
+
/** Discovery order expresses preference; display sorting must not change the recommendation. */
|
|
23
|
+
export declare function recommendedChoice(endpoints: DiscoveredEndpoint[]): ModelChoice | undefined;
|
|
24
|
+
export declare function generateModels(endpoints: DiscoveredEndpoint[], opts?: GenerateOpts): ModelsFile;
|
|
25
|
+
export declare function readExistingModels(configDir: string): Partial<ModelsFile> | null;
|
|
26
|
+
/** Preserve the operator's default unless explicitly overwritten; favorites are always a union. */
|
|
27
|
+
export declare function mergeModelsJson(generated: ModelsFile, outputDir?: string, overwrite?: boolean): ModelsFile;
|
|
28
|
+
export declare function writeModelsJson(endpoints: DiscoveredEndpoint[], opts?: WriteModelsOpts): string;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { atomicWriteSync } from './atomic-write.js';
|
|
4
|
+
import { CONFIG_DIR } from './paths.js';
|
|
5
|
+
import { createLogger } from './log.js';
|
|
6
|
+
const log = createLogger('models-generator');
|
|
7
|
+
export function resolveBackend(endpoint, mode) {
|
|
8
|
+
return endpoint === 'anthropic' && (mode === 'plan' || mode === 'api') ? 'claude' : 'pi';
|
|
9
|
+
}
|
|
10
|
+
export function flattenModels(endpoints) {
|
|
11
|
+
return endpoints.flatMap(ep => ep.models.map(model => ({
|
|
12
|
+
model, backend: resolveBackend(ep.endpoint, ep.mode), mode: ep.mode, endpoint: ep.endpoint,
|
|
13
|
+
})));
|
|
14
|
+
}
|
|
15
|
+
export function listChoices(endpoints) {
|
|
16
|
+
return flattenModels(endpoints)
|
|
17
|
+
.sort((a, b) => a.mode.localeCompare(b.mode) || a.model.localeCompare(b.model))
|
|
18
|
+
.map(({ mode, model }) => ({ mode, model }));
|
|
19
|
+
}
|
|
20
|
+
/** Discovery order expresses preference; display sorting must not change the recommendation. */
|
|
21
|
+
export function recommendedChoice(endpoints) {
|
|
22
|
+
const endpoint = endpoints.find(ep => ep.models.length > 0);
|
|
23
|
+
if (!endpoint)
|
|
24
|
+
return undefined;
|
|
25
|
+
const model = endpoint.defaultModel && endpoint.models.includes(endpoint.defaultModel)
|
|
26
|
+
? endpoint.defaultModel : endpoint.models[0];
|
|
27
|
+
return { mode: endpoint.mode, model };
|
|
28
|
+
}
|
|
29
|
+
function selectionForChoice(models, choice) {
|
|
30
|
+
const entry = models.find(m => m.mode === choice.mode && m.model === choice.model);
|
|
31
|
+
if (!entry)
|
|
32
|
+
throw new Error(`(mode="${choice.mode}", model="${choice.model}") not found among discovered models`);
|
|
33
|
+
return {
|
|
34
|
+
backend: entry.backend, provider: entry.backend === 'pi' ? entry.endpoint : null,
|
|
35
|
+
model: entry.model, thinking: null, mode: entry.backend === 'pi' ? entry.endpoint : entry.mode,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** Keep only model identity in favorites, deduplicating independently of route and thinking. */
|
|
39
|
+
function unionFavorites(refs) {
|
|
40
|
+
const entries = refs.map(({ backend, provider, model }) => {
|
|
41
|
+
const ref = { backend, provider, model };
|
|
42
|
+
return [JSON.stringify([backend, provider, model]), ref];
|
|
43
|
+
});
|
|
44
|
+
return [...new Map(entries).values()];
|
|
45
|
+
}
|
|
46
|
+
export function generateModels(endpoints, opts = {}) {
|
|
47
|
+
const choice = opts.defaultChoice ?? recommendedChoice(endpoints);
|
|
48
|
+
if (!choice)
|
|
49
|
+
throw new Error('No discovered model is available for the default selection');
|
|
50
|
+
const models = flattenModels(endpoints);
|
|
51
|
+
const selection = selectionForChoice(models, choice);
|
|
52
|
+
const favorites = (opts.favorites ?? []).map(item => selectionForChoice(models, item));
|
|
53
|
+
return { default: selection, favorites: unionFavorites([selection, ...favorites]) };
|
|
54
|
+
}
|
|
55
|
+
export function readExistingModels(configDir) {
|
|
56
|
+
const file = path.join(configDir, 'models.json');
|
|
57
|
+
if (!existsSync(file))
|
|
58
|
+
return null;
|
|
59
|
+
try {
|
|
60
|
+
return JSON.parse(readFileSync(file, 'utf8'));
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
log.warn(`Failed to read models.json: ${error.message}`);
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** Preserve the operator's default unless explicitly overwritten; favorites are always a union. */
|
|
68
|
+
export function mergeModelsJson(generated, outputDir = CONFIG_DIR, overwrite = false) {
|
|
69
|
+
const existing = readExistingModels(outputDir);
|
|
70
|
+
return {
|
|
71
|
+
default: !overwrite && existing?.default ? existing.default : generated.default,
|
|
72
|
+
favorites: unionFavorites([...(existing?.favorites ?? []), ...generated.favorites]),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function writeModelsJson(endpoints, opts = {}) {
|
|
76
|
+
const configDir = opts.outputDir ?? CONFIG_DIR;
|
|
77
|
+
const merged = mergeModelsJson(generateModels(endpoints, opts), configDir, opts.overwrite);
|
|
78
|
+
const outputPath = path.join(configDir, 'models.json');
|
|
79
|
+
atomicWriteSync(outputPath, JSON.stringify(merged, null, 2) + '\n');
|
|
80
|
+
log.info(`Written models.json to ${outputPath}`);
|
|
81
|
+
return outputPath;
|
|
82
|
+
}
|
package/dist/core/paths.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare function resolveSpawnCwd(cwd?: string): string;
|
|
|
21
21
|
/** aistatus's own home (gateway.yaml, config.yaml, usage/). Always under the user's home, not
|
|
22
22
|
* DATA_DIR: aistatus reads it from there regardless of CORTEX_HOME. */
|
|
23
23
|
export declare const AISTATUS_DIR: string;
|
|
24
|
-
/** Configuration files — .env, budget,
|
|
24
|
+
/** Configuration files — .env, budget, models, environments, etc. (DATA_DIR/config/). */
|
|
25
25
|
export declare const CONFIG_DIR: string;
|
|
26
26
|
/** Persistent store for runtime JSON state files (DATA_DIR/data/). */
|
|
27
27
|
export declare const STORE_DIR: string;
|
package/dist/core/paths.js
CHANGED
|
@@ -51,7 +51,7 @@ export function resolveSpawnCwd(cwd) {
|
|
|
51
51
|
/** aistatus's own home (gateway.yaml, config.yaml, usage/). Always under the user's home, not
|
|
52
52
|
* DATA_DIR: aistatus reads it from there regardless of CORTEX_HOME. */
|
|
53
53
|
export const AISTATUS_DIR = path.join(os.homedir(), '.aistatus');
|
|
54
|
-
/** Configuration files — .env, budget,
|
|
54
|
+
/** Configuration files — .env, budget, models, environments, etc. (DATA_DIR/config/). */
|
|
55
55
|
export const CONFIG_DIR = path.join(DATA_DIR, 'config');
|
|
56
56
|
/** Persistent store for runtime JSON state files (DATA_DIR/data/). */
|
|
57
57
|
export const STORE_DIR = path.join(DATA_DIR, 'data');
|
|
@@ -17,6 +17,7 @@ export interface Settings {
|
|
|
17
17
|
showToolCalls: boolean;
|
|
18
18
|
statusNewqButton: boolean;
|
|
19
19
|
autoResume: boolean;
|
|
20
|
+
showThinking: boolean;
|
|
20
21
|
streamDeltas: boolean;
|
|
21
22
|
bgContinuation: boolean;
|
|
22
23
|
eventLog: boolean;
|
|
@@ -26,6 +27,7 @@ export interface Settings {
|
|
|
26
27
|
serverAutoUpdate: boolean;
|
|
27
28
|
clientHotReloadEnabled: boolean;
|
|
28
29
|
teamEnabled: boolean;
|
|
30
|
+
telemetryEnabled: boolean;
|
|
29
31
|
feishuSkillsInWeb: boolean;
|
|
30
32
|
waitpointSweepMs: number;
|
|
31
33
|
waitpointTtlMs: number;
|
|
@@ -35,6 +37,7 @@ export interface Settings {
|
|
|
35
37
|
subscriptionBillingModes: string[];
|
|
36
38
|
providerUsageCollectionEnabled: boolean;
|
|
37
39
|
providerUsageCollectionIntervalMs: number;
|
|
40
|
+
claudeWindowWarmupEnabled: boolean;
|
|
38
41
|
providerRateLimits: ProviderRateLimits;
|
|
39
42
|
storeArchiveEnabled: boolean;
|
|
40
43
|
memoryIndexRegenEnabled: boolean;
|
|
@@ -42,6 +45,8 @@ export interface Settings {
|
|
|
42
45
|
sessionRetentionDays: number;
|
|
43
46
|
piCompactReserveTokens: number;
|
|
44
47
|
maxContextTokens: number | null;
|
|
48
|
+
cacheKeepWarmHours: number;
|
|
49
|
+
coldResumeClearToolResults: boolean;
|
|
45
50
|
uiCorsOrigins: string[];
|
|
46
51
|
adminChannel: string | null;
|
|
47
52
|
feishuAdminChannel: string | null;
|
|
@@ -83,6 +88,8 @@ export declare const MIN_MAX_CONTEXT_TOKENS = 100000;
|
|
|
83
88
|
export declare const MAX_MAX_CONTEXT_TOKENS = 1000000;
|
|
84
89
|
declare function validateMaxContextTokens(value: number | null): string | null;
|
|
85
90
|
declare function validateSessionRetentionDays(value: number): string | null;
|
|
91
|
+
export declare const MAX_CACHE_KEEP_WARM_HOURS = 24;
|
|
92
|
+
declare function validateCacheKeepWarmHours(value: number): string | null;
|
|
86
93
|
export declare const SETTINGS_SPEC: {
|
|
87
94
|
turnNotify: {
|
|
88
95
|
envVar: string;
|
|
@@ -120,6 +127,12 @@ export declare const SETTINGS_SPEC: {
|
|
|
120
127
|
default: true;
|
|
121
128
|
legacyParse: (raw: string) => boolean;
|
|
122
129
|
};
|
|
130
|
+
showThinking: {
|
|
131
|
+
envVar: string;
|
|
132
|
+
type: "boolean";
|
|
133
|
+
default: true;
|
|
134
|
+
legacyParse: (raw: string) => boolean;
|
|
135
|
+
};
|
|
123
136
|
streamDeltas: {
|
|
124
137
|
envVar: string;
|
|
125
138
|
type: "boolean";
|
|
@@ -174,6 +187,10 @@ export declare const SETTINGS_SPEC: {
|
|
|
174
187
|
default: true;
|
|
175
188
|
legacyParse: (raw: string) => raw is "1";
|
|
176
189
|
};
|
|
190
|
+
telemetryEnabled: {
|
|
191
|
+
type: "boolean";
|
|
192
|
+
default: true;
|
|
193
|
+
};
|
|
177
194
|
waitpointSweepMs: {
|
|
178
195
|
envVar: string;
|
|
179
196
|
type: "number";
|
|
@@ -215,6 +232,10 @@ export declare const SETTINGS_SPEC: {
|
|
|
215
232
|
default: number;
|
|
216
233
|
validate: typeof validateJobInterval;
|
|
217
234
|
};
|
|
235
|
+
claudeWindowWarmupEnabled: {
|
|
236
|
+
type: "boolean";
|
|
237
|
+
default: false;
|
|
238
|
+
};
|
|
218
239
|
providerRateLimits: {
|
|
219
240
|
type: "provider-rate-limits";
|
|
220
241
|
default: {};
|
|
@@ -249,6 +270,15 @@ export declare const SETTINGS_SPEC: {
|
|
|
249
270
|
default: any;
|
|
250
271
|
validate: typeof validateMaxContextTokens;
|
|
251
272
|
};
|
|
273
|
+
cacheKeepWarmHours: {
|
|
274
|
+
type: "number";
|
|
275
|
+
default: number;
|
|
276
|
+
validate: typeof validateCacheKeepWarmHours;
|
|
277
|
+
};
|
|
278
|
+
coldResumeClearToolResults: {
|
|
279
|
+
type: "boolean";
|
|
280
|
+
default: true;
|
|
281
|
+
};
|
|
252
282
|
uiCorsOrigins: {
|
|
253
283
|
envVar: string;
|
|
254
284
|
type: "string[]";
|
|
@@ -55,6 +55,15 @@ function validateSessionRetentionDays(value) {
|
|
|
55
55
|
}
|
|
56
56
|
return null;
|
|
57
57
|
}
|
|
58
|
+
export const MAX_CACHE_KEEP_WARM_HOURS = 24;
|
|
59
|
+
function validateCacheKeepWarmHours(value) {
|
|
60
|
+
if (!Number.isFinite(value))
|
|
61
|
+
return 'must be a number of hours';
|
|
62
|
+
if (value < 0 || value > MAX_CACHE_KEEP_WARM_HOURS) {
|
|
63
|
+
return `must be between 0 and ${MAX_CACHE_KEEP_WARM_HOURS} hours`;
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
58
67
|
export const SETTINGS_SPEC = {
|
|
59
68
|
turnNotify: {
|
|
60
69
|
envVar: 'CORTEX_TURN_NOTIFY',
|
|
@@ -98,6 +107,12 @@ export const SETTINGS_SPEC = {
|
|
|
98
107
|
default: true,
|
|
99
108
|
legacyParse: (raw) => raw !== '0' && raw !== 'false',
|
|
100
109
|
},
|
|
110
|
+
showThinking: {
|
|
111
|
+
envVar: 'CORTEX_SHOW_THINKING',
|
|
112
|
+
type: 'boolean',
|
|
113
|
+
default: true,
|
|
114
|
+
legacyParse: (raw) => !['0', 'false', 'off', 'no'].includes(raw.trim().toLowerCase()),
|
|
115
|
+
},
|
|
101
116
|
streamDeltas: {
|
|
102
117
|
envVar: 'CORTEX_STREAM_DELTAS',
|
|
103
118
|
type: 'boolean',
|
|
@@ -150,6 +165,10 @@ export const SETTINGS_SPEC = {
|
|
|
150
165
|
default: true,
|
|
151
166
|
legacyParse: (raw) => raw === '1',
|
|
152
167
|
},
|
|
168
|
+
// Anonymous product telemetry (domain/telemetry). CORTEX_TELEMETRY is deliberately not a legacy
|
|
169
|
+
// variable of this key: the gate reads it directly as a hard switch, so `CORTEX_TELEMETRY=0` in
|
|
170
|
+
// .env must stay in .env rather than be migrated away (an existing key here would win over it).
|
|
171
|
+
telemetryEnabled: { type: 'boolean', default: true },
|
|
153
172
|
waitpointSweepMs: {
|
|
154
173
|
envVar: 'CORTEX_WAITPOINT_SWEEP_MS',
|
|
155
174
|
type: 'number',
|
|
@@ -208,6 +227,12 @@ export const SETTINGS_SPEC = {
|
|
|
208
227
|
default: 5 * 60 * 1000,
|
|
209
228
|
validate: validateJobInterval,
|
|
210
229
|
},
|
|
230
|
+
// Claude on a subscription mode only: once the five-hour usage window has closed and no Claude
|
|
231
|
+
// run has started for ten minutes, send one tiny request to open the next window.
|
|
232
|
+
claudeWindowWarmupEnabled: {
|
|
233
|
+
type: 'boolean',
|
|
234
|
+
default: false,
|
|
235
|
+
},
|
|
211
236
|
providerRateLimits: {
|
|
212
237
|
type: 'provider-rate-limits',
|
|
213
238
|
default: {},
|
|
@@ -250,6 +275,19 @@ export const SETTINGS_SPEC = {
|
|
|
250
275
|
default: null,
|
|
251
276
|
validate: validateMaxContextTokens,
|
|
252
277
|
},
|
|
278
|
+
// Claude on a subscription mode only: how long an idle session that still expects a wake keeps
|
|
279
|
+
// its one-hour prompt cache refreshed, counted from its last model activity. 0 turns it off.
|
|
280
|
+
cacheKeepWarmHours: {
|
|
281
|
+
type: 'number',
|
|
282
|
+
default: 6,
|
|
283
|
+
validate: validateCacheKeepWarmHours,
|
|
284
|
+
},
|
|
285
|
+
// Claude only: on a --resume whose prompt cache has certainly expired, stub out all but the most
|
|
286
|
+
// recent tool results in the transcript before the CLI re-sends it.
|
|
287
|
+
coldResumeClearToolResults: {
|
|
288
|
+
type: 'boolean',
|
|
289
|
+
default: true,
|
|
290
|
+
},
|
|
253
291
|
uiCorsOrigins: {
|
|
254
292
|
envVar: 'CORTEX_UI_CORS_ORIGINS',
|
|
255
293
|
type: 'string[]',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EngineSelection } from '../domain/agents/engine-selection.js';
|
|
1
2
|
export declare function computeElapsed(startTime: number): {
|
|
2
3
|
elapsedStr: string;
|
|
3
4
|
elapsedS: number;
|
|
@@ -11,11 +12,11 @@ export declare function buildSessionTag(sessionId: string | null): string;
|
|
|
11
12
|
/** `todoProgress` is a pre-rendered task-list line (see core/todo.ts renderTodoProgress).
|
|
12
13
|
* Passing the rendered string rather than a snapshot keeps this formatter free of todo parsing
|
|
13
14
|
* and lets every caller decide whether the surface shows task progress at all. */
|
|
14
|
-
export declare function buildUserProcessingMessage({ startTime, elapsed_s, num_turns,
|
|
15
|
+
export declare function buildUserProcessingMessage({ startTime, elapsed_s, num_turns, selection, sessionId, todoProgress }: {
|
|
15
16
|
startTime: number;
|
|
16
17
|
elapsed_s?: number | null;
|
|
17
18
|
num_turns?: number | null;
|
|
18
|
-
|
|
19
|
+
selection: Pick<EngineSelection, 'backend' | 'model'>;
|
|
19
20
|
sessionId?: string | null;
|
|
20
21
|
todoProgress?: string | null;
|
|
21
22
|
}): string;
|
|
@@ -18,12 +18,12 @@ export function buildSessionTag(sessionId) {
|
|
|
18
18
|
/** `todoProgress` is a pre-rendered task-list line (see core/todo.ts renderTodoProgress).
|
|
19
19
|
* Passing the rendered string rather than a snapshot keeps this formatter free of todo parsing
|
|
20
20
|
* and lets every caller decide whether the surface shows task progress at all. */
|
|
21
|
-
export function buildUserProcessingMessage({ startTime, elapsed_s = null, num_turns = null,
|
|
21
|
+
export function buildUserProcessingMessage({ startTime, elapsed_s = null, num_turns = null, selection, sessionId = null, todoProgress = null }) {
|
|
22
22
|
const elapsed = elapsed_s ?? ((Date.now() - startTime) / 1000);
|
|
23
23
|
const sessionTag = buildSessionTag(sessionId);
|
|
24
24
|
const turnsStr = num_turns != null ? ` | ${Icons.repeat} ${t('notice.turns', { n: num_turns })}` : '';
|
|
25
25
|
const todoStr = todoProgress ? ` | ${Icons.todo} ${todoProgress}` : '';
|
|
26
|
-
return `${Icons.processing} ${t('status.processing')} | ${sessionTag}${
|
|
26
|
+
return `${Icons.processing} ${t('status.processing')} | ${sessionTag}${selection.backend} · ${selection.model} | ${Icons.stopwatch} ${formatDurationCompact(elapsed || 0)}${turnsStr}${todoStr}`;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Render one turn-status line. These strings are what a user reads in Slack/Feishu, so the shapes
|
|
@@ -37,7 +37,9 @@ export type SystemTurnOrigin =
|
|
|
37
37
|
/** A worker's pending question or plan was forwarded to its lead. */
|
|
38
38
|
| 'worker-question'
|
|
39
39
|
/** A schedule fired and opened its run with the prompt the user wrote for it. */
|
|
40
|
-
| 'scheduled'
|
|
40
|
+
| 'scheduled'
|
|
41
|
+
/** Finished `run_in_background` work re-invoked the model with no turn in flight. */
|
|
42
|
+
| 'background-task';
|
|
41
43
|
export interface AuthNoticeAction {
|
|
42
44
|
kind: 'auth-login';
|
|
43
45
|
noticeId: string;
|