mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-10 19:30:46 +08:00
feat: add native result-file delivery
This commit is contained in:
parent
2803bbcbab
commit
d472dd5a75
65 changed files with 10205 additions and 255 deletions
|
|
@ -52,6 +52,34 @@ async function fixture(t) {
|
|||
return { root, defaultWorkspace, alternateWorkspace, path: join(root, 'workspaces.json') };
|
||||
}
|
||||
|
||||
test('workspace asks collect result files without an explicit Gate', async () => {
|
||||
const observed = [];
|
||||
const harness = {
|
||||
async sessionExists() { return true; },
|
||||
async ask(_sessionId, _text, options) {
|
||||
observed.push(options);
|
||||
await options?.onArtifact?.({ artifactId: 'artifact-one' });
|
||||
return 'answer';
|
||||
},
|
||||
};
|
||||
const state = { sessionFor: () => 'session-existing' };
|
||||
const askOptions = { timeoutMs: 1234 };
|
||||
|
||||
assert.deepEqual(await askInWorkspaceSession({
|
||||
harness,
|
||||
state,
|
||||
key: 'default',
|
||||
text: 'file request',
|
||||
askOptions,
|
||||
}), {
|
||||
sessionId: 'session-existing',
|
||||
answer: 'answer',
|
||||
artifacts: [{ artifactId: 'artifact-one' }],
|
||||
});
|
||||
assert.notEqual(observed[0], askOptions);
|
||||
assert.equal(typeof observed[0].onArtifact, 'function');
|
||||
});
|
||||
|
||||
test('BotWorkspaceStore persists the creation default and keeps bots isolated', async (t) => {
|
||||
const { path, defaultWorkspace, alternateWorkspace } = await fixture(t);
|
||||
const store = await new BotWorkspaceStore(path, { defaultWorkspace }).load();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue