@hiper2d/ai-agents 0.11.0 → 0.13.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/index.d.mts +18 -3
- package/dist/index.d.ts +18 -3
- package/dist/index.js +35 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -886,10 +886,16 @@ var SupportedAiModels = {
|
|
|
886
886
|
// GPT-6 Astra (2026-09-03): OpenAI's frontier tier above Sol. No `none` reasoning effort;
|
|
887
887
|
// temperature/top_p are rejected — Gpt5Agent sends neither, so the same agent serves it.
|
|
888
888
|
// The catalog temperature is only carried for the agent constructor signature.
|
|
889
|
+
// All four OpenAI entries carry reasoningEffort: 'medium' as of 2026-09-22. That is
|
|
890
|
+
// OpenAI's own current default, established by MEASUREMENT rather than docs: each model was
|
|
891
|
+
// called with no reasoning param and the effort it echoes back read off the response, since
|
|
892
|
+
// OpenAI documents the default for Sol, Luna and the 5.6 family but never states Astra's.
|
|
893
|
+
// Pinning it changes no behaviour today; it stops the default moving under us silently.
|
|
889
894
|
[LLM_CONSTANTS.GPT_ASTRA]: {
|
|
890
895
|
displayName: "GPT-6 Astra",
|
|
891
896
|
modelApiName: "gpt-6-astra",
|
|
892
897
|
apiKeyName: API_KEY_CONSTANTS.OPENAI,
|
|
898
|
+
reasoningEffort: "medium",
|
|
893
899
|
hasThinking: true,
|
|
894
900
|
temperature: 1,
|
|
895
901
|
tags: ["expensive"]
|
|
@@ -904,6 +910,7 @@ var SupportedAiModels = {
|
|
|
904
910
|
displayName: "GPT-6 Sol",
|
|
905
911
|
modelApiName: "gpt-6-sol",
|
|
906
912
|
apiKeyName: API_KEY_CONSTANTS.OPENAI,
|
|
913
|
+
reasoningEffort: "medium",
|
|
907
914
|
hasThinking: true,
|
|
908
915
|
temperature: 1,
|
|
909
916
|
tags: ["expensive"]
|
|
@@ -912,6 +919,7 @@ var SupportedAiModels = {
|
|
|
912
919
|
displayName: "GPT-5.6 Terra",
|
|
913
920
|
modelApiName: "gpt-5.6-terra",
|
|
914
921
|
apiKeyName: API_KEY_CONSTANTS.OPENAI,
|
|
922
|
+
reasoningEffort: "medium",
|
|
915
923
|
hasThinking: true,
|
|
916
924
|
temperature: 1,
|
|
917
925
|
tags: ["fast", "expensive"]
|
|
@@ -920,6 +928,7 @@ var SupportedAiModels = {
|
|
|
920
928
|
displayName: "GPT-6 Luna",
|
|
921
929
|
modelApiName: "gpt-6-luna",
|
|
922
930
|
apiKeyName: API_KEY_CONSTANTS.OPENAI,
|
|
931
|
+
reasoningEffort: "medium",
|
|
923
932
|
hasThinking: true,
|
|
924
933
|
temperature: 1,
|
|
925
934
|
tags: ["fast", "cheap"]
|
|
@@ -969,6 +978,7 @@ var SupportedAiModels = {
|
|
|
969
978
|
modelApiName: "grok-4.7",
|
|
970
979
|
apiKeyName: API_KEY_CONSTANTS.GROK,
|
|
971
980
|
hasThinking: true,
|
|
981
|
+
reasoningEffort: "high",
|
|
972
982
|
temperature: 0.7
|
|
973
983
|
},
|
|
974
984
|
// Mistral models. Two hybrid entries since 2026-09-18: reasoning is off by default on the
|
|
@@ -1017,6 +1027,9 @@ var SupportedAiModels = {
|
|
|
1017
1027
|
hasThinking: true,
|
|
1018
1028
|
// Temperature is omitted from the request: kimi-k3 rejects any value other than 1.
|
|
1019
1029
|
// Speed samples: 17s (2026-08-04) and 28.9s (2026-08-05) — graded into the >25s tier.
|
|
1030
|
+
// Pinned 'high' 2026-09-22, down from Moonshot's 'max' default: K3 had no levels at
|
|
1031
|
+
// launch and the agent hardcoded max, so this is the first time the knob exists.
|
|
1032
|
+
reasoningEffort: "high",
|
|
1020
1033
|
tags: ["very-slow", "expensive"]
|
|
1021
1034
|
},
|
|
1022
1035
|
// Z.AI models — thinking-only entry (non-thinking variant retired 2026-08-05)
|
|
@@ -1531,6 +1544,7 @@ var FUGU_REASONING_EFFORTS = ["high", "xhigh", "max"];
|
|
|
1531
1544
|
var META_REASONING_EFFORTS = ["minimal", "low", "medium", "high", "xhigh", "max"];
|
|
1532
1545
|
var MISTRAL_REASONING_EFFORTS = ["minimal", "low", "medium", "high", "xhigh"];
|
|
1533
1546
|
var XAI_REASONING_EFFORTS = ["low", "medium", "high", "xhigh"];
|
|
1547
|
+
var KIMI_REASONING_EFFORTS = ["low", "high", "max"];
|
|
1534
1548
|
function clampReasoningEffort(effort, allowed) {
|
|
1535
1549
|
const rank = REASONING_EFFORT_SCALE.indexOf(effort);
|
|
1536
1550
|
let best = allowed[0];
|
|
@@ -1553,6 +1567,7 @@ var toMetaEffort = (effort) => clampReasoningEffort(effort, META_REASONING_EFFOR
|
|
|
1553
1567
|
var toFuguEffort = (effort) => clampReasoningEffort(effort, FUGU_REASONING_EFFORTS);
|
|
1554
1568
|
var toMistralEffort = (effort) => clampReasoningEffort(effort, MISTRAL_REASONING_EFFORTS);
|
|
1555
1569
|
var toXaiEffort = (effort) => clampReasoningEffort(effort, XAI_REASONING_EFFORTS);
|
|
1570
|
+
var toKimiEffort = (effort) => clampReasoningEffort(effort, KIMI_REASONING_EFFORTS);
|
|
1556
1571
|
|
|
1557
1572
|
// src/pricing/token-usage-utils.ts
|
|
1558
1573
|
function extractTokenUsage(response) {
|
|
@@ -2327,6 +2342,17 @@ ${instruction}`);
|
|
|
2327
2342
|
apiKey
|
|
2328
2343
|
});
|
|
2329
2344
|
}
|
|
2345
|
+
/**
|
|
2346
|
+
* `reasoning: {effort}`, sent only when the catalog names a level. Every current OpenAI
|
|
2347
|
+
* model defaults to "medium" when the field is omitted — verified 2026-09-22 by calling
|
|
2348
|
+
* astra/sol/terra/luna with no reasoning param and reading the effort the API echoes back,
|
|
2349
|
+
* since OpenAI documents the default for Sol, Luna and the 5.6 family but not for Astra.
|
|
2350
|
+
* The catalog pins all four to medium so the level is explicit in our request rather than
|
|
2351
|
+
* inherited from a default OpenAI can change under us.
|
|
2352
|
+
*/
|
|
2353
|
+
reasoningParams() {
|
|
2354
|
+
return this.reasoningEffort ? { reasoning: { effort: toOpenAIEffort(this.reasoningEffort) } } : {};
|
|
2355
|
+
}
|
|
2330
2356
|
/**
|
|
2331
2357
|
* Structured output method using Zod with OpenAI's Responses API
|
|
2332
2358
|
* This provides better schema handling and runtime validation
|
|
@@ -2347,6 +2373,7 @@ ${instruction}`);
|
|
|
2347
2373
|
input,
|
|
2348
2374
|
max_output_tokens: this.maxOutputTokens,
|
|
2349
2375
|
prompt_cache_key: this.promptCacheKey,
|
|
2376
|
+
...this.reasoningParams(),
|
|
2350
2377
|
text: {
|
|
2351
2378
|
format: zodTextFormat(schemaToSend, "response_schema")
|
|
2352
2379
|
}
|
|
@@ -2431,7 +2458,8 @@ ${instruction}`);
|
|
|
2431
2458
|
instructions: this.instruction,
|
|
2432
2459
|
input,
|
|
2433
2460
|
max_output_tokens: this.maxOutputTokens,
|
|
2434
|
-
prompt_cache_key: this.promptCacheKey
|
|
2461
|
+
prompt_cache_key: this.promptCacheKey,
|
|
2462
|
+
...this.reasoningParams()
|
|
2435
2463
|
});
|
|
2436
2464
|
const content = response.output_text;
|
|
2437
2465
|
if (!content) {
|
|
@@ -3927,8 +3955,8 @@ var KimiAgent = class extends AbstractAgent {
|
|
|
3927
3955
|
model: this.model,
|
|
3928
3956
|
stream: false,
|
|
3929
3957
|
max_tokens: this.maxOutputTokens,
|
|
3930
|
-
//
|
|
3931
|
-
reasoning_effort: "max"
|
|
3958
|
+
// "max" is not in the OpenAI SDK's ReasoningEffort union, hence the cast.
|
|
3959
|
+
reasoning_effort: toKimiEffort(this.reasoningEffort ?? "max")
|
|
3932
3960
|
};
|
|
3933
3961
|
}
|
|
3934
3962
|
// Log message templates
|
|
@@ -5204,6 +5232,7 @@ export {
|
|
|
5204
5232
|
Gpt5Agent,
|
|
5205
5233
|
GrokAgent,
|
|
5206
5234
|
InMemorySpendStore,
|
|
5235
|
+
KIMI_REASONING_EFFORTS,
|
|
5207
5236
|
KimiAgent,
|
|
5208
5237
|
LLM_CONSTANTS,
|
|
5209
5238
|
MESSAGE_ROLE,
|
|
@@ -5310,6 +5339,7 @@ export {
|
|
|
5310
5339
|
toFuguEffort,
|
|
5311
5340
|
toGeminiEffort,
|
|
5312
5341
|
toGlmEffort,
|
|
5342
|
+
toKimiEffort,
|
|
5313
5343
|
toMetaEffort,
|
|
5314
5344
|
toMistralEffort,
|
|
5315
5345
|
toOpenAIEffort,
|