@hiper2d/ai-agents 0.12.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.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"]
@@ -2333,6 +2342,17 @@ ${instruction}`);
2333
2342
  apiKey
2334
2343
  });
2335
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
+ }
2336
2356
  /**
2337
2357
  * Structured output method using Zod with OpenAI's Responses API
2338
2358
  * This provides better schema handling and runtime validation
@@ -2353,6 +2373,7 @@ ${instruction}`);
2353
2373
  input,
2354
2374
  max_output_tokens: this.maxOutputTokens,
2355
2375
  prompt_cache_key: this.promptCacheKey,
2376
+ ...this.reasoningParams(),
2356
2377
  text: {
2357
2378
  format: zodTextFormat(schemaToSend, "response_schema")
2358
2379
  }
@@ -2437,7 +2458,8 @@ ${instruction}`);
2437
2458
  instructions: this.instruction,
2438
2459
  input,
2439
2460
  max_output_tokens: this.maxOutputTokens,
2440
- prompt_cache_key: this.promptCacheKey
2461
+ prompt_cache_key: this.promptCacheKey,
2462
+ ...this.reasoningParams()
2441
2463
  });
2442
2464
  const content = response.output_text;
2443
2465
  if (!content) {