Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/surface-ai-sdk-data-agents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@funkai/agents": minor
---

Surface all AI SDK data through agent results including token usage, finish reasons, warnings, request metadata, response metadata, and provider-specific fields. Unified hook types for flow agent onFinish and cleaned up type casts in generate/stream paths.
5 changes: 5 additions & 0 deletions .changeset/surface-ai-sdk-data-models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@funkai/models": minor
---

Export additional provider types and update cost calculation to support surfaced AI SDK data.
9 changes: 2 additions & 7 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"functional/no-throw-statements": "off",
"functional/no-try-statements": "off",
"functional/no-loop-statements": "off",
"unicorn/prefer-ternary": "off",
"unicorn/no-null": "off",
"unicorn/no-useless-undefined": "off",
"unicorn/no-array-callback-reference": "off",
Expand All @@ -83,12 +84,7 @@
"vitest/prefer-called-times": "off",
"vitest/prefer-called-once": "off",
"vitest/prefer-expect-type-of": "off",
"oxc/no-optional-chaining": [
"error",
{
"message": "Use explicit null checks (if/else or ts-pattern match) instead of optional chaining."
}
],
"oxc/no-optional-chaining": "off",
"jsdoc-js/multiline-blocks": [
"error",
{
Expand All @@ -103,7 +99,6 @@
"no-unused-vars": "off",
"functional/no-classes": "off",
"typescript/no-non-null-assertion": "off",
"oxc/no-optional-chaining": "off",
"vitest/prefer-to-be-truthy": "off",
"vitest/prefer-to-be-falsy": "off"
}
Expand Down
1 change: 0 additions & 1 deletion examples/basic-agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const result = await weatherAgent.generate({ prompt: "What is the weather in San

if (result.ok) {
console.log("Output:", result.output);
console.log("Messages:", result.messages.length);
console.log("Usage:", result.usage);
} else {
console.error("Error:", result.error);
Expand Down
6 changes: 0 additions & 6 deletions examples/streaming/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { openai } from "@ai-sdk/openai";
import { agent, flowAgent, tool } from "@funkai/agents";
import type { Message } from "@funkai/agents";
import { z } from "zod";

// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -193,11 +192,6 @@ if (flowResult.ok) {

const output = await flowResult.output;
console.log("\nFindings:", JSON.stringify(output, null, 2));

const messages: Message[] = await flowResult.messages;
console.log(
`\nFlow produced ${messages.length} messages (including synthetic tool-call/result pairs for each step)`,
);
} else {
console.error("Error:", flowResult.error);
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
"devDependencies": {
"@changesets/cli": "^2.30.0",
"@vitest/coverage-v8": "catalog:",
"@zpress/kit": "^0.2.12",
"@zpress/kit": "^0.2.14",
"eslint-plugin-functional": "^9.0.4",
"eslint-plugin-jsdoc": "^62.8.0",
"eslint-plugin-security": "^4.0.0",
"laufen": "^1.2.1",
"oxfmt": "^0.41.0",
"oxlint": "^1.56.0",
"oxfmt": "^0.42.0",
"oxlint": "^1.57.0",
"turbo": "^2.8.20",
"vitest": "catalog:"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/agents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"dependencies": {
"@funkai/models": "workspace:*",
"ai": "^6.0.136",
"ai": "^6.0.138",
"es-toolkit": "catalog:",
"ts-pattern": "catalog:",
"type-fest": "^5.5.0",
Expand Down
Loading
Loading