@mariozechner/pi-ai 0.5.30 → 0.5.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +275 -10
- package/dist/agent/agent.d.ts +5 -0
- package/dist/agent/agent.d.ts.map +1 -0
- package/dist/agent/agent.js +161 -0
- package/dist/agent/agent.js.map +1 -0
- package/dist/agent/index.d.ts +4 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +3 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/tools/calculate.d.ts +17 -0
- package/dist/agent/tools/calculate.d.ts.map +1 -0
- package/dist/agent/tools/calculate.js +23 -0
- package/dist/agent/tools/calculate.js.map +1 -0
- package/dist/agent/tools/get-current-time.d.ts +20 -0
- package/dist/agent/tools/get-current-time.d.ts.map +1 -0
- package/dist/agent/tools/get-current-time.js +36 -0
- package/dist/agent/tools/get-current-time.js.map +1 -0
- package/dist/agent/tools/index.d.ts +3 -0
- package/dist/agent/tools/index.d.ts.map +1 -0
- package/dist/agent/tools/index.js +3 -0
- package/dist/agent/tools/index.js.map +1 -0
- package/dist/agent/types.d.ts +53 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/types.js +2 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/event-stream.d.ts +19 -0
- package/dist/event-stream.d.ts.map +1 -0
- package/dist/event-stream.js +77 -0
- package/dist/event-stream.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/models.generated.d.ts +191 -2
- package/dist/models.generated.d.ts.map +1 -1
- package/dist/models.generated.js +204 -15
- package/dist/models.generated.js.map +1 -1
- package/dist/providers/anthropic.d.ts +3 -3
- package/dist/providers/anthropic.d.ts.map +1 -1
- package/dist/providers/anthropic.js +107 -55
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/google.d.ts +3 -3
- package/dist/providers/google.d.ts.map +1 -1
- package/dist/providers/google.js +49 -11
- package/dist/providers/google.js.map +1 -1
- package/dist/providers/openai-completions.d.ts +3 -3
- package/dist/providers/openai-completions.d.ts.map +1 -1
- package/dist/providers/openai-completions.js +85 -148
- package/dist/providers/openai-completions.js.map +1 -1
- package/dist/providers/openai-responses.d.ts +3 -3
- package/dist/providers/openai-responses.d.ts.map +1 -1
- package/dist/providers/openai-responses.js +59 -9
- package/dist/providers/openai-responses.js.map +1 -1
- package/dist/providers/{utils.d.ts → transorm-messages.d.ts} +1 -1
- package/dist/providers/transorm-messages.d.ts.map +1 -0
- package/dist/providers/{utils.js → transorm-messages.js} +1 -1
- package/dist/providers/transorm-messages.js.map +1 -0
- package/dist/stream.d.ts +10 -0
- package/dist/stream.d.ts.map +1 -0
- package/dist/{generate.js → stream.js} +4 -65
- package/dist/stream.js.map +1 -0
- package/dist/types.d.ts +29 -12
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/validation.d.ts +10 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +30 -0
- package/dist/validation.js.map +1 -0
- package/package.json +7 -5
- package/dist/generate.d.ts +0 -22
- package/dist/generate.d.ts.map +0 -1
- package/dist/generate.js.map +0 -1
- package/dist/providers/utils.d.ts.map +0 -1
- package/dist/providers/utils.js.map +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export async function getCurrentTime(timezone) {
|
|
3
|
+
const date = new Date();
|
|
4
|
+
if (timezone) {
|
|
5
|
+
try {
|
|
6
|
+
return {
|
|
7
|
+
output: date.toLocaleString("en-US", {
|
|
8
|
+
timeZone: timezone,
|
|
9
|
+
dateStyle: "full",
|
|
10
|
+
timeStyle: "long",
|
|
11
|
+
}),
|
|
12
|
+
details: { utcTimestamp: date.getTime() },
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
throw new Error(`Invalid timezone: ${timezone}. Current UTC time: ${date.toISOString()}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
output: date.toLocaleString("en-US", { dateStyle: "full", timeStyle: "long" }),
|
|
21
|
+
details: { utcTimestamp: date.getTime() },
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const getCurrentTimeSchema = z.object({
|
|
25
|
+
timezone: z.string().optional().describe("Optional timezone (e.g., 'America/New_York', 'Europe/London')"),
|
|
26
|
+
});
|
|
27
|
+
export const getCurrentTimeTool = {
|
|
28
|
+
label: "Current Time",
|
|
29
|
+
name: "get_current_time",
|
|
30
|
+
description: "Get the current date and time",
|
|
31
|
+
parameters: getCurrentTimeSchema,
|
|
32
|
+
execute: async (_toolCallId, args) => {
|
|
33
|
+
return getCurrentTime(args.timezone);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=get-current-time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-current-time.js","sourceRoot":"","sources":["../../../src/agent/tools/get-current-time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,QAAiB;IACrD,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;IACxB,IAAI,QAAQ,EAAE,CAAC;QACd,IAAI,CAAC;YACJ,OAAO;gBACN,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;oBACpC,QAAQ,EAAE,QAAQ;oBAClB,SAAS,EAAE,MAAM;oBACjB,SAAS,EAAE,MAAM;iBACjB,CAAC;gBACF,OAAO,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE;aACzC,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,qBAAqB,QAAQ,uBAAuB,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC3F,CAAC;IACF,CAAC;IACD,OAAO;QACN,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QAC9E,OAAO,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE;KACzC,CAAC;AACH,CAAC;AAED,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+DAA+D,CAAC;CACzG,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAqE;IACnG,KAAK,EAAE,cAAc;IACrB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,+BAA+B;IAC5C,UAAU,EAAE,oBAAoB;IAChC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE;QACpC,OAAO,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;CACD,CAAC","sourcesContent":["import { z } from \"zod\";\nimport type { AgentTool } from \"../../agent\";\nimport type { AgentToolResult } from \"../types\";\n\nexport interface GetCurrentTimeResult extends AgentToolResult<{ utcTimestamp: number }> {}\n\nexport async function getCurrentTime(timezone?: string): Promise<GetCurrentTimeResult> {\n\tconst date = new Date();\n\tif (timezone) {\n\t\ttry {\n\t\t\treturn {\n\t\t\t\toutput: date.toLocaleString(\"en-US\", {\n\t\t\t\t\ttimeZone: timezone,\n\t\t\t\t\tdateStyle: \"full\",\n\t\t\t\t\ttimeStyle: \"long\",\n\t\t\t\t}),\n\t\t\t\tdetails: { utcTimestamp: date.getTime() },\n\t\t\t};\n\t\t} catch (e) {\n\t\t\tthrow new Error(`Invalid timezone: ${timezone}. Current UTC time: ${date.toISOString()}`);\n\t\t}\n\t}\n\treturn {\n\t\toutput: date.toLocaleString(\"en-US\", { dateStyle: \"full\", timeStyle: \"long\" }),\n\t\tdetails: { utcTimestamp: date.getTime() },\n\t};\n}\n\nconst getCurrentTimeSchema = z.object({\n\ttimezone: z.string().optional().describe(\"Optional timezone (e.g., 'America/New_York', 'Europe/London')\"),\n});\n\nexport const getCurrentTimeTool: AgentTool<typeof getCurrentTimeSchema, { utcTimestamp: number }> = {\n\tlabel: \"Current Time\",\n\tname: \"get_current_time\",\n\tdescription: \"Get the current date and time\",\n\tparameters: getCurrentTimeSchema,\n\texecute: async (_toolCallId, args) => {\n\t\treturn getCurrentTime(args.timezone);\n\t},\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agent/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export { calculate, calculateTool } from \"./calculate\";\nexport { getCurrentTime, getCurrentTimeTool } from \"./get-current-time\";\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ZodSchema, z } from "zod";
|
|
2
|
+
import type { AssistantMessage, AssistantMessageEvent, Message, Model, SimpleStreamOptions, Tool, ToolResultMessage } from "../types.js";
|
|
3
|
+
export interface AgentToolResult<T> {
|
|
4
|
+
output: string;
|
|
5
|
+
details: T;
|
|
6
|
+
}
|
|
7
|
+
export interface AgentTool<TParameters extends ZodSchema = ZodSchema, TDetails = any> extends Tool<TParameters> {
|
|
8
|
+
label: string;
|
|
9
|
+
execute: (toolCallId: string, params: z.infer<TParameters>, signal?: AbortSignal) => Promise<AgentToolResult<TDetails>>;
|
|
10
|
+
}
|
|
11
|
+
export interface AgentContext {
|
|
12
|
+
systemPrompt: string;
|
|
13
|
+
messages: Message[];
|
|
14
|
+
tools?: AgentTool<any>[];
|
|
15
|
+
}
|
|
16
|
+
export type AgentEvent = {
|
|
17
|
+
type: "agent_start";
|
|
18
|
+
} | {
|
|
19
|
+
type: "turn_start";
|
|
20
|
+
} | {
|
|
21
|
+
type: "message_start";
|
|
22
|
+
message: Message;
|
|
23
|
+
} | {
|
|
24
|
+
type: "message_update";
|
|
25
|
+
assistantMessageEvent: AssistantMessageEvent;
|
|
26
|
+
message: AssistantMessage;
|
|
27
|
+
} | {
|
|
28
|
+
type: "message_end";
|
|
29
|
+
message: Message;
|
|
30
|
+
} | {
|
|
31
|
+
type: "tool_execution_start";
|
|
32
|
+
toolCallId: string;
|
|
33
|
+
toolName: string;
|
|
34
|
+
args: any;
|
|
35
|
+
} | {
|
|
36
|
+
type: "tool_execution_end";
|
|
37
|
+
toolCallId: string;
|
|
38
|
+
toolName: string;
|
|
39
|
+
result: AgentToolResult<any> | string;
|
|
40
|
+
isError: boolean;
|
|
41
|
+
} | {
|
|
42
|
+
type: "turn_end";
|
|
43
|
+
assistantMessage: AssistantMessage;
|
|
44
|
+
toolResults: ToolResultMessage[];
|
|
45
|
+
} | {
|
|
46
|
+
type: "agent_end";
|
|
47
|
+
messages: AgentContext["messages"];
|
|
48
|
+
};
|
|
49
|
+
export interface PromptConfig extends SimpleStreamOptions {
|
|
50
|
+
model: Model<any>;
|
|
51
|
+
preprocessor?: (messages: AgentContext["messages"], abortSignal?: AbortSignal) => Promise<AgentContext["messages"]>;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agent/types.ts"],"names":[],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AE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE,GAEjF;IACA,IAAI,EAAE,oBAAoB,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,eAAe,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;IACtC,OAAO,EAAE,OAAO,CAAC;CAChB,GAED;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAAC,WAAW,EAAE,iBAAiB,EAAE,CAAA;CAAE,GAG1F;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,CAAA;CAAE,CAAC;AAG7D,MAAM,WAAW,YAAa,SAAQ,mBAAmB;IACxD,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;CACpH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/agent/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ZodSchema, z } from \"zod\";\nimport type {\n\tAssistantMessage,\n\tAssistantMessageEvent,\n\tMessage,\n\tModel,\n\tSimpleStreamOptions,\n\tTool,\n\tToolResultMessage,\n} from \"../types.js\";\n\nexport interface AgentToolResult<T> {\n\t// Output of the tool to be given to the LLM in ToolResultMessage.content\n\toutput: string;\n\t// Details to be displayed in a UI or loggedty\n\tdetails: T;\n}\n\n// AgentTool extends Tool but adds the execute function\nexport interface AgentTool<TParameters extends ZodSchema = ZodSchema, TDetails = any> extends Tool<TParameters> {\n\t// A human-readable label for the tool to be displayed in UI\n\tlabel: string;\n\texecute: (\n\t\ttoolCallId: string,\n\t\tparams: z.infer<TParameters>,\n\t\tsignal?: AbortSignal,\n\t) => Promise<AgentToolResult<TDetails>>;\n}\n\n// AgentContext is like Context but uses AgentTool\nexport interface AgentContext {\n\tsystemPrompt: string;\n\tmessages: Message[];\n\ttools?: AgentTool<any>[];\n}\n\n// Event types\nexport type AgentEvent =\n\t// Emitted when the agent starts. An agent can emit multiple turns\n\t| { type: \"agent_start\" }\n\t// Emitted when a turn starts. A turn can emit an optional user message (initial prompt), an assistant message (response) and multiple tool result messages\n\t| { type: \"turn_start\" }\n\t// Emitted when a user, assistant or tool result message starts\n\t| { type: \"message_start\"; message: Message }\n\t// Emitted when an asssitant messages is updated due to streaming\n\t| { type: \"message_update\"; assistantMessageEvent: AssistantMessageEvent; message: AssistantMessage }\n\t// Emitted when a user, assistant or tool result message is complete\n\t| { type: \"message_end\"; message: Message }\n\t// Emitted when a tool execution starts\n\t| { type: \"tool_execution_start\"; toolCallId: string; toolName: string; args: any }\n\t// Emitted when a tool execution completes\n\t| {\n\t\t\ttype: \"tool_execution_end\";\n\t\t\ttoolCallId: string;\n\t\t\ttoolName: string;\n\t\t\tresult: AgentToolResult<any> | string;\n\t\t\tisError: boolean;\n\t }\n\t// Emitted when a full turn completes\n\t| { type: \"turn_end\"; assistantMessage: AssistantMessage; toolResults: ToolResultMessage[] }\n\t// Emitted when the agent has completed all its turns. All messages from every turn are\n\t// contained in messages, which can be appended to the context\n\t| { type: \"agent_end\"; messages: AgentContext[\"messages\"] };\n\n// Configuration for prompt execution\nexport interface PromptConfig extends SimpleStreamOptions {\n\tmodel: Model<any>;\n\tpreprocessor?: (messages: AgentContext[\"messages\"], abortSignal?: AbortSignal) => Promise<AgentContext[\"messages\"]>;\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AssistantMessage, AssistantMessageEvent } from "./types";
|
|
2
|
+
export declare class EventStream<T, R = T> implements AsyncIterable<T> {
|
|
3
|
+
private isComplete;
|
|
4
|
+
private extractResult;
|
|
5
|
+
private queue;
|
|
6
|
+
private waiting;
|
|
7
|
+
private done;
|
|
8
|
+
private finalResultPromise;
|
|
9
|
+
private resolveFinalResult;
|
|
10
|
+
constructor(isComplete: (event: T) => boolean, extractResult: (event: T) => R);
|
|
11
|
+
push(event: T): void;
|
|
12
|
+
end(result?: R): void;
|
|
13
|
+
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
14
|
+
result(): Promise<R>;
|
|
15
|
+
}
|
|
16
|
+
export declare class AssistantMessageEventStream extends EventStream<AssistantMessageEvent, AssistantMessage> {
|
|
17
|
+
constructor();
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=event-stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-stream.d.ts","sourceRoot":"","sources":["../src/event-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGvE,qBAAa,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IAQ5D,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,aAAa;IARtB,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,OAAO,CAA8C;IAC7D,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,kBAAkB,CAAa;IACvC,OAAO,CAAC,kBAAkB,CAAuB;gBAGxC,UAAU,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,EACjC,aAAa,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC;IAOvC,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IAiBpB,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI;IAYd,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC;IAcjD,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC;CAGpB;AAED,qBAAa,2BAA4B,SAAQ,WAAW,CAAC,qBAAqB,EAAE,gBAAgB,CAAC;;CAcpG"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Generic event stream class for async iteration
|
|
2
|
+
export class EventStream {
|
|
3
|
+
isComplete;
|
|
4
|
+
extractResult;
|
|
5
|
+
queue = [];
|
|
6
|
+
waiting = [];
|
|
7
|
+
done = false;
|
|
8
|
+
finalResultPromise;
|
|
9
|
+
resolveFinalResult;
|
|
10
|
+
constructor(isComplete, extractResult) {
|
|
11
|
+
this.isComplete = isComplete;
|
|
12
|
+
this.extractResult = extractResult;
|
|
13
|
+
this.finalResultPromise = new Promise((resolve) => {
|
|
14
|
+
this.resolveFinalResult = resolve;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
push(event) {
|
|
18
|
+
if (this.done)
|
|
19
|
+
return;
|
|
20
|
+
if (this.isComplete(event)) {
|
|
21
|
+
this.done = true;
|
|
22
|
+
this.resolveFinalResult(this.extractResult(event));
|
|
23
|
+
}
|
|
24
|
+
// Deliver to waiting consumer or queue it
|
|
25
|
+
const waiter = this.waiting.shift();
|
|
26
|
+
if (waiter) {
|
|
27
|
+
waiter({ value: event, done: false });
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.queue.push(event);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
end(result) {
|
|
34
|
+
this.done = true;
|
|
35
|
+
if (result !== undefined) {
|
|
36
|
+
this.resolveFinalResult(result);
|
|
37
|
+
}
|
|
38
|
+
// Notify all waiting consumers that we're done
|
|
39
|
+
while (this.waiting.length > 0) {
|
|
40
|
+
const waiter = this.waiting.shift();
|
|
41
|
+
waiter({ value: undefined, done: true });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async *[Symbol.asyncIterator]() {
|
|
45
|
+
while (true) {
|
|
46
|
+
if (this.queue.length > 0) {
|
|
47
|
+
yield this.queue.shift();
|
|
48
|
+
}
|
|
49
|
+
else if (this.done) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const result = await new Promise((resolve) => this.waiting.push(resolve));
|
|
54
|
+
if (result.done)
|
|
55
|
+
return;
|
|
56
|
+
yield result.value;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
result() {
|
|
61
|
+
return this.finalResultPromise;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export class AssistantMessageEventStream extends EventStream {
|
|
65
|
+
constructor() {
|
|
66
|
+
super((event) => event.type === "done" || event.type === "error", (event) => {
|
|
67
|
+
if (event.type === "done") {
|
|
68
|
+
return event.message;
|
|
69
|
+
}
|
|
70
|
+
else if (event.type === "error") {
|
|
71
|
+
return event.partial;
|
|
72
|
+
}
|
|
73
|
+
throw new Error("Unexpected event type for final result");
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=event-stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-stream.js","sourceRoot":"","sources":["../src/event-stream.ts"],"names":[],"mappings":"AAEA,iDAAiD;AACjD,MAAM,OAAO,WAAW;IAQd;IACA;IARD,KAAK,GAAQ,EAAE,CAAC;IAChB,OAAO,GAA2C,EAAE,CAAC;IACrD,IAAI,GAAG,KAAK,CAAC;IACb,kBAAkB,CAAa;IAC/B,kBAAkB,CAAuB;IAEjD,YACS,UAAiC,EACjC,aAA8B;QAD9B,eAAU,GAAV,UAAU,CAAuB;QACjC,kBAAa,GAAb,aAAa,CAAiB;QAEtC,IAAI,CAAC,kBAAkB,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACjD,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC;QACnC,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,KAAQ;QACZ,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO;QAEtB,I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GAAG,MAAM,IAAI,OAAO,CAAoB,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC7F,IAAI,MAAM,CAAC,IAAI;oBAAE,OAAO;gBACxB,MAAM,MAAM,CAAC,KAAK,CAAC;YACpB,CAAC;QACF,CAAC;IACF,CAAC;IAED,MAAM;QACL,OAAO,IAAI,CAAC,kBAAkB,CAAC;IAChC,CAAC;CACD;AAED,MAAM,OAAO,2BAA4B,SAAQ,WAAoD;IACpG;QACC,KAAK,CACJ,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAC1D,CAAC,KAAK,EAAE,EAAE;YACT,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;gBAC3B,OAAO,KAAK,CAAC,OAAO,CAAC;YACtB,CAAC;iBAAM,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gBACnC,OAAO,KAAK,CAAC,OAAO,CAAC;YACtB,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC3D,CAAC,CACD,CAAC;IACH,CAAC;CACD","sourcesContent":["import type { AssistantMessage, AssistantMessageEvent } from \"./types\";\n\n// Generic event stream class for async iteration\nexport class EventStream<T, R = T> implements AsyncIterable<T> {\n\tprivate queue: T[] = [];\n\tprivate waiting: ((value: IteratorResult<T>) => void)[] = [];\n\tprivate done = false;\n\tprivate finalResultPromise: Promise<R>;\n\tprivate resolveFinalResult!: (result: R) => void;\n\n\tconstructor(\n\t\tprivate isComplete: (event: T) => boolean,\n\t\tprivate extractResult: (event: T) => R,\n\t) {\n\t\tthis.finalResultPromise = new Promise((resolve) => {\n\t\t\tthis.resolveFinalResult = resolve;\n\t\t});\n\t}\n\n\tpush(event: T): void {\n\t\tif (this.done) return;\n\n\t\tif (this.isComplete(event)) {\n\t\t\tthis.done = true;\n\t\t\tthis.resolveFinalResult(this.extractResult(event));\n\t\t}\n\n\t\t// Deliver to waiting consumer or queue it\n\t\tconst waiter = this.waiting.shift();\n\t\tif (waiter) {\n\t\t\twaiter({ value: event, done: false });\n\t\t} else {\n\t\t\tthis.queue.push(event);\n\t\t}\n\t}\n\n\tend(result?: R): void {\n\t\tthis.done = true;\n\t\tif (result !== undefined) {\n\t\t\tthis.resolveFinalResult(result);\n\t\t}\n\t\t// Notify all waiting consumers that we're done\n\t\twhile (this.waiting.length > 0) {\n\t\t\tconst waiter = this.waiting.shift()!;\n\t\t\twaiter({ value: undefined as any, done: true });\n\t\t}\n\t}\n\n\tasync *[Symbol.asyncIterator](): AsyncIterator<T> {\n\t\twhile (true) {\n\t\t\tif (this.queue.length > 0) {\n\t\t\t\tyield this.queue.shift()!;\n\t\t\t} else if (this.done) {\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tconst result = await new Promise<IteratorResult<T>>((resolve) => this.waiting.push(resolve));\n\t\t\t\tif (result.done) return;\n\t\t\t\tyield result.value;\n\t\t\t}\n\t\t}\n\t}\n\n\tresult(): Promise<R> {\n\t\treturn this.finalResultPromise;\n\t}\n}\n\nexport class AssistantMessageEventStream extends EventStream<AssistantMessageEvent, AssistantMessage> {\n\tconstructor() {\n\t\tsuper(\n\t\t\t(event) => event.type === \"done\" || event.type === \"error\",\n\t\t\t(event) => {\n\t\t\t\tif (event.type === \"done\") {\n\t\t\t\t\treturn event.message;\n\t\t\t\t} else if (event.type === \"error\") {\n\t\t\t\t\treturn event.partial;\n\t\t\t\t}\n\t\t\t\tthrow new Error(\"Unexpected event type for final result\");\n\t\t\t},\n\t\t);\n\t}\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { z } from "zod";
|
|
2
|
+
export * from "./agent/index.js";
|
|
2
3
|
export * from "./models.js";
|
|
3
4
|
export * from "./providers/anthropic.js";
|
|
4
5
|
export * from "./providers/google.js";
|
|
5
6
|
export * from "./providers/openai-completions.js";
|
|
6
7
|
export * from "./providers/openai-responses.js";
|
|
8
|
+
export * from "./stream.js";
|
|
7
9
|
export * from "./types.js";
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { z } from "zod";
|
|
2
|
+
export * from "./agent/index.js";
|
|
2
3
|
export * from "./models.js";
|
|
3
4
|
export * from "./providers/anthropic.js";
|
|
4
5
|
export * from "./providers/google.js";
|
|
5
6
|
export * from "./providers/openai-completions.js";
|
|
6
7
|
export * from "./providers/openai-responses.js";
|
|
8
|
+
export * from "./stream.js";
|
|
7
9
|
export * from "./types.js";
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC","sourcesContent":["export { z } from \"zod\";\nexport * from \"./agent/index.js\";\nexport * from \"./models.js\";\nexport * from \"./providers/anthropic.js\";\nexport * from \"./providers/google.js\";\nexport * from \"./providers/openai-completions.js\";\nexport * from \"./providers/openai-responses.js\";\nexport * from \"./stream.js\";\nexport * from \"./types.js\";\n"]}
|
|
@@ -941,6 +941,23 @@ export declare const MODELS: {
|
|
|
941
941
|
contextWindow: number;
|
|
942
942
|
maxTokens: number;
|
|
943
943
|
};
|
|
944
|
+
readonly "moonshotai/kimi-k2-instruct-0905": {
|
|
945
|
+
id: string;
|
|
946
|
+
name: string;
|
|
947
|
+
api: "openai-completions";
|
|
948
|
+
provider: string;
|
|
949
|
+
baseUrl: string;
|
|
950
|
+
reasoning: false;
|
|
951
|
+
input: "text"[];
|
|
952
|
+
cost: {
|
|
953
|
+
input: number;
|
|
954
|
+
output: number;
|
|
955
|
+
cacheRead: number;
|
|
956
|
+
cacheWrite: number;
|
|
957
|
+
};
|
|
958
|
+
contextWindow: number;
|
|
959
|
+
maxTokens: number;
|
|
960
|
+
};
|
|
944
961
|
readonly "moonshotai/kimi-k2-instruct": {
|
|
945
962
|
id: string;
|
|
946
963
|
name: string;
|
|
@@ -1320,7 +1337,162 @@ export declare const MODELS: {
|
|
|
1320
1337
|
maxTokens: number;
|
|
1321
1338
|
};
|
|
1322
1339
|
};
|
|
1340
|
+
readonly zai: {
|
|
1341
|
+
readonly "glm-4.5-air": {
|
|
1342
|
+
id: string;
|
|
1343
|
+
name: string;
|
|
1344
|
+
api: "anthropic-messages";
|
|
1345
|
+
provider: string;
|
|
1346
|
+
baseUrl: string;
|
|
1347
|
+
reasoning: true;
|
|
1348
|
+
input: "text"[];
|
|
1349
|
+
cost: {
|
|
1350
|
+
input: number;
|
|
1351
|
+
output: number;
|
|
1352
|
+
cacheRead: number;
|
|
1353
|
+
cacheWrite: number;
|
|
1354
|
+
};
|
|
1355
|
+
contextWindow: number;
|
|
1356
|
+
maxTokens: number;
|
|
1357
|
+
};
|
|
1358
|
+
readonly "glm-4.5v": {
|
|
1359
|
+
id: string;
|
|
1360
|
+
name: string;
|
|
1361
|
+
api: "anthropic-messages";
|
|
1362
|
+
provider: string;
|
|
1363
|
+
baseUrl: string;
|
|
1364
|
+
reasoning: true;
|
|
1365
|
+
input: ("text" | "image")[];
|
|
1366
|
+
cost: {
|
|
1367
|
+
input: number;
|
|
1368
|
+
output: number;
|
|
1369
|
+
cacheRead: number;
|
|
1370
|
+
cacheWrite: number;
|
|
1371
|
+
};
|
|
1372
|
+
contextWindow: number;
|
|
1373
|
+
maxTokens: number;
|
|
1374
|
+
};
|
|
1375
|
+
readonly "glm-4.5-flash": {
|
|
1376
|
+
id: string;
|
|
1377
|
+
name: string;
|
|
1378
|
+
api: "anthropic-messages";
|
|
1379
|
+
provider: string;
|
|
1380
|
+
baseUrl: string;
|
|
1381
|
+
reasoning: true;
|
|
1382
|
+
input: "text"[];
|
|
1383
|
+
cost: {
|
|
1384
|
+
input: number;
|
|
1385
|
+
output: number;
|
|
1386
|
+
cacheRead: number;
|
|
1387
|
+
cacheWrite: number;
|
|
1388
|
+
};
|
|
1389
|
+
contextWindow: number;
|
|
1390
|
+
maxTokens: number;
|
|
1391
|
+
};
|
|
1392
|
+
readonly "glm-4.5": {
|
|
1393
|
+
id: string;
|
|
1394
|
+
name: string;
|
|
1395
|
+
api: "anthropic-messages";
|
|
1396
|
+
provider: string;
|
|
1397
|
+
baseUrl: string;
|
|
1398
|
+
reasoning: true;
|
|
1399
|
+
input: "text"[];
|
|
1400
|
+
cost: {
|
|
1401
|
+
input: number;
|
|
1402
|
+
output: number;
|
|
1403
|
+
cacheRead: number;
|
|
1404
|
+
cacheWrite: number;
|
|
1405
|
+
};
|
|
1406
|
+
contextWindow: number;
|
|
1407
|
+
maxTokens: number;
|
|
1408
|
+
};
|
|
1409
|
+
};
|
|
1323
1410
|
readonly openrouter: {
|
|
1411
|
+
readonly "nvidia/nemotron-nano-9b-v2": {
|
|
1412
|
+
id: string;
|
|
1413
|
+
name: string;
|
|
1414
|
+
api: "openai-completions";
|
|
1415
|
+
provider: string;
|
|
1416
|
+
baseUrl: string;
|
|
1417
|
+
reasoning: true;
|
|
1418
|
+
input: "text"[];
|
|
1419
|
+
cost: {
|
|
1420
|
+
input: number;
|
|
1421
|
+
output: number;
|
|
1422
|
+
cacheRead: number;
|
|
1423
|
+
cacheWrite: number;
|
|
1424
|
+
};
|
|
1425
|
+
contextWindow: number;
|
|
1426
|
+
maxTokens: number;
|
|
1427
|
+
};
|
|
1428
|
+
readonly "openrouter/sonoma-dusk-alpha": {
|
|
1429
|
+
id: string;
|
|
1430
|
+
name: string;
|
|
1431
|
+
api: "openai-completions";
|
|
1432
|
+
provider: string;
|
|
1433
|
+
baseUrl: string;
|
|
1434
|
+
reasoning: false;
|
|
1435
|
+
input: ("text" | "image")[];
|
|
1436
|
+
cost: {
|
|
1437
|
+
input: number;
|
|
1438
|
+
output: number;
|
|
1439
|
+
cacheRead: number;
|
|
1440
|
+
cacheWrite: number;
|
|
1441
|
+
};
|
|
1442
|
+
contextWindow: number;
|
|
1443
|
+
maxTokens: number;
|
|
1444
|
+
};
|
|
1445
|
+
readonly "openrouter/sonoma-sky-alpha": {
|
|
1446
|
+
id: string;
|
|
1447
|
+
name: string;
|
|
1448
|
+
api: "openai-completions";
|
|
1449
|
+
provider: string;
|
|
1450
|
+
baseUrl: string;
|
|
1451
|
+
reasoning: true;
|
|
1452
|
+
input: ("text" | "image")[];
|
|
1453
|
+
cost: {
|
|
1454
|
+
input: number;
|
|
1455
|
+
output: number;
|
|
1456
|
+
cacheRead: number;
|
|
1457
|
+
cacheWrite: number;
|
|
1458
|
+
};
|
|
1459
|
+
contextWindow: number;
|
|
1460
|
+
maxTokens: number;
|
|
1461
|
+
};
|
|
1462
|
+
readonly "qwen/qwen3-max": {
|
|
1463
|
+
id: string;
|
|
1464
|
+
name: string;
|
|
1465
|
+
api: "openai-completions";
|
|
1466
|
+
provider: string;
|
|
1467
|
+
baseUrl: string;
|
|
1468
|
+
reasoning: false;
|
|
1469
|
+
input: "text"[];
|
|
1470
|
+
cost: {
|
|
1471
|
+
input: number;
|
|
1472
|
+
output: number;
|
|
1473
|
+
cacheRead: number;
|
|
1474
|
+
cacheWrite: number;
|
|
1475
|
+
};
|
|
1476
|
+
contextWindow: number;
|
|
1477
|
+
maxTokens: number;
|
|
1478
|
+
};
|
|
1479
|
+
readonly "moonshotai/kimi-k2-0905": {
|
|
1480
|
+
id: string;
|
|
1481
|
+
name: string;
|
|
1482
|
+
api: "openai-completions";
|
|
1483
|
+
provider: string;
|
|
1484
|
+
baseUrl: string;
|
|
1485
|
+
reasoning: false;
|
|
1486
|
+
input: "text"[];
|
|
1487
|
+
cost: {
|
|
1488
|
+
input: number;
|
|
1489
|
+
output: number;
|
|
1490
|
+
cacheRead: number;
|
|
1491
|
+
cacheWrite: number;
|
|
1492
|
+
};
|
|
1493
|
+
contextWindow: number;
|
|
1494
|
+
maxTokens: number;
|
|
1495
|
+
};
|
|
1324
1496
|
readonly "deepcogito/cogito-v2-preview-llama-109b-moe": {
|
|
1325
1497
|
id: string;
|
|
1326
1498
|
name: string;
|
|
@@ -1338,6 +1510,23 @@ export declare const MODELS: {
|
|
|
1338
1510
|
contextWindow: number;
|
|
1339
1511
|
maxTokens: number;
|
|
1340
1512
|
};
|
|
1513
|
+
readonly "stepfun-ai/step3": {
|
|
1514
|
+
id: string;
|
|
1515
|
+
name: string;
|
|
1516
|
+
api: "openai-completions";
|
|
1517
|
+
provider: string;
|
|
1518
|
+
baseUrl: string;
|
|
1519
|
+
reasoning: true;
|
|
1520
|
+
input: ("text" | "image")[];
|
|
1521
|
+
cost: {
|
|
1522
|
+
input: number;
|
|
1523
|
+
output: number;
|
|
1524
|
+
cacheRead: number;
|
|
1525
|
+
cacheWrite: number;
|
|
1526
|
+
};
|
|
1527
|
+
contextWindow: number;
|
|
1528
|
+
maxTokens: number;
|
|
1529
|
+
};
|
|
1341
1530
|
readonly "qwen/qwen3-30b-a3b-thinking-2507": {
|
|
1342
1531
|
id: string;
|
|
1343
1532
|
name: string;
|
|
@@ -2732,7 +2921,7 @@ export declare const MODELS: {
|
|
|
2732
2921
|
contextWindow: number;
|
|
2733
2922
|
maxTokens: number;
|
|
2734
2923
|
};
|
|
2735
|
-
readonly "meta-llama/llama-3.1-
|
|
2924
|
+
readonly "meta-llama/llama-3.1-70b-instruct": {
|
|
2736
2925
|
id: string;
|
|
2737
2926
|
name: string;
|
|
2738
2927
|
api: "openai-completions";
|
|
@@ -2749,7 +2938,7 @@ export declare const MODELS: {
|
|
|
2749
2938
|
contextWindow: number;
|
|
2750
2939
|
maxTokens: number;
|
|
2751
2940
|
};
|
|
2752
|
-
readonly "meta-llama/llama-3.1-
|
|
2941
|
+
readonly "meta-llama/llama-3.1-8b-instruct": {
|
|
2753
2942
|
id: string;
|
|
2754
2943
|
name: string;
|
|
2755
2944
|
api: "openai-completions";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.generated.d.ts","sourceRoot":"","sources":["../src/models.generated.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"models.generated.d.ts","sourceRoot":"","sources":["../src/models.generated.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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