chapterhouse 0.3.24 → 0.3.25
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/dist/api/server.js +52 -15
- package/dist/api/worker-events-sse.integration.test.js +241 -1
- package/dist/copilot/orchestrator.js +2 -0
- package/dist/copilot/task-event-log.js +6 -1
- package/dist/copilot/task-event-log.test.js +45 -0
- package/dist/copilot/tools.js +39 -4
- package/dist/store/db.js +45 -7
- package/dist/store/db.test.js +56 -0
- package/package.json +1 -1
- package/web/dist/assets/{index-BK-hInnO.js → index-BRPJa1DK.js} +83 -83
- package/web/dist/assets/{index-BK-hInnO.js.map → index-BRPJa1DK.js.map} +1 -1
- package/web/dist/assets/index-DhY5yWmC.css +10 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-D__tBB0X.css +0 -10
package/dist/store/db.test.js
CHANGED
|
@@ -266,6 +266,62 @@ test("#86: agent_task_events table exists in schema after getDb()", async () =>
|
|
|
266
266
|
dbModule.closeDb();
|
|
267
267
|
}
|
|
268
268
|
});
|
|
269
|
+
test("#158: appendTaskOutputDeltaEvent writes output_delta event with text", async () => {
|
|
270
|
+
const dbModule = await loadDbModule();
|
|
271
|
+
try {
|
|
272
|
+
const db = dbModule.getDb();
|
|
273
|
+
db.prepare("INSERT INTO agent_tasks (task_id, agent_slug, description, status) VALUES (?, ?, ?, ?)").run("task-delta-001", "coder", "delta test", "running");
|
|
274
|
+
const ev = dbModule.appendTaskOutputDeltaEvent("task-delta-001", "Hello world");
|
|
275
|
+
assert.ok(ev, "appendTaskOutputDeltaEvent must return the event");
|
|
276
|
+
assert.equal(ev.kind, "output_delta");
|
|
277
|
+
assert.equal(ev.text, "Hello world");
|
|
278
|
+
assert.equal(ev.toolName, null);
|
|
279
|
+
assert.equal(ev.status, null);
|
|
280
|
+
assert.equal(ev.seq, 1);
|
|
281
|
+
const events = dbModule.getTaskEvents("task-delta-001");
|
|
282
|
+
assert.equal(events.length, 1);
|
|
283
|
+
assert.equal(events[0].text, "Hello world");
|
|
284
|
+
assert.equal(events[0].kind, "output_delta");
|
|
285
|
+
}
|
|
286
|
+
finally {
|
|
287
|
+
dbModule.closeDb();
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
test("#158: appendTaskStatusEvent writes task_status event with status field", async () => {
|
|
291
|
+
const dbModule = await loadDbModule();
|
|
292
|
+
try {
|
|
293
|
+
const db = dbModule.getDb();
|
|
294
|
+
db.prepare("INSERT INTO agent_tasks (task_id, agent_slug, description, status) VALUES (?, ?, ?, ?)").run("task-status-001", "coder", "status test", "running");
|
|
295
|
+
const ev = dbModule.appendTaskStatusEvent("task-status-001", "completed", "All done");
|
|
296
|
+
assert.ok(ev, "appendTaskStatusEvent must return the event");
|
|
297
|
+
assert.equal(ev.kind, "task_status");
|
|
298
|
+
assert.equal(ev.status, "completed");
|
|
299
|
+
assert.equal(ev.summary, "All done");
|
|
300
|
+
assert.equal(ev.text, null);
|
|
301
|
+
assert.equal(ev.toolName, null);
|
|
302
|
+
const events = dbModule.getTaskEvents("task-status-001");
|
|
303
|
+
assert.equal(events.length, 1);
|
|
304
|
+
assert.equal(events[0].status, "completed");
|
|
305
|
+
assert.equal(events[0].kind, "task_status");
|
|
306
|
+
}
|
|
307
|
+
finally {
|
|
308
|
+
dbModule.closeDb();
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
test("#158: updateTaskResult updates agent_tasks status and result", async () => {
|
|
312
|
+
const dbModule = await loadDbModule();
|
|
313
|
+
try {
|
|
314
|
+
const db = dbModule.getDb();
|
|
315
|
+
db.prepare("INSERT INTO agent_tasks (task_id, agent_slug, description, status) VALUES (?, ?, ?, ?)").run("task-result-001", "coder", "result test", "running");
|
|
316
|
+
dbModule.updateTaskResult("task-result-001", "completed", "output text");
|
|
317
|
+
const row = db.prepare("SELECT status, result FROM agent_tasks WHERE task_id = ?").get("task-result-001");
|
|
318
|
+
assert.equal(row.status, "completed");
|
|
319
|
+
assert.equal(row.result, "output text");
|
|
320
|
+
}
|
|
321
|
+
finally {
|
|
322
|
+
dbModule.closeDb();
|
|
323
|
+
}
|
|
324
|
+
});
|
|
269
325
|
// ---------------------------------------------------------------------------
|
|
270
326
|
// normalizeSqliteTsToIso — unit tests
|
|
271
327
|
// ---------------------------------------------------------------------------
|
package/package.json
CHANGED