sqlew 4.3.1 → 5.0.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/CHANGELOG.md +68 -0
- package/LICENSE +1 -1
- package/NOTICE +2 -2
- package/README.md +112 -42
- package/assets/claude-md-snippets/plan-mode-integration.md +54 -0
- package/assets/claude-md-snippets/queue-monitoring.md +84 -0
- package/dist/backend/backend-factory.d.ts +67 -0
- package/dist/backend/backend-factory.d.ts.map +1 -0
- package/dist/backend/backend-factory.js +171 -0
- package/dist/backend/backend-factory.js.map +1 -0
- package/dist/backend/index.d.ts +12 -0
- package/dist/backend/index.d.ts.map +1 -0
- package/dist/backend/index.js +13 -0
- package/dist/backend/index.js.map +1 -0
- package/dist/backend/inference.d.ts +38 -0
- package/dist/backend/inference.d.ts.map +1 -0
- package/dist/backend/inference.js +76 -0
- package/dist/backend/inference.js.map +1 -0
- package/dist/backend/local-backend.d.ts +40 -0
- package/dist/backend/local-backend.d.ts.map +1 -0
- package/dist/backend/local-backend.js +410 -0
- package/dist/backend/local-backend.js.map +1 -0
- package/dist/backend/transforming-backend.d.ts +47 -0
- package/dist/backend/transforming-backend.d.ts.map +1 -0
- package/dist/backend/transforming-backend.js +80 -0
- package/dist/backend/transforming-backend.js.map +1 -0
- package/dist/backend/types.d.ts +58 -0
- package/dist/backend/types.d.ts.map +1 -0
- package/dist/backend/types.js +7 -0
- package/dist/backend/types.js.map +1 -0
- package/dist/cli/db-dump.js +45 -45
- package/dist/cli/db-dump.js.map +1 -1
- package/dist/cli/db-export.js +30 -30
- package/dist/cli/db-export.js.map +1 -1
- package/dist/cli/db-import.d.ts.map +1 -1
- package/dist/cli/db-import.js +32 -33
- package/dist/cli/db-import.js.map +1 -1
- package/dist/cli/hooks/check-completion.d.ts +1 -0
- package/dist/cli/hooks/check-completion.d.ts.map +1 -1
- package/dist/cli/hooks/check-completion.js +15 -26
- package/dist/cli/hooks/check-completion.js.map +1 -1
- package/dist/cli/hooks/mark-done.d.ts +1 -0
- package/dist/cli/hooks/mark-done.d.ts.map +1 -1
- package/dist/cli/hooks/mark-done.js +12 -17
- package/dist/cli/hooks/mark-done.js.map +1 -1
- package/dist/cli/hooks/on-enter-plan.js +2 -2
- package/dist/cli/hooks/on-enter-plan.js.map +1 -1
- package/dist/cli/hooks/on-session-start.d.ts +23 -0
- package/dist/cli/hooks/on-session-start.d.ts.map +1 -0
- package/dist/cli/hooks/on-session-start.js +70 -0
- package/dist/cli/hooks/on-session-start.js.map +1 -0
- package/dist/cli/hooks/on-stop.js +5 -5
- package/dist/cli/hooks/on-stop.js.map +1 -1
- package/dist/cli/hooks/{plan-toml-parser.d.ts → plan-parser.d.ts} +1 -1
- package/dist/cli/hooks/plan-parser.d.ts.map +1 -0
- package/dist/cli/hooks/{plan-toml-parser.js → plan-parser.js} +1 -1
- package/dist/cli/hooks/plan-parser.js.map +1 -0
- package/dist/cli/hooks/plan-pattern-extractor.d.ts.map +1 -1
- package/dist/cli/hooks/plan-pattern-extractor.js +6 -3
- package/dist/cli/hooks/plan-pattern-extractor.js.map +1 -1
- package/dist/cli/hooks/plan-processor.js +1 -1
- package/dist/cli/hooks/plan-processor.js.map +1 -1
- package/dist/cli/hooks/stdin-parser.d.ts +4 -0
- package/dist/cli/hooks/stdin-parser.d.ts.map +1 -1
- package/dist/cli/hooks/stdin-parser.js.map +1 -1
- package/dist/cli/hooks/suggest.js +2 -2
- package/dist/cli/hooks/suggest.js.map +1 -1
- package/dist/cli/hooks/track-plan.d.ts.map +1 -1
- package/dist/cli/hooks/track-plan.js +24 -18
- package/dist/cli/hooks/track-plan.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +72 -72
- package/dist/cli.js.map +1 -1
- package/dist/config/cloud-config-loader.d.ts +107 -0
- package/dist/config/cloud-config-loader.d.ts.map +1 -0
- package/dist/config/cloud-config-loader.js +273 -0
- package/dist/config/cloud-config-loader.js.map +1 -0
- package/dist/config/global-config.d.ts +10 -10
- package/dist/config/global-config.d.ts.map +1 -1
- package/dist/config/global-config.js +12 -12
- package/dist/config/global-config.js.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +5 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/config/minimal-generator.d.ts.map +1 -1
- package/dist/config/minimal-generator.js +22 -72
- package/dist/config/minimal-generator.js.map +1 -1
- package/dist/config/types.d.ts +59 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +14 -0
- package/dist/config/types.js.map +1 -1
- package/dist/constants.d.ts +1 -29
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -38
- package/dist/constants.js.map +1 -1
- package/dist/database/initialization/cleanup.d.ts.map +1 -1
- package/dist/database/initialization/cleanup.js +0 -13
- package/dist/database/initialization/cleanup.js.map +1 -1
- package/dist/database/initialization/init.d.ts.map +1 -1
- package/dist/database/initialization/init.js +0 -9
- package/dist/database/initialization/init.js.map +1 -1
- package/dist/database/initialization/schema-version.d.ts +4 -4
- package/dist/database/initialization/schema-version.js +9 -9
- package/dist/database/initialization/schema-version.js.map +1 -1
- package/dist/database/migrations/v4/20260107000000_v5_drop_task_file_tables.d.ts +36 -0
- package/dist/database/migrations/v4/20260107000000_v5_drop_task_file_tables.d.ts.map +1 -0
- package/dist/database/migrations/v4/20260107000000_v5_drop_task_file_tables.js +135 -0
- package/dist/database/migrations/v4/20260107000000_v5_drop_task_file_tables.js.map +1 -0
- package/dist/database/migrations/v4/20260107000001_v5_drop_legacy_tables.d.ts +20 -0
- package/dist/database/migrations/v4/20260107000001_v5_drop_legacy_tables.d.ts.map +1 -0
- package/dist/database/migrations/v4/20260107000001_v5_drop_legacy_tables.js +168 -0
- package/dist/database/migrations/v4/20260107000001_v5_drop_legacy_tables.js.map +1 -0
- package/dist/database/migrations/v4/20260108000000_v5_rename_to_m_t_prefix.d.ts +23 -0
- package/dist/database/migrations/v4/20260108000000_v5_rename_to_m_t_prefix.d.ts.map +1 -0
- package/dist/database/migrations/v4/20260108000000_v5_rename_to_m_t_prefix.js +570 -0
- package/dist/database/migrations/v4/20260108000000_v5_rename_to_m_t_prefix.js.map +1 -0
- package/dist/database/migrations/v4/20260109000000_v5_drop_help_tables.d.ts +29 -0
- package/dist/database/migrations/v4/20260109000000_v5_drop_help_tables.d.ts.map +1 -0
- package/dist/database/migrations/v4/20260109000000_v5_drop_help_tables.js +80 -0
- package/dist/database/migrations/v4/20260109000000_v5_drop_help_tables.js.map +1 -0
- package/dist/database/operations/inserts.js +11 -11
- package/dist/database/operations/inserts.js.map +1 -1
- package/dist/database/operations/queries.js +9 -9
- package/dist/database/operations/queries.js.map +1 -1
- package/dist/formatters/adr-formatter.d.ts +22 -0
- package/dist/formatters/adr-formatter.d.ts.map +1 -0
- package/dist/formatters/adr-formatter.js +127 -0
- package/dist/formatters/adr-formatter.js.map +1 -0
- package/dist/formatters/confluence-formatter.d.ts +26 -0
- package/dist/formatters/confluence-formatter.d.ts.map +1 -0
- package/dist/formatters/confluence-formatter.js +129 -0
- package/dist/formatters/confluence-formatter.js.map +1 -0
- package/dist/formatters/index.d.ts +34 -0
- package/dist/formatters/index.d.ts.map +1 -0
- package/dist/formatters/index.js +57 -0
- package/dist/formatters/index.js.map +1 -0
- package/dist/formatters/markdown-formatter.d.ts +16 -0
- package/dist/formatters/markdown-formatter.d.ts.map +1 -0
- package/dist/formatters/markdown-formatter.js +110 -0
- package/dist/formatters/markdown-formatter.js.map +1 -0
- package/dist/formatters/notion-formatter.d.ts +29 -0
- package/dist/formatters/notion-formatter.d.ts.map +1 -0
- package/dist/formatters/notion-formatter.js +177 -0
- package/dist/formatters/notion-formatter.js.map +1 -0
- package/dist/formatters/types.d.ts +31 -0
- package/dist/formatters/types.d.ts.map +1 -0
- package/dist/formatters/types.js +6 -0
- package/dist/formatters/types.js.map +1 -0
- package/dist/help-data/_schema.toml +21 -0
- package/dist/help-data/constraint.toml +259 -0
- package/dist/help-data/decision.toml +833 -0
- package/dist/help-data/example.toml +177 -0
- package/dist/help-data/help.toml +246 -0
- package/dist/help-data/queue.toml +134 -0
- package/dist/help-data/suggest.toml +219 -0
- package/dist/help-data/use-cases/_categories.toml +22 -0
- package/dist/help-data/use-cases/constraint-basic.toml +34 -0
- package/dist/help-data/use-cases/cross-tool-workflow.toml +50 -0
- package/dist/help-data/use-cases/decision-intelligence-duplicate.toml +35 -0
- package/dist/help-data/use-cases/decision-intelligence-related.toml +35 -0
- package/dist/help-data/use-cases/decision-tracking-basic.toml +42 -0
- package/dist/help-data/use-cases/decision-tracking-versions.toml +42 -0
- package/dist/help-data/use_case.toml +147 -0
- package/dist/help-loader.d.ts +194 -0
- package/dist/help-loader.d.ts.map +1 -0
- package/dist/help-loader.js +419 -0
- package/dist/help-loader.js.map +1 -0
- package/dist/index.js +15 -10
- package/dist/index.js.map +1 -1
- package/dist/init-rules.d.ts +42 -0
- package/dist/init-rules.d.ts.map +1 -0
- package/dist/init-rules.js +217 -0
- package/dist/init-rules.js.map +1 -0
- package/dist/schema.d.ts +4 -6
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +28 -45
- package/dist/schema.js.map +1 -1
- package/dist/server/setup.d.ts +0 -10
- package/dist/server/setup.d.ts.map +1 -1
- package/dist/server/setup.js +97 -89
- package/dist/server/setup.js.map +1 -1
- package/dist/server/shutdown.d.ts +1 -1
- package/dist/server/shutdown.d.ts.map +1 -1
- package/dist/server/shutdown.js +1 -16
- package/dist/server/shutdown.js.map +1 -1
- package/dist/server/tool-handlers.d.ts +15 -0
- package/dist/server/tool-handlers.d.ts.map +1 -1
- package/dist/server/tool-handlers.js +47 -462
- package/dist/server/tool-handlers.js.map +1 -1
- package/dist/server/tool-registry.d.ts.map +1 -1
- package/dist/server/tool-registry.js +50 -62
- package/dist/server/tool-registry.js.map +1 -1
- package/dist/tests/backend/backend-factory.test.d.ts +7 -0
- package/dist/tests/backend/backend-factory.test.d.ts.map +1 -0
- package/dist/tests/backend/backend-factory.test.js +157 -0
- package/dist/tests/backend/backend-factory.test.js.map +1 -0
- package/dist/tests/backend/inference.test.d.ts +7 -0
- package/dist/tests/backend/inference.test.d.ts.map +1 -0
- package/dist/tests/backend/inference.test.js +142 -0
- package/dist/tests/backend/inference.test.js.map +1 -0
- package/dist/tests/database/multi-project/multi-project.test.js +9 -70
- package/dist/tests/database/multi-project/multi-project.test.js.map +1 -1
- package/dist/tests/database/sql-dump/table-ordering.test.js +14 -14
- package/dist/tests/database/sql-dump/table-ordering.test.js.map +1 -1
- package/dist/tests/docker/cross-database.test.js +32 -32
- package/dist/tests/docker/cross-database.test.js.map +1 -1
- package/dist/tests/docker/dump-import.test.js +55 -55
- package/dist/tests/docker/dump-import.test.js.map +1 -1
- package/dist/tests/docker/fk-constraints.test.js +3 -3
- package/dist/tests/docker/indexes.test.js +34 -34
- package/dist/tests/docker/integration.test.js +33 -33
- package/dist/tests/docker/multi-project-migration.test.js +47 -47
- package/dist/tests/docker/multi-project-migration.test.js.map +1 -1
- package/dist/tests/docker/native/constraint-operations.test.js +49 -49
- package/dist/tests/docker/native/constraint-operations.test.js.map +1 -1
- package/dist/tests/docker/native/db-init.d.ts +3 -1
- package/dist/tests/docker/native/db-init.d.ts.map +1 -1
- package/dist/tests/docker/native/db-init.js +14 -12
- package/dist/tests/docker/native/db-init.js.map +1 -1
- package/dist/tests/docker/native/decision-operations.test.js +91 -91
- package/dist/tests/docker/native/decision-operations.test.js.map +1 -1
- package/dist/tests/docker/native/help-system.test.d.ts +2 -2
- package/dist/tests/docker/native/help-system.test.js +113 -138
- package/dist/tests/docker/native/help-system.test.js.map +1 -1
- package/dist/tests/docker/native/suggest-tool.test.d.ts +2 -2
- package/dist/tests/docker/native/suggest-tool.test.js +35 -35
- package/dist/tests/docker/native/suggest-tool.test.js.map +1 -1
- package/dist/tests/docker/native/test-harness.d.ts +6 -12
- package/dist/tests/docker/native/test-harness.d.ts.map +1 -1
- package/dist/tests/docker/native/test-harness.js +74 -156
- package/dist/tests/docker/native/test-harness.js.map +1 -1
- package/dist/tests/docker/schema-migration.test.js +6 -6
- package/dist/tests/feature/decision/batch-validation-comprehensive.test.d.ts +3 -7
- package/dist/tests/feature/decision/batch-validation-comprehensive.test.d.ts.map +1 -1
- package/dist/tests/feature/decision/batch-validation-comprehensive.test.js +7 -318
- package/dist/tests/feature/decision/batch-validation-comprehensive.test.js.map +1 -1
- package/dist/tests/feature/help/help-system.test.d.ts +6 -6
- package/dist/tests/feature/help/help-system.test.js +166 -124
- package/dist/tests/feature/help/help-system.test.js.map +1 -1
- package/dist/tests/integration/auto-trigger-suggestions.test.js +22 -22
- package/dist/tests/integration/auto-trigger-suggestions.test.js.map +1 -1
- package/dist/tests/integration/decision-intelligence-e2e.test.js +23 -22
- package/dist/tests/integration/decision-intelligence-e2e.test.js.map +1 -1
- package/dist/tests/integration/e2e-workflow1-debug.test.js +3 -3
- package/dist/tests/integration/e2e-workflow1-debug.test.js.map +1 -1
- package/dist/tests/integration/hybrid-similarity-detection.test.js +25 -25
- package/dist/tests/integration/hybrid-similarity-detection.test.js.map +1 -1
- package/dist/tests/integration/suggest-simple.test.js +18 -0
- package/dist/tests/integration/suggest-simple.test.js.map +1 -1
- package/dist/tests/migrations/test-all-versions.js +212 -212
- package/dist/tests/migrations/test-all-versions.js.map +1 -1
- package/dist/tests/migrations/v4/v4-fresh-install.test.js +29 -29
- package/dist/tests/migrations/v4/v4-fresh-install.test.js.map +1 -1
- package/dist/tests/migrations/v4/v4-migrate-data.test.js +20 -20
- package/dist/tests/migrations/v4/v4-migrate-data.test.js.map +1 -1
- package/dist/tests/test-v4-native-rdbms.js +20 -20
- package/dist/tests/test-v4-native-rdbms.js.map +1 -1
- package/dist/tests/unit/config/cloud-config-loader.test.d.ts +2 -0
- package/dist/tests/unit/config/cloud-config-loader.test.d.ts.map +1 -0
- package/dist/tests/unit/config/cloud-config-loader.test.js +103 -0
- package/dist/tests/unit/config/cloud-config-loader.test.js.map +1 -0
- package/dist/tests/unit/config/{plan-toml-cache.test.d.ts → plan-cache.test.d.ts} +1 -1
- package/dist/tests/unit/config/plan-cache.test.d.ts.map +1 -0
- package/dist/tests/unit/config/{plan-toml-cache.test.js → plan-cache.test.js} +32 -32
- package/dist/tests/unit/config/plan-cache.test.js.map +1 -0
- package/dist/tests/unit/hooks/{plan-toml-parser.test.d.ts → plan-parser.test.d.ts} +1 -1
- package/dist/tests/unit/hooks/plan-parser.test.d.ts.map +1 -0
- package/dist/tests/unit/hooks/{plan-toml-parser.test.js → plan-parser.test.js} +179 -179
- package/dist/tests/unit/hooks/plan-parser.test.js.map +1 -0
- package/dist/tests/unit/server/tool-handlers.test.d.ts +7 -0
- package/dist/tests/unit/server/tool-handlers.test.d.ts.map +1 -0
- package/dist/tests/unit/server/tool-handlers.test.js +76 -0
- package/dist/tests/unit/server/tool-handlers.test.js.map +1 -0
- package/dist/tests/unit/utils/config-loader.test.js +17 -17
- package/dist/tests/unit/utils/connection-hash.test.d.ts +2 -0
- package/dist/tests/unit/utils/connection-hash.test.d.ts.map +1 -0
- package/dist/tests/unit/utils/connection-hash.test.js +57 -0
- package/dist/tests/unit/utils/connection-hash.test.js.map +1 -0
- package/dist/tests/unit/utils/environment-detector.test.d.ts +2 -0
- package/dist/tests/unit/utils/environment-detector.test.d.ts.map +1 -0
- package/dist/tests/unit/utils/environment-detector.test.js +43 -0
- package/dist/tests/unit/utils/environment-detector.test.js.map +1 -0
- package/dist/tests/unit/utils/path-utils.test.d.ts +2 -0
- package/dist/tests/unit/utils/path-utils.test.d.ts.map +1 -0
- package/dist/tests/unit/utils/path-utils.test.js +72 -0
- package/dist/tests/unit/utils/path-utils.test.js.map +1 -0
- package/dist/tests/unit/utils/project-detector.test.js +14 -13
- package/dist/tests/unit/utils/project-detector.test.js.map +1 -1
- package/dist/tests/unit/validation/parameter-validation.test.d.ts +2 -1
- package/dist/tests/unit/validation/parameter-validation.test.d.ts.map +1 -1
- package/dist/tests/unit/validation/parameter-validation.test.js +5 -133
- package/dist/tests/unit/validation/parameter-validation.test.js.map +1 -1
- package/dist/tests/unit/validation/policy-validation.test.js +15 -15
- package/dist/tests/unit/validation/policy-validation.test.js.map +1 -1
- package/dist/tests/utils/db-schema.js +48 -48
- package/dist/tests/utils/db-seeding.js +11 -11
- package/dist/tests/utils/db-seeding.js.map +1 -1
- package/dist/tests/utils/json-export-import.test.d.ts +6 -0
- package/dist/tests/utils/json-export-import.test.d.ts.map +1 -0
- package/dist/tests/utils/json-export-import.test.js +474 -0
- package/dist/tests/utils/json-export-import.test.js.map +1 -0
- package/dist/tests/utils/test-helpers.js +59 -59
- package/dist/tests/utils/test-helpers.js.map +1 -1
- package/dist/tools/constraints/actions/activate.d.ts +2 -2
- package/dist/tools/constraints/actions/activate.d.ts.map +1 -1
- package/dist/tools/constraints/actions/activate.js +12 -12
- package/dist/tools/constraints/actions/activate.js.map +1 -1
- package/dist/tools/constraints/actions/add.js +3 -3
- package/dist/tools/constraints/actions/add.js.map +1 -1
- package/dist/tools/constraints/actions/deactivate.js +6 -6
- package/dist/tools/constraints/actions/deactivate.js.map +1 -1
- package/dist/tools/constraints/actions/get.d.ts +2 -2
- package/dist/tools/constraints/actions/get.js +9 -9
- package/dist/tools/constraints/actions/get.js.map +1 -1
- package/dist/tools/constraints/actions/suggest-pending.js +2 -2
- package/dist/tools/constraints/actions/suggest-pending.js.map +1 -1
- package/dist/tools/constraints/index.d.ts +1 -1
- package/dist/tools/constraints/index.d.ts.map +1 -1
- package/dist/tools/constraints/index.js +1 -1
- package/dist/tools/constraints/index.js.map +1 -1
- package/dist/tools/context/actions/create-policy.js +3 -3
- package/dist/tools/context/actions/create-policy.js.map +1 -1
- package/dist/tools/context/actions/create-template.js +2 -2
- package/dist/tools/context/actions/create-template.js.map +1 -1
- package/dist/tools/context/actions/export.d.ts +35 -0
- package/dist/tools/context/actions/export.d.ts.map +1 -0
- package/dist/tools/context/actions/export.js +93 -0
- package/dist/tools/context/actions/export.js.map +1 -0
- package/dist/tools/context/actions/hard-delete.js +11 -11
- package/dist/tools/context/actions/hard-delete.js.map +1 -1
- package/dist/tools/context/actions/has-updates.d.ts +1 -1
- package/dist/tools/context/actions/has-updates.d.ts.map +1 -1
- package/dist/tools/context/actions/has-updates.js +5 -13
- package/dist/tools/context/actions/has-updates.js.map +1 -1
- package/dist/tools/context/actions/list-policies.js +1 -1
- package/dist/tools/context/actions/list-policies.js.map +1 -1
- package/dist/tools/context/actions/list-templates.js +2 -2
- package/dist/tools/context/actions/list-templates.js.map +1 -1
- package/dist/tools/context/actions/list.js +1 -1
- package/dist/tools/context/actions/list.js.map +1 -1
- package/dist/tools/context/actions/search-layer.js +8 -8
- package/dist/tools/context/actions/search-layer.js.map +1 -1
- package/dist/tools/context/actions/set-from-policy.js +1 -1
- package/dist/tools/context/actions/set-from-policy.js.map +1 -1
- package/dist/tools/context/actions/set-from-template.js +2 -2
- package/dist/tools/context/actions/set-from-template.js.map +1 -1
- package/dist/tools/context/actions/versions.js +3 -3
- package/dist/tools/context/actions/versions.js.map +1 -1
- package/dist/tools/context/index.d.ts +1 -0
- package/dist/tools/context/index.d.ts.map +1 -1
- package/dist/tools/context/index.js +2 -0
- package/dist/tools/context/index.js.map +1 -1
- package/dist/tools/context/internal/queries.d.ts.map +1 -1
- package/dist/tools/context/internal/queries.js +54 -43
- package/dist/tools/context/internal/queries.js.map +1 -1
- package/dist/tools/context/types.d.ts +1 -1
- package/dist/tools/context/types.d.ts.map +1 -1
- package/dist/tools/example/actions/get.d.ts +8 -3
- package/dist/tools/example/actions/get.d.ts.map +1 -1
- package/dist/tools/example/actions/get.js +29 -30
- package/dist/tools/example/actions/get.js.map +1 -1
- package/dist/tools/example/actions/list-all.d.ts +8 -2
- package/dist/tools/example/actions/list-all.d.ts.map +1 -1
- package/dist/tools/example/actions/list-all.js +37 -29
- package/dist/tools/example/actions/list-all.js.map +1 -1
- package/dist/tools/example/actions/search.d.ts +8 -3
- package/dist/tools/example/actions/search.d.ts.map +1 -1
- package/dist/tools/example/actions/search.js +29 -43
- package/dist/tools/example/actions/search.js.map +1 -1
- package/dist/tools/help/actions/batch-guide.js +5 -5
- package/dist/tools/help/actions/batch-guide.js.map +1 -1
- package/dist/tools/help/actions/query-action.d.ts +7 -3
- package/dist/tools/help/actions/query-action.d.ts.map +1 -1
- package/dist/tools/help/actions/query-action.js +35 -6
- package/dist/tools/help/actions/query-action.js.map +1 -1
- package/dist/tools/help/actions/query-params.d.ts +5 -3
- package/dist/tools/help/actions/query-params.d.ts.map +1 -1
- package/dist/tools/help/actions/query-params.js +28 -6
- package/dist/tools/help/actions/query-params.js.map +1 -1
- package/dist/tools/help/actions/query-tool.d.ts +5 -3
- package/dist/tools/help/actions/query-tool.d.ts.map +1 -1
- package/dist/tools/help/actions/query-tool.js +23 -6
- package/dist/tools/help/actions/query-tool.js.map +1 -1
- package/dist/tools/help/actions/workflow-hints.d.ts +5 -3
- package/dist/tools/help/actions/workflow-hints.d.ts.map +1 -1
- package/dist/tools/help/actions/workflow-hints.js +21 -6
- package/dist/tools/help/actions/workflow-hints.js.map +1 -1
- package/dist/tools/queue/actions/clear.d.ts +19 -0
- package/dist/tools/queue/actions/clear.d.ts.map +1 -0
- package/dist/tools/queue/actions/clear.js +79 -0
- package/dist/tools/queue/actions/clear.js.map +1 -0
- package/dist/tools/queue/actions/list.d.ts +16 -0
- package/dist/tools/queue/actions/list.d.ts.map +1 -0
- package/dist/tools/queue/actions/list.js +95 -0
- package/dist/tools/queue/actions/list.js.map +1 -0
- package/dist/tools/queue/actions/remove.d.ts +19 -0
- package/dist/tools/queue/actions/remove.d.ts.map +1 -0
- package/dist/tools/queue/actions/remove.js +81 -0
- package/dist/tools/queue/actions/remove.js.map +1 -0
- package/dist/tools/queue/index.d.ts +13 -0
- package/dist/tools/queue/index.d.ts.map +1 -0
- package/dist/tools/queue/index.js +13 -0
- package/dist/tools/queue/index.js.map +1 -0
- package/dist/tools/queue/types.d.ts +87 -0
- package/dist/tools/queue/types.d.ts.map +1 -0
- package/dist/tools/queue/types.js +9 -0
- package/dist/tools/queue/types.js.map +1 -0
- package/dist/tools/suggest/actions/by-context.d.ts.map +1 -1
- package/dist/tools/suggest/actions/by-context.js +3 -1
- package/dist/tools/suggest/actions/by-context.js.map +1 -1
- package/dist/tools/suggest/actions/by-key.d.ts.map +1 -1
- package/dist/tools/suggest/actions/by-key.js +3 -1
- package/dist/tools/suggest/actions/by-key.js.map +1 -1
- package/dist/tools/suggest/actions/by-tags.d.ts +2 -2
- package/dist/tools/suggest/actions/by-tags.js +3 -3
- package/dist/tools/suggest/actions/by-tags.js.map +1 -1
- package/dist/tools/suggest/internal/constraint-queries.d.ts +4 -4
- package/dist/tools/suggest/internal/constraint-queries.js +14 -14
- package/dist/tools/suggest/internal/constraint-queries.js.map +1 -1
- package/dist/tools/suggest/internal/queries.d.ts +4 -4
- package/dist/tools/suggest/internal/queries.js +25 -25
- package/dist/tools/suggest/internal/queries.js.map +1 -1
- package/dist/tools/use_case/actions/get.d.ts +5 -3
- package/dist/tools/use_case/actions/get.d.ts.map +1 -1
- package/dist/tools/use_case/actions/get.js +20 -6
- package/dist/tools/use_case/actions/get.js.map +1 -1
- package/dist/tools/use_case/actions/list-all.d.ts +5 -3
- package/dist/tools/use_case/actions/list-all.d.ts.map +1 -1
- package/dist/tools/use_case/actions/list-all.js +36 -6
- package/dist/tools/use_case/actions/list-all.js.map +1 -1
- package/dist/tools/use_case/actions/search.d.ts +6 -3
- package/dist/tools/use_case/actions/search.d.ts.map +1 -1
- package/dist/tools/use_case/actions/search.js +37 -67
- package/dist/tools/use_case/actions/search.js.map +1 -1
- package/dist/tools/use_case/help/example.js +17 -17
- package/dist/tools/use_case/help/example.js.map +1 -1
- package/dist/types.d.ts +82 -153
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -10
- package/dist/types.js.map +1 -1
- package/dist/utils/action-specs/constraint-specs.js +6 -6
- package/dist/utils/action-specs/constraint-specs.js.map +1 -1
- package/dist/utils/action-specs/index.d.ts +0 -2
- package/dist/utils/action-specs/index.d.ts.map +1 -1
- package/dist/utils/action-specs/index.js +0 -6
- package/dist/utils/action-specs/index.js.map +1 -1
- package/dist/utils/batch-validation.d.ts +1 -1
- package/dist/utils/batch-validation.js +3 -3
- package/dist/utils/batch-validation.js.map +1 -1
- package/dist/utils/case-insensitive-validator.d.ts +2 -2
- package/dist/utils/case-insensitive-validator.js +2 -2
- package/dist/utils/connection-hash.d.ts +37 -0
- package/dist/utils/connection-hash.d.ts.map +1 -0
- package/dist/utils/connection-hash.js +55 -0
- package/dist/utils/connection-hash.js.map +1 -0
- package/dist/utils/db-aggregations.js +16 -16
- package/dist/utils/db-aggregations.js.map +1 -1
- package/dist/utils/enum-converter.d.ts +0 -21
- package/dist/utils/enum-converter.d.ts.map +1 -1
- package/dist/utils/enum-converter.js +1 -23
- package/dist/utils/enum-converter.js.map +1 -1
- package/dist/utils/environment-detector.d.ts +30 -0
- package/dist/utils/environment-detector.d.ts.map +1 -0
- package/dist/utils/environment-detector.js +86 -0
- package/dist/utils/environment-detector.js.map +1 -0
- package/dist/utils/example-filter.d.ts +34 -0
- package/dist/utils/example-filter.d.ts.map +1 -0
- package/dist/utils/example-filter.js +45 -0
- package/dist/utils/example-filter.js.map +1 -0
- package/dist/utils/exporter/export.d.ts +2 -16
- package/dist/utils/exporter/export.d.ts.map +1 -1
- package/dist/utils/exporter/export.js +49 -130
- package/dist/utils/exporter/export.js.map +1 -1
- package/dist/utils/hook-queue.d.ts +60 -0
- package/dist/utils/hook-queue.d.ts.map +1 -1
- package/dist/utils/hook-queue.js +114 -11
- package/dist/utils/hook-queue.js.map +1 -1
- package/dist/utils/importer/import.d.ts.map +1 -1
- package/dist/utils/importer/import.js +33 -188
- package/dist/utils/importer/import.js.map +1 -1
- package/dist/utils/importer/master-tables.d.ts +2 -1
- package/dist/utils/importer/master-tables.d.ts.map +1 -1
- package/dist/utils/importer/master-tables.js +35 -81
- package/dist/utils/importer/master-tables.js.map +1 -1
- package/dist/utils/param-normalizer.d.ts +0 -1
- package/dist/utils/param-normalizer.d.ts.map +1 -1
- package/dist/utils/param-normalizer.js +1 -3
- package/dist/utils/param-normalizer.js.map +1 -1
- package/dist/utils/path-utils.d.ts +46 -0
- package/dist/utils/path-utils.d.ts.map +1 -0
- package/dist/utils/path-utils.js +74 -0
- package/dist/utils/path-utils.js.map +1 -0
- package/dist/utils/policy-validator.js +1 -1
- package/dist/utils/policy-validator.js.map +1 -1
- package/dist/utils/project-context.d.ts +23 -0
- package/dist/utils/project-context.d.ts.map +1 -1
- package/dist/utils/project-context.js +45 -3
- package/dist/utils/project-context.js.map +1 -1
- package/dist/utils/project-root.d.ts +2 -2
- package/dist/utils/project-root.js +2 -2
- package/dist/utils/sql-dump/core/index-export.js +7 -7
- package/dist/utils/sql-dump/schema/indexes.js +24 -24
- package/dist/utils/sql-dump/schema/tables.js +44 -44
- package/dist/utils/token-logging.js +6 -6
- package/dist/utils/token-logging.js.map +1 -1
- package/dist/utils/validators.js +1 -1
- package/dist/utils/validators.js.map +1 -1
- package/dist/utils/view-queries.d.ts +0 -8
- package/dist/utils/view-queries.d.ts.map +1 -1
- package/dist/utils/view-queries.js +29 -84
- package/dist/utils/view-queries.js.map +1 -1
- package/dist/watcher/index.d.ts +1 -4
- package/dist/watcher/index.d.ts.map +1 -1
- package/dist/watcher/index.js +1 -3
- package/dist/watcher/index.js.map +1 -1
- package/dist/watcher/queue-watcher.d.ts +10 -3
- package/dist/watcher/queue-watcher.d.ts.map +1 -1
- package/dist/watcher/queue-watcher.js +24 -21
- package/dist/watcher/queue-watcher.js.map +1 -1
- package/docs/CONFIGURATION.md +14 -14
- package/docs/DATABASE_AUTH.md +1 -1
- package/docs/HOOKS_GUIDE.md +30 -50
- package/docs/HOW_TO_UNINSTALL.md +199 -0
- package/docs/MIGRATION_CLEANUP_GUIDE.md +212 -0
- package/docs/MIGRATION_TO_SAAS.md +176 -0
- package/docs/SLASH_COMMANDS.md +1 -1
- package/docs/cli/DATABASE_MIGRATION.md +13 -13
- package/docs/cli/DATA_EXPORT_IMPORT.md +71 -69
- package/package.json +10 -8
- package/saas-connector/LICENSE +190 -0
- package/saas-connector/README.md +122 -0
- package/saas-connector/dist/auth/auth-manager.d.ts +6 -0
- package/saas-connector/dist/auth/auth-manager.d.ts.map +1 -0
- package/saas-connector/dist/auth/auth-manager.js +39 -0
- package/saas-connector/dist/auth/auth-manager.js.map +7 -0
- package/saas-connector/dist/backend/saas-backend.d.ts +20 -0
- package/saas-connector/dist/backend/saas-backend.d.ts.map +1 -0
- package/saas-connector/dist/backend/saas-backend.js +104 -0
- package/saas-connector/dist/backend/saas-backend.js.map +7 -0
- package/saas-connector/dist/client/http-client.d.ts +33 -0
- package/saas-connector/dist/client/http-client.d.ts.map +1 -0
- package/saas-connector/dist/client/http-client.js +226 -0
- package/saas-connector/dist/client/http-client.js.map +7 -0
- package/saas-connector/dist/client/types.d.ts +62 -0
- package/saas-connector/dist/client/types.d.ts.map +1 -0
- package/saas-connector/dist/client/types.js +17 -0
- package/saas-connector/dist/client/types.js.map +7 -0
- package/saas-connector/dist/config/constants.d.ts +14 -0
- package/saas-connector/dist/config/constants.d.ts.map +1 -0
- package/saas-connector/dist/config/constants.js +68 -0
- package/saas-connector/dist/config/constants.js.map +7 -0
- package/saas-connector/dist/errors/api-error.d.ts +26 -0
- package/saas-connector/dist/errors/api-error.d.ts.map +1 -0
- package/saas-connector/dist/errors/api-error.js +62 -0
- package/saas-connector/dist/errors/api-error.js.map +7 -0
- package/saas-connector/dist/index.d.ts +18 -0
- package/saas-connector/dist/index.d.ts.map +1 -0
- package/saas-connector/dist/index.js +51 -0
- package/saas-connector/dist/index.js.map +7 -0
- package/saas-connector/package-lock.json +518 -0
- package/saas-connector/package.json +34 -0
- package/scripts/copy-help-data.js +19 -0
- package/assets/config.example.toml +0 -120
- package/assets/kanban-style.png +0 -0
- package/assets/kanban-visualizer.png +0 -0
- package/assets/sample-agents/README.md +0 -36
- package/assets/sample-agents/sqlew-architect.md +0 -321
- package/assets/sample-agents/sqlew-researcher.md +0 -292
- package/assets/sample-agents/sqlew-scrum-master.md +0 -286
- package/assets/sample-commands/README.md +0 -56
- package/assets/sample-commands/sqlew.md +0 -144
- package/assets/sample-skills/sqlew-decision-format/SKILL.md +0 -73
- package/assets/sample-skills/sqlew-plan-guidance/SKILL.md +0 -62
- package/assets/schema.sql +0 -564
- package/dist/cli/hooks/init-hooks.d.ts +0 -35
- package/dist/cli/hooks/init-hooks.d.ts.map +0 -1
- package/dist/cli/hooks/init-hooks.js +0 -517
- package/dist/cli/hooks/init-hooks.js.map +0 -1
- package/dist/cli/hooks/plan-toml-parser.d.ts.map +0 -1
- package/dist/cli/hooks/plan-toml-parser.js.map +0 -1
- package/dist/init-agents.d.ts +0 -7
- package/dist/init-agents.d.ts.map +0 -1
- package/dist/init-agents.js +0 -206
- package/dist/init-agents.js.map +0 -1
- package/dist/init-commands.d.ts +0 -10
- package/dist/init-commands.d.ts.map +0 -1
- package/dist/init-commands.js +0 -46
- package/dist/init-commands.js.map +0 -1
- package/dist/init-skills.d.ts +0 -29
- package/dist/init-skills.d.ts.map +0 -1
- package/dist/init-skills.js +0 -183
- package/dist/init-skills.js.map +0 -1
- package/dist/sync-agents.d.ts +0 -13
- package/dist/sync-agents.d.ts.map +0 -1
- package/dist/sync-agents.js +0 -157
- package/dist/sync-agents.js.map +0 -1
- package/dist/sync-commands.d.ts +0 -13
- package/dist/sync-commands.d.ts.map +0 -1
- package/dist/sync-commands.js +0 -150
- package/dist/sync-commands.js.map +0 -1
- package/dist/sync-gitignore.d.ts +0 -13
- package/dist/sync-gitignore.d.ts.map +0 -1
- package/dist/sync-gitignore.js +0 -60
- package/dist/sync-gitignore.js.map +0 -1
- package/dist/tests/docker/native/task-operations.test.d.ts +0 -16
- package/dist/tests/docker/native/task-operations.test.d.ts.map +0 -1
- package/dist/tests/docker/native/task-operations.test.js +0 -800
- package/dist/tests/docker/native/task-operations.test.js.map +0 -1
- package/dist/tests/feature/decision/batch-validation-integration.test.d.ts +0 -6
- package/dist/tests/feature/decision/batch-validation-integration.test.d.ts.map +0 -1
- package/dist/tests/feature/decision/batch-validation-integration.test.js +0 -193
- package/dist/tests/feature/decision/batch-validation-integration.test.js.map +0 -1
- package/dist/tests/feature/task/auto-pruning-decision-link.test.d.ts +0 -6
- package/dist/tests/feature/task/auto-pruning-decision-link.test.d.ts.map +0 -1
- package/dist/tests/feature/task/auto-pruning-decision-link.test.js +0 -281
- package/dist/tests/feature/task/auto-pruning-decision-link.test.js.map +0 -1
- package/dist/tests/feature/task/auto-pruning-partial.test.d.ts +0 -6
- package/dist/tests/feature/task/auto-pruning-partial.test.d.ts.map +0 -1
- package/dist/tests/feature/task/auto-pruning-partial.test.js +0 -305
- package/dist/tests/feature/task/auto-pruning-partial.test.js.map +0 -1
- package/dist/tests/feature/task/auto-pruning-persistence.test.d.ts +0 -6
- package/dist/tests/feature/task/auto-pruning-persistence.test.d.ts.map +0 -1
- package/dist/tests/feature/task/auto-pruning-persistence.test.js +0 -267
- package/dist/tests/feature/task/auto-pruning-persistence.test.js.map +0 -1
- package/dist/tests/feature/task/auto-pruning-safety.test.d.ts +0 -12
- package/dist/tests/feature/task/auto-pruning-safety.test.d.ts.map +0 -1
- package/dist/tests/feature/task/auto-pruning-safety.test.js +0 -224
- package/dist/tests/feature/task/auto-pruning-safety.test.js.map +0 -1
- package/dist/tests/feature/task/dependencies.test.d.ts +0 -7
- package/dist/tests/feature/task/dependencies.test.d.ts.map +0 -1
- package/dist/tests/feature/task/dependencies.test.js +0 -656
- package/dist/tests/feature/task/dependencies.test.js.map +0 -1
- package/dist/tests/feature/task/file-actions-integration.test.d.ts +0 -10
- package/dist/tests/feature/task/file-actions-integration.test.d.ts.map +0 -1
- package/dist/tests/feature/task/file-actions-integration.test.js +0 -162
- package/dist/tests/feature/task/file-actions-integration.test.js.map +0 -1
- package/dist/tests/feature/task/file-actions-validation.test.d.ts +0 -6
- package/dist/tests/feature/task/file-actions-validation.test.d.ts.map +0 -1
- package/dist/tests/feature/task/file-actions-validation.test.js +0 -228
- package/dist/tests/feature/task/file-actions-validation.test.js.map +0 -1
- package/dist/tests/feature/task/link-file-backward-compat.test.d.ts +0 -6
- package/dist/tests/feature/task/link-file-backward-compat.test.d.ts.map +0 -1
- package/dist/tests/feature/task/link-file-backward-compat.test.js +0 -280
- package/dist/tests/feature/task/link-file-backward-compat.test.js.map +0 -1
- package/dist/tests/feature/task/watch-files-action.test.d.ts +0 -8
- package/dist/tests/feature/task/watch-files-action.test.d.ts.map +0 -1
- package/dist/tests/feature/task/watch-files-action.test.js +0 -402
- package/dist/tests/feature/task/watch-files-action.test.js.map +0 -1
- package/dist/tests/feature/task/watch-files-parameter.test.d.ts +0 -8
- package/dist/tests/feature/task/watch-files-parameter.test.d.ts.map +0 -1
- package/dist/tests/feature/task/watch-files-parameter.test.js +0 -283
- package/dist/tests/feature/task/watch-files-parameter.test.js.map +0 -1
- package/dist/tests/integration/all-features.standalone.d.ts +0 -7
- package/dist/tests/integration/all-features.standalone.d.ts.map +0 -1
- package/dist/tests/integration/all-features.standalone.js +0 -417
- package/dist/tests/integration/all-features.standalone.js.map +0 -1
- package/dist/tests/unit/config/plan-toml-cache.test.d.ts.map +0 -1
- package/dist/tests/unit/config/plan-toml-cache.test.js.map +0 -1
- package/dist/tests/unit/hooks/plan-toml-parser.test.d.ts.map +0 -1
- package/dist/tests/unit/hooks/plan-toml-parser.test.js.map +0 -1
- package/dist/tools/files/actions/check-lock.d.ts +0 -16
- package/dist/tools/files/actions/check-lock.d.ts.map +0 -1
- package/dist/tools/files/actions/check-lock.js +0 -74
- package/dist/tools/files/actions/check-lock.js.map +0 -1
- package/dist/tools/files/actions/get.d.ts +0 -16
- package/dist/tools/files/actions/get.d.ts.map +0 -1
- package/dist/tools/files/actions/get.js +0 -85
- package/dist/tools/files/actions/get.js.map +0 -1
- package/dist/tools/files/actions/record-batch.d.ts +0 -18
- package/dist/tools/files/actions/record-batch.d.ts.map +0 -1
- package/dist/tools/files/actions/record-batch.js +0 -119
- package/dist/tools/files/actions/record-batch.js.map +0 -1
- package/dist/tools/files/actions/record.d.ts +0 -16
- package/dist/tools/files/actions/record.d.ts.map +0 -1
- package/dist/tools/files/actions/record.js +0 -43
- package/dist/tools/files/actions/record.js.map +0 -1
- package/dist/tools/files/actions/sqlite-flush.d.ts +0 -27
- package/dist/tools/files/actions/sqlite-flush.d.ts.map +0 -1
- package/dist/tools/files/actions/sqlite-flush.js +0 -66
- package/dist/tools/files/actions/sqlite-flush.js.map +0 -1
- package/dist/tools/files/help/example.d.ts +0 -5
- package/dist/tools/files/help/example.d.ts.map +0 -1
- package/dist/tools/files/help/example.js +0 -109
- package/dist/tools/files/help/example.js.map +0 -1
- package/dist/tools/files/help/help.d.ts +0 -5
- package/dist/tools/files/help/help.d.ts.map +0 -1
- package/dist/tools/files/help/help.js +0 -35
- package/dist/tools/files/help/help.js.map +0 -1
- package/dist/tools/files/index.d.ts +0 -14
- package/dist/tools/files/index.d.ts.map +0 -1
- package/dist/tools/files/index.js +0 -15
- package/dist/tools/files/index.js.map +0 -1
- package/dist/tools/files/internal/queries.d.ts +0 -18
- package/dist/tools/files/internal/queries.d.ts.map +0 -1
- package/dist/tools/files/internal/queries.js +0 -54
- package/dist/tools/files/internal/queries.js.map +0 -1
- package/dist/tools/files/internal/validation.d.ts +0 -18
- package/dist/tools/files/internal/validation.d.ts.map +0 -1
- package/dist/tools/files/internal/validation.js +0 -39
- package/dist/tools/files/internal/validation.js.map +0 -1
- package/dist/tools/files/types.d.ts +0 -6
- package/dist/tools/files/types.d.ts.map +0 -1
- package/dist/tools/files/types.js +0 -6
- package/dist/tools/files/types.js.map +0 -1
- package/dist/tools/help-queries.d.ts +0 -130
- package/dist/tools/help-queries.d.ts.map +0 -1
- package/dist/tools/help-queries.js +0 -411
- package/dist/tools/help-queries.js.map +0 -1
- package/dist/tools/tasks/actions/add-dependency.d.ts +0 -12
- package/dist/tools/tasks/actions/add-dependency.d.ts.map +0 -1
- package/dist/tools/tasks/actions/add-dependency.js +0 -129
- package/dist/tools/tasks/actions/add-dependency.js.map +0 -1
- package/dist/tools/tasks/actions/archive.d.ts +0 -11
- package/dist/tools/tasks/actions/archive.d.ts.map +0 -1
- package/dist/tools/tasks/actions/archive.js +0 -58
- package/dist/tools/tasks/actions/archive.js.map +0 -1
- package/dist/tools/tasks/actions/create-batch.d.ts +0 -19
- package/dist/tools/tasks/actions/create-batch.d.ts.map +0 -1
- package/dist/tools/tasks/actions/create-batch.js +0 -103
- package/dist/tools/tasks/actions/create-batch.js.map +0 -1
- package/dist/tools/tasks/actions/create.d.ts +0 -16
- package/dist/tools/tasks/actions/create.d.ts.map +0 -1
- package/dist/tools/tasks/actions/create.js +0 -163
- package/dist/tools/tasks/actions/create.js.map +0 -1
- package/dist/tools/tasks/actions/get-dependencies.d.ts +0 -12
- package/dist/tools/tasks/actions/get-dependencies.d.ts.map +0 -1
- package/dist/tools/tasks/actions/get-dependencies.js +0 -41
- package/dist/tools/tasks/actions/get-dependencies.js.map +0 -1
- package/dist/tools/tasks/actions/get-pruned-files.d.ts +0 -13
- package/dist/tools/tasks/actions/get-pruned-files.d.ts.map +0 -1
- package/dist/tools/tasks/actions/get-pruned-files.js +0 -45
- package/dist/tools/tasks/actions/get-pruned-files.js.map +0 -1
- package/dist/tools/tasks/actions/get.d.ts +0 -12
- package/dist/tools/tasks/actions/get.d.ts.map +0 -1
- package/dist/tools/tasks/actions/get.js +0 -84
- package/dist/tools/tasks/actions/get.js.map +0 -1
- package/dist/tools/tasks/actions/link-pruned-file.d.ts +0 -14
- package/dist/tools/tasks/actions/link-pruned-file.d.ts.map +0 -1
- package/dist/tools/tasks/actions/link-pruned-file.js +0 -68
- package/dist/tools/tasks/actions/link-pruned-file.js.map +0 -1
- package/dist/tools/tasks/actions/link.d.ts +0 -14
- package/dist/tools/tasks/actions/link.d.ts.map +0 -1
- package/dist/tools/tasks/actions/link.js +0 -120
- package/dist/tools/tasks/actions/link.js.map +0 -1
- package/dist/tools/tasks/actions/list.d.ts +0 -17
- package/dist/tools/tasks/actions/list.d.ts.map +0 -1
- package/dist/tools/tasks/actions/list.js +0 -100
- package/dist/tools/tasks/actions/list.js.map +0 -1
- package/dist/tools/tasks/actions/move.d.ts +0 -13
- package/dist/tools/tasks/actions/move.d.ts.map +0 -1
- package/dist/tools/tasks/actions/move.js +0 -91
- package/dist/tools/tasks/actions/move.js.map +0 -1
- package/dist/tools/tasks/actions/remove-dependency.d.ts +0 -12
- package/dist/tools/tasks/actions/remove-dependency.d.ts.map +0 -1
- package/dist/tools/tasks/actions/remove-dependency.js +0 -36
- package/dist/tools/tasks/actions/remove-dependency.js.map +0 -1
- package/dist/tools/tasks/actions/update.d.ts +0 -10
- package/dist/tools/tasks/actions/update.d.ts.map +0 -1
- package/dist/tools/tasks/actions/update.js +0 -183
- package/dist/tools/tasks/actions/update.js.map +0 -1
- package/dist/tools/tasks/actions/watch-files.d.ts +0 -14
- package/dist/tools/tasks/actions/watch-files.d.ts.map +0 -1
- package/dist/tools/tasks/actions/watch-files.js +0 -127
- package/dist/tools/tasks/actions/watch-files.js.map +0 -1
- package/dist/tools/tasks/help/example.d.ts +0 -8
- package/dist/tools/tasks/help/example.d.ts.map +0 -1
- package/dist/tools/tasks/help/example.js +0 -225
- package/dist/tools/tasks/help/example.js.map +0 -1
- package/dist/tools/tasks/help/help.d.ts +0 -8
- package/dist/tools/tasks/help/help.d.ts.map +0 -1
- package/dist/tools/tasks/help/help.js +0 -307
- package/dist/tools/tasks/help/help.js.map +0 -1
- package/dist/tools/tasks/help/use-case.d.ts +0 -11
- package/dist/tools/tasks/help/use-case.d.ts.map +0 -1
- package/dist/tools/tasks/help/use-case.js +0 -767
- package/dist/tools/tasks/help/use-case.js.map +0 -1
- package/dist/tools/tasks/index.d.ts +0 -28
- package/dist/tools/tasks/index.d.ts.map +0 -1
- package/dist/tools/tasks/index.js +0 -33
- package/dist/tools/tasks/index.js.map +0 -1
- package/dist/tools/tasks/internal/state-machine.d.ts +0 -16
- package/dist/tools/tasks/internal/state-machine.d.ts.map +0 -1
- package/dist/tools/tasks/internal/state-machine.js +0 -36
- package/dist/tools/tasks/internal/state-machine.js.map +0 -1
- package/dist/tools/tasks/internal/task-queries.d.ts +0 -12
- package/dist/tools/tasks/internal/task-queries.d.ts.map +0 -1
- package/dist/tools/tasks/internal/task-queries.js +0 -53
- package/dist/tools/tasks/internal/task-queries.js.map +0 -1
- package/dist/tools/tasks/internal/validation.d.ts +0 -47
- package/dist/tools/tasks/internal/validation.d.ts.map +0 -1
- package/dist/tools/tasks/internal/validation.js +0 -261
- package/dist/tools/tasks/internal/validation.js.map +0 -1
- package/dist/tools/tasks/types.d.ts +0 -80
- package/dist/tools/tasks/types.d.ts.map +0 -1
- package/dist/tools/tasks/types.js +0 -68
- package/dist/tools/tasks/types.js.map +0 -1
- package/dist/tools/tasks/watcher/status.d.ts +0 -9
- package/dist/tools/tasks/watcher/status.d.ts.map +0 -1
- package/dist/tools/tasks/watcher/status.js +0 -130
- package/dist/tools/tasks/watcher/status.js.map +0 -1
- package/dist/tools/tasks.d.ts +0 -16
- package/dist/tools/tasks.d.ts.map +0 -1
- package/dist/tools/tasks.js +0 -17
- package/dist/tools/tasks.js.map +0 -1
- package/dist/utils/action-specs/file-specs.d.ts +0 -9
- package/dist/utils/action-specs/file-specs.d.ts.map +0 -1
- package/dist/utils/action-specs/file-specs.js +0 -54
- package/dist/utils/action-specs/file-specs.js.map +0 -1
- package/dist/utils/action-specs/task-specs.d.ts +0 -9
- package/dist/utils/action-specs/task-specs.d.ts.map +0 -1
- package/dist/utils/action-specs/task-specs.js +0 -143
- package/dist/utils/action-specs/task-specs.js.map +0 -1
- package/dist/utils/cleanup.d.ts +0 -69
- package/dist/utils/cleanup.d.ts.map +0 -1
- package/dist/utils/cleanup.js +0 -102
- package/dist/utils/cleanup.js.map +0 -1
- package/dist/utils/file-pruning.d.ts +0 -93
- package/dist/utils/file-pruning.d.ts.map +0 -1
- package/dist/utils/file-pruning.js +0 -194
- package/dist/utils/file-pruning.js.map +0 -1
- package/dist/utils/importer/topological-sort.d.ts +0 -61
- package/dist/utils/importer/topological-sort.d.ts.map +0 -1
- package/dist/utils/importer/topological-sort.js +0 -143
- package/dist/utils/importer/topological-sort.js.map +0 -1
- package/dist/utils/retention.d.ts +0 -65
- package/dist/utils/retention.d.ts.map +0 -1
- package/dist/utils/retention.js +0 -156
- package/dist/utils/retention.js.map +0 -1
- package/dist/utils/task-stale-detection.d.ts +0 -98
- package/dist/utils/task-stale-detection.d.ts.map +0 -1
- package/dist/utils/task-stale-detection.js +0 -479
- package/dist/utils/task-stale-detection.js.map +0 -1
- package/dist/watcher/file-watcher.d.ts +0 -131
- package/dist/watcher/file-watcher.d.ts.map +0 -1
- package/dist/watcher/file-watcher.js +0 -730
- package/dist/watcher/file-watcher.js.map +0 -1
- package/dist/watcher/test-executor.d.ts +0 -23
- package/dist/watcher/test-executor.d.ts.map +0 -1
- package/dist/watcher/test-executor.js +0 -226
- package/dist/watcher/test-executor.js.map +0 -1
- package/docs/TASK_SYSTEM_DEPRECATED.md +0 -88
|
@@ -1,730 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File Watcher - Auto-tracking file changes linked to tasks
|
|
3
|
-
* Monitors files and auto-transitions task status on file modification
|
|
4
|
-
*
|
|
5
|
-
* Features (v3.5.1):
|
|
6
|
-
* - chokidar v4 file watching with automatic WSL support
|
|
7
|
-
* - Project root watching with .gitignore support
|
|
8
|
-
* - Dynamic file registration (add/remove files at runtime)
|
|
9
|
-
* - Auto-transition: todo → in_progress on file change
|
|
10
|
-
* - Maps file paths → task IDs for efficient lookup
|
|
11
|
-
* - Respects .gitignore patterns and built-in ignore rules
|
|
12
|
-
*/
|
|
13
|
-
import chokidar from 'chokidar';
|
|
14
|
-
import { getAdapter, getConfigInt, getConfigBool } from '../database.js';
|
|
15
|
-
import { basename, join } from 'path';
|
|
16
|
-
import { existsSync } from 'fs';
|
|
17
|
-
import { execSync } from 'child_process';
|
|
18
|
-
import { executeAcceptanceCriteria } from './test-executor.js';
|
|
19
|
-
import { createGitIgnoreParser } from './gitignore-parser.js';
|
|
20
|
-
import { checkReadyForReview } from '../utils/quality-checks.js';
|
|
21
|
-
import { CONFIG_KEYS } from '../constants.js';
|
|
22
|
-
import { detectAndCompleteReviewedTasks, detectAndCompleteOnStaging, detectAndArchiveOnCommit } from '../utils/task-stale-detection.js';
|
|
23
|
-
import { detectVCS } from '../utils/vcs-adapter.js';
|
|
24
|
-
import { debugLog } from '../utils/debug-logger.js';
|
|
25
|
-
/**
|
|
26
|
-
* FileWatcher class - Singleton pattern
|
|
27
|
-
*/
|
|
28
|
-
export class FileWatcher {
|
|
29
|
-
static instance = null;
|
|
30
|
-
watcher = null;
|
|
31
|
-
watchedFiles = new Map();
|
|
32
|
-
isRunning = false;
|
|
33
|
-
debounceTimers = new Map();
|
|
34
|
-
DEBOUNCE_MS = 2000; // Wait 2s after last write
|
|
35
|
-
gitignoreParser = null;
|
|
36
|
-
projectRoot;
|
|
37
|
-
lastModifiedTimes = new Map(); // taskId -> timestamp
|
|
38
|
-
filesModifiedSet = new Map(); // taskId -> modified files
|
|
39
|
-
vcsDetectionInterval = null; // Periodic VCS re-detection
|
|
40
|
-
stagingPollInterval = null; // WSL staging detection polling
|
|
41
|
-
constructor() {
|
|
42
|
-
// Private constructor for singleton
|
|
43
|
-
// Determine project root (current working directory)
|
|
44
|
-
this.projectRoot = process.cwd();
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Get singleton instance
|
|
48
|
-
*/
|
|
49
|
-
static getInstance() {
|
|
50
|
-
if (!FileWatcher.instance) {
|
|
51
|
-
FileWatcher.instance = new FileWatcher();
|
|
52
|
-
}
|
|
53
|
-
return FileWatcher.instance;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Detect if running on WSL (Windows Subsystem for Linux)
|
|
57
|
-
*/
|
|
58
|
-
isWSL() {
|
|
59
|
-
// WSL only exists on Linux platform, not on native Windows
|
|
60
|
-
if (process.platform !== 'linux') {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
// On Linux, check if it's actually WSL by examining uname
|
|
64
|
-
try {
|
|
65
|
-
const result = execSync('uname -r', {
|
|
66
|
-
encoding: 'utf-8',
|
|
67
|
-
stdio: ['pipe', 'pipe', 'ignore'] // stdin, stdout, stderr (ignore)
|
|
68
|
-
});
|
|
69
|
-
return result.toLowerCase().includes('microsoft') || result.toLowerCase().includes('wsl');
|
|
70
|
-
}
|
|
71
|
-
catch {
|
|
72
|
-
// Command failed - not WSL
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Initialize and start the file watcher (Chokidar v4)
|
|
78
|
-
*/
|
|
79
|
-
async start() {
|
|
80
|
-
if (this.isRunning) {
|
|
81
|
-
debugLog('WARN', 'File watcher already running');
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
try {
|
|
85
|
-
// Initialize gitignore parser
|
|
86
|
-
this.gitignoreParser = createGitIgnoreParser(this.projectRoot);
|
|
87
|
-
// Detect WSL (informational only - chokidar v4 handles WSL automatically)
|
|
88
|
-
const isWSL = this.isWSL();
|
|
89
|
-
if (isWSL) {
|
|
90
|
-
debugLog('INFO', 'WSL detected - chokidar v4 handles WSL automatically');
|
|
91
|
-
}
|
|
92
|
-
// Initialize chokidar v4 with debouncing and gitignore support
|
|
93
|
-
// NOTE: Chokidar v4 automatically detects and handles WSL without manual polling configuration
|
|
94
|
-
// Windows: awaitWriteFinish causes file handle locking - use app-level debounce instead
|
|
95
|
-
const isWindows = process.platform === 'win32';
|
|
96
|
-
this.watcher = chokidar.watch(this.projectRoot, {
|
|
97
|
-
persistent: true,
|
|
98
|
-
ignoreInitial: true, // Don't trigger on startup
|
|
99
|
-
// Windows: disable awaitWriteFinish to prevent file handle locking
|
|
100
|
-
// Other platforms: use chokidar's built-in write stabilization
|
|
101
|
-
awaitWriteFinish: isWindows ? false : {
|
|
102
|
-
stabilityThreshold: this.DEBOUNCE_MS,
|
|
103
|
-
pollInterval: 100
|
|
104
|
-
},
|
|
105
|
-
ignored: (path) => {
|
|
106
|
-
// Use gitignore parser to filter files
|
|
107
|
-
if (this.gitignoreParser) {
|
|
108
|
-
return this.gitignoreParser.shouldIgnore(path);
|
|
109
|
-
}
|
|
110
|
-
// Fallback: ignore dotfiles
|
|
111
|
-
return /(^|[\/\\])\./.test(path);
|
|
112
|
-
},
|
|
113
|
-
});
|
|
114
|
-
// Set up event handlers
|
|
115
|
-
this.watcher.on('change', (path) => {
|
|
116
|
-
// Check if this is a VCS index file
|
|
117
|
-
if (this.isVCSIndexFile(path)) {
|
|
118
|
-
this.handleVCSIndexChange(path);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
this.handleFileChange(path);
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
this.watcher.on('add', (path) => {
|
|
125
|
-
// Check if this is a VCS index file
|
|
126
|
-
if (this.isVCSIndexFile(path)) {
|
|
127
|
-
this.handleVCSIndexChange(path);
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
this.handleFileChange(path);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
this.watcher.on('error', (error) => {
|
|
134
|
-
debugLog('ERROR', 'File watcher error', { error });
|
|
135
|
-
});
|
|
136
|
-
// Load existing task-file links from database
|
|
137
|
-
await this.loadTaskFileLinks();
|
|
138
|
-
// Initialize tracking maps
|
|
139
|
-
this.lastModifiedTimes.clear();
|
|
140
|
-
this.filesModifiedSet.clear();
|
|
141
|
-
// Watch VCS index files for commit detection (VCS-aware auto-complete)
|
|
142
|
-
await this.watchVCSIndexFiles();
|
|
143
|
-
// Periodic VCS re-detection
|
|
144
|
-
// Handles case where git is initialized after watcher starts
|
|
145
|
-
// Check every 5 minutes for new VCS initialization
|
|
146
|
-
this.vcsDetectionInterval = setInterval(async () => {
|
|
147
|
-
await this.refreshVCSWatching();
|
|
148
|
-
}, 5 * 60 * 1000); // 5 minutes
|
|
149
|
-
// WSL-specific: Periodic staging detection
|
|
150
|
-
// Workaround for chokidar not reliably detecting .git/index changes on WSL
|
|
151
|
-
if (isWSL) {
|
|
152
|
-
this.stagingPollInterval = setInterval(async () => {
|
|
153
|
-
await this.pollStagingArea();
|
|
154
|
-
}, 1000); // Poll every 1 second
|
|
155
|
-
debugLog('INFO', 'WSL periodic staging detection enabled (1s interval)');
|
|
156
|
-
}
|
|
157
|
-
this.isRunning = true;
|
|
158
|
-
debugLog('INFO', 'File watcher started successfully', {
|
|
159
|
-
projectRoot: this.projectRoot,
|
|
160
|
-
filesWatched: this.watchedFiles.size,
|
|
161
|
-
tasksWatched: this.getTotalTaskCount(),
|
|
162
|
-
gitignoreLoaded: existsSync(this.projectRoot + '/.gitignore')
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
catch (error) {
|
|
166
|
-
debugLog('ERROR', 'Failed to start file watcher', { error });
|
|
167
|
-
throw error;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Stop the file watcher
|
|
172
|
-
*/
|
|
173
|
-
async stop() {
|
|
174
|
-
if (!this.isRunning) {
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
try {
|
|
178
|
-
// Clear all debounce timers
|
|
179
|
-
this.debounceTimers.forEach(timer => clearTimeout(timer));
|
|
180
|
-
this.debounceTimers.clear();
|
|
181
|
-
// Clear tracking maps
|
|
182
|
-
this.lastModifiedTimes.clear();
|
|
183
|
-
this.filesModifiedSet.clear();
|
|
184
|
-
// Clear VCS detection interval
|
|
185
|
-
if (this.vcsDetectionInterval) {
|
|
186
|
-
clearInterval(this.vcsDetectionInterval);
|
|
187
|
-
this.vcsDetectionInterval = null;
|
|
188
|
-
}
|
|
189
|
-
// Clear WSL staging poll interval
|
|
190
|
-
if (this.stagingPollInterval) {
|
|
191
|
-
clearInterval(this.stagingPollInterval);
|
|
192
|
-
this.stagingPollInterval = null;
|
|
193
|
-
}
|
|
194
|
-
// Close watcher
|
|
195
|
-
if (this.watcher) {
|
|
196
|
-
await this.watcher.close();
|
|
197
|
-
this.watcher = null;
|
|
198
|
-
}
|
|
199
|
-
this.isRunning = false;
|
|
200
|
-
debugLog('INFO', 'File watcher stopped');
|
|
201
|
-
}
|
|
202
|
-
catch (error) {
|
|
203
|
-
debugLog('ERROR', 'Error stopping file watcher', { error });
|
|
204
|
-
throw error;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Register a file to watch for a specific task
|
|
209
|
-
*/
|
|
210
|
-
registerFile(filePath, taskId, taskTitle, currentStatus) {
|
|
211
|
-
if (!this.watcher) {
|
|
212
|
-
debugLog('WARN', 'Cannot register file: watcher not initialized');
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
// Normalize path
|
|
216
|
-
const normalizedPath = this.normalizePath(filePath);
|
|
217
|
-
// Add to watched files map
|
|
218
|
-
if (!this.watchedFiles.has(normalizedPath)) {
|
|
219
|
-
this.watchedFiles.set(normalizedPath, []);
|
|
220
|
-
}
|
|
221
|
-
const mappings = this.watchedFiles.get(normalizedPath);
|
|
222
|
-
// Check if task already registered for this file
|
|
223
|
-
const existing = mappings.find(m => m.taskId === taskId);
|
|
224
|
-
if (existing) {
|
|
225
|
-
// Update status
|
|
226
|
-
existing.currentStatus = currentStatus;
|
|
227
|
-
existing.taskTitle = taskTitle;
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
// Add new mapping
|
|
231
|
-
mappings.push({ taskId, taskTitle, currentStatus });
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Unregister a file from watching (when task completes or is archived)
|
|
236
|
-
*/
|
|
237
|
-
unregisterFile(filePath, taskId) {
|
|
238
|
-
const normalizedPath = this.normalizePath(filePath);
|
|
239
|
-
const mappings = this.watchedFiles.get(normalizedPath);
|
|
240
|
-
if (!mappings) {
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
// Remove this task from the file's mappings
|
|
244
|
-
const filtered = mappings.filter(m => m.taskId !== taskId);
|
|
245
|
-
if (filtered.length === 0) {
|
|
246
|
-
// No more tasks watching this file
|
|
247
|
-
this.watchedFiles.delete(normalizedPath);
|
|
248
|
-
debugLog('INFO', `Removed task mapping for: ${basename(normalizedPath)}`);
|
|
249
|
-
}
|
|
250
|
-
else {
|
|
251
|
-
this.watchedFiles.set(normalizedPath, filtered);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Unregister all files for a specific task
|
|
256
|
-
*/
|
|
257
|
-
unregisterTask(taskId) {
|
|
258
|
-
const filesToUnregister = [];
|
|
259
|
-
// Find all files linked to this task
|
|
260
|
-
this.watchedFiles.forEach((mappings, filePath) => {
|
|
261
|
-
if (mappings.some(m => m.taskId === taskId)) {
|
|
262
|
-
filesToUnregister.push(filePath);
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
// Unregister each file
|
|
266
|
-
filesToUnregister.forEach(filePath => {
|
|
267
|
-
this.unregisterFile(filePath, taskId);
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Check if a path is a VCS index file
|
|
272
|
-
*/
|
|
273
|
-
isVCSIndexFile(path) {
|
|
274
|
-
// Git index file
|
|
275
|
-
if (path.endsWith('.git/index') || path.endsWith('.git\\index')) {
|
|
276
|
-
return true;
|
|
277
|
-
}
|
|
278
|
-
// Mercurial dirstate file
|
|
279
|
-
if (path.endsWith('.hg/dirstate') || path.endsWith('.hg\\dirstate')) {
|
|
280
|
-
return true;
|
|
281
|
-
}
|
|
282
|
-
// SVN doesn't have a local index file that changes on commit
|
|
283
|
-
return false;
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Get VCS index file path for given VCS type
|
|
287
|
-
* Centralized mapping for easier extension to Mercurial/SVN
|
|
288
|
-
* @param vcsType - VCS type string (Git, Mercurial, SVN)
|
|
289
|
-
* @returns Absolute path to VCS index file, or null if VCS has no local index
|
|
290
|
-
*/
|
|
291
|
-
getVCSIndexPath(vcsType) {
|
|
292
|
-
const vcsIndexPaths = {
|
|
293
|
-
'Git': join(this.projectRoot, '.git', 'index'),
|
|
294
|
-
'Mercurial': join(this.projectRoot, '.hg', 'dirstate'),
|
|
295
|
-
'SVN': null, // SVN has no local index file (commits are remote)
|
|
296
|
-
};
|
|
297
|
-
return vcsIndexPaths[vcsType] || null;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* Re-detect VCS and start watching index files
|
|
301
|
-
* Called when VCS might be initialized after watcher starts
|
|
302
|
-
* Public method for external triggering (e.g., after git init)
|
|
303
|
-
*/
|
|
304
|
-
async refreshVCSWatching() {
|
|
305
|
-
if (!this.watcher || !this.isRunning) {
|
|
306
|
-
debugLog('WARN', 'Cannot refresh VCS watching: watcher not running');
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
debugLog('INFO', 'Re-detecting VCS...');
|
|
310
|
-
await this.watchVCSIndexFiles();
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Watch VCS index files for commit detection
|
|
314
|
-
*/
|
|
315
|
-
async watchVCSIndexFiles() {
|
|
316
|
-
// Detect VCS type
|
|
317
|
-
const vcsAdapter = await detectVCS(this.projectRoot);
|
|
318
|
-
if (!vcsAdapter) {
|
|
319
|
-
debugLog('INFO', 'No VCS detected - skipping VCS index watching');
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
const vcsType = vcsAdapter.getVCSType();
|
|
323
|
-
const indexPath = this.getVCSIndexPath(vcsType);
|
|
324
|
-
if (indexPath === null) {
|
|
325
|
-
debugLog('INFO', `${vcsType} detected - no local index file to watch (commits are remote)`);
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
|
-
if (existsSync(indexPath) && this.watcher) {
|
|
329
|
-
this.watcher.add(indexPath);
|
|
330
|
-
debugLog('INFO', `Watching ${indexPath} for ${vcsType} commits`);
|
|
331
|
-
}
|
|
332
|
-
else if (!existsSync(indexPath)) {
|
|
333
|
-
debugLog('WARN', `${vcsType} index file not found: ${indexPath}`);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Handle file change event
|
|
338
|
-
*/
|
|
339
|
-
async handleFileChange(filePath) {
|
|
340
|
-
const normalizedPath = this.normalizePath(filePath);
|
|
341
|
-
const mappings = this.watchedFiles.get(normalizedPath);
|
|
342
|
-
if (!mappings || mappings.length === 0) {
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
debugLog('INFO', `File changed: ${basename(normalizedPath)}`);
|
|
346
|
-
const adapter = getAdapter();
|
|
347
|
-
const knex = adapter.getKnex();
|
|
348
|
-
// Process each task linked to this file
|
|
349
|
-
for (const mapping of mappings) {
|
|
350
|
-
const { taskId, taskTitle, currentStatus } = mapping;
|
|
351
|
-
// Track file modification
|
|
352
|
-
this.lastModifiedTimes.set(taskId, Date.now());
|
|
353
|
-
if (!this.filesModifiedSet.has(taskId)) {
|
|
354
|
-
this.filesModifiedSet.set(taskId, new Set());
|
|
355
|
-
}
|
|
356
|
-
this.filesModifiedSet.get(taskId).add(normalizedPath);
|
|
357
|
-
// Auto-transition: todo → in_progress
|
|
358
|
-
if (currentStatus === 'todo') {
|
|
359
|
-
try {
|
|
360
|
-
// Get status IDs
|
|
361
|
-
const todoStatusId = await knex('v4_task_statuses')
|
|
362
|
-
.where({ name: 'todo' })
|
|
363
|
-
.select('id')
|
|
364
|
-
.first();
|
|
365
|
-
const inProgressStatusId = await knex('v4_task_statuses')
|
|
366
|
-
.where({ name: 'in_progress' })
|
|
367
|
-
.select('id')
|
|
368
|
-
.first();
|
|
369
|
-
if (!todoStatusId || !inProgressStatusId) {
|
|
370
|
-
debugLog('ERROR', 'Cannot find task status IDs');
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
// Update task status: todo → in_progress
|
|
374
|
-
await knex('v4_tasks')
|
|
375
|
-
.where({ id: taskId, status_id: todoStatusId.id })
|
|
376
|
-
.update({
|
|
377
|
-
status_id: inProgressStatusId.id,
|
|
378
|
-
updated_ts: knex.raw('unixepoch()')
|
|
379
|
-
});
|
|
380
|
-
// Update in-memory status
|
|
381
|
-
mapping.currentStatus = 'in_progress';
|
|
382
|
-
debugLog('INFO', `Task #${taskId} "${taskTitle}": todo → in_progress`);
|
|
383
|
-
// Log to activity log
|
|
384
|
-
const agentIdRow = await knex('v4_tasks')
|
|
385
|
-
.where({ id: taskId })
|
|
386
|
-
.select('assigned_agent_id')
|
|
387
|
-
.first();
|
|
388
|
-
if (agentIdRow?.assigned_agent_id) {
|
|
389
|
-
await knex('v4_activity_log').insert({
|
|
390
|
-
agent_id: agentIdRow.assigned_agent_id,
|
|
391
|
-
action_type: 'task_auto_transition',
|
|
392
|
-
target: `task_id:${taskId}`,
|
|
393
|
-
details: JSON.stringify({
|
|
394
|
-
from_status: 'todo',
|
|
395
|
-
to_status: 'in_progress',
|
|
396
|
-
trigger: 'file_change',
|
|
397
|
-
file_path: normalizedPath
|
|
398
|
-
})
|
|
399
|
-
});
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
catch (error) {
|
|
403
|
-
debugLog('ERROR', `Error auto-transitioning task #${taskId}`, { error });
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
// Check acceptance criteria for in_progress tasks
|
|
407
|
-
if (currentStatus === 'in_progress' || mapping.currentStatus === 'in_progress') {
|
|
408
|
-
await this.checkAcceptanceCriteria(taskId, taskTitle, mapping);
|
|
409
|
-
// After debounce period, check if task is ready for review
|
|
410
|
-
// Use setTimeout to check after idle period
|
|
411
|
-
const idleMinutes = await getConfigInt(adapter, CONFIG_KEYS.REVIEW_IDLE_MINUTES, 15);
|
|
412
|
-
setTimeout(async () => {
|
|
413
|
-
await this.checkAndTransitionToReview(taskId);
|
|
414
|
-
}, idleMinutes * 60 * 1000);
|
|
415
|
-
}
|
|
416
|
-
else {
|
|
417
|
-
debugLog('INFO', `Task #${taskId} "${taskTitle}": status ${currentStatus}`);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
/**
|
|
422
|
-
* Handle VCS index file change - triggers two-step Git-aware workflow
|
|
423
|
-
* Step 1: Staging (git add) → waiting_review → done
|
|
424
|
-
* Step 2: Commit (git commit) → done → archived
|
|
425
|
-
* Fallback: If files already committed (not in staging), use legacy logic
|
|
426
|
-
*/
|
|
427
|
-
async handleVCSIndexChange(filePath) {
|
|
428
|
-
debugLog('INFO', 'VCS index changed - checking for tasks ready to auto-transition');
|
|
429
|
-
const db = getAdapter();
|
|
430
|
-
try {
|
|
431
|
-
// Step 1: Check for staged files → complete tasks (waiting_review → done)
|
|
432
|
-
const stagingCompleted = await detectAndCompleteOnStaging(db);
|
|
433
|
-
// Step 2: Check for committed files → archive tasks (done → archived)
|
|
434
|
-
const commitArchived = await detectAndArchiveOnCommit(db);
|
|
435
|
-
// Fallback: Check for committed files → complete tasks (waiting_review → done)
|
|
436
|
-
// This handles cases where files go straight to commit without visible staging
|
|
437
|
-
const commitCompleted = await detectAndCompleteReviewedTasks(db);
|
|
438
|
-
// Log results
|
|
439
|
-
const transitions = [];
|
|
440
|
-
if (stagingCompleted > 0) {
|
|
441
|
-
transitions.push(`${stagingCompleted} task(s) completed (git add detected)`);
|
|
442
|
-
}
|
|
443
|
-
if (commitCompleted > 0) {
|
|
444
|
-
transitions.push(`${commitCompleted} task(s) completed (git commit fallback)`);
|
|
445
|
-
}
|
|
446
|
-
if (commitArchived > 0) {
|
|
447
|
-
transitions.push(`${commitArchived} task(s) archived (git commit detected)`);
|
|
448
|
-
}
|
|
449
|
-
if (transitions.length > 0) {
|
|
450
|
-
debugLog('INFO', `VCS auto-transition: ${transitions.join(', ')}`);
|
|
451
|
-
}
|
|
452
|
-
else {
|
|
453
|
-
debugLog('INFO', 'No tasks ready for auto-transition');
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
catch (error) {
|
|
457
|
-
debugLog('ERROR', 'Error during VCS-aware auto-transition', { error });
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
/**
|
|
461
|
-
* Poll staging area for changes (WSL workaround)
|
|
462
|
-
* Called periodically on WSL where chokidar doesn't reliably detect .git/index changes
|
|
463
|
-
*/
|
|
464
|
-
async pollStagingArea() {
|
|
465
|
-
try {
|
|
466
|
-
const db = getAdapter();
|
|
467
|
-
const { detectAndCompleteOnStaging } = await import('../utils/task-stale-detection.js');
|
|
468
|
-
const completedCount = await detectAndCompleteOnStaging(db);
|
|
469
|
-
// Only log if tasks were actually completed (reduce noise)
|
|
470
|
-
if (completedCount > 0) {
|
|
471
|
-
debugLog('INFO', `WSL polling detected staging → ${completedCount} task(s) auto-completed`);
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
catch (error) {
|
|
475
|
-
// Silently ignore errors to avoid spamming console
|
|
476
|
-
// The next poll will retry
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
/**
|
|
480
|
-
* Check acceptance criteria and auto-complete task if all pass
|
|
481
|
-
*/
|
|
482
|
-
async checkAcceptanceCriteria(taskId, taskTitle, mapping) {
|
|
483
|
-
const adapter = getAdapter();
|
|
484
|
-
const knex = adapter.getKnex();
|
|
485
|
-
try {
|
|
486
|
-
// Get acceptance criteria JSON
|
|
487
|
-
const taskDetails = await knex('v4_task_details')
|
|
488
|
-
.where({ task_id: taskId })
|
|
489
|
-
.select('acceptance_criteria_json')
|
|
490
|
-
.first();
|
|
491
|
-
if (!taskDetails || !taskDetails.acceptance_criteria_json) {
|
|
492
|
-
// No acceptance criteria defined, skip auto-completion
|
|
493
|
-
return;
|
|
494
|
-
}
|
|
495
|
-
const checks = JSON.parse(taskDetails.acceptance_criteria_json);
|
|
496
|
-
if (!Array.isArray(checks) || checks.length === 0) {
|
|
497
|
-
return;
|
|
498
|
-
}
|
|
499
|
-
debugLog('INFO', `Checking acceptance criteria for task #${taskId}...`);
|
|
500
|
-
// Execute all checks
|
|
501
|
-
const { allPassed, results } = await executeAcceptanceCriteria(checks);
|
|
502
|
-
// Log individual check results
|
|
503
|
-
results.forEach((result, index) => {
|
|
504
|
-
const icon = result.success ? '✓' : '✗';
|
|
505
|
-
const message = `${icon} Check ${index + 1}: ${result.message}`;
|
|
506
|
-
debugLog(result.success ? 'INFO' : 'WARN', message, result.details ? { details: result.details } : undefined);
|
|
507
|
-
});
|
|
508
|
-
if (allPassed) {
|
|
509
|
-
// All checks passed - auto-complete task: in_progress → done
|
|
510
|
-
const inProgressStatusId = await knex('v4_task_statuses')
|
|
511
|
-
.where({ name: 'in_progress' })
|
|
512
|
-
.select('id')
|
|
513
|
-
.first();
|
|
514
|
-
const doneStatusId = await knex('v4_task_statuses')
|
|
515
|
-
.where({ name: 'done' })
|
|
516
|
-
.select('id')
|
|
517
|
-
.first();
|
|
518
|
-
if (!inProgressStatusId || !doneStatusId) {
|
|
519
|
-
debugLog('ERROR', 'Cannot find task status IDs');
|
|
520
|
-
return;
|
|
521
|
-
}
|
|
522
|
-
await knex('v4_tasks')
|
|
523
|
-
.where({ id: taskId, status_id: inProgressStatusId.id })
|
|
524
|
-
.update({
|
|
525
|
-
status_id: doneStatusId.id,
|
|
526
|
-
completed_ts: knex.raw('unixepoch()'),
|
|
527
|
-
updated_ts: knex.raw('unixepoch()')
|
|
528
|
-
});
|
|
529
|
-
// Update in-memory status
|
|
530
|
-
mapping.currentStatus = 'done';
|
|
531
|
-
debugLog('INFO', `Task #${taskId} "${taskTitle}": in_progress → done (all checks passed!)`);
|
|
532
|
-
// Unregister from watcher (done tasks don't need watching)
|
|
533
|
-
this.unregisterTask(taskId);
|
|
534
|
-
// Log to activity log
|
|
535
|
-
const agentIdRow = await knex('v4_tasks')
|
|
536
|
-
.where({ id: taskId })
|
|
537
|
-
.select('assigned_agent_id')
|
|
538
|
-
.first();
|
|
539
|
-
if (agentIdRow?.assigned_agent_id) {
|
|
540
|
-
await knex('v4_activity_log').insert({
|
|
541
|
-
agent_id: agentIdRow.assigned_agent_id,
|
|
542
|
-
action_type: 'task_auto_complete',
|
|
543
|
-
target: `task_id:${taskId}`,
|
|
544
|
-
details: JSON.stringify({
|
|
545
|
-
from_status: 'in_progress',
|
|
546
|
-
to_status: 'done',
|
|
547
|
-
trigger: 'acceptance_criteria_passed',
|
|
548
|
-
checks_passed: results.length
|
|
549
|
-
})
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
else {
|
|
554
|
-
const failedCount = results.filter(r => !r.success).length;
|
|
555
|
-
debugLog('INFO', `Task #${taskId}: ${failedCount}/${results.length} checks failed, staying in_progress`);
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
catch (error) {
|
|
559
|
-
debugLog('ERROR', `Error checking acceptance criteria for task #${taskId}`, { error });
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
/**
|
|
563
|
-
* Load existing task-file links from database
|
|
564
|
-
*/
|
|
565
|
-
async loadTaskFileLinks() {
|
|
566
|
-
const adapter = getAdapter();
|
|
567
|
-
const knex = adapter.getKnex();
|
|
568
|
-
try {
|
|
569
|
-
// Query all active tasks with file links
|
|
570
|
-
const links = await knex('v4_tasks as t')
|
|
571
|
-
.join('v4_task_statuses as s', 't.status_id', 's.id')
|
|
572
|
-
.join('v4_task_file_links as tfl', 't.id', 'tfl.task_id')
|
|
573
|
-
.join('v4_files as f', 'tfl.file_id', 'f.id')
|
|
574
|
-
.whereIn('s.name', ['todo', 'in_progress', 'waiting_review', 'blocked'])
|
|
575
|
-
.select('t.id as task_id', 't.title as task_title', 's.name as status', 'f.path as file_path');
|
|
576
|
-
// Register each file
|
|
577
|
-
links.forEach(link => {
|
|
578
|
-
this.registerFile(link.file_path, link.task_id, link.task_title, link.status);
|
|
579
|
-
});
|
|
580
|
-
debugLog('INFO', `Loaded ${links.length} task-file links from database`);
|
|
581
|
-
}
|
|
582
|
-
catch (error) {
|
|
583
|
-
debugLog('ERROR', 'Error loading task-file links', { error });
|
|
584
|
-
throw error;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
/**
|
|
588
|
-
* Normalize file path (convert to relative path from project root, remove trailing slashes)
|
|
589
|
-
*/
|
|
590
|
-
normalizePath(filePath) {
|
|
591
|
-
// Convert backslashes to forward slashes (Windows compatibility)
|
|
592
|
-
let normalized = filePath.replace(/\\/g, '/');
|
|
593
|
-
// Remove trailing slashes
|
|
594
|
-
normalized = normalized.replace(/[\/\\]+$/, '');
|
|
595
|
-
// Convert absolute paths to relative paths from project root
|
|
596
|
-
const projectRootNormalized = this.projectRoot.replace(/\\/g, '/');
|
|
597
|
-
if (normalized.startsWith(projectRootNormalized + '/')) {
|
|
598
|
-
normalized = normalized.substring(projectRootNormalized.length + 1);
|
|
599
|
-
}
|
|
600
|
-
else if (normalized.startsWith(projectRootNormalized)) {
|
|
601
|
-
normalized = normalized.substring(projectRootNormalized.length);
|
|
602
|
-
}
|
|
603
|
-
return normalized;
|
|
604
|
-
}
|
|
605
|
-
/**
|
|
606
|
-
* Get total count of tasks being watched
|
|
607
|
-
*/
|
|
608
|
-
getTotalTaskCount() {
|
|
609
|
-
const taskIds = new Set();
|
|
610
|
-
this.watchedFiles.forEach(mappings => {
|
|
611
|
-
mappings.forEach(m => taskIds.add(m.taskId));
|
|
612
|
-
});
|
|
613
|
-
return taskIds.size;
|
|
614
|
-
}
|
|
615
|
-
/**
|
|
616
|
-
* Check if task is ready for review and transition if conditions met
|
|
617
|
-
* Quality gates:
|
|
618
|
-
* - All watched files modified at least once
|
|
619
|
-
* - TypeScript compiles without errors (if .ts files)
|
|
620
|
-
* - Tests pass (if test files exist)
|
|
621
|
-
* - Idle for configured time (default 15 minutes)
|
|
622
|
-
*
|
|
623
|
-
* @param taskId - Task ID to check
|
|
624
|
-
*/
|
|
625
|
-
async checkAndTransitionToReview(taskId) {
|
|
626
|
-
const adapter = getAdapter();
|
|
627
|
-
const knex = adapter.getKnex();
|
|
628
|
-
try {
|
|
629
|
-
// Get current task status
|
|
630
|
-
const task = await knex('v4_tasks as t')
|
|
631
|
-
.join('v4_task_statuses as s', 's.id', 't.status_id')
|
|
632
|
-
.leftJoin('v4_task_details as td', 'td.task_id', 't.id')
|
|
633
|
-
.where({ 't.id': taskId })
|
|
634
|
-
.select('t.status_id', 's.name as status_name', 'td.acceptance_criteria_json')
|
|
635
|
-
.first();
|
|
636
|
-
if (!task) {
|
|
637
|
-
return; // Task not found
|
|
638
|
-
}
|
|
639
|
-
// Only check for in_progress tasks
|
|
640
|
-
if (task.status_name !== 'in_progress') {
|
|
641
|
-
return;
|
|
642
|
-
}
|
|
643
|
-
// Read configuration
|
|
644
|
-
const idleMinutes = await getConfigInt(adapter, CONFIG_KEYS.REVIEW_IDLE_MINUTES, 15);
|
|
645
|
-
const requireAllFilesModified = await getConfigBool(adapter, CONFIG_KEYS.REVIEW_REQUIRE_ALL_FILES_MODIFIED, true);
|
|
646
|
-
const requireTestsPass = await getConfigBool(adapter, CONFIG_KEYS.REVIEW_REQUIRE_TESTS_PASS, true);
|
|
647
|
-
const requireCompile = await getConfigBool(adapter, CONFIG_KEYS.REVIEW_REQUIRE_COMPILE, true);
|
|
648
|
-
// Check idle time
|
|
649
|
-
const lastModified = this.lastModifiedTimes.get(taskId);
|
|
650
|
-
if (!lastModified) {
|
|
651
|
-
return; // No modifications tracked yet
|
|
652
|
-
}
|
|
653
|
-
const idleTimeMs = Date.now() - lastModified;
|
|
654
|
-
const requiredIdleMs = idleMinutes * 60 * 1000;
|
|
655
|
-
if (idleTimeMs < requiredIdleMs) {
|
|
656
|
-
return; // Not idle long enough
|
|
657
|
-
}
|
|
658
|
-
// Get all watched files for this task
|
|
659
|
-
const filePaths = [];
|
|
660
|
-
this.watchedFiles.forEach((mappings, path) => {
|
|
661
|
-
if (mappings.some(m => m.taskId === taskId)) {
|
|
662
|
-
filePaths.push(path);
|
|
663
|
-
}
|
|
664
|
-
});
|
|
665
|
-
if (filePaths.length === 0) {
|
|
666
|
-
return; // No files being watched
|
|
667
|
-
}
|
|
668
|
-
// Get modified files set
|
|
669
|
-
const modifiedFiles = this.filesModifiedSet.get(taskId) || new Set();
|
|
670
|
-
// Run quality checks
|
|
671
|
-
const { ready, results } = await checkReadyForReview(adapter, taskId, filePaths, modifiedFiles, {
|
|
672
|
-
requireAllFilesModified,
|
|
673
|
-
requireTestsPass,
|
|
674
|
-
requireCompile,
|
|
675
|
-
});
|
|
676
|
-
if (ready) {
|
|
677
|
-
// All quality gates passed - transition to waiting_review
|
|
678
|
-
debugLog('INFO', `Quality checks passed for task #${taskId}`);
|
|
679
|
-
// Log individual results
|
|
680
|
-
results.forEach(({ check, result }) => {
|
|
681
|
-
debugLog('INFO', `${check}: ${result.message}`);
|
|
682
|
-
});
|
|
683
|
-
// Get waiting_review status ID
|
|
684
|
-
const waitingReviewStatus = await knex('v4_task_statuses')
|
|
685
|
-
.where({ name: 'waiting_review' })
|
|
686
|
-
.select('id')
|
|
687
|
-
.first();
|
|
688
|
-
if (!waitingReviewStatus) {
|
|
689
|
-
debugLog('ERROR', 'Cannot find waiting_review status');
|
|
690
|
-
return;
|
|
691
|
-
}
|
|
692
|
-
// Update task status
|
|
693
|
-
await knex('v4_tasks')
|
|
694
|
-
.where({ id: taskId })
|
|
695
|
-
.update({
|
|
696
|
-
status_id: waitingReviewStatus.id,
|
|
697
|
-
updated_ts: knex.raw('unixepoch()')
|
|
698
|
-
});
|
|
699
|
-
debugLog('INFO', `Task #${taskId} auto-transitioned to waiting_review`);
|
|
700
|
-
// Clear tracking for this task
|
|
701
|
-
this.lastModifiedTimes.delete(taskId);
|
|
702
|
-
this.filesModifiedSet.delete(taskId);
|
|
703
|
-
}
|
|
704
|
-
else {
|
|
705
|
-
// Some checks failed - log details
|
|
706
|
-
const failedChecks = results.filter(({ result }) => !result.passed);
|
|
707
|
-
debugLog('INFO', `Task #${taskId} not ready for review (${failedChecks.length} checks failed)`);
|
|
708
|
-
failedChecks.forEach(({ check, result }) => {
|
|
709
|
-
const details = result.details ? { details: result.details } : undefined;
|
|
710
|
-
debugLog('INFO', `${check}: ${result.message}`, details);
|
|
711
|
-
});
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
catch (error) {
|
|
715
|
-
// Log error but don't crash the watcher
|
|
716
|
-
debugLog('ERROR', `Error checking review readiness for task #${taskId}`, { error });
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
/**
|
|
720
|
-
* Get current watcher status
|
|
721
|
-
*/
|
|
722
|
-
getStatus() {
|
|
723
|
-
return {
|
|
724
|
-
running: this.isRunning,
|
|
725
|
-
filesWatched: this.watchedFiles.size,
|
|
726
|
-
tasksWatched: this.getTotalTaskCount()
|
|
727
|
-
};
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
//# sourceMappingURL=file-watcher.js.map
|