@winspan/claude-forge 8.54.4 → 9.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DEVELOPMENT.md +723 -46
- package/README.md +166 -21
- package/dist/catalogs/agents.json +67 -0
- package/dist/catalogs/skills.json +306 -0
- package/dist/claudemd/claudemd-generator.d.ts +45 -45
- package/dist/claudemd/claudemd-generator.d.ts.map +1 -1
- package/dist/claudemd/claudemd-generator.js +128 -449
- package/dist/claudemd/claudemd-generator.js.map +1 -1
- package/dist/claudemd/index.d.ts +14 -4
- package/dist/claudemd/index.d.ts.map +1 -1
- package/dist/claudemd/index.js +15 -4
- package/dist/claudemd/index.js.map +1 -1
- package/dist/claudemd/resume-manager.d.ts.map +1 -1
- package/dist/claudemd/resume-manager.js +37 -9
- package/dist/claudemd/resume-manager.js.map +1 -1
- package/dist/claudemd/templates/swarm-protocol.md +35 -186
- package/dist/claudemd/violations-manager.d.ts +40 -0
- package/dist/claudemd/violations-manager.d.ts.map +1 -0
- package/dist/claudemd/violations-manager.js +106 -0
- package/dist/claudemd/violations-manager.js.map +1 -0
- package/dist/cli/commands/admin.d.ts +15 -0
- package/dist/cli/commands/admin.d.ts.map +1 -0
- package/dist/cli/commands/admin.js +177 -0
- package/dist/cli/commands/admin.js.map +1 -0
- package/dist/cli/commands/agent.d.ts +169 -0
- package/dist/cli/commands/agent.d.ts.map +1 -0
- package/dist/cli/commands/agent.js +690 -0
- package/dist/cli/commands/agent.js.map +1 -0
- package/dist/cli/commands/agents.d.ts +18 -0
- package/dist/cli/commands/agents.d.ts.map +1 -0
- package/dist/cli/commands/agents.js +160 -0
- package/dist/cli/commands/agents.js.map +1 -0
- package/dist/cli/commands/bypass.d.ts +18 -0
- package/dist/cli/commands/bypass.d.ts.map +1 -0
- package/dist/cli/commands/bypass.js +87 -0
- package/dist/cli/commands/bypass.js.map +1 -0
- package/dist/cli/commands/claudemd.d.ts +60 -0
- package/dist/cli/commands/claudemd.d.ts.map +1 -1
- package/dist/cli/commands/claudemd.js +174 -37
- package/dist/cli/commands/claudemd.js.map +1 -1
- package/dist/cli/commands/codegraph.d.ts +17 -0
- package/dist/cli/commands/codegraph.d.ts.map +1 -0
- package/dist/cli/commands/codegraph.js +263 -0
- package/dist/cli/commands/codegraph.js.map +1 -0
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/config.js +94 -1
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/daemon.d.ts +39 -0
- package/dist/cli/commands/daemon.d.ts.map +1 -1
- package/dist/cli/commands/daemon.js +167 -20
- package/dist/cli/commands/daemon.js.map +1 -1
- package/dist/cli/commands/decisions.d.ts +129 -0
- package/dist/cli/commands/decisions.d.ts.map +1 -0
- package/dist/cli/commands/decisions.js +706 -0
- package/dist/cli/commands/decisions.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +29 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +124 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/entropy.d.ts +35 -0
- package/dist/cli/commands/entropy.d.ts.map +1 -0
- package/dist/cli/commands/entropy.js +121 -0
- package/dist/cli/commands/entropy.js.map +1 -0
- package/dist/cli/commands/executions.d.ts +1 -0
- package/dist/cli/commands/executions.d.ts.map +1 -1
- package/dist/cli/commands/executions.js +12 -2
- package/dist/cli/commands/executions.js.map +1 -1
- package/dist/cli/commands/fix.d.ts +31 -0
- package/dist/cli/commands/fix.d.ts.map +1 -0
- package/dist/cli/commands/fix.js +108 -0
- package/dist/cli/commands/fix.js.map +1 -0
- package/dist/cli/commands/governance.d.ts +21 -0
- package/dist/cli/commands/governance.d.ts.map +1 -0
- package/dist/cli/commands/governance.js +60 -0
- package/dist/cli/commands/governance.js.map +1 -0
- package/dist/cli/commands/init.d.ts +27 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +158 -146
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/insights-goal-check.d.ts +54 -0
- package/dist/cli/commands/insights-goal-check.d.ts.map +1 -0
- package/dist/cli/commands/insights-goal-check.js +318 -0
- package/dist/cli/commands/insights-goal-check.js.map +1 -0
- package/dist/cli/commands/insights.d.ts +15 -0
- package/dist/cli/commands/insights.d.ts.map +1 -0
- package/dist/cli/commands/insights.js +127 -0
- package/dist/cli/commands/insights.js.map +1 -0
- package/dist/cli/commands/knowledge.d.ts +117 -0
- package/dist/cli/commands/knowledge.d.ts.map +1 -0
- package/dist/cli/commands/knowledge.js +1070 -0
- package/dist/cli/commands/knowledge.js.map +1 -0
- package/dist/cli/commands/loop.d.ts +95 -0
- package/dist/cli/commands/loop.d.ts.map +1 -0
- package/dist/cli/commands/loop.js +408 -0
- package/dist/cli/commands/loop.js.map +1 -0
- package/dist/cli/commands/maintenance.d.ts +33 -0
- package/dist/cli/commands/maintenance.d.ts.map +1 -0
- package/dist/cli/commands/maintenance.js +75 -0
- package/dist/cli/commands/maintenance.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +22 -11
- package/dist/cli/commands/mcp.d.ts.map +1 -1
- package/dist/cli/commands/mcp.js +93 -5
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/menu.d.ts.map +1 -1
- package/dist/cli/commands/menu.js +10 -184
- package/dist/cli/commands/menu.js.map +1 -1
- package/dist/cli/commands/project.d.ts +98 -0
- package/dist/cli/commands/project.d.ts.map +1 -0
- package/dist/cli/commands/project.js +382 -0
- package/dist/cli/commands/project.js.map +1 -0
- package/dist/cli/commands/skills.d.ts +131 -0
- package/dist/cli/commands/skills.d.ts.map +1 -1
- package/dist/cli/commands/skills.js +404 -118
- package/dist/cli/commands/skills.js.map +1 -1
- package/dist/cli/commands/spec.d.ts +40 -0
- package/dist/cli/commands/spec.d.ts.map +1 -0
- package/dist/cli/commands/spec.js +49 -0
- package/dist/cli/commands/spec.js.map +1 -0
- package/dist/cli/commands/stats.d.ts.map +1 -1
- package/dist/cli/commands/stats.js +11 -3
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +17 -2
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/trace.d.ts.map +1 -1
- package/dist/cli/commands/trace.js +4 -9
- package/dist/cli/commands/trace.js.map +1 -1
- package/dist/cli/commands/violations.d.ts +14 -0
- package/dist/cli/commands/violations.d.ts.map +1 -0
- package/dist/cli/commands/violations.js +43 -0
- package/dist/cli/commands/violations.js.map +1 -0
- package/dist/cli/index.js +34 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/hook-manager.d.ts +1 -1
- package/dist/cli/init/hook-manager.d.ts.map +1 -1
- package/dist/cli/init/hook-manager.js +6 -0
- package/dist/cli/init/hook-manager.js.map +1 -1
- package/dist/cli/utils/resolve-session.d.ts +32 -0
- package/dist/cli/utils/resolve-session.d.ts.map +1 -0
- package/dist/cli/utils/resolve-session.js +39 -0
- package/dist/cli/utils/resolve-session.js.map +1 -0
- package/dist/core/config.d.ts +4 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +11 -23
- package/dist/core/config.js.map +1 -1
- package/dist/core/constants.d.ts +51 -13
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +63 -13
- package/dist/core/constants.js.map +1 -1
- package/dist/core/diagnostics/checks.d.ts +151 -0
- package/dist/core/diagnostics/checks.d.ts.map +1 -0
- package/dist/core/diagnostics/checks.js +766 -0
- package/dist/core/diagnostics/checks.js.map +1 -0
- package/dist/core/diagnostics/daemon-status.d.ts +77 -0
- package/dist/core/diagnostics/daemon-status.d.ts.map +1 -0
- package/dist/core/diagnostics/daemon-status.js +113 -0
- package/dist/core/diagnostics/daemon-status.js.map +1 -0
- package/dist/core/diagnostics/entropy-checks.d.ts +83 -0
- package/dist/core/diagnostics/entropy-checks.d.ts.map +1 -0
- package/dist/core/diagnostics/entropy-checks.js +400 -0
- package/dist/core/diagnostics/entropy-checks.js.map +1 -0
- package/dist/core/diagnostics/fix-runner.d.ts +54 -0
- package/dist/core/diagnostics/fix-runner.d.ts.map +1 -0
- package/dist/core/diagnostics/fix-runner.js +90 -0
- package/dist/core/diagnostics/fix-runner.js.map +1 -0
- package/dist/core/diagnostics/heartbeat-reader.d.ts +28 -0
- package/dist/core/diagnostics/heartbeat-reader.d.ts.map +1 -0
- package/dist/core/diagnostics/heartbeat-reader.js +50 -0
- package/dist/core/diagnostics/heartbeat-reader.js.map +1 -0
- package/dist/core/diagnostics/knip-runner.d.ts +49 -0
- package/dist/core/diagnostics/knip-runner.d.ts.map +1 -0
- package/dist/core/diagnostics/knip-runner.js +100 -0
- package/dist/core/diagnostics/knip-runner.js.map +1 -0
- package/dist/core/diagnostics/markers.d.ts +96 -0
- package/dist/core/diagnostics/markers.d.ts.map +1 -0
- package/dist/core/diagnostics/markers.js +153 -0
- package/dist/core/diagnostics/markers.js.map +1 -0
- package/dist/core/event-fields.d.ts +27 -0
- package/dist/core/event-fields.d.ts.map +1 -1
- package/dist/core/event-fields.js +43 -0
- package/dist/core/event-fields.js.map +1 -1
- package/dist/core/governance/global-inject.d.ts +90 -0
- package/dist/core/governance/global-inject.d.ts.map +1 -0
- package/dist/core/governance/global-inject.js +184 -0
- package/dist/core/governance/global-inject.js.map +1 -0
- package/dist/core/insights/agent-anchor-guard.d.ts +77 -0
- package/dist/core/insights/agent-anchor-guard.d.ts.map +1 -0
- package/dist/core/insights/agent-anchor-guard.js +119 -0
- package/dist/core/insights/agent-anchor-guard.js.map +1 -0
- package/dist/core/insights/agent-distill-context.d.ts +55 -0
- package/dist/core/insights/agent-distill-context.d.ts.map +1 -0
- package/dist/core/insights/agent-distill-context.js +146 -0
- package/dist/core/insights/agent-distill-context.js.map +1 -0
- package/dist/core/insights/agent-distill-spawn.d.ts +56 -0
- package/dist/core/insights/agent-distill-spawn.d.ts.map +1 -0
- package/dist/core/insights/agent-distill-spawn.js +179 -0
- package/dist/core/insights/agent-distill-spawn.js.map +1 -0
- package/dist/core/insights/agent-drift.d.ts +66 -0
- package/dist/core/insights/agent-drift.d.ts.map +1 -0
- package/dist/core/insights/agent-drift.js +109 -0
- package/dist/core/insights/agent-drift.js.map +1 -0
- package/dist/core/insights/agent-evolution-sources.d.ts +21 -0
- package/dist/core/insights/agent-evolution-sources.d.ts.map +1 -0
- package/dist/core/insights/agent-evolution-sources.js +36 -0
- package/dist/core/insights/agent-evolution-sources.js.map +1 -0
- package/dist/core/insights/agent-health.d.ts +142 -0
- package/dist/core/insights/agent-health.d.ts.map +1 -0
- package/dist/core/insights/agent-health.js +296 -0
- package/dist/core/insights/agent-health.js.map +1 -0
- package/dist/core/insights/agent-patch-apply.d.ts +45 -0
- package/dist/core/insights/agent-patch-apply.d.ts.map +1 -0
- package/dist/core/insights/agent-patch-apply.js +165 -0
- package/dist/core/insights/agent-patch-apply.js.map +1 -0
- package/dist/core/insights/agent-suggest.d.ts +128 -0
- package/dist/core/insights/agent-suggest.d.ts.map +1 -0
- package/dist/core/insights/agent-suggest.js +284 -0
- package/dist/core/insights/agent-suggest.js.map +1 -0
- package/dist/core/insights/coverage-tiers.d.ts +46 -0
- package/dist/core/insights/coverage-tiers.d.ts.map +1 -0
- package/dist/core/insights/coverage-tiers.js +95 -0
- package/dist/core/insights/coverage-tiers.js.map +1 -0
- package/dist/core/insights/experience-extractor.d.ts +60 -0
- package/dist/core/insights/experience-extractor.d.ts.map +1 -0
- package/dist/core/insights/experience-extractor.js +319 -0
- package/dist/core/insights/experience-extractor.js.map +1 -0
- package/dist/core/insights/violation-reporter.d.ts +149 -0
- package/dist/core/insights/violation-reporter.d.ts.map +1 -0
- package/dist/core/insights/violation-reporter.js +391 -0
- package/dist/core/insights/violation-reporter.js.map +1 -0
- package/dist/core/loop/loop-engine.d.ts +140 -0
- package/dist/core/loop/loop-engine.d.ts.map +1 -0
- package/dist/core/loop/loop-engine.js +266 -0
- package/dist/core/loop/loop-engine.js.map +1 -0
- package/dist/core/queue/index.d.ts +16 -3
- package/dist/core/queue/index.d.ts.map +1 -1
- package/dist/core/queue/index.js +16 -4
- package/dist/core/queue/index.js.map +1 -1
- package/dist/core/storage/base.d.ts +317 -0
- package/dist/core/storage/base.d.ts.map +1 -1
- package/dist/core/storage/base.js +1093 -0
- package/dist/core/storage/base.js.map +1 -1
- package/dist/core/storage/codec/tool-input-codec.d.ts +93 -0
- package/dist/core/storage/codec/tool-input-codec.d.ts.map +1 -0
- package/dist/core/storage/codec/tool-input-codec.js +159 -0
- package/dist/core/storage/codec/tool-input-codec.js.map +1 -0
- package/dist/core/storage/codegraph-types.d.ts +79 -0
- package/dist/core/storage/codegraph-types.d.ts.map +1 -0
- package/dist/core/storage/codegraph-types.js +14 -0
- package/dist/core/storage/codegraph-types.js.map +1 -0
- package/dist/core/storage/codegraph.d.ts +186 -0
- package/dist/core/storage/codegraph.d.ts.map +1 -0
- package/dist/core/storage/codegraph.js +452 -0
- package/dist/core/storage/codegraph.js.map +1 -0
- package/dist/core/storage/decisions.d.ts +387 -0
- package/dist/core/storage/decisions.d.ts.map +1 -0
- package/dist/core/storage/decisions.js +534 -0
- package/dist/core/storage/decisions.js.map +1 -0
- package/dist/core/storage/events.d.ts +239 -8
- package/dist/core/storage/events.d.ts.map +1 -1
- package/dist/core/storage/events.js +705 -39
- package/dist/core/storage/events.js.map +1 -1
- package/dist/core/storage/feedback.d.ts +111 -0
- package/dist/core/storage/feedback.d.ts.map +1 -0
- package/dist/core/storage/feedback.js +186 -0
- package/dist/core/storage/feedback.js.map +1 -0
- package/dist/core/storage/forge-config.d.ts +40 -0
- package/dist/core/storage/forge-config.d.ts.map +1 -0
- package/dist/core/storage/forge-config.js +65 -0
- package/dist/core/storage/forge-config.js.map +1 -0
- package/dist/core/storage/injections.d.ts +68 -0
- package/dist/core/storage/injections.d.ts.map +1 -1
- package/dist/core/storage/injections.js +131 -5
- package/dist/core/storage/injections.js.map +1 -1
- package/dist/core/storage/knowledge.d.ts +332 -0
- package/dist/core/storage/knowledge.d.ts.map +1 -0
- package/dist/core/storage/knowledge.js +589 -0
- package/dist/core/storage/knowledge.js.map +1 -0
- package/dist/core/storage/maintenance.d.ts +36 -9
- package/dist/core/storage/maintenance.d.ts.map +1 -1
- package/dist/core/storage/maintenance.js +56 -24
- package/dist/core/storage/maintenance.js.map +1 -1
- package/dist/core/storage/pipeline-rollup.d.ts +111 -0
- package/dist/core/storage/pipeline-rollup.d.ts.map +1 -0
- package/dist/core/storage/pipeline-rollup.js +432 -0
- package/dist/core/storage/pipeline-rollup.js.map +1 -0
- package/dist/core/storage/routing.d.ts +50 -3
- package/dist/core/storage/routing.d.ts.map +1 -1
- package/dist/core/storage/routing.js +131 -10
- package/dist/core/storage/routing.js.map +1 -1
- package/dist/core/storage/rows.d.ts +31 -8
- package/dist/core/storage/rows.d.ts.map +1 -1
- package/dist/core/storage/schema.sql +367 -23
- package/dist/core/storage/sessions.d.ts +136 -0
- package/dist/core/storage/sessions.d.ts.map +1 -1
- package/dist/core/storage/sessions.js +352 -15
- package/dist/core/storage/sessions.js.map +1 -1
- package/dist/core/storage/skills.d.ts +160 -0
- package/dist/core/storage/skills.d.ts.map +1 -1
- package/dist/core/storage/skills.js +368 -7
- package/dist/core/storage/skills.js.map +1 -1
- package/dist/core/storage/sqlite.d.ts +309 -20
- package/dist/core/storage/sqlite.d.ts.map +1 -1
- package/dist/core/storage/sqlite.js +523 -16
- package/dist/core/storage/sqlite.js.map +1 -1
- package/dist/core/storage/tasks.d.ts +744 -2
- package/dist/core/storage/tasks.d.ts.map +1 -1
- package/dist/core/storage/tasks.js +1691 -17
- package/dist/core/storage/tasks.js.map +1 -1
- package/dist/core/storage/tool-intercepts.d.ts +69 -0
- package/dist/core/storage/tool-intercepts.d.ts.map +1 -0
- package/dist/core/storage/tool-intercepts.js +116 -0
- package/dist/core/storage/tool-intercepts.js.map +1 -0
- package/dist/core/types.d.ts +136 -18
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +10 -0
- package/dist/core/types.js.map +1 -1
- package/dist/core/utils/backup.d.ts +81 -0
- package/dist/core/utils/backup.d.ts.map +1 -0
- package/dist/core/utils/backup.js +98 -0
- package/dist/core/utils/backup.js.map +1 -0
- package/dist/core/utils/binary-paths.d.ts +124 -0
- package/dist/core/utils/binary-paths.d.ts.map +1 -0
- package/dist/core/utils/binary-paths.js +218 -0
- package/dist/core/utils/binary-paths.js.map +1 -0
- package/dist/core/utils/bypass-token.d.ts +75 -0
- package/dist/core/utils/bypass-token.d.ts.map +1 -0
- package/dist/core/utils/bypass-token.js +133 -0
- package/dist/core/utils/bypass-token.js.map +1 -0
- package/dist/core/utils/cc-builtin-agents.d.ts +3 -0
- package/dist/core/utils/cc-builtin-agents.d.ts.map +1 -0
- package/dist/core/utils/cc-builtin-agents.js +29 -0
- package/dist/core/utils/cc-builtin-agents.js.map +1 -0
- package/dist/core/utils/claude-cli-resolver.d.ts +26 -0
- package/dist/core/utils/claude-cli-resolver.d.ts.map +1 -0
- package/dist/core/utils/claude-cli-resolver.js +115 -0
- package/dist/core/utils/claude-cli-resolver.js.map +1 -0
- package/dist/core/utils/claude-cli-spawn.d.ts +106 -0
- package/dist/core/utils/claude-cli-spawn.d.ts.map +1 -0
- package/dist/core/utils/claude-cli-spawn.js +219 -0
- package/dist/core/utils/claude-cli-spawn.js.map +1 -0
- package/dist/core/utils/forge-resume-block.d.ts.map +1 -1
- package/dist/core/utils/forge-resume-block.js +3 -2
- package/dist/core/utils/forge-resume-block.js.map +1 -1
- package/dist/core/utils/logger.d.ts +15 -3
- package/dist/core/utils/logger.d.ts.map +1 -1
- package/dist/core/utils/logger.js +20 -2
- package/dist/core/utils/logger.js.map +1 -1
- package/dist/core/utils/noise-prompt.d.ts +97 -0
- package/dist/core/utils/noise-prompt.d.ts.map +1 -0
- package/dist/core/utils/noise-prompt.js +127 -0
- package/dist/core/utils/noise-prompt.js.map +1 -0
- package/dist/core/utils/path.d.ts +0 -4
- package/dist/core/utils/path.d.ts.map +1 -1
- package/dist/core/utils/path.js +0 -7
- package/dist/core/utils/path.js.map +1 -1
- package/dist/core/utils/time.d.ts +67 -0
- package/dist/core/utils/time.d.ts.map +1 -1
- package/dist/core/utils/time.js +147 -0
- package/dist/core/utils/time.js.map +1 -1
- package/dist/daemon/agent-sync.d.ts +24 -0
- package/dist/daemon/agent-sync.d.ts.map +1 -0
- package/dist/daemon/agent-sync.js +114 -0
- package/dist/daemon/agent-sync.js.map +1 -0
- package/dist/daemon/config-store.d.ts +55 -0
- package/dist/daemon/config-store.d.ts.map +1 -0
- package/dist/daemon/config-store.js +146 -0
- package/dist/daemon/config-store.js.map +1 -0
- package/dist/daemon/event-parser.d.ts +22 -0
- package/dist/daemon/event-parser.d.ts.map +1 -1
- package/dist/daemon/event-parser.js +54 -3
- package/dist/daemon/event-parser.js.map +1 -1
- package/dist/daemon/handlers/history-exporter.d.ts.map +1 -1
- package/dist/daemon/handlers/history-exporter.js +9 -8
- package/dist/daemon/handlers/history-exporter.js.map +1 -1
- package/dist/daemon/handlers/post-tool-use.d.ts +66 -4
- package/dist/daemon/handlers/post-tool-use.d.ts.map +1 -1
- package/dist/daemon/handlers/post-tool-use.js +221 -8
- package/dist/daemon/handlers/post-tool-use.js.map +1 -1
- package/dist/daemon/handlers/pre-tool-use.d.ts +181 -0
- package/dist/daemon/handlers/pre-tool-use.d.ts.map +1 -0
- package/dist/daemon/handlers/pre-tool-use.js +618 -0
- package/dist/daemon/handlers/pre-tool-use.js.map +1 -0
- package/dist/daemon/handlers/stop.d.ts +55 -7
- package/dist/daemon/handlers/stop.d.ts.map +1 -1
- package/dist/daemon/handlers/stop.js +245 -8
- package/dist/daemon/handlers/stop.js.map +1 -1
- package/dist/daemon/handlers/user-prompt.d.ts +51 -14
- package/dist/daemon/handlers/user-prompt.d.ts.map +1 -1
- package/dist/daemon/handlers/user-prompt.js +223 -95
- package/dist/daemon/handlers/user-prompt.js.map +1 -1
- package/dist/daemon/handlers/violation-content-backfill.d.ts +76 -0
- package/dist/daemon/handlers/violation-content-backfill.d.ts.map +1 -0
- package/dist/daemon/handlers/violation-content-backfill.js +167 -0
- package/dist/daemon/handlers/violation-content-backfill.js.map +1 -0
- package/dist/daemon/hook-sync.d.ts.map +1 -1
- package/dist/daemon/hook-sync.js +2 -1
- package/dist/daemon/hook-sync.js.map +1 -1
- package/dist/daemon/index.d.ts +19 -0
- package/dist/daemon/index.d.ts.map +1 -1
- package/dist/daemon/index.js +439 -86
- package/dist/daemon/index.js.map +1 -1
- package/dist/daemon/lifecycle.d.ts +48 -1
- package/dist/daemon/lifecycle.d.ts.map +1 -1
- package/dist/daemon/lifecycle.js +98 -2
- package/dist/daemon/lifecycle.js.map +1 -1
- package/dist/daemon/router.d.ts +4 -1
- package/dist/daemon/router.d.ts.map +1 -1
- package/dist/daemon/router.js +4 -2
- package/dist/daemon/router.js.map +1 -1
- package/dist/daemon/rules/defaults.d.ts +20 -0
- package/dist/daemon/rules/defaults.d.ts.map +1 -0
- package/dist/daemon/rules/defaults.js +779 -0
- package/dist/daemon/rules/defaults.js.map +1 -0
- package/dist/daemon/rules/registry.d.ts +47 -0
- package/dist/daemon/rules/registry.d.ts.map +1 -0
- package/dist/daemon/rules/registry.js +84 -0
- package/dist/daemon/rules/registry.js.map +1 -0
- package/dist/daemon/rules/types.d.ts +176 -0
- package/dist/daemon/rules/types.d.ts.map +1 -0
- package/dist/daemon/rules/types.js +15 -0
- package/dist/daemon/rules/types.js.map +1 -0
- package/dist/daemon/rules/whitelist.d.ts +101 -0
- package/dist/daemon/rules/whitelist.d.ts.map +1 -0
- package/dist/daemon/rules/whitelist.js +210 -0
- package/dist/daemon/rules/whitelist.js.map +1 -0
- package/dist/daemon/rules/workflow-defaults.d.ts +52 -0
- package/dist/daemon/rules/workflow-defaults.d.ts.map +1 -0
- package/dist/daemon/rules/workflow-defaults.js +521 -0
- package/dist/daemon/rules/workflow-defaults.js.map +1 -0
- package/dist/daemon/server.d.ts +11 -1
- package/dist/daemon/server.d.ts.map +1 -1
- package/dist/daemon/server.js +7 -1
- package/dist/daemon/server.js.map +1 -1
- package/dist/daemon/services/codegraph-sync.d.ts +94 -0
- package/dist/daemon/services/codegraph-sync.d.ts.map +1 -0
- package/dist/daemon/services/codegraph-sync.js +159 -0
- package/dist/daemon/services/codegraph-sync.js.map +1 -0
- package/dist/daemon/services/context-injector.d.ts +34 -0
- package/dist/daemon/services/context-injector.d.ts.map +1 -0
- package/dist/daemon/services/context-injector.js +61 -0
- package/dist/daemon/services/context-injector.js.map +1 -0
- package/dist/daemon/services/decision-hint.d.ts +240 -0
- package/dist/daemon/services/decision-hint.d.ts.map +1 -0
- package/dist/daemon/services/decision-hint.js +562 -0
- package/dist/daemon/services/decision-hint.js.map +1 -0
- package/dist/daemon/services/event-ttl-sweep.d.ts +86 -0
- package/dist/daemon/services/event-ttl-sweep.d.ts.map +1 -0
- package/dist/daemon/services/event-ttl-sweep.js +124 -0
- package/dist/daemon/services/event-ttl-sweep.js.map +1 -0
- package/dist/daemon/services/feedback-aggregator.d.ts +167 -0
- package/dist/daemon/services/feedback-aggregator.d.ts.map +1 -0
- package/dist/daemon/services/feedback-aggregator.js +415 -0
- package/dist/daemon/services/feedback-aggregator.js.map +1 -0
- package/dist/daemon/services/heartbeat-writer.d.ts +46 -0
- package/dist/daemon/services/heartbeat-writer.d.ts.map +1 -0
- package/dist/daemon/services/heartbeat-writer.js +82 -0
- package/dist/daemon/services/heartbeat-writer.js.map +1 -0
- package/dist/daemon/services/idle-session-sweeper.d.ts +61 -0
- package/dist/daemon/services/idle-session-sweeper.d.ts.map +1 -0
- package/dist/daemon/services/idle-session-sweeper.js +94 -0
- package/dist/daemon/services/idle-session-sweeper.js.map +1 -0
- package/dist/daemon/services/idle-task-budget.d.ts +50 -0
- package/dist/daemon/services/idle-task-budget.d.ts.map +1 -0
- package/dist/daemon/services/idle-task-budget.js +72 -0
- package/dist/daemon/services/idle-task-budget.js.map +1 -0
- package/dist/daemon/services/intercept-revive.d.ts +60 -0
- package/dist/daemon/services/intercept-revive.d.ts.map +1 -0
- package/dist/daemon/services/intercept-revive.js +86 -0
- package/dist/daemon/services/intercept-revive.js.map +1 -0
- package/dist/daemon/services/intercept-rollback-guard.d.ts +105 -0
- package/dist/daemon/services/intercept-rollback-guard.d.ts.map +1 -0
- package/dist/daemon/services/intercept-rollback-guard.js +152 -0
- package/dist/daemon/services/intercept-rollback-guard.js.map +1 -0
- package/dist/daemon/services/intercept-timeout-sweeper.d.ts +58 -0
- package/dist/daemon/services/intercept-timeout-sweeper.d.ts.map +1 -0
- package/dist/daemon/services/intercept-timeout-sweeper.js +83 -0
- package/dist/daemon/services/intercept-timeout-sweeper.js.map +1 -0
- package/dist/daemon/services/kb-injector.d.ts +57 -0
- package/dist/daemon/services/kb-injector.d.ts.map +1 -0
- package/dist/daemon/services/kb-injector.js +148 -0
- package/dist/daemon/services/kb-injector.js.map +1 -0
- package/dist/daemon/services/kb-rebuild-scheduler.d.ts +95 -0
- package/dist/daemon/services/kb-rebuild-scheduler.d.ts.map +1 -0
- package/dist/daemon/services/kb-rebuild-scheduler.js +149 -0
- package/dist/daemon/services/kb-rebuild-scheduler.js.map +1 -0
- package/dist/daemon/services/loop-hint.d.ts +139 -0
- package/dist/daemon/services/loop-hint.d.ts.map +1 -0
- package/dist/daemon/services/loop-hint.js +272 -0
- package/dist/daemon/services/loop-hint.js.map +1 -0
- package/dist/daemon/services/outcome-classification-service.d.ts +49 -0
- package/dist/daemon/services/outcome-classification-service.d.ts.map +1 -0
- package/dist/daemon/services/outcome-classification-service.js +214 -0
- package/dist/daemon/services/outcome-classification-service.js.map +1 -0
- package/dist/daemon/services/outcome-classifier.d.ts +136 -0
- package/dist/daemon/services/outcome-classifier.d.ts.map +1 -0
- package/dist/daemon/services/outcome-classifier.js +178 -0
- package/dist/daemon/services/outcome-classifier.js.map +1 -0
- package/dist/daemon/services/outcome-nudge.d.ts +107 -0
- package/dist/daemon/services/outcome-nudge.d.ts.map +1 -0
- package/dist/daemon/services/outcome-nudge.js +242 -0
- package/dist/daemon/services/outcome-nudge.js.map +1 -0
- package/dist/daemon/services/spec-approval.d.ts +127 -0
- package/dist/daemon/services/spec-approval.d.ts.map +1 -0
- package/dist/daemon/services/spec-approval.js +216 -0
- package/dist/daemon/services/spec-approval.js.map +1 -0
- package/dist/daemon/services/spec-gate.d.ts +54 -0
- package/dist/daemon/services/spec-gate.d.ts.map +1 -0
- package/dist/daemon/services/spec-gate.js +113 -0
- package/dist/daemon/services/spec-gate.js.map +1 -0
- package/dist/daemon/services/task-boundary-classifier.d.ts +78 -0
- package/dist/daemon/services/task-boundary-classifier.d.ts.map +1 -0
- package/dist/daemon/services/task-boundary-classifier.js +202 -0
- package/dist/daemon/services/task-boundary-classifier.js.map +1 -0
- package/dist/daemon/services/task-segmenter.d.ts +230 -1
- package/dist/daemon/services/task-segmenter.d.ts.map +1 -1
- package/dist/daemon/services/task-segmenter.js +527 -17
- package/dist/daemon/services/task-segmenter.js.map +1 -1
- package/dist/daemon/skill-sync.d.ts +7 -2
- package/dist/daemon/skill-sync.d.ts.map +1 -1
- package/dist/daemon/skill-sync.js +114 -9
- package/dist/daemon/skill-sync.js.map +1 -1
- package/dist/daemon/startup/maintenance-schedulers.d.ts +68 -0
- package/dist/daemon/startup/maintenance-schedulers.d.ts.map +1 -0
- package/dist/daemon/startup/maintenance-schedulers.js +294 -0
- package/dist/daemon/startup/maintenance-schedulers.js.map +1 -0
- package/dist/daemon/templates/agents/agent-retro-distiller.md +106 -0
- package/dist/daemon/templates/agents/claudemd-writer.md +102 -0
- package/dist/daemon/templates/agents/coder.md +262 -0
- package/dist/daemon/templates/agents/decision-maker.md +546 -0
- package/dist/daemon/templates/agents/doc-reviewer.md +118 -0
- package/dist/daemon/templates/agents/harness-debug-full.md +196 -0
- package/dist/daemon/templates/agents/knowledge-builder.md +120 -0
- package/dist/daemon/templates/agents/patch-applier.md +145 -0
- package/dist/daemon/templates/agents/planner.md +217 -0
- package/dist/daemon/templates/agents/safety-net-implementer.md +278 -0
- package/dist/daemon/templates/agents/skill-distiller.md +114 -0
- package/dist/daemon/templates/agents/task-boundary-classifier.md +65 -0
- package/dist/daemon/templates/agents/verify-agent.md +259 -0
- package/dist/daemon/utils/inject-block.d.ts +39 -0
- package/dist/daemon/utils/inject-block.d.ts.map +1 -0
- package/dist/daemon/utils/inject-block.js +25 -0
- package/dist/daemon/utils/inject-block.js.map +1 -0
- package/dist/hooks/hook-lib.sh +8 -0
- package/dist/hooks/notification.sh +19 -8
- package/dist/hooks/post-tool-use.sh +41 -23
- package/dist/hooks/pre-tool-use.sh +54 -23
- package/dist/hooks/session-start.sh +68 -0
- package/dist/hooks/stop.sh +31 -11
- package/dist/hooks/user-prompt-submit.sh +37 -21
- package/dist/knowledge/adapters/go-adapter.d.ts +65 -0
- package/dist/knowledge/adapters/go-adapter.d.ts.map +1 -0
- package/dist/knowledge/adapters/go-adapter.js +294 -0
- package/dist/knowledge/adapters/go-adapter.js.map +1 -0
- package/dist/knowledge/adapters/index.d.ts +41 -0
- package/dist/knowledge/adapters/index.d.ts.map +1 -0
- package/dist/knowledge/adapters/index.js +71 -0
- package/dist/knowledge/adapters/index.js.map +1 -0
- package/dist/knowledge/adapters/java-adapter.d.ts +66 -0
- package/dist/knowledge/adapters/java-adapter.d.ts.map +1 -0
- package/dist/knowledge/adapters/java-adapter.js +260 -0
- package/dist/knowledge/adapters/java-adapter.js.map +1 -0
- package/dist/knowledge/adapters/js-vue-adapter.d.ts +56 -0
- package/dist/knowledge/adapters/js-vue-adapter.d.ts.map +1 -0
- package/dist/knowledge/adapters/js-vue-adapter.js +203 -0
- package/dist/knowledge/adapters/js-vue-adapter.js.map +1 -0
- package/dist/knowledge/adapters/kotlin-adapter.d.ts +55 -0
- package/dist/knowledge/adapters/kotlin-adapter.d.ts.map +1 -0
- package/dist/knowledge/adapters/kotlin-adapter.js +209 -0
- package/dist/knowledge/adapters/kotlin-adapter.js.map +1 -0
- package/dist/knowledge/adapters/monorepo-adapter.d.ts +77 -0
- package/dist/knowledge/adapters/monorepo-adapter.d.ts.map +1 -0
- package/dist/knowledge/adapters/monorepo-adapter.js +170 -0
- package/dist/knowledge/adapters/monorepo-adapter.js.map +1 -0
- package/dist/knowledge/adapters/python-adapter.d.ts +89 -0
- package/dist/knowledge/adapters/python-adapter.d.ts.map +1 -0
- package/dist/knowledge/adapters/python-adapter.js +358 -0
- package/dist/knowledge/adapters/python-adapter.js.map +1 -0
- package/dist/knowledge/adapters/rust-adapter.d.ts +73 -0
- package/dist/knowledge/adapters/rust-adapter.d.ts.map +1 -0
- package/dist/knowledge/adapters/rust-adapter.js +329 -0
- package/dist/knowledge/adapters/rust-adapter.js.map +1 -0
- package/dist/knowledge/adapters/types.d.ts +99 -0
- package/dist/knowledge/adapters/types.d.ts.map +1 -0
- package/dist/knowledge/adapters/types.js +17 -0
- package/dist/knowledge/adapters/types.js.map +1 -0
- package/dist/knowledge/adapters/typescript-adapter.d.ts +57 -0
- package/dist/knowledge/adapters/typescript-adapter.d.ts.map +1 -0
- package/dist/knowledge/adapters/typescript-adapter.js +171 -0
- package/dist/knowledge/adapters/typescript-adapter.js.map +1 -0
- package/dist/knowledge/audit-applier.d.ts +70 -0
- package/dist/knowledge/audit-applier.d.ts.map +1 -0
- package/dist/knowledge/audit-applier.js +251 -0
- package/dist/knowledge/audit-applier.js.map +1 -0
- package/dist/knowledge/builder.d.ts +261 -0
- package/dist/knowledge/builder.d.ts.map +1 -0
- package/dist/knowledge/builder.js +966 -0
- package/dist/knowledge/builder.js.map +1 -0
- package/dist/knowledge/cli-provider.d.ts +151 -0
- package/dist/knowledge/cli-provider.d.ts.map +1 -0
- package/dist/knowledge/cli-provider.js +313 -0
- package/dist/knowledge/cli-provider.js.map +1 -0
- package/dist/knowledge/constants.d.ts +78 -0
- package/dist/knowledge/constants.d.ts.map +1 -0
- package/dist/knowledge/constants.js +98 -0
- package/dist/knowledge/constants.js.map +1 -0
- package/dist/knowledge/cross-module.d.ts +139 -0
- package/dist/knowledge/cross-module.d.ts.map +1 -0
- package/dist/knowledge/cross-module.js +370 -0
- package/dist/knowledge/cross-module.js.map +1 -0
- package/dist/knowledge/git-hooks.d.ts +67 -0
- package/dist/knowledge/git-hooks.d.ts.map +1 -0
- package/dist/knowledge/git-hooks.js +258 -0
- package/dist/knowledge/git-hooks.js.map +1 -0
- package/dist/knowledge/graph/edge-extractor.d.ts +45 -0
- package/dist/knowledge/graph/edge-extractor.d.ts.map +1 -0
- package/dist/knowledge/graph/edge-extractor.js +242 -0
- package/dist/knowledge/graph/edge-extractor.js.map +1 -0
- package/dist/knowledge/graph/impact.d.ts +73 -0
- package/dist/knowledge/graph/impact.d.ts.map +1 -0
- package/dist/knowledge/graph/impact.js +94 -0
- package/dist/knowledge/graph/impact.js.map +1 -0
- package/dist/knowledge/graph/types.d.ts +22 -0
- package/dist/knowledge/graph/types.d.ts.map +1 -0
- package/dist/knowledge/graph/types.js +13 -0
- package/dist/knowledge/graph/types.js.map +1 -0
- package/dist/knowledge/module-hash.d.ts +88 -0
- package/dist/knowledge/module-hash.d.ts.map +1 -0
- package/dist/knowledge/module-hash.js +162 -0
- package/dist/knowledge/module-hash.js.map +1 -0
- package/dist/knowledge/project-detector.d.ts +101 -0
- package/dist/knowledge/project-detector.d.ts.map +1 -0
- package/dist/knowledge/project-detector.js +223 -0
- package/dist/knowledge/project-detector.js.map +1 -0
- package/dist/knowledge/prompt.d.ts +237 -0
- package/dist/knowledge/prompt.d.ts.map +1 -0
- package/dist/knowledge/prompt.js +416 -0
- package/dist/knowledge/prompt.js.map +1 -0
- package/dist/knowledge/query.d.ts +118 -0
- package/dist/knowledge/query.d.ts.map +1 -0
- package/dist/knowledge/query.js +438 -0
- package/dist/knowledge/query.js.map +1 -0
- package/dist/knowledge/repo-map.d.ts +97 -0
- package/dist/knowledge/repo-map.d.ts.map +1 -0
- package/dist/knowledge/repo-map.js +447 -0
- package/dist/knowledge/repo-map.js.map +1 -0
- package/dist/knowledge/tools/index.d.ts +14 -0
- package/dist/knowledge/tools/index.d.ts.map +1 -0
- package/dist/knowledge/tools/index.js +11 -0
- package/dist/knowledge/tools/index.js.map +1 -0
- package/dist/knowledge/tools/knowledge-get-page.d.ts +46 -0
- package/dist/knowledge/tools/knowledge-get-page.d.ts.map +1 -0
- package/dist/knowledge/tools/knowledge-get-page.js +101 -0
- package/dist/knowledge/tools/knowledge-get-page.js.map +1 -0
- package/dist/knowledge/tools/knowledge-query.d.ts +77 -0
- package/dist/knowledge/tools/knowledge-query.d.ts.map +1 -0
- package/dist/knowledge/tools/knowledge-query.js +104 -0
- package/dist/knowledge/tools/knowledge-query.js.map +1 -0
- package/dist/knowledge/tools/repo-map-lookup.d.ts +45 -0
- package/dist/knowledge/tools/repo-map-lookup.d.ts.map +1 -0
- package/dist/knowledge/tools/repo-map-lookup.js +82 -0
- package/dist/knowledge/tools/repo-map-lookup.js.map +1 -0
- package/dist/knowledge/types.d.ts +269 -0
- package/dist/knowledge/types.d.ts.map +1 -0
- package/dist/knowledge/types.js +10 -0
- package/dist/knowledge/types.js.map +1 -0
- package/dist/knowledge/validator.d.ts +90 -0
- package/dist/knowledge/validator.d.ts.map +1 -0
- package/dist/knowledge/validator.js +355 -0
- package/dist/knowledge/validator.js.map +1 -0
- package/dist/mcp/server.d.ts +64 -8
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +448 -12
- package/dist/mcp/server.js.map +1 -1
- package/dist/skills/builtin-skills.d.ts +35 -0
- package/dist/skills/builtin-skills.d.ts.map +1 -0
- package/dist/skills/builtin-skills.js +68 -0
- package/dist/skills/builtin-skills.js.map +1 -0
- package/dist/skills/distill/attribution.d.ts +59 -0
- package/dist/skills/distill/attribution.d.ts.map +1 -0
- package/dist/skills/distill/attribution.js +101 -0
- package/dist/skills/distill/attribution.js.map +1 -0
- package/dist/skills/distill/distiller.d.ts +161 -0
- package/dist/skills/distill/distiller.d.ts.map +1 -0
- package/dist/skills/distill/distiller.js +461 -0
- package/dist/skills/distill/distiller.js.map +1 -0
- package/dist/skills/distill/index.d.ts +223 -0
- package/dist/skills/distill/index.d.ts.map +1 -0
- package/dist/skills/distill/index.js +466 -0
- package/dist/skills/distill/index.js.map +1 -0
- package/dist/skills/distill/project-anchor-guard.d.ts +116 -0
- package/dist/skills/distill/project-anchor-guard.d.ts.map +1 -0
- package/dist/skills/distill/project-anchor-guard.js +334 -0
- package/dist/skills/distill/project-anchor-guard.js.map +1 -0
- package/dist/skills/distill/topic-deduper.d.ts +77 -0
- package/dist/skills/distill/topic-deduper.d.ts.map +1 -0
- package/dist/skills/distill/topic-deduper.js +119 -0
- package/dist/skills/distill/topic-deduper.js.map +1 -0
- package/dist/skills/distill/upstream-fetcher.d.ts +71 -0
- package/dist/skills/distill/upstream-fetcher.d.ts.map +1 -0
- package/dist/skills/distill/upstream-fetcher.js +202 -0
- package/dist/skills/distill/upstream-fetcher.js.map +1 -0
- package/dist/skills/distilled/distilled-api-design.md +495 -0
- package/dist/skills/distilled/distilled-architecture-decision.md +173 -0
- package/dist/skills/distilled/distilled-brainstorming.md +79 -0
- package/dist/skills/distilled/distilled-brand-guidelines.md +86 -0
- package/dist/skills/distilled/distilled-canvas-design.md +128 -0
- package/dist/skills/distilled/distilled-claude-api.md +185 -0
- package/dist/skills/distilled/distilled-creator.md +181 -0
- package/dist/skills/distilled/distilled-db-schema-design.md +245 -0
- package/dist/skills/distilled/distilled-dispatching-parallel-agents.md +136 -0
- package/dist/skills/distilled/distilled-doc-coauthoring.md +144 -0
- package/dist/skills/distilled/distilled-docx.md +231 -0
- package/dist/skills/distilled/distilled-executing-plans.md +148 -0
- package/dist/skills/distilled/distilled-finishing-a-development-branch.md +213 -0
- package/dist/skills/distilled/distilled-frontend-design.md +118 -0
- package/dist/skills/distilled/distilled-harness-engineering.md +242 -0
- package/dist/skills/distilled/distilled-karpathy-guidelines.md +104 -0
- package/dist/skills/distilled/distilled-performance-optimization.md +175 -0
- package/dist/skills/distilled/distilled-receiving-code-review.md +185 -0
- package/dist/skills/distilled/distilled-spec-driven-design.md +193 -0
- package/dist/skills/distilled/distilled-subagent-driven-development.md +124 -0
- package/dist/skills/distilled/distilled-systematic-debugging.md +154 -0
- package/dist/skills/distilled/distilled-test-driven-development.md +432 -0
- package/dist/skills/distilled/distilled-using-superpowers.md +134 -0
- package/dist/skills/distilled/distilled-verification-before-completion.md +213 -0
- package/dist/skills/distilled/distilled-writing-skills.md +175 -0
- package/dist/skills/registry.d.ts +55 -51
- package/dist/skills/registry.d.ts.map +1 -1
- package/dist/skills/registry.js +82 -196
- package/dist/skills/registry.js.map +1 -1
- package/dist/skills/tools/pipeline-suggest.js +14 -14
- package/dist/skills/tools/pipeline-suggest.js.map +1 -1
- package/dist/skills/tools/skill-invoke.d.ts +3 -2
- package/dist/skills/tools/skill-invoke.d.ts.map +1 -1
- package/dist/skills/tools/skill-invoke.js +4 -2
- package/dist/skills/tools/skill-invoke.js.map +1 -1
- package/dist/web/analytics/anti-pattern-detector.d.ts.map +1 -1
- package/dist/web/analytics/anti-pattern-detector.js +6 -1
- package/dist/web/analytics/anti-pattern-detector.js.map +1 -1
- package/dist/web/analytics/drift-detector.d.ts +6 -0
- package/dist/web/analytics/drift-detector.d.ts.map +1 -1
- package/dist/web/analytics/drift-detector.js +15 -8
- package/dist/web/analytics/drift-detector.js.map +1 -1
- package/dist/web/analytics/weekly-report.d.ts +13 -0
- package/dist/web/analytics/weekly-report.d.ts.map +1 -1
- package/dist/web/analytics/weekly-report.js +17 -3
- package/dist/web/analytics/weekly-report.js.map +1 -1
- package/dist/web/routes/_helpers.d.ts +31 -0
- package/dist/web/routes/_helpers.d.ts.map +1 -1
- package/dist/web/routes/_helpers.js +33 -0
- package/dist/web/routes/_helpers.js.map +1 -1
- package/dist/web/routes/agent-content.d.ts +30 -0
- package/dist/web/routes/agent-content.d.ts.map +1 -0
- package/dist/web/routes/agent-content.js +139 -0
- package/dist/web/routes/agent-content.js.map +1 -0
- package/dist/web/routes/agent-distill.d.ts +49 -0
- package/dist/web/routes/agent-distill.d.ts.map +1 -0
- package/dist/web/routes/agent-distill.js +526 -0
- package/dist/web/routes/agent-distill.js.map +1 -0
- package/dist/web/routes/config.d.ts +56 -0
- package/dist/web/routes/config.d.ts.map +1 -0
- package/dist/web/routes/config.js +243 -0
- package/dist/web/routes/config.js.map +1 -0
- package/dist/web/routes/decisions.d.ts +15 -0
- package/dist/web/routes/decisions.d.ts.map +1 -0
- package/dist/web/routes/decisions.js +181 -0
- package/dist/web/routes/decisions.js.map +1 -0
- package/dist/web/routes/diagnostics.d.ts +61 -0
- package/dist/web/routes/diagnostics.d.ts.map +1 -0
- package/dist/web/routes/diagnostics.js +203 -0
- package/dist/web/routes/diagnostics.js.map +1 -0
- package/dist/web/routes/error-handler.d.ts +0 -4
- package/dist/web/routes/error-handler.d.ts.map +1 -1
- package/dist/web/routes/error-handler.js +0 -8
- package/dist/web/routes/error-handler.js.map +1 -1
- package/dist/web/routes/events.d.ts.map +1 -1
- package/dist/web/routes/events.js +26 -1
- package/dist/web/routes/events.js.map +1 -1
- package/dist/web/routes/health.d.ts +33 -0
- package/dist/web/routes/health.d.ts.map +1 -0
- package/dist/web/routes/health.js +37 -0
- package/dist/web/routes/health.js.map +1 -0
- package/dist/web/routes/insights.d.ts +0 -5
- package/dist/web/routes/insights.d.ts.map +1 -1
- package/dist/web/routes/insights.js +0 -0
- package/dist/web/routes/insights.js.map +1 -1
- package/dist/web/routes/knowledge.d.ts +57 -0
- package/dist/web/routes/knowledge.d.ts.map +1 -0
- package/dist/web/routes/knowledge.js +772 -0
- package/dist/web/routes/knowledge.js.map +1 -0
- package/dist/web/routes/patch.d.ts +60 -1
- package/dist/web/routes/patch.d.ts.map +1 -1
- package/dist/web/routes/patch.js +170 -64
- package/dist/web/routes/patch.js.map +1 -1
- package/dist/web/routes/pipeline.d.ts +28 -0
- package/dist/web/routes/pipeline.d.ts.map +1 -0
- package/dist/web/routes/pipeline.js +145 -0
- package/dist/web/routes/pipeline.js.map +1 -0
- package/dist/web/routes/rules.d.ts.map +1 -1
- package/dist/web/routes/rules.js +26 -7
- package/dist/web/routes/rules.js.map +1 -1
- package/dist/web/routes/sessions.d.ts.map +1 -1
- package/dist/web/routes/sessions.js +17 -8
- package/dist/web/routes/sessions.js.map +1 -1
- package/dist/web/routes/skill-content.d.ts +30 -0
- package/dist/web/routes/skill-content.d.ts.map +1 -0
- package/dist/web/routes/skill-content.js +117 -0
- package/dist/web/routes/skill-content.js.map +1 -0
- package/dist/web/routes/skill-stats.d.ts.map +1 -1
- package/dist/web/routes/skill-stats.js +153 -16
- package/dist/web/routes/skill-stats.js.map +1 -1
- package/dist/web/routes/skills-distill.d.ts +29 -0
- package/dist/web/routes/skills-distill.d.ts.map +1 -0
- package/dist/web/routes/skills-distill.js +552 -0
- package/dist/web/routes/skills-distill.js.map +1 -0
- package/dist/web/routes/skills.js +7 -7
- package/dist/web/routes/skills.js.map +1 -1
- package/dist/web/routes/stats.d.ts.map +1 -1
- package/dist/web/routes/stats.js +2 -1
- package/dist/web/routes/stats.js.map +1 -1
- package/dist/web/routes/task-timeline.d.ts +178 -0
- package/dist/web/routes/task-timeline.d.ts.map +1 -0
- package/dist/web/routes/task-timeline.js +530 -0
- package/dist/web/routes/task-timeline.js.map +1 -0
- package/dist/web/routes/tasks.d.ts.map +1 -1
- package/dist/web/routes/tasks.js +377 -8
- package/dist/web/routes/tasks.js.map +1 -1
- package/dist/web/routes/trace.d.ts.map +1 -1
- package/dist/web/routes/trace.js +3 -2
- package/dist/web/routes/trace.js.map +1 -1
- package/dist/web/routes/types.d.ts +0 -4
- package/dist/web/routes/types.d.ts.map +1 -1
- package/dist/web/routes/types.js +1 -1
- package/dist/web/routes/types.js.map +1 -1
- package/dist/web/routes/violations.d.ts +14 -0
- package/dist/web/routes/violations.d.ts.map +1 -0
- package/dist/web/routes/violations.js +112 -0
- package/dist/web/routes/violations.js.map +1 -0
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +99 -19
- package/dist/web/server.js.map +1 -1
- package/dist/web/services/agent-distill-manager.d.ts +122 -0
- package/dist/web/services/agent-distill-manager.d.ts.map +1 -0
- package/dist/web/services/agent-distill-manager.js +397 -0
- package/dist/web/services/agent-distill-manager.js.map +1 -0
- package/dist/web/services/build-manager.d.ts +72 -0
- package/dist/web/services/build-manager.d.ts.map +1 -0
- package/dist/web/services/build-manager.js +189 -0
- package/dist/web/services/build-manager.js.map +1 -0
- package/dist/web/services/distill-manager.d.ts +172 -0
- package/dist/web/services/distill-manager.d.ts.map +1 -0
- package/dist/web/services/distill-manager.js +411 -0
- package/dist/web/services/distill-manager.js.map +1 -0
- package/dist/web/static/assets/AgentDetailPage-DlUeA1sX.js +2 -0
- package/dist/web/static/assets/AgentDetailPage-DlUeA1sX.js.map +1 -0
- package/dist/web/static/assets/AgentDistillRunPage-Cybo4bii.js +3 -0
- package/dist/web/static/assets/AgentDistillRunPage-Cybo4bii.js.map +1 -0
- package/dist/web/static/assets/AgentsPage-Qd9FExLG.js +2 -0
- package/dist/web/static/assets/AgentsPage-Qd9FExLG.js.map +1 -0
- package/dist/web/static/assets/DaemonHealthPage-DTSVqtrI.js +2 -0
- package/dist/web/static/assets/DaemonHealthPage-DTSVqtrI.js.map +1 -0
- package/dist/web/static/assets/DecisionDetailPage-b4BA8dhc.js +2 -0
- package/dist/web/static/assets/DecisionDetailPage-b4BA8dhc.js.map +1 -0
- package/dist/web/static/assets/DecisionsPage-a3NRo_T7.js +2 -0
- package/dist/web/static/assets/DecisionsPage-a3NRo_T7.js.map +1 -0
- package/dist/web/static/assets/DiagnosticsPage-DIVdiIQG.js +2 -0
- package/dist/web/static/assets/DiagnosticsPage-DIVdiIQG.js.map +1 -0
- package/dist/web/static/assets/DistillDetailPage-U6a3l2iP.js +4 -0
- package/dist/web/static/assets/DistillDetailPage-U6a3l2iP.js.map +1 -0
- package/dist/web/static/assets/DistillPage-O7BHtRN8.js +2 -0
- package/dist/web/static/assets/DistillPage-O7BHtRN8.js.map +1 -0
- package/dist/web/static/assets/DistillRunPage-D1JuRWWr.js +2 -0
- package/dist/web/static/assets/DistillRunPage-D1JuRWWr.js.map +1 -0
- package/dist/web/static/assets/GlobalScopeHint-Q3wTJx3F.js +2 -0
- package/dist/web/static/assets/GlobalScopeHint-Q3wTJx3F.js.map +1 -0
- package/dist/web/static/assets/IssueDetailPage-BDfrtk2C.js +2 -0
- package/dist/web/static/assets/IssueDetailPage-BDfrtk2C.js.map +1 -0
- package/dist/web/static/assets/IssuesPage-SKmhlCrw.js +2 -0
- package/dist/web/static/assets/IssuesPage-SKmhlCrw.js.map +1 -0
- package/dist/web/static/assets/KbDetailPage-Yna86Na8.js +2 -0
- package/dist/web/static/assets/KbDetailPage-Yna86Na8.js.map +1 -0
- package/dist/web/static/assets/KbHitsPage-Cljl7H9p.js +2 -0
- package/dist/web/static/assets/KbHitsPage-Cljl7H9p.js.map +1 -0
- package/dist/web/static/assets/MarkdownRenderer-DlDQNihj.js +3 -0
- package/dist/web/static/assets/MarkdownRenderer-DlDQNihj.js.map +1 -0
- package/dist/web/static/assets/NotFound-LMzbP51V.js +2 -0
- package/dist/web/static/assets/NotFound-LMzbP51V.js.map +1 -0
- package/dist/web/static/assets/SettingsPage-DzoK4PKg.js +2 -0
- package/dist/web/static/assets/SettingsPage-DzoK4PKg.js.map +1 -0
- package/dist/web/static/assets/SkillDetailPage-BuBJJ_NX.js +2 -0
- package/dist/web/static/assets/SkillDetailPage-BuBJJ_NX.js.map +1 -0
- package/dist/web/static/assets/SkillsPage-aojkJpBc.js +2 -0
- package/dist/web/static/assets/SkillsPage-aojkJpBc.js.map +1 -0
- package/dist/web/static/assets/TaskDetailPage-1ckxnGhw.js +4 -0
- package/dist/web/static/assets/TaskDetailPage-1ckxnGhw.js.map +1 -0
- package/dist/web/static/assets/TasksHubPage-C2PLh3eg.js +6 -0
- package/dist/web/static/assets/TasksHubPage-C2PLh3eg.js.map +1 -0
- package/dist/web/static/assets/WorkplacePage-DHrp5VxS.js +2 -0
- package/dist/web/static/assets/WorkplacePage-DHrp5VxS.js.map +1 -0
- package/dist/web/static/assets/arco-DFQA6dO_.css +1 -0
- package/dist/web/static/assets/arco-DV6xCLhr.js +14 -0
- package/dist/web/static/assets/arco-DV6xCLhr.js.map +1 -0
- package/dist/web/static/assets/charts-BSV4cyC4.js +37 -0
- package/dist/web/static/assets/charts-BSV4cyC4.js.map +1 -0
- package/dist/web/static/assets/date-fns-sbWH3_uq.js +2 -0
- package/dist/web/static/assets/date-fns-sbWH3_uq.js.map +1 -0
- package/dist/web/static/assets/index-B_v_MKlb.css +1 -0
- package/dist/web/static/assets/index-DileOOE4.js +4 -0
- package/dist/web/static/assets/index-DileOOE4.js.map +1 -0
- package/dist/web/static/assets/lucide-CnlPQoG8.js +72 -0
- package/dist/web/static/assets/lucide-CnlPQoG8.js.map +1 -0
- package/dist/web/static/assets/markdown-CA7ePUts.js +30 -0
- package/dist/web/static/assets/markdown-CA7ePUts.js.map +1 -0
- package/dist/web/static/assets/outcome-BKGy9azt.js +2 -0
- package/dist/web/static/assets/outcome-BKGy9azt.js.map +1 -0
- package/dist/web/static/assets/query-CgCOpYWf.js +2 -0
- package/dist/web/static/assets/{query-C99w429o.js.map → query-CgCOpYWf.js.map} +1 -1
- package/dist/web/static/assets/{react-router-r79dBVy4.js → react-router-Cxmg8RuL.js} +3 -3
- package/dist/web/static/assets/{react-router-r79dBVy4.js.map → react-router-Cxmg8RuL.js.map} +1 -1
- package/dist/web/static/assets/react-vendor-tkvCrao7.js +57 -0
- package/dist/web/static/assets/react-vendor-tkvCrao7.js.map +1 -0
- package/dist/web/static/assets/syntax-highlighter-BDYycNja.js +6 -0
- package/dist/web/static/assets/syntax-highlighter-BDYycNja.js.map +1 -0
- package/dist/web/static/assets/useAgentStats-B-uTgqBd.js +2 -0
- package/dist/web/static/assets/useAgentStats-B-uTgqBd.js.map +1 -0
- package/dist/web/static/assets/useDecisions-D-G2Ft5T.js +2 -0
- package/dist/web/static/assets/useDecisions-D-G2Ft5T.js.map +1 -0
- package/dist/web/static/assets/useDistill-21dZkXlT.js +3 -0
- package/dist/web/static/assets/useDistill-21dZkXlT.js.map +1 -0
- package/dist/web/static/assets/useEffectiveProject-DQiyX54y.js +2 -0
- package/dist/web/static/assets/useEffectiveProject-DQiyX54y.js.map +1 -0
- package/dist/web/static/assets/useIssuesFeed-CFiyQkAL.js +2 -0
- package/dist/web/static/assets/useIssuesFeed-CFiyQkAL.js.map +1 -0
- package/dist/web/static/assets/useKbHits-xKXWgqh9.js +2 -0
- package/dist/web/static/assets/useKbHits-xKXWgqh9.js.map +1 -0
- package/dist/web/static/assets/useSkillStats-B5hbIwdf.js +2 -0
- package/dist/web/static/assets/useSkillStats-B5hbIwdf.js.map +1 -0
- package/dist/web/static/assets/vendor-DS-q4Eyc.js +36 -0
- package/dist/web/static/assets/vendor-DS-q4Eyc.js.map +1 -0
- package/dist/web/static/index.html +12 -8
- package/package.json +18 -5
- package/dist/core/ai/provider.d.ts +0 -63
- package/dist/core/ai/provider.d.ts.map +0 -1
- package/dist/core/ai/provider.js +0 -241
- package/dist/core/ai/provider.js.map +0 -1
- package/dist/core/ai/types.d.ts +0 -43
- package/dist/core/ai/types.d.ts.map +0 -1
- package/dist/core/ai/types.js +0 -5
- package/dist/core/ai/types.js.map +0 -1
- package/dist/core/storage/token-usage.d.ts +0 -36
- package/dist/core/storage/token-usage.d.ts.map +0 -1
- package/dist/core/storage/token-usage.js +0 -59
- package/dist/core/storage/token-usage.js.map +0 -1
- package/dist/core/utils/token-tracker.d.ts +0 -39
- package/dist/core/utils/token-tracker.d.ts.map +0 -1
- package/dist/core/utils/token-tracker.js +0 -69
- package/dist/core/utils/token-tracker.js.map +0 -1
- package/dist/skills/index.d.ts +0 -3
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js +0 -3
- package/dist/skills/index.js.map +0 -1
- package/dist/skills/matcher.d.ts +0 -26
- package/dist/skills/matcher.d.ts.map +0 -1
- package/dist/skills/matcher.js +0 -113
- package/dist/skills/matcher.js.map +0 -1
- package/dist/skills/official/code-simplifier.md +0 -52
- package/dist/skills/official/find-skills.md +0 -142
- package/dist/skills/official/official-api-design.md +0 -30
- package/dist/skills/official/official-architecture-decision.md +0 -41
- package/dist/skills/official/official-bmad.md +0 -118
- package/dist/skills/official/official-db-schema-design.md +0 -34
- package/dist/skills/official/official-debug.md +0 -25
- package/dist/skills/official/official-doc-driven.md +0 -31
- package/dist/skills/official/official-harness-engineering.md +0 -108
- package/dist/skills/official/official-openspec.md +0 -89
- package/dist/skills/official/official-performance-optimization.md +0 -30
- package/dist/skills/official/official-pr-review.md +0 -35
- package/dist/skills/official/official-release-checklist.md +0 -30
- package/dist/skills/official/official-security-hardening.md +0 -32
- package/dist/skills/official/official-spec-driven-design.md +0 -31
- package/dist/skills/official/planning-with-files.md +0 -241
- package/dist/skills/official/ui-ux-pro-max.md +0 -105
- package/dist/skills/official/webapp-testing.md +0 -96
- package/dist/skills/official-skills.d.ts +0 -26
- package/dist/skills/official-skills.d.ts.map +0 -1
- package/dist/skills/official-skills.js +0 -74
- package/dist/skills/official-skills.js.map +0 -1
- package/dist/skills/semantic-matcher.d.ts +0 -60
- package/dist/skills/semantic-matcher.d.ts.map +0 -1
- package/dist/skills/semantic-matcher.js +0 -192
- package/dist/skills/semantic-matcher.js.map +0 -1
- package/dist/skills/upgrade-engine.d.ts +0 -93
- package/dist/skills/upgrade-engine.d.ts.map +0 -1
- package/dist/skills/upgrade-engine.js +0 -447
- package/dist/skills/upgrade-engine.js.map +0 -1
- package/dist/skills/upgrade-prompt.d.ts +0 -20
- package/dist/skills/upgrade-prompt.d.ts.map +0 -1
- package/dist/skills/upgrade-prompt.js +0 -75
- package/dist/skills/upgrade-prompt.js.map +0 -1
- package/dist/web/routes/ai.d.ts +0 -10
- package/dist/web/routes/ai.d.ts.map +0 -1
- package/dist/web/routes/ai.js +0 -186
- package/dist/web/routes/ai.js.map +0 -1
- package/dist/web/routes/token-usage.d.ts +0 -7
- package/dist/web/routes/token-usage.d.ts.map +0 -1
- package/dist/web/routes/token-usage.js +0 -18
- package/dist/web/routes/token-usage.js.map +0 -1
- package/dist/web/ssrf-guard.d.ts +0 -35
- package/dist/web/ssrf-guard.d.ts.map +0 -1
- package/dist/web/ssrf-guard.js +0 -93
- package/dist/web/ssrf-guard.js.map +0 -1
- package/dist/web/static/assets/AIConfig-CdDWzJyO.js +0 -2
- package/dist/web/static/assets/AIConfig-CdDWzJyO.js.map +0 -1
- package/dist/web/static/assets/Dashboard-CoEmmIDt.js +0 -2
- package/dist/web/static/assets/Dashboard-CoEmmIDt.js.map +0 -1
- package/dist/web/static/assets/Drawer-DdRTzlLB.js +0 -2
- package/dist/web/static/assets/Drawer-DdRTzlLB.js.map +0 -1
- package/dist/web/static/assets/Events-DrIq1SUS.js +0 -2
- package/dist/web/static/assets/Events-DrIq1SUS.js.map +0 -1
- package/dist/web/static/assets/Reports-DFBM3MDK.js +0 -2
- package/dist/web/static/assets/Reports-DFBM3MDK.js.map +0 -1
- package/dist/web/static/assets/SearchInput-qCj_jAcf.js +0 -2
- package/dist/web/static/assets/SearchInput-qCj_jAcf.js.map +0 -1
- package/dist/web/static/assets/SessionDetail-CCzwdoT7.js +0 -2
- package/dist/web/static/assets/SessionDetail-CCzwdoT7.js.map +0 -1
- package/dist/web/static/assets/Sessions-FfLYkAw9.js +0 -2
- package/dist/web/static/assets/Sessions-FfLYkAw9.js.map +0 -1
- package/dist/web/static/assets/Skills-C8Gvs3Qa.js +0 -2
- package/dist/web/static/assets/Skills-C8Gvs3Qa.js.map +0 -1
- package/dist/web/static/assets/TaskDetail-BS8pYhaR.js +0 -2
- package/dist/web/static/assets/TaskDetail-BS8pYhaR.js.map +0 -1
- package/dist/web/static/assets/Tasks-CyuhizG8.js +0 -2
- package/dist/web/static/assets/Tasks-CyuhizG8.js.map +0 -1
- package/dist/web/static/assets/charts-CLrM0_uM.js +0 -37
- package/dist/web/static/assets/charts-CLrM0_uM.js.map +0 -1
- package/dist/web/static/assets/date-fns-CZ_bHujz.js +0 -2
- package/dist/web/static/assets/date-fns-CZ_bHujz.js.map +0 -1
- package/dist/web/static/assets/export-L_VBD2p1.js +0 -4
- package/dist/web/static/assets/export-L_VBD2p1.js.map +0 -1
- package/dist/web/static/assets/index-CBX47X8l.js +0 -3
- package/dist/web/static/assets/index-CBX47X8l.js.map +0 -1
- package/dist/web/static/assets/index-DjIoMdoR.css +0 -1
- package/dist/web/static/assets/lucide-Bs_edTLa.js +0 -232
- package/dist/web/static/assets/lucide-Bs_edTLa.js.map +0 -1
- package/dist/web/static/assets/query-C99w429o.js +0 -2
- package/dist/web/static/assets/react-vendor-CSp-GLFF.js +0 -49
- package/dist/web/static/assets/react-vendor-CSp-GLFF.js.map +0 -1
- package/dist/web/static/assets/syntax-highlighter-44FakypI.js +0 -9
- package/dist/web/static/assets/syntax-highlighter-44FakypI.js.map +0 -1
- package/dist/web/static/assets/time-Bxuk0M-C.js +0 -2
- package/dist/web/static/assets/time-Bxuk0M-C.js.map +0 -1
- package/dist/web/static/assets/vendor-CMMjVdZs.js +0 -64
- package/dist/web/static/assets/vendor-CMMjVdZs.js.map +0 -1
|
@@ -7,6 +7,21 @@ import type Database from 'better-sqlite3';
|
|
|
7
7
|
import type { ForgeEvent } from '../types.js';
|
|
8
8
|
import type { SkillInvocationRow } from './rows.js';
|
|
9
9
|
import type { Injection } from './injections.js';
|
|
10
|
+
/**
|
|
11
|
+
* 单条任务窗内 KB 主动 pull(decision 93b3075b)。queryTaskKbPulls 返回,
|
|
12
|
+
* 任务详情端点透传为 kbPulls[]。query 是 KB page/topic 明文(NOT gzip),
|
|
13
|
+
* reason 形如 `<workflow>/kb-precedent`,usefulness 为 pull 后自评(可空)。
|
|
14
|
+
*/
|
|
15
|
+
export interface TaskKbPullRow {
|
|
16
|
+
ts: number;
|
|
17
|
+
query: string;
|
|
18
|
+
reason: string | null;
|
|
19
|
+
workflow: string | null;
|
|
20
|
+
phase: string | null;
|
|
21
|
+
usefulness: string | null;
|
|
22
|
+
usefulness_note: string | null;
|
|
23
|
+
result_count: number;
|
|
24
|
+
}
|
|
10
25
|
export interface TaskRecord {
|
|
11
26
|
id: string;
|
|
12
27
|
session_id: string;
|
|
@@ -20,7 +35,47 @@ export interface TaskRecord {
|
|
|
20
35
|
/** First UserPromptSubmit user_prompt text for this task's session window.
|
|
21
36
|
* Populated by queryTasksFiltered via correlated subquery on idx_events_session_hook. */
|
|
22
37
|
first_prompt?: string | null;
|
|
38
|
+
outcome?: 'success' | 'partial' | 'failed' | 'abandoned' | null;
|
|
39
|
+
outcome_reason?: string | null;
|
|
40
|
+
commit_count?: number | null;
|
|
41
|
+
reverted_commits?: number | null;
|
|
42
|
+
user_violation_count?: number | null;
|
|
43
|
+
classified_at?: string | null;
|
|
44
|
+
/**
|
|
45
|
+
* decision 265f59d5 (2026-06-08): LLM task-boundary classifier idempotency
|
|
46
|
+
* marker. ISO timestamp stamped once the async classifier has processed the
|
|
47
|
+
* prompt that minted this task. NULL = not yet classified (or never eligible).
|
|
48
|
+
*/
|
|
49
|
+
llm_classified_at?: string | null;
|
|
50
|
+
/**
|
|
51
|
+
* Task-tracking overhaul (2026-05-27): write-time noise flag. 1 when title
|
|
52
|
+
* matched an envelope / sub-3-char / single-word slash command pattern at
|
|
53
|
+
* createTask time, else 0. Filter SQL uses this column instead of the old
|
|
54
|
+
* length+blocklist LIKE expression — see queryAgentBoardTasks WHERE clause.
|
|
55
|
+
*
|
|
56
|
+
* DEPRECATED since 2026-06-01 (spec b1480935 Option A) — `task_kind` is the
|
|
57
|
+
* successor. Read-side callers should branch on `task_kind` first and only
|
|
58
|
+
* fall back to is_noise on rows where backfill hasn't run yet.
|
|
59
|
+
*/
|
|
60
|
+
is_noise?: number | null;
|
|
61
|
+
/**
|
|
62
|
+
* spec b1480935 (2026-06-01 Option A): per-task classification.
|
|
63
|
+
* Defaults to 'user' on legacy rows + new createTask writes from
|
|
64
|
+
* NormalPrompts; segmenter tags callback / image / system rows at
|
|
65
|
+
* write time. See `core/utils/noise-prompt.ts#classifyPromptKind`.
|
|
66
|
+
*/
|
|
67
|
+
task_kind?: 'user' | 'agent-callback' | 'image' | 'system';
|
|
68
|
+
/**
|
|
69
|
+
* decision f47c2c90 (二期B, spec 1711): self-referencing FK to the user task
|
|
70
|
+
* that spawned this approval/continue follow-up turn. NULL for root tasks and
|
|
71
|
+
* for any task that didn't meet the conservative triple-gate linkage criteria.
|
|
72
|
+
* Used by the timeline parent-chain aggregation fallback when the task carries
|
|
73
|
+
* no decision_id. Exposed verbatim by mapRow.
|
|
74
|
+
*/
|
|
75
|
+
parent_task_id?: string | null;
|
|
23
76
|
}
|
|
77
|
+
/** spec b1480935: canonical task-kind enum (single source of truth). */
|
|
78
|
+
export type TaskKind = 'user' | 'agent-callback' | 'image' | 'system';
|
|
24
79
|
export interface TaskFilter {
|
|
25
80
|
session_id?: string;
|
|
26
81
|
limit?: number;
|
|
@@ -29,6 +84,8 @@ export interface TaskFilter {
|
|
|
29
84
|
from?: string;
|
|
30
85
|
to?: string;
|
|
31
86
|
search?: string;
|
|
87
|
+
/** spec b1480935 (2026-06-01): filter rows by task_kind whitelist. */
|
|
88
|
+
include_kinds?: ReadonlyArray<'user' | 'agent-callback' | 'image' | 'system'>;
|
|
32
89
|
}
|
|
33
90
|
export interface TaskPage {
|
|
34
91
|
items: TaskRecord[];
|
|
@@ -38,19 +95,193 @@ export interface TaskPage {
|
|
|
38
95
|
export declare class TaskOperations {
|
|
39
96
|
private db;
|
|
40
97
|
constructor(db: Database.Database);
|
|
98
|
+
/**
|
|
99
|
+
* Insert a task row.
|
|
100
|
+
*
|
|
101
|
+
* `is_noise` (deprecated since 2026-06-01, spec b1480935) is still accepted
|
|
102
|
+
* for back-compat — callers that haven't been migrated to `task_kind` will
|
|
103
|
+
* keep working; new writers should pass `task_kind` directly.
|
|
104
|
+
*
|
|
105
|
+
* `task_kind` (spec b1480935 Option A): when omitted, defaults to `'user'`
|
|
106
|
+
* via the schema DEFAULT. TaskSegmenter passes the classified kind from
|
|
107
|
+
* `classifyPromptKind()` so envelope rows surface in Web with a muted
|
|
108
|
+
* `agent-callback`/`image`/`system` chip instead of being hidden.
|
|
109
|
+
*/
|
|
41
110
|
writeTask(task: {
|
|
42
111
|
id: string;
|
|
43
112
|
session_id: string;
|
|
44
113
|
title: string;
|
|
45
114
|
start_time: string;
|
|
115
|
+
is_noise?: boolean;
|
|
116
|
+
task_kind?: TaskKind;
|
|
117
|
+
/**
|
|
118
|
+
* decision f47c2c90 (二期B): optional self-FK to the originating user task.
|
|
119
|
+
* Only TaskSegmenter passes it, and ONLY when the conservative triple-gate
|
|
120
|
+
* fires. Omitted → NULL (the default for every legacy / non-linked task).
|
|
121
|
+
*/
|
|
122
|
+
parent_task_id?: string | null;
|
|
46
123
|
}): void;
|
|
124
|
+
/**
|
|
125
|
+
* decision f47c2c90 (二期B, spec 1711 § Phase 2): link a task to its parent
|
|
126
|
+
* user task, but ONLY when no parent is set yet (idempotent — never overwrites
|
|
127
|
+
* an existing link). Also refuses to self-link (parentTaskId === taskId). This
|
|
128
|
+
* is the resume-path补链 hook; go-forward创建路径 passes parent_task_id directly
|
|
129
|
+
* to writeTask instead. Defense-in-depth for R4 (no cycles / no self-link).
|
|
130
|
+
*/
|
|
131
|
+
setTaskParent(taskId: string, parentTaskId: string): void;
|
|
132
|
+
/**
|
|
133
|
+
* decision f47c2c90 (二期B, spec 1711 § Phase 2): find the most recent prior
|
|
134
|
+
* user task in the same session for the triple-gate parent linkage.
|
|
135
|
+
*
|
|
136
|
+
* Conservative selection (mirrors the backfill heuristic):
|
|
137
|
+
* - same session, task_kind='user'
|
|
138
|
+
* - start_time STRICTLY earlier than `beforeIso` (parent must precede child)
|
|
139
|
+
* - start_time within `windowMs` of `beforeIso` (default 30min)
|
|
140
|
+
* - PREFERS a non-ack-titled task as the substantive originator; falls back
|
|
141
|
+
* to the most recent qualifying user task if none is non-ack.
|
|
142
|
+
*
|
|
143
|
+
* Returns the task id, or null when no qualifying prior task exists.
|
|
144
|
+
* Time math uses ISO lexical comparison (start_time is ISO TEXT — no numeric
|
|
145
|
+
* probe, DB column type landmine). `ackTitles` is the lowercase ack-token set
|
|
146
|
+
* supplied by the caller (single source of truth lives in the segmenter).
|
|
147
|
+
*/
|
|
148
|
+
getMostRecentUserTaskBefore(opts: {
|
|
149
|
+
session_id: string;
|
|
150
|
+
beforeIso: string;
|
|
151
|
+
windowMs: number;
|
|
152
|
+
ackTitles: ReadonlyArray<string>;
|
|
153
|
+
}): string | null;
|
|
154
|
+
/**
|
|
155
|
+
* decision f47c2c90 (二期B, spec 1711 § Phase 3.1): aggregate ALL Task/Agent
|
|
156
|
+
* spawns across the parent_task_id chain that `anchorTaskId` belongs to —
|
|
157
|
+
* the timeline's fallback for workflows that have NO decision_id.
|
|
158
|
+
*
|
|
159
|
+
* Algorithm (two bounded recursive CTEs, R4 cycle-safe):
|
|
160
|
+
* 1. 向上找根: walk parent_task_id up from the anchor to the root
|
|
161
|
+
* (parent_task_id IS NULL), depth ≤ 8.
|
|
162
|
+
* 2. 向下收子: from that root, collect all descendants (depth ≤ 8).
|
|
163
|
+
* The union of both walks is the chain's task-id set. SQLite recursive CTEs
|
|
164
|
+
* with UNION (set semantics) dedup automatically; the explicit depth column
|
|
165
|
+
* guard caps a pathological cycle (a.parent=b, b.parent=a) at 8 hops so the
|
|
166
|
+
* query always terminates with a finite result.
|
|
167
|
+
*
|
|
168
|
+
* Output shape is IDENTICAL to EventOperations.queryWorkflowSpawnsByDecisionId
|
|
169
|
+
* so task-timeline.ts can feed both through the same buildAgentSpawnEvents
|
|
170
|
+
* helper. subagent_type is read from the PLAINTEXT column (no gzip);
|
|
171
|
+
* tool_input / tool_output are decoded via the codec (same path as the A query)
|
|
172
|
+
* for the prompt / output previews. task_count = distinct chain task ids that
|
|
173
|
+
* actually carry ≥1 spawn (the "跨 N 轮" N for the B path).
|
|
174
|
+
*
|
|
175
|
+
* gzip note: only tool_input/tool_output flow through the codec; the chain walk
|
|
176
|
+
* itself touches plaintext tasks columns only (R7-safe).
|
|
177
|
+
*/
|
|
178
|
+
queryParentTaskChainSpawns(anchorTaskId: string): {
|
|
179
|
+
spawns: Array<{
|
|
180
|
+
event_id: string;
|
|
181
|
+
session_id: string;
|
|
182
|
+
task_id: string | null;
|
|
183
|
+
timestamp: string;
|
|
184
|
+
hook_type: 'PreToolUse' | 'PostToolUse';
|
|
185
|
+
subagent_type: string | null;
|
|
186
|
+
tool_input: Record<string, unknown> | undefined;
|
|
187
|
+
tool_output: unknown;
|
|
188
|
+
}>;
|
|
189
|
+
task_count: number;
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Read the plaintext `user_prompt` of every `UserPromptSubmit` event linked to
|
|
193
|
+
* any task in `taskIds` (decision ed5c3e93, spec 0909 per-turn-human-input).
|
|
194
|
+
*
|
|
195
|
+
* Used by the timeline route's two cross-task aggregation arms to collect the
|
|
196
|
+
* per-turn human inputs that live in OTHER per-prompt tasks of the same
|
|
197
|
+
* workflow (the originating task only sees its own first turn). The caller
|
|
198
|
+
* passes the distinct task_id set already computed from the spawn rows.
|
|
199
|
+
*
|
|
200
|
+
* CRITICAL (gzip event-content landmine, MEMORY note): `events.user_prompt` is
|
|
201
|
+
* a PLAINTEXT TEXT column — read it directly. It is NOT a gzip blob; do NOT run
|
|
202
|
+
* it through `decodeToolInput`/`decodeToolOutput` (those are for tool_input /
|
|
203
|
+
* tool_output only).
|
|
204
|
+
*
|
|
205
|
+
* Ordering: `ORDER BY e.timestamp ASC` — timestamp is ISO TEXT, lexically
|
|
206
|
+
* sortable (DB time-column-type landmine: do not treat it as ms INTEGER).
|
|
207
|
+
* Empty `taskIds` → `[]` (avoid an empty `IN ()` clause).
|
|
208
|
+
*/
|
|
209
|
+
queryUserPromptsByTaskIds(taskIds: string[]): Array<{
|
|
210
|
+
event_id: string;
|
|
211
|
+
timestamp: string;
|
|
212
|
+
user_prompt: string;
|
|
213
|
+
task_id: string | null;
|
|
214
|
+
}>;
|
|
47
215
|
updateTask(taskId: string, updates: {
|
|
48
216
|
end_time?: string;
|
|
49
217
|
status?: string;
|
|
50
218
|
event_count?: number;
|
|
51
219
|
title?: string;
|
|
220
|
+
outcome?: 'success' | 'partial' | 'failed' | 'abandoned' | 'answered';
|
|
221
|
+
outcome_reason?: string;
|
|
222
|
+
commit_count?: number;
|
|
223
|
+
reverted_commits?: number;
|
|
224
|
+
user_violation_count?: number;
|
|
225
|
+
classified_at?: string;
|
|
52
226
|
}): void;
|
|
53
227
|
linkEventToTask(taskId: string, eventId: string): void;
|
|
228
|
+
/**
|
|
229
|
+
* Task-tracking overhaul (2026-05-27 spec §3.3 Q3): pure-attachment variant
|
|
230
|
+
* of linkEventToTask. Inserts the task_events row + increments event_count
|
|
231
|
+
* BUT does NOT advance task.end_time. Used by the orphan-recovery fallback
|
|
232
|
+
* in TaskSegmenter.linkEvent so attaching a late-arriving sub-agent event
|
|
233
|
+
* to a recently-completed task doesn't stretch its duration KPI.
|
|
234
|
+
*
|
|
235
|
+
* Tradeoff: KPIs that count events get the orphan back, KPIs that read
|
|
236
|
+
* end_time stay honest. Outcome / commit_count rollups already ran at Stop
|
|
237
|
+
* time so they're unaffected either way.
|
|
238
|
+
*/
|
|
239
|
+
attachEventToTask(taskId: string, eventId: string): void;
|
|
240
|
+
/**
|
|
241
|
+
* Orphan-event robustness fix (2026-06-01): direct lookup of a session's
|
|
242
|
+
* single active *user* task.
|
|
243
|
+
*
|
|
244
|
+
* Replaces the old `queryTasks(limit:5).find(...)` heuristic in
|
|
245
|
+
* TaskSegmenter.recoverActiveTask, which broke on high-task-count sessions:
|
|
246
|
+
* the active user task could be pushed out of the most-recent-5 window by a
|
|
247
|
+
* burst of newer agent-callback / completed rows, so `.find()` returned null
|
|
248
|
+
* and every subsequent event orphaned.
|
|
249
|
+
*
|
|
250
|
+
* SQL pins the predicate at the DB layer (no LIMIT truncation):
|
|
251
|
+
* WHERE session_id = ? AND status = 'active'
|
|
252
|
+
* AND (task_kind = 'user' OR (task_kind IS NULL AND is_noise = 0))
|
|
253
|
+
* ORDER BY start_time DESC LIMIT 1
|
|
254
|
+
*
|
|
255
|
+
* The `task_kind IS NULL AND is_noise = 0` arm preserves backward compat for
|
|
256
|
+
* legacy rows written before the task_kind backfill (spec b1480935).
|
|
257
|
+
*/
|
|
258
|
+
/**
|
|
259
|
+
* decision c6613590 P0 缺陷 B: cheap PK existence check for status='active'.
|
|
260
|
+
*
|
|
261
|
+
* Used by TaskSegmenter.getTrustedCurrent to PK-recheck a map hit before
|
|
262
|
+
* trusting it, so a task the stale-GC already flipped to 'completed' can't
|
|
263
|
+
* keep absorbing new events via a dangling in-memory pointer. Returns false
|
|
264
|
+
* for unknown / completed / abandoned ids.
|
|
265
|
+
*/
|
|
266
|
+
isTaskActive(taskId: string): boolean;
|
|
267
|
+
getActiveUserTask(sessionId: string): TaskRecord | null;
|
|
268
|
+
/**
|
|
269
|
+
* Orphan-event robustness fix (2026-06-01): every session that currently has
|
|
270
|
+
* at least one active *user* task, with that task's id + start_time anchor.
|
|
271
|
+
*
|
|
272
|
+
* Drives TaskSegmenter.hydrateActiveTasks() so a freshly-restarted daemon can
|
|
273
|
+
* re-populate its in-memory `currentTasks` map up-front, instead of relying
|
|
274
|
+
* on per-event lazy recovery (which misses buffered/replayed events whose
|
|
275
|
+
* recovery heuristic doesn't fire).
|
|
276
|
+
*
|
|
277
|
+
* One row per session (the most recently started active user task wins) —
|
|
278
|
+
* mirrors getActiveUserTask's tie-break so hydrate and lazy-recover agree.
|
|
279
|
+
*/
|
|
280
|
+
queryActiveUserTaskSessions(): Array<{
|
|
281
|
+
session_id: string;
|
|
282
|
+
task_id: string;
|
|
283
|
+
start_time: string;
|
|
284
|
+
}>;
|
|
54
285
|
/** Legacy simple query — returns bare array (used by detail route internally) */
|
|
55
286
|
queryTasks(filter?: {
|
|
56
287
|
session_id?: string;
|
|
@@ -69,13 +300,119 @@ export declare class TaskOperations {
|
|
|
69
300
|
/** Returns distinct project paths that have at least one task. */
|
|
70
301
|
queryTaskProjects(): string[];
|
|
71
302
|
getTaskEventIds(taskId: string): string[];
|
|
303
|
+
/**
|
|
304
|
+
* 批量把 event_id 反查到 task_id(用 task_events 关联表)。
|
|
305
|
+
*
|
|
306
|
+
* 场景:pipeline 视图想为每个 prompt 行附上 task_id(让用户点 prompt 直接
|
|
307
|
+
* 跳 task drawer 看"这个任务实际干了什么",而不是噪音重的 session 视图)。
|
|
308
|
+
*
|
|
309
|
+
* 实现:一条 IN(...) 查询,event_id 通常 ≤ pipeline limit(默认 50,
|
|
310
|
+
* 上限 200)— 远低于 SQLite 单语句参数限制 (999),无需分批。
|
|
311
|
+
*/
|
|
312
|
+
queryTaskIdsByEventIds(eventIds: string[]): Map<string, string>;
|
|
313
|
+
/**
|
|
314
|
+
* Task-tracking overhaul (2026-05-27 spec §3.3): orphan-event recovery.
|
|
315
|
+
*
|
|
316
|
+
* After StopHandler completes the current task, late-arriving sub-agent
|
|
317
|
+
* PostToolUse events (the spawn's Bash/Read/etc tool calls that fire
|
|
318
|
+
* AFTER Stop closes the parent task) used to orphan because
|
|
319
|
+
* TaskSegmenter.linkEvent could not find an active task. Spec § 3.3
|
|
320
|
+
* Option C: when no active task exists, attach the event to the most
|
|
321
|
+
* recently completed task on the same session if it's within
|
|
322
|
+
* `sinceMs` of the event timestamp.
|
|
323
|
+
*
|
|
324
|
+
* Q3 (spec § 11): we do NOT update `task.end_time` here — the fallback
|
|
325
|
+
* is pure attachment (event_count grows by the linkEventToTask path in
|
|
326
|
+
* the caller). Updating end_time would stretch the duration KPI for
|
|
327
|
+
* every orphan that lands inside the recovery window and corrupt the
|
|
328
|
+
* outcome / task duration analytics.
|
|
329
|
+
*
|
|
330
|
+
* Order: most-recently-ended task first. event_time bound via SQLite
|
|
331
|
+
* julianday() — sinceMs is the look-back window in ms (typically 5 min).
|
|
332
|
+
* Returns null if no candidate within the window.
|
|
333
|
+
*/
|
|
334
|
+
findRecentCompletedTaskForOrphan(opts: {
|
|
335
|
+
session_id: string;
|
|
336
|
+
event_ts_iso: string;
|
|
337
|
+
sinceMs: number;
|
|
338
|
+
}): TaskRecord | null;
|
|
339
|
+
/**
|
|
340
|
+
* Task-tracking deep fix (2026-05-27 spec §3.A): smart orphan-recovery helper.
|
|
341
|
+
*
|
|
342
|
+
* Finds the most recently completed task on the same session whose end_time
|
|
343
|
+
* is before the event timestamp AND there is no other task that started
|
|
344
|
+
* between that completed task's end_time and the event timestamp.
|
|
345
|
+
*
|
|
346
|
+
* Algorithm (plain English):
|
|
347
|
+
* - candidate: status='completed', end_time IS NOT NULL, end_time <= event_ts
|
|
348
|
+
* - guard: NOT EXISTS t2 where t2.session_id = t.session_id
|
|
349
|
+
* AND t2.start_time > t.end_time AND t2.start_time <= event_ts
|
|
350
|
+
* - if multiple candidates, take end_time DESC (most recent)
|
|
351
|
+
* - returns null if no qualifying candidate
|
|
352
|
+
*
|
|
353
|
+
* Unlike findRecentCompletedTaskForOrphan (5-min window), this function has
|
|
354
|
+
* NO time-window cap. If the idle gap is 2h and no new task started during
|
|
355
|
+
* that gap, the event still attaches to the completed task. The "newer task
|
|
356
|
+
* block" guard prevents cross-task mis-attribution.
|
|
357
|
+
*/
|
|
358
|
+
findCompletedTaskForOrphanSmart(opts: {
|
|
359
|
+
session_id: string;
|
|
360
|
+
event_ts_iso: string;
|
|
361
|
+
}): TaskRecord | null;
|
|
362
|
+
/**
|
|
363
|
+
* Task-tracking deep fix (2026-05-27 spec §5.C): UNION fallback query.
|
|
364
|
+
*
|
|
365
|
+
* Returns all events associated with the task via two sources:
|
|
366
|
+
* 1. linked (linked=1): events directly linked via task_events JOIN
|
|
367
|
+
* 2. fallback (linked=0): events in the same session+time window that are
|
|
368
|
+
* NOT in task_events for this task AND NOT linked to any OTHER task
|
|
369
|
+
* on the same session (prevents event theft across tasks)
|
|
370
|
+
*
|
|
371
|
+
* The `linked` field lets callers (web timeline) badge unlinked events.
|
|
372
|
+
*/
|
|
373
|
+
queryEventsByTaskIdWithFallback(taskId: string, opts?: {
|
|
374
|
+
limit?: number;
|
|
375
|
+
}): Array<ForgeEvent & {
|
|
376
|
+
linked: 0 | 1;
|
|
377
|
+
}>;
|
|
378
|
+
/**
|
|
379
|
+
* B+ spec: 30min smart window 续命 helper.
|
|
380
|
+
*
|
|
381
|
+
* Reactivates a previously completed task so that a new UserPromptSubmit
|
|
382
|
+
* that arrives within TASK_RESUME_WINDOW_MS of its end_time can continue
|
|
383
|
+
* the same task instead of creating a new one.
|
|
384
|
+
*
|
|
385
|
+
* Mutations:
|
|
386
|
+
* - status → 'active'
|
|
387
|
+
* - end_time → NULL (cleared; duration KPI will re-anchor at Stop time)
|
|
388
|
+
*
|
|
389
|
+
* start_time is intentionally left untouched (spec §B+: "不改 start_time").
|
|
390
|
+
* Outcome / commit_count / classified_at columns are not touched here — they
|
|
391
|
+
* would have been NULL anyway (no outcome had landed in a gap of < 30min).
|
|
392
|
+
*/
|
|
393
|
+
resumeTask(taskId: string): void;
|
|
72
394
|
/**
|
|
73
395
|
* 将 idle 超过阈值的 active task 批量转为 completed。
|
|
74
396
|
* 条件:status='active' AND end_time IS NOT NULL
|
|
75
397
|
* AND (now - end_time) > idleMinutes 分钟。
|
|
76
|
-
*
|
|
398
|
+
*
|
|
399
|
+
* 返回:被关闭的 task id 列表(decision c6613590 P0 缺陷 B)。
|
|
400
|
+
*
|
|
401
|
+
* 此前返回行数(number),调用方拿不到具体被关的 task id,导致
|
|
402
|
+
* daemon 的 GC 把任务在 DB 标 completed 后,TaskSegmenter.currentTasks
|
|
403
|
+
* 内存 map 仍留着指向这些已关任务的悬空指针——后续事件经
|
|
404
|
+
* linkEventToTask 推进其 end_time,骗过 30min resume 窗,把多条独立
|
|
405
|
+
* prompt 错并进陈旧任务。改为返回 id 列表后,daemon 可据此从内存
|
|
406
|
+
* map 驱逐这些 entry,使 GC 与内存 map 保持一致。
|
|
407
|
+
*
|
|
408
|
+
* 实现:先 SELECT 出符合条件的 id(带 task_kind / session 信息以便
|
|
409
|
+
* 调用方按 session 驱逐),再用同一谓词 UPDATE。两步在 better-sqlite3
|
|
410
|
+
* 同步事务语义下原子。
|
|
77
411
|
*/
|
|
78
|
-
completeStaleActiveTasks(idleMinutes: number):
|
|
412
|
+
completeStaleActiveTasks(idleMinutes: number): Array<{
|
|
413
|
+
id: string;
|
|
414
|
+
session_id: string;
|
|
415
|
+
}>;
|
|
79
416
|
/**
|
|
80
417
|
* 按 taskId 直查单个 task(LEFT JOIN sessions 取 project_path)。
|
|
81
418
|
* 替代旧 detail route 的「拉 5000 tasks 再 find(id)」。
|
|
@@ -105,9 +442,414 @@ export declare class TaskOperations {
|
|
|
105
442
|
querySkillInvocationsByTaskWindow(taskId: string, opts?: {
|
|
106
443
|
now_ms?: number;
|
|
107
444
|
}): SkillInvocationRow[];
|
|
445
|
+
/**
|
|
446
|
+
* 该任务执行窗内 agent 主动 pull 的 KB(decision 93b3075b)—— 任务详情页右栏
|
|
447
|
+
* 「用了什么 → KB 主动 pull」从「无主动 pull」降级占位接成真实数据。
|
|
448
|
+
*
|
|
449
|
+
* scope 口径(与 querySkillInvocationsByTaskWindow 同思路,但 kb_query_log
|
|
450
|
+
* **没有 session_id 列**,故纯按时间窗 + project 圈到具体任务):
|
|
451
|
+
* - 时间窗:kb_query_log.ts(INTEGER ms) BETWEEN task.start_time(→ms) 和
|
|
452
|
+
* COALESCE(task.end_time→ms+999, now_ms)。task.start/end 是 ISO TEXT,
|
|
453
|
+
* 用 strftime('%s', ...)*1000 转 ms 比较(kb_query_log.ts 地雷:是 ms 整数,
|
|
454
|
+
* 别打成 1970)。end_time IS NULL(active task)→ 取 now_ms 兜底。
|
|
455
|
+
* - **project 圈定**:JOIN tasks t LEFT JOIN sessions s 取 project_path,
|
|
456
|
+
* 仅取 kb_query_log.project_path = 该任务 project 的 pull。本 session 多任务
|
|
457
|
+
* 共享 session_id,且同一时间窗可能并发别项目的 pull(实测 64d37b1d 窗内有
|
|
458
|
+
* /prm 项目的 coder pull),故 project 过滤 + 时间窗一起把 pull 圈到本任务
|
|
459
|
+
* 的本项目,不串别项目/别任务。project_path 为 NULL(孤儿 task)→ 不串任何
|
|
460
|
+
* pull(IS NOT NULL guard)。
|
|
461
|
+
* - **只取真实 agent pull**:reason LIKE '%kb-precedent%'(coder/verify/
|
|
462
|
+
* safetynet/decision 的 pull-reason 约定),与 countAgentKbPulls 同口径,
|
|
463
|
+
* 排掉 `cf knowledge query foo` 探针(同时 NULL-safe 排 sentinel
|
|
464
|
+
* agent_id='cli-no-session',decision 2d6d59b0)。
|
|
465
|
+
*
|
|
466
|
+
* `now_ms` 通过参数注入(end_time IS NULL 时取此值),便于测试 mock。
|
|
467
|
+
*/
|
|
468
|
+
queryTaskKbPulls(taskId: string, opts?: {
|
|
469
|
+
now_ms?: number;
|
|
470
|
+
}): TaskKbPullRow[];
|
|
471
|
+
queryAgentBoardTasks(opts: {
|
|
472
|
+
windowDays: number;
|
|
473
|
+
projectPath?: string;
|
|
474
|
+
limit?: number;
|
|
475
|
+
/** 0-based offset for paginated list view (added 2026-05-26).
|
|
476
|
+
* Kanban view always uses offset=0; only the list view paginator drives this. */
|
|
477
|
+
offset?: number;
|
|
478
|
+
now_ms?: number;
|
|
479
|
+
/**
|
|
480
|
+
* Task-tracking overhaul (2026-05-27 spec §3.2): include rows with
|
|
481
|
+
* `is_noise=1` (envelope / single-char / single-word slash command).
|
|
482
|
+
* Defaults to false — Web dashboards stay clean. Set true for audit /
|
|
483
|
+
* `?include_noise=1` API access.
|
|
484
|
+
*
|
|
485
|
+
* DEPRECATED since 2026-06-01 (spec b1480935) — translated internally
|
|
486
|
+
* to `includeKinds=['user','agent-callback','image','system']`. New
|
|
487
|
+
* callers should use `includeKinds` directly.
|
|
488
|
+
*/
|
|
489
|
+
includeNoise?: boolean;
|
|
490
|
+
/**
|
|
491
|
+
* spec b1480935 (2026-06-01 Option A): filter rows by task_kind. When
|
|
492
|
+
* omitted defaults to `['user']` — only real human tasks reach Web.
|
|
493
|
+
* Pass the full set (or call with `includeNoise:true`) to surface
|
|
494
|
+
* envelope rows muted in the UI.
|
|
495
|
+
*/
|
|
496
|
+
includeKinds?: ReadonlyArray<TaskKind>;
|
|
497
|
+
}): AgentBoardTaskRow[];
|
|
498
|
+
/**
|
|
499
|
+
* Shared task_kind filter resolution (decision b509fd91, 2026-06-08).
|
|
500
|
+
*
|
|
501
|
+
* Extracted so queryAgentBoardTasks / countAgentBoardTasks /
|
|
502
|
+
* queryAgentBoardPromptRows / countAgentBoardPromptRows all resolve the
|
|
503
|
+
* effective kind whitelist identically — no copy-paste drift. Resolution
|
|
504
|
+
* order matches the pre-existing inline logic:
|
|
505
|
+
* 1) explicit includeKinds → use as-is
|
|
506
|
+
* 2) includeNoise=true (legacy) → all 4 kinds
|
|
507
|
+
* 3) default → ['user'] only
|
|
508
|
+
*
|
|
509
|
+
* Returns { effectiveKinds, kindFilter } where kindFilter is the SQL
|
|
510
|
+
* fragment (empty string when the caller wants all kinds — no filter needed).
|
|
511
|
+
*/
|
|
512
|
+
private resolveKindFilter;
|
|
513
|
+
/**
|
|
514
|
+
* Shared outcome-bucket filter resolution (decision 0c1549ec, 2026-06-11).
|
|
515
|
+
*
|
|
516
|
+
* The TasksHub「我的任务」list view's outcome chips push their selection to
|
|
517
|
+
* the backend so filtering happens over the WHOLE window (not the page-local
|
|
518
|
+
* ~120 rows). The bucket classification here MUST mirror the CASE expression
|
|
519
|
+
* in queryAgentBoardPromptWindowAggregates so the chip COUNTS and the chip
|
|
520
|
+
* FILTER agree exactly — otherwise we re-introduce the count/filter 口径
|
|
521
|
+
* split that commit 40e03283 caused.
|
|
522
|
+
*
|
|
523
|
+
* Bucket → predicate over the `t` (tasks) alias:
|
|
524
|
+
* - 'all' / undefined → '' (no filter, backward compatible)
|
|
525
|
+
* - 'success'|'partial'|'failed' → t.outcome = '<bucket>'
|
|
526
|
+
* - 'abandoned' → t.outcome='abandoned' OR (t.outcome IS NULL AND status='abandoned')
|
|
527
|
+
* - 'answered' → t.outcome='answered'
|
|
528
|
+
* - 'none' → residual catch-all (the in-progress / no-terminal-outcome
|
|
529
|
+
* bucket + any unknown/legacy outcome string), exactly the
|
|
530
|
+
* complement of the five buckets above.
|
|
531
|
+
* Returns the bare predicate (no leading AND); caller wraps in `AND (...)`.
|
|
532
|
+
* The `t` alias is parameterless (no bind values), so callers don't push args.
|
|
533
|
+
*/
|
|
534
|
+
private resolveOutcomeFilter;
|
|
535
|
+
/**
|
|
536
|
+
* Shared free-text search filter for the TasksHub「我的任务」list view
|
|
537
|
+
* (decision 540ed063, 2026-06-11). Same downsink shape as resolveOutcomeFilter
|
|
538
|
+
* above: the search box pushes its term to the backend so matching happens
|
|
539
|
+
* over the WHOLE window (every page), not just the page-local ~120 rows a
|
|
540
|
+
* client `.filter` could see.
|
|
541
|
+
*
|
|
542
|
+
* Matching 口径 (must stay in lockstep between query and count):
|
|
543
|
+
* - case-insensitive substring (`LIKE '%term%'`, LOWER on both sides);
|
|
544
|
+
* - OR'd across two PLAINTEXT columns — `e.user_prompt` (the prompt text)
|
|
545
|
+
* and `t.title` (the task title).
|
|
546
|
+
*
|
|
547
|
+
* ⚠️ gzip One-way Door (KB landmine): `events.tool_input` / `tool_output` hold
|
|
548
|
+
* GZIP-compressed blobs (declared TEXT but binary content) — a bare SQL LIKE
|
|
549
|
+
* over them silently matches nothing. This predicate therefore touches ONLY
|
|
550
|
+
* the two plaintext columns above and NEVER tool_input/tool_output.
|
|
551
|
+
*
|
|
552
|
+
* Empty / whitespace-only term → '' (no predicate), so absent or blank search
|
|
553
|
+
* is backward-compatible (= no filter). Returns { predicate, params }: the
|
|
554
|
+
* predicate has two `?` placeholders, so unlike resolveOutcomeFilter the caller
|
|
555
|
+
* MUST push the two bind values in clause order.
|
|
556
|
+
*/
|
|
557
|
+
private resolveSearchFilter;
|
|
558
|
+
queryAgentBoardPromptRows(opts: {
|
|
559
|
+
windowDays: number;
|
|
560
|
+
projectPath?: string;
|
|
561
|
+
limit?: number;
|
|
562
|
+
offset?: number;
|
|
563
|
+
now_ms?: number;
|
|
564
|
+
includeNoise?: boolean;
|
|
565
|
+
includeKinds?: ReadonlyArray<TaskKind>;
|
|
566
|
+
/** decision 0c1549ec (2026-06-11): window-level outcome chip filter. */
|
|
567
|
+
outcome?: AgentBoardOutcomeFilter;
|
|
568
|
+
/** decision 540ed063 (2026-06-11): window-level free-text search (prompt + title). */
|
|
569
|
+
search?: string;
|
|
570
|
+
}): AgentBoardPromptRow[];
|
|
571
|
+
/**
|
|
572
|
+
* Unbounded count companion for queryAgentBoardPromptRows — the number of
|
|
573
|
+
* prompt rows (not tasks) in the window, for the list paginator's
|
|
574
|
+
* total-pages math. Same WHERE clause minus LIMIT/ORDER (decision b509fd91).
|
|
575
|
+
*/
|
|
576
|
+
countAgentBoardPromptRows(opts: {
|
|
577
|
+
windowDays: number;
|
|
578
|
+
projectPath?: string;
|
|
579
|
+
now_ms?: number;
|
|
580
|
+
includeNoise?: boolean;
|
|
581
|
+
includeKinds?: ReadonlyArray<TaskKind>;
|
|
582
|
+
/** decision 0c1549ec (2026-06-11): window-level outcome chip filter. */
|
|
583
|
+
outcome?: AgentBoardOutcomeFilter;
|
|
584
|
+
/** decision 540ed063 (2026-06-11): window-level free-text search (prompt + title). */
|
|
585
|
+
search?: string;
|
|
586
|
+
}): number;
|
|
587
|
+
/**
|
|
588
|
+
* Window-level task aggregates for the prompt-rows list view (2026-06-10).
|
|
589
|
+
*
|
|
590
|
+
* Why: the list view's KPI bar ("总任务数 / 失败 / 平均时长") and outcome tab
|
|
591
|
+
* counts were derived client-side from `queryAgentBoardPromptRows` groups —
|
|
592
|
+
* i.e. from ONE PAGE (LIMIT default 120) — so they showed page-local numbers
|
|
593
|
+
* (e.g. 34) instead of true window totals (e.g. 709). This method runs the
|
|
594
|
+
* SAME WHERE 口径 as countAgentBoardPromptRows (window / project / kind
|
|
595
|
+
* whitelist, prompt-bearing tasks only) but dedupes to distinct tasks and
|
|
596
|
+
* aggregates outcome distribution + average duration in SQL.
|
|
597
|
+
*
|
|
598
|
+
* Semantics intentionally mirror the page's previous client-side math:
|
|
599
|
+
* - task_total = COUNT(DISTINCT task) — a task with N prompts counts once.
|
|
600
|
+
* - outcome_abandoned = outcome='abandoned' OR (outcome IS NULL AND
|
|
601
|
+
* status='abandoned') — same fold the outcome chips did.
|
|
602
|
+
* - outcome_answered = outcome='answered' (spec 1100 Option C, 2026-06-02 —
|
|
603
|
+
* a first-class fifth value; no UI tab, but live data
|
|
604
|
+
* has hundreds of these so it must not vanish).
|
|
605
|
+
* - outcome_none = residual catch-all: outcome IS NULL with a
|
|
606
|
+
* non-abandoned status, OR any unknown/legacy outcome
|
|
607
|
+
* string (the column CHECK only enforces non-empty).
|
|
608
|
+
* - avg_duration_sec = AVG over tasks with duration > 0, where duration is
|
|
609
|
+
* the same CASE expression queryAgentBoardPromptRows
|
|
610
|
+
* computes for group_duration_sec (end-start, or
|
|
611
|
+
* now-start while active). Rounded to whole seconds.
|
|
612
|
+
*
|
|
613
|
+
* Invariant (tested, holds for ARBITRARY outcome strings thanks to the
|
|
614
|
+
* catch-all): success+partial+failed+abandoned+answered+none == task_total.
|
|
615
|
+
* MUST keep the inner WHERE in sync with queryAgentBoardPromptRows /
|
|
616
|
+
* countAgentBoardPromptRows above.
|
|
617
|
+
*/
|
|
618
|
+
queryAgentBoardPromptWindowAggregates(opts: {
|
|
619
|
+
windowDays: number;
|
|
620
|
+
projectPath?: string;
|
|
621
|
+
now_ms?: number;
|
|
622
|
+
includeNoise?: boolean;
|
|
623
|
+
includeKinds?: ReadonlyArray<TaskKind>;
|
|
624
|
+
}): AgentBoardPromptWindowAggregates;
|
|
625
|
+
countAgentBoardTasks(opts: {
|
|
626
|
+
windowDays: number;
|
|
627
|
+
projectPath?: string;
|
|
628
|
+
now_ms?: number;
|
|
629
|
+
/**
|
|
630
|
+
* Task-tracking overhaul (2026-05-27 spec §3.2): mirrors
|
|
631
|
+
* queryAgentBoardTasks.includeNoise so the KPI count matches whatever
|
|
632
|
+
* the lane query returned for the same opts.
|
|
633
|
+
*
|
|
634
|
+
* DEPRECATED since 2026-06-01 (spec b1480935) — see queryAgentBoardTasks.
|
|
635
|
+
*/
|
|
636
|
+
includeNoise?: boolean;
|
|
637
|
+
/** spec b1480935: mirror queryAgentBoardTasks.includeKinds. */
|
|
638
|
+
includeKinds?: ReadonlyArray<TaskKind>;
|
|
639
|
+
}): number;
|
|
640
|
+
/**
|
|
641
|
+
* Count "trivial" tasks since `sinceIso` — driven by DaemonObserverBadge's
|
|
642
|
+
* `trivial_passed_7d` field (spec 1750 § B1-3).
|
|
643
|
+
*
|
|
644
|
+
* Definition: tasks the task-segmenter marked as `is_noise=1` AT INSERT TIME
|
|
645
|
+
* (single-char prompt / single-word slash command / envelope task title). This
|
|
646
|
+
* is the closest server-side proxy for "daemon never engaged" — the trivial
|
|
647
|
+
* filter in `task-segmenter.ts` runs at write time using the same heuristics
|
|
648
|
+
* that gate decision-hint emission. Frontend's `isTrivialPath()` uses a finer
|
|
649
|
+
* signal (all daemon-intervention sections empty) but we don't have that
|
|
650
|
+
* aggregated; this proxy is good enough for the weekly counter chip.
|
|
651
|
+
*
|
|
652
|
+
* `datetime()` wrap normalises ISO 'T' vs SQLite default ' ' separator
|
|
653
|
+
* (see DecisionsOperations.countDecisionsSince for the reasoning).
|
|
654
|
+
*/
|
|
655
|
+
countTrivialTasksSince(sinceIso: string): number;
|
|
656
|
+
/**
|
|
657
|
+
* Daily commit + task activity over a window (default 30 days).
|
|
658
|
+
*
|
|
659
|
+
* Used by `/api/insights/commit-activity` to drive the HealthHomePage
|
|
660
|
+
* 30d "Commit calendar" without the lane LIMIT undercount that the
|
|
661
|
+
* agent-board path suffered. Aggregates straight off the `tasks` table
|
|
662
|
+
* by `DATE(start_time)` so the result is unbounded by perf caps.
|
|
663
|
+
*
|
|
664
|
+
* The day buckets are filled with zeros for days with no tasks so the
|
|
665
|
+
* caller doesn't have to fill gaps client-side. Days ordered oldest→newest.
|
|
666
|
+
*
|
|
667
|
+
* Added 2026-05-26 — see docs/implementation changelog.
|
|
668
|
+
*/
|
|
669
|
+
queryCommitActivityDaily(opts: {
|
|
670
|
+
days: number;
|
|
671
|
+
projectPath?: string;
|
|
672
|
+
now_ms?: number;
|
|
673
|
+
}): Array<{
|
|
674
|
+
date: string;
|
|
675
|
+
total: number;
|
|
676
|
+
succeeded: number;
|
|
677
|
+
failed: number;
|
|
678
|
+
commits: number;
|
|
679
|
+
}>;
|
|
680
|
+
/**
|
|
681
|
+
* Task-tracking deep fix (spec 1551 §6.D): Dry-run query for backfill-orphans CLI.
|
|
682
|
+
*
|
|
683
|
+
* Returns stats about how many orphan events can be attached via the smart-window
|
|
684
|
+
* algorithm. No writes are performed.
|
|
685
|
+
*/
|
|
686
|
+
queryOrphanStats(): {
|
|
687
|
+
total_orphans: number;
|
|
688
|
+
attachable: number;
|
|
689
|
+
unattachable: number;
|
|
690
|
+
pct: string;
|
|
691
|
+
};
|
|
692
|
+
/**
|
|
693
|
+
* Task-tracking deep fix (spec 1551 §6.D): Sample orphan→task pairs for dry-run display.
|
|
694
|
+
*
|
|
695
|
+
* Returns up to `limit` (default 5) sample pairs showing which events would be attached.
|
|
696
|
+
*/
|
|
697
|
+
sampleAttachablePairs(limit?: number): Array<{
|
|
698
|
+
event_id: string;
|
|
699
|
+
task_id: string;
|
|
700
|
+
task_title: string;
|
|
701
|
+
gap_min: number;
|
|
702
|
+
}>;
|
|
703
|
+
/**
|
|
704
|
+
* Task-tracking deep fix (spec 1551 §6.D.3): Apply backfill in a single atomic transaction.
|
|
705
|
+
*
|
|
706
|
+
* Inserts orphan→task links using INSERT OR IGNORE (idempotent).
|
|
707
|
+
* Then synchronizes event_count on updated tasks.
|
|
708
|
+
*
|
|
709
|
+
* Returns the number of rows inserted.
|
|
710
|
+
*/
|
|
711
|
+
backfillOrphans(): number;
|
|
712
|
+
/**
|
|
713
|
+
* The first `limit` user-prompt texts of a task, oldest-first. Feeds the
|
|
714
|
+
* classifier the "what was the previous task about" context. Reads only the
|
|
715
|
+
* plaintext `user_prompt` column (never gzip tool_input).
|
|
716
|
+
*/
|
|
717
|
+
getTaskUserPrompts(taskId: string, limit?: number): string[];
|
|
718
|
+
/** True once the async boundary classifier has stamped this task. */
|
|
719
|
+
isLlmClassified(taskId: string): boolean;
|
|
720
|
+
/** Stamp the idempotency marker without re-attributing (CONTINUATION verdict). */
|
|
721
|
+
markLlmClassified(taskId: string, atIso: string): void;
|
|
722
|
+
/**
|
|
723
|
+
* Re-attribute a single prompt event off `fromTaskId` onto a brand-new task,
|
|
724
|
+
* because the async classifier judged it NEW_TASK. Atomic + idempotent.
|
|
725
|
+
*
|
|
726
|
+
* Safety / idempotency guards (spec OQ #3 "re-check"):
|
|
727
|
+
* 1. `fromTaskId` must not already be llm_classified (double-write guard).
|
|
728
|
+
* 2. the event must STILL be linked to `fromTaskId` (no other path moved it
|
|
729
|
+
* during the LLM delay window).
|
|
730
|
+
* 3. all writes run in ONE better-sqlite3 transaction.
|
|
731
|
+
*
|
|
732
|
+
* On success: creates the new task row, moves ONLY this event's
|
|
733
|
+
* task_events.task_id FK, decrements the old task's event_count / increments
|
|
734
|
+
* the new one, and stamps `llm_classified_at` on BOTH rows. Returns the new
|
|
735
|
+
* task id. On any guard failure returns null and writes nothing.
|
|
736
|
+
*
|
|
737
|
+
* Explicitly NOT done: deleting events, editing event content, closing or
|
|
738
|
+
* reactivating the source task (its lifecycle is owned by the segmenter /
|
|
739
|
+
* stop handler). OQ1 = "trust the LLM": no conservative event-count/time guard.
|
|
740
|
+
*/
|
|
741
|
+
reattributePromptToNewTask(opts: {
|
|
742
|
+
fromTaskId: string;
|
|
743
|
+
eventId: string;
|
|
744
|
+
newTask: {
|
|
745
|
+
id: string;
|
|
746
|
+
session_id: string;
|
|
747
|
+
title: string;
|
|
748
|
+
start_time: string;
|
|
749
|
+
task_kind?: TaskKind;
|
|
750
|
+
};
|
|
751
|
+
atIso: string;
|
|
752
|
+
}): string | null;
|
|
108
753
|
/** Map a raw events row to ForgeEvent (parses JSON columns). */
|
|
109
754
|
private rowToEvent;
|
|
110
755
|
private buildWhereConditions;
|
|
111
756
|
private mapRow;
|
|
757
|
+
/**
|
|
758
|
+
* Count this task's Edit/Write intent events. Drives the `edit_intent_count`
|
|
759
|
+
* signal: a task with >0 edit-intent → `success`, one with 0 edit-intent is a
|
|
760
|
+
* pure Q&A / research task → `answered`.
|
|
761
|
+
*
|
|
762
|
+
* `tool_name` is NOT gzip-compressed (only `tool_input` is), so this is a
|
|
763
|
+
* pure SQL COUNT — no decode needed. We count PreToolUse so a single logical
|
|
764
|
+
* edit (Pre + Post) is counted once; multi-edit / notebook variants included.
|
|
765
|
+
*/
|
|
766
|
+
countEditIntentEventsByTask(taskId: string): number;
|
|
767
|
+
queryIdleUnclassifiedTasks(sessionId: string): TaskRecord[];
|
|
768
|
+
}
|
|
769
|
+
/** Raw row shape returned by queryAgentBoardTasks (route layer reshapes). */
|
|
770
|
+
export interface AgentBoardTaskRow {
|
|
771
|
+
id: string;
|
|
772
|
+
session_id: string;
|
|
773
|
+
project_path: string | null;
|
|
774
|
+
title: string;
|
|
775
|
+
description: string | null;
|
|
776
|
+
start_time: string;
|
|
777
|
+
end_time: string | null;
|
|
778
|
+
status: 'active' | 'completed' | 'abandoned';
|
|
779
|
+
event_count: number | null;
|
|
780
|
+
outcome: 'success' | 'partial' | 'failed' | 'abandoned' | null;
|
|
781
|
+
outcome_reason: string | null;
|
|
782
|
+
commit_count: number | null;
|
|
783
|
+
reverted_commits: number | null;
|
|
784
|
+
user_violation_count: number | null;
|
|
785
|
+
/** spec b1480935 (2026-06-01 Option A): per-task classification. */
|
|
786
|
+
task_kind: TaskKind;
|
|
787
|
+
duration_sec: number | null;
|
|
788
|
+
top_tools_json: string | null;
|
|
789
|
+
spawned_json: string | null;
|
|
790
|
+
files_changed: number | null;
|
|
791
|
+
last_file: string | null;
|
|
792
|
+
deny_count: number | null;
|
|
793
|
+
warn_count: number | null;
|
|
794
|
+
kb_meta_concat: string | null;
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* Outcome-chip filter buckets for the TasksHub list view (decision 0c1549ec,
|
|
798
|
+
* 2026-06-11). Mirrors the six buckets of AgentBoardPromptWindowAggregates so
|
|
799
|
+
* the chip COUNT and the chip FILTER use one classification. 'all' = no filter.
|
|
800
|
+
* - 'none' = the in-progress / no-terminal-outcome residual bucket (the
|
|
801
|
+
* ~365 tasks that previously had no chip and made sub-buckets ≠ 全部).
|
|
802
|
+
*/
|
|
803
|
+
export type AgentBoardOutcomeFilter = 'all' | 'success' | 'partial' | 'failed' | 'abandoned' | 'answered' | 'none';
|
|
804
|
+
/**
|
|
805
|
+
* Raw row shape returned by queryAgentBoardPromptRows (decision b509fd91,
|
|
806
|
+
* 2026-06-08). One row = one UserPromptSubmit event; `group_id` = the task it
|
|
807
|
+
* belongs to (zero-schema grouping). Lightweight — no per-prompt aggregations;
|
|
808
|
+
* group_* fields carry the owning task's lane/status metadata.
|
|
809
|
+
*/
|
|
810
|
+
export interface AgentBoardPromptRow {
|
|
811
|
+
/** prompt event id — primary key + `?prompt=<event_id>` drawer deep-link. */
|
|
812
|
+
event_id: string;
|
|
813
|
+
/** user_prompt text, substr(1,300); frontend ellipsises further. */
|
|
814
|
+
prompt_text: string;
|
|
815
|
+
/** events.timestamp of this prompt. */
|
|
816
|
+
prompt_ts: string;
|
|
817
|
+
session_id: string;
|
|
818
|
+
project_path: string | null;
|
|
819
|
+
/** = owning task id. The "group" key (zero new column). */
|
|
820
|
+
group_id: string;
|
|
821
|
+
group_title: string;
|
|
822
|
+
group_status: 'active' | 'completed' | 'abandoned';
|
|
823
|
+
group_outcome: 'success' | 'partial' | 'failed' | 'abandoned' | null;
|
|
824
|
+
group_task_kind: TaskKind;
|
|
825
|
+
group_start_time: string;
|
|
826
|
+
group_end_time: string | null;
|
|
827
|
+
group_event_count: number;
|
|
828
|
+
group_duration_sec: number | null;
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Window-level aggregates over DISTINCT prompt-bearing tasks (2026-06-10).
|
|
832
|
+
* Returned by queryAgentBoardPromptWindowAggregates — drives the list view's
|
|
833
|
+
* KPI bar + outcome tab counts so they reflect the whole window instead of
|
|
834
|
+
* the current page. Invariant: the six outcome buckets sum to task_total.
|
|
835
|
+
*/
|
|
836
|
+
export interface AgentBoardPromptWindowAggregates {
|
|
837
|
+
/** COUNT(DISTINCT task) in the window — N prompts of one task count once. */
|
|
838
|
+
task_total: number;
|
|
839
|
+
outcome_success: number;
|
|
840
|
+
outcome_partial: number;
|
|
841
|
+
outcome_failed: number;
|
|
842
|
+
/** outcome='abandoned' OR (outcome IS NULL AND status='abandoned') — chip fold. */
|
|
843
|
+
outcome_abandoned: number;
|
|
844
|
+
/** outcome='answered' (spec 1100 Option C fifth value — no UI tab today). */
|
|
845
|
+
outcome_answered: number;
|
|
846
|
+
/**
|
|
847
|
+
* Residual catch-all: outcome IS NULL with non-abandoned status (active /
|
|
848
|
+
* pending), plus any unknown/legacy outcome string. Keeps the partition
|
|
849
|
+
* invariant true for arbitrary data (column CHECK only enforces non-empty).
|
|
850
|
+
*/
|
|
851
|
+
outcome_none: number;
|
|
852
|
+
/** AVG over tasks with duration > 0 (rounded, whole seconds); null when none. */
|
|
853
|
+
avg_duration_sec: number | null;
|
|
112
854
|
}
|
|
113
855
|
//# sourceMappingURL=tasks.d.ts.map
|