feat(background): add background registry and status tool with tests

This commit is contained in:
pi
2026-04-12 13:49:55 +01:00
parent afab606237
commit 21ae108bae
6 changed files with 306 additions and 0 deletions

12
tmp-debug.mjs Normal file
View File

@@ -0,0 +1,12 @@
import { createBackgroundRegistry } from './src/background-registry.js';
import { createBackgroundStatusTool } from './src/background-status-tool.js';
(async()=>{
const reg = createBackgroundRegistry();
reg.recordLaunch({ runId: 'r1', preset: 'p1', task: 't1' });
reg.recordLaunch({ runId: 'r2', preset: 'p2', task: 't2' });
reg.recordUpdate('r2', { status: 'completed', exitCode: 0, finalText: 'done' });
const tool = createBackgroundStatusTool({ registry: reg });
const resDefault = await tool.execute('id', {}, undefined, undefined, undefined);
console.log('default details', resDefault.details);
console.log('default content', resDefault.content);
})();