@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
-- Claude Forge SQLite Schema (core tables)
|
|
2
2
|
-- Active tables: events, sessions, injections, tasks, task_events,
|
|
3
|
-
-- routing_events,
|
|
3
|
+
-- routing_events, skill_invocations
|
|
4
4
|
--
|
|
5
5
|
-- ── Table Relationships ──────────────────────────────────────────────────────
|
|
6
6
|
--
|
|
@@ -17,10 +17,7 @@
|
|
|
17
17
|
-- └─ skill_invocations.session_id → events.session_id (logical, no FK)
|
|
18
18
|
-- └─ skill_invocations.route_request_id → routing_events.route_request_id (logical, no FK)
|
|
19
19
|
--
|
|
20
|
-
--
|
|
21
|
-
-- └─ token_usage.session_id → events.session_id (logical, no FK)
|
|
22
|
-
--
|
|
23
|
-
-- Why no FK on routing_events / skill_invocations / token_usage:
|
|
20
|
+
-- Why no FK on routing_events / skill_invocations:
|
|
24
21
|
-- 1. routing_events.route_request_id is nullable and not UNIQUE — cannot be FK target
|
|
25
22
|
-- 2. Write order is not guaranteed: skill_invocations may be written before routing_events
|
|
26
23
|
-- 3. session_id references are maintained by application logic; sessions is an aggregate
|
|
@@ -42,6 +39,14 @@ CREATE TABLE IF NOT EXISTS events (
|
|
|
42
39
|
user_prompt TEXT,
|
|
43
40
|
ai_response TEXT,
|
|
44
41
|
distilled INTEGER DEFAULT 0,
|
|
42
|
+
-- F3 (audit-20260522): tool_output 写入端 50KB 截断标记。1=truncated。
|
|
43
|
+
tool_output_truncated INTEGER DEFAULT 0,
|
|
44
|
+
-- decision c425f26f (spec 1544): spawn prompt 头 <!-- decision-id: XXXX --> 抽出的
|
|
45
|
+
-- 明文串联键(nullable,非 Task/Agent spawn 行为 NULL)。绝不走 gzip codec——
|
|
46
|
+
-- 解压一次写明文,供跨 task 按 decision_id 聚合 SQL 直接查询(gzip one-way-door 雷)。
|
|
47
|
+
decision_id TEXT,
|
|
48
|
+
-- decision c425f26f: Task/Agent spawn 的 subagent_type 明文抽出(nullable,非 spawn 为 NULL)。
|
|
49
|
+
subagent_type TEXT,
|
|
45
50
|
created_at TEXT DEFAULT (datetime('now'))
|
|
46
51
|
);
|
|
47
52
|
|
|
@@ -50,6 +55,9 @@ CREATE INDEX IF NOT EXISTS idx_events_project ON events(project_path);
|
|
|
50
55
|
CREATE INDEX IF NOT EXISTS idx_events_timestamp ON events(timestamp DESC);
|
|
51
56
|
CREATE INDEX IF NOT EXISTS idx_events_distilled ON events(distilled);
|
|
52
57
|
CREATE INDEX IF NOT EXISTS idx_events_hook_type ON events(hook_type);
|
|
58
|
+
-- decision c425f26f: 跨 task 按 decision_id 聚合 spawn 的覆盖索引。
|
|
59
|
+
CREATE INDEX IF NOT EXISTS idx_events_decision_id ON events(decision_id);
|
|
60
|
+
CREATE INDEX IF NOT EXISTS idx_events_decision_spawn ON events(decision_id, hook_type, tool_name, timestamp);
|
|
53
61
|
|
|
54
62
|
CREATE TABLE IF NOT EXISTS sessions (
|
|
55
63
|
session_id TEXT PRIMARY KEY,
|
|
@@ -60,6 +68,28 @@ CREATE TABLE IF NOT EXISTS sessions (
|
|
|
60
68
|
end_time TEXT,
|
|
61
69
|
last_event_time TEXT,
|
|
62
70
|
event_count INTEGER DEFAULT 0,
|
|
71
|
+
-- Outcome instrumentation (v9.x): rule-based classification at Stop time.
|
|
72
|
+
-- NULL means "not yet classified" (legacy rows or pre-classification reads).
|
|
73
|
+
--
|
|
74
|
+
-- spec 1100 Option C (2026-06-02): CHECK relaxed from a fixed value enum
|
|
75
|
+
-- ('success','partial','failed','abandoned') to a non-empty-string guard.
|
|
76
|
+
-- Adding the new `answered` outcome (and any future value) no longer
|
|
77
|
+
-- requires a table rebuild / CHECK-migration — the classifier is the single
|
|
78
|
+
-- source of truth for the value set; the column just stores it. Legacy DBs
|
|
79
|
+
-- with the old enum CHECK are widened in-place by base.ts
|
|
80
|
+
-- rebuildOutcomeCheckIfNeeded (one-shot, idempotent, data-preserving).
|
|
81
|
+
outcome TEXT CHECK(outcome IS NULL OR length(outcome) > 0),
|
|
82
|
+
outcome_reason TEXT,
|
|
83
|
+
commit_count INTEGER DEFAULT 0,
|
|
84
|
+
reverted_commits INTEGER DEFAULT 0,
|
|
85
|
+
user_violation_count INTEGER DEFAULT 0,
|
|
86
|
+
classified_at TEXT,
|
|
87
|
+
-- Phase 2 metrics rollup (master roadmap §2): per-session counters back-
|
|
88
|
+
-- filled by Stop handler from fact tables (tool_intercepts / injections /
|
|
89
|
+
-- skill_invocations). Default 0 so analytics queries can skip COALESCE.
|
|
90
|
+
intercept_count INTEGER DEFAULT 0,
|
|
91
|
+
kb_inject_count INTEGER DEFAULT 0,
|
|
92
|
+
skill_match_count INTEGER DEFAULT 0,
|
|
63
93
|
created_at TEXT DEFAULT (datetime('now')),
|
|
64
94
|
updated_at TEXT DEFAULT (datetime('now'))
|
|
65
95
|
);
|
|
@@ -67,6 +97,8 @@ CREATE TABLE IF NOT EXISTS sessions (
|
|
|
67
97
|
CREATE INDEX IF NOT EXISTS idx_sessions_project ON sessions(project_path);
|
|
68
98
|
CREATE INDEX IF NOT EXISTS idx_sessions_status ON sessions(status);
|
|
69
99
|
CREATE INDEX IF NOT EXISTS idx_sessions_start_time ON sessions(start_time DESC);
|
|
100
|
+
CREATE INDEX IF NOT EXISTS idx_sessions_outcome ON sessions(outcome);
|
|
101
|
+
CREATE INDEX IF NOT EXISTS idx_sessions_project_outcome ON sessions(project_path, outcome);
|
|
70
102
|
|
|
71
103
|
-- ── Injections ─────────────────────────────────────────────────────
|
|
72
104
|
|
|
@@ -78,6 +110,12 @@ CREATE TABLE IF NOT EXISTS injections (
|
|
|
78
110
|
source_handler TEXT NOT NULL,
|
|
79
111
|
injection_type TEXT NOT NULL CHECK(injection_type IN ('systemMessage', 'additionalContext', 'reason')),
|
|
80
112
|
content TEXT NOT NULL,
|
|
113
|
+
metadata_json TEXT,
|
|
114
|
+
-- KB 采纳 telemetry(decision 148f7a0a, 2026-06-10):同会话后续出现
|
|
115
|
+
-- mcp__claude-forge__knowledge* 调用时,PostToolUse handler 把该会话
|
|
116
|
+
-- source_handler LIKE '%:kb' 且未标记的注入行盖上 epoch-ms 时间戳。
|
|
117
|
+
-- NULL = 注入后从未被采纳。
|
|
118
|
+
adopted_at INTEGER,
|
|
81
119
|
created_at TEXT DEFAULT (datetime('now')),
|
|
82
120
|
FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE
|
|
83
121
|
);
|
|
@@ -97,6 +135,54 @@ CREATE TABLE IF NOT EXISTS tasks (
|
|
|
97
135
|
end_time TEXT,
|
|
98
136
|
status TEXT DEFAULT 'active' CHECK(status IN ('active', 'completed', 'abandoned')),
|
|
99
137
|
event_count INTEGER DEFAULT 0,
|
|
138
|
+
-- Outcome instrumentation (v9.x): mirrors sessions.outcome at task granularity.
|
|
139
|
+
-- spec 1100 Option C (2026-06-02): CHECK relaxed to a non-empty guard so the
|
|
140
|
+
-- new `answered` value (and future ones) need no table rebuild. See the
|
|
141
|
+
-- matching note on sessions.outcome above.
|
|
142
|
+
outcome TEXT CHECK(outcome IS NULL OR length(outcome) > 0),
|
|
143
|
+
outcome_reason TEXT,
|
|
144
|
+
commit_count INTEGER DEFAULT 0,
|
|
145
|
+
reverted_commits INTEGER DEFAULT 0,
|
|
146
|
+
user_violation_count INTEGER DEFAULT 0,
|
|
147
|
+
classified_at TEXT,
|
|
148
|
+
-- decision 265f59d5 (2026-06-08): LLM task-boundary classifier idempotency
|
|
149
|
+
-- marker. ISO timestamp stamped once the async TaskBoundaryClassifier has
|
|
150
|
+
-- processed the prompt that minted this task; NULL = not yet / never
|
|
151
|
+
-- classified. Guards against a replayed event re-spawning claude or
|
|
152
|
+
-- re-attributing the same prompt twice.
|
|
153
|
+
llm_classified_at TEXT,
|
|
154
|
+
-- Task-tracking overhaul (2026-05-27): write-time noise classification.
|
|
155
|
+
-- Computed by TaskSegmenter.createTask via computeIsNoise(); replaces the
|
|
156
|
+
-- LOWER(title) IN (...) + length() blocklist in queryAgentBoardTasks /
|
|
157
|
+
-- countAgentBoardTasks (Bug 2: CJK short titles like '推送吧' were dropped).
|
|
158
|
+
-- 1 = noise (envelope / sub-3-char / single-word slash command).
|
|
159
|
+
-- 0 = real human task (default; legacy rows back-filled by base.ts post-migration).
|
|
160
|
+
--
|
|
161
|
+
-- DEPRECATED since 2026-06-01 (spec b1480935 Option A) in favour of the
|
|
162
|
+
-- richer `task_kind` column below. Writers stop populating is_noise (it
|
|
163
|
+
-- stays 0 for new rows); read paths fall back to is_noise=1 only on
|
|
164
|
+
-- legacy DBs where backfill hasn't yet populated task_kind. Column kept
|
|
165
|
+
-- to ease rollback; will be dropped in a future overhaul.
|
|
166
|
+
is_noise INTEGER NOT NULL DEFAULT 0,
|
|
167
|
+
-- spec b1480935 (2026-06-01): per-task classification covering the
|
|
168
|
+
-- previous is_noise=1 envelope buckets PLUS real human tasks. Values:
|
|
169
|
+
-- 'user' — real human prompt (default; the only kind that
|
|
170
|
+
-- participates in continuation / KPI roll-ups)
|
|
171
|
+
-- 'agent-callback' — `<task-notification>` envelope post-spawn
|
|
172
|
+
-- 'image' — `[Image #N]` attachment-only envelope
|
|
173
|
+
-- 'system' — framework reminders (system-reminder /
|
|
174
|
+
-- local-command-stdout / command-message /
|
|
175
|
+
-- command-name)
|
|
176
|
+
-- Boot-time backfill maps the legacy is_noise=1 rows to the appropriate
|
|
177
|
+
-- kind via title-prefix sniff (see base.ts backfillTasksTaskKindIfNeeded).
|
|
178
|
+
task_kind TEXT NOT NULL DEFAULT 'user'
|
|
179
|
+
CHECK(task_kind IN ('user', 'agent-callback', 'image', 'system')),
|
|
180
|
+
-- decision f47c2c90 (二期B): 无 decision_id 工作流的回退串联键。续接/批准类后续轮
|
|
181
|
+
-- 由 TaskSegmenter 指回发起它的 user task(自引用,nullable,根 task 为 NULL)。
|
|
182
|
+
-- 与一期A互补:timeline 有 decision_id 走 A,无则沿此父链聚合四段。
|
|
183
|
+
-- NOTE: SQLite ALTER TABLE ADD COLUMN 不支持 inline REFERENCES,故旧库该列无 FK
|
|
184
|
+
-- enforcement;应用层不依赖 SQLite FK enforce(仅逻辑外键),新库声明仅为文档。
|
|
185
|
+
parent_task_id TEXT REFERENCES tasks(id),
|
|
100
186
|
created_at TEXT DEFAULT (datetime('now'))
|
|
101
187
|
);
|
|
102
188
|
|
|
@@ -110,6 +196,12 @@ CREATE TABLE IF NOT EXISTS task_events (
|
|
|
110
196
|
|
|
111
197
|
CREATE INDEX IF NOT EXISTS idx_tasks_session ON tasks(session_id);
|
|
112
198
|
CREATE INDEX IF NOT EXISTS idx_tasks_start_time ON tasks(start_time DESC);
|
|
199
|
+
CREATE INDEX IF NOT EXISTS idx_tasks_session_outcome ON tasks(session_id, outcome);
|
|
200
|
+
-- spec b1480935: drives WHERE task_kind='user' on hot paths (agent-board,
|
|
201
|
+
-- TasksHub, KPI counts). Without this every list query would full-scan tasks.
|
|
202
|
+
CREATE INDEX IF NOT EXISTS idx_tasks_kind ON tasks(task_kind);
|
|
203
|
+
-- decision f47c2c90: 向下收子 task(WHERE parent_task_id=?)的覆盖索引(外键列必建)。
|
|
204
|
+
CREATE INDEX IF NOT EXISTS idx_tasks_parent ON tasks(parent_task_id);
|
|
113
205
|
CREATE INDEX IF NOT EXISTS idx_task_events_task ON task_events(task_id);
|
|
114
206
|
CREATE INDEX IF NOT EXISTS idx_task_events_event ON task_events(event_id);
|
|
115
207
|
|
|
@@ -125,7 +217,6 @@ CREATE TABLE IF NOT EXISTS routing_events (
|
|
|
125
217
|
intent_json TEXT NOT NULL,
|
|
126
218
|
routed_to_type TEXT,
|
|
127
219
|
routed_to_name TEXT,
|
|
128
|
-
is_forced INTEGER DEFAULT 0,
|
|
129
220
|
obeyed INTEGER,
|
|
130
221
|
classification_ms INTEGER,
|
|
131
222
|
fallback_used INTEGER DEFAULT 0,
|
|
@@ -141,33 +232,27 @@ CREATE TABLE IF NOT EXISTS routing_events (
|
|
|
141
232
|
experiment_group TEXT,
|
|
142
233
|
skill_confidence REAL,
|
|
143
234
|
skill_source TEXT,
|
|
235
|
+
-- R9 (decision 1544, 2026-06-10): provenance of the routing row. NULL for
|
|
236
|
+
-- normal hook-driven events; 'programmatic' for rows minted by code paths
|
|
237
|
+
-- (not a live user-prompt → route decision). Nullable, default NULL.
|
|
238
|
+
source TEXT,
|
|
239
|
+
-- decision-flow-overhaul (2026-05-28): links a routing row to the decision
|
|
240
|
+
-- that caused the spawn. Filled by pre-tool-use handler from the magic
|
|
241
|
+
-- marker `<!-- decision-id: X -->` in the Task prompt, or via fallback.
|
|
242
|
+
decision_id TEXT,
|
|
243
|
+
-- spawn_id: unique id for this spawn attempt (future dedup / pairing use)
|
|
244
|
+
spawn_id TEXT,
|
|
144
245
|
created_at TEXT DEFAULT (datetime('now'))
|
|
145
246
|
);
|
|
146
247
|
|
|
147
248
|
CREATE INDEX IF NOT EXISTS idx_routing_events_session ON routing_events(session_id);
|
|
249
|
+
CREATE INDEX IF NOT EXISTS idx_routing_decision ON routing_events(decision_id);
|
|
148
250
|
CREATE INDEX IF NOT EXISTS idx_routing_events_route_request ON routing_events(route_request_id);
|
|
149
251
|
CREATE INDEX IF NOT EXISTS idx_routing_events_ts ON routing_events(ts DESC);
|
|
150
252
|
CREATE INDEX IF NOT EXISTS idx_routing_events_agent ON routing_events(routed_to_name, obeyed);
|
|
151
253
|
CREATE INDEX IF NOT EXISTS idx_routing_events_obeyed ON routing_events(obeyed);
|
|
152
254
|
CREATE INDEX IF NOT EXISTS idx_routing_events_experiment ON routing_events(experiment_id, experiment_group);
|
|
153
255
|
|
|
154
|
-
-- ── Token Usage ──────────────────────────────────────────────────────
|
|
155
|
-
|
|
156
|
-
CREATE TABLE IF NOT EXISTS token_usage (
|
|
157
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
158
|
-
session_id TEXT NOT NULL, -- logical ref → events.session_id; no FK due to write-order race (sessions is aggregate, may lag)
|
|
159
|
-
timestamp INTEGER NOT NULL,
|
|
160
|
-
input_tokens INTEGER NOT NULL,
|
|
161
|
-
output_tokens INTEGER NOT NULL,
|
|
162
|
-
total_tokens INTEGER NOT NULL,
|
|
163
|
-
model TEXT,
|
|
164
|
-
tool_name TEXT,
|
|
165
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
166
|
-
);
|
|
167
|
-
|
|
168
|
-
CREATE INDEX IF NOT EXISTS idx_token_usage_session ON token_usage(session_id);
|
|
169
|
-
CREATE INDEX IF NOT EXISTS idx_token_usage_timestamp ON token_usage(timestamp DESC);
|
|
170
|
-
|
|
171
256
|
-- ── Skill Invocations ─────────────────────────────────────────────────
|
|
172
257
|
|
|
173
258
|
CREATE TABLE IF NOT EXISTS skill_invocations (
|
|
@@ -186,10 +271,34 @@ CREATE TABLE IF NOT EXISTS skill_invocations (
|
|
|
186
271
|
success INTEGER DEFAULT 1,
|
|
187
272
|
error TEXT,
|
|
188
273
|
timestamp INTEGER NOT NULL,
|
|
274
|
+
-- audit #2 (decision f61b8a0c): NULLABLE marker. 1 = row was written at
|
|
275
|
+
-- UserPromptSubmit auto-MATCH/INJECT time (skill injected, NOT proven
|
|
276
|
+
-- invoked). NULL = real-call row (MCP skill_invoke / Skill tool). Lets web
|
|
277
|
+
-- metrics separate "injected" from "really invoked" without changing the
|
|
278
|
+
-- old `success` column semantics. See runColumnMigrations.
|
|
279
|
+
recorded_at_inject INTEGER,
|
|
280
|
+
-- Skill usefulness feedback (decision d24cd3a2 P0,
|
|
281
|
+
-- spec docs/design/2026-06-11/1524-skill-usefulness-feedback-spec.md):
|
|
282
|
+
-- agent POST-USE self-assessment of skill CONTENT actionability on THIS
|
|
283
|
+
-- project's task. DISTINCT from `success` (invoke didn't throw). Advisory
|
|
284
|
+
-- enum 'helped' | 'partial' | 'not-actionable' stored as free TEXT (no CHECK:
|
|
285
|
+
-- SQLite ADD COLUMN CHECK limits + forward-compat with new ratings). Nullable,
|
|
286
|
+
-- DEFAULT NULL → legacy rows untouched. usefulness_note = one-line rationale.
|
|
287
|
+
usefulness TEXT,
|
|
288
|
+
usefulness_note TEXT,
|
|
289
|
+
-- Project scope (decision 39839e30 Part 2): the project a skill pull belongs
|
|
290
|
+
-- to, so the workplace "Skill 调用" KPI can filter by project like the other
|
|
291
|
+
-- 3 KPIs do. Filled at write time (cf skill invoke → cwd/--project; MCP →
|
|
292
|
+
-- CF_PROJECT_ROOT/cwd) and historically back-filled from sessions.project_path
|
|
293
|
+
-- (join miss → stays NULL). Nullable, DEFAULT NULL → legacy rows untouched;
|
|
294
|
+
-- aggregations only add an `AND project_path = ?` clause when a project is
|
|
295
|
+
-- passed (additive, back-compat).
|
|
296
|
+
project_path TEXT,
|
|
189
297
|
created_at TEXT DEFAULT (datetime('now'))
|
|
190
298
|
);
|
|
191
299
|
|
|
192
300
|
CREATE INDEX IF NOT EXISTS idx_skill_invocations_route_request ON skill_invocations(route_request_id);
|
|
301
|
+
CREATE INDEX IF NOT EXISTS idx_skill_invocations_project ON skill_invocations(project_path);
|
|
193
302
|
CREATE INDEX IF NOT EXISTS idx_skill_invocations_session ON skill_invocations(session_id);
|
|
194
303
|
CREATE INDEX IF NOT EXISTS idx_skill_invocations_skill ON skill_invocations(skill_id);
|
|
195
304
|
CREATE INDEX IF NOT EXISTS idx_skill_invocations_timestamp ON skill_invocations(timestamp DESC);
|
|
@@ -213,6 +322,15 @@ CREATE INDEX IF NOT EXISTS idx_tasks_start_time_session ON tasks(start_time DESC
|
|
|
213
322
|
-- events: optimize session + hook_type composite queries
|
|
214
323
|
CREATE INDEX IF NOT EXISTS idx_events_session_hook ON events(session_id, hook_type, timestamp DESC);
|
|
215
324
|
|
|
325
|
+
-- events: covering index for the agent-board top_tools join (decision 7a3d07b5).
|
|
326
|
+
-- Keyed by event_id (the join key from task_events) and carrying hook_type +
|
|
327
|
+
-- tool_name so the per-row lookup satisfies `hook_type='PostToolUse' AND
|
|
328
|
+
-- tool_name IS NOT NULL` and projects tool_name WITHOUT touching the events
|
|
329
|
+
-- table. Combined with `INDEXED BY idx_task_events_task` on the task_events side,
|
|
330
|
+
-- this flips the join driver to the ~40 page tasks (narrow probe) instead of
|
|
331
|
+
-- scanning every PostToolUse row. Measured 485ms → ~10ms.
|
|
332
|
+
CREATE INDEX IF NOT EXISTS idx_events_eid_hook_tool ON events(event_id, hook_type, tool_name);
|
|
333
|
+
|
|
216
334
|
-- injections: optimize session + handler composite queries
|
|
217
335
|
CREATE INDEX IF NOT EXISTS idx_injections_session_handler ON injections(session_id, source_handler);
|
|
218
336
|
|
|
@@ -222,3 +340,229 @@ CREATE INDEX IF NOT EXISTS idx_routing_events_type_ts ON routing_events(routed_t
|
|
|
222
340
|
-- skill_invocations: optimize workflow/phase and feature_slug queries (H4 dedup: previously migration-only)
|
|
223
341
|
CREATE INDEX IF NOT EXISTS idx_skill_invocations_workflow ON skill_invocations(workflow, phase);
|
|
224
342
|
CREATE INDEX IF NOT EXISTS idx_skill_invocations_feature ON skill_invocations(feature_slug);
|
|
343
|
+
|
|
344
|
+
-- ── KB Telemetry (v9.5) ───────────────────────────────────────────────
|
|
345
|
+
-- Two append-only tables capturing knowledge-base query & build observability.
|
|
346
|
+
-- Failures writing here MUST be swallowed (fail-silent) by callers; these
|
|
347
|
+
-- tables are diagnostic and never on a request's critical path.
|
|
348
|
+
|
|
349
|
+
CREATE TABLE IF NOT EXISTS kb_query_log (
|
|
350
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
351
|
+
ts INTEGER NOT NULL,
|
|
352
|
+
project_path TEXT NOT NULL,
|
|
353
|
+
query TEXT NOT NULL,
|
|
354
|
+
result_count INTEGER NOT NULL,
|
|
355
|
+
ai_call_count INTEGER DEFAULT 0,
|
|
356
|
+
ai_input_tokens INTEGER,
|
|
357
|
+
ai_output_tokens INTEGER,
|
|
358
|
+
duration_ms INTEGER NOT NULL,
|
|
359
|
+
-- Attribution columns (decision d24cd3a2 Task B) — mirror skill_invocations.
|
|
360
|
+
-- Nullable; daemon-auto probes record source='daemon-probe', deliberate CLI/
|
|
361
|
+
-- agent pulls record source='cli' + verbatim reason, legacy rows stay NULL.
|
|
362
|
+
reason TEXT,
|
|
363
|
+
source TEXT,
|
|
364
|
+
agent_id TEXT,
|
|
365
|
+
workflow TEXT,
|
|
366
|
+
phase TEXT,
|
|
367
|
+
-- Post-use usefulness self-assessment (decision 096309e4 batch 1 item ①) —
|
|
368
|
+
-- mirrors skill_invocations.usefulness. An agent that pulled KB via
|
|
369
|
+
-- `cf knowledge query/fetch --reason` rates whether the CONTENT helped on
|
|
370
|
+
-- THIS task: 'helped' | 'partial' | 'not-actionable'. Nullable; legacy /
|
|
371
|
+
-- daemon-probe rows stay NULL (no backfill). This is the real "was KB used
|
|
372
|
+
-- AND did it help" signal — distinct from result_count (pages returned).
|
|
373
|
+
usefulness TEXT,
|
|
374
|
+
usefulness_note TEXT,
|
|
375
|
+
created_at TEXT DEFAULT (datetime('now'))
|
|
376
|
+
);
|
|
377
|
+
CREATE INDEX IF NOT EXISTS idx_kb_query_log_ts ON kb_query_log(ts DESC);
|
|
378
|
+
CREATE INDEX IF NOT EXISTS idx_kb_query_log_project ON kb_query_log(project_path);
|
|
379
|
+
CREATE INDEX IF NOT EXISTS idx_kb_query_log_source ON kb_query_log(source);
|
|
380
|
+
|
|
381
|
+
CREATE TABLE IF NOT EXISTS kb_build_log (
|
|
382
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
383
|
+
build_id TEXT NOT NULL UNIQUE,
|
|
384
|
+
ts INTEGER NOT NULL,
|
|
385
|
+
project_path TEXT NOT NULL,
|
|
386
|
+
options_json TEXT NOT NULL,
|
|
387
|
+
stats_json TEXT,
|
|
388
|
+
duration_ms INTEGER,
|
|
389
|
+
status TEXT NOT NULL CHECK(status IN ('running', 'done', 'error')),
|
|
390
|
+
error_message TEXT,
|
|
391
|
+
created_at TEXT DEFAULT (datetime('now')),
|
|
392
|
+
updated_at TEXT DEFAULT (datetime('now'))
|
|
393
|
+
);
|
|
394
|
+
CREATE INDEX IF NOT EXISTS idx_kb_build_log_ts ON kb_build_log(ts DESC);
|
|
395
|
+
CREATE INDEX IF NOT EXISTS idx_kb_build_log_project ON kb_build_log(project_path);
|
|
396
|
+
CREATE INDEX IF NOT EXISTS idx_kb_build_log_project_ts ON kb_build_log(project_path, ts DESC);
|
|
397
|
+
|
|
398
|
+
-- ── Forge Config (v9.x Phase 0) ────────────────────────────────────────
|
|
399
|
+
-- Simple KV store for runtime feature flags / tuning knobs. Lets later phases
|
|
400
|
+
-- ship behind a flag without recompilation. Default flags are seeded by the
|
|
401
|
+
-- daemon at startup (only when the key is absent — user edits are preserved).
|
|
402
|
+
|
|
403
|
+
CREATE TABLE IF NOT EXISTS forge_config (
|
|
404
|
+
key TEXT PRIMARY KEY,
|
|
405
|
+
value TEXT NOT NULL,
|
|
406
|
+
updated_at TEXT DEFAULT (datetime('now'))
|
|
407
|
+
);
|
|
408
|
+
|
|
409
|
+
-- ── Tool Intercepts (v9.x Phase 1) ─────────────────────────────────────
|
|
410
|
+
-- Records every PreToolUse decision made by the rules registry. While the
|
|
411
|
+
-- `pre_tool_intercept.enabled` flag is OFF (default), the handler still runs
|
|
412
|
+
-- in dry_run mode — rows are written with decision='dry_run' so the team can
|
|
413
|
+
-- observe rule-hit distribution before flipping the kill switch.
|
|
414
|
+
--
|
|
415
|
+
-- decision contract:
|
|
416
|
+
-- 'deny' — handler returned allow=false; tool execution blocked
|
|
417
|
+
-- 'warn' — handler returned allow=true + additionalContext hint
|
|
418
|
+
-- 'bypass' — rule matched but user supplied `forge:bypass=<reason>`
|
|
419
|
+
-- 'dry_run' — flag OFF; rule matched but never enforced (observability only)
|
|
420
|
+
--
|
|
421
|
+
-- outcome is back-filled by PostToolUse / Stop:
|
|
422
|
+
-- 'obeyed' — AI heeded the hint (e.g. switched to Agent after deny)
|
|
423
|
+
-- 'override' — AI re-invoked the same tool / pattern despite hint
|
|
424
|
+
-- 'unknown' — Stop fired without enough signal to classify
|
|
425
|
+
|
|
426
|
+
CREATE TABLE IF NOT EXISTS tool_intercepts (
|
|
427
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
428
|
+
event_id TEXT,
|
|
429
|
+
session_id TEXT NOT NULL,
|
|
430
|
+
project_path TEXT NOT NULL,
|
|
431
|
+
timestamp TEXT NOT NULL,
|
|
432
|
+
tool_name TEXT NOT NULL,
|
|
433
|
+
tool_input_summary TEXT,
|
|
434
|
+
rule_id TEXT NOT NULL,
|
|
435
|
+
decision TEXT NOT NULL CHECK(decision IN ('deny', 'warn', 'bypass', 'dry_run')),
|
|
436
|
+
hint TEXT,
|
|
437
|
+
outcome TEXT CHECK(outcome IS NULL OR outcome IN ('obeyed', 'override', 'unknown')),
|
|
438
|
+
bypass_token TEXT,
|
|
439
|
+
created_at TEXT DEFAULT (datetime('now')),
|
|
440
|
+
FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE SET NULL
|
|
441
|
+
);
|
|
442
|
+
CREATE INDEX IF NOT EXISTS idx_tool_intercepts_session ON tool_intercepts(session_id);
|
|
443
|
+
CREATE INDEX IF NOT EXISTS idx_tool_intercepts_rule ON tool_intercepts(rule_id);
|
|
444
|
+
CREATE INDEX IF NOT EXISTS idx_tool_intercepts_ts ON tool_intercepts(timestamp DESC);
|
|
445
|
+
CREATE INDEX IF NOT EXISTS idx_tool_intercepts_decision ON tool_intercepts(decision);
|
|
446
|
+
|
|
447
|
+
-- ── Workflow Recommendations — RETIRED (decision fe6f98cd, 2026-06-10) ──
|
|
448
|
+
-- Producers (workflow_classifier / skill_pairing) were deleted with spec 1200
|
|
449
|
+
-- (2026-05-28); the consumption chain (deny rule, outcome marking, C7/C8,
|
|
450
|
+
-- web display) was removed 2026-06-10. The table definition is kept so
|
|
451
|
+
-- existing DBs preserve the 262 historical rows for audit; no code reads or
|
|
452
|
+
-- writes it anymore.
|
|
453
|
+
|
|
454
|
+
CREATE TABLE IF NOT EXISTS workflow_recommendations (
|
|
455
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
456
|
+
session_id TEXT NOT NULL,
|
|
457
|
+
timestamp TEXT NOT NULL,
|
|
458
|
+
rule_id TEXT NOT NULL,
|
|
459
|
+
matched_keywords TEXT,
|
|
460
|
+
recommended_workflow TEXT NOT NULL,
|
|
461
|
+
recommended_agent_type TEXT NOT NULL,
|
|
462
|
+
reason TEXT,
|
|
463
|
+
outcome TEXT CHECK(outcome IS NULL OR outcome IN ('pending','accepted','partial_accepted','rejected','ignored','bypassed')),
|
|
464
|
+
outcome_at TEXT,
|
|
465
|
+
source TEXT DEFAULT 'workflow_classifier',
|
|
466
|
+
created_at TEXT DEFAULT (datetime('now'))
|
|
467
|
+
);
|
|
468
|
+
CREATE INDEX IF NOT EXISTS idx_workflow_rec_session ON workflow_recommendations(session_id, outcome);
|
|
469
|
+
CREATE INDEX IF NOT EXISTS idx_workflow_rec_ts ON workflow_recommendations(timestamp DESC);
|
|
470
|
+
|
|
471
|
+
-- ── Decisions — 统一批准子系统 (2026-05-28 decision-flow-overhaul; C1 ──────
|
|
472
|
+
-- convergence spec 0854, 2026-06-02) ──────────────────────────────────────
|
|
473
|
+
-- Backs TWO row families via `kind`:
|
|
474
|
+
-- kind='decision' — decision-maker lifecycle (pending → resolved | bypassed
|
|
475
|
+
-- | expired). Daemon writes a row on [DECISION HINT]; decision-maker fills
|
|
476
|
+
-- options/recommendation/risks via `cf decisions update`; user approves
|
|
477
|
+
-- via Web UI or `cf decisions approve`.
|
|
478
|
+
-- kind='spec' — externally-registered spec files (absorbed from the
|
|
479
|
+
-- retired pending_specs table). `cf decisions register --doc` writes the
|
|
480
|
+
-- row with an 8-hex approval_token; user replies bare `批准 <token>` to
|
|
481
|
+
-- short-circuit (status flips pending → resolved).
|
|
482
|
+
--
|
|
483
|
+
-- status contract:
|
|
484
|
+
-- 'advisory' — (2026-06-08 decision 93e8fff1) daemon-minted decision-hint
|
|
485
|
+
-- bookkeeping row in the advisory model (interceptor removed,
|
|
486
|
+
-- decision 7c924678). NOT a "待批准" gate — it never blocks any
|
|
487
|
+
-- tool; it just records that a hint was emitted. This is now the
|
|
488
|
+
-- DEFAULT mint status for kind='decision' rows. Still 7-day TTL
|
|
489
|
+
-- expirable and still chat/CLI-approvable (advisory → resolved).
|
|
490
|
+
-- 'pending' — hint emitted, decision-maker not yet spawned / doc not written.
|
|
491
|
+
-- For kind='spec' this is the real SpecGate approval gate; for
|
|
492
|
+
-- kind='decision' it is legacy (pre-93e8fff1 rows only).
|
|
493
|
+
-- 'resolved' — user approved the decision (approved_at is set)
|
|
494
|
+
-- 'bypassed' — main thread used bypass token / 'skip decision' keyword
|
|
495
|
+
-- 'expired' — expires_at < now and no approval received
|
|
496
|
+
|
|
497
|
+
CREATE TABLE IF NOT EXISTS decisions (
|
|
498
|
+
id TEXT PRIMARY KEY, -- 8-char short id (nanoid/uuid slice)
|
|
499
|
+
session_id TEXT NOT NULL,
|
|
500
|
+
project_path TEXT NOT NULL,
|
|
501
|
+
trigger_event_id TEXT, -- FK events.event_id (UserPromptSubmit)
|
|
502
|
+
trigger_prompt TEXT NOT NULL, -- raw user prompt (≤500 chars)
|
|
503
|
+
suggested_agent TEXT, -- intent.suggested_agent
|
|
504
|
+
status TEXT NOT NULL DEFAULT 'pending'
|
|
505
|
+
CHECK(status IN ('advisory','pending','resolved','bypassed','expired')),
|
|
506
|
+
-- Filled by decision-maker agent via `cf decisions update`:
|
|
507
|
+
options_json TEXT, -- JSON array of {name, what, pros, cons, loc, risk}
|
|
508
|
+
recommendation TEXT, -- recommended option name + rationale (≤2KB)
|
|
509
|
+
risks_json TEXT, -- JSON array of risk strings
|
|
510
|
+
open_questions_json TEXT, -- JSON array of open question strings
|
|
511
|
+
decision_doc_path TEXT, -- relative path under docs/design/
|
|
512
|
+
-- Filled by decision-maker agent (spec 1200 extension):
|
|
513
|
+
recommended_agents TEXT, -- comma-separated agent ids (e.g. 'coder,planner')
|
|
514
|
+
recommended_skills TEXT, -- comma-separated skill ids (e.g. 'safety-net,harness')
|
|
515
|
+
-- Unified approval subsystem (C1, 2026-06-02): decisions now also carries
|
|
516
|
+
-- externally-registered spec rows (kind='spec'), absorbing the retired
|
|
517
|
+
-- pending_specs table. 'decision' = daemon-minted decision-hint row;
|
|
518
|
+
-- 'spec' = a spec file registered via `cf decisions register` whose bare
|
|
519
|
+
-- `批准 <token>` short-circuits approval.
|
|
520
|
+
kind TEXT NOT NULL DEFAULT 'decision' CHECK(kind IN ('decision','spec')),
|
|
521
|
+
spec_source TEXT, -- spec-kind origin: planner/manual/decision/auto
|
|
522
|
+
spec_intent_json TEXT, -- spec-kind intent payload (承接 pending_specs.intent_json)
|
|
523
|
+
-- decision-maker optimization Batch 1.1 (decision a5d5a85b, 2026-06-02):
|
|
524
|
+
-- implementation result, INDEPENDENT of `status` (approval lifecycle).
|
|
525
|
+
-- enum success|failed|partial is enforced in app code (writeDecisionOutcome);
|
|
526
|
+
-- relaxed non-empty CHECK mirrors sessions/tasks.outcome.
|
|
527
|
+
outcome TEXT CHECK(outcome IS NULL OR length(outcome) > 0),
|
|
528
|
+
-- Approve flow:
|
|
529
|
+
approval_token TEXT,
|
|
530
|
+
approved_at TEXT,
|
|
531
|
+
approved_by TEXT, -- 'user' | 'auto-bypass'
|
|
532
|
+
-- Option B (2026-05-29 decision b95e0956) bypass-governance audit fields:
|
|
533
|
+
-- bypass_flag: 1 when the approve happened WITHOUT a decision-maker
|
|
534
|
+
-- spawn trace within ±5min (main-thread self-approve path)
|
|
535
|
+
-- bypass_reason: free-text justification supplied by `cf decisions approve --reason`
|
|
536
|
+
-- or 'via decision-maker' when auto-filled because the maker
|
|
537
|
+
-- trace exists.
|
|
538
|
+
bypass_flag INTEGER NOT NULL DEFAULT 0 CHECK(bypass_flag IN (0, 1)),
|
|
539
|
+
bypass_reason TEXT,
|
|
540
|
+
-- Audit:
|
|
541
|
+
created_at TEXT DEFAULT (datetime('now')),
|
|
542
|
+
expires_at TEXT DEFAULT (datetime('now','+7 days')),
|
|
543
|
+
resolved_at TEXT
|
|
544
|
+
);
|
|
545
|
+
|
|
546
|
+
CREATE INDEX IF NOT EXISTS idx_decisions_session ON decisions(session_id, created_at DESC);
|
|
547
|
+
CREATE INDEX IF NOT EXISTS idx_decisions_status ON decisions(status, expires_at);
|
|
548
|
+
CREATE INDEX IF NOT EXISTS idx_decisions_trigger ON decisions(trigger_event_id);
|
|
549
|
+
-- C1 (2026-06-02): spec-kind row lookups (rollup batch + listSpecsBySessionPending).
|
|
550
|
+
CREATE INDEX IF NOT EXISTS idx_decisions_kind_session ON decisions(kind, session_id, status);
|
|
551
|
+
-- C1: approval_token short-circuit lookup. Partial UNIQUE so the many
|
|
552
|
+
-- decision-kind rows with NULL approval_token never collide.
|
|
553
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_decisions_approval_token ON decisions(approval_token) WHERE approval_token IS NOT NULL;
|
|
554
|
+
|
|
555
|
+
-- ── Pending Specs — RETIRED (C1 convergence, spec 0854, 2026-06-02) ───────
|
|
556
|
+
-- The pending_specs table was a parallel "awaiting approval" subsystem. C1
|
|
557
|
+
-- folded its semantics (spec file registration + bare `批准 <token>` short-
|
|
558
|
+
-- circuit) into the decisions table (kind='spec', see above). The historical
|
|
559
|
+
-- DDL + 8-hex approve token now live on decisions.approval_token /
|
|
560
|
+
-- decision_doc_path / spec_source / spec_intent_json.
|
|
561
|
+
--
|
|
562
|
+
-- This DROP is the single delete point for the table on FRESH databases.
|
|
563
|
+
-- Existing live DBs are dropped out-of-band by an operator after the data
|
|
564
|
+
-- migration + backup (see spec 0854 Phase 4/5). Idempotent — IF EXISTS.
|
|
565
|
+
--
|
|
566
|
+
-- 关联 spec: docs/design/2026-06-02/0854-converge-pending-specs-into-decisions-C1-implementation-spec.md
|
|
567
|
+
-- migrations/011_add_pending_specs.sql history is kept untouched.
|
|
568
|
+
DROP TABLE IF EXISTS pending_specs;
|
|
@@ -14,8 +14,26 @@ export interface SessionSummary {
|
|
|
14
14
|
start_time: string;
|
|
15
15
|
end_time: string;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Extended session row that exposes the Phase 2 metric rollup columns and
|
|
19
|
+
* outcome classification. Used by the Web timeline endpoint (`/api/insights/
|
|
20
|
+
* timeline`) to render the per-session header chips without joining four
|
|
21
|
+
* tables on every request.
|
|
22
|
+
*
|
|
23
|
+
* Keeps `SessionSummary` intact (sessions list views still rely on the
|
|
24
|
+
* narrow shape) — opt-in only via getSessionWithMetrics().
|
|
25
|
+
*/
|
|
26
|
+
export interface SessionWithMetrics extends SessionSummary {
|
|
27
|
+
project_path: string | null;
|
|
28
|
+
outcome: 'success' | 'partial' | 'failed' | 'abandoned' | null;
|
|
29
|
+
outcome_reason: string | null;
|
|
30
|
+
intercept_count: number;
|
|
31
|
+
kb_inject_count: number;
|
|
32
|
+
skill_match_count: number;
|
|
33
|
+
}
|
|
17
34
|
export declare class SessionOperations {
|
|
18
35
|
private db;
|
|
36
|
+
private readonly upsertSessionStmt;
|
|
19
37
|
constructor(db: Database.Database);
|
|
20
38
|
/**
|
|
21
39
|
* 将事件聚合到 sessions 表,供 querySessions 直接读取。
|
|
@@ -33,6 +51,15 @@ export declare class SessionOperations {
|
|
|
33
51
|
* (e.g. from a hook payload or task row) — O(1) via primary key.
|
|
34
52
|
*/
|
|
35
53
|
getSession(id: string): SessionSummary | null;
|
|
54
|
+
/**
|
|
55
|
+
* Phase 3 (master roadmap §2): fetch a session row with the rollup metric
|
|
56
|
+
* columns and outcome classification attached. Used by the Web timeline
|
|
57
|
+
* endpoint header so the React page can show intercept / KB / skill chips
|
|
58
|
+
* without a second round-trip.
|
|
59
|
+
*
|
|
60
|
+
* Accepts either a full PK or a >=8 char prefix (parity with getSession).
|
|
61
|
+
*/
|
|
62
|
+
getSessionWithMetrics(idOrPrefix: string): SessionWithMetrics | null;
|
|
36
63
|
/**
|
|
37
64
|
* Look up a session by a session_id prefix. Used by web routes that accept
|
|
38
65
|
* short ids from the URL bar.
|
|
@@ -45,8 +72,46 @@ export declare class SessionOperations {
|
|
|
45
72
|
getSessionByPrefix(idPrefix: string): SessionSummary | null;
|
|
46
73
|
querySessions(filter?: {
|
|
47
74
|
project_path?: string;
|
|
75
|
+
/** LIKE %search% on first_prompt (case-insensitive via SQLite default) */
|
|
76
|
+
search?: string;
|
|
48
77
|
limit?: number;
|
|
49
78
|
}): SessionSummary[];
|
|
79
|
+
/**
|
|
80
|
+
* 写入 outcome 归因字段(v9.x outcome instrumentation)。
|
|
81
|
+
*
|
|
82
|
+
* 字段语义:
|
|
83
|
+
* - outcome: success/partial/failed/abandoned;null 表示尚未分类(不要覆盖)
|
|
84
|
+
* - outcome_reason: 自由文本,归因依据短文本(例 "commit+no_violation")
|
|
85
|
+
* - commit_count / reverted_commits / user_violation_count: 信号原值,
|
|
86
|
+
* 保留下来便于回测调参 & 在 web 上展示
|
|
87
|
+
* - classified_at: ISO timestamp of classification call
|
|
88
|
+
*
|
|
89
|
+
* 调用方:daemon Stop handler;backfill 脚本;测试。
|
|
90
|
+
* 容错:每个字段都是可选;只更新提供的字段,避免误覆盖。
|
|
91
|
+
*/
|
|
92
|
+
updateSessionOutcome(sessionId: string, updates: {
|
|
93
|
+
outcome?: 'success' | 'partial' | 'failed' | 'abandoned' | 'answered';
|
|
94
|
+
outcome_reason?: string;
|
|
95
|
+
commit_count?: number;
|
|
96
|
+
reverted_commits?: number;
|
|
97
|
+
user_violation_count?: number;
|
|
98
|
+
classified_at?: string;
|
|
99
|
+
}): void;
|
|
100
|
+
/**
|
|
101
|
+
* Phase 2 metrics rollup: 回填本 session 的三个事实表行数到 sessions 表。
|
|
102
|
+
*
|
|
103
|
+
* 调用方:Stop handler 在 classifyAndPersistOutcome 之后;这里只做写,不做
|
|
104
|
+
* 聚合逻辑(由 caller 用 facade 的 countToolInterceptsBySession /
|
|
105
|
+
* countInjectionsBySessionByHandler / countSkillInvocationsBySession 计算)。
|
|
106
|
+
*
|
|
107
|
+
* 容错:每个字段都是可选;只更新提供的字段。和 updateSessionOutcome 对称,
|
|
108
|
+
* 不重置未提供的列,避免被两个调用点互相覆盖。
|
|
109
|
+
*/
|
|
110
|
+
updateSessionMetrics(sessionId: string, updates: {
|
|
111
|
+
interceptCount?: number;
|
|
112
|
+
kbInjectCount?: number;
|
|
113
|
+
skillMatchCount?: number;
|
|
114
|
+
}): void;
|
|
50
115
|
/** Total session row count. */
|
|
51
116
|
countAllSessions(): number;
|
|
52
117
|
/** Per-day session counts (date(start_time) → count) within [since, until). */
|
|
@@ -62,10 +127,81 @@ export declare class SessionOperations {
|
|
|
62
127
|
since: string;
|
|
63
128
|
until?: string;
|
|
64
129
|
}): SessionSummary[];
|
|
130
|
+
/**
|
|
131
|
+
* Phase 9.5 idle-session sweeper input.
|
|
132
|
+
*
|
|
133
|
+
* Sessions whose `outcome` is still NULL (never reached Stop hook — abnormal
|
|
134
|
+
* exit, experimental synthetic events, etc.) AND whose effective "last
|
|
135
|
+
* activity" timestamp is older than `cutoffIso`. We use
|
|
136
|
+
* `COALESCE(last_event_time, start_time)` so sessions that never recorded a
|
|
137
|
+
* non-UserPromptSubmit event still age out by their start time.
|
|
138
|
+
*
|
|
139
|
+
* Ordered by oldest-first so under a `LIMIT` cap the worst offenders go
|
|
140
|
+
* first (defensive against backlog bursts).
|
|
141
|
+
*/
|
|
142
|
+
queryIdleUnclassifiedSessions(cutoffIso: string, limit: number): Array<{
|
|
143
|
+
session_id: string;
|
|
144
|
+
start_time: string;
|
|
145
|
+
last_event_time: string | null;
|
|
146
|
+
event_count: number | null;
|
|
147
|
+
user_violation_count: number | null;
|
|
148
|
+
}>;
|
|
65
149
|
/** Count of sessions with start_time in [since, until?). */
|
|
66
150
|
countSessionsByRange(opts: {
|
|
67
151
|
since: string;
|
|
68
152
|
until?: string;
|
|
69
153
|
}): number;
|
|
154
|
+
/**
|
|
155
|
+
* Session-centric agent board projection (v2 rewrite, 2026-05-22).
|
|
156
|
+
*
|
|
157
|
+
* Returns one row per session in [since, now] with everything a Kanban card
|
|
158
|
+
* needs to show "what actually happened in this work unit":
|
|
159
|
+
* - first user prompt (truncated)
|
|
160
|
+
* - tool usage Top-3 (PostToolUse hook_type only)
|
|
161
|
+
* - spawned subagents Top-3 (Task tool input.subagent_type)
|
|
162
|
+
* - distinct edited files count + sample (Edit / Write tool_input.file_path)
|
|
163
|
+
* - matched skills (skill_invocations)
|
|
164
|
+
* - KB injection GROUP_CONCAT (route reshapes into page list)
|
|
165
|
+
* - tool intercept decision counts (deny / warn / dry_run)
|
|
166
|
+
* - git commit Bash count (heuristic: tool_input.command LIKE '%git commit%')
|
|
167
|
+
* - session outcome + last_event_time so the route can lane-bucket
|
|
168
|
+
*
|
|
169
|
+
* Single SQL with correlated subqueries — every subquery hits a covered
|
|
170
|
+
* index (idx_events_session_hook / idx_tool_intercepts_session /
|
|
171
|
+
* idx_skill_invocations_session / idx_injections_session_handler), so the
|
|
172
|
+
* per-session fan-out is cheap. Limit-clamped 1..200.
|
|
173
|
+
*/
|
|
174
|
+
queryAgentBoardSessions(opts: {
|
|
175
|
+
windowDays: number;
|
|
176
|
+
projectPath?: string;
|
|
177
|
+
limit?: number;
|
|
178
|
+
}): AgentBoardSessionRow[];
|
|
179
|
+
}
|
|
180
|
+
/** Raw row shape returned by queryAgentBoardSessions (route layer reshapes). */
|
|
181
|
+
export interface AgentBoardSessionRow {
|
|
182
|
+
session_id: string;
|
|
183
|
+
project_path: string | null;
|
|
184
|
+
first_prompt: string | null;
|
|
185
|
+
start_time: string;
|
|
186
|
+
last_event_time: string;
|
|
187
|
+
end_time: string;
|
|
188
|
+
event_count: number | null;
|
|
189
|
+
outcome: 'success' | 'partial' | 'failed' | 'abandoned' | null;
|
|
190
|
+
outcome_reason: string | null;
|
|
191
|
+
intercept_count: number | null;
|
|
192
|
+
kb_inject_count: number | null;
|
|
193
|
+
skill_match_count: number | null;
|
|
194
|
+
commit_count: number | null;
|
|
195
|
+
user_violation_count: number | null;
|
|
196
|
+
top_tools_json: string | null;
|
|
197
|
+
spawned_json: string | null;
|
|
198
|
+
files_changed: number | null;
|
|
199
|
+
last_file: string | null;
|
|
200
|
+
bash_commit_count: number | null;
|
|
201
|
+
deny_count: number | null;
|
|
202
|
+
warn_count: number | null;
|
|
203
|
+
dryrun_count: number | null;
|
|
204
|
+
skills_json: string | null;
|
|
205
|
+
kb_meta_concat: string | null;
|
|
70
206
|
}
|
|
71
207
|
//# sourceMappingURL=sessions.d.ts.map
|