@agi-cli/sdk 0.1.142 → 0.1.143

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agi-cli/sdk",
3
- "version": "0.1.142",
3
+ "version": "0.1.143",
4
4
  "description": "AI agent SDK for building intelligent assistants - tree-shakable and comprehensive",
5
5
  "author": "nitishxyz",
6
6
  "license": "MIT",
@@ -32,6 +32,10 @@ const SETU_SOURCES: Array<{ id: ProviderId; npm: string }> = [
32
32
  id: 'anthropic',
33
33
  npm: '@ai-sdk/anthropic',
34
34
  },
35
+ {
36
+ id: 'moonshot',
37
+ npm: '@ai-sdk/openai-compatible',
38
+ },
35
39
  ];
36
40
 
37
41
  function cloneModel(model: ModelInfo): ModelInfo {
@@ -7,6 +7,7 @@ import { svm } from 'x402/shared';
7
7
  import nacl from 'tweetnacl';
8
8
  import { createOpenAI } from '@ai-sdk/openai';
9
9
  import { createAnthropic } from '@ai-sdk/anthropic';
10
+ import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
10
11
  import { addAnthropicCacheControl } from './anthropic-caching.ts';
11
12
 
12
13
  function simplifyPaymentError(errMsg: string): string {
@@ -245,6 +246,7 @@ export function createSetuFetch(
245
246
  * Uses native AI SDK providers:
246
247
  * - OpenAI models → /v1/responses (via @ai-sdk/openai)
247
248
  * - Anthropic models → /v1/messages (via @ai-sdk/anthropic)
249
+ * - Moonshot models → /v1/chat/completions (via @ai-sdk/openai-compatible)
248
250
  *
249
251
  * Provider is determined by options.providerNpm from catalog.
250
252
  */
@@ -268,6 +270,18 @@ export function createSetuModel(
268
270
  return anthropic(model);
269
271
  }
270
272
 
273
+ if (providerNpm === '@ai-sdk/openai-compatible') {
274
+ const compatible = createOpenAICompatible({
275
+ name: 'setu-moonshot',
276
+ baseURL,
277
+ headers: {
278
+ Authorization: 'Bearer setu-wallet-auth',
279
+ },
280
+ fetch: customFetch,
281
+ });
282
+ return compatible(model);
283
+ }
284
+
271
285
  // Default to OpenAI
272
286
  const openai = createOpenAI({
273
287
  baseURL,