sudocode 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/package.json +8 -38
- package/build.js +0 -75
- package/node_modules/@sudocode-ai/cli/README.md +0 -330
- package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.d.ts +0 -53
- package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.js +0 -274
- package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.d.ts +0 -22
- package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.js +0 -148
- package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.d.ts +0 -45
- package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.js +0 -310
- package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.d.ts +0 -18
- package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.js +0 -61
- package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.d.ts +0 -22
- package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.js +0 -136
- package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.d.ts +0 -14
- package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.js +0 -76
- package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.d.ts +0 -17
- package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.js +0 -99
- package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.d.ts +0 -38
- package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.js +0 -321
- package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.d.ts +0 -17
- package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.js +0 -131
- package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.d.ts +0 -24
- package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.js +0 -416
- package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.d.ts +0 -12
- package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.js +0 -78
- package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli.d.ts +0 -6
- package/node_modules/@sudocode-ai/cli/dist/cli.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/cli.js +0 -426
- package/node_modules/@sudocode-ai/cli/dist/cli.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/db.d.ts +0 -21
- package/node_modules/@sudocode-ai/cli/dist/db.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/db.js +0 -54
- package/node_modules/@sudocode-ai/cli/dist/db.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/export.d.ts +0 -79
- package/node_modules/@sudocode-ai/cli/dist/export.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/export.js +0 -195
- package/node_modules/@sudocode-ai/cli/dist/export.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/filename-generator.d.ts +0 -30
- package/node_modules/@sudocode-ai/cli/dist/filename-generator.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/filename-generator.js +0 -93
- package/node_modules/@sudocode-ai/cli/dist/filename-generator.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/id-generator.d.ts +0 -26
- package/node_modules/@sudocode-ai/cli/dist/id-generator.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/id-generator.js +0 -123
- package/node_modules/@sudocode-ai/cli/dist/id-generator.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/import.d.ts +0 -118
- package/node_modules/@sudocode-ai/cli/dist/import.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/import.js +0 -608
- package/node_modules/@sudocode-ai/cli/dist/import.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/index.d.ts +0 -13
- package/node_modules/@sudocode-ai/cli/dist/index.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/index.js +0 -13
- package/node_modules/@sudocode-ai/cli/dist/index.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/jsonl.d.ts +0 -69
- package/node_modules/@sudocode-ai/cli/dist/jsonl.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/jsonl.js +0 -333
- package/node_modules/@sudocode-ai/cli/dist/jsonl.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/markdown.d.ts +0 -146
- package/node_modules/@sudocode-ai/cli/dist/markdown.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/markdown.js +0 -357
- package/node_modules/@sudocode-ai/cli/dist/markdown.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/migrations.d.ts +0 -23
- package/node_modules/@sudocode-ai/cli/dist/migrations.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/migrations.js +0 -57
- package/node_modules/@sudocode-ai/cli/dist/migrations.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/events.d.ts +0 -53
- package/node_modules/@sudocode-ai/cli/dist/operations/events.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/events.js +0 -108
- package/node_modules/@sudocode-ai/cli/dist/operations/events.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.d.ts +0 -92
- package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.js +0 -444
- package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/feedback.d.ts +0 -76
- package/node_modules/@sudocode-ai/cli/dist/operations/feedback.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/feedback.js +0 -234
- package/node_modules/@sudocode-ai/cli/dist/operations/feedback.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/index.d.ts +0 -10
- package/node_modules/@sudocode-ai/cli/dist/operations/index.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/index.js +0 -10
- package/node_modules/@sudocode-ai/cli/dist/operations/index.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/issues.d.ts +0 -82
- package/node_modules/@sudocode-ai/cli/dist/operations/issues.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/issues.js +0 -411
- package/node_modules/@sudocode-ai/cli/dist/operations/issues.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/references.d.ts +0 -34
- package/node_modules/@sudocode-ai/cli/dist/operations/references.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/references.js +0 -117
- package/node_modules/@sudocode-ai/cli/dist/operations/references.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/relationships.d.ts +0 -57
- package/node_modules/@sudocode-ai/cli/dist/operations/relationships.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/relationships.js +0 -236
- package/node_modules/@sudocode-ai/cli/dist/operations/relationships.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/specs.d.ts +0 -64
- package/node_modules/@sudocode-ai/cli/dist/operations/specs.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/specs.js +0 -290
- package/node_modules/@sudocode-ai/cli/dist/operations/specs.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/tags.d.ts +0 -42
- package/node_modules/@sudocode-ai/cli/dist/operations/tags.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/tags.js +0 -127
- package/node_modules/@sudocode-ai/cli/dist/operations/tags.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/transactions.d.ts +0 -41
- package/node_modules/@sudocode-ai/cli/dist/operations/transactions.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/operations/transactions.js +0 -111
- package/node_modules/@sudocode-ai/cli/dist/operations/transactions.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/sync.d.ts +0 -47
- package/node_modules/@sudocode-ai/cli/dist/sync.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/sync.js +0 -442
- package/node_modules/@sudocode-ai/cli/dist/sync.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/test-schema.d.ts +0 -5
- package/node_modules/@sudocode-ai/cli/dist/test-schema.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/test-schema.js +0 -46
- package/node_modules/@sudocode-ai/cli/dist/test-schema.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/types.d.ts +0 -7
- package/node_modules/@sudocode-ai/cli/dist/types.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/types.js +0 -7
- package/node_modules/@sudocode-ai/cli/dist/types.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/update-checker.d.ts +0 -24
- package/node_modules/@sudocode-ai/cli/dist/update-checker.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/update-checker.js +0 -151
- package/node_modules/@sudocode-ai/cli/dist/update-checker.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/version.d.ts +0 -12
- package/node_modules/@sudocode-ai/cli/dist/version.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/version.js +0 -23
- package/node_modules/@sudocode-ai/cli/dist/version.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/watcher.d.ts +0 -63
- package/node_modules/@sudocode-ai/cli/dist/watcher.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/cli/dist/watcher.js +0 -438
- package/node_modules/@sudocode-ai/cli/dist/watcher.js.map +0 -1
- package/node_modules/@sudocode-ai/cli/package.json +0 -65
- package/node_modules/@sudocode-ai/local-server/README.md +0 -19
- package/node_modules/@sudocode-ai/local-server/dist/cli.d.ts +0 -7
- package/node_modules/@sudocode-ai/local-server/dist/cli.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/cli.js +0 -7
- package/node_modules/@sudocode-ai/local-server/dist/cli.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/engine.d.ts +0 -103
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/engine.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/engine.js +0 -10
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/engine.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/simple-engine.d.ts +0 -190
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/simple-engine.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/simple-engine.js +0 -611
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/simple-engine.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/types.d.ts +0 -116
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/types.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/types.js +0 -10
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/types.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-adapter.d.ts +0 -176
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-adapter.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-adapter.js +0 -438
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-adapter.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-integration.d.ts +0 -96
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-integration.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-integration.js +0 -96
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-integration.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/claude-code-output-processor.d.ts +0 -321
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/claude-code-output-processor.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/claude-code-output-processor.js +0 -769
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/claude-code-output-processor.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.d.ts +0 -18
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.js +0 -15
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.d.ts +0 -421
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.js +0 -22
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.d.ts +0 -86
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.js +0 -59
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/index.d.ts +0 -15
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/index.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/index.js +0 -15
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/index.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/manager.d.ts +0 -133
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/manager.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/manager.js +0 -10
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/manager.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/simple-manager.d.ts +0 -102
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/simple-manager.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/simple-manager.js +0 -336
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/simple-manager.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/types.d.ts +0 -105
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/types.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/types.js +0 -10
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/types.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/utils.d.ts +0 -53
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/utils.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/utils.js +0 -97
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/utils.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/circuit-breaker.d.ts +0 -170
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/circuit-breaker.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/circuit-breaker.js +0 -291
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/circuit-breaker.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/executor.d.ts +0 -109
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/executor.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/executor.js +0 -10
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/executor.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/index.d.ts +0 -14
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/index.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/index.js +0 -15
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/index.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/resilient-executor.d.ts +0 -86
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/resilient-executor.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/resilient-executor.js +0 -261
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/resilient-executor.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/retry.d.ts +0 -161
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/retry.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/retry.js +0 -234
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/retry.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/types.d.ts +0 -226
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/types.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/types.js +0 -30
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/types.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/event-buffer.d.ts +0 -119
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/event-buffer.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/event-buffer.js +0 -208
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/event-buffer.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/index.d.ts +0 -10
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/index.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/index.js +0 -10
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/index.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.d.ts +0 -146
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.js +0 -282
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.d.ts +0 -176
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.js +0 -231
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/index.d.ts +0 -13
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/index.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/index.js +0 -13
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/index.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/linear-orchestrator.d.ts +0 -216
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/linear-orchestrator.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/linear-orchestrator.js +0 -683
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/linear-orchestrator.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/memory-storage.d.ts +0 -54
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/memory-storage.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/memory-storage.js +0 -68
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/memory-storage.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/orchestrator.d.ts +0 -158
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/orchestrator.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/orchestrator.js +0 -9
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/orchestrator.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/types.d.ts +0 -172
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/types.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/types.js +0 -9
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/types.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/utils.d.ts +0 -89
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/utils.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/utils.js +0 -152
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/utils.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.d.ts +0 -74
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.js +0 -280
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.d.ts +0 -151
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.js +0 -189
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.d.ts +0 -16
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.js +0 -15
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.d.ts +0 -184
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.js +0 -452
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.d.ts +0 -90
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.js +0 -42
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/index.d.ts +0 -8
- package/node_modules/@sudocode-ai/local-server/dist/index.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/index.js +0 -356
- package/node_modules/@sudocode-ai/local-server/dist/index.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/public/assets/index-C4SmlXoo.js +0 -568
- package/node_modules/@sudocode-ai/local-server/dist/public/assets/index-C4SmlXoo.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/public/assets/index-DE59j7ti.css +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/public/assets/react-vendor-LX0UoTxg.js +0 -60
- package/node_modules/@sudocode-ai/local-server/dist/public/assets/react-vendor-LX0UoTxg.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/public/assets/ui-vendor-_cxVHaqZ.js +0 -54
- package/node_modules/@sudocode-ai/local-server/dist/public/assets/ui-vendor-_cxVHaqZ.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/public/favicon.ico +0 -0
- package/node_modules/@sudocode-ai/local-server/dist/public/index.html +0 -16
- package/node_modules/@sudocode-ai/local-server/dist/public/logo.png +0 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/executions-stream.d.ts +0 -24
- package/node_modules/@sudocode-ai/local-server/dist/routes/executions-stream.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/routes/executions-stream.js +0 -55
- package/node_modules/@sudocode-ai/local-server/dist/routes/executions-stream.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/routes/executions.d.ts +0 -19
- package/node_modules/@sudocode-ai/local-server/dist/routes/executions.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/routes/executions.js +0 -267
- package/node_modules/@sudocode-ai/local-server/dist/routes/executions.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.d.ts +0 -7
- package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.js +0 -329
- package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/routes/issues.d.ts +0 -7
- package/node_modules/@sudocode-ai/local-server/dist/routes/issues.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/routes/issues.js +0 -280
- package/node_modules/@sudocode-ai/local-server/dist/routes/issues.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.d.ts +0 -7
- package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.js +0 -308
- package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/routes/specs.d.ts +0 -7
- package/node_modules/@sudocode-ai/local-server/dist/routes/specs.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/routes/specs.js +0 -270
- package/node_modules/@sudocode-ai/local-server/dist/routes/specs.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/db.d.ts +0 -33
- package/node_modules/@sudocode-ai/local-server/dist/services/db.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/db.js +0 -85
- package/node_modules/@sudocode-ai/local-server/dist/services/db.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.d.ts +0 -108
- package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.js +0 -286
- package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.d.ts +0 -185
- package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.js +0 -676
- package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/executions.d.ts +0 -59
- package/node_modules/@sudocode-ai/local-server/dist/services/executions.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/executions.js +0 -164
- package/node_modules/@sudocode-ai/local-server/dist/services/executions.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/export.d.ts +0 -24
- package/node_modules/@sudocode-ai/local-server/dist/services/export.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/export.js +0 -106
- package/node_modules/@sudocode-ai/local-server/dist/services/export.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/feedback.d.ts +0 -40
- package/node_modules/@sudocode-ai/local-server/dist/services/feedback.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/feedback.js +0 -54
- package/node_modules/@sudocode-ai/local-server/dist/services/feedback.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/issues.d.ts +0 -27
- package/node_modules/@sudocode-ai/local-server/dist/services/issues.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/issues.js +0 -35
- package/node_modules/@sudocode-ai/local-server/dist/services/issues.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.d.ts +0 -108
- package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.js +0 -212
- package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.d.ts +0 -97
- package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.js +0 -236
- package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/relationships.d.ts +0 -35
- package/node_modules/@sudocode-ai/local-server/dist/services/relationships.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/relationships.js +0 -42
- package/node_modules/@sudocode-ai/local-server/dist/services/relationships.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/specs.d.ts +0 -27
- package/node_modules/@sudocode-ai/local-server/dist/services/specs.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/specs.js +0 -35
- package/node_modules/@sudocode-ai/local-server/dist/services/specs.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/watcher.d.ts +0 -50
- package/node_modules/@sudocode-ai/local-server/dist/services/watcher.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/watcher.js +0 -69
- package/node_modules/@sudocode-ai/local-server/dist/services/watcher.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/websocket.d.ts +0 -127
- package/node_modules/@sudocode-ai/local-server/dist/services/websocket.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/services/websocket.js +0 -389
- package/node_modules/@sudocode-ai/local-server/dist/services/websocket.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.d.ts +0 -6
- package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.js +0 -9
- package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.js.map +0 -1
- package/node_modules/@sudocode-ai/local-server/package.json +0 -72
- package/node_modules/@sudocode-ai/mcp/LICENSE +0 -21
- package/node_modules/@sudocode-ai/mcp/README.md +0 -226
- package/node_modules/@sudocode-ai/mcp/dist/client.d.ts +0 -33
- package/node_modules/@sudocode-ai/mcp/dist/client.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/client.js +0 -159
- package/node_modules/@sudocode-ai/mcp/dist/client.js.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/index.d.ts +0 -6
- package/node_modules/@sudocode-ai/mcp/dist/index.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/index.js +0 -64
- package/node_modules/@sudocode-ai/mcp/dist/index.js.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/server.d.ts +0 -26
- package/node_modules/@sudocode-ai/mcp/dist/server.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/server.js +0 -575
- package/node_modules/@sudocode-ai/mcp/dist/server.js.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.d.ts +0 -41
- package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.js +0 -21
- package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.js.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.d.ts +0 -19
- package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.js +0 -24
- package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.js.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/tools/init.d.ts +0 -17
- package/node_modules/@sudocode-ai/mcp/dist/tools/init.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/tools/init.js +0 -15
- package/node_modules/@sudocode-ai/mcp/dist/tools/init.js.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/tools/issues.d.ts +0 -44
- package/node_modules/@sudocode-ai/mcp/dist/tools/issues.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/tools/issues.js +0 -106
- package/node_modules/@sudocode-ai/mcp/dist/tools/issues.js.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/tools/references.d.ts +0 -21
- package/node_modules/@sudocode-ai/mcp/dist/tools/references.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/tools/references.js +0 -49
- package/node_modules/@sudocode-ai/mcp/dist/tools/references.js.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.d.ts +0 -15
- package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.js +0 -18
- package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.js.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/tools/specs.d.ts +0 -35
- package/node_modules/@sudocode-ai/mcp/dist/tools/specs.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/tools/specs.js +0 -85
- package/node_modules/@sudocode-ai/mcp/dist/tools/specs.js.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/types.d.ts +0 -35
- package/node_modules/@sudocode-ai/mcp/dist/types.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/mcp/dist/types.js +0 -21
- package/node_modules/@sudocode-ai/mcp/dist/types.js.map +0 -1
- package/node_modules/@sudocode-ai/mcp/package.json +0 -67
- package/node_modules/@sudocode-ai/types/README.md +0 -7
- package/node_modules/@sudocode-ai/types/dist/schema.d.ts +0 -45
- package/node_modules/@sudocode-ai/types/dist/schema.d.ts.map +0 -1
- package/node_modules/@sudocode-ai/types/dist/schema.js +0 -338
- package/node_modules/@sudocode-ai/types/dist/schema.js.map +0 -1
- package/node_modules/@sudocode-ai/types/package.json +0 -46
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Operations for Relationships
|
|
3
|
-
*/
|
|
4
|
-
import { getIssue } from "./issues.js";
|
|
5
|
-
/**
|
|
6
|
-
* Add a relationship between entities
|
|
7
|
-
*/
|
|
8
|
-
export function addRelationship(db, input) {
|
|
9
|
-
// Check if from_id exists and get from_uuid
|
|
10
|
-
const fromTable = input.from_type === "spec" ? "specs" : "issues";
|
|
11
|
-
const fromEntity = db
|
|
12
|
-
.prepare(`SELECT id, uuid FROM ${fromTable} WHERE id = ?`)
|
|
13
|
-
.get(input.from_id);
|
|
14
|
-
if (!fromEntity) {
|
|
15
|
-
throw new Error(`${input.from_type === "spec" ? "Spec" : "Issue"} not found: ${input.from_id}`);
|
|
16
|
-
}
|
|
17
|
-
// Check if to_id exists and get to_uuid
|
|
18
|
-
const toTable = input.to_type === "spec" ? "specs" : "issues";
|
|
19
|
-
const toEntity = db
|
|
20
|
-
.prepare(`SELECT id, uuid FROM ${toTable} WHERE id = ?`)
|
|
21
|
-
.get(input.to_id);
|
|
22
|
-
if (!toEntity) {
|
|
23
|
-
throw new Error(`${input.to_type === "spec" ? "Spec" : "Issue"} not found: ${input.to_id}`);
|
|
24
|
-
}
|
|
25
|
-
// Check if relationship already exists
|
|
26
|
-
const existing = getRelationship(db, input.from_id, input.from_type, input.to_id, input.to_type, input.relationship_type);
|
|
27
|
-
if (existing) {
|
|
28
|
-
return existing;
|
|
29
|
-
}
|
|
30
|
-
const stmt = db.prepare(`
|
|
31
|
-
INSERT INTO relationships (
|
|
32
|
-
from_id, from_uuid, from_type, to_id, to_uuid, to_type, relationship_type, metadata
|
|
33
|
-
) VALUES (
|
|
34
|
-
@from_id, @from_uuid, @from_type, @to_id, @to_uuid, @to_type, @relationship_type, @metadata
|
|
35
|
-
)
|
|
36
|
-
`);
|
|
37
|
-
try {
|
|
38
|
-
stmt.run({
|
|
39
|
-
from_id: input.from_id,
|
|
40
|
-
from_uuid: fromEntity.uuid,
|
|
41
|
-
from_type: input.from_type,
|
|
42
|
-
to_id: input.to_id,
|
|
43
|
-
to_uuid: toEntity.uuid,
|
|
44
|
-
to_type: input.to_type,
|
|
45
|
-
relationship_type: input.relationship_type,
|
|
46
|
-
metadata: input.metadata ?? null,
|
|
47
|
-
});
|
|
48
|
-
const rel = getRelationship(db, input.from_id, input.from_type, input.to_id, input.to_type, input.relationship_type);
|
|
49
|
-
if (!rel) {
|
|
50
|
-
throw new Error("Failed to create relationship");
|
|
51
|
-
}
|
|
52
|
-
// Auto-update blocked status when adding a 'blocks' relationship
|
|
53
|
-
if (input.relationship_type === "blocks" &&
|
|
54
|
-
input.from_type === "issue" &&
|
|
55
|
-
input.to_type === "issue") {
|
|
56
|
-
autoUpdateBlockedStatusOnAdd(db, input.from_id, input.to_id);
|
|
57
|
-
}
|
|
58
|
-
return rel;
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
if (error.code && error.code.startsWith("SQLITE_CONSTRAINT")) {
|
|
62
|
-
throw new Error(`Relationship already exists: ${input.from_id} (${input.from_type}) --[${input.relationship_type}]--> ${input.to_id} (${input.to_type})`);
|
|
63
|
-
}
|
|
64
|
-
throw error;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Auto-update blocked status when adding a 'blocks' relationship
|
|
69
|
-
*/
|
|
70
|
-
function autoUpdateBlockedStatusOnAdd(db, blockedIssueId, blockerIssueId) {
|
|
71
|
-
const blockerIssue = getIssue(db, blockerIssueId);
|
|
72
|
-
// Only set to 'blocked' if the blocker is not closed
|
|
73
|
-
if (blockerIssue && blockerIssue.status !== "closed") {
|
|
74
|
-
const blockedIssue = getIssue(db, blockedIssueId);
|
|
75
|
-
// Only update if currently open or in_progress (don't override other statuses)
|
|
76
|
-
if (blockedIssue &&
|
|
77
|
-
(blockedIssue.status === "open" || blockedIssue.status === "in_progress")) {
|
|
78
|
-
const updateStmt = db.prepare(`
|
|
79
|
-
UPDATE issues
|
|
80
|
-
SET status = 'blocked', updated_at = CURRENT_TIMESTAMP
|
|
81
|
-
WHERE id = ?
|
|
82
|
-
`);
|
|
83
|
-
updateStmt.run(blockedIssueId);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Get a specific relationship
|
|
89
|
-
*/
|
|
90
|
-
export function getRelationship(db, from_id, from_type, to_id, to_type, relationship_type) {
|
|
91
|
-
const stmt = db.prepare(`
|
|
92
|
-
SELECT * FROM relationships
|
|
93
|
-
WHERE from_id = ? AND from_type = ?
|
|
94
|
-
AND to_id = ? AND to_type = ?
|
|
95
|
-
AND relationship_type = ?
|
|
96
|
-
`);
|
|
97
|
-
return (stmt.get(from_id, from_type, to_id, to_type, relationship_type) ?? null);
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Remove a relationship
|
|
101
|
-
*/
|
|
102
|
-
export function removeRelationship(db, from_id, from_type, to_id, to_type, relationship_type) {
|
|
103
|
-
const stmt = db.prepare(`
|
|
104
|
-
DELETE FROM relationships
|
|
105
|
-
WHERE from_id = ? AND from_type = ?
|
|
106
|
-
AND to_id = ? AND to_type = ?
|
|
107
|
-
AND relationship_type = ?
|
|
108
|
-
`);
|
|
109
|
-
const result = stmt.run(from_id, from_type, to_id, to_type, relationship_type);
|
|
110
|
-
const removed = result.changes > 0;
|
|
111
|
-
// Auto-update blocked status when removing a 'blocks' relationship
|
|
112
|
-
if (removed &&
|
|
113
|
-
relationship_type === "blocks" &&
|
|
114
|
-
from_type === "issue" &&
|
|
115
|
-
to_type === "issue") {
|
|
116
|
-
autoUpdateBlockedStatusOnRemove(db, from_id);
|
|
117
|
-
}
|
|
118
|
-
return removed;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Auto-update blocked status when removing a 'blocks' relationship
|
|
122
|
-
*/
|
|
123
|
-
function autoUpdateBlockedStatusOnRemove(db, blockedIssueId) {
|
|
124
|
-
const blockedIssue = getIssue(db, blockedIssueId);
|
|
125
|
-
// Only unblock if currently blocked
|
|
126
|
-
if (blockedIssue && blockedIssue.status === "blocked") {
|
|
127
|
-
// Check if there are any other open blockers
|
|
128
|
-
const hasOtherBlockers = hasOpenBlockers(db, blockedIssueId);
|
|
129
|
-
// If no other blockers, unblock the issue
|
|
130
|
-
if (!hasOtherBlockers) {
|
|
131
|
-
const updateStmt = db.prepare(`
|
|
132
|
-
UPDATE issues
|
|
133
|
-
SET status = 'open', updated_at = CURRENT_TIMESTAMP
|
|
134
|
-
WHERE id = ?
|
|
135
|
-
`);
|
|
136
|
-
updateStmt.run(blockedIssueId);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Check if an issue has any open blockers
|
|
142
|
-
*/
|
|
143
|
-
function hasOpenBlockers(db, issueId) {
|
|
144
|
-
const stmt = db.prepare(`
|
|
145
|
-
SELECT COUNT(*) as count
|
|
146
|
-
FROM relationships r
|
|
147
|
-
JOIN issues blocker ON r.to_id = blocker.id AND r.to_type = 'issue'
|
|
148
|
-
WHERE r.from_id = ?
|
|
149
|
-
AND r.from_type = 'issue'
|
|
150
|
-
AND r.relationship_type = 'blocks'
|
|
151
|
-
AND blocker.status IN ('open', 'in_progress', 'blocked')
|
|
152
|
-
`);
|
|
153
|
-
const result = stmt.get(issueId);
|
|
154
|
-
return result.count > 0;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Get all outgoing relationships from an entity
|
|
158
|
-
*/
|
|
159
|
-
export function getOutgoingRelationships(db, entity_id, entity_type, relationship_type) {
|
|
160
|
-
let query = `
|
|
161
|
-
SELECT * FROM relationships
|
|
162
|
-
WHERE from_id = @entity_id AND from_type = @entity_type
|
|
163
|
-
`;
|
|
164
|
-
const params = {
|
|
165
|
-
entity_id,
|
|
166
|
-
entity_type,
|
|
167
|
-
};
|
|
168
|
-
if (relationship_type !== undefined) {
|
|
169
|
-
query += " AND relationship_type = @relationship_type";
|
|
170
|
-
params.relationship_type = relationship_type;
|
|
171
|
-
}
|
|
172
|
-
query += " ORDER BY created_at DESC";
|
|
173
|
-
const stmt = db.prepare(query);
|
|
174
|
-
return stmt.all(params);
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Get all incoming relationships to an entity
|
|
178
|
-
*/
|
|
179
|
-
export function getIncomingRelationships(db, entity_id, entity_type, relationship_type) {
|
|
180
|
-
let query = `
|
|
181
|
-
SELECT * FROM relationships
|
|
182
|
-
WHERE to_id = @entity_id AND to_type = @entity_type
|
|
183
|
-
`;
|
|
184
|
-
const params = {
|
|
185
|
-
entity_id,
|
|
186
|
-
entity_type,
|
|
187
|
-
};
|
|
188
|
-
if (relationship_type !== undefined) {
|
|
189
|
-
query += " AND relationship_type = @relationship_type";
|
|
190
|
-
params.relationship_type = relationship_type;
|
|
191
|
-
}
|
|
192
|
-
query += " ORDER BY created_at DESC";
|
|
193
|
-
const stmt = db.prepare(query);
|
|
194
|
-
return stmt.all(params);
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Get all dependencies (what this entity depends on - things that block it)
|
|
198
|
-
*/
|
|
199
|
-
export function getDependencies(db, entity_id, entity_type) {
|
|
200
|
-
return getOutgoingRelationships(db, entity_id, entity_type, "blocks");
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Get all dependents (what depends on this entity - things it blocks)
|
|
204
|
-
*/
|
|
205
|
-
export function getDependents(db, entity_id, entity_type) {
|
|
206
|
-
return getIncomingRelationships(db, entity_id, entity_type, "blocks");
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Get all relationships for an entity (both incoming and outgoing)
|
|
210
|
-
*/
|
|
211
|
-
export function getAllRelationships(db, entity_id, entity_type) {
|
|
212
|
-
return {
|
|
213
|
-
outgoing: getOutgoingRelationships(db, entity_id, entity_type),
|
|
214
|
-
incoming: getIncomingRelationships(db, entity_id, entity_type),
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Check if a relationship exists
|
|
219
|
-
*/
|
|
220
|
-
export function relationshipExists(db, from_id, from_type, to_id, to_type, relationship_type) {
|
|
221
|
-
const rel = getRelationship(db, from_id, from_type, to_id, to_type, relationship_type);
|
|
222
|
-
return rel !== null;
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Remove all relationships for an entity
|
|
226
|
-
*/
|
|
227
|
-
export function removeAllRelationships(db, entity_id, entity_type) {
|
|
228
|
-
const stmt = db.prepare(`
|
|
229
|
-
DELETE FROM relationships
|
|
230
|
-
WHERE (from_id = ? AND from_type = ?)
|
|
231
|
-
OR (to_id = ? AND to_type = ?)
|
|
232
|
-
`);
|
|
233
|
-
const result = stmt.run(entity_id, entity_type, entity_id, entity_type);
|
|
234
|
-
return result.changes;
|
|
235
|
-
}
|
|
236
|
-
//# sourceMappingURL=relationships.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"relationships.js","sourceRoot":"","sources":["../../src/operations/relationships.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAWvC;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,EAAqB,EACrB,KAA8B;IAE9B,4CAA4C;IAC5C,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC;IAClE,MAAM,UAAU,GAAG,EAAE;SAClB,OAAO,CAAC,wBAAwB,SAAS,eAAe,CAAC;SACzD,GAAG,CAAC,KAAK,CAAC,OAAO,CAA6C,CAAC;IAClE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACb,GAAG,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,eAAe,KAAK,CAAC,OAAO,EAAE,CAC/E,CAAC;IACJ,CAAC;IAED,wCAAwC;IACxC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC9D,MAAM,QAAQ,GAAG,EAAE;SAChB,OAAO,CAAC,wBAAwB,OAAO,eAAe,CAAC;SACvD,GAAG,CAAC,KAAK,CAAC,KAAK,CAA6C,CAAC;IAChE,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CACb,GAAG,KAAK,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,eAAe,KAAK,CAAC,KAAK,EAAE,CAC3E,CAAC;IACJ,CAAC;IAED,uCAAuC;IACvC,MAAM,Q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WAAW,EAAE,QAAQ,CAAC,CAAC;AACxE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,EAAqB,EACrB,SAAiB,EACjB,WAAuB;IAEvB,OAAO,wBAAwB,CAAC,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;AACxE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,EAAqB,EACrB,SAAiB,EACjB,WAAuB;IAEvB,OAAO;QACL,QAAQ,EAAE,wBAAwB,CAAC,EAAE,EAAE,SAAS,EAAE,WAAW,CAAC;QAC9D,QAAQ,EAAE,wBAAwB,CAAC,EAAE,EAAE,SAAS,EAAE,WAAW,CAAC;KAC/D,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,EAAqB,EACrB,OAAe,EACf,SAAqB,EACrB,KAAa,EACb,OAAmB,EACnB,iBAAmC;IAEnC,MAAM,GAAG,GAAG,eAAe,CACzB,EAAE,EACF,OAAO,EACP,SAAS,EACT,KAAK,EACL,OAAO,EACP,iBAAiB,CAClB,CAAC;IACF,OAAO,GAAG,KAAK,IAAI,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,EAAqB,EACrB,SAAiB,EACjB,WAAuB;IAEvB,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC;;;;GAIvB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IACxE,OAAO,MAAM,CAAC,OAAO,CAAC;AACxB,CAAC"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CRUD operations for Specs
|
|
3
|
-
*/
|
|
4
|
-
import type Database from "better-sqlite3";
|
|
5
|
-
import type { Spec } from "../types.js";
|
|
6
|
-
export interface CreateSpecInput {
|
|
7
|
-
id: string;
|
|
8
|
-
uuid?: string;
|
|
9
|
-
title: string;
|
|
10
|
-
file_path: string;
|
|
11
|
-
content?: string;
|
|
12
|
-
priority?: number;
|
|
13
|
-
parent_id?: string;
|
|
14
|
-
archived?: boolean;
|
|
15
|
-
archived_at?: string;
|
|
16
|
-
created_at?: string;
|
|
17
|
-
updated_at?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface UpdateSpecInput {
|
|
20
|
-
title?: string;
|
|
21
|
-
file_path?: string;
|
|
22
|
-
content?: string;
|
|
23
|
-
priority?: number;
|
|
24
|
-
parent_id?: string;
|
|
25
|
-
archived?: boolean;
|
|
26
|
-
archived_at?: string;
|
|
27
|
-
updated_at?: string;
|
|
28
|
-
}
|
|
29
|
-
export interface ListSpecsOptions {
|
|
30
|
-
priority?: number;
|
|
31
|
-
parent_id?: string;
|
|
32
|
-
archived?: boolean;
|
|
33
|
-
limit?: number;
|
|
34
|
-
offset?: number;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Create a new spec
|
|
38
|
-
*/
|
|
39
|
-
export declare function createSpec(db: Database.Database, input: CreateSpecInput): Spec;
|
|
40
|
-
/**
|
|
41
|
-
* Get a spec by ID
|
|
42
|
-
*/
|
|
43
|
-
export declare function getSpec(db: Database.Database, id: string): Spec | null;
|
|
44
|
-
/**
|
|
45
|
-
* Get a spec by file path
|
|
46
|
-
*/
|
|
47
|
-
export declare function getSpecByFilePath(db: Database.Database, filePath: string): Spec | null;
|
|
48
|
-
/**
|
|
49
|
-
* Update a spec
|
|
50
|
-
*/
|
|
51
|
-
export declare function updateSpec(db: Database.Database, id: string, input: UpdateSpecInput): Spec;
|
|
52
|
-
/**
|
|
53
|
-
* Delete a spec
|
|
54
|
-
*/
|
|
55
|
-
export declare function deleteSpec(db: Database.Database, id: string): boolean;
|
|
56
|
-
/**
|
|
57
|
-
* List specs with optional filters
|
|
58
|
-
*/
|
|
59
|
-
export declare function listSpecs(db: Database.Database, options?: ListSpecsOptions): Spec[];
|
|
60
|
-
/**
|
|
61
|
-
* Search specs by title or content
|
|
62
|
-
*/
|
|
63
|
-
export declare function searchSpecs(db: Database.Database, query: string, options?: Omit<ListSpecsOptions, "offset">): Spec[];
|
|
64
|
-
//# sourceMappingURL=specs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../src/operations/specs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,KAAK,EAAE,eAAe,GACrB,IAAI,CA2GN;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAMtE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,QAAQ,EAAE,MAAM,GACf,IAAI,GAAG,IAAI,CAMb;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,eAAe,GACrB,IAAI,CA6FN;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAIrE;AAED;;GAEG;AACH,wBAAgB,SAAS,CACvB,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,OAAO,GAAE,gBAAqB,GAC7B,IAAI,EAAE,CAkCR;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAM,GAC7C,IAAI,EAAE,CA4BR"}
|
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CRUD operations for Specs
|
|
3
|
-
*/
|
|
4
|
-
import { generateUUID } from "../id-generator.js";
|
|
5
|
-
/**
|
|
6
|
-
* Create a new spec
|
|
7
|
-
*/
|
|
8
|
-
export function createSpec(db, input) {
|
|
9
|
-
// Validate parent_id exists if provided and get parent_uuid
|
|
10
|
-
let parent_uuid = null;
|
|
11
|
-
if (input.parent_id) {
|
|
12
|
-
const parent = getSpec(db, input.parent_id);
|
|
13
|
-
if (!parent) {
|
|
14
|
-
throw new Error(`Parent spec not found: ${input.parent_id}`);
|
|
15
|
-
}
|
|
16
|
-
parent_uuid = parent.uuid;
|
|
17
|
-
}
|
|
18
|
-
const uuid = input.uuid || generateUUID();
|
|
19
|
-
// Build INSERT statement with optional timestamp fields
|
|
20
|
-
const columns = [
|
|
21
|
-
"id",
|
|
22
|
-
"uuid",
|
|
23
|
-
"title",
|
|
24
|
-
"file_path",
|
|
25
|
-
"content",
|
|
26
|
-
"priority",
|
|
27
|
-
"parent_id",
|
|
28
|
-
"parent_uuid",
|
|
29
|
-
"archived",
|
|
30
|
-
];
|
|
31
|
-
const values = [
|
|
32
|
-
"@id",
|
|
33
|
-
"@uuid",
|
|
34
|
-
"@title",
|
|
35
|
-
"@file_path",
|
|
36
|
-
"@content",
|
|
37
|
-
"@priority",
|
|
38
|
-
"@parent_id",
|
|
39
|
-
"@parent_uuid",
|
|
40
|
-
"@archived",
|
|
41
|
-
];
|
|
42
|
-
if (input.created_at) {
|
|
43
|
-
columns.push("created_at");
|
|
44
|
-
values.push("@created_at");
|
|
45
|
-
}
|
|
46
|
-
if (input.updated_at) {
|
|
47
|
-
columns.push("updated_at");
|
|
48
|
-
values.push("@updated_at");
|
|
49
|
-
}
|
|
50
|
-
if (input.archived_at !== undefined) {
|
|
51
|
-
columns.push("archived_at");
|
|
52
|
-
values.push("@archived_at");
|
|
53
|
-
}
|
|
54
|
-
const stmt = db.prepare(`
|
|
55
|
-
INSERT INTO specs (
|
|
56
|
-
${columns.join(", ")}
|
|
57
|
-
) VALUES (
|
|
58
|
-
${values.join(", ")}
|
|
59
|
-
)
|
|
60
|
-
ON CONFLICT(id) DO UPDATE SET
|
|
61
|
-
uuid = excluded.uuid,
|
|
62
|
-
title = excluded.title,
|
|
63
|
-
file_path = excluded.file_path,
|
|
64
|
-
content = excluded.content,
|
|
65
|
-
priority = excluded.priority,
|
|
66
|
-
parent_id = excluded.parent_id,
|
|
67
|
-
parent_uuid = excluded.parent_uuid,
|
|
68
|
-
archived = excluded.archived,
|
|
69
|
-
archived_at = excluded.archived_at,
|
|
70
|
-
${input.created_at ? "created_at = excluded.created_at," : ""}
|
|
71
|
-
${input.updated_at ? "updated_at = excluded.updated_at" : "updated_at = CURRENT_TIMESTAMP"}
|
|
72
|
-
`);
|
|
73
|
-
try {
|
|
74
|
-
const params = {
|
|
75
|
-
id: input.id,
|
|
76
|
-
uuid: uuid,
|
|
77
|
-
title: input.title,
|
|
78
|
-
file_path: input.file_path,
|
|
79
|
-
content: input.content || "",
|
|
80
|
-
priority: input.priority ?? 2,
|
|
81
|
-
parent_id: input.parent_id ?? null,
|
|
82
|
-
parent_uuid: parent_uuid,
|
|
83
|
-
archived: input.archived ? 1 : 0,
|
|
84
|
-
};
|
|
85
|
-
// Add optional timestamp parameters
|
|
86
|
-
if (input.created_at) {
|
|
87
|
-
params.created_at = input.created_at;
|
|
88
|
-
}
|
|
89
|
-
if (input.updated_at) {
|
|
90
|
-
params.updated_at = input.updated_at;
|
|
91
|
-
}
|
|
92
|
-
if (input.archived_at !== undefined) {
|
|
93
|
-
params.archived_at = input.archived_at;
|
|
94
|
-
}
|
|
95
|
-
stmt.run(params);
|
|
96
|
-
const spec = getSpec(db, input.id);
|
|
97
|
-
if (!spec) {
|
|
98
|
-
throw new Error(`Failed to create spec ${input.id}`);
|
|
99
|
-
}
|
|
100
|
-
return spec;
|
|
101
|
-
}
|
|
102
|
-
catch (error) {
|
|
103
|
-
if (error.code && error.code.startsWith("SQLITE_CONSTRAINT")) {
|
|
104
|
-
throw new Error(`Constraint violation: ${error.message}`);
|
|
105
|
-
}
|
|
106
|
-
throw error;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Get a spec by ID
|
|
111
|
-
*/
|
|
112
|
-
export function getSpec(db, id) {
|
|
113
|
-
const stmt = db.prepare(`
|
|
114
|
-
SELECT * FROM specs WHERE id = ?
|
|
115
|
-
`);
|
|
116
|
-
return stmt.get(id) ?? null;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Get a spec by file path
|
|
120
|
-
*/
|
|
121
|
-
export function getSpecByFilePath(db, filePath) {
|
|
122
|
-
const stmt = db.prepare(`
|
|
123
|
-
SELECT * FROM specs WHERE file_path = ?
|
|
124
|
-
`);
|
|
125
|
-
return stmt.get(filePath) ?? null;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Update a spec
|
|
129
|
-
*/
|
|
130
|
-
export function updateSpec(db, id, input) {
|
|
131
|
-
const existing = getSpec(db, id);
|
|
132
|
-
if (!existing) {
|
|
133
|
-
throw new Error(`Spec not found: ${id}`);
|
|
134
|
-
}
|
|
135
|
-
// Validate parent_id exists if provided
|
|
136
|
-
if (input.parent_id) {
|
|
137
|
-
const parent = getSpec(db, input.parent_id);
|
|
138
|
-
if (!parent) {
|
|
139
|
-
throw new Error(`Parent spec not found: ${input.parent_id}`);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
const updates = [];
|
|
143
|
-
const params = { id };
|
|
144
|
-
if (input.title !== undefined && input.title !== existing.title) {
|
|
145
|
-
updates.push("title = @title");
|
|
146
|
-
params.title = input.title;
|
|
147
|
-
}
|
|
148
|
-
if (input.file_path !== undefined && input.file_path !== existing.file_path) {
|
|
149
|
-
updates.push("file_path = @file_path");
|
|
150
|
-
params.file_path = input.file_path;
|
|
151
|
-
}
|
|
152
|
-
if (input.content !== undefined && input.content !== existing.content) {
|
|
153
|
-
updates.push("content = @content");
|
|
154
|
-
params.content = input.content;
|
|
155
|
-
}
|
|
156
|
-
if (input.priority !== undefined && input.priority !== existing.priority) {
|
|
157
|
-
updates.push("priority = @priority");
|
|
158
|
-
params.priority = input.priority;
|
|
159
|
-
}
|
|
160
|
-
if (input.parent_id !== undefined && input.parent_id !== existing.parent_id) {
|
|
161
|
-
updates.push("parent_id = @parent_id");
|
|
162
|
-
params.parent_id = input.parent_id;
|
|
163
|
-
}
|
|
164
|
-
if (input.archived !== undefined && input.archived !== existing.archived) {
|
|
165
|
-
updates.push("archived = @archived");
|
|
166
|
-
params.archived = input.archived ? 1 : 0;
|
|
167
|
-
// Handle archived_at based on archived changes
|
|
168
|
-
// Use input.archived_at if provided, otherwise auto-set based on archived
|
|
169
|
-
if (input.archived_at !== undefined) {
|
|
170
|
-
// Explicit archived_at provided - use it
|
|
171
|
-
updates.push("archived_at = @archived_at");
|
|
172
|
-
params.archived_at = input.archived_at;
|
|
173
|
-
}
|
|
174
|
-
else if (input.archived && !existing.archived) {
|
|
175
|
-
// Archiving - set timestamp
|
|
176
|
-
updates.push("archived_at = CURRENT_TIMESTAMP");
|
|
177
|
-
}
|
|
178
|
-
else if (!input.archived && existing.archived) {
|
|
179
|
-
// Unarchiving - clear timestamp
|
|
180
|
-
updates.push("archived_at = NULL");
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
else if (input.archived_at !== undefined &&
|
|
184
|
-
input.archived_at !== existing.archived_at) {
|
|
185
|
-
// archived_at provided without archived change
|
|
186
|
-
updates.push("archived_at = @archived_at");
|
|
187
|
-
params.archived_at = input.archived_at;
|
|
188
|
-
}
|
|
189
|
-
// Handle updated_at - use provided value or set to current timestamp
|
|
190
|
-
if (input.updated_at !== undefined) {
|
|
191
|
-
updates.push("updated_at = @updated_at");
|
|
192
|
-
params.updated_at = input.updated_at;
|
|
193
|
-
}
|
|
194
|
-
else if (updates.length > 0) {
|
|
195
|
-
// Only update timestamp if there are actual changes
|
|
196
|
-
updates.push("updated_at = CURRENT_TIMESTAMP");
|
|
197
|
-
}
|
|
198
|
-
if (updates.length === 0) {
|
|
199
|
-
return existing;
|
|
200
|
-
}
|
|
201
|
-
const stmt = db.prepare(`
|
|
202
|
-
UPDATE specs SET ${updates.join(", ")} WHERE id = @id
|
|
203
|
-
`);
|
|
204
|
-
try {
|
|
205
|
-
stmt.run(params);
|
|
206
|
-
const updated = getSpec(db, id);
|
|
207
|
-
if (!updated) {
|
|
208
|
-
throw new Error(`Failed to update spec ${id}`);
|
|
209
|
-
}
|
|
210
|
-
return updated;
|
|
211
|
-
}
|
|
212
|
-
catch (error) {
|
|
213
|
-
if (error.code && error.code.startsWith("SQLITE_CONSTRAINT")) {
|
|
214
|
-
throw new Error(`Constraint violation: ${error.message}`);
|
|
215
|
-
}
|
|
216
|
-
throw error;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Delete a spec
|
|
221
|
-
*/
|
|
222
|
-
export function deleteSpec(db, id) {
|
|
223
|
-
const stmt = db.prepare(`DELETE FROM specs WHERE id = ?`);
|
|
224
|
-
const result = stmt.run(id);
|
|
225
|
-
return result.changes > 0;
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* List specs with optional filters
|
|
229
|
-
*/
|
|
230
|
-
export function listSpecs(db, options = {}) {
|
|
231
|
-
const conditions = [];
|
|
232
|
-
const params = {};
|
|
233
|
-
if (options.priority !== undefined) {
|
|
234
|
-
conditions.push("priority = @priority");
|
|
235
|
-
params.priority = options.priority;
|
|
236
|
-
}
|
|
237
|
-
if (options.parent_id !== undefined) {
|
|
238
|
-
conditions.push("parent_id = @parent_id");
|
|
239
|
-
params.parent_id = options.parent_id;
|
|
240
|
-
}
|
|
241
|
-
if (options.archived !== undefined) {
|
|
242
|
-
conditions.push("archived = @archived");
|
|
243
|
-
params.archived = options.archived ? 1 : 0;
|
|
244
|
-
}
|
|
245
|
-
let query = "SELECT * FROM specs";
|
|
246
|
-
if (conditions.length > 0) {
|
|
247
|
-
query += " WHERE " + conditions.join(" AND ");
|
|
248
|
-
}
|
|
249
|
-
query += " ORDER BY priority DESC, created_at DESC";
|
|
250
|
-
if (options.limit !== undefined) {
|
|
251
|
-
query += " LIMIT @limit";
|
|
252
|
-
params.limit = options.limit;
|
|
253
|
-
}
|
|
254
|
-
if (options.offset !== undefined) {
|
|
255
|
-
query += " OFFSET @offset";
|
|
256
|
-
params.offset = options.offset;
|
|
257
|
-
}
|
|
258
|
-
const stmt = db.prepare(query);
|
|
259
|
-
return stmt.all(params);
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Search specs by title or content
|
|
263
|
-
*/
|
|
264
|
-
export function searchSpecs(db, query, options = {}) {
|
|
265
|
-
const conditions = ["(title LIKE @query OR content LIKE @query)"];
|
|
266
|
-
const params = { query: `%${query}%` };
|
|
267
|
-
if (options.priority !== undefined) {
|
|
268
|
-
conditions.push("priority = @priority");
|
|
269
|
-
params.priority = options.priority;
|
|
270
|
-
}
|
|
271
|
-
if (options.parent_id !== undefined) {
|
|
272
|
-
conditions.push("parent_id = @parent_id");
|
|
273
|
-
params.parent_id = options.parent_id;
|
|
274
|
-
}
|
|
275
|
-
if (options.archived !== undefined) {
|
|
276
|
-
conditions.push("archived = @archived");
|
|
277
|
-
params.archived = options.archived ? 1 : 0;
|
|
278
|
-
}
|
|
279
|
-
let sql = `SELECT * FROM specs WHERE ${conditions.join(" AND ")} ORDER BY priority DESC, created_at DESC`;
|
|
280
|
-
if (options.limit !== undefined) {
|
|
281
|
-
sql += " LIMIT @limit";
|
|
282
|
-
params.limit = options.limit;
|
|
283
|
-
}
|
|
284
|
-
else {
|
|
285
|
-
sql += " LIMIT 50";
|
|
286
|
-
}
|
|
287
|
-
const stmt = db.prepare(sql);
|
|
288
|
-
return stmt.all(params);
|
|
289
|
-
}
|
|
290
|
-
//# sourceMappingURL=specs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"specs.js","sourceRoot":"","sources":["../../src/operations/specs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAmClD;;GAEG;AACH,MAAM,UAAU,UAAU,CACxB,EAAqB,EACrB,KAAsB;IAEtB,4DAA4D;IAC5D,I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 -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Operations for Tags
|
|
3
|
-
*/
|
|
4
|
-
import type Database from "better-sqlite3";
|
|
5
|
-
import type { Tag, EntityType } from "../types.js";
|
|
6
|
-
/**
|
|
7
|
-
* Add a tag to an entity
|
|
8
|
-
*/
|
|
9
|
-
export declare function addTag(db: Database.Database, entity_id: string, entity_type: EntityType, tag: string): Tag;
|
|
10
|
-
/**
|
|
11
|
-
* Add multiple tags to an entity
|
|
12
|
-
*/
|
|
13
|
-
export declare function addTags(db: Database.Database, entity_id: string, entity_type: EntityType, tags: string[]): Tag[];
|
|
14
|
-
/**
|
|
15
|
-
* Remove a tag from an entity
|
|
16
|
-
*/
|
|
17
|
-
export declare function removeTag(db: Database.Database, entity_id: string, entity_type: EntityType, tag: string): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Get all tags for an entity
|
|
20
|
-
*/
|
|
21
|
-
export declare function getTags(db: Database.Database, entity_id: string, entity_type: EntityType): string[];
|
|
22
|
-
/**
|
|
23
|
-
* Get all entities with a specific tag
|
|
24
|
-
*/
|
|
25
|
-
export declare function getEntitiesByTag(db: Database.Database, tag: string, entity_type?: EntityType): Tag[];
|
|
26
|
-
/**
|
|
27
|
-
* Remove all tags from an entity
|
|
28
|
-
*/
|
|
29
|
-
export declare function removeAllTags(db: Database.Database, entity_id: string, entity_type: EntityType): number;
|
|
30
|
-
/**
|
|
31
|
-
* Check if an entity has a specific tag
|
|
32
|
-
*/
|
|
33
|
-
export declare function hasTag(db: Database.Database, entity_id: string, entity_type: EntityType, tag: string): boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Get all unique tags in the system
|
|
36
|
-
*/
|
|
37
|
-
export declare function getAllTags(db: Database.Database, entity_type?: EntityType): string[];
|
|
38
|
-
/**
|
|
39
|
-
* Replace all tags for an entity
|
|
40
|
-
*/
|
|
41
|
-
export declare function setTags(db: Database.Database, entity_id: string, entity_type: EntityType, tags: string[]): string[];
|
|
42
|
-
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