@hiper2d/ai-agents 0.1.3 → 0.1.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/dist/index.mjs CHANGED
@@ -787,6 +787,7 @@ var LLM_CONSTANTS = {
787
787
  DEEPSEEK_PRO: "deepseek-pro",
788
788
  // GPT-5.6 family. 'gpt' and 'gpt-mini' are stable picker ids carried over from the
789
789
  // GPT-5.5 / GPT-5.4-mini era so existing consumers keep working across the repoint.
790
+ GPT_ASTRA: "gpt-astra",
790
791
  GPT_SOL: "gpt-sol",
791
792
  GPT: "gpt",
792
793
  GPT_MINI: "gpt-mini",
@@ -871,6 +872,17 @@ var SupportedAiModels = {
871
872
  tags: ["cheap"]
872
873
  },
873
874
  // Models with always-on reasoning
875
+ // GPT-6 Astra (2026-09-03): OpenAI's frontier tier above Sol. No `none` reasoning effort;
876
+ // temperature/top_p are rejected — Gpt5Agent sends neither, so the same agent serves it.
877
+ // The catalog temperature is only carried for the agent constructor signature.
878
+ [LLM_CONSTANTS.GPT_ASTRA]: {
879
+ displayName: "GPT-6 Astra",
880
+ modelApiName: "gpt-6-astra",
881
+ apiKeyName: API_KEY_CONSTANTS.OPENAI,
882
+ hasThinking: true,
883
+ temperature: 1,
884
+ tags: ["expensive"]
885
+ },
874
886
  // GPT-5.6 family (promoted July 2026 when the limited preview opened up):
875
887
  // sol is the flagship, terra the mainline, luna the cheap tier.
876
888
  [LLM_CONSTANTS.GPT_SOL]: {
@@ -1142,6 +1154,19 @@ var DEEPSEEK_PEAK_SCHEDULE = {
1142
1154
  weekendOffPeak: { utcOffsetHours: 8 }
1143
1155
  };
1144
1156
  var MODEL_PRICING = {
1157
+ // OpenAI GPT-6 Astra (developers.openai.com/api/docs/pricing, 2026-09-03): $10/$50 cache-hit $1
1158
+ // short context, $20/$75 cache-hit $2 long context. OpenAI's pricing table doesn't restate
1159
+ // the boundary; we assume the same 272k threshold as the GPT-5.6 siblings. Cache writes
1160
+ // ($12.50/$25) are not modelled — caching is automatic and we only see hits.
1161
+ [SupportedAiModels[LLM_CONSTANTS.GPT_ASTRA].modelApiName]: {
1162
+ inputPrice: 10,
1163
+ outputPrice: 50,
1164
+ cacheHitPrice: 1,
1165
+ extendedContextInputPrice: 20,
1166
+ extendedContextOutputPrice: 75,
1167
+ extendedContextCacheHitPrice: 2,
1168
+ extendedContextThresholdTokens: 272e3
1169
+ },
1145
1170
  // OpenAI GPT-5.6 models
1146
1171
  // Sol repriced 2026-08-30 (developers.openai.com/api/docs/pricing): $4/$20 short context,
1147
1172
  // $8/$30 past the long-context threshold — the same 272k boundary its siblings use.
@@ -1740,7 +1765,6 @@ ${msg.content}` };
1740
1765
 
1741
1766
  // src/agents/gpt-5-agent.ts
1742
1767
  import OpenAI from "openai";
1743
- import { z as z2 } from "zod";
1744
1768
  import { zodTextFormat } from "openai/helpers/zod";
1745
1769
  var Gpt5Agent = class extends AbstractAgent {
1746
1770
  client;
@@ -1774,12 +1798,7 @@ var Gpt5Agent = class extends AbstractAgent {
1774
1798
  `System: ${this.instruction}`,
1775
1799
  ...this.prepareMessages(messages).map((msg) => `${msg.role === "user" ? "User" : "Assistant"}: ${msg.content}`)
1776
1800
  ].join("\n\n");
1777
- let schemaToSend = zodSchema;
1778
- if (this.enableThinking && zodSchema instanceof z2.ZodObject) {
1779
- schemaToSend = zodSchema.extend({
1780
- thinking: z2.string().describe("Your internal chain-of-thought reasoning process used to arrive at the final answer.")
1781
- });
1782
- }
1801
+ const schemaToSend = zodSchema;
1783
1802
  let response;
1784
1803
  try {
1785
1804
  response = await this.client.responses.parse({
@@ -4258,6 +4277,7 @@ var AgentFactory = class {
4258
4277
  case LLM_CONSTANTS.CLAUDE_HAIKU:
4259
4278
  return new ClaudeAgent(name, instruction, model.modelApiName, key, shouldEnableThinking);
4260
4279
  // Always-on reasoning models
4280
+ case LLM_CONSTANTS.GPT_ASTRA:
4261
4281
  case LLM_CONSTANTS.GPT_SOL:
4262
4282
  case LLM_CONSTANTS.GPT:
4263
4283
  case LLM_CONSTANTS.GPT_MINI: