2be354322d
- Renamed npm package scope from @mariozechner to @oh-my-pi across all packages for consistent branding. - Removed packages/pods directory and all related pod management functionality. - Updated import paths and module declarations throughout codebase to reflect new package names. - Reformatted code with consistent trailing comma removal and ternary operator alignment.
23 lines
628 B
TypeScript
23 lines
628 B
TypeScript
/**
|
|
* Minimal SDK Usage
|
|
*
|
|
* Uses all defaults: discovers skills, hooks, tools, context files
|
|
* from cwd and ~/.pi/agent. Model chosen from settings or first available.
|
|
*/
|
|
|
|
import { createAgentSession } from "@oh-my-pi/pi-coding-agent";
|
|
|
|
const { session } = await createAgentSession();
|
|
|
|
session.subscribe((event) => {
|
|
if (event.type === "message_update" && event.assistantMessageEvent.type === "text_delta") {
|
|
process.stdout.write(event.assistantMessageEvent.delta);
|
|
}
|
|
});
|
|
|
|
await session.prompt("What files are in the current directory?");
|
|
session.state.messages.forEach((msg) => {
|
|
console.log(msg);
|
|
});
|
|
console.log();
|