sqlew 3.6.10 → 3.7.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 +318 -0
- package/README.md +54 -39
- package/assets/config.example.toml +93 -0
- package/assets/kanban-visualizer.png +0 -0
- package/assets/sample-agents/sqlew-architect.md +32 -13
- package/assets/sample-agents/sqlew-researcher.md +70 -17
- package/assets/sample-agents/sqlew-scrum-master.md +60 -25
- package/assets/schema.sql +2 -2
- package/dist/adapters/auth/auth-factory.d.ts +86 -0
- package/dist/adapters/auth/auth-factory.d.ts.map +1 -0
- package/dist/adapters/auth/auth-factory.js +103 -0
- package/dist/adapters/auth/auth-factory.js.map +1 -0
- package/dist/adapters/auth/auth-types.d.ts +30 -0
- package/dist/adapters/auth/auth-types.d.ts.map +1 -0
- package/dist/adapters/auth/auth-types.js +30 -0
- package/dist/adapters/auth/auth-types.js.map +1 -0
- package/dist/adapters/auth/base-auth-provider.d.ts +327 -0
- package/dist/adapters/auth/base-auth-provider.d.ts.map +1 -0
- package/dist/adapters/auth/base-auth-provider.js +111 -0
- package/dist/adapters/auth/base-auth-provider.js.map +1 -0
- package/dist/adapters/auth/direct-auth-provider.d.ts +356 -0
- package/dist/adapters/auth/direct-auth-provider.d.ts.map +1 -0
- package/dist/adapters/auth/direct-auth-provider.js +406 -0
- package/dist/adapters/auth/direct-auth-provider.js.map +1 -0
- package/dist/adapters/base-adapter.d.ts +638 -0
- package/dist/adapters/base-adapter.d.ts.map +1 -0
- package/dist/adapters/base-adapter.js +557 -0
- package/dist/adapters/base-adapter.js.map +1 -0
- package/dist/adapters/index.d.ts +13 -2
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +27 -5
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/mysql-adapter.d.ts +547 -6
- package/dist/adapters/mysql-adapter.d.ts.map +1 -1
- package/dist/adapters/mysql-adapter.js +651 -32
- package/dist/adapters/mysql-adapter.js.map +1 -1
- package/dist/adapters/postgresql-adapter.d.ts +15 -4
- package/dist/adapters/postgresql-adapter.d.ts.map +1 -1
- package/dist/adapters/postgresql-adapter.js +19 -2
- package/dist/adapters/postgresql-adapter.js.map +1 -1
- package/dist/adapters/sqlite-adapter.d.ts +35 -5
- package/dist/adapters/sqlite-adapter.d.ts.map +1 -1
- package/dist/adapters/sqlite-adapter.js +57 -18
- package/dist/adapters/sqlite-adapter.js.map +1 -1
- package/dist/cli/db-dump.d.ts +32 -0
- package/dist/cli/db-dump.d.ts.map +1 -0
- package/dist/cli/db-dump.js +409 -0
- package/dist/cli/db-dump.js.map +1 -0
- package/dist/cli.js +24 -14
- package/dist/cli.js.map +1 -1
- package/dist/config/knex/bootstrap/20251025020452_create_master_tables.d.ts.map +1 -0
- package/dist/{migrations → config}/knex/bootstrap/20251025020452_create_master_tables.js +7 -2
- package/dist/config/knex/bootstrap/20251025020452_create_master_tables.js.map +1 -0
- package/dist/config/knex/bootstrap/20251025021152_create_transaction_tables.d.ts.map +1 -0
- package/dist/{migrations → config}/knex/bootstrap/20251025021152_create_transaction_tables.js +49 -50
- package/dist/config/knex/bootstrap/20251025021152_create_transaction_tables.js.map +1 -0
- package/dist/config/knex/bootstrap/20251025021351_create_indexes.d.ts.map +1 -0
- package/dist/config/knex/bootstrap/20251025021351_create_indexes.js.map +1 -0
- package/dist/config/knex/bootstrap/20251025021416_seed_master_data.d.ts.map +1 -0
- package/dist/{migrations → config}/knex/bootstrap/20251025021416_seed_master_data.js +11 -6
- package/dist/config/knex/bootstrap/20251025021416_seed_master_data.js.map +1 -0
- package/dist/config/knex/bootstrap/20251025070349_create_views.d.ts.map +1 -0
- package/dist/{migrations → config}/knex/bootstrap/20251025070349_create_views.js +66 -14
- package/dist/config/knex/bootstrap/20251025070349_create_views.js.map +1 -0
- package/dist/config/knex/enhancements/20251025081221_add_link_type_to_task_decision_links.d.ts.map +1 -0
- package/dist/config/knex/enhancements/20251025081221_add_link_type_to_task_decision_links.js +22 -0
- package/dist/config/knex/enhancements/20251025081221_add_link_type_to_task_decision_links.js.map +1 -0
- package/dist/config/knex/enhancements/20251025082220_fix_task_dependencies_columns.d.ts.map +1 -0
- package/dist/config/knex/enhancements/20251025082220_fix_task_dependencies_columns.js.map +1 -0
- package/dist/config/knex/enhancements/20251025090000_create_help_system_tables.d.ts.map +1 -0
- package/dist/{migrations → config}/knex/enhancements/20251025090000_create_help_system_tables.js +6 -0
- package/dist/config/knex/enhancements/20251025090000_create_help_system_tables.js.map +1 -0
- package/dist/config/knex/enhancements/20251025090100_seed_help_categories_and_use_cases.d.ts.map +1 -0
- package/dist/{migrations → config}/knex/enhancements/20251025090100_seed_help_categories_and_use_cases.js +6 -0
- package/dist/config/knex/enhancements/20251025090100_seed_help_categories_and_use_cases.js.map +1 -0
- package/dist/config/knex/enhancements/20251025100000_seed_help_metadata.d.ts.map +1 -0
- package/dist/{migrations → config}/knex/enhancements/20251025100000_seed_help_metadata.js +6 -0
- package/dist/config/knex/enhancements/20251025100000_seed_help_metadata.js.map +1 -0
- package/dist/config/knex/enhancements/20251025100100_seed_remaining_use_cases.d.ts.map +1 -0
- package/dist/config/knex/enhancements/20251025100100_seed_remaining_use_cases.js.map +1 -0
- package/dist/config/knex/enhancements/20251025120000_add_cascade_to_task_dependencies.d.ts.map +1 -0
- package/dist/{migrations → config}/knex/enhancements/20251025120000_add_cascade_to_task_dependencies.js +7 -0
- package/dist/config/knex/enhancements/20251025120000_add_cascade_to_task_dependencies.js.map +1 -0
- package/dist/config/knex/enhancements/20251027000000_add_agent_reuse_system.d.ts.map +1 -0
- package/dist/config/knex/enhancements/20251027000000_add_agent_reuse_system.js +62 -0
- package/dist/config/knex/enhancements/20251027000000_add_agent_reuse_system.js.map +1 -0
- package/dist/config/knex/enhancements/20251027010000_add_task_constraint_to_decision_context.d.ts.map +1 -0
- package/dist/config/knex/enhancements/20251027010000_add_task_constraint_to_decision_context.js.map +1 -0
- package/dist/config/knex/enhancements/20251027020000_update_agent_reusability.d.ts.map +1 -0
- package/dist/{migrations → config}/knex/enhancements/20251027020000_update_agent_reusability.js +6 -0
- package/dist/config/knex/enhancements/20251027020000_update_agent_reusability.js.map +1 -0
- package/dist/config/knex/enhancements/20251028000000_simplify_agent_system.d.ts.map +1 -0
- package/dist/{migrations → config}/knex/enhancements/20251028000000_simplify_agent_system.js +6 -0
- package/dist/config/knex/enhancements/20251028000000_simplify_agent_system.js.map +1 -0
- package/dist/config/knex/enhancements/20251031000000_drop_orphaned_message_view.d.ts +13 -0
- package/dist/config/knex/enhancements/20251031000000_drop_orphaned_message_view.d.ts.map +1 -0
- package/dist/config/knex/enhancements/20251031000000_drop_orphaned_message_view.js +48 -0
- package/dist/config/knex/enhancements/20251031000000_drop_orphaned_message_view.js.map +1 -0
- package/dist/config/knex/enhancements/20251104000003_rename_constraints_created_by_to_agent_id.d.ts +24 -0
- package/dist/config/knex/enhancements/20251104000003_rename_constraints_created_by_to_agent_id.d.ts.map +1 -0
- package/dist/config/knex/enhancements/20251104000003_rename_constraints_created_by_to_agent_id.js +189 -0
- package/dist/config/knex/enhancements/20251104000003_rename_constraints_created_by_to_agent_id.js.map +1 -0
- package/dist/config/knex/enhancements/20251105000000_add_token_usage_table.d.ts +16 -0
- package/dist/config/knex/enhancements/20251105000000_add_token_usage_table.d.ts.map +1 -0
- package/dist/config/knex/enhancements/20251105000000_add_token_usage_table.js +65 -0
- package/dist/config/knex/enhancements/20251105000000_add_token_usage_table.js.map +1 -0
- package/dist/config/knex/enhancements/20251105000001_rename_decision_context_decided_by_to_agent_id.d.ts +23 -0
- package/dist/config/knex/enhancements/20251105000001_rename_decision_context_decided_by_to_agent_id.d.ts.map +1 -0
- package/dist/config/knex/enhancements/20251105000001_rename_decision_context_decided_by_to_agent_id.js +118 -0
- package/dist/config/knex/enhancements/20251105000001_rename_decision_context_decided_by_to_agent_id.js.map +1 -0
- package/dist/config/knex/upgrades/20251024010000_upgrade_v1_0_to_v1_1.d.ts.map +1 -0
- package/dist/config/knex/upgrades/20251024010000_upgrade_v1_0_to_v1_1.js.map +1 -0
- package/dist/config/knex/upgrades/20251024020000_upgrade_v2_0_to_v2_1.d.ts.map +1 -0
- package/dist/config/knex/upgrades/20251024020000_upgrade_v2_0_to_v2_1.js.map +1 -0
- package/dist/config/knex/upgrades/20251024030000_upgrade_v2_1_to_v3_0.d.ts.map +1 -0
- package/dist/config/knex/upgrades/20251024030000_upgrade_v2_1_to_v3_0.js.map +1 -0
- package/dist/config/knex/upgrades/20251024040000_upgrade_v3_0_to_v3_2.d.ts.map +1 -0
- package/dist/config/knex/upgrades/20251024040000_upgrade_v3_0_to_v3_2.js.map +1 -0
- package/dist/config/knex/upgrades/20251024050000_upgrade_v3_2_0_to_v3_2_2.d.ts.map +1 -0
- package/dist/config/knex/upgrades/20251024050000_upgrade_v3_2_0_to_v3_2_2.js.map +1 -0
- package/dist/config/knex/upgrades/20251024060000_upgrade_v3_4_to_v3_5.d.ts.map +1 -0
- package/dist/config/knex/upgrades/20251024060000_upgrade_v3_4_to_v3_5.js.map +1 -0
- package/dist/config/knex/upgrades/20251024070000_upgrade_v3_5_to_v3_6.d.ts.map +1 -0
- package/dist/config/knex/upgrades/20251024070000_upgrade_v3_5_to_v3_6.js.map +1 -0
- package/dist/config/knex/upgrades/20251104000000_add_multi_project_v3_7_0.d.ts +49 -0
- package/dist/config/knex/upgrades/20251104000000_add_multi_project_v3_7_0.d.ts.map +1 -0
- package/dist/config/knex/upgrades/20251104000000_add_multi_project_v3_7_0.js +864 -0
- package/dist/config/knex/upgrades/20251104000000_add_multi_project_v3_7_0.js.map +1 -0
- package/dist/config/loader.d.ts +19 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +149 -4
- package/dist/config/loader.js.map +1 -1
- package/dist/config/types.d.ts +261 -2
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js.map +1 -1
- package/dist/config/writer.d.ts +65 -0
- package/dist/config/writer.d.ts.map +1 -0
- package/dist/config/writer.js +139 -0
- package/dist/config/writer.js.map +1 -0
- package/dist/database.d.ts +11 -2
- package/dist/database.d.ts.map +1 -1
- package/dist/database.js +62 -6
- package/dist/database.js.map +1 -1
- package/dist/index.js +165 -35
- package/dist/index.js.map +1 -1
- package/dist/knexfile.d.ts.map +1 -1
- package/dist/knexfile.js +88 -12
- package/dist/knexfile.js.map +1 -1
- package/dist/tests/all-features.test.js +15 -3
- package/dist/tests/all-features.test.js.map +1 -1
- package/dist/tests/config-loader.test.d.ts +6 -0
- package/dist/tests/config-loader.test.d.ts.map +1 -0
- package/dist/tests/config-loader.test.js +201 -0
- package/dist/tests/config-loader.test.js.map +1 -0
- package/dist/tests/connection-manager-integration.test.d.ts +2 -0
- package/dist/tests/connection-manager-integration.test.d.ts.map +1 -0
- package/dist/tests/connection-manager-integration.test.js +431 -0
- package/dist/tests/connection-manager-integration.test.js.map +1 -0
- package/dist/tests/connection-manager.test.d.ts +2 -0
- package/dist/tests/connection-manager.test.d.ts.map +1 -0
- package/dist/tests/connection-manager.test.js +361 -0
- package/dist/tests/connection-manager.test.js.map +1 -0
- package/dist/tests/dump-import.test.d.ts +15 -0
- package/dist/tests/dump-import.test.d.ts.map +1 -0
- package/dist/tests/dump-import.test.js +430 -0
- package/dist/tests/dump-import.test.js.map +1 -0
- package/dist/tests/migration-idempotency.test.d.ts +2 -0
- package/dist/tests/migration-idempotency.test.d.ts.map +1 -0
- package/dist/tests/migration-idempotency.test.js +330 -0
- package/dist/tests/migration-idempotency.test.js.map +1 -0
- package/dist/tests/migration-upgrade-paths.test.d.ts +2 -0
- package/dist/tests/migration-upgrade-paths.test.d.ts.map +1 -0
- package/dist/tests/migration-upgrade-paths.test.js +248 -0
- package/dist/tests/migration-upgrade-paths.test.js.map +1 -0
- package/dist/tests/multi-project-migration.test.d.ts +17 -0
- package/dist/tests/multi-project-migration.test.d.ts.map +1 -0
- package/dist/tests/multi-project-migration.test.js +399 -0
- package/dist/tests/multi-project-migration.test.js.map +1 -0
- package/dist/tests/multi-project.test.d.ts +5 -0
- package/dist/tests/multi-project.test.d.ts.map +1 -0
- package/dist/tests/multi-project.test.js +238 -0
- package/dist/tests/multi-project.test.js.map +1 -0
- package/dist/tests/schema-migration.test.d.ts +8 -0
- package/dist/tests/schema-migration.test.d.ts.map +1 -0
- package/dist/tests/schema-migration.test.js +108 -0
- package/dist/tests/schema-migration.test.js.map +1 -0
- package/dist/tests/sql-dump-converters.test.d.ts +7 -0
- package/dist/tests/sql-dump-converters.test.d.ts.map +1 -0
- package/dist/tests/sql-dump-converters.test.js +314 -0
- package/dist/tests/sql-dump-converters.test.js.map +1 -0
- package/dist/tests/sql-dump-cross-database.test.d.ts +21 -0
- package/dist/tests/sql-dump-cross-database.test.d.ts.map +1 -0
- package/dist/tests/sql-dump-cross-database.test.js +314 -0
- package/dist/tests/sql-dump-cross-database.test.js.map +1 -0
- package/dist/tests/sql-dump-default-conversions.test.d.ts +8 -0
- package/dist/tests/sql-dump-default-conversions.test.d.ts.map +1 -0
- package/dist/tests/sql-dump-default-conversions.test.js +141 -0
- package/dist/tests/sql-dump-default-conversions.test.js.map +1 -0
- package/dist/tests/sql-dump-fk-constraints.test.d.ts +13 -0
- package/dist/tests/sql-dump-fk-constraints.test.d.ts.map +1 -0
- package/dist/tests/sql-dump-fk-constraints.test.js +381 -0
- package/dist/tests/sql-dump-fk-constraints.test.js.map +1 -0
- package/dist/tests/sql-dump-indexes.test.d.ts +12 -0
- package/dist/tests/sql-dump-indexes.test.d.ts.map +1 -0
- package/dist/tests/sql-dump-indexes.test.js +269 -0
- package/dist/tests/sql-dump-indexes.test.js.map +1 -0
- package/dist/tests/sql-dump-integration.test.d.ts +16 -0
- package/dist/tests/sql-dump-integration.test.d.ts.map +1 -0
- package/dist/tests/sql-dump-integration.test.js +342 -0
- package/dist/tests/sql-dump-integration.test.js.map +1 -0
- package/dist/tests/sql-dump-table-ordering.test.d.ts +8 -0
- package/dist/tests/sql-dump-table-ordering.test.d.ts.map +1 -0
- package/dist/tests/sql-dump-table-ordering.test.js +253 -0
- package/dist/tests/sql-dump-table-ordering.test.js.map +1 -0
- package/dist/tests/tasks.link-file-backward-compat.test.js +11 -1
- package/dist/tests/tasks.link-file-backward-compat.test.js.map +1 -1
- package/dist/tests/tasks.watch-files-action.test.js +11 -1
- package/dist/tests/tasks.watch-files-action.test.js.map +1 -1
- package/dist/tests/type-conversion.test.d.ts +8 -0
- package/dist/tests/type-conversion.test.d.ts.map +1 -0
- package/dist/tests/type-conversion.test.js +312 -0
- package/dist/tests/type-conversion.test.js.map +1 -0
- package/dist/tests/utils/test-helpers.d.ts +93 -0
- package/dist/tests/utils/test-helpers.d.ts.map +1 -0
- package/dist/tests/utils/test-helpers.js +407 -0
- package/dist/tests/utils/test-helpers.js.map +1 -0
- package/dist/tools/config.d.ts +58 -0
- package/dist/tools/config.d.ts.map +1 -0
- package/dist/tools/config.js +281 -0
- package/dist/tools/config.js.map +1 -0
- package/dist/tools/constraints.d.ts.map +1 -1
- package/dist/tools/constraints.js +138 -122
- package/dist/tools/constraints.js.map +1 -1
- package/dist/tools/context.d.ts.map +1 -1
- package/dist/tools/context.js +216 -109
- package/dist/tools/context.js.map +1 -1
- package/dist/tools/files.d.ts.map +1 -1
- package/dist/tools/files.js +123 -102
- package/dist/tools/files.js.map +1 -1
- package/dist/tools/tasks.d.ts.map +1 -1
- package/dist/tools/tasks.js +581 -518
- package/dist/tools/tasks.js.map +1 -1
- package/dist/tools/utils.d.ts +5 -0
- package/dist/tools/utils.d.ts.map +1 -1
- package/dist/tools/utils.js +176 -122
- package/dist/tools/utils.js.map +1 -1
- package/dist/types.d.ts +9 -26
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/cleanup.d.ts +3 -0
- package/dist/utils/cleanup.d.ts.map +1 -1
- package/dist/utils/cleanup.js +14 -2
- package/dist/utils/cleanup.js.map +1 -1
- package/dist/utils/connection-manager.d.ts +59 -0
- package/dist/utils/connection-manager.d.ts.map +1 -0
- package/dist/utils/connection-manager.js +178 -0
- package/dist/utils/connection-manager.js.map +1 -0
- package/dist/utils/debug-logger.d.ts +8 -4
- package/dist/utils/debug-logger.d.ts.map +1 -1
- package/dist/utils/debug-logger.js +27 -7
- package/dist/utils/debug-logger.js.map +1 -1
- package/dist/utils/error-handler.d.ts +2 -2
- package/dist/utils/error-handler.d.ts.map +1 -1
- package/dist/utils/error-handler.js +10 -7
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/parameter-validator.d.ts.map +1 -1
- package/dist/utils/parameter-validator.js +36 -15
- package/dist/utils/parameter-validator.js.map +1 -1
- package/dist/utils/project-context.d.ts +111 -0
- package/dist/utils/project-context.d.ts.map +1 -0
- package/dist/utils/project-context.js +187 -0
- package/dist/utils/project-context.js.map +1 -0
- package/dist/utils/sql-dump-converters.d.ts +188 -0
- package/dist/utils/sql-dump-converters.d.ts.map +1 -0
- package/dist/utils/sql-dump-converters.js +311 -0
- package/dist/utils/sql-dump-converters.js.map +1 -0
- package/dist/utils/sql-dump.d.ts +102 -0
- package/dist/utils/sql-dump.d.ts.map +1 -0
- package/dist/utils/sql-dump.js +1550 -0
- package/dist/utils/sql-dump.js.map +1 -0
- package/dist/utils/vcs-adapter.d.ts +42 -0
- package/dist/utils/vcs-adapter.d.ts.map +1 -1
- package/dist/utils/vcs-adapter.js +154 -0
- package/dist/utils/vcs-adapter.js.map +1 -1
- package/docs/BASEADAPTER_IMPLEMENTATION.md +399 -0
- package/docs/DATABASE_AUTH.md +445 -0
- package/docs/DATABASE_MIGRATION.md +247 -0
- package/docs/MULTI_PROJECT_ARCHITECTURE.md +497 -0
- package/package.json +12 -4
- package/dist/migrations/knex/bootstrap/20251025020452_create_master_tables.d.ts.map +0 -1
- package/dist/migrations/knex/bootstrap/20251025020452_create_master_tables.js.map +0 -1
- package/dist/migrations/knex/bootstrap/20251025021152_create_transaction_tables.d.ts.map +0 -1
- package/dist/migrations/knex/bootstrap/20251025021152_create_transaction_tables.js.map +0 -1
- package/dist/migrations/knex/bootstrap/20251025021351_create_indexes.d.ts.map +0 -1
- package/dist/migrations/knex/bootstrap/20251025021351_create_indexes.js.map +0 -1
- package/dist/migrations/knex/bootstrap/20251025021416_seed_master_data.d.ts.map +0 -1
- package/dist/migrations/knex/bootstrap/20251025021416_seed_master_data.js.map +0 -1
- package/dist/migrations/knex/bootstrap/20251025070349_create_views.d.ts.map +0 -1
- package/dist/migrations/knex/bootstrap/20251025070349_create_views.js.map +0 -1
- package/dist/migrations/knex/enhancements/20251025081221_add_link_type_to_task_decision_links.d.ts.map +0 -1
- package/dist/migrations/knex/enhancements/20251025081221_add_link_type_to_task_decision_links.js +0 -15
- package/dist/migrations/knex/enhancements/20251025081221_add_link_type_to_task_decision_links.js.map +0 -1
- package/dist/migrations/knex/enhancements/20251025082220_fix_task_dependencies_columns.d.ts.map +0 -1
- package/dist/migrations/knex/enhancements/20251025082220_fix_task_dependencies_columns.js.map +0 -1
- package/dist/migrations/knex/enhancements/20251025090000_create_help_system_tables.d.ts.map +0 -1
- package/dist/migrations/knex/enhancements/20251025090000_create_help_system_tables.js.map +0 -1
- package/dist/migrations/knex/enhancements/20251025090100_seed_help_categories_and_use_cases.d.ts.map +0 -1
- package/dist/migrations/knex/enhancements/20251025090100_seed_help_categories_and_use_cases.js.map +0 -1
- package/dist/migrations/knex/enhancements/20251025100000_seed_help_metadata.d.ts.map +0 -1
- package/dist/migrations/knex/enhancements/20251025100000_seed_help_metadata.js.map +0 -1
- package/dist/migrations/knex/enhancements/20251025100100_seed_remaining_use_cases.d.ts.map +0 -1
- package/dist/migrations/knex/enhancements/20251025100100_seed_remaining_use_cases.js.map +0 -1
- package/dist/migrations/knex/enhancements/20251025120000_add_cascade_to_task_dependencies.d.ts.map +0 -1
- package/dist/migrations/knex/enhancements/20251025120000_add_cascade_to_task_dependencies.js.map +0 -1
- package/dist/migrations/knex/enhancements/20251027000000_add_agent_reuse_system.d.ts.map +0 -1
- package/dist/migrations/knex/enhancements/20251027000000_add_agent_reuse_system.js +0 -34
- package/dist/migrations/knex/enhancements/20251027000000_add_agent_reuse_system.js.map +0 -1
- package/dist/migrations/knex/enhancements/20251027010000_add_task_constraint_to_decision_context.d.ts.map +0 -1
- package/dist/migrations/knex/enhancements/20251027010000_add_task_constraint_to_decision_context.js.map +0 -1
- package/dist/migrations/knex/enhancements/20251027020000_update_agent_reusability.d.ts.map +0 -1
- package/dist/migrations/knex/enhancements/20251027020000_update_agent_reusability.js.map +0 -1
- package/dist/migrations/knex/enhancements/20251028000000_simplify_agent_system.d.ts.map +0 -1
- package/dist/migrations/knex/enhancements/20251028000000_simplify_agent_system.js.map +0 -1
- package/dist/migrations/knex/upgrades/20251024010000_upgrade_v1_0_to_v1_1.d.ts.map +0 -1
- package/dist/migrations/knex/upgrades/20251024010000_upgrade_v1_0_to_v1_1.js.map +0 -1
- package/dist/migrations/knex/upgrades/20251024020000_upgrade_v2_0_to_v2_1.d.ts.map +0 -1
- package/dist/migrations/knex/upgrades/20251024020000_upgrade_v2_0_to_v2_1.js.map +0 -1
- package/dist/migrations/knex/upgrades/20251024030000_upgrade_v2_1_to_v3_0.d.ts.map +0 -1
- package/dist/migrations/knex/upgrades/20251024030000_upgrade_v2_1_to_v3_0.js.map +0 -1
- package/dist/migrations/knex/upgrades/20251024040000_upgrade_v3_0_to_v3_2.d.ts.map +0 -1
- package/dist/migrations/knex/upgrades/20251024040000_upgrade_v3_0_to_v3_2.js.map +0 -1
- package/dist/migrations/knex/upgrades/20251024050000_upgrade_v3_2_0_to_v3_2_2.d.ts.map +0 -1
- package/dist/migrations/knex/upgrades/20251024050000_upgrade_v3_2_0_to_v3_2_2.js.map +0 -1
- package/dist/migrations/knex/upgrades/20251024060000_upgrade_v3_4_to_v3_5.d.ts.map +0 -1
- package/dist/migrations/knex/upgrades/20251024060000_upgrade_v3_4_to_v3_5.js.map +0 -1
- package/dist/migrations/knex/upgrades/20251024070000_upgrade_v3_5_to_v3_6.d.ts.map +0 -1
- package/dist/migrations/knex/upgrades/20251024070000_upgrade_v3_5_to_v3_6.js.map +0 -1
- /package/dist/{migrations → config}/knex/bootstrap/20251025020452_create_master_tables.d.ts +0 -0
- /package/dist/{migrations → config}/knex/bootstrap/20251025021152_create_transaction_tables.d.ts +0 -0
- /package/dist/{migrations → config}/knex/bootstrap/20251025021351_create_indexes.d.ts +0 -0
- /package/dist/{migrations → config}/knex/bootstrap/20251025021351_create_indexes.js +0 -0
- /package/dist/{migrations → config}/knex/bootstrap/20251025021416_seed_master_data.d.ts +0 -0
- /package/dist/{migrations → config}/knex/bootstrap/20251025070349_create_views.d.ts +0 -0
- /package/dist/{migrations → config}/knex/enhancements/20251025081221_add_link_type_to_task_decision_links.d.ts +0 -0
- /package/dist/{migrations → config}/knex/enhancements/20251025082220_fix_task_dependencies_columns.d.ts +0 -0
- /package/dist/{migrations → config}/knex/enhancements/20251025082220_fix_task_dependencies_columns.js +0 -0
- /package/dist/{migrations → config}/knex/enhancements/20251025090000_create_help_system_tables.d.ts +0 -0
- /package/dist/{migrations → config}/knex/enhancements/20251025090100_seed_help_categories_and_use_cases.d.ts +0 -0
- /package/dist/{migrations → config}/knex/enhancements/20251025100000_seed_help_metadata.d.ts +0 -0
- /package/dist/{migrations → config}/knex/enhancements/20251025100100_seed_remaining_use_cases.d.ts +0 -0
- /package/dist/{migrations → config}/knex/enhancements/20251025100100_seed_remaining_use_cases.js +0 -0
- /package/dist/{migrations → config}/knex/enhancements/20251025120000_add_cascade_to_task_dependencies.d.ts +0 -0
- /package/dist/{migrations → config}/knex/enhancements/20251027000000_add_agent_reuse_system.d.ts +0 -0
- /package/dist/{migrations → config}/knex/enhancements/20251027010000_add_task_constraint_to_decision_context.d.ts +0 -0
- /package/dist/{migrations → config}/knex/enhancements/20251027010000_add_task_constraint_to_decision_context.js +0 -0
- /package/dist/{migrations → config}/knex/enhancements/20251027020000_update_agent_reusability.d.ts +0 -0
- /package/dist/{migrations → config}/knex/enhancements/20251028000000_simplify_agent_system.d.ts +0 -0
- /package/dist/{migrations → config}/knex/upgrades/20251024010000_upgrade_v1_0_to_v1_1.d.ts +0 -0
- /package/dist/{migrations → config}/knex/upgrades/20251024010000_upgrade_v1_0_to_v1_1.js +0 -0
- /package/dist/{migrations → config}/knex/upgrades/20251024020000_upgrade_v2_0_to_v2_1.d.ts +0 -0
- /package/dist/{migrations → config}/knex/upgrades/20251024020000_upgrade_v2_0_to_v2_1.js +0 -0
- /package/dist/{migrations → config}/knex/upgrades/20251024030000_upgrade_v2_1_to_v3_0.d.ts +0 -0
- /package/dist/{migrations → config}/knex/upgrades/20251024030000_upgrade_v2_1_to_v3_0.js +0 -0
- /package/dist/{migrations → config}/knex/upgrades/20251024040000_upgrade_v3_0_to_v3_2.d.ts +0 -0
- /package/dist/{migrations → config}/knex/upgrades/20251024040000_upgrade_v3_0_to_v3_2.js +0 -0
- /package/dist/{migrations → config}/knex/upgrades/20251024050000_upgrade_v3_2_0_to_v3_2_2.d.ts +0 -0
- /package/dist/{migrations → config}/knex/upgrades/20251024050000_upgrade_v3_2_0_to_v3_2_2.js +0 -0
- /package/dist/{migrations → config}/knex/upgrades/20251024060000_upgrade_v3_4_to_v3_5.d.ts +0 -0
- /package/dist/{migrations → config}/knex/upgrades/20251024060000_upgrade_v3_4_to_v3_5.js +0 -0
- /package/dist/{migrations → config}/knex/upgrades/20251024070000_upgrade_v3_5_to_v3_6.d.ts +0 -0
- /package/dist/{migrations → config}/knex/upgrades/20251024070000_upgrade_v3_5_to_v3_6.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,166 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [3.7.0] - 2025-11-05
|
|
11
|
+
|
|
12
|
+
### Added - Runtime Database Reconnection
|
|
13
|
+
|
|
14
|
+
**Automatic connection recovery with exponential backoff retry logic**
|
|
15
|
+
|
|
16
|
+
#### Features
|
|
17
|
+
- **ConnectionManager** - Singleton wrapper for all database operations
|
|
18
|
+
- **Exponential Backoff** - Retry delays: 1s → 2s → 4s → 8s → 16s (31 seconds total)
|
|
19
|
+
- **Smart Error Detection** - Recognizes connection errors across SQLite, MySQL, PostgreSQL
|
|
20
|
+
- **Process.exit on Exhaustion** - Exits cleanly after 5 failed retries
|
|
21
|
+
- **27 Operations Wrapped** - All transactional operations protected:
|
|
22
|
+
- context.ts: 5 operations
|
|
23
|
+
- tasks.ts: 9 operations
|
|
24
|
+
- files.ts: 3 operations
|
|
25
|
+
- constraints.ts: 3 operations
|
|
26
|
+
- config.ts: 2 operations
|
|
27
|
+
- utils.ts: 5 operations
|
|
28
|
+
|
|
29
|
+
#### Connection Error Patterns Detected
|
|
30
|
+
- **Network Errors**: ECONNREFUSED, ENOTFOUND, ETIMEDOUT, ECONNRESET, EPIPE
|
|
31
|
+
- **SQLite**: "database is locked", "unable to open database"
|
|
32
|
+
- **MySQL/MariaDB**: "server has gone away", "lost connection to mysql server"
|
|
33
|
+
- **PostgreSQL**: "connection to server was lost", "could not connect to server"
|
|
34
|
+
- **Knex-specific**: "timeout acquiring a connection", "pool is destroyed"
|
|
35
|
+
|
|
36
|
+
#### Test Coverage
|
|
37
|
+
- **41 tests passing** (22 unit + 19 integration)
|
|
38
|
+
- Retry behavior verification
|
|
39
|
+
- Production scenario simulation (server restart, network failures)
|
|
40
|
+
- Tool integration testing
|
|
41
|
+
|
|
42
|
+
#### Impact
|
|
43
|
+
- ✅ **Resilient operations** - Automatic recovery from transient connection failures
|
|
44
|
+
- ✅ **Production ready** - Handles server restarts, network issues
|
|
45
|
+
- ✅ **Zero regressions** - All existing tests pass
|
|
46
|
+
- ✅ **Token efficient** - No manual retry logic needed in agent code
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
### Changed - Validation Error Messages
|
|
51
|
+
|
|
52
|
+
**70-85% token reduction in error message size**
|
|
53
|
+
|
|
54
|
+
#### Token Efficiency
|
|
55
|
+
- **Before**: ~1000+ characters (~300+ tokens) with full examples embedded
|
|
56
|
+
- **After**: ~200 characters (~50 tokens) with reference IDs
|
|
57
|
+
- **Reduction**: 70-85% token savings
|
|
58
|
+
|
|
59
|
+
#### New Error Format
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"error": "Missing: key, value",
|
|
63
|
+
"action": "set",
|
|
64
|
+
"reference": "decision.set",
|
|
65
|
+
"missing": ["key", "value"],
|
|
66
|
+
"hint": "Use 'quick_set' for simpler usage..."
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### Features
|
|
71
|
+
- **Reference IDs** - Compact `{tool}.{action}` format (e.g., "decision.set")
|
|
72
|
+
- **Concise Messages** - Essential information only
|
|
73
|
+
- **Conditional Fields** - Only include fields when present
|
|
74
|
+
- **Self-Documenting** - AI can query `action: "help"` for full docs if needed
|
|
75
|
+
|
|
76
|
+
#### Error Types
|
|
77
|
+
- Missing params: `"Missing: key, value"`
|
|
78
|
+
- Typos: `"Invalid params: val → value"`
|
|
79
|
+
- Unknown action: `"Unknown action 'sett'. Did you mean: set?"`
|
|
80
|
+
|
|
81
|
+
#### Impact
|
|
82
|
+
- ✅ **Token efficiency** - 70-85% reduction in error size
|
|
83
|
+
- ✅ **Cost reduction** - Lower API costs for AI agents
|
|
84
|
+
- ✅ **Better UX** - Quick, scannable errors
|
|
85
|
+
- ✅ **Backward compatible** - Error structure unchanged
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### Changed - Debug Log Format
|
|
90
|
+
|
|
91
|
+
**Single-line log entries for easier parsing**
|
|
92
|
+
|
|
93
|
+
#### Problem
|
|
94
|
+
Multi-line log messages broke standard text processing tools (grep, awk, log rotation).
|
|
95
|
+
|
|
96
|
+
#### Solution
|
|
97
|
+
- **Sanitization Function** - Replaces newlines with spaces, collapses whitespace
|
|
98
|
+
- **Applied To**: All log messages, data values, JSON output
|
|
99
|
+
- **Result**: Every log entry is exactly one line
|
|
100
|
+
|
|
101
|
+
#### Benefits
|
|
102
|
+
- ✅ **Easier parsing** - Line-based tools work correctly
|
|
103
|
+
- ✅ **Better grep** - Search across entire messages
|
|
104
|
+
- ✅ **Simpler analysis** - Standard text processing
|
|
105
|
+
- ✅ **Cleaner output** - No unexpected line breaks
|
|
106
|
+
|
|
107
|
+
#### Example
|
|
108
|
+
**Before:**
|
|
109
|
+
```
|
|
110
|
+
[2025-11-05T02:00:00.000Z] [ERROR] Error details:
|
|
111
|
+
Stack trace line 1
|
|
112
|
+
Stack trace line 2
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**After:**
|
|
116
|
+
```
|
|
117
|
+
[2025-11-05T02:00:00.000Z] [ERROR] Error details: Stack trace line 1 Stack trace line 2
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
### Fixed - Multi-Project Migration (Critical)
|
|
123
|
+
|
|
124
|
+
**Fixed migration for ALL users upgrading from v3.6.10 to v3.7.0**
|
|
125
|
+
|
|
126
|
+
#### Problem
|
|
127
|
+
- SQLite's `ALTER TABLE` silently failed for 4 tables with complex foreign keys
|
|
128
|
+
- Migration reported success but columns weren't added
|
|
129
|
+
- Task creation would fail: `"table t_task_details has no column named project_id"`
|
|
130
|
+
|
|
131
|
+
#### Root Cause
|
|
132
|
+
SQLite cannot modify tables with `ON DELETE CASCADE` constraints using ALTER TABLE.
|
|
133
|
+
|
|
134
|
+
#### Solution
|
|
135
|
+
- **Table Recreation Strategy** - Backup → Drop → Recreate → Restore
|
|
136
|
+
- **4 Tables Fixed**:
|
|
137
|
+
- `t_task_details` (STEP 4.7)
|
|
138
|
+
- `t_task_file_links` (STEP 4.8)
|
|
139
|
+
- `t_task_decision_links` (STEP 4.9)
|
|
140
|
+
- `t_task_tags` (composite PRIMARY KEY)
|
|
141
|
+
|
|
142
|
+
#### Idempotency
|
|
143
|
+
All recreation steps check if `project_id` exists before executing:
|
|
144
|
+
```typescript
|
|
145
|
+
const hasProjectId = await knex.schema.hasColumn('table_name', 'project_id');
|
|
146
|
+
if (!hasProjectId) {
|
|
147
|
+
// Recreation logic
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### Data Preservation Verified
|
|
152
|
+
- ✅ 223 task detail rows preserved
|
|
153
|
+
- ✅ 632 task tag rows preserved
|
|
154
|
+
- ✅ All task links preserved
|
|
155
|
+
- ✅ 100% data integrity maintained
|
|
156
|
+
|
|
157
|
+
#### Testing
|
|
158
|
+
- ✅ Fresh installation works
|
|
159
|
+
- ✅ v3.6.10 → v3.7.0 upgrade works
|
|
160
|
+
- ✅ Migration can be re-run safely (idempotent)
|
|
161
|
+
- ✅ TypeScript compiles without errors
|
|
162
|
+
|
|
163
|
+
#### Impact
|
|
164
|
+
- ✅ **Production ready** - Safe for all v3.6.10 users to upgrade
|
|
165
|
+
- ✅ **No data loss** - All existing data preserved
|
|
166
|
+
- ✅ **Idempotent** - Can re-run without errors
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
10
170
|
## [3.6.10] - 2025-10-30
|
|
11
171
|
|
|
12
172
|
### Added - Environment Variable Support for Project Root
|
|
@@ -88,6 +248,164 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
88
248
|
|
|
89
249
|
---
|
|
90
250
|
|
|
251
|
+
### Added - Environment Variable Support for Project Root
|
|
252
|
+
|
|
253
|
+
**New `SQLEW_PROJECT_ROOT` environment variable for project-relative databases**
|
|
254
|
+
|
|
255
|
+
#### Problem
|
|
256
|
+
- Junie AI and other MCP clients require absolute paths in configuration
|
|
257
|
+
- Users had to hardcode project-specific paths in MCP server config
|
|
258
|
+
- No easy way to use project-relative database paths
|
|
259
|
+
|
|
260
|
+
#### Solution
|
|
261
|
+
- Added `SQLEW_PROJECT_ROOT` environment variable support (inspired by serena-mcp pattern)
|
|
262
|
+
- MCP clients can now pass project directory via environment variable
|
|
263
|
+
- Database automatically created at `$SQLEW_PROJECT_ROOT/.sqlew/sqlew.db`
|
|
264
|
+
|
|
265
|
+
#### Priority Order
|
|
266
|
+
1. `SQLEW_PROJECT_ROOT` environment variable (NEW - highest priority)
|
|
267
|
+
2. `--db-path` CLI argument (absolute path)
|
|
268
|
+
3. `--config-path` CLI argument (absolute path)
|
|
269
|
+
4. `database.path` in config file (absolute path)
|
|
270
|
+
5. `process.cwd()` fallback
|
|
271
|
+
|
|
272
|
+
#### Junie AI Configuration Example
|
|
273
|
+
```json
|
|
274
|
+
{
|
|
275
|
+
"mcpServers": {
|
|
276
|
+
"sqlew": {
|
|
277
|
+
"command": "npx",
|
|
278
|
+
"args": ["sqlew"],
|
|
279
|
+
"env": {
|
|
280
|
+
"SQLEW_PROJECT_ROOT": "{projectDir}"
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Note:** Junie AI uses `{projectDir}` variable which expands to the current project's absolute path. This ensures each project gets its own isolated database without hardcoded paths. Other MCP clients may use different variable names like `${workspaceFolder}` (VS Code/Cline) - check your client's documentation.
|
|
288
|
+
|
|
289
|
+
#### Impact
|
|
290
|
+
- ✅ **Project-relative databases** without hardcoded absolute paths
|
|
291
|
+
- ✅ **Cleaner MCP configuration** (no per-project path updates needed)
|
|
292
|
+
- ✅ **Compatible with Junie AI, Claude Desktop, and other MCP clients**
|
|
293
|
+
- ✅ **No breaking changes** (environment variable is optional)
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
### Fixed - MCP Protocol Compliance (EPIPE Fix)
|
|
298
|
+
|
|
299
|
+
**Eliminated console output for strict JSON-RPC protocol compliance**
|
|
300
|
+
|
|
301
|
+
#### Problem
|
|
302
|
+
- EPIPE (broken pipe) errors when running with Junie AI on Windows
|
|
303
|
+
- Console output to stdout/stderr violated MCP JSON-RPC protocol requirements
|
|
304
|
+
- Strict MCP clients (like Junie AI) expect pure JSON-RPC on stdio streams
|
|
305
|
+
|
|
306
|
+
#### Changes
|
|
307
|
+
- **Redirected all diagnostic output to debug log file** - stdout/stderr reserved exclusively for JSON-RPC
|
|
308
|
+
- Modified `safeConsoleError()` to write to debug log instead of stderr
|
|
309
|
+
- Replaced 50+ console.log/console.error calls across codebase:
|
|
310
|
+
- `src/database.ts` - Database initialization messages
|
|
311
|
+
- `src/watcher/file-watcher.ts` - File watcher status and events
|
|
312
|
+
- `src/watcher/gitignore-parser.ts` - .gitignore loading warnings
|
|
313
|
+
- `src/tools/tasks.ts` - Task file registration warnings
|
|
314
|
+
- `src/config/example-generator.ts` - First launch messages
|
|
315
|
+
|
|
316
|
+
#### Technical Details
|
|
317
|
+
- **MCP Protocol Requirement**: stdin/stdout/stderr must carry only JSON-RPC messages
|
|
318
|
+
- **Debug Logging**: All diagnostic messages now use `debugLog()` with appropriate levels (INFO, WARN, ERROR)
|
|
319
|
+
- **Zero stdout pollution**: Server starts silently, waits for JSON-RPC requests
|
|
320
|
+
- **Tested with Junie AI**: Confirmed no EPIPE errors on Windows
|
|
321
|
+
|
|
322
|
+
#### Impact
|
|
323
|
+
- ✅ **Works with strict MCP clients** (Junie AI, etc.)
|
|
324
|
+
- ✅ **Maintains full diagnostics** via debug log file
|
|
325
|
+
- ✅ **Pure JSON-RPC protocol** compliance
|
|
326
|
+
- ✅ **No breaking changes** to MCP tool functionality
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
### Added - Environment Variable Support for Project Root
|
|
331
|
+
|
|
332
|
+
**New `SQLEW_PROJECT_ROOT` environment variable for project-relative databases**
|
|
333
|
+
|
|
334
|
+
#### Problem
|
|
335
|
+
- Junie AI and other MCP clients require absolute paths in configuration
|
|
336
|
+
- Users had to hardcode project-specific paths in MCP server config
|
|
337
|
+
- No easy way to use project-relative database paths
|
|
338
|
+
|
|
339
|
+
#### Solution
|
|
340
|
+
- Added `SQLEW_PROJECT_ROOT` environment variable support (inspired by serena-mcp pattern)
|
|
341
|
+
- MCP clients can now pass project directory via environment variable
|
|
342
|
+
- Database automatically created at `$SQLEW_PROJECT_ROOT/.sqlew/sqlew.db`
|
|
343
|
+
|
|
344
|
+
#### Priority Order
|
|
345
|
+
1. `SQLEW_PROJECT_ROOT` environment variable (NEW - highest priority)
|
|
346
|
+
2. `--db-path` CLI argument (absolute path)
|
|
347
|
+
3. `--config-path` CLI argument (absolute path)
|
|
348
|
+
4. `database.path` in config file (absolute path)
|
|
349
|
+
5. `process.cwd()` fallback
|
|
350
|
+
|
|
351
|
+
#### Junie AI Configuration Example
|
|
352
|
+
```json
|
|
353
|
+
{
|
|
354
|
+
"mcpServers": {
|
|
355
|
+
"sqlew": {
|
|
356
|
+
"command": "npx",
|
|
357
|
+
"args": ["sqlew"],
|
|
358
|
+
"env": {
|
|
359
|
+
"SQLEW_PROJECT_ROOT": "{projectDir}"
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
**Note:** Junie AI uses `{projectDir}` variable which expands to the current project's absolute path. This ensures each project gets its own isolated database without hardcoded paths. Other MCP clients may use different variable names like `${workspaceFolder}` (VS Code/Cline) - check your client's documentation.
|
|
367
|
+
|
|
368
|
+
#### Impact
|
|
369
|
+
- ✅ **Project-relative databases** without hardcoded absolute paths
|
|
370
|
+
- ✅ **Cleaner MCP configuration** (no per-project path updates needed)
|
|
371
|
+
- ✅ **Compatible with Junie AI, Claude Desktop, and other MCP clients**
|
|
372
|
+
- ✅ **No breaking changes** (environment variable is optional)
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
### Fixed - MCP Protocol Compliance (EPIPE Fix)
|
|
377
|
+
|
|
378
|
+
**Eliminated console output for strict JSON-RPC protocol compliance**
|
|
379
|
+
|
|
380
|
+
#### Problem
|
|
381
|
+
- EPIPE (broken pipe) errors when running with Junie AI on Windows
|
|
382
|
+
- Console output to stdout/stderr violated MCP JSON-RPC protocol requirements
|
|
383
|
+
- Strict MCP clients (like Junie AI) expect pure JSON-RPC on stdio streams
|
|
384
|
+
|
|
385
|
+
#### Changes
|
|
386
|
+
- **Redirected all diagnostic output to debug log file** - stdout/stderr reserved exclusively for JSON-RPC
|
|
387
|
+
- Modified `safeConsoleError()` to write to debug log instead of stderr
|
|
388
|
+
- Replaced 50+ console.log/console.error calls across codebase:
|
|
389
|
+
- `src/database.ts` - Database initialization messages
|
|
390
|
+
- `src/watcher/file-watcher.ts` - File watcher status and events
|
|
391
|
+
- `src/watcher/gitignore-parser.ts` - .gitignore loading warnings
|
|
392
|
+
- `src/tools/tasks.ts` - Task file registration warnings
|
|
393
|
+
- `src/config/example-generator.ts` - First launch messages
|
|
394
|
+
|
|
395
|
+
#### Technical Details
|
|
396
|
+
- **MCP Protocol Requirement**: stdin/stdout/stderr must carry only JSON-RPC messages
|
|
397
|
+
- **Debug Logging**: All diagnostic messages now use `debugLog()` with appropriate levels (INFO, WARN, ERROR)
|
|
398
|
+
- **Zero stdout pollution**: Server starts silently, waits for JSON-RPC requests
|
|
399
|
+
- **Tested with Junie AI**: Confirmed no EPIPE errors on Windows
|
|
400
|
+
|
|
401
|
+
#### Impact
|
|
402
|
+
- ✅ **Works with strict MCP clients** (Junie AI, etc.)
|
|
403
|
+
- ✅ **Maintains full diagnostics** via debug log file
|
|
404
|
+
- ✅ **Pure JSON-RPC protocol** compliance
|
|
405
|
+
- ✅ **No breaking changes** to MCP tool functionality
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
91
409
|
### Fixed - Windows Absolute Path Handling
|
|
92
410
|
|
|
93
411
|
**Fixed path normalization for Windows environments**
|
package/README.md
CHANGED
|
@@ -10,25 +10,39 @@
|
|
|
10
10
|
|
|
11
11
|
**sqlew** is a Model Context Protocol (MCP) server that gives AI agents organizational memory across sessions.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
### The Problem
|
|
14
|
+
Without sqlew, every Claude session starts with zero context. You must re-explain decisions, agents can reintroduce bugs, and there's no way to track WHY decisions were made.
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
It has been possible to keep records using Markdown files. However, large-scale projects or long-term maintenance records tend to generate massive amounts of documentation. This has become a problem, as it causes context rot in AI systems, leading to declining performance.
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
### The Solution
|
|
19
|
+
sqlew builds efficient external memory for AI by using relational databases.
|
|
20
|
+
- Records the reasoning behind decisions
|
|
21
|
+
- Enables querying past context
|
|
22
|
+
- Prevents anti-patterns through constraints
|
|
23
|
+
- Eliminates duplicate work via task management
|
|
24
|
+
|
|
25
|
+
**Example:**
|
|
26
|
+
- Session 1 records "API v1 deprecated".
|
|
27
|
+
- Session 2 (days later) queries and automatically uses v2.
|
|
28
|
+
|
|
29
|
+
> *This software does not send any data to external networks. We NEVER collect any data or usage statistics. Please use it with complete security.*
|
|
18
30
|
|
|
19
31
|
## Why Use sqlew?
|
|
20
32
|
|
|
21
33
|
### 🧠 Organizational Memory
|
|
22
|
-
Traditional code tells you **WHAT**
|
|
34
|
+
Traditional code analysis like git tells you **WHAT** is done, sqlew adds **WHY** and **HOW** on it:
|
|
23
35
|
- **Decisions** → WHY it was changed
|
|
24
|
-
- **Constraints** →
|
|
36
|
+
- **Constraints** → HOW should it be written
|
|
37
|
+
- **Tasks** → WHAT needs to be done
|
|
25
38
|
|
|
26
39
|
### ⚡ Token Efficiency
|
|
27
40
|
**60-75% token reduction** in multi-session projects through structured data storage and selective querying.
|
|
28
41
|
|
|
29
42
|
### 🎯 Key Features
|
|
30
|
-
- **5 Specialized Tools**: decisions, tasks, files, constraints, stats
|
|
31
|
-
- **
|
|
43
|
+
- **5 Specialized Tools**: decisions, tasks, files, constraints, stats
|
|
44
|
+
- **Runtime Reconnection**: Automatic database connection recovery with exponential backoff
|
|
45
|
+
- **Parameter Validation**: Typo detection, required/optional markers, 70-85% more concise error messages
|
|
32
46
|
- **Metadata-Driven**: Tag, layer, scope, and version everything
|
|
33
47
|
- **Decision Context**: Document WHY with rationale, alternatives, and trade-offs
|
|
34
48
|
- **Task Dependencies**: Blocking relationships with circular detection
|
|
@@ -41,7 +55,7 @@ Traditional code tells you **WHAT** and **HOW**. sqlew adds **WHY**:
|
|
|
41
55
|
See [docs/TASK_OVERVIEW.md](docs/TASK_OVERVIEW.md) and [docs/DECISION_CONTEXT.md](docs/DECISION_CONTEXT.md) for details.
|
|
42
56
|
|
|
43
57
|
### 🔖Kanban-style AI Scrum
|
|
44
|
-

|
|
45
59
|
|
|
46
60
|
## Installation
|
|
47
61
|
|
|
@@ -51,21 +65,7 @@ See [docs/TASK_OVERVIEW.md](docs/TASK_OVERVIEW.md) and [docs/DECISION_CONTEXT.md
|
|
|
51
65
|
|
|
52
66
|
### Quick Install
|
|
53
67
|
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
npx sqlew
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
**Or install per project:**
|
|
60
|
-
```bash
|
|
61
|
-
npm install sqlew
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
**Note**: Global install (`npm install -g`) is **not recommended** because sqlew requires an independent database per project. Each project should maintain its own context database in `.sqlew/sqlew.db`.
|
|
65
|
-
|
|
66
|
-
### Add to Claude Desktop
|
|
67
|
-
|
|
68
|
-
Edit `claude_desktop_config.json`:
|
|
68
|
+
on `.mcp.json` in your project's root, add these lines:
|
|
69
69
|
|
|
70
70
|
```json
|
|
71
71
|
{
|
|
@@ -77,8 +77,13 @@ Edit `claude_desktop_config.json`:
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
```
|
|
80
|
+
**Recommend to restart claude after initialize**
|
|
81
|
+
|
|
82
|
+
The first time, sqlew install custom agents and initialize database. Custom agents are not loaded in this time. Please exit claude once, and restart claude again.
|
|
83
|
+
|
|
84
|
+
It's Ready!
|
|
80
85
|
|
|
81
|
-
|
|
86
|
+
**⚠️Note**: Global install (`npm install -g`) is **not recommended** because sqlew requires an independent settings per project. Each project should maintain its own context database in `.sqlew/sqlew.db`.
|
|
82
87
|
|
|
83
88
|
**Custom database path:** Add path as argument: `"args": ["sqlew", "/path/to/db.db"]`
|
|
84
89
|
**Default location:** `.sqlew/sqlew.db`
|
|
@@ -91,7 +96,7 @@ Restart Claude Desktop. Done!
|
|
|
91
96
|
|
|
92
97
|
### Optional Config File
|
|
93
98
|
|
|
94
|
-
|
|
99
|
+
On first run, `.sqlew/config.toml` will be created for persistent settings:
|
|
95
100
|
|
|
96
101
|
```toml
|
|
97
102
|
[database]
|
|
@@ -102,25 +107,31 @@ ignore_weekend = true
|
|
|
102
107
|
message_hours = 48
|
|
103
108
|
```
|
|
104
109
|
|
|
105
|
-
|
|
110
|
+
Also `.sqlew/config.example.toml` is created for reference.
|
|
111
|
+
|
|
112
|
+
**Settings Priority:** CLI args > config.toml > database defaults
|
|
106
113
|
|
|
107
114
|
See [docs/CONFIGURATION.md](docs/CONFIGURATION.md) for all options and validation rules.
|
|
108
115
|
|
|
109
116
|
## Quick Start
|
|
110
117
|
|
|
118
|
+
install it, launch claude, exit claude and launch Claude again.
|
|
119
|
+
|
|
111
120
|
### Basic Usage
|
|
112
121
|
|
|
113
|
-
|
|
122
|
+
You'll never need to call it manually, I recommend to call this tool via prompt.
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
read sqlew usecases, and plan implementation of feature X using sqlew.
|
|
126
|
+
```
|
|
114
127
|
|
|
115
|
-
|
|
116
|
-
// Store a decision
|
|
117
|
-
{action: "set", key: "auth_method", value: "JWT", layer: "business", tags: ["security"]}
|
|
128
|
+
or invoke Specialized Agent
|
|
118
129
|
|
|
119
|
-
|
|
120
|
-
|
|
130
|
+
```
|
|
131
|
+
plan implementation of feature X with @agent-scrum-master.
|
|
121
132
|
```
|
|
122
133
|
|
|
123
|
-
|
|
134
|
+
Specialized Agents use sqlew more efficiently.
|
|
124
135
|
|
|
125
136
|
## Specialized Agents
|
|
126
137
|
|
|
@@ -132,7 +143,7 @@ sqlew provides three specialized agents for efficient multi-agent coordination i
|
|
|
132
143
|
| **Researcher** | Query decisions, analyze patterns, investigate context | 14KB/conversation | Understanding past decisions, onboarding new members, sprint retrospectives |
|
|
133
144
|
| **Architect** | Document decisions, enforce constraints, maintain standards | 20KB/conversation | Making architectural choices, establishing rules, validating compliance |
|
|
134
145
|
|
|
135
|
-
### Installation
|
|
146
|
+
### Detailed Installation
|
|
136
147
|
|
|
137
148
|
**By default, all three specialized agents are automatically installed** to your project's `.claude/agents/` directory on first run.
|
|
138
149
|
|
|
@@ -160,22 +171,25 @@ Savings: Scrum + Architect = 32KB (30%) | Scrum only = 12KB (74%)
|
|
|
160
171
|
|
|
161
172
|
| Tool | Purpose | Example Use |
|
|
162
173
|
|------|---------|------------|
|
|
163
|
-
| **decision** | Record choices | "We chose PostgreSQL" |
|
|
174
|
+
| **decision** | Record choices and reasons | "We chose PostgreSQL" |
|
|
175
|
+
| **constraint** | Define rules | "DO NOT use raw SQL, use ORM" |
|
|
164
176
|
| **task** | Track work | "Implement feature X" |
|
|
165
177
|
| **file** | Track changes | "Modified auth.ts" |
|
|
166
|
-
| **constraint** | Define rules | "API must be <100ms" |
|
|
167
178
|
| **stats** | Database metrics | Get layer summary |
|
|
168
|
-
| **config** | Retention settings | Auto-cleanup config |
|
|
169
179
|
|
|
170
|
-
Each tool supports `action: "help"` for full documentation and `action: "example"` for comprehensive usage examples.
|
|
171
180
|
|
|
172
181
|
## Documentation
|
|
173
182
|
|
|
183
|
+
Each tool supports `action: "help"` for full documentation and `action: "example"` for comprehensive usage examples.
|
|
184
|
+
|
|
185
|
+
And `action: "use_case"` shows how to use the tool in a real-world scenario.
|
|
186
|
+
|
|
174
187
|
### On-Demand Documentation
|
|
175
188
|
|
|
176
189
|
All tools support:
|
|
177
190
|
- `action: "help"` - Parameter reference and descriptions
|
|
178
191
|
- `action: "example"` - Usage scenarios and examples
|
|
192
|
+
- `action: "use_case"` - Real-world usage examples
|
|
179
193
|
|
|
180
194
|
### For AI Agents
|
|
181
195
|
|
|
@@ -205,6 +219,7 @@ All tools support:
|
|
|
205
219
|
### For Developers
|
|
206
220
|
|
|
207
221
|
- [Configuration Guide](docs/CONFIGURATION.md) - TOML config file setup
|
|
222
|
+
- [Database Migration](docs/DATABASE_MIGRATION.md) - SQLite → MySQL/PostgreSQL migration
|
|
208
223
|
- [Building from Source](docs/ARCHITECTURE.md#development) - Setup instructions
|
|
209
224
|
- [Migration Guides](docs/MIGRATION_v2.md) - Version upgrade guides
|
|
210
225
|
|
|
@@ -230,7 +245,7 @@ Support development via [GitHub Sponsors](https://github.com/sponsors/sin5ddd) -
|
|
|
230
245
|
|
|
231
246
|
## Version
|
|
232
247
|
|
|
233
|
-
Current version: **3.
|
|
248
|
+
Current version: **3.7.0**
|
|
234
249
|
See [CHANGELOG.md](CHANGELOG.md) for release history.
|
|
235
250
|
|
|
236
251
|
## License
|
|
@@ -8,11 +8,51 @@
|
|
|
8
8
|
# Database Settings
|
|
9
9
|
# ============================================================================
|
|
10
10
|
[database]
|
|
11
|
+
# SQLite Configuration (default, local development)
|
|
11
12
|
# Database file path (relative to project root or absolute)
|
|
12
13
|
# Default: ".sqlew/sqlew.db"
|
|
13
14
|
# path = ".sqlew/custom.db"
|
|
14
15
|
# path = "/absolute/path/to/database.db"
|
|
15
16
|
|
|
17
|
+
# PostgreSQL/MySQL/MariaDB Configuration (multi-agent production)
|
|
18
|
+
# Uncomment and configure for remote database access
|
|
19
|
+
# type = "postgres" # or "mysql" (also works with MariaDB 10.5+)
|
|
20
|
+
|
|
21
|
+
# Connection settings (required for postgres/mysql/mariadb)
|
|
22
|
+
# IMPORTANT: Database must already exist! User does NOT need CREATE DATABASE privilege.
|
|
23
|
+
# [database.connection]
|
|
24
|
+
# host = "localhost"
|
|
25
|
+
# port = 5432 # PostgreSQL: 5432, MySQL/MariaDB: 3306
|
|
26
|
+
# database = "sqlew" # Must be created beforehand!
|
|
27
|
+
|
|
28
|
+
# Authentication settings (required for postgres/mysql/mariadb)
|
|
29
|
+
# Required user privileges: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, INDEX, DROP, REFERENCES
|
|
30
|
+
# [database.auth]
|
|
31
|
+
# type = "direct" # Options: "direct", "ssh", "aws-iam", "gcp-iam"
|
|
32
|
+
# user = "postgres" # or mysql_user, etc.
|
|
33
|
+
# password = "your-password"
|
|
34
|
+
|
|
35
|
+
# SSL/TLS Configuration (optional, for encrypted connections)
|
|
36
|
+
# [database.auth.ssl]
|
|
37
|
+
# ca = "/path/to/ca-cert.pem" # or inline certificate content
|
|
38
|
+
# cert = "/path/to/client-cert.pem" # for mutual TLS
|
|
39
|
+
# key = "/path/to/client-key.pem" # for mutual TLS
|
|
40
|
+
# rejectUnauthorized = true # set to false for self-signed certs (not recommended for production)
|
|
41
|
+
|
|
42
|
+
# SSH Tunnel Configuration (when type = "ssh")
|
|
43
|
+
# Used for bastion host / jump server access
|
|
44
|
+
# [database.auth.ssh]
|
|
45
|
+
# host = "bastion.example.com"
|
|
46
|
+
# port = 22
|
|
47
|
+
# username = "deploy"
|
|
48
|
+
# privateKeyPath = "/home/user/.ssh/id_rsa" # or use password
|
|
49
|
+
# password = "ssh-password" # alternative to privateKeyPath
|
|
50
|
+
# passphrase = "key-passphrase" # if private key is encrypted
|
|
51
|
+
# timeout = 30000 # SSH connection timeout in ms
|
|
52
|
+
# keepalive = true
|
|
53
|
+
# keepaliveInterval = 10000
|
|
54
|
+
# localPort = 50000 # auto-allocated from 50000-60000 if not specified
|
|
55
|
+
|
|
16
56
|
# ============================================================================
|
|
17
57
|
# Auto-Deletion Settings
|
|
18
58
|
# ============================================================================
|
|
@@ -154,6 +194,59 @@ architect = true
|
|
|
154
194
|
# Example Configurations
|
|
155
195
|
# ============================================================================
|
|
156
196
|
|
|
197
|
+
# Example 1: PostgreSQL with Direct Authentication + SSL
|
|
198
|
+
# [database]
|
|
199
|
+
# type = "postgres"
|
|
200
|
+
# [database.connection]
|
|
201
|
+
# host = "db.example.com"
|
|
202
|
+
# port = 5432
|
|
203
|
+
# database = "sqlew_production"
|
|
204
|
+
# [database.auth]
|
|
205
|
+
# type = "direct"
|
|
206
|
+
# user = "postgres"
|
|
207
|
+
# password = "secure-password"
|
|
208
|
+
# [database.auth.ssl]
|
|
209
|
+
# ca = "/path/to/ca-cert.pem"
|
|
210
|
+
# rejectUnauthorized = true
|
|
211
|
+
|
|
212
|
+
# Example 2: PostgreSQL through SSH Tunnel
|
|
213
|
+
# [database]
|
|
214
|
+
# type = "postgres"
|
|
215
|
+
# [database.connection]
|
|
216
|
+
# host = "db.internal.example.com"
|
|
217
|
+
# port = 5432
|
|
218
|
+
# database = "sqlew_production"
|
|
219
|
+
# [database.auth]
|
|
220
|
+
# type = "ssh"
|
|
221
|
+
# user = "postgres"
|
|
222
|
+
# password = "db-password"
|
|
223
|
+
# [database.auth.ssh]
|
|
224
|
+
# host = "bastion.example.com"
|
|
225
|
+
# username = "deploy"
|
|
226
|
+
# privateKeyPath = "/home/user/.ssh/id_rsa"
|
|
227
|
+
|
|
228
|
+
# Example 3: MySQL with SSL and SSH
|
|
229
|
+
# [database]
|
|
230
|
+
# type = "mysql"
|
|
231
|
+
# [database.connection]
|
|
232
|
+
# host = "mysql.internal.example.com"
|
|
233
|
+
# port = 3306
|
|
234
|
+
# database = "sqlew_db"
|
|
235
|
+
# [database.auth]
|
|
236
|
+
# type = "ssh"
|
|
237
|
+
# user = "mysql_user"
|
|
238
|
+
# password = "db-password"
|
|
239
|
+
# [database.auth.ssl]
|
|
240
|
+
# ca = "-----BEGIN CERTIFICATE-----\nMIIE...\n-----END CERTIFICATE-----"
|
|
241
|
+
# rejectUnauthorized = true
|
|
242
|
+
# [database.auth.ssh]
|
|
243
|
+
# host = "jump.example.com"
|
|
244
|
+
# port = 22
|
|
245
|
+
# username = "deploy"
|
|
246
|
+
# privateKeyPath = "/home/user/.ssh/deploy_key"
|
|
247
|
+
# passphrase = "key-passphrase"
|
|
248
|
+
# localPort = 53306
|
|
249
|
+
|
|
157
250
|
# Aggressive cleanup (development)
|
|
158
251
|
# [autodelete]
|
|
159
252
|
# message_hours = 1
|
|
Binary file
|