sqlew 3.2.5 → 3.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +815 -13
- package/README.md +53 -2
- package/assets/schema.sql +6 -1
- package/dist/config/loader.d.ts +46 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +151 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/types.d.ts +77 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +28 -0
- package/dist/config/types.js.map +1 -0
- package/dist/constants.d.ts +9 -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.d.ts +1 -1
- package/dist/database.d.ts.map +1 -1
- package/dist/database.js +77 -10
- package/dist/database.js.map +1 -1
- package/dist/index.js +21 -3
- package/dist/index.js.map +1 -1
- package/dist/migrations/add-v3.5.0-pruned-files.d.ts +26 -0
- package/dist/migrations/add-v3.5.0-pruned-files.d.ts.map +1 -0
- package/dist/migrations/add-v3.5.0-pruned-files.js +107 -0
- package/dist/migrations/add-v3.5.0-pruned-files.js.map +1 -0
- package/dist/migrations/index.d.ts +2 -1
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +16 -1
- package/dist/migrations/index.js.map +1 -1
- package/dist/tests/git-aware-completion.test.d.ts +6 -0
- package/dist/tests/git-aware-completion.test.d.ts.map +1 -0
- package/dist/tests/git-aware-completion.test.js +141 -0
- package/dist/tests/git-aware-completion.test.js.map +1 -0
- package/dist/tests/tasks.auto-pruning-decision-link.test.d.ts +6 -0
- package/dist/tests/tasks.auto-pruning-decision-link.test.d.ts.map +1 -0
- package/dist/tests/tasks.auto-pruning-decision-link.test.js +250 -0
- package/dist/tests/tasks.auto-pruning-decision-link.test.js.map +1 -0
- package/dist/tests/tasks.auto-pruning-partial.test.d.ts +6 -0
- package/dist/tests/tasks.auto-pruning-partial.test.d.ts.map +1 -0
- package/dist/tests/tasks.auto-pruning-partial.test.js +274 -0
- package/dist/tests/tasks.auto-pruning-partial.test.js.map +1 -0
- package/dist/tests/tasks.auto-pruning-persistence.test.d.ts +6 -0
- package/dist/tests/tasks.auto-pruning-persistence.test.d.ts.map +1 -0
- package/dist/tests/tasks.auto-pruning-persistence.test.js +232 -0
- package/dist/tests/tasks.auto-pruning-persistence.test.js.map +1 -0
- package/dist/tests/tasks.auto-pruning-safety.test.d.ts +12 -0
- package/dist/tests/tasks.auto-pruning-safety.test.d.ts.map +1 -0
- package/dist/tests/tasks.auto-pruning-safety.test.js +196 -0
- package/dist/tests/tasks.auto-pruning-safety.test.js.map +1 -0
- package/dist/tests/tasks.link-file-backward-compat.test.d.ts +6 -0
- package/dist/tests/tasks.link-file-backward-compat.test.d.ts.map +1 -0
- package/dist/tests/tasks.link-file-backward-compat.test.js +235 -0
- package/dist/tests/tasks.link-file-backward-compat.test.js.map +1 -0
- package/dist/tests/tasks.watch-files-action.test.d.ts +6 -0
- package/dist/tests/tasks.watch-files-action.test.d.ts.map +1 -0
- package/dist/tests/tasks.watch-files-action.test.js +351 -0
- package/dist/tests/tasks.watch-files-action.test.js.map +1 -0
- package/dist/tests/tasks.watch-files-parameter.test.d.ts +6 -0
- package/dist/tests/tasks.watch-files-parameter.test.d.ts.map +1 -0
- package/dist/tests/tasks.watch-files-parameter.test.js +249 -0
- package/dist/tests/tasks.watch-files-parameter.test.js.map +1 -0
- package/dist/tests/two-step-git-completion.test.d.ts +6 -0
- package/dist/tests/two-step-git-completion.test.d.ts.map +1 -0
- package/dist/tests/two-step-git-completion.test.js +283 -0
- package/dist/tests/two-step-git-completion.test.js.map +1 -0
- package/dist/tests/vcs-staging.test.d.ts +6 -0
- package/dist/tests/vcs-staging.test.d.ts.map +1 -0
- package/dist/tests/vcs-staging.test.js +137 -0
- package/dist/tests/vcs-staging.test.js.map +1 -0
- package/dist/tools/config.d.ts +4 -2
- package/dist/tools/config.d.ts.map +1 -1
- package/dist/tools/config.js +13 -11
- package/dist/tools/config.js.map +1 -1
- package/dist/tools/constraints.d.ts +7 -4
- package/dist/tools/constraints.d.ts.map +1 -1
- package/dist/tools/constraints.js +19 -16
- package/dist/tools/constraints.js.map +1 -1
- package/dist/tools/context.d.ts +33 -17
- package/dist/tools/context.d.ts.map +1 -1
- package/dist/tools/context.js +84 -68
- package/dist/tools/context.js.map +1 -1
- package/dist/tools/files.d.ts +9 -5
- package/dist/tools/files.d.ts.map +1 -1
- package/dist/tools/files.js +19 -15
- package/dist/tools/files.js.map +1 -1
- package/dist/tools/messaging.d.ts +9 -5
- package/dist/tools/messaging.d.ts.map +1 -1
- package/dist/tools/messaging.js +20 -16
- package/dist/tools/messaging.js.map +1 -1
- package/dist/tools/tasks.d.ts +40 -12
- package/dist/tools/tasks.d.ts.map +1 -1
- package/dist/tools/tasks.js +475 -87
- package/dist/tools/tasks.js.map +1 -1
- package/dist/tools/utils.d.ts +11 -6
- package/dist/tools/utils.d.ts.map +1 -1
- package/dist/tools/utils.js +56 -44
- package/dist/tools/utils.js.map +1 -1
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/file-pruning.d.ts +69 -0
- package/dist/utils/file-pruning.d.ts.map +1 -0
- package/dist/utils/file-pruning.js +185 -0
- package/dist/utils/file-pruning.js.map +1 -0
- package/dist/utils/quality-checks.d.ts +60 -0
- package/dist/utils/quality-checks.d.ts.map +1 -0
- package/dist/utils/quality-checks.js +228 -0
- package/dist/utils/quality-checks.js.map +1 -0
- package/dist/utils/retention.d.ts +8 -0
- package/dist/utils/retention.d.ts.map +1 -1
- package/dist/utils/retention.js +12 -0
- package/dist/utils/retention.js.map +1 -1
- package/dist/utils/task-stale-detection.d.ts +69 -1
- package/dist/utils/task-stale-detection.d.ts.map +1 -1
- package/dist/utils/task-stale-detection.js +494 -17
- package/dist/utils/task-stale-detection.js.map +1 -1
- package/dist/utils/vcs-adapter.d.ts +68 -0
- package/dist/utils/vcs-adapter.d.ts.map +1 -0
- package/dist/utils/vcs-adapter.js +187 -0
- package/dist/utils/vcs-adapter.js.map +1 -0
- package/dist/watcher/file-watcher.d.ts +54 -4
- package/dist/watcher/file-watcher.d.ts.map +1 -1
- package/dist/watcher/file-watcher.js +312 -30
- package/dist/watcher/file-watcher.js.map +1 -1
- package/dist/watcher/gitignore-parser.d.ts +70 -0
- package/dist/watcher/gitignore-parser.d.ts.map +1 -0
- package/dist/watcher/gitignore-parser.js +191 -0
- package/dist/watcher/gitignore-parser.js.map +1 -0
- package/dist/watcher/index.d.ts +1 -0
- package/dist/watcher/index.d.ts.map +1 -1
- package/dist/watcher/index.js +1 -0
- package/dist/watcher/index.js.map +1 -1
- package/docs/AI_AGENT_GUIDE.md +1 -1
- package/docs/ARCHITECTURE.md +12 -0
- package/docs/AUTO_FILE_TRACKING.md +486 -82
- package/docs/CONFIGURATION.md +908 -0
- package/docs/GIT_AWARE_AUTO_COMPLETE.md +645 -0
- package/docs/MIGRATION_v3.3.md +602 -0
- package/docs/SHARED_CONCEPTS.md +2 -1
- package/docs/TASK_ACTIONS.md +12 -0
- package/docs/TASK_OVERVIEW.md +124 -23
- package/docs/TASK_PRUNING.md +589 -0
- package/docs/TASK_SYSTEM.md +83 -13
- package/docs/TOOL_REFERENCE.md +94 -6
- package/package.json +8 -6
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for backward compatibility of deprecated task.link(link_type="file") (v3.4.1)
|
|
3
|
+
* Tests that the deprecated API still works while showing deprecation warnings
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it, beforeEach } from 'node:test';
|
|
6
|
+
import assert from 'node:assert/strict';
|
|
7
|
+
import Database from 'better-sqlite3';
|
|
8
|
+
import { initializeSchema } from '../schema.js';
|
|
9
|
+
import { getOrCreateAgent, getOrCreateFile } from '../database.js';
|
|
10
|
+
/**
|
|
11
|
+
* Test database instance
|
|
12
|
+
*/
|
|
13
|
+
let testDb;
|
|
14
|
+
/**
|
|
15
|
+
* Create an in-memory test database
|
|
16
|
+
*/
|
|
17
|
+
function createTestDatabase() {
|
|
18
|
+
const db = new Database(':memory:');
|
|
19
|
+
db.pragma('foreign_keys = ON');
|
|
20
|
+
initializeSchema(db);
|
|
21
|
+
return db;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Helper: Create a test task
|
|
25
|
+
*/
|
|
26
|
+
function createTestTask(db, title) {
|
|
27
|
+
const agentId = getOrCreateAgent(db, 'test-agent');
|
|
28
|
+
const statusId = 1; // todo
|
|
29
|
+
const result = db.prepare(`
|
|
30
|
+
INSERT INTO t_tasks (title, status_id, priority, created_by_agent_id, assigned_agent_id)
|
|
31
|
+
VALUES (?, ?, 2, ?, ?)
|
|
32
|
+
`).run(title, statusId, agentId, agentId);
|
|
33
|
+
return result.lastInsertRowid;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Inline implementation of linkTask for testing (file link_type only)
|
|
37
|
+
*/
|
|
38
|
+
function linkTaskFile(db, params) {
|
|
39
|
+
if (!params.task_id) {
|
|
40
|
+
throw new Error('Parameter "task_id" is required');
|
|
41
|
+
}
|
|
42
|
+
if (params.target_id === undefined || params.target_id === null) {
|
|
43
|
+
throw new Error('Parameter "target_id" is required');
|
|
44
|
+
}
|
|
45
|
+
// Check if task exists
|
|
46
|
+
const taskExists = db.prepare('SELECT id FROM t_tasks WHERE id = ?').get(params.task_id);
|
|
47
|
+
if (!taskExists) {
|
|
48
|
+
throw new Error(`Task with id ${params.task_id} not found`);
|
|
49
|
+
}
|
|
50
|
+
// Deprecation warning (v3.4.1) - would appear in console
|
|
51
|
+
// console.warn(`⚠️ DEPRECATION WARNING: task.link(link_type="file") is deprecated as of v3.4.1.`);
|
|
52
|
+
const filePath = String(params.target_id);
|
|
53
|
+
const fileId = getOrCreateFile(db, filePath);
|
|
54
|
+
const stmt = db.prepare(`
|
|
55
|
+
INSERT OR IGNORE INTO t_task_file_links (task_id, file_id)
|
|
56
|
+
VALUES (?, ?)
|
|
57
|
+
`);
|
|
58
|
+
stmt.run(params.task_id, fileId);
|
|
59
|
+
return {
|
|
60
|
+
success: true,
|
|
61
|
+
task_id: params.task_id,
|
|
62
|
+
linked_to: 'file',
|
|
63
|
+
target: filePath,
|
|
64
|
+
deprecation_warning: 'task.link(link_type="file") is deprecated. Use task.create/update(watch_files) or watch_files action instead.',
|
|
65
|
+
message: `Task ${params.task_id} linked to file "${filePath}" (DEPRECATED API - use watch_files instead)`
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
describe('Backward compatibility: task.link(link_type="file")', () => {
|
|
69
|
+
beforeEach(() => {
|
|
70
|
+
testDb = createTestDatabase();
|
|
71
|
+
});
|
|
72
|
+
it('should still link file to task (backward compatible)', () => {
|
|
73
|
+
const taskId = createTestTask(testDb, 'Task for backward compat test');
|
|
74
|
+
const result = linkTaskFile(testDb, {
|
|
75
|
+
task_id: taskId,
|
|
76
|
+
target_id: 'src/index.ts'
|
|
77
|
+
});
|
|
78
|
+
assert.ok(result.success, 'Should succeed');
|
|
79
|
+
assert.strictEqual(result.task_id, taskId);
|
|
80
|
+
assert.strictEqual(result.linked_to, 'file');
|
|
81
|
+
assert.strictEqual(result.target, 'src/index.ts');
|
|
82
|
+
});
|
|
83
|
+
it('should include deprecation warning in response', () => {
|
|
84
|
+
const taskId = createTestTask(testDb, 'Task for deprecation warning test');
|
|
85
|
+
const result = linkTaskFile(testDb, {
|
|
86
|
+
task_id: taskId,
|
|
87
|
+
target_id: 'src/database.ts'
|
|
88
|
+
});
|
|
89
|
+
assert.ok(result.deprecation_warning, 'Should include deprecation warning');
|
|
90
|
+
assert.ok(result.deprecation_warning.includes('deprecated'), 'Warning should mention deprecation');
|
|
91
|
+
assert.ok(result.deprecation_warning.includes('watch_files'), 'Warning should suggest watch_files');
|
|
92
|
+
});
|
|
93
|
+
it('should create file link in database', () => {
|
|
94
|
+
const taskId = createTestTask(testDb, 'Task for DB link test');
|
|
95
|
+
linkTaskFile(testDb, {
|
|
96
|
+
task_id: taskId,
|
|
97
|
+
target_id: 'src/schema.ts'
|
|
98
|
+
});
|
|
99
|
+
// Verify file link was created
|
|
100
|
+
const links = testDb.prepare(`
|
|
101
|
+
SELECT f.path
|
|
102
|
+
FROM t_task_file_links tfl
|
|
103
|
+
JOIN m_files f ON tfl.file_id = f.id
|
|
104
|
+
WHERE tfl.task_id = ?
|
|
105
|
+
`).all(taskId);
|
|
106
|
+
assert.strictEqual(links.length, 1);
|
|
107
|
+
assert.strictEqual(links[0].path, 'src/schema.ts');
|
|
108
|
+
});
|
|
109
|
+
it('should handle multiple file links', () => {
|
|
110
|
+
const taskId = createTestTask(testDb, 'Task for multiple links');
|
|
111
|
+
linkTaskFile(testDb, {
|
|
112
|
+
task_id: taskId,
|
|
113
|
+
target_id: 'src/index.ts'
|
|
114
|
+
});
|
|
115
|
+
linkTaskFile(testDb, {
|
|
116
|
+
task_id: taskId,
|
|
117
|
+
target_id: 'src/database.ts'
|
|
118
|
+
});
|
|
119
|
+
linkTaskFile(testDb, {
|
|
120
|
+
task_id: taskId,
|
|
121
|
+
target_id: 'src/schema.ts'
|
|
122
|
+
});
|
|
123
|
+
// Verify all links exist
|
|
124
|
+
const links = testDb.prepare(`
|
|
125
|
+
SELECT f.path
|
|
126
|
+
FROM t_task_file_links tfl
|
|
127
|
+
JOIN m_files f ON tfl.file_id = f.id
|
|
128
|
+
WHERE tfl.task_id = ?
|
|
129
|
+
ORDER BY f.path
|
|
130
|
+
`).all(taskId);
|
|
131
|
+
assert.strictEqual(links.length, 3);
|
|
132
|
+
assert.strictEqual(links[0].path, 'src/database.ts');
|
|
133
|
+
assert.strictEqual(links[1].path, 'src/index.ts');
|
|
134
|
+
assert.strictEqual(links[2].path, 'src/schema.ts');
|
|
135
|
+
});
|
|
136
|
+
it('should be idempotent (duplicate links ignored)', () => {
|
|
137
|
+
const taskId = createTestTask(testDb, 'Task for idempotent test');
|
|
138
|
+
// Link same file twice
|
|
139
|
+
linkTaskFile(testDb, {
|
|
140
|
+
task_id: taskId,
|
|
141
|
+
target_id: 'src/index.ts'
|
|
142
|
+
});
|
|
143
|
+
linkTaskFile(testDb, {
|
|
144
|
+
task_id: taskId,
|
|
145
|
+
target_id: 'src/index.ts'
|
|
146
|
+
});
|
|
147
|
+
// Should only have one link
|
|
148
|
+
const links = testDb.prepare(`
|
|
149
|
+
SELECT f.path
|
|
150
|
+
FROM t_task_file_links tfl
|
|
151
|
+
JOIN m_files f ON tfl.file_id = f.id
|
|
152
|
+
WHERE tfl.task_id = ?
|
|
153
|
+
`).all(taskId);
|
|
154
|
+
assert.strictEqual(links.length, 1, 'Should not create duplicate links');
|
|
155
|
+
});
|
|
156
|
+
it('should work with new watch_files action on same task', () => {
|
|
157
|
+
const taskId = createTestTask(testDb, 'Task for mixed API test');
|
|
158
|
+
// Use old API
|
|
159
|
+
linkTaskFile(testDb, {
|
|
160
|
+
task_id: taskId,
|
|
161
|
+
target_id: 'src/index.ts'
|
|
162
|
+
});
|
|
163
|
+
// Use new API (simulated by direct DB insert)
|
|
164
|
+
const fileId = getOrCreateFile(testDb, 'src/database.ts');
|
|
165
|
+
testDb.prepare('INSERT OR IGNORE INTO t_task_file_links (task_id, file_id) VALUES (?, ?)').run(taskId, fileId);
|
|
166
|
+
// Both files should be linked
|
|
167
|
+
const links = testDb.prepare(`
|
|
168
|
+
SELECT f.path
|
|
169
|
+
FROM t_task_file_links tfl
|
|
170
|
+
JOIN m_files f ON tfl.file_id = f.id
|
|
171
|
+
WHERE tfl.task_id = ?
|
|
172
|
+
ORDER BY f.path
|
|
173
|
+
`).all(taskId);
|
|
174
|
+
assert.strictEqual(links.length, 2);
|
|
175
|
+
assert.strictEqual(links[0].path, 'src/database.ts');
|
|
176
|
+
assert.strictEqual(links[1].path, 'src/index.ts');
|
|
177
|
+
});
|
|
178
|
+
it('should throw error for invalid task_id', () => {
|
|
179
|
+
assert.throws(() => {
|
|
180
|
+
linkTaskFile(testDb, {
|
|
181
|
+
task_id: 999,
|
|
182
|
+
target_id: 'src/index.ts'
|
|
183
|
+
});
|
|
184
|
+
}, /Task with id 999 not found/);
|
|
185
|
+
});
|
|
186
|
+
it('should handle various file path formats', () => {
|
|
187
|
+
const taskId = createTestTask(testDb, 'Task for path formats');
|
|
188
|
+
linkTaskFile(testDb, {
|
|
189
|
+
task_id: taskId,
|
|
190
|
+
target_id: 'package.json'
|
|
191
|
+
});
|
|
192
|
+
linkTaskFile(testDb, {
|
|
193
|
+
task_id: taskId,
|
|
194
|
+
target_id: 'src/tools/tasks.ts'
|
|
195
|
+
});
|
|
196
|
+
linkTaskFile(testDb, {
|
|
197
|
+
task_id: taskId,
|
|
198
|
+
target_id: 'docs/README.md'
|
|
199
|
+
});
|
|
200
|
+
const links = testDb.prepare(`
|
|
201
|
+
SELECT f.path
|
|
202
|
+
FROM t_task_file_links tfl
|
|
203
|
+
JOIN m_files f ON tfl.file_id = f.id
|
|
204
|
+
WHERE tfl.task_id = ?
|
|
205
|
+
`).all(taskId);
|
|
206
|
+
assert.strictEqual(links.length, 3);
|
|
207
|
+
});
|
|
208
|
+
it('should maintain same database schema as new API', () => {
|
|
209
|
+
const taskId1 = createTestTask(testDb, 'Task with old API');
|
|
210
|
+
const taskId2 = createTestTask(testDb, 'Task with new API');
|
|
211
|
+
// Old API
|
|
212
|
+
linkTaskFile(testDb, {
|
|
213
|
+
task_id: taskId1,
|
|
214
|
+
target_id: 'src/index.ts'
|
|
215
|
+
});
|
|
216
|
+
// New API (simulated)
|
|
217
|
+
const fileId = getOrCreateFile(testDb, 'src/index.ts');
|
|
218
|
+
testDb.prepare('INSERT OR IGNORE INTO t_task_file_links (task_id, file_id) VALUES (?, ?)').run(taskId2, fileId);
|
|
219
|
+
// Both should create identical links
|
|
220
|
+
const links1 = testDb.prepare(`
|
|
221
|
+
SELECT task_id, file_id
|
|
222
|
+
FROM t_task_file_links
|
|
223
|
+
WHERE task_id = ?
|
|
224
|
+
`).all(taskId1);
|
|
225
|
+
const links2 = testDb.prepare(`
|
|
226
|
+
SELECT task_id, file_id
|
|
227
|
+
FROM t_task_file_links
|
|
228
|
+
WHERE task_id = ?
|
|
229
|
+
`).all(taskId2);
|
|
230
|
+
// Same file_id should be used
|
|
231
|
+
assert.strictEqual(links1[0].file_id, links2[0].file_id, 'Should use same file ID');
|
|
232
|
+
});
|
|
233
|
+
console.log('\n✅ All backward compatibility tests passed!\n');
|
|
234
|
+
});
|
|
235
|
+
//# sourceMappingURL=tasks.link-file-backward-compat.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.link-file-backward-compat.test.js","sourceRoot":"","sources":["../../src/tests/tasks.link-file-backward-compat.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGnE;;GAEG;AACH,IAAI,MAAoB,CAAC;AAEzB;;GAEG;AACH,SAAS,kBAAkB;IACzB,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC;IACpC,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAC/B,gBAAgB,CAAC,EAAE,CAAC,CAAC;IACrB,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,EAAgB,EAAE,KAAa;IACrD,MAAM,OAAO,GAAG,gBAAgB,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,OAAO;IAE3B,MAAM,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC;;;GAGzB,CAAC,CAAC,GA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,MAAM,EAAE,mBAAmB,CAAC,CAAC;QAC5D,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;QAE5D,UAAU;QACV,YAAY,CAAC,MAAM,EAAE;YACnB,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,cAAc;SAC1B,CAAC,CAAC;QAEH,sBAAsB;QACtB,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;QACvD,MAAM,CAAC,OAAO,CAAC,0EAA0E,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAEhH,qCAAqC;QACrC,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;;;;KAI7B,CAAC,CAAC,GAAG,CAAC,OAAO,CAA2C,CAAC;QAE1D,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;;;;KAI7B,CAAC,CAAC,GAAG,CAAC,OAAO,CAA2C,CAAC;QAE1D,8BAA8B;QAC9B,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,yBAAyB,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;AAChE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.watch-files-action.test.d.ts","sourceRoot":"","sources":["../../src/tests/tasks.watch-files-action.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for Task watch_files action (v3.4.1)
|
|
3
|
+
* Tests the new watch_files action: watch, unwatch, list
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it, beforeEach } from 'node:test';
|
|
6
|
+
import assert from 'node:assert/strict';
|
|
7
|
+
import Database from 'better-sqlite3';
|
|
8
|
+
import { initializeSchema } from '../schema.js';
|
|
9
|
+
import { getOrCreateAgent, getOrCreateFile } from '../database.js';
|
|
10
|
+
/**
|
|
11
|
+
* Test database instance
|
|
12
|
+
*/
|
|
13
|
+
let testDb;
|
|
14
|
+
/**
|
|
15
|
+
* Create an in-memory test database
|
|
16
|
+
*/
|
|
17
|
+
function createTestDatabase() {
|
|
18
|
+
const db = new Database(':memory:');
|
|
19
|
+
db.pragma('foreign_keys = ON');
|
|
20
|
+
initializeSchema(db);
|
|
21
|
+
return db;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Helper: Create a test task
|
|
25
|
+
*/
|
|
26
|
+
function createTestTask(db, title) {
|
|
27
|
+
const agentId = getOrCreateAgent(db, 'test-agent');
|
|
28
|
+
const statusId = 1; // todo
|
|
29
|
+
const result = db.prepare(`
|
|
30
|
+
INSERT INTO t_tasks (title, status_id, priority, created_by_agent_id, assigned_agent_id)
|
|
31
|
+
VALUES (?, ?, 2, ?, ?)
|
|
32
|
+
`).run(title, statusId, agentId, agentId);
|
|
33
|
+
return result.lastInsertRowid;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Inline implementation of watchFiles action for testing
|
|
37
|
+
*/
|
|
38
|
+
function watchFilesAction(db, params) {
|
|
39
|
+
if (!params.task_id) {
|
|
40
|
+
throw new Error('Parameter "task_id" is required');
|
|
41
|
+
}
|
|
42
|
+
if (!params.action) {
|
|
43
|
+
throw new Error('Parameter "action" is required (watch, unwatch, or list)');
|
|
44
|
+
}
|
|
45
|
+
// Check if task exists
|
|
46
|
+
const taskData = db.prepare(`
|
|
47
|
+
SELECT t.id, t.title, s.name as status
|
|
48
|
+
FROM t_tasks t
|
|
49
|
+
JOIN m_task_statuses s ON t.status_id = s.id
|
|
50
|
+
WHERE t.id = ?
|
|
51
|
+
`).get(params.task_id);
|
|
52
|
+
if (!taskData) {
|
|
53
|
+
throw new Error(`Task with id ${params.task_id} not found`);
|
|
54
|
+
}
|
|
55
|
+
if (params.action === 'watch') {
|
|
56
|
+
if (!params.file_paths || params.file_paths.length === 0) {
|
|
57
|
+
throw new Error('Parameter "file_paths" is required for watch action');
|
|
58
|
+
}
|
|
59
|
+
const insertFileLinkStmt = db.prepare(`
|
|
60
|
+
INSERT OR IGNORE INTO t_task_file_links (task_id, file_id)
|
|
61
|
+
VALUES (?, ?)
|
|
62
|
+
`);
|
|
63
|
+
const addedFiles = [];
|
|
64
|
+
for (const filePath of params.file_paths) {
|
|
65
|
+
const fileId = getOrCreateFile(db, filePath);
|
|
66
|
+
const result = insertFileLinkStmt.run(params.task_id, fileId);
|
|
67
|
+
// Check if row was actually inserted (changes > 0)
|
|
68
|
+
if (result.changes > 0) {
|
|
69
|
+
addedFiles.push(filePath);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
success: true,
|
|
74
|
+
task_id: params.task_id,
|
|
75
|
+
action: 'watch',
|
|
76
|
+
files_added: addedFiles.length,
|
|
77
|
+
files: addedFiles,
|
|
78
|
+
message: `Watching ${addedFiles.length} file(s) for task ${params.task_id}`
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
else if (params.action === 'unwatch') {
|
|
82
|
+
if (!params.file_paths || params.file_paths.length === 0) {
|
|
83
|
+
throw new Error('Parameter "file_paths" is required for unwatch action');
|
|
84
|
+
}
|
|
85
|
+
const deleteFileLinkStmt = db.prepare(`
|
|
86
|
+
DELETE FROM t_task_file_links
|
|
87
|
+
WHERE task_id = ? AND file_id = (SELECT id FROM m_files WHERE path = ?)
|
|
88
|
+
`);
|
|
89
|
+
const removedFiles = [];
|
|
90
|
+
for (const filePath of params.file_paths) {
|
|
91
|
+
const result = deleteFileLinkStmt.run(params.task_id, filePath);
|
|
92
|
+
// Check if row was actually deleted (changes > 0)
|
|
93
|
+
if (result.changes > 0) {
|
|
94
|
+
removedFiles.push(filePath);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
success: true,
|
|
99
|
+
task_id: params.task_id,
|
|
100
|
+
action: 'unwatch',
|
|
101
|
+
files_removed: removedFiles.length,
|
|
102
|
+
files: removedFiles,
|
|
103
|
+
message: `Stopped watching ${removedFiles.length} file(s) for task ${params.task_id}`
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
else if (params.action === 'list') {
|
|
107
|
+
const filesStmt = db.prepare(`
|
|
108
|
+
SELECT f.path
|
|
109
|
+
FROM t_task_file_links tfl
|
|
110
|
+
JOIN m_files f ON tfl.file_id = f.id
|
|
111
|
+
WHERE tfl.task_id = ?
|
|
112
|
+
`);
|
|
113
|
+
const files = filesStmt.all(params.task_id).map((row) => row.path);
|
|
114
|
+
return {
|
|
115
|
+
success: true,
|
|
116
|
+
task_id: params.task_id,
|
|
117
|
+
action: 'list',
|
|
118
|
+
files_count: files.length,
|
|
119
|
+
files: files,
|
|
120
|
+
message: `Task ${params.task_id} is watching ${files.length} file(s)`
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
throw new Error(`Invalid action: ${params.action}. Must be one of: watch, unwatch, list`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
describe('Task watch_files action tests', () => {
|
|
128
|
+
beforeEach(() => {
|
|
129
|
+
testDb = createTestDatabase();
|
|
130
|
+
});
|
|
131
|
+
it('should list watched files for task with no files', () => {
|
|
132
|
+
const taskId = createTestTask(testDb, 'Task without files');
|
|
133
|
+
const result = watchFilesAction(testDb, {
|
|
134
|
+
task_id: taskId,
|
|
135
|
+
action: 'list'
|
|
136
|
+
});
|
|
137
|
+
assert.ok(result.success);
|
|
138
|
+
assert.strictEqual(result.action, 'list');
|
|
139
|
+
assert.strictEqual(result.files_count, 0);
|
|
140
|
+
assert.deepStrictEqual(result.files, []);
|
|
141
|
+
});
|
|
142
|
+
it('should watch files for a task', () => {
|
|
143
|
+
const taskId = createTestTask(testDb, 'Task to watch files');
|
|
144
|
+
const result = watchFilesAction(testDb, {
|
|
145
|
+
task_id: taskId,
|
|
146
|
+
action: 'watch',
|
|
147
|
+
file_paths: ['src/index.ts', 'src/database.ts']
|
|
148
|
+
});
|
|
149
|
+
assert.ok(result.success);
|
|
150
|
+
assert.strictEqual(result.action, 'watch');
|
|
151
|
+
assert.strictEqual(result.files_added, 2);
|
|
152
|
+
assert.deepStrictEqual(result.files, ['src/index.ts', 'src/database.ts']);
|
|
153
|
+
});
|
|
154
|
+
it('should list watched files after watching', () => {
|
|
155
|
+
const taskId = createTestTask(testDb, 'Task with watched files');
|
|
156
|
+
// Watch files
|
|
157
|
+
watchFilesAction(testDb, {
|
|
158
|
+
task_id: taskId,
|
|
159
|
+
action: 'watch',
|
|
160
|
+
file_paths: ['src/index.ts', 'src/database.ts', 'src/schema.ts']
|
|
161
|
+
});
|
|
162
|
+
// List files
|
|
163
|
+
const result = watchFilesAction(testDb, {
|
|
164
|
+
task_id: taskId,
|
|
165
|
+
action: 'list'
|
|
166
|
+
});
|
|
167
|
+
assert.ok(result.success);
|
|
168
|
+
assert.strictEqual(result.action, 'list');
|
|
169
|
+
assert.strictEqual(result.files_count, 3);
|
|
170
|
+
assert.strictEqual(result.files.length, 3);
|
|
171
|
+
assert.ok(result.files.includes('src/index.ts'));
|
|
172
|
+
assert.ok(result.files.includes('src/database.ts'));
|
|
173
|
+
assert.ok(result.files.includes('src/schema.ts'));
|
|
174
|
+
});
|
|
175
|
+
it('should handle watching duplicate files (idempotent)', () => {
|
|
176
|
+
const taskId = createTestTask(testDb, 'Task for idempotent test');
|
|
177
|
+
// Watch files first time
|
|
178
|
+
const result1 = watchFilesAction(testDb, {
|
|
179
|
+
task_id: taskId,
|
|
180
|
+
action: 'watch',
|
|
181
|
+
file_paths: ['src/index.ts']
|
|
182
|
+
});
|
|
183
|
+
assert.strictEqual(result1.files_added, 1);
|
|
184
|
+
// Watch same file again
|
|
185
|
+
const result2 = watchFilesAction(testDb, {
|
|
186
|
+
task_id: taskId,
|
|
187
|
+
action: 'watch',
|
|
188
|
+
file_paths: ['src/index.ts']
|
|
189
|
+
});
|
|
190
|
+
assert.strictEqual(result2.files_added, 0, 'Should not add duplicate file');
|
|
191
|
+
// Verify only one link exists
|
|
192
|
+
const listResult = watchFilesAction(testDb, {
|
|
193
|
+
task_id: taskId,
|
|
194
|
+
action: 'list'
|
|
195
|
+
});
|
|
196
|
+
assert.strictEqual(listResult.files_count, 1);
|
|
197
|
+
});
|
|
198
|
+
it('should unwatch files from a task', () => {
|
|
199
|
+
const taskId = createTestTask(testDb, 'Task for unwatch test');
|
|
200
|
+
// Watch files
|
|
201
|
+
watchFilesAction(testDb, {
|
|
202
|
+
task_id: taskId,
|
|
203
|
+
action: 'watch',
|
|
204
|
+
file_paths: ['src/index.ts', 'src/database.ts', 'src/schema.ts']
|
|
205
|
+
});
|
|
206
|
+
// Unwatch one file
|
|
207
|
+
const result = watchFilesAction(testDb, {
|
|
208
|
+
task_id: taskId,
|
|
209
|
+
action: 'unwatch',
|
|
210
|
+
file_paths: ['src/database.ts']
|
|
211
|
+
});
|
|
212
|
+
assert.ok(result.success);
|
|
213
|
+
assert.strictEqual(result.action, 'unwatch');
|
|
214
|
+
assert.strictEqual(result.files_removed, 1);
|
|
215
|
+
assert.deepStrictEqual(result.files, ['src/database.ts']);
|
|
216
|
+
// Verify remaining files
|
|
217
|
+
const listResult = watchFilesAction(testDb, {
|
|
218
|
+
task_id: taskId,
|
|
219
|
+
action: 'list'
|
|
220
|
+
});
|
|
221
|
+
assert.strictEqual(listResult.files_count, 2);
|
|
222
|
+
assert.ok(listResult.files.includes('src/index.ts'));
|
|
223
|
+
assert.ok(listResult.files.includes('src/schema.ts'));
|
|
224
|
+
assert.ok(!listResult.files.includes('src/database.ts'));
|
|
225
|
+
});
|
|
226
|
+
it('should unwatch multiple files at once', () => {
|
|
227
|
+
const taskId = createTestTask(testDb, 'Task for batch unwatch');
|
|
228
|
+
// Watch files
|
|
229
|
+
watchFilesAction(testDb, {
|
|
230
|
+
task_id: taskId,
|
|
231
|
+
action: 'watch',
|
|
232
|
+
file_paths: ['src/index.ts', 'src/database.ts', 'src/schema.ts', 'src/types.ts']
|
|
233
|
+
});
|
|
234
|
+
// Unwatch multiple files
|
|
235
|
+
const result = watchFilesAction(testDb, {
|
|
236
|
+
task_id: taskId,
|
|
237
|
+
action: 'unwatch',
|
|
238
|
+
file_paths: ['src/database.ts', 'src/types.ts']
|
|
239
|
+
});
|
|
240
|
+
assert.strictEqual(result.files_removed, 2);
|
|
241
|
+
// Verify remaining files
|
|
242
|
+
const listResult = watchFilesAction(testDb, {
|
|
243
|
+
task_id: taskId,
|
|
244
|
+
action: 'list'
|
|
245
|
+
});
|
|
246
|
+
assert.strictEqual(listResult.files_count, 2);
|
|
247
|
+
assert.ok(listResult.files.includes('src/index.ts'));
|
|
248
|
+
assert.ok(listResult.files.includes('src/schema.ts'));
|
|
249
|
+
});
|
|
250
|
+
it('should handle unwatching non-existent file gracefully', () => {
|
|
251
|
+
const taskId = createTestTask(testDb, 'Task for non-existent unwatch');
|
|
252
|
+
// Watch one file
|
|
253
|
+
watchFilesAction(testDb, {
|
|
254
|
+
task_id: taskId,
|
|
255
|
+
action: 'watch',
|
|
256
|
+
file_paths: ['src/index.ts']
|
|
257
|
+
});
|
|
258
|
+
// Try to unwatch file that was never watched
|
|
259
|
+
const result = watchFilesAction(testDb, {
|
|
260
|
+
task_id: taskId,
|
|
261
|
+
action: 'unwatch',
|
|
262
|
+
file_paths: ['src/non-existent.ts']
|
|
263
|
+
});
|
|
264
|
+
assert.ok(result.success);
|
|
265
|
+
assert.strictEqual(result.files_removed, 0, 'Should remove 0 files');
|
|
266
|
+
});
|
|
267
|
+
it('should throw error for invalid task_id', () => {
|
|
268
|
+
assert.throws(() => {
|
|
269
|
+
watchFilesAction(testDb, {
|
|
270
|
+
task_id: 999,
|
|
271
|
+
action: 'list'
|
|
272
|
+
});
|
|
273
|
+
}, /Task with id 999 not found/);
|
|
274
|
+
});
|
|
275
|
+
it('should throw error when watch action missing file_paths', () => {
|
|
276
|
+
const taskId = createTestTask(testDb, 'Task for error test');
|
|
277
|
+
assert.throws(() => {
|
|
278
|
+
watchFilesAction(testDb, {
|
|
279
|
+
task_id: taskId,
|
|
280
|
+
action: 'watch'
|
|
281
|
+
});
|
|
282
|
+
}, /Parameter "file_paths" is required for watch action/);
|
|
283
|
+
});
|
|
284
|
+
it('should throw error when unwatch action missing file_paths', () => {
|
|
285
|
+
const taskId = createTestTask(testDb, 'Task for error test');
|
|
286
|
+
assert.throws(() => {
|
|
287
|
+
watchFilesAction(testDb, {
|
|
288
|
+
task_id: taskId,
|
|
289
|
+
action: 'unwatch'
|
|
290
|
+
});
|
|
291
|
+
}, /Parameter "file_paths" is required for unwatch action/);
|
|
292
|
+
});
|
|
293
|
+
it('should handle empty file_paths array for watch', () => {
|
|
294
|
+
const taskId = createTestTask(testDb, 'Task for empty array test');
|
|
295
|
+
assert.throws(() => {
|
|
296
|
+
watchFilesAction(testDb, {
|
|
297
|
+
task_id: taskId,
|
|
298
|
+
action: 'watch',
|
|
299
|
+
file_paths: []
|
|
300
|
+
});
|
|
301
|
+
}, /Parameter "file_paths" is required for watch action/);
|
|
302
|
+
});
|
|
303
|
+
it('should watch then unwatch all files', () => {
|
|
304
|
+
const taskId = createTestTask(testDb, 'Task for full cycle test');
|
|
305
|
+
// Watch files
|
|
306
|
+
watchFilesAction(testDb, {
|
|
307
|
+
task_id: taskId,
|
|
308
|
+
action: 'watch',
|
|
309
|
+
file_paths: ['src/index.ts', 'src/database.ts']
|
|
310
|
+
});
|
|
311
|
+
// Verify watched
|
|
312
|
+
const listResult1 = watchFilesAction(testDb, {
|
|
313
|
+
task_id: taskId,
|
|
314
|
+
action: 'list'
|
|
315
|
+
});
|
|
316
|
+
assert.strictEqual(listResult1.files_count, 2);
|
|
317
|
+
// Unwatch all
|
|
318
|
+
watchFilesAction(testDb, {
|
|
319
|
+
task_id: taskId,
|
|
320
|
+
action: 'unwatch',
|
|
321
|
+
file_paths: ['src/index.ts', 'src/database.ts']
|
|
322
|
+
});
|
|
323
|
+
// Verify empty
|
|
324
|
+
const listResult2 = watchFilesAction(testDb, {
|
|
325
|
+
task_id: taskId,
|
|
326
|
+
action: 'list'
|
|
327
|
+
});
|
|
328
|
+
assert.strictEqual(listResult2.files_count, 0);
|
|
329
|
+
});
|
|
330
|
+
it('should handle various file path formats', () => {
|
|
331
|
+
const taskId = createTestTask(testDb, 'Task for path formats');
|
|
332
|
+
const result = watchFilesAction(testDb, {
|
|
333
|
+
task_id: taskId,
|
|
334
|
+
action: 'watch',
|
|
335
|
+
file_paths: [
|
|
336
|
+
'package.json',
|
|
337
|
+
'src/index.ts',
|
|
338
|
+
'docs/README.md',
|
|
339
|
+
'tests/unit/test.ts'
|
|
340
|
+
]
|
|
341
|
+
});
|
|
342
|
+
assert.strictEqual(result.files_added, 4);
|
|
343
|
+
const listResult = watchFilesAction(testDb, {
|
|
344
|
+
task_id: taskId,
|
|
345
|
+
action: 'list'
|
|
346
|
+
});
|
|
347
|
+
assert.strictEqual(listResult.files_count, 4);
|
|
348
|
+
});
|
|
349
|
+
console.log('\n✅ All watch_files action tests passed!\n');
|
|
350
|
+
});
|
|
351
|
+
//# sourceMappingURL=tasks.watch-files-action.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.watch-files-action.test.js","sourceRoot":"","sources":["../../src/tests/tasks.watch-files-action.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGnE;;GAEG;AACH,IAAI,MAAoB,CAAC;AAEzB;;G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","sourceRoot":"","sources":["../../src/tests/tasks.watch-files-parameter.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|