mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-29 18:36:23 +02:00
add test agent script
This commit is contained in:
parent
ac82eed82b
commit
01fd938fb0
1 changed files with 19 additions and 0 deletions
19
apps/x/apps/main/src/test-agent.ts
Normal file
19
apps/x/apps/main/src/test-agent.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import * as runsCore from '@x/core/dist/runs/runs.js';
|
||||
import { bus } from '@x/core/dist/runs/bus.js';
|
||||
|
||||
async function main() {
|
||||
const { id } = await runsCore.createRun({
|
||||
// this will expect an agent file to exist at ~/.rowboat/agents/test-agent.md
|
||||
agentId: 'test-agent',
|
||||
});
|
||||
console.log(`created run: ${id}`);
|
||||
|
||||
await bus.subscribe(id, async (event) => {
|
||||
console.log(`got event: ${JSON.stringify(event)}`);
|
||||
});
|
||||
|
||||
const msgId = await runsCore.createMessage(id, 'whats your name?');
|
||||
console.log(`created message: ${msgId}`);
|
||||
}
|
||||
|
||||
main();
|
||||
Loading…
Add table
Add a link
Reference in a new issue