@codeworksh/aikit 0.7.1 → 0.7.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.
- package/cli.mjs +2 -2
- package/failure-C0lCOdFE.d.mts +240 -0
- package/failure-xra3YPdY.mjs +281 -0
- package/failure-xra3YPdY.mjs.map +1 -0
- package/index.d.mts +2656 -2
- package/index.mjs +12 -4
- package/index.mjs.map +1 -1
- package/llm/failure.d.mts +2 -0
- package/llm/failure.mjs +2 -0
- package/model-CKKq3s4y.d.mts +1138 -0
- package/{modelgen-BcsqB44a.mjs → modelgen-xolcfdfT.mjs} +2 -2
- package/{modelgen-BcsqB44a.mjs.map → modelgen-xolcfdfT.mjs.map} +1 -1
- package/modelgen.d.mts +1 -1
- package/modelgen.mjs +1 -1
- package/package.json +10 -1
- package/{registry-CMkIE_B4.mjs → registry-DHskX4NP.mjs} +42 -5
- package/registry-DHskX4NP.mjs.map +1 -0
- package/model-En2JLLXC.d.mts +0 -328
- package/registry-CMkIE_B4.mjs.map +0 -1
package/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { c as FailureSchema, r as normalize, t as failure_exports } from "./failure-xra3YPdY.mjs";
|
|
3
|
+
import { E as NamedError, _ as getProviders, c as APIMethodEnumSchema, d as KnownProviderEnumSchema, f as ProviderInfo, g as getModels, h as getModel, i as packageForModel, l as ActiveThinkingLevel, m as clampThinkingLevel, o as resolveLanguageModel, p as calculateCost, r as loadProviderFactory, u as KnownProviderEnum, v as model_exports, x as registry, y as modelsAreEqual } from "./registry-DHskX4NP.mjs";
|
|
3
4
|
import { g as shortHash, n as createOpenAICodex, r as openaiCodex, v as openAICodexTools, x as resolveOpenAICodexToolConstraint } from "./openai-codex-_3XkJ4bs.mjs";
|
|
4
5
|
import Type$2, { Type, Type as Type$1 } from "typebox";
|
|
5
6
|
import { uuidv7 } from "uuidv7";
|
|
@@ -180,6 +181,8 @@ const AssistantMessageSchema = Type$2.Object({
|
|
|
180
181
|
usage: UsageSchema,
|
|
181
182
|
stopReason: StopReasonSchema,
|
|
182
183
|
errorMessage: Type$2.Optional(Type$2.String()),
|
|
184
|
+
/** Structured, provider-independent details for a failed request. */
|
|
185
|
+
failure: Type$2.Optional(FailureSchema),
|
|
183
186
|
time: Type$2.Object({
|
|
184
187
|
created: Type$2.Number(),
|
|
185
188
|
completed: Type$2.Number()
|
|
@@ -1549,7 +1552,8 @@ const stream$1 = (model, context, options) => {
|
|
|
1549
1552
|
abortSignal: runtimeOptions.signal,
|
|
1550
1553
|
timeout: runtimeOptions.timeoutMs,
|
|
1551
1554
|
maxRetries: runtimeOptions.maxRetries,
|
|
1552
|
-
headers: runtimeOptions.headers
|
|
1555
|
+
headers: runtimeOptions.headers,
|
|
1556
|
+
onError: () => {}
|
|
1553
1557
|
});
|
|
1554
1558
|
const payload = await runtimeOptions.onPayload?.(params, model);
|
|
1555
1559
|
if (payload !== void 0) params = payload;
|
|
@@ -1576,7 +1580,11 @@ const stream$1 = (model, context, options) => {
|
|
|
1576
1580
|
}
|
|
1577
1581
|
output.time.completed = Date.now();
|
|
1578
1582
|
output.stopReason = runtimeOptions.signal?.aborted || output.stopReason === "aborted" ? "aborted" : "error";
|
|
1579
|
-
output.errorMessage = formatThrownError(error);
|
|
1583
|
+
if (output.stopReason === "aborted") output.errorMessage = formatThrownError(error);
|
|
1584
|
+
else {
|
|
1585
|
+
output.failure = normalize(error);
|
|
1586
|
+
output.errorMessage = output.failure.message;
|
|
1587
|
+
}
|
|
1580
1588
|
stream.push({
|
|
1581
1589
|
type: "error",
|
|
1582
1590
|
reason: output.stopReason,
|
|
@@ -1677,6 +1685,6 @@ function validateToolArguments(tool, toolExecution) {
|
|
|
1677
1685
|
return validateSchema(tool.parameters, toolExecution.rawArgs, `Tool "${toolExecution.name}"`);
|
|
1678
1686
|
}
|
|
1679
1687
|
//#endregion
|
|
1680
|
-
export { event_exports as Event, EventStream, message_exports as Message, model_exports as Model, protocol_exports as Protocol, ThinkingBudgets, Type, createAssistantMessageEventStream, createOpenAICodex, llm, openAICodexTools, openaiCodex, stream, validateSchema, validateToolArguments, validateToolCall };
|
|
1688
|
+
export { event_exports as Event, EventStream, failure_exports as Failure, message_exports as Message, model_exports as Model, protocol_exports as Protocol, ThinkingBudgets, Type, createAssistantMessageEventStream, createOpenAICodex, llm, openAICodexTools, openaiCodex, stream, validateSchema, validateToolArguments, validateToolCall };
|
|
1681
1689
|
|
|
1682
1690
|
//# sourceMappingURL=index.mjs.map
|