@anvia/core 1.0.0-rc.3 → 1.0.0-rc.5
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 +37 -3
- package/dist/agent/index.d.ts +28 -6
- package/dist/agent/index.js +17 -27
- package/dist/{interactions-csssHYcN.d.ts → agent/interactions/index.d.ts} +3 -55
- package/dist/agent/interactions/index.js +20 -0
- package/dist/agent/interactions/index.js.map +1 -0
- package/dist/{agent-CXScUOpX.d.ts → agent-LlCD_2UQ.d.ts} +2 -2
- package/dist/{chunk-AI5JMUW7.js → chunk-7OCVDT2X.js} +2 -2
- package/dist/{chunk-5MK3BISB.js → chunk-7YAH2F3J.js} +3 -3
- package/dist/{chunk-LXMAFD23.js → chunk-BAEFBTOW.js} +2 -2
- package/dist/chunk-BEU6FCTN.js +164 -0
- package/dist/chunk-BEU6FCTN.js.map +1 -0
- package/dist/{chunk-KFR4CDGK.js → chunk-DNQNOHD5.js} +2 -2
- package/dist/{chunk-VKYZZXP5.js → chunk-E5J4OY4K.js} +2 -2
- package/dist/{chunk-BY4OMNIU.js → chunk-FCANRQ5Q.js} +201 -191
- package/dist/chunk-FCANRQ5Q.js.map +1 -0
- package/dist/{chunk-PK5LKOFL.js → chunk-G5OACQEI.js} +4 -66
- package/dist/chunk-G5OACQEI.js.map +1 -0
- package/dist/{chunk-GQL5KRAH.js → chunk-H7BI3BSP.js} +2 -2
- package/dist/{chunk-D2ECOWN5.js → chunk-HSA6NL2E.js} +6 -4
- package/dist/{chunk-D2ECOWN5.js.map → chunk-HSA6NL2E.js.map} +1 -1
- package/dist/{chunk-BEYBU7VJ.js → chunk-HVHTVGPP.js} +2 -2
- package/dist/{chunk-KV6QCRQ4.js → chunk-JXZTTNCR.js} +3 -3
- package/dist/{chunk-3CMWKK32.js → chunk-RZDI7B6Z.js} +8 -5
- package/dist/chunk-RZDI7B6Z.js.map +1 -0
- package/dist/chunk-SROQA7I7.js +69 -0
- package/dist/chunk-SROQA7I7.js.map +1 -0
- package/dist/{chunk-TRQ3XRFD.js → chunk-TEV3OB7N.js} +26 -1
- package/dist/chunk-TEV3OB7N.js.map +1 -0
- package/dist/{chunk-FN7HLLAZ.js → chunk-UBE4WH6G.js} +2 -1
- package/dist/chunk-UBE4WH6G.js.map +1 -0
- package/dist/{chunk-ZCPOIDAQ.js → chunk-YDJA4R37.js} +4 -4
- package/dist/{chunk-GKDERULJ.js → chunk-YXLDR2O4.js} +2 -2
- package/dist/completion/index.js +6 -4
- package/dist/embeddings/index.js +2 -2
- package/dist/evals/index.d.ts +4 -3
- package/dist/evals/index.js +7 -6
- package/dist/evals/index.js.map +1 -1
- package/dist/extractor/index.js +5 -4
- package/dist/image-generation/index.js +2 -2
- package/dist/index.d.ts +7 -6
- package/dist/index.js +31 -38
- package/dist/internal/agent.d.ts +4 -3
- package/dist/internal/agent.js +13 -11
- package/dist/internal/agent.js.map +1 -1
- package/dist/mcp/index.js +7 -6
- package/dist/memory/index.js +5 -4
- package/dist/middleware-BqtLB_Xt.d.ts +56 -0
- package/dist/observability/index.d.ts +5 -4
- package/dist/observability/index.js +5 -4
- package/dist/pipeline/index.d.ts +5 -4
- package/dist/pipeline/index.js +6 -5
- package/dist/pipeline/index.js.map +1 -1
- package/dist/skills/index.js +7 -6
- package/dist/speech-generation/index.js +2 -2
- package/dist/{think-tool-D8frXxwV.d.ts → think-tool-Cz3QYNPX.d.ts} +1 -1
- package/dist/tool/index.d.ts +4 -3
- package/dist/tool/index.js +6 -5
- package/dist/transcription/index.js +2 -2
- package/dist/{types-CElwurHZ.d.ts → types-1KpjDfoN.d.ts} +2 -1
- package/dist/vector-store/index.d.ts +3 -2
- package/dist/vector-store/index.js +7 -4
- package/package.json +6 -2
- package/dist/chunk-3CMWKK32.js.map +0 -1
- package/dist/chunk-BY4OMNIU.js.map +0 -1
- package/dist/chunk-FN7HLLAZ.js.map +0 -1
- package/dist/chunk-PK5LKOFL.js.map +0 -1
- package/dist/chunk-TRQ3XRFD.js.map +0 -1
- /package/dist/{chunk-AI5JMUW7.js.map → chunk-7OCVDT2X.js.map} +0 -0
- /package/dist/{chunk-5MK3BISB.js.map → chunk-7YAH2F3J.js.map} +0 -0
- /package/dist/{chunk-LXMAFD23.js.map → chunk-BAEFBTOW.js.map} +0 -0
- /package/dist/{chunk-KFR4CDGK.js.map → chunk-DNQNOHD5.js.map} +0 -0
- /package/dist/{chunk-VKYZZXP5.js.map → chunk-E5J4OY4K.js.map} +0 -0
- /package/dist/{chunk-GQL5KRAH.js.map → chunk-H7BI3BSP.js.map} +0 -0
- /package/dist/{chunk-BEYBU7VJ.js.map → chunk-HVHTVGPP.js.map} +0 -0
- /package/dist/{chunk-KV6QCRQ4.js.map → chunk-JXZTTNCR.js.map} +0 -0
- /package/dist/{chunk-ZCPOIDAQ.js.map → chunk-YDJA4R37.js.map} +0 -0
- /package/dist/{chunk-GKDERULJ.js.map → chunk-YXLDR2O4.js.map} +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// src/completion/json.ts
|
|
2
|
+
function isJsonValue(value) {
|
|
3
|
+
return isJsonValueWithAncestors(value, /* @__PURE__ */ new WeakSet());
|
|
4
|
+
}
|
|
5
|
+
function isJsonValueWithAncestors(value, ancestors) {
|
|
6
|
+
if (value === null || typeof value === "string" || typeof value === "boolean") {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
if (typeof value === "number") {
|
|
10
|
+
return Number.isFinite(value);
|
|
11
|
+
}
|
|
12
|
+
if (typeof value !== "object" || ancestors.has(value)) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
ancestors.add(value);
|
|
16
|
+
try {
|
|
17
|
+
if (Array.isArray(value)) {
|
|
18
|
+
if (!hasOnlyDenseArrayProperties(value)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
22
|
+
if (!isJsonValueWithAncestors(value[index], ancestors)) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
const prototype = Object.getPrototypeOf(value);
|
|
29
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
33
|
+
if (typeof key !== "string") {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
37
|
+
if (descriptor === void 0 || !descriptor.enumerable || !("value" in descriptor) || !isJsonValueWithAncestors(descriptor.value, ancestors)) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
} catch {
|
|
43
|
+
return false;
|
|
44
|
+
} finally {
|
|
45
|
+
ancestors.delete(value);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function hasOnlyDenseArrayProperties(value) {
|
|
49
|
+
const keys = Reflect.ownKeys(value);
|
|
50
|
+
if (keys.length !== value.length + 1 || keys.at(-1) !== "length") {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
54
|
+
const key = String(index);
|
|
55
|
+
if (keys[index] !== key) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
59
|
+
if (descriptor === void 0 || !descriptor.enumerable || !("value" in descriptor)) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export {
|
|
67
|
+
isJsonValue
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=chunk-SROQA7I7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/completion/json.ts"],"sourcesContent":["import type { JsonValue } from \"./types\";\n\nexport function isJsonValue(value: unknown): value is JsonValue {\n return isJsonValueWithAncestors(value, new WeakSet<object>());\n}\n\nfunction isJsonValueWithAncestors(value: unknown, ancestors: WeakSet<object>): value is JsonValue {\n if (value === null || typeof value === \"string\" || typeof value === \"boolean\") {\n return true;\n }\n if (typeof value === \"number\") {\n return Number.isFinite(value);\n }\n if (typeof value !== \"object\" || ancestors.has(value)) {\n return false;\n }\n\n ancestors.add(value);\n try {\n if (Array.isArray(value)) {\n if (!hasOnlyDenseArrayProperties(value)) {\n return false;\n }\n for (let index = 0; index < value.length; index += 1) {\n if (!isJsonValueWithAncestors(value[index], ancestors)) {\n return false;\n }\n }\n return true;\n }\n\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) {\n return false;\n }\n for (const key of Reflect.ownKeys(value)) {\n if (typeof key !== \"string\") {\n return false;\n }\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (\n descriptor === undefined ||\n !descriptor.enumerable ||\n !(\"value\" in descriptor) ||\n !isJsonValueWithAncestors(descriptor.value, ancestors)\n ) {\n return false;\n }\n }\n return true;\n } catch {\n return false;\n } finally {\n ancestors.delete(value);\n }\n}\n\nfunction hasOnlyDenseArrayProperties(value: unknown[]): boolean {\n const keys = Reflect.ownKeys(value);\n if (keys.length !== value.length + 1 || keys.at(-1) !== \"length\") {\n return false;\n }\n for (let index = 0; index < value.length; index += 1) {\n const key = String(index);\n if (keys[index] !== key) {\n return false;\n }\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined || !descriptor.enumerable || !(\"value\" in descriptor)) {\n return false;\n }\n }\n return true;\n}\n"],"mappings":";AAEO,SAAS,YAAY,OAAoC;AAC9D,SAAO,yBAAyB,OAAO,oBAAI,QAAgB,CAAC;AAC9D;AAEA,SAAS,yBAAyB,OAAgB,WAAgD;AAChG,MAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,OAAO,UAAU,WAAW;AAC7E,WAAO;AAAA,EACT;AACA,MAAI,OAAO,U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O,yBAAyB,OAAO,GAAG;AAC7D,QAAI,eAAe,UAAa,CAAC,WAAW,cAAc,EAAE,WAAW,aAAa;AAClF,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
// src/agent/errors.ts
|
|
2
|
+
var AgentStructuredOutputError = class extends Error {
|
|
3
|
+
phase;
|
|
4
|
+
attempt;
|
|
5
|
+
maxAttempts;
|
|
6
|
+
outputLength;
|
|
7
|
+
normalizedLength;
|
|
8
|
+
outputFormat;
|
|
9
|
+
usage;
|
|
10
|
+
constructor(options) {
|
|
11
|
+
const failure = options.phase === "parse" ? "JSON parsing" : "schema validation";
|
|
12
|
+
super(
|
|
13
|
+
`Agent structured output failed ${failure} on attempt ${options.attempt} of ${options.maxAttempts}.`,
|
|
14
|
+
{ cause: options.cause }
|
|
15
|
+
);
|
|
16
|
+
this.name = "AgentStructuredOutputError";
|
|
17
|
+
this.phase = options.phase;
|
|
18
|
+
this.attempt = options.attempt;
|
|
19
|
+
this.maxAttempts = options.maxAttempts;
|
|
20
|
+
this.outputLength = options.outputLength;
|
|
21
|
+
this.normalizedLength = options.normalizedLength;
|
|
22
|
+
this.outputFormat = options.outputFormat;
|
|
23
|
+
this.usage = options.usage;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
2
26
|
var MaxTurnsError = class extends Error {
|
|
3
27
|
constructor(maxTurns, chatHistory, prompt) {
|
|
4
28
|
super(`Reached max turn limit: ${maxTurns}`);
|
|
@@ -45,10 +69,11 @@ var AgentToolSuspensionError = class extends Error {
|
|
|
45
69
|
};
|
|
46
70
|
|
|
47
71
|
export {
|
|
72
|
+
AgentStructuredOutputError,
|
|
48
73
|
MaxTurnsError,
|
|
49
74
|
AgentRunCancelledError,
|
|
50
75
|
AgentRunBlockedError,
|
|
51
76
|
AgentStreamClosedError,
|
|
52
77
|
AgentToolSuspensionError
|
|
53
78
|
};
|
|
54
|
-
//# sourceMappingURL=chunk-
|
|
79
|
+
//# sourceMappingURL=chunk-TEV3OB7N.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/agent/errors.ts"],"sourcesContent":["import type { Message, Usage } from \"../completion/index\";\nimport type { AgentBlockedResult, AgentSuspendedResult } from \"./run-types\";\n\nexport type AgentStructuredOutputPhase = \"parse\" | \"schema\";\n\nexport type AgentStructuredOutputFormat = \"raw\" | \"json-fence\" | \"unlabeled-fence\";\n\nexport class AgentStructuredOutputError extends Error {\n readonly phase: AgentStructuredOutputPhase;\n readonly attempt: number;\n readonly maxAttempts: number;\n readonly outputLength: number;\n readonly normalizedLength: number;\n readonly outputFormat: AgentStructuredOutputFormat;\n readonly usage: Usage;\n\n constructor(options: {\n phase: AgentStructuredOutputPhase;\n attempt: number;\n maxAttempts: number;\n outputLength: number;\n normalizedLength: number;\n outputFormat: AgentStructuredOutputFormat;\n usage: Usage;\n cause: unknown;\n }) {\n const failure = options.phase === \"parse\" ? \"JSON parsing\" : \"schema validation\";\n super(\n `Agent structured output failed ${failure} on attempt ${options.attempt} of ${options.maxAttempts}.`,\n { cause: options.cause },\n );\n this.name = \"AgentStructuredOutputError\";\n this.phase = options.phase;\n this.attempt = options.attempt;\n this.maxAttempts = options.maxAttempts;\n this.outputLength = options.outputLength;\n this.normalizedLength = options.normalizedLength;\n this.outputFormat = options.outputFormat;\n this.usage = options.usage;\n }\n}\n\nexport class MaxTurnsError extends Error {\n constructor(\n readonly maxTurns: number,\n readonly chatHistory: Message[],\n readonly prompt: Message,\n ) {\n super(`Reached max turn limit: ${maxTurns}`);\n this.name = \"MaxTurnsError\";\n }\n}\n\nexport class AgentRunCancelledError extends Error {\n constructor(\n readonly chatHistory: Message[],\n readonly reason: string,\n options?: ErrorOptions,\n ) {\n super(`Agent run cancelled: ${reason}`, options);\n this.name = \"AgentRunCancelledError\";\n }\n}\n\nexport class AgentRunBlockedError extends Error {\n constructor(readonly result: AgentBlockedResult) {\n super(`Agent run was blocked by an ${result.stage} guardrail.`);\n this.name = \"AgentRunBlockedError\";\n }\n}\n\nexport class AgentStreamClosedError extends Error {\n constructor() {\n super(\"Agent stream is no longer accepting steering input.\");\n this.name = \"AgentStreamClosedError\";\n }\n}\n\nexport class AgentToolSuspensionError extends Error {\n constructor(readonly result: AgentSuspendedResult) {\n super(\"Agent tool execution suspended for human interaction.\");\n this.name = \"AgentToolSuspensionError\";\n }\n}\n"],"mappings":";AAOO,IAAM,6BAAN,cAAyC,MAAM;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,SAST;AACD,UAAM,UAAU,QAAQ,UAAU,UAAU,iBAAiB;AAC7D;AAAA,MACE,kCAAkC,OAAO,eAAe,QAAQ,OAAO,OAAO,QAAQ,WAAW;AAAA,MACjG,EAAE,OAAO,QAAQ,MAAM;AAAA,IACzB;AACA,SAAK,OAAO;AACZ,SAAK,QAAQ,QAAQ;AACrB,SAAK,UAAU,QAAQ;AACvB,SAAK,cAAc,QAAQ;AAC3B,SAAK,eAAe,QAAQ;AAC5B,SAAK,mBAAmB,QAAQ;AAChC,SAAK,eAAe,QAAQ;AAC5B,SAAK,QAAQ,QAAQ;AAAA,EACvB;AACF;AAEO,IAAM,gBAAN,cAA4B,MAAM;AAAA,EACvC,YACW,UACA,aACA,QACT;AACA,UAAM,2BAA2B,QAAQ,EAAE;AAJlC;AACA;AACA;AAGT,SAAK,OAAO;AAAA,EACd;AAAA,EANW;AAAA,EACA;AAAA,EACA;AAKb;AAEO,IAAM,yBAAN,cAAqC,MAAM;AAAA,EAChD,YACW,aACA,QACT,SACA;AACA,UAAM,wBAAwB,MAAM,IAAI,OAAO;AAJtC;AACA;AAIT,SAAK,OAAO;AAAA,EACd;AAAA,EANW;AAAA,EACA;AAMb;AAEO,IAAM,uBAAN,cAAmC,MAAM;AAAA,EAC9C,YAAqB,QAA4B;AAC/C,UAAM,+BAA+B,OAAO,KAAK,aAAa;AAD3C;AAEnB,SAAK,OAAO;AAAA,EACd;AAAA,EAHqB;AAIvB;AAEO,IAAM,yBAAN,cAAqC,MAAM;AAAA,EAChD,cAAc;AACZ,UAAM,qDAAqD;AAC3D,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,2BAAN,cAAuC,MAAM;AAAA,EAClD,YAAqB,QAA8B;AACjD,UAAM,uDAAuD;AAD1C;AAEnB,SAAK,OAAO;AAAA,EACd;AAAA,EAHqB;AAIvB;","names":[]}
|
|
@@ -54,6 +54,7 @@ var MAX_TIMER_DELAY_MS = 2147483647;
|
|
|
54
54
|
var RETRYABLE_STATUS_CODES = /* @__PURE__ */ new Set([408, 409, 425, 429]);
|
|
55
55
|
var RETRYABLE_NUMERIC_ERROR_CODES = /* @__PURE__ */ new Set([4, 8, 14]);
|
|
56
56
|
var RETRYABLE_ERROR_NAMES = /* @__PURE__ */ new Set([
|
|
57
|
+
"AgentStructuredOutputError",
|
|
57
58
|
"APIConnectionError",
|
|
58
59
|
"APIConnectionTimeoutError",
|
|
59
60
|
"TimeoutError"
|
|
@@ -208,4 +209,4 @@ export {
|
|
|
208
209
|
retryOptionsForFailure,
|
|
209
210
|
runWithRetries
|
|
210
211
|
};
|
|
211
|
-
//# sourceMappingURL=chunk-
|
|
212
|
+
//# sourceMappingURL=chunk-UBE4WH6G.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/internal/abort.ts","../src/retry.ts"],"sourcesContent":["export function throwIfAborted(signal: AbortSignal | undefined): void {\n if (signal?.aborted === true) {\n throw abortError(signal.reason);\n }\n}\n\nexport function abortError(reason?: unknown): Error {\n if (isAbortError(reason)) {\n return reason;\n }\n\n const error = new Error(\n \"The operation was aborted.\",\n reason === undefined ? undefined : { cause: reason },\n );\n error.name = \"AbortError\";\n return error;\n}\n\nexport function isAbortError(error: unknown): error is Error {\n const seen = new Set<object>();\n let current = error;\n while (typeof current === \"object\" && current !== null && !seen.has(current)) {\n seen.add(current);\n if (\"name\" in current && current.name === \"AbortError\") {\n return true;\n }\n current = \"cause\" in current ? current.cause : undefined;\n }\n return false;\n}\n\nexport function waitForAbortableDelay(\n delayMs: number,\n signal: AbortSignal | undefined,\n): Promise<void> {\n throwIfAborted(signal);\n if (delayMs === 0) return Promise.resolve();\n if (signal === undefined) {\n return new Promise<void>((resolve) => setTimeout(resolve, delayMs));\n }\n\n return new Promise<void>((resolve, reject) => {\n const timer = setTimeout(() => {\n signal.removeEventListener(\"abort\", onAbort);\n resolve();\n }, delayMs);\n const onAbort = () => {\n clearTimeout(timer);\n reject(abortError(signal.reason));\n };\n signal.addEventListener(\"abort\", onAbort, { once: true });\n });\n}\n","import type { JsonValue } from \"./completion/types\";\nimport { abortError, isAbortError, waitForAbortableDelay } from \"./internal/abort\";\n\nexport type RetryContext = {\n error: unknown;\n attempt: number;\n maxAttempts: number;\n streaming: boolean;\n turn?: number | undefined;\n};\n\nexport type RetryOptions = {\n maxAttempts?: number | undefined;\n initialDelayMs?: number | undefined;\n maxDelayMs?: number | undefined;\n shouldRetry?: ((context: RetryContext) => boolean) | undefined;\n};\n\nexport type RetrySetting = RetryOptions | false;\n\nexport type ResolvedRetryOptions = {\n maxAttempts: number;\n initialDelayMs: number;\n maxDelayMs: number;\n shouldRetry: (context: RetryContext) => boolean;\n};\n\nconst DEFAULT_MAX_ATTEMPTS = 3;\nconst DEFAULT_INITIAL_DELAY_MS = 100;\nconst DEFAULT_MAX_DELAY_MS = 1_000;\nconst MAX_TIMER_DELAY_MS = 2_147_483_647;\n\nconst RETRYABLE_STATUS_CODES = new Set([408, 409, 425, 429]);\nconst RETRYABLE_NUMERIC_ERROR_CODES = new Set([4, 8, 14]);\nconst RETRYABLE_ERROR_NAMES = new Set([\n \"AgentStructuredOutputError\",\n \"APIConnectionError\",\n \"APIConnectionTimeoutError\",\n \"TimeoutError\",\n]);\nconst RETRYABLE_ERROR_CODES = new Set([\n \"DEADLINE_EXCEEDED\",\n \"EAI_AGAIN\",\n \"ECONNREFUSED\",\n \"ECONNRESET\",\n \"EHOSTUNREACH\",\n \"ENETDOWN\",\n \"ENETUNREACH\",\n \"EPIPE\",\n \"ETIMEDOUT\",\n \"RESOURCE_EXHAUSTED\",\n \"UNAVAILABLE\",\n \"UND_ERR_CONNECT_TIMEOUT\",\n \"UND_ERR_HEADERS_TIMEOUT\",\n \"UND_ERR_SOCKET\",\n]);\n\nexport function resolveRetryOptions(options: RetryOptions): ResolvedRetryOptions {\n const maxAttempts = options.maxAttempts ?? DEFAULT_MAX_ATTEMPTS;\n const initialDelayMs = options.initialDelayMs ?? DEFAULT_INITIAL_DELAY_MS;\n const maxDelayMs = options.maxDelayMs ?? DEFAULT_MAX_DELAY_MS;\n\n if (!Number.isSafeInteger(maxAttempts) || maxAttempts < 1) {\n throw new RangeError(\"Retry maxAttempts must be a positive integer.\");\n }\n assertDelay(initialDelayMs, \"initialDelayMs\");\n assertDelay(maxDelayMs, \"maxDelayMs\");\n if (maxDelayMs < initialDelayMs) {\n throw new RangeError(\"Retry maxDelayMs must be greater than or equal to initialDelayMs.\");\n }\n if (options.shouldRetry !== undefined && typeof options.shouldRetry !== \"function\") {\n throw new TypeError(\"Retry shouldRetry must be a function.\");\n }\n\n return {\n maxAttempts,\n initialDelayMs,\n maxDelayMs,\n shouldRetry: options.shouldRetry ?? defaultShouldRetry,\n };\n}\n\nexport function retryDelayMs(options: ResolvedRetryOptions, failedAttempt: number): number {\n const exponentialDelay = options.initialDelayMs * 2 ** (failedAttempt - 1);\n const cappedDelay = Math.min(options.maxDelayMs, exponentialDelay);\n return Math.random() * cappedDelay;\n}\n\nexport function retryErrorAttributes(error: unknown): Record<string, JsonValue | undefined> {\n const errors = errorChain(error);\n const errorName = errors\n .map((candidate) => stringProperty(candidate, \"name\"))\n .find((value) => value !== undefined);\n const statusCode = firstStatusCode(errors);\n const errorCode = errors\n .map((candidate) => errorCodeProperty(candidate))\n .find((value) => value !== undefined);\n\n return { errorName, statusCode, errorCode };\n}\n\nexport async function waitForRetry(\n delayMs: number,\n abortSignal?: AbortSignal | undefined,\n): Promise<void> {\n await waitForAbortableDelay(delayMs, abortSignal);\n}\n\nexport function retryOptionsForFailure(\n options: ResolvedRetryOptions | undefined,\n context: Omit<RetryContext, \"maxAttempts\">,\n): ResolvedRetryOptions | undefined {\n if (isAbortError(context.error)) return undefined;\n if (options === undefined || context.attempt >= options.maxAttempts) return undefined;\n return options.shouldRetry({ ...context, maxAttempts: options.maxAttempts })\n ? options\n : undefined;\n}\n\nexport async function runWithRetries<T>(\n operation: () => Promise<T>,\n options: ResolvedRetryOptions | undefined,\n context: {\n streaming: boolean;\n turn?: number | undefined;\n abortSignal?: AbortSignal | undefined;\n },\n): Promise<T> {\n let attempt = 1;\n while (true) {\n try {\n return await operation();\n } catch (error) {\n if (context.abortSignal?.aborted === true) {\n throw abortError(context.abortSignal.reason);\n }\n const retryOptions = retryOptionsForFailure(options, { error, attempt, ...context });\n if (retryOptions === undefined) throw error;\n await waitForRetry(retryDelayMs(retryOptions, attempt), context.abortSignal);\n attempt += 1;\n }\n }\n}\n\nfunction defaultShouldRetry(context: RetryContext): boolean {\n const errors = errorChain(context.error);\n if (isAbortError(context.error)) return false;\n\n const statusCode = firstStatusCode(errors);\n if (statusCode !== undefined) {\n return RETRYABLE_STATUS_CODES.has(statusCode) || (statusCode >= 500 && statusCode <= 599);\n }\n\n return errors.some((error) => {\n const name = stringProperty(error, \"name\");\n if (name !== undefined && RETRYABLE_ERROR_NAMES.has(name)) return true;\n const code = stringProperty(error, \"code\")?.toUpperCase();\n if (code !== undefined && RETRYABLE_ERROR_CODES.has(code)) return true;\n const numericCode = numberProperty(error, \"code\");\n return numericCode !== undefined && RETRYABLE_NUMERIC_ERROR_CODES.has(numericCode);\n });\n}\n\nfunction firstStatusCode(errors: Record<string, unknown>[]): number | undefined {\n for (const error of errors) {\n const status = numberProperty(error, \"status\");\n if (status !== undefined && status >= 100 && status <= 599) return status;\n const statusCode = numberProperty(error, \"statusCode\");\n if (statusCode !== undefined && statusCode >= 100 && statusCode <= 599) return statusCode;\n const code = numberProperty(error, \"code\");\n if (code !== undefined && code >= 100 && code <= 599) return code;\n }\n return undefined;\n}\n\nfunction errorChain(error: unknown): Record<string, unknown>[] {\n const errors: Record<string, unknown>[] = [];\n const seen = new Set<object>();\n let current = error;\n while (isObject(current) && !seen.has(current)) {\n seen.add(current);\n errors.push(current);\n current = property(current, \"cause\");\n }\n return errors;\n}\n\nfunction assertDelay(value: number, name: string): void {\n if (!Number.isFinite(value) || value < 0 || value > MAX_TIMER_DELAY_MS) {\n throw new RangeError(`Retry ${name} must be between 0 and ${MAX_TIMER_DELAY_MS} milliseconds.`);\n }\n}\n\nfunction numberProperty(value: Record<string, unknown>, name: string): number | undefined {\n const candidate = property(value, name);\n return typeof candidate === \"number\" && Number.isFinite(candidate) ? candidate : undefined;\n}\n\nfunction stringProperty(value: Record<string, unknown>, name: string): string | undefined {\n const candidate = property(value, name);\n return typeof candidate === \"string\" && candidate.length > 0 ? candidate : undefined;\n}\n\nfunction errorCodeProperty(value: Record<string, unknown>): string | number | undefined {\n return stringProperty(value, \"code\") ?? numberProperty(value, \"code\");\n}\n\nfunction property(value: Record<string, unknown>, name: string): unknown {\n try {\n return value[name];\n } catch {\n return undefined;\n }\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n"],"mappings":";AAAO,SAAS,eAAe,QAAuC;AACpE,MAAI,QAAQ,YAAY,MAAM;AAC5B,UAAM,WAAW,OAAO,MAAM;AAAA,EAChC;AACF;AAEO,SAAS,WAAW,QAAyB;AAClD,MAAI,aAAa,MAAM,GAAG;AACxB,WAAO;AAAA,EACT;AAEA,QAAM,QAAQ,IAAI;AAAA,IAChB;AAAA,IACA,WAAW,SAAY,SAAY,EAAE,OAAO,OAAO;AAAA,EACrD;AACA,QAAM,OAAO;AACb,SAAO;AACT;AAEO,SAAS,aAAa,OAAgC;AAC3D,QAAM,OAAO,o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AY,UAAU;AAChD;","names":[]}
|
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
CompletionCapabilityError,
|
|
3
3
|
Usage,
|
|
4
4
|
generateCompletion
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HSA6NL2E.js";
|
|
6
6
|
import {
|
|
7
7
|
toProviderJsonSchema
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-G5OACQEI.js";
|
|
9
9
|
import {
|
|
10
10
|
isAbortError,
|
|
11
11
|
resolveRetryOptions,
|
|
12
12
|
retryDelayMs,
|
|
13
13
|
retryOptionsForFailure,
|
|
14
14
|
waitForRetry
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UBE4WH6G.js";
|
|
16
16
|
|
|
17
17
|
// src/extractor/extractor.ts
|
|
18
18
|
import { z } from "zod";
|
|
@@ -124,4 +124,4 @@ export {
|
|
|
124
124
|
ExtractionError,
|
|
125
125
|
extract
|
|
126
126
|
};
|
|
127
|
-
//# sourceMappingURL=chunk-
|
|
127
|
+
//# sourceMappingURL=chunk-YDJA4R37.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
resolveRetryOptions,
|
|
3
3
|
runWithRetries,
|
|
4
4
|
throwIfAborted
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UBE4WH6G.js";
|
|
6
6
|
|
|
7
7
|
// src/transcription/transcribe.ts
|
|
8
8
|
async function transcribe(options) {
|
|
@@ -47,4 +47,4 @@ function toUint8Array(bytes) {
|
|
|
47
47
|
export {
|
|
48
48
|
transcribe
|
|
49
49
|
};
|
|
50
|
-
//# sourceMappingURL=chunk-
|
|
50
|
+
//# sourceMappingURL=chunk-YXLDR2O4.js.map
|
package/dist/completion/index.js
CHANGED
|
@@ -16,17 +16,19 @@ import {
|
|
|
16
16
|
streamCompletion,
|
|
17
17
|
textFromAssistantContent,
|
|
18
18
|
withContextUsage
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-HSA6NL2E.js";
|
|
20
20
|
import {
|
|
21
21
|
createMessageSchema,
|
|
22
|
-
isJsonValue,
|
|
23
22
|
isMessage,
|
|
24
23
|
messageSchema,
|
|
25
24
|
messagesSchema,
|
|
26
25
|
parseMessage,
|
|
27
26
|
parseMessages
|
|
28
|
-
} from "../chunk-
|
|
29
|
-
import
|
|
27
|
+
} from "../chunk-G5OACQEI.js";
|
|
28
|
+
import {
|
|
29
|
+
isJsonValue
|
|
30
|
+
} from "../chunk-SROQA7I7.js";
|
|
31
|
+
import "../chunk-UBE4WH6G.js";
|
|
30
32
|
export {
|
|
31
33
|
CompletionCapabilityError,
|
|
32
34
|
Usage,
|
package/dist/embeddings/index.js
CHANGED
|
@@ -10,9 +10,9 @@ import {
|
|
|
10
10
|
embedTexts,
|
|
11
11
|
euclideanDistance,
|
|
12
12
|
manhattanDistance
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-H7BI3BSP.js";
|
|
14
14
|
import "../chunk-3RM57ZT2.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-UBE4WH6G.js";
|
|
16
16
|
export {
|
|
17
17
|
angularDistance,
|
|
18
18
|
chebyshevDistance,
|
package/dist/evals/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { U as Usage, J as JsonObject, C as CompletionModel, M as Message } from '../types-D9rKQ_as.js';
|
|
2
2
|
import { Z as ZodSchema } from '../zod-schema-C7F4clpm.js';
|
|
3
|
-
import {
|
|
4
|
-
import { t as AgentSuspendedResult, j as AgentResponse, l as AgentRunOptions, k as AgentResult } from '../types-
|
|
3
|
+
import { AgentInteractionRequest, AgentInteractionResponse } from '../agent/interactions/index.js';
|
|
4
|
+
import { t as AgentSuspendedResult, j as AgentResponse, l as AgentRunOptions, k as AgentResult } from '../types-1KpjDfoN.js';
|
|
5
5
|
import { E as EmbeddingModel } from '../types-Cr4uiYo5.js';
|
|
6
6
|
import '../model-call-options-CZkSw_xN.js';
|
|
7
7
|
import 'zod';
|
|
8
|
-
import '../type-utils-CtHVDRn_.js';
|
|
9
8
|
import '../retry-CjvSlKGW.js';
|
|
10
9
|
import '../types-CIPaIbZo.js';
|
|
10
|
+
import '../type-utils-CtHVDRn_.js';
|
|
11
11
|
import '../types-DbolvLtZ.js';
|
|
12
12
|
import '../tool-r62gf3QY.js';
|
|
13
|
+
import '../middleware-BqtLB_Xt.js';
|
|
13
14
|
|
|
14
15
|
type EvalOutcome<Score = unknown> = {
|
|
15
16
|
outcome: "pass";
|
package/dist/evals/index.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentRunBlockedError
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-TEV3OB7N.js";
|
|
4
4
|
import {
|
|
5
5
|
cosineSimilarity,
|
|
6
6
|
embedText
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-H7BI3BSP.js";
|
|
8
8
|
import {
|
|
9
9
|
mapWithConcurrency
|
|
10
10
|
} from "../chunk-3RM57ZT2.js";
|
|
11
11
|
import {
|
|
12
12
|
extract
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-YDJA4R37.js";
|
|
14
14
|
import "../chunk-MGNTXGTX.js";
|
|
15
15
|
import {
|
|
16
16
|
Usage
|
|
17
|
-
} from "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
17
|
+
} from "../chunk-HSA6NL2E.js";
|
|
18
|
+
import "../chunk-G5OACQEI.js";
|
|
19
|
+
import "../chunk-SROQA7I7.js";
|
|
20
|
+
import "../chunk-UBE4WH6G.js";
|
|
20
21
|
|
|
21
22
|
// src/evals/advanced-metrics.ts
|
|
22
23
|
import { z } from "zod";
|