chore(vendor): import pi 1.3.0

Imported as a linear vendor commit so forge rebases do not replay the upstream root tree.

git-subtree-dir: third_party/pi

git-subtree-split: 71023aec1546d6d677a65669c5665c0927ce0dd0
This commit is contained in:
2026-10-15 17:58:48 -04:00
parent 719370c8f7
commit 6081e3e325
1743 changed files with 205460 additions and 131705 deletions

View File

@@ -1,4 +1,5 @@
import type { AssistantMessage, AssistantMessageEvent, Model } from "@earendil-works/pi-ai";
import { normalizeContext } from "@earendil-works/pi-ai";
import { afterEach, describe, expect, it, vi } from "vitest";
import { type ProxyAssistantMessageEvent, streamProxy } from "../src/proxy.ts";
@@ -53,14 +54,10 @@ describe("streamProxy", () => {
vi.fn(async () => new Response(body, { status: 200 })),
);
const stream = streamProxy(
model,
{ systemPrompt: "", messages: [] },
{
authToken: "test-token",
proxyUrl: "https://proxy.example.com",
},
);
const stream = streamProxy(model, normalizeContext({ systemPrompt: "", messages: [] }), {
authToken: "test-token",
proxyUrl: "https://proxy.example.com",
});
const events: AssistantMessageEvent[] = [];
for await (const event of stream) events.push(event);
const result = await stream.result();
@@ -86,14 +83,10 @@ describe("streamProxy", () => {
vi.fn(async () => new Response(start + done, { status: 200 })),
);
const stream = streamProxy(
model,
{ systemPrompt: "", messages: [] },
{
authToken: "test-token",
proxyUrl: "https://proxy.example.com",
},
);
const stream = streamProxy(model, normalizeContext({ systemPrompt: "", messages: [] }), {
authToken: "test-token",
proxyUrl: "https://proxy.example.com",
});
const events: AssistantMessageEvent[] = [];
for await (const event of stream) events.push(event);
const result = await stream.result();
@@ -110,14 +103,10 @@ describe("streamProxy", () => {
vi.fn(async () => new Response(body, { status: 200 })),
);
const stream = streamProxy(
model,
{ systemPrompt: "", messages: [] },
{
authToken: "test-token",
proxyUrl: "https://proxy.example.com",
},
);
const stream = streamProxy(model, normalizeContext({ systemPrompt: "", messages: [] }), {
authToken: "test-token",
proxyUrl: "https://proxy.example.com",
});
const events: AssistantMessageEvent[] = [];
for await (const event of stream) events.push(event);
const result = await stream.result();