@absolutejs/ai 0.3.1 → 0.3.2

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.
@@ -1,3 +1,4 @@
1
+ export { StructuredOutputError } from "./structuredOutputError";
1
2
  export { aiChat } from "../plugins/aiChat";
2
3
  export { streamAI } from "./streamAI";
3
4
  export { streamAIToSSE } from "./streamAIToSSE";
@@ -0,0 +1,13 @@
1
+ import type { AIUsage } from "../../types/ai";
2
+ /** Extract bounded validation diagnostics, never the rejected value. Supports
3
+ * TypeBox/Ajv errors and Zod issues without requiring either validator. */
4
+ export declare const structuredOutputDiagnostics: (error: unknown) => string;
5
+ /** A completed generation produced no valid structured result after bounded
6
+ * repair. Transport/auth/budget failures retain their original error types. */
7
+ export declare class StructuredOutputError extends Error {
8
+ readonly reason: "validation" | "missing_tool";
9
+ readonly attempts: number;
10
+ readonly usage: AIUsage | undefined;
11
+ readonly code = "AI_STRUCTURED_OUTPUT_INVALID";
12
+ constructor(reason: "validation" | "missing_tool", attempts: number, usage: AIUsage | undefined, cause: unknown);
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/ai",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "homepage": "https://github.com/absolutejs/ai",
5
5
  "bugs": {
6
6
  "url": "https://github.com/absolutejs/ai/issues"