mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
Deletes packages/client, packages/protocol (CBOR codec), packages/server, coding-agent's src/experimental (except source-resolver.ts, which source runs still preload), src/cli/experimental, src/client, the example plugin, and their tests. coding-agent no longer depends on @earendil-works/chord. The installer lock drops esbuild, so its platform-package sanity check goes too.
22 lines
895 B
TypeScript
22 lines
895 B
TypeScript
import { createAssistantMessageEventStream, Type } from "@earendil-works/pi-ai";
|
|
import { complete, getModel, getProviders, streamSimple } from "@earendil-works/pi-ai/compat";
|
|
import { Agent, streamProxy } from "@earendil-works/pi-agent-core";
|
|
|
|
// Keep this entry browser-safe. It is bundled by scripts/check-browser-smoke.mjs
|
|
// to catch accidental Node-only runtime imports in browser-facing package exports.
|
|
const model = getModel("google", "gemini-2.5-flash");
|
|
const schema = Type.Object({ prompt: Type.String() });
|
|
const stream = createAssistantMessageEventStream();
|
|
|
|
const agent = new Agent({ initialState: { model }, streamFn: streamSimple });
|
|
agent.steer({ role: "user", content: [{ type: "text", text: "queued" }], timestamp: 0 });
|
|
|
|
console.log(
|
|
model.id,
|
|
getProviders().length,
|
|
typeof complete,
|
|
schema.type,
|
|
typeof stream.push,
|
|
agent.hasQueuedMessages(),
|
|
typeof streamProxy,
|
|
);
|