@quantish/agent 0.1.10 → 0.1.12

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.
Files changed (2) hide show
  1. package/dist/index.js +57 -40
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ var schema = {
27
27
  },
28
28
  model: {
29
29
  type: "string",
30
- default: "claude-sonnet-4-20250514"
30
+ default: "claude-sonnet-4-5-20250929"
31
31
  }
32
32
  };
33
33
  var ConfigManager = class {
@@ -111,7 +111,7 @@ var ConfigManager = class {
111
111
  * Get the model to use
112
112
  */
113
113
  getModel() {
114
- return this.conf.get("model") ?? "claude-sonnet-4-20250514";
114
+ return this.conf.get("model") ?? "claude-sonnet-4-5-20250929";
115
115
  }
116
116
  /**
117
117
  * Set the model to use
@@ -2357,10 +2357,10 @@ async function compactConversation(anthropic, history, model, systemPrompt, tool
2357
2357
 
2358
2358
  // src/agent/pricing.ts
2359
2359
  var MODELS = {
2360
- "claude-opus-4-20250514": {
2361
- id: "claude-opus-4-20250514",
2362
- name: "opus-4",
2363
- displayName: "Claude Opus 4",
2360
+ "claude-opus-4-5-20251101": {
2361
+ id: "claude-opus-4-5-20251101",
2362
+ name: "opus-4.5",
2363
+ displayName: "Claude Opus 4.5",
2364
2364
  pricing: {
2365
2365
  inputPerMTok: 15,
2366
2366
  outputPerMTok: 75,
@@ -2372,10 +2372,10 @@ var MODELS = {
2372
2372
  contextWindow: 2e5,
2373
2373
  description: "Most capable model. Best for complex reasoning and creative tasks."
2374
2374
  },
2375
- "claude-sonnet-4-20250514": {
2376
- id: "claude-sonnet-4-20250514",
2377
- name: "sonnet-4",
2378
- displayName: "Claude Sonnet 4",
2375
+ "claude-sonnet-4-5-20250929": {
2376
+ id: "claude-sonnet-4-5-20250929",
2377
+ name: "sonnet-4.5",
2378
+ displayName: "Claude Sonnet 4.5",
2379
2379
  pricing: {
2380
2380
  inputPerMTok: 3,
2381
2381
  outputPerMTok: 15,
@@ -2387,30 +2387,30 @@ var MODELS = {
2387
2387
  contextWindow: 2e5,
2388
2388
  description: "Balanced performance and cost. Great for most coding and trading tasks."
2389
2389
  },
2390
- "claude-3-5-haiku-20241022": {
2391
- id: "claude-3-5-haiku-20241022",
2392
- name: "haiku-3.5",
2393
- displayName: "Claude Haiku 3.5",
2390
+ "claude-haiku-4-5-20251001": {
2391
+ id: "claude-haiku-4-5-20251001",
2392
+ name: "haiku-4.5",
2393
+ displayName: "Claude Haiku 4.5",
2394
2394
  pricing: {
2395
- inputPerMTok: 0.8,
2396
- outputPerMTok: 4,
2397
- cacheWritePerMTok: 1,
2395
+ inputPerMTok: 1,
2396
+ outputPerMTok: 5,
2397
+ cacheWritePerMTok: 1.25,
2398
2398
  // 1.25x input
2399
- cacheReadPerMTok: 0.08
2399
+ cacheReadPerMTok: 0.1
2400
2400
  // 0.1x input
2401
2401
  },
2402
2402
  contextWindow: 2e5,
2403
2403
  description: "Fastest and most economical. Good for simple tasks and high volume."
2404
2404
  }
2405
2405
  };
2406
- var DEFAULT_MODEL = "claude-sonnet-4-20250514";
2406
+ var DEFAULT_MODEL = "claude-sonnet-4-5-20250929";
2407
2407
  var MODEL_ALIASES = {
2408
- "opus": "claude-opus-4-20250514",
2409
- "opus-4": "claude-opus-4-20250514",
2410
- "sonnet": "claude-sonnet-4-20250514",
2411
- "sonnet-4": "claude-sonnet-4-20250514",
2412
- "haiku": "claude-3-5-haiku-20241022",
2413
- "haiku-3.5": "claude-3-5-haiku-20241022"
2408
+ "opus": "claude-opus-4-5-20251101",
2409
+ "opus-4.5": "claude-opus-4-5-20251101",
2410
+ "sonnet": "claude-sonnet-4-5-20250929",
2411
+ "sonnet-4.5": "claude-sonnet-4-5-20250929",
2412
+ "haiku": "claude-haiku-4-5-20251001",
2413
+ "haiku-4.5": "claude-haiku-4-5-20251001"
2414
2414
  };
2415
2415
  function resolveModelId(nameOrAlias) {
2416
2416
  const lower = nameOrAlias.toLowerCase();
@@ -2823,18 +2823,35 @@ Example flow:
2823
2823
  3. Extract tokenId for YES/NO outcome you want
2824
2824
  4. place_order({ conditionId, tokenId, side: "BUY", price: 0.55, size: 100 })
2825
2825
 
2826
- ### \u26A0\uFE0F CRITICAL: Market Search Behavior
2827
- When searching for markets:
2828
- 1. **ALWAYS look at the actual results** - Don't say "I don't see any" without checking
2829
- 2. **Be flexible with timeframes** - If user asks for "15 minute" market, use any similar short-term market (5min, 10min, 30min)
2830
- 3. **Show what IS available** - If exact match not found, show the user what markets ARE available
2831
- 4. **Extract and use the data** - The search returns clobTokenIds, conditionId, etc. - USE THEM
2832
- 5. **Parse the results properly** - Results are in data.result.content[0].text as JSON string
2826
+ ### \u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F EXTREMELY CRITICAL: Market Search Results - READ THEM! \u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F
2833
2827
 
2834
- The search results contain EVERYTHING needed:
2835
- - \`markets[].markets[].clobTokenIds\` - Parse this JSON string to get token IDs
2828
+ **YOU MUST READ AND USE SEARCH RESULTS. NEVER SAY "I DON'T SEE ANY" WHEN RESULTS ARE RETURNED.**
2829
+
2830
+ When search_markets returns \`"found": 10\` or any number > 0, there ARE markets. READ THEM.
2831
+
2832
+ Example: If user asks for "15 minute BTC up/down market" and search returns:
2833
+ \`\`\`
2834
+ "found": 10,
2835
+ "markets": [
2836
+ { "title": "Bitcoin Up or Down - December 28, 11:50PM-11:55PM ET", ... }
2837
+ ]
2838
+ \`\`\`
2839
+
2840
+ You MUST say: "I found a 5-minute BTC Up/Down market: 'Bitcoin Up or Down - December 28, 11:50PM-11:55PM ET'. This is similar to what you requested."
2841
+
2842
+ **NEVER** say "I don't see any 15-minute markets" when the search returned 10 results!
2843
+
2844
+ Rules:
2845
+ 1. **found > 0 means markets exist** - Read the titles and show them to the user
2846
+ 2. **Be flexible** - 5min/10min/15min/30min are ALL acceptable for "short-term" requests
2847
+ 3. **Use what's available** - Don't refuse to build because exact match isn't found
2848
+ 4. **Extract the data** - clobTokenIds, conditionId, title are all in the results
2849
+
2850
+ The search results contain:
2851
+ - \`markets[].title\` - TELLS YOU THE MARKET NAME AND TIMEFRAME
2852
+ - \`markets[].markets[].clobTokenIds\` - Parse this JSON string for token IDs
2836
2853
  - \`markets[].markets[].conditionId\` - The condition ID for orders
2837
- - \`markets[].title\` - Market title with timeframe info
2854
+ - \`markets[].markets[].outcomes[]\` - The Up/Down options with prices
2838
2855
 
2839
2856
  ### Bot Code Template (Node.js)
2840
2857
  \`\`\`javascript
@@ -3229,7 +3246,7 @@ var Agent = class {
3229
3246
  */
3230
3247
  async run(userMessage, options) {
3231
3248
  const maxIterations = this.config.maxIterations ?? 15;
3232
- const model = this.config.model ?? "claude-sonnet-4-20250514";
3249
+ const model = this.config.model ?? "claude-sonnet-4-5-20250929";
3233
3250
  const maxTokens = this.config.maxTokens ?? 8192;
3234
3251
  const systemPrompt = this.config.systemPrompt ?? DEFAULT_SYSTEM_PROMPT;
3235
3252
  const useStreaming = this.config.streaming ?? true;
@@ -3489,7 +3506,7 @@ ${userMessage}`;
3489
3506
  * Count tokens in current conversation (uses Anthropic's token counting API)
3490
3507
  */
3491
3508
  async countTokens() {
3492
- const model = this.config.model ?? "claude-sonnet-4-20250514";
3509
+ const model = this.config.model ?? "claude-sonnet-4-5-20250929";
3493
3510
  const systemPrompt = this.config.systemPrompt ?? DEFAULT_SYSTEM_PROMPT;
3494
3511
  const allTools = await this.getAllTools();
3495
3512
  try {
@@ -3560,7 +3577,7 @@ ${userMessage}`;
3560
3577
  * @returns Object with original/new token counts and the summary
3561
3578
  */
3562
3579
  async compactHistory() {
3563
- const model = this.config.model ?? "claude-sonnet-4-20250514";
3580
+ const model = this.config.model ?? "claude-sonnet-4-5-20250929";
3564
3581
  const systemPrompt = this.config.systemPrompt ?? DEFAULT_SYSTEM_PROMPT;
3565
3582
  const allTools = await this.getAllTools();
3566
3583
  if (this.conversationHistory.length < 2) {
@@ -4296,7 +4313,7 @@ program.command("config").description("View or edit configuration").option("-s,
4296
4313
  console.log(`QUANTISH_API_KEY=${all2.quantishApiKey}`);
4297
4314
  }
4298
4315
  console.log(`QUANTISH_MCP_URL=${all2.mcpServerUrl}`);
4299
- console.log(`QUANTISH_MODEL=${all2.model || "claude-sonnet-4-20250514"}`);
4316
+ console.log(`QUANTISH_MODEL=${all2.model || "claude-sonnet-4-5-20250929"}`);
4300
4317
  console.log();
4301
4318
  console.log(chalk3.dim("# Discovery MCP (public, read-only market data)"));
4302
4319
  console.log(`QUANTISH_DISCOVERY_URL=https://quantish.live/mcp`);
@@ -4317,7 +4334,7 @@ program.command("config").description("View or edit configuration").option("-s,
4317
4334
  tableRow("Quantish API Key", all.quantishApiKey ? `${all.quantishApiKey.slice(0, 12)}...` : chalk3.dim("Not set"));
4318
4335
  }
4319
4336
  tableRow("MCP Server URL", all.mcpServerUrl);
4320
- tableRow("Model", all.model || "claude-sonnet-4-20250514");
4337
+ tableRow("Model", all.model || "claude-sonnet-4-5-20250929");
4321
4338
  printDivider();
4322
4339
  console.log(chalk3.dim(`Config file: ${config.getConfigPath()}`));
4323
4340
  console.log();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantish/agent",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "AI-powered agent for building trading bots on Polymarket",
5
5
  "type": "module",
6
6
  "bin": {