sqlew 4.0.4 → 4.1.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 +1805 -1762
- package/LICENSE +177 -39
- package/NOTICE +24 -0
- package/README.md +409 -390
- package/assets/claude-md-snippets/plan-mode-integration.md +17 -6
- package/assets/config.example.toml +282 -284
- package/assets/sample-agents/README.md +36 -40
- package/assets/sample-agents/sqlew-architect.md +321 -322
- package/assets/sample-agents/sqlew-researcher.md +292 -293
- package/assets/sample-agents/sqlew-scrum-master.md +286 -287
- package/assets/sample-commands/README.md +56 -57
- package/assets/sample-skills/sqlew-plan-guidance/SKILL.md +33 -26
- package/dist/cli/hooks/check-completion.d.ts +19 -0
- package/dist/cli/hooks/check-completion.d.ts.map +1 -0
- package/dist/cli/hooks/check-completion.js +104 -0
- package/dist/cli/hooks/check-completion.js.map +1 -0
- package/dist/cli/hooks/init-hooks.d.ts +35 -0
- package/dist/cli/hooks/init-hooks.d.ts.map +1 -0
- package/dist/cli/hooks/init-hooks.js +425 -0
- package/dist/cli/hooks/init-hooks.js.map +1 -0
- package/dist/cli/hooks/mark-done.d.ts +25 -0
- package/dist/cli/hooks/mark-done.d.ts.map +1 -0
- package/dist/cli/hooks/mark-done.js +128 -0
- package/dist/cli/hooks/mark-done.js.map +1 -0
- package/dist/cli/hooks/plan-id-utils.d.ts +83 -0
- package/dist/cli/hooks/plan-id-utils.d.ts.map +1 -0
- package/dist/cli/hooks/plan-id-utils.js +183 -0
- package/dist/cli/hooks/plan-id-utils.js.map +1 -0
- package/dist/cli/hooks/save.d.ts +23 -0
- package/dist/cli/hooks/save.d.ts.map +1 -0
- package/dist/cli/hooks/save.js +90 -0
- package/dist/cli/hooks/save.js.map +1 -0
- package/dist/cli/hooks/stdin-parser.d.ts +139 -0
- package/dist/cli/hooks/stdin-parser.d.ts.map +1 -0
- package/dist/cli/hooks/stdin-parser.js +127 -0
- package/dist/cli/hooks/stdin-parser.js.map +1 -0
- package/dist/cli/hooks/suggest.d.ts +19 -0
- package/dist/cli/hooks/suggest.d.ts.map +1 -0
- package/dist/cli/hooks/suggest.js +157 -0
- package/dist/cli/hooks/suggest.js.map +1 -0
- package/dist/cli/hooks/track-plan.d.ts +36 -0
- package/dist/cli/hooks/track-plan.d.ts.map +1 -0
- package/dist/cli/hooks/track-plan.js +152 -0
- package/dist/cli/hooks/track-plan.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +56 -16
- package/dist/cli.js.map +1 -1
- package/dist/config/global-config.d.ts +187 -0
- package/dist/config/global-config.d.ts.map +1 -0
- package/dist/config/global-config.js +206 -0
- package/dist/config/global-config.js.map +1 -0
- package/dist/config/loader.d.ts +42 -0
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +96 -0
- package/dist/config/loader.js.map +1 -1
- package/dist/constants.d.ts +4 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +10 -0
- package/dist/constants.js.map +1 -1
- package/dist/database/operations/queries.d.ts.map +1 -1
- package/dist/database/operations/queries.js +11 -2
- package/dist/database/operations/queries.js.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/init-agents.js +0 -1
- package/dist/init-agents.js.map +1 -1
- package/dist/init-skills.d.ts +4 -3
- package/dist/init-skills.d.ts.map +1 -1
- package/dist/init-skills.js +10 -3
- package/dist/init-skills.js.map +1 -1
- package/dist/server/setup.d.ts +8 -0
- package/dist/server/setup.d.ts.map +1 -1
- package/dist/server/setup.js +141 -21
- package/dist/server/setup.js.map +1 -1
- package/dist/sync-agents.d.ts.map +1 -1
- package/dist/sync-agents.js +48 -3
- package/dist/sync-agents.js.map +1 -1
- package/dist/sync-commands.d.ts.map +1 -1
- package/dist/sync-commands.js +43 -3
- package/dist/sync-commands.js.map +1 -1
- package/dist/tools/constraints/actions/get.d.ts.map +1 -1
- package/dist/tools/constraints/actions/get.js +5 -8
- package/dist/tools/constraints/actions/get.js.map +1 -1
- package/dist/tools/constraints/help/help.d.ts.map +1 -1
- package/dist/tools/constraints/help/help.js +1 -6
- package/dist/tools/constraints/help/help.js.map +1 -1
- package/dist/tools/context/actions/get.d.ts.map +1 -1
- package/dist/tools/context/actions/get.js.map +1 -1
- package/dist/tools/context/actions/search-layer.d.ts.map +1 -1
- package/dist/tools/context/actions/search-layer.js +5 -3
- package/dist/tools/context/actions/search-layer.js.map +1 -1
- package/dist/tools/context/actions/set-from-policy.d.ts +2 -1
- package/dist/tools/context/actions/set-from-policy.d.ts.map +1 -1
- package/dist/tools/context/actions/set-from-policy.js.map +1 -1
- package/dist/tools/context/help/help.d.ts.map +1 -1
- package/dist/tools/context/help/help.js +1 -7
- package/dist/tools/context/help/help.js.map +1 -1
- package/dist/tools/context/internal/queries.d.ts.map +1 -1
- package/dist/tools/context/internal/queries.js +5 -2
- 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/files/actions/get.d.ts.map +1 -1
- package/dist/tools/files/actions/get.js +4 -6
- package/dist/tools/files/actions/get.js.map +1 -1
- package/dist/tools/files/help/help.d.ts.map +1 -1
- package/dist/tools/files/help/help.js +1 -6
- package/dist/tools/files/help/help.js.map +1 -1
- package/dist/tools/suggest/help/constraint-help.d.ts.map +1 -1
- package/dist/tools/suggest/help/constraint-help.js +0 -2
- package/dist/tools/suggest/help/constraint-help.js.map +1 -1
- package/dist/tools/suggest/internal/constraint-queries.d.ts.map +1 -1
- package/dist/tools/suggest/internal/constraint-queries.js +12 -5
- package/dist/tools/suggest/internal/constraint-queries.js.map +1 -1
- package/dist/tools/suggest/internal/queries.js +2 -2
- package/dist/tools/suggest/internal/queries.js.map +1 -1
- package/dist/tools/tasks/help/help.d.ts.map +1 -1
- package/dist/tools/tasks/help/help.js +0 -6
- package/dist/tools/tasks/help/help.js.map +1 -1
- package/dist/tools/tasks/help/use-case.d.ts.map +1 -1
- package/dist/tools/tasks/help/use-case.js +0 -1
- package/dist/tools/tasks/help/use-case.js.map +1 -1
- package/dist/tools/tasks/watcher/status.d.ts.map +1 -1
- package/dist/tools/tasks/watcher/status.js +5 -1
- package/dist/tools/tasks/watcher/status.js.map +1 -1
- package/dist/types/decision/params.d.ts +7 -6
- package/dist/types/decision/params.d.ts.map +1 -1
- package/dist/types/decision/templates.d.ts +3 -2
- package/dist/types/decision/templates.d.ts.map +1 -1
- package/dist/types/view-entities.d.ts +2 -1
- package/dist/types/view-entities.d.ts.map +1 -1
- package/dist/types.d.ts +19 -11
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/enum-converter.d.ts +72 -0
- package/dist/utils/enum-converter.d.ts.map +1 -0
- package/dist/utils/enum-converter.js +76 -0
- package/dist/utils/enum-converter.js.map +1 -0
- package/dist/utils/hook-queue.d.ts +81 -0
- package/dist/utils/hook-queue.d.ts.map +1 -0
- package/dist/utils/hook-queue.js +156 -0
- package/dist/utils/hook-queue.js.map +1 -0
- package/dist/utils/project-root.d.ts +9 -2
- package/dist/utils/project-root.d.ts.map +1 -1
- package/dist/utils/project-root.js +16 -2
- package/dist/utils/project-root.js.map +1 -1
- package/dist/utils/tag-parser.d.ts.map +1 -1
- package/dist/utils/tag-parser.js +6 -0
- package/dist/utils/tag-parser.js.map +1 -1
- package/dist/utils/validators.d.ts +1 -1
- package/dist/utils/validators.d.ts.map +1 -1
- package/dist/utils/validators.js +1 -1
- package/dist/utils/validators.js.map +1 -1
- package/dist/utils/vcs-adapter.d.ts +44 -0
- package/dist/utils/vcs-adapter.d.ts.map +1 -1
- package/dist/utils/vcs-adapter.js +88 -0
- package/dist/utils/vcs-adapter.js.map +1 -1
- package/dist/utils/view-queries.d.ts.map +1 -1
- package/dist/utils/view-queries.js +9 -19
- package/dist/utils/view-queries.js.map +1 -1
- package/dist/watcher/base-watcher.d.ts +69 -0
- package/dist/watcher/base-watcher.d.ts.map +1 -0
- package/dist/watcher/base-watcher.js +130 -0
- package/dist/watcher/base-watcher.js.map +1 -0
- package/dist/watcher/index.d.ts +3 -0
- package/dist/watcher/index.d.ts.map +1 -1
- package/dist/watcher/index.js +2 -0
- package/dist/watcher/index.js.map +1 -1
- package/dist/watcher/queue-watcher.d.ts +64 -0
- package/dist/watcher/queue-watcher.d.ts.map +1 -0
- package/dist/watcher/queue-watcher.js +187 -0
- package/dist/watcher/queue-watcher.js.map +1 -0
- package/docs/ADR_CONCEPTS.md +140 -0
- package/docs/CONFIGURATION.md +922 -925
- package/docs/CROSS_DATABASE.md +153 -0
- package/docs/DATABASE_AUTH.md +70 -356
- package/docs/HOOKS_GUIDE.md +159 -0
- package/docs/SLASH_COMMANDS.md +329 -337
- package/docs/TASK_SYSTEM_DEPRECATED.md +88 -0
- package/docs/changelogs/CHANGELOG_ARCHIVE_v3.4_and_older.md +293 -296
- package/docs/cli/DATA_EXPORT_IMPORT.md +699 -700
- package/docs/cli/README.md +276 -277
- package/package.json +123 -119
- package/docs/ACCEPTANCE_CRITERIA.md +0 -625
- package/docs/AI_AGENT_GUIDE.md +0 -198
- package/docs/ARCHITECTURE.md +0 -167
- package/docs/AUTO_FILE_TRACKING.md +0 -841
- package/docs/BATCH_VALIDATION.md +0 -617
- package/docs/BEST_PRACTICES.md +0 -168
- package/docs/CONSTRAINT_INTELLIGENCE.md +0 -339
- package/docs/DECISION_CONTEXT.md +0 -675
- package/docs/DECISION_INTELLIGENCE.md +0 -605
- package/docs/GIT_AWARE_AUTO_COMPLETE.md +0 -646
- package/docs/MIGRATION_GUIDE_V3.9.0.md +0 -371
- package/docs/SHARED_CONCEPTS.md +0 -225
- package/docs/SPECIALIZED_AGENTS.md +0 -126
- package/docs/TASK_ACTIONS.md +0 -1177
- package/docs/TASK_OVERVIEW.md +0 -452
- package/docs/TASK_PRUNING.md +0 -594
- package/docs/TOOL_REFERENCE.md +0 -1077
- package/docs/TOOL_SELECTION.md +0 -83
- package/docs/WORKFLOWS.md +0 -941
|
@@ -1,57 +1,56 @@
|
|
|
1
|
-
# Slash Commands for sqlew
|
|
2
|
-
|
|
3
|
-
This directory contains slash command templates for Claude Code integration with mcp-sqlew.
|
|
4
|
-
|
|
5
|
-
## Documentation
|
|
6
|
-
|
|
7
|
-
**For complete installation guide and usage:**
|
|
8
|
-
|
|
9
|
-
➡️ **[docs/SLASH_COMMANDS.md](../../docs/SLASH_COMMANDS.md)**
|
|
10
|
-
|
|
11
|
-
## Command Files
|
|
12
|
-
|
|
13
|
-
- `sqw-documentor.md` - Document architectural decisions
|
|
14
|
-
- `sqw-secretary.md` - Record decisions (meeting minutes)
|
|
15
|
-
- `sqw-plan.md` - Planning workflow (architecture + tasks)
|
|
16
|
-
- `sqw-research.md` - Search decision/task history
|
|
17
|
-
- `sqw-review.md` - Validate architectural consistency
|
|
18
|
-
- `sqw-scrum.md` - Task management + agent coordination
|
|
19
|
-
|
|
20
|
-
## Quick Install
|
|
21
|
-
|
|
22
|
-
### Automatic (Recommended)
|
|
23
|
-
|
|
24
|
-
Commands are automatically installed when the MCP server starts. Configure in `.sqlew/config.toml`:
|
|
25
|
-
|
|
26
|
-
```toml
|
|
27
|
-
[commands]
|
|
28
|
-
documentor = true
|
|
29
|
-
secretary = true
|
|
30
|
-
plan = true
|
|
31
|
-
research = true
|
|
32
|
-
review = true
|
|
33
|
-
scrum = true
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Manual Installation
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
# Install all enabled commands
|
|
40
|
-
npx mcp-sqlew init-commands
|
|
41
|
-
|
|
42
|
-
# Install to custom location
|
|
43
|
-
npx mcp-sqlew init-commands --path /custom/path
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Commands are installed to `.claude/commands/` in your project directory.
|
|
47
|
-
|
|
48
|
-
**Usage**: Invoke commands with the `/` prefix: `/sqw-plan`, `/sqw-documentor`, `/sqw-scrum`
|
|
49
|
-
|
|
50
|
-
See [docs/SLASH_COMMANDS.md](../../docs/SLASH_COMMANDS.md) for detailed usage examples and customization options.
|
|
51
|
-
|
|
52
|
-
## Links
|
|
53
|
-
|
|
54
|
-
- [Main README](../../README.md)
|
|
55
|
-
- [Slash Commands Documentation](../../docs/SLASH_COMMANDS.md)
|
|
56
|
-
- [
|
|
57
|
-
- [Project Repository](https://github.com/sin5ddd/mcp-sqlew)
|
|
1
|
+
# Slash Commands for sqlew
|
|
2
|
+
|
|
3
|
+
This directory contains slash command templates for Claude Code integration with mcp-sqlew.
|
|
4
|
+
|
|
5
|
+
## Documentation
|
|
6
|
+
|
|
7
|
+
**For complete installation guide and usage:**
|
|
8
|
+
|
|
9
|
+
➡️ **[docs/SLASH_COMMANDS.md](../../docs/SLASH_COMMANDS.md)**
|
|
10
|
+
|
|
11
|
+
## Command Files
|
|
12
|
+
|
|
13
|
+
- `sqw-documentor.md` - Document architectural decisions
|
|
14
|
+
- `sqw-secretary.md` - Record decisions (meeting minutes)
|
|
15
|
+
- `sqw-plan.md` - Planning workflow (architecture + tasks)
|
|
16
|
+
- `sqw-research.md` - Search decision/task history
|
|
17
|
+
- `sqw-review.md` - Validate architectural consistency
|
|
18
|
+
- `sqw-scrum.md` - Task management + agent coordination
|
|
19
|
+
|
|
20
|
+
## Quick Install
|
|
21
|
+
|
|
22
|
+
### Automatic (Recommended)
|
|
23
|
+
|
|
24
|
+
Commands are automatically installed when the MCP server starts. Configure in `.sqlew/config.toml`:
|
|
25
|
+
|
|
26
|
+
```toml
|
|
27
|
+
[commands]
|
|
28
|
+
documentor = true
|
|
29
|
+
secretary = true
|
|
30
|
+
plan = true
|
|
31
|
+
research = true
|
|
32
|
+
review = true
|
|
33
|
+
scrum = true
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Manual Installation
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Install all enabled commands
|
|
40
|
+
npx mcp-sqlew init-commands
|
|
41
|
+
|
|
42
|
+
# Install to custom location
|
|
43
|
+
npx mcp-sqlew init-commands --path /custom/path
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Commands are installed to `.claude/commands/` in your project directory.
|
|
47
|
+
|
|
48
|
+
**Usage**: Invoke commands with the `/` prefix: `/sqw-plan`, `/sqw-documentor`, `/sqw-scrum`
|
|
49
|
+
|
|
50
|
+
See [docs/SLASH_COMMANDS.md](../../docs/SLASH_COMMANDS.md) for detailed usage examples and customization options.
|
|
51
|
+
|
|
52
|
+
## Links
|
|
53
|
+
|
|
54
|
+
- [Main README](../../README.md)
|
|
55
|
+
- [Slash Commands Documentation](../../docs/SLASH_COMMANDS.md)
|
|
56
|
+
- [Project Repository](https://github.com/sin5ddd/mcp-sqlew)
|
|
@@ -1,17 +1,37 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sqlew-plan-guidance
|
|
3
3
|
description: |
|
|
4
|
-
Quick reference for sqlew
|
|
5
|
-
Provides usage patterns for Plan mode
|
|
4
|
+
Quick reference for sqlew integration.
|
|
5
|
+
Provides usage patterns for Plan mode with Claude Code Hooks automation.
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Automatic Integration (v4.1.0+)
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
With `sqlew init --hooks`, everything is **automatic**:
|
|
11
|
+
|
|
12
|
+
| Event | Hook | Action |
|
|
13
|
+
|-------|------|--------|
|
|
14
|
+
| Task tool called | PreToolUse | Auto-suggest related decisions |
|
|
15
|
+
| Plan file written | PreToolUse | Auto-track with plan ID |
|
|
16
|
+
| Code edited | PostToolUse | Auto-save decision (status: draft) |
|
|
17
|
+
| All todos completed | PostToolUse | Auto-update status to active |
|
|
18
|
+
| Git merge/rebase | Git hooks | Auto-mark as implemented |
|
|
19
|
+
|
|
20
|
+
## Manual Commands (Slash Command)
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
/sqlew # Show status
|
|
24
|
+
/sqlew search for <topic> # Find related decisions
|
|
25
|
+
/sqlew record <decision> # Record decision
|
|
26
|
+
/sqlew show remaining tasks # List active tasks
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Direct MCP Tool Usage (Advanced)
|
|
30
|
+
|
|
31
|
+
### Research
|
|
11
32
|
|
|
12
33
|
```typescript
|
|
13
34
|
mcp__sqlew__suggest action="by_tags" tags=["tag"]
|
|
14
|
-
mcp__sqlew__decision action="search_tags" tags=["tag"]
|
|
15
35
|
mcp__sqlew__task action="list" status="in_progress"
|
|
16
36
|
```
|
|
17
37
|
|
|
@@ -21,35 +41,22 @@ mcp__sqlew__task action="list" status="in_progress"
|
|
|
21
41
|
mcp__sqlew__decision action="set"
|
|
22
42
|
key="decision-key"
|
|
23
43
|
value="chosen approach"
|
|
24
|
-
rationale="why this decision was made"
|
|
25
|
-
alternatives_considered="what other options were evaluated"
|
|
26
|
-
tradeoffs="benefits and drawbacks"
|
|
27
44
|
```
|
|
28
45
|
|
|
29
46
|
### Task Creation
|
|
30
47
|
|
|
31
48
|
```typescript
|
|
32
49
|
mcp__sqlew__task action="create_batch" tasks=[
|
|
33
|
-
{ title: "Task title", layer: "business", priority: 3
|
|
50
|
+
{ title: "Task title", layer: "business", priority: 3 }
|
|
34
51
|
]
|
|
35
52
|
```
|
|
36
53
|
|
|
37
|
-
|
|
54
|
+
## Decision Workflow (Hooks)
|
|
38
55
|
|
|
39
|
-
```typescript
|
|
40
|
-
mcp__sqlew__constraint action="add"
|
|
41
|
-
category="architecture"
|
|
42
|
-
description="rule description"
|
|
43
|
-
priority=3
|
|
44
56
|
```
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
| Check for duplicates | suggest | check_duplicate |
|
|
52
|
-
| Record decision | decision | set |
|
|
53
|
-
| Create tasks | task | create, create_batch |
|
|
54
|
-
| Add constraint | constraint | add |
|
|
55
|
-
| List tasks | task | list |
|
|
57
|
+
Code Edit All Todos Done Git Merge
|
|
58
|
+
│ │ │
|
|
59
|
+
▼ ▼ ▼
|
|
60
|
+
[draft] ──────→ [active] ──────→ [active]
|
|
61
|
+
(workflow:in_progress) (workflow:in_review) (workflow:implemented)
|
|
62
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check Completion Hook Command
|
|
3
|
+
*
|
|
4
|
+
* PostToolUse hook for TodoWrite tool - checks if all tasks are completed.
|
|
5
|
+
* When all todos are completed, updates the decision status to "in_review".
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* echo '{"tool_input": {"todos": [...]}}' | sqlew check-completion
|
|
9
|
+
*
|
|
10
|
+
* @since v4.1.0
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Main check-completion command entry point
|
|
14
|
+
*
|
|
15
|
+
* Called as PostToolUse hook when TodoWrite tool completes.
|
|
16
|
+
* Updates decision to in_review when all todos are completed.
|
|
17
|
+
*/
|
|
18
|
+
export declare function checkCompletionCommand(): Promise<void>;
|
|
19
|
+
//# sourceMappingURL=check-completion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-completion.d.ts","sourceRoot":"","sources":["../../../src/cli/hooks/check-completion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAyBH;;;;;GAKG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CA4E5D"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check Completion Hook Command
|
|
3
|
+
*
|
|
4
|
+
* PostToolUse hook for TodoWrite tool - checks if all tasks are completed.
|
|
5
|
+
* When all todos are completed, updates the decision status to "in_review".
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* echo '{"tool_input": {"todos": [...]}}' | sqlew check-completion
|
|
9
|
+
*
|
|
10
|
+
* @since v4.1.0
|
|
11
|
+
*/
|
|
12
|
+
import { readStdinJson, sendContinue, areAllTodosCompleted, getProjectPath } from './stdin-parser.js';
|
|
13
|
+
import { loadCurrentPlan } from '../../config/global-config.js';
|
|
14
|
+
import { initializeDatabase } from '../../database.js';
|
|
15
|
+
import { setDecision } from '../../tools/context/actions/set.js';
|
|
16
|
+
import { join } from 'path';
|
|
17
|
+
// ============================================================================
|
|
18
|
+
// Constants
|
|
19
|
+
// ============================================================================
|
|
20
|
+
/** Decision key prefix for plan-based decisions */
|
|
21
|
+
const PLAN_DECISION_PREFIX = 'plan/implementation';
|
|
22
|
+
/** Status for in-review decisions (using 'active' as DB only supports active/deprecated/draft) */
|
|
23
|
+
const IN_REVIEW_STATUS = 'active';
|
|
24
|
+
/** Workflow tag for in-review state */
|
|
25
|
+
const WORKFLOW_TAG_IN_REVIEW = 'workflow:in_review';
|
|
26
|
+
// ============================================================================
|
|
27
|
+
// Main Entry Point
|
|
28
|
+
// ============================================================================
|
|
29
|
+
/**
|
|
30
|
+
* Main check-completion command entry point
|
|
31
|
+
*
|
|
32
|
+
* Called as PostToolUse hook when TodoWrite tool completes.
|
|
33
|
+
* Updates decision to in_review when all todos are completed.
|
|
34
|
+
*/
|
|
35
|
+
export async function checkCompletionCommand() {
|
|
36
|
+
try {
|
|
37
|
+
const input = await readStdinJson();
|
|
38
|
+
// Only process TodoWrite tool
|
|
39
|
+
if (input.tool_name !== 'TodoWrite') {
|
|
40
|
+
sendContinue();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
// Check if all todos are completed
|
|
44
|
+
if (!areAllTodosCompleted(input)) {
|
|
45
|
+
// Not all completed - continue without action
|
|
46
|
+
sendContinue();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const projectPath = getProjectPath(input);
|
|
50
|
+
if (!projectPath) {
|
|
51
|
+
sendContinue();
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
// Check if there's a current plan being tracked
|
|
55
|
+
const planInfo = loadCurrentPlan(projectPath);
|
|
56
|
+
if (!planInfo) {
|
|
57
|
+
// No plan being tracked - continue without action
|
|
58
|
+
sendContinue();
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
// Only update if the decision was recorded
|
|
62
|
+
if (!planInfo.recorded) {
|
|
63
|
+
sendContinue();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
// Initialize database
|
|
67
|
+
const dbPath = join(projectPath, '.sqlew', 'sqlew.db');
|
|
68
|
+
try {
|
|
69
|
+
await initializeDatabase({ configPath: dbPath });
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
// Database not initialized - continue without updating
|
|
73
|
+
sendContinue();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
// Build decision key from plan file name
|
|
77
|
+
const planName = planInfo.plan_file.replace(/\.md$/, '');
|
|
78
|
+
const decisionKey = `${PLAN_DECISION_PREFIX}/${planName}`;
|
|
79
|
+
// Update decision status to active (in_review tracked via tag)
|
|
80
|
+
try {
|
|
81
|
+
await setDecision({
|
|
82
|
+
key: decisionKey,
|
|
83
|
+
value: `All tasks completed for plan: ${planInfo.plan_file}`,
|
|
84
|
+
status: IN_REVIEW_STATUS,
|
|
85
|
+
layer: 'cross-cutting',
|
|
86
|
+
tags: ['plan', 'implementation', WORKFLOW_TAG_IN_REVIEW, planInfo.plan_id.slice(0, 8)],
|
|
87
|
+
});
|
|
88
|
+
sendContinue(`[sqlew] All tasks completed! Decision updated to status: ${IN_REVIEW_STATUS}`);
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
// Log error but continue
|
|
92
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
93
|
+
console.error(`[sqlew check-completion] Error updating decision: ${message}`);
|
|
94
|
+
sendContinue();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
// On error, log to stderr but continue execution
|
|
99
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
100
|
+
console.error(`[sqlew check-completion] Error: ${message}`);
|
|
101
|
+
sendContinue();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=check-completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-completion.js","sourceRoot":"","sources":["../../../src/cli/hooks/check-completion.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Init Hooks Command
|
|
3
|
+
*
|
|
4
|
+
* Initializes Claude Code Hooks configuration for sqlew.
|
|
5
|
+
* Creates/updates .claude/settings.local.json with hook settings.
|
|
6
|
+
* Optionally installs Git hooks (post-merge, post-rewrite).
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* sqlew init --hooks # Initialize all hooks
|
|
10
|
+
* sqlew init --hooks --no-git # Skip Git hooks
|
|
11
|
+
*
|
|
12
|
+
* Auto-initialization:
|
|
13
|
+
* Called automatically on MCP server startup (first time only).
|
|
14
|
+
* Silent mode - no console output unless errors occur.
|
|
15
|
+
*
|
|
16
|
+
* @since v4.1.0
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Main init hooks command entry point
|
|
20
|
+
*
|
|
21
|
+
* @param args - Command line arguments
|
|
22
|
+
*/
|
|
23
|
+
export declare function initHooksCommand(args?: string[]): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Auto-initialize hooks on MCP server startup
|
|
26
|
+
*
|
|
27
|
+
* Called from initializeSqlewIntegrations() during server startup.
|
|
28
|
+
* Silent mode - only logs via debugLog, no console output.
|
|
29
|
+
* Only runs if hooks are not already configured.
|
|
30
|
+
*
|
|
31
|
+
* @param projectPath - Project root path
|
|
32
|
+
* @returns true if hooks were initialized, false if already configured or skipped
|
|
33
|
+
*/
|
|
34
|
+
export declare function autoInitializeHooks(projectPath: string): boolean;
|
|
35
|
+
//# sourceMappingURL=init-hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-hooks.d.ts","sourceRoot":"","sources":["../../../src/cli/hooks/init-hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA8RH;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAwCzE;AAoCD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CA6BhE"}
|