@agentionai/agents 1.13.0 → 1.15.0
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/dist/agents/AgentConfig.d.ts +40 -0
- package/dist/agents/AgentEvent.d.ts +6 -0
- package/dist/agents/AgentEvent.js +6 -0
- package/dist/agents/BaseAgent.d.ts +18 -0
- package/dist/agents/BaseAgent.js +2 -0
- package/dist/agents/openai/CodexAgent.d.ts +114 -8
- package/dist/agents/openai/CodexAgent.js +81 -7
- package/dist/agents/openai/OpenAiAgent.d.ts +147 -0
- package/dist/agents/openai/OpenAiAgent.js +127 -12
- package/dist/agents/openai/codex-usage.d.ts +88 -0
- package/dist/agents/openai/codex-usage.js +127 -0
- package/dist/history/History.d.ts +2 -2
- package/dist/history/History.js +24 -2
- package/dist/history/index.d.ts +2 -2
- package/dist/history/index.js +2 -1
- package/dist/history/transformers.d.ts +12 -3
- package/dist/history/transformers.js +119 -13
- package/dist/history/types.d.ts +31 -1
- package/dist/history/types.js +15 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -1
- package/dist/openai.d.ts +2 -0
- package/dist/openai.js +4 -1
- package/package.json +3 -3
|
@@ -10,17 +10,33 @@ const types_1 = require("./types");
|
|
|
10
10
|
// =============================================================================
|
|
11
11
|
// Anthropic Transformer
|
|
12
12
|
// =============================================================================
|
|
13
|
+
/**
|
|
14
|
+
* Whether a thinking block is one Anthropic itself produced, and so can be sent
|
|
15
|
+
* back to it.
|
|
16
|
+
*
|
|
17
|
+
* Anthropic signs every thinking block it emits (or returns it redacted), and
|
|
18
|
+
* rejects one whose signature does not verify — an empty string included. Other
|
|
19
|
+
* providers' reasoning reaches this transformer whenever a `History` is shared
|
|
20
|
+
* between agents, which the docs recommend: OpenAI's carries a summary and an
|
|
21
|
+
* encrypted payload but no signature, so it has to be dropped rather than
|
|
22
|
+
* replayed under an empty one.
|
|
23
|
+
*/
|
|
24
|
+
function isAnthropicThinkingBlock(block) {
|
|
25
|
+
return block.redactedData !== undefined || block.signature !== undefined;
|
|
26
|
+
}
|
|
13
27
|
exports.anthropicTransformer = {
|
|
14
28
|
/**
|
|
15
29
|
* Convert normalized entries to Anthropic MessageParam format
|
|
16
30
|
*/
|
|
17
31
|
toProvider(entries) {
|
|
18
|
-
return entries
|
|
32
|
+
return (entries
|
|
19
33
|
.filter((entry) => entry.role !== "system") // Anthropic handles system separately
|
|
20
34
|
.map((entry) => {
|
|
21
35
|
const role = entry.role === "assistant" ? "assistant" : "user";
|
|
22
36
|
// Convert content blocks to Anthropic's ContentBlockParam
|
|
23
|
-
const content = entry.content
|
|
37
|
+
const content = entry.content
|
|
38
|
+
.filter((block) => !(0, types_1.isThinkingContent)(block) || isAnthropicThinkingBlock(block))
|
|
39
|
+
.map((block) => {
|
|
24
40
|
if ((0, types_1.isTextContent)(block)) {
|
|
25
41
|
return { type: "text", text: block.text };
|
|
26
42
|
}
|
|
@@ -72,7 +88,12 @@ exports.anthropicTransformer = {
|
|
|
72
88
|
throw new Error(`Unknown content type: ${block.type}`);
|
|
73
89
|
});
|
|
74
90
|
return { role, content };
|
|
75
|
-
})
|
|
91
|
+
})
|
|
92
|
+
// Dropping a foreign thinking block can empty a turn that held nothing
|
|
93
|
+
// else (a reasoning-only assistant entry). Anthropic rejects a message
|
|
94
|
+
// with no content, and there is nothing left to say, so drop the message
|
|
95
|
+
// too. Tool pairs are unaffected: a thinking-only entry has no tool_use.
|
|
96
|
+
.filter((message) => message.content.length > 0));
|
|
76
97
|
},
|
|
77
98
|
/**
|
|
78
99
|
* Convert Anthropic response content to normalized HistoryEntry
|
|
@@ -139,12 +160,48 @@ function toOpenAiId(originalId) {
|
|
|
139
160
|
idMappingToOpenAi.set(originalId, newId);
|
|
140
161
|
return newId;
|
|
141
162
|
}
|
|
163
|
+
function isOpenAiReasoningItem(value) {
|
|
164
|
+
return (typeof value === "object" &&
|
|
165
|
+
value !== null &&
|
|
166
|
+
value.type === "reasoning");
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* The reasoning items stored on an assistant entry, in the order they were
|
|
170
|
+
* received.
|
|
171
|
+
*
|
|
172
|
+
* They ride on `ThinkingContent.reasoningDetails` — the same passthrough slot
|
|
173
|
+
* OpenRouter's `reasoning_details` uses — because they have to survive the round
|
|
174
|
+
* trip untouched and there is nothing to model.
|
|
175
|
+
*/
|
|
176
|
+
function openAiReasoningItems(entry) {
|
|
177
|
+
return entry.content
|
|
178
|
+
.filter(types_1.isThinkingContent)
|
|
179
|
+
.filter((block) => (0, types_1.reasoningDetailsFormatOf)(block) === "openai.responses")
|
|
180
|
+
.flatMap((block) => block.reasoningDetails ?? [])
|
|
181
|
+
.filter(isOpenAiReasoningItem);
|
|
182
|
+
}
|
|
183
|
+
/** Human-readable text of a reasoning item's summary, for display in history. */
|
|
184
|
+
function reasoningSummaryText(items) {
|
|
185
|
+
return items
|
|
186
|
+
.flatMap((item) => item.summary ?? [])
|
|
187
|
+
.map((part) => part?.text ?? "")
|
|
188
|
+
.filter(Boolean)
|
|
189
|
+
.join("\n\n");
|
|
190
|
+
}
|
|
142
191
|
exports.openAiTransformer = {
|
|
143
192
|
/**
|
|
144
|
-
* Convert normalized entries to OpenAI ResponseInputItem format
|
|
193
|
+
* Convert normalized entries to OpenAI ResponseInputItem format.
|
|
194
|
+
*
|
|
195
|
+
* `replayReasoning` defaults to on and mirrors
|
|
196
|
+
* `AgentConfig.includeEncryptedReasoning`: requesting the blobs and sending
|
|
197
|
+
* them back are one feature, so switching it off has to stop *both*.
|
|
198
|
+
* Otherwise a history that already holds blobs keeps replaying them — which
|
|
199
|
+
* is exactly the situation the flag is turned off to escape, since reasoning
|
|
200
|
+
* is tied to the model that produced it and switching models is rejected.
|
|
145
201
|
*/
|
|
146
|
-
toProvider(entries) {
|
|
202
|
+
toProvider(entries, options) {
|
|
147
203
|
const items = [];
|
|
204
|
+
const replayReasoning = options?.replayReasoning ?? true;
|
|
148
205
|
for (const entry of entries) {
|
|
149
206
|
if (entry.role === "system") {
|
|
150
207
|
items.push({
|
|
@@ -157,6 +214,18 @@ exports.openAiTransformer = {
|
|
|
157
214
|
});
|
|
158
215
|
continue;
|
|
159
216
|
}
|
|
217
|
+
// Reasoning first, before anything else this turn produced — the order
|
|
218
|
+
// the model emitted it in. The Responses API turns out not to enforce
|
|
219
|
+
// this on the `store: false` + explicit-`input` flow these agents use
|
|
220
|
+
// (probed live 2026-09-10; see `OpenAiAgent.replayableReasoning` for what
|
|
221
|
+
// was accepted), so this is fidelity to what the model produced rather
|
|
222
|
+
// than a constraint. Emitting it out of order is not known to fail, but
|
|
223
|
+
// there is no reason to.
|
|
224
|
+
if (replayReasoning) {
|
|
225
|
+
for (const item of openAiReasoningItems(entry)) {
|
|
226
|
+
items.push(item);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
160
229
|
// Separate content blocks by type for OpenAI format
|
|
161
230
|
const textBlocks = entry.content.filter(types_1.isTextContent);
|
|
162
231
|
const toolUseBlocks = entry.content.filter(types_1.isToolUseContent);
|
|
@@ -238,8 +307,21 @@ exports.openAiTransformer = {
|
|
|
238
307
|
/**
|
|
239
308
|
* Convert OpenAI response to normalized HistoryEntry
|
|
240
309
|
*/
|
|
241
|
-
fromProviderMessage(role, outputText, functionCalls
|
|
310
|
+
fromProviderMessage(role, outputText, functionCalls,
|
|
311
|
+
/**
|
|
312
|
+
* `reasoning` items from `response.output`, stored verbatim so the next
|
|
313
|
+
* request can replay them. Pass only items that carry `encrypted_content`:
|
|
314
|
+
* with `store: false` the provider has kept nothing of its own, so a
|
|
315
|
+
* replayed item without it cannot be resolved and the request is rejected.
|
|
316
|
+
*/
|
|
317
|
+
reasoningItems) {
|
|
242
318
|
const content = [];
|
|
319
|
+
const reasoning = (reasoningItems ?? []).filter(isOpenAiReasoningItem);
|
|
320
|
+
if (reasoning.length > 0) {
|
|
321
|
+
// Summary text is for humans reading the history; the payload that
|
|
322
|
+
// matters is the untouched items on `reasoningDetails`.
|
|
323
|
+
content.push((0, types_1.thinking)(reasoningSummaryText(reasoning), undefined, undefined, reasoning, "openai.responses"));
|
|
324
|
+
}
|
|
243
325
|
if (outputText) {
|
|
244
326
|
content.push((0, types_1.text)(outputText));
|
|
245
327
|
}
|
|
@@ -553,7 +635,10 @@ exports.ollamaTransformer = {
|
|
|
553
635
|
const toolUseBlocks = entry.content.filter(types_1.isToolUseContent);
|
|
554
636
|
const toolResultBlocks = entry.content.filter(types_1.isToolResultContent);
|
|
555
637
|
if (entry.role === "system") {
|
|
556
|
-
messages.push({
|
|
638
|
+
messages.push({
|
|
639
|
+
role: "system",
|
|
640
|
+
content: textBlocks.map((c) => c.text).join("\n"),
|
|
641
|
+
});
|
|
557
642
|
continue;
|
|
558
643
|
}
|
|
559
644
|
if (entry.role === "assistant") {
|
|
@@ -579,7 +664,10 @@ exports.ollamaTransformer = {
|
|
|
579
664
|
}
|
|
580
665
|
}
|
|
581
666
|
else if (textBlocks.length > 0) {
|
|
582
|
-
messages.push({
|
|
667
|
+
messages.push({
|
|
668
|
+
role: "user",
|
|
669
|
+
content: textBlocks.map((c) => c.text).join("\n"),
|
|
670
|
+
});
|
|
583
671
|
}
|
|
584
672
|
}
|
|
585
673
|
return messages;
|
|
@@ -650,7 +738,10 @@ exports.chatCompletionsTransformer = {
|
|
|
650
738
|
const imageBase64Blocks = entry.content.filter(types_1.isImageBase64Content);
|
|
651
739
|
const hasImages = imageUrlBlocks.length > 0 || imageBase64Blocks.length > 0;
|
|
652
740
|
if (entry.role === "system") {
|
|
653
|
-
messages.push({
|
|
741
|
+
messages.push({
|
|
742
|
+
role: "system",
|
|
743
|
+
content: textBlocks.map((c) => c.text).join("\n"),
|
|
744
|
+
});
|
|
654
745
|
continue;
|
|
655
746
|
}
|
|
656
747
|
if (entry.role === "assistant") {
|
|
@@ -720,7 +811,10 @@ exports.chatCompletionsTransformer = {
|
|
|
720
811
|
messages.push({ role: "user", content: parts });
|
|
721
812
|
}
|
|
722
813
|
else if (textBlocks.length > 0) {
|
|
723
|
-
messages.push({
|
|
814
|
+
messages.push({
|
|
815
|
+
role: "user",
|
|
816
|
+
content: textBlocks.map((c) => c.text).join("\n"),
|
|
817
|
+
});
|
|
724
818
|
}
|
|
725
819
|
}
|
|
726
820
|
return messages;
|
|
@@ -807,7 +901,11 @@ function markLatestCacheBreakpoint(messages) {
|
|
|
807
901
|
const message = messages[i];
|
|
808
902
|
if (typeof message.content === "string" && message.content.length > 0) {
|
|
809
903
|
message.content = [
|
|
810
|
-
{
|
|
904
|
+
{
|
|
905
|
+
type: "text",
|
|
906
|
+
text: message.content,
|
|
907
|
+
cacheControl: { type: "ephemeral" },
|
|
908
|
+
},
|
|
811
909
|
];
|
|
812
910
|
return;
|
|
813
911
|
}
|
|
@@ -861,7 +959,15 @@ exports.openRouterTransformer = {
|
|
|
861
959
|
// and Anthropic and OpenAI models reject a tool-using turn whose
|
|
862
960
|
// signature did not come back. Only set the key when there is one, so
|
|
863
961
|
// requests for non-reasoning models stay byte-identical.
|
|
864
|
-
|
|
962
|
+
// Only OpenRouter's own blocks. A history shared with an OpenAI agent
|
|
963
|
+
// also carries Responses-API `reasoning` items in this slot, and they
|
|
964
|
+
// are not OpenRouter's to interpret — it returned 200 rather than an
|
|
965
|
+
// error when one was sent (probed live 2026-09-10, upstream
|
|
966
|
+
// `anthropic/claude-sonnet-4.5`), but forwarding another provider's
|
|
967
|
+
// opaque payload can only confuse the model or the upstream route.
|
|
968
|
+
const reasoningDetails = thinkingBlocks
|
|
969
|
+
.filter((block) => (0, types_1.reasoningDetailsFormatOf)(block) === "openrouter")
|
|
970
|
+
.flatMap((block) => block.reasoningDetails ?? []);
|
|
865
971
|
if (reasoningDetails.length > 0) {
|
|
866
972
|
msg.reasoningDetails = reasoningDetails;
|
|
867
973
|
}
|
|
@@ -934,7 +1040,7 @@ exports.openRouterTransformer = {
|
|
|
934
1040
|
const reasoningText = typeof message.reasoning === "string" ? message.reasoning : "";
|
|
935
1041
|
const reasoningDetails = message.reasoningDetails ?? [];
|
|
936
1042
|
if (reasoningText || reasoningDetails.length > 0) {
|
|
937
|
-
content.push((0, types_1.thinking)(reasoningText, undefined, undefined, reasoningDetails));
|
|
1043
|
+
content.push((0, types_1.thinking)(reasoningText, undefined, undefined, reasoningDetails, "openrouter"));
|
|
938
1044
|
}
|
|
939
1045
|
if (typeof message.content === "string" && message.content) {
|
|
940
1046
|
content.push((0, types_1.text)(message.content));
|
package/dist/history/types.d.ts
CHANGED
|
@@ -62,9 +62,32 @@ export type ThinkingContent = {
|
|
|
62
62
|
*
|
|
63
63
|
* Nothing here reads the contents; they only have to survive the round trip,
|
|
64
64
|
* so they stay untyped rather than modelling every provider's block shapes.
|
|
65
|
+
*
|
|
66
|
+
* The shapes are *not* interchangeable — see
|
|
67
|
+
* {@link ThinkingContent.reasoningDetailsFormat}.
|
|
65
68
|
*/
|
|
66
69
|
reasoningDetails?: unknown[];
|
|
70
|
+
/**
|
|
71
|
+
* Which provider's format {@link ThinkingContent.reasoningDetails} is in.
|
|
72
|
+
*
|
|
73
|
+
* Two producers share that slot and their shapes are mutually invalid:
|
|
74
|
+
* OpenRouter's entries are tagged `reasoning.text` / `reasoning.summary` /
|
|
75
|
+
* `reasoning.encrypted`, while the OpenAI Responses API's are whole
|
|
76
|
+
* `reasoning` items. A history shared between agents therefore has to say
|
|
77
|
+
* which is which, or each transformer forwards the other's blocks and the
|
|
78
|
+
* provider rejects the request.
|
|
79
|
+
*
|
|
80
|
+
* Absent on blocks written before this field existed, which are OpenRouter's
|
|
81
|
+
* by definition — it was the only producer then. Read it through
|
|
82
|
+
* {@link reasoningDetailsFormatOf} rather than directly, so that default
|
|
83
|
+
* stays in one place.
|
|
84
|
+
*/
|
|
85
|
+
reasoningDetailsFormat?: ReasoningDetailsFormat;
|
|
67
86
|
};
|
|
87
|
+
/**
|
|
88
|
+
* Provider formats that {@link ThinkingContent.reasoningDetails} can hold.
|
|
89
|
+
*/
|
|
90
|
+
export type ReasoningDetailsFormat = "openrouter" | "openai.responses";
|
|
68
91
|
/**
|
|
69
92
|
* Supported image MIME types across all providers
|
|
70
93
|
*/
|
|
@@ -207,7 +230,14 @@ export declare function toolUse(id: string, name: string, input: Record<string,
|
|
|
207
230
|
/**
|
|
208
231
|
* Create a thinking content block. Pass `redactedData` for redacted thinking.
|
|
209
232
|
*/
|
|
210
|
-
export declare function thinking(thinkingText: string, signature?: string, redactedData?: string, reasoningDetails?: unknown[]): ThinkingContent;
|
|
233
|
+
export declare function thinking(thinkingText: string, signature?: string, redactedData?: string, reasoningDetails?: unknown[], reasoningDetailsFormat?: ReasoningDetailsFormat): ThinkingContent;
|
|
234
|
+
/**
|
|
235
|
+
* The format of a block's {@link ThinkingContent.reasoningDetails}.
|
|
236
|
+
*
|
|
237
|
+
* Untagged blocks are OpenRouter's: it was the only producer before the tag
|
|
238
|
+
* existed, so that is what an untagged block can only have come from.
|
|
239
|
+
*/
|
|
240
|
+
export declare function reasoningDetailsFormatOf(block: ThinkingContent): ReasoningDetailsFormat;
|
|
211
241
|
/**
|
|
212
242
|
* Create a tool result content block
|
|
213
243
|
*/
|
package/dist/history/types.js
CHANGED
|
@@ -16,6 +16,7 @@ exports.isImageContent = isImageContent;
|
|
|
16
16
|
exports.text = text;
|
|
17
17
|
exports.toolUse = toolUse;
|
|
18
18
|
exports.thinking = thinking;
|
|
19
|
+
exports.reasoningDetailsFormatOf = reasoningDetailsFormatOf;
|
|
19
20
|
exports.toolResult = toolResult;
|
|
20
21
|
exports.textMessage = textMessage;
|
|
21
22
|
exports.imageUrl = imageUrl;
|
|
@@ -70,20 +71,29 @@ function toolUse(id, name, input, thoughtSignature) {
|
|
|
70
71
|
/**
|
|
71
72
|
* Create a thinking content block. Pass `redactedData` for redacted thinking.
|
|
72
73
|
*/
|
|
73
|
-
function thinking(thinkingText, signature, redactedData, reasoningDetails) {
|
|
74
|
+
function thinking(thinkingText, signature, redactedData, reasoningDetails, reasoningDetailsFormat = "openrouter") {
|
|
74
75
|
// As in `toolUse()`, only set the passthrough key when there is something in
|
|
75
76
|
// it, so a block stored without details serializes exactly as it did before
|
|
76
|
-
// the field existed.
|
|
77
|
+
// the field existed. The format tag rides along with the details for the same
|
|
78
|
+
// reason: it says nothing on its own.
|
|
79
|
+
const hasDetails = reasoningDetails !== undefined && reasoningDetails.length > 0;
|
|
77
80
|
return {
|
|
78
81
|
type: "thinking",
|
|
79
82
|
thinking: thinkingText,
|
|
80
83
|
signature,
|
|
81
84
|
redactedData,
|
|
82
|
-
...(
|
|
83
|
-
? { reasoningDetails }
|
|
84
|
-
: {}),
|
|
85
|
+
...(hasDetails ? { reasoningDetails, reasoningDetailsFormat } : {}),
|
|
85
86
|
};
|
|
86
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* The format of a block's {@link ThinkingContent.reasoningDetails}.
|
|
90
|
+
*
|
|
91
|
+
* Untagged blocks are OpenRouter's: it was the only producer before the tag
|
|
92
|
+
* existed, so that is what an untagged block can only have come from.
|
|
93
|
+
*/
|
|
94
|
+
function reasoningDetailsFormatOf(block) {
|
|
95
|
+
return block.reasoningDetailsFormat ?? "openrouter";
|
|
96
|
+
}
|
|
87
97
|
/**
|
|
88
98
|
* Create a tool result content block
|
|
89
99
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./agents/anthropic/ClaudeAgent";
|
|
|
3
3
|
export { OpenAiAgent } from "./agents/openai/OpenAiAgent";
|
|
4
4
|
export { CODEX_BASE_URL, CODEX_CLIENT_ID, CODEX_ORIGINATOR, CODEX_TOKEN_URL, codexAuthFilePath, createCodexTokenProvider, loadCodexCredentials, refreshCodexCredentials, } from "./agents/openai/codex-auth";
|
|
5
5
|
export type { CodexModelCard, CodexCredentials, CodexTokenProvider, CodexTokenProviderOptions, } from "./agents/openai/codex-auth";
|
|
6
|
+
export { parseCodexUsageLimits, observeHeadersFetch, type CodexUsageLimits, type CodexRateLimitWindow, type CodexCredits, } from "./agents/openai/codex-usage";
|
|
6
7
|
export { CodexAgent } from "./agents/openai/CodexAgent";
|
|
7
8
|
export type { CodexAgentConfig, CodexModel, CodexReasoningEffort, } from "./agents/openai/CodexAgent";
|
|
8
9
|
export { MistralAgent } from "./agents/mistral/MistralAgent";
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
22
22
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.openRouterTransformer = exports.chatCompletionsTransformer = exports.ollamaTransformer = exports.geminiTransformer = exports.mistralTransformer = exports.openAiTransformer = exports.anthropicTransformer = exports.OpenRouterAgent = exports.OpenAICompatibleAgent = exports.LlamaCppAgent = exports.OllamaAgent = exports.GEMINI_RETIRED_MODELS = exports.GeminiAgent = exports.MistralAgent = exports.CodexAgent = exports.refreshCodexCredentials = exports.loadCodexCredentials = exports.createCodexTokenProvider = exports.codexAuthFilePath = exports.CODEX_TOKEN_URL = exports.CODEX_ORIGINATOR = exports.CODEX_CLIENT_ID = exports.CODEX_BASE_URL = exports.OpenAiAgent = void 0;
|
|
25
|
+
exports.openRouterTransformer = exports.chatCompletionsTransformer = exports.ollamaTransformer = exports.geminiTransformer = exports.mistralTransformer = exports.openAiTransformer = exports.anthropicTransformer = exports.OpenRouterAgent = exports.OpenAICompatibleAgent = exports.LlamaCppAgent = exports.OllamaAgent = exports.GEMINI_RETIRED_MODELS = exports.GeminiAgent = exports.MistralAgent = exports.CodexAgent = exports.observeHeadersFetch = exports.parseCodexUsageLimits = exports.refreshCodexCredentials = exports.loadCodexCredentials = exports.createCodexTokenProvider = exports.codexAuthFilePath = exports.CODEX_TOKEN_URL = exports.CODEX_ORIGINATOR = exports.CODEX_CLIENT_ID = exports.CODEX_BASE_URL = exports.OpenAiAgent = void 0;
|
|
26
26
|
// Agents
|
|
27
27
|
__exportStar(require("./agents/BaseAgent"), exports);
|
|
28
28
|
__exportStar(require("./agents/anthropic/ClaudeAgent"), exports);
|
|
@@ -37,6 +37,9 @@ Object.defineProperty(exports, "codexAuthFilePath", { enumerable: true, get: fun
|
|
|
37
37
|
Object.defineProperty(exports, "createCodexTokenProvider", { enumerable: true, get: function () { return codex_auth_1.createCodexTokenProvider; } });
|
|
38
38
|
Object.defineProperty(exports, "loadCodexCredentials", { enumerable: true, get: function () { return codex_auth_1.loadCodexCredentials; } });
|
|
39
39
|
Object.defineProperty(exports, "refreshCodexCredentials", { enumerable: true, get: function () { return codex_auth_1.refreshCodexCredentials; } });
|
|
40
|
+
var codex_usage_1 = require("./agents/openai/codex-usage");
|
|
41
|
+
Object.defineProperty(exports, "parseCodexUsageLimits", { enumerable: true, get: function () { return codex_usage_1.parseCodexUsageLimits; } });
|
|
42
|
+
Object.defineProperty(exports, "observeHeadersFetch", { enumerable: true, get: function () { return codex_usage_1.observeHeadersFetch; } });
|
|
40
43
|
var CodexAgent_1 = require("./agents/openai/CodexAgent");
|
|
41
44
|
Object.defineProperty(exports, "CodexAgent", { enumerable: true, get: function () { return CodexAgent_1.CodexAgent; } });
|
|
42
45
|
var MistralAgent_1 = require("./agents/mistral/MistralAgent");
|
package/dist/openai.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from "./core";
|
|
2
2
|
export { OpenAiAgent, describeOpenAIError, wrapErrorBodyFetch, } from "./agents/openai/OpenAiAgent";
|
|
3
|
+
export type { OpenAIInputTokensDetails } from "./agents/openai/OpenAiAgent";
|
|
3
4
|
export { CodexAgent } from "./agents/openai/CodexAgent";
|
|
4
5
|
export type { CodexAgentConfig, CodexModel, CodexReasoningEffort, } from "./agents/openai/CodexAgent";
|
|
5
6
|
export { openAiTransformer } from "./history/transformers";
|
|
6
7
|
export { CODEX_BASE_URL, CODEX_CLIENT_ID, CODEX_ORIGINATOR, CODEX_TOKEN_URL, codexAuthFilePath, createCodexTokenProvider, decodeJwtClaims, jwtExpiry, loadCodexCredentials, refreshCodexCredentials, type CodexCredentials, type CodexTokenProvider, type CodexTokenProviderOptions, type CodexModelCard, } from "./agents/openai/codex-auth";
|
|
8
|
+
export { parseCodexUsageLimits, observeHeadersFetch, type CodexUsageLimits, type CodexRateLimitWindow, type CodexCredits, } from "./agents/openai/codex-usage";
|
|
7
9
|
//# sourceMappingURL=openai.d.ts.map
|
package/dist/openai.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.refreshCodexCredentials = exports.loadCodexCredentials = exports.jwtExpiry = exports.decodeJwtClaims = exports.createCodexTokenProvider = exports.codexAuthFilePath = exports.CODEX_TOKEN_URL = exports.CODEX_ORIGINATOR = exports.CODEX_CLIENT_ID = exports.CODEX_BASE_URL = exports.openAiTransformer = exports.CodexAgent = exports.wrapErrorBodyFetch = exports.describeOpenAIError = exports.OpenAiAgent = void 0;
|
|
17
|
+
exports.observeHeadersFetch = exports.parseCodexUsageLimits = exports.refreshCodexCredentials = exports.loadCodexCredentials = exports.jwtExpiry = exports.decodeJwtClaims = exports.createCodexTokenProvider = exports.codexAuthFilePath = exports.CODEX_TOKEN_URL = exports.CODEX_ORIGINATOR = exports.CODEX_CLIENT_ID = exports.CODEX_BASE_URL = exports.openAiTransformer = exports.CodexAgent = exports.wrapErrorBodyFetch = exports.describeOpenAIError = exports.OpenAiAgent = void 0;
|
|
18
18
|
// OpenAI Agent Entry Point
|
|
19
19
|
__exportStar(require("./core"), exports);
|
|
20
20
|
var OpenAiAgent_1 = require("./agents/openai/OpenAiAgent");
|
|
@@ -36,4 +36,7 @@ Object.defineProperty(exports, "decodeJwtClaims", { enumerable: true, get: funct
|
|
|
36
36
|
Object.defineProperty(exports, "jwtExpiry", { enumerable: true, get: function () { return codex_auth_1.jwtExpiry; } });
|
|
37
37
|
Object.defineProperty(exports, "loadCodexCredentials", { enumerable: true, get: function () { return codex_auth_1.loadCodexCredentials; } });
|
|
38
38
|
Object.defineProperty(exports, "refreshCodexCredentials", { enumerable: true, get: function () { return codex_auth_1.refreshCodexCredentials; } });
|
|
39
|
+
var codex_usage_1 = require("./agents/openai/codex-usage");
|
|
40
|
+
Object.defineProperty(exports, "parseCodexUsageLimits", { enumerable: true, get: function () { return codex_usage_1.parseCodexUsageLimits; } });
|
|
41
|
+
Object.defineProperty(exports, "observeHeadersFetch", { enumerable: true, get: function () { return codex_usage_1.observeHeadersFetch; } });
|
|
39
42
|
//# sourceMappingURL=openai.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentionai/agents",
|
|
3
3
|
"author": "Laurent Zuijdwijk",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.15.0",
|
|
5
5
|
"description": "Agent Library",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"jsdoc": "^4.0.4",
|
|
133
133
|
"jsdoc-to-markdown": "^9.1.1",
|
|
134
134
|
"nodemon": "^2.0.22",
|
|
135
|
-
"openai": "^
|
|
135
|
+
"openai": "^7.13.0",
|
|
136
136
|
"prettier": "^2.8.7",
|
|
137
137
|
"rimraf": "^4.4.1",
|
|
138
138
|
"ts-jest": "^29.2.6",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"@openrouter/sdk": "^1.2.106",
|
|
154
154
|
"apache-arrow": "^18.0.0",
|
|
155
155
|
"ollama": "^0.5.18",
|
|
156
|
-
"openai": "^
|
|
156
|
+
"openai": "^7.13.0",
|
|
157
157
|
"voyageai": "^0.0.3"
|
|
158
158
|
},
|
|
159
159
|
"peerDependenciesMeta": {
|