indusagi 0.13.6 → 0.13.8
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/LICENSE +661 -0
- package/README.md +7 -1
- package/dist/cli.js +114 -14
- package/dist/index.js +1618 -51
- package/dist/llmgateway.js +114 -14
- package/dist/mcp.js +812 -3
- package/dist/runtime.js +114 -14
- package/dist/sarvam-mcp.js +960 -0
- package/dist/shell-app.js +116 -14
- package/dist/smithy.js +114 -14
- package/dist/swarm.js +114 -14
- package/dist/tracing.js +37 -0
- package/dist/types/connectors-sarvam/connect.d.ts +14 -0
- package/dist/types/connectors-sarvam/connectors-sarvam.test.d.ts +14 -0
- package/dist/types/connectors-sarvam/index.d.ts +14 -0
- package/dist/types/connectors-sarvam/toolbox.d.ts +19 -0
- package/dist/types/connectors-sarvam/types.d.ts +49 -0
- package/dist/types/connectors-zoho/connect.d.ts +22 -0
- package/dist/types/connectors-zoho/connectors-zoho.test.d.ts +10 -0
- package/dist/types/connectors-zoho/index.d.ts +13 -0
- package/dist/types/connectors-zoho/toolbox.d.ts +19 -0
- package/dist/types/connectors-zoho/types.d.ts +56 -0
- package/dist/types/facade/mcp-core/client.d.ts +32 -0
- package/dist/types/facade/mcp-core/index.d.ts +4 -0
- package/dist/types/facade/mcp-core/oauth/flow.d.ts +72 -0
- package/dist/types/facade/mcp-core/oauth/index.d.ts +18 -0
- package/dist/types/facade/mcp-core/oauth/oauth.test.d.ts +8 -0
- package/dist/types/facade/mcp-core/oauth/provider.d.ts +51 -0
- package/dist/types/facade/mcp-core/oauth/token-store.d.ts +31 -0
- package/dist/types/facade/mcp-core/oauth/types.d.ts +96 -0
- package/dist/types/facade/mcp-core/toolbox-bridge.d.ts +46 -0
- package/dist/types/facade/mcp-core/toolbox-bridge.test.d.ts +8 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/llmgateway/contract/model-card.d.ts +1 -1
- package/dist/types/llmgateway/credentials/secrets.d.ts +2 -0
- package/dist/zoho.js +1451 -0
- package/package.json +11 -4
- package/dist/knowledge/guides/authoring-an-agent.md +0 -53
- package/dist/knowledge/guides/choosing-tools.md +0 -49
- package/dist/knowledge/guides/model-selection.md +0 -51
- package/dist/knowledge/guides/writing-system-prompts.md +0 -53
- package/dist/knowledge/index.ts +0 -19
- package/dist/knowledge/loader.ts +0 -200
- package/dist/knowledge/manifest.json +0 -29
package/dist/runtime.js
CHANGED
|
@@ -237,6 +237,85 @@ var MODEL_CARDS = [
|
|
|
237
237
|
cacheReadPerMTok: 0.15
|
|
238
238
|
}
|
|
239
239
|
},
|
|
240
|
+
// ── MiniMax (Anthropic-compatible Messages API) ─────────────────────────
|
|
241
|
+
// Wire: same dialect as Claude (`anthropic-messages`) at api.minimax.io.
|
|
242
|
+
// Auth: MINIMAX_API_KEY. Ids match facade/models.generated.ts.
|
|
243
|
+
{
|
|
244
|
+
id: "MiniMax-M2",
|
|
245
|
+
provider: "minimax",
|
|
246
|
+
api: "anthropic-messages",
|
|
247
|
+
displayName: "MiniMax M2",
|
|
248
|
+
baseUrl: "https://api.minimax.io/anthropic",
|
|
249
|
+
contextWindow: 204800,
|
|
250
|
+
maxOutputTokens: 131072,
|
|
251
|
+
modalities: ["text"],
|
|
252
|
+
reasoning: true,
|
|
253
|
+
cost: {
|
|
254
|
+
inputPerMTok: 0.3,
|
|
255
|
+
outputPerMTok: 1.2
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
id: "MiniMax-M2.1",
|
|
260
|
+
provider: "minimax",
|
|
261
|
+
api: "anthropic-messages",
|
|
262
|
+
displayName: "MiniMax M2.1",
|
|
263
|
+
baseUrl: "https://api.minimax.io/anthropic",
|
|
264
|
+
contextWindow: 204800,
|
|
265
|
+
maxOutputTokens: 131072,
|
|
266
|
+
modalities: ["text"],
|
|
267
|
+
reasoning: true,
|
|
268
|
+
cost: {
|
|
269
|
+
inputPerMTok: 0.3,
|
|
270
|
+
outputPerMTok: 1.2
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
id: "MiniMax-M2.5",
|
|
275
|
+
provider: "minimax",
|
|
276
|
+
api: "anthropic-messages",
|
|
277
|
+
displayName: "MiniMax M2.5",
|
|
278
|
+
baseUrl: "https://api.minimax.io/anthropic",
|
|
279
|
+
contextWindow: 204800,
|
|
280
|
+
maxOutputTokens: 131072,
|
|
281
|
+
modalities: ["text"],
|
|
282
|
+
reasoning: true,
|
|
283
|
+
cost: {
|
|
284
|
+
inputPerMTok: 0.3,
|
|
285
|
+
outputPerMTok: 1.2
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
id: "MiniMax-M2.7",
|
|
290
|
+
provider: "minimax",
|
|
291
|
+
api: "anthropic-messages",
|
|
292
|
+
displayName: "MiniMax M2.7",
|
|
293
|
+
baseUrl: "https://api.minimax.io/anthropic",
|
|
294
|
+
contextWindow: 204800,
|
|
295
|
+
maxOutputTokens: 131072,
|
|
296
|
+
modalities: ["text"],
|
|
297
|
+
reasoning: true,
|
|
298
|
+
cost: {
|
|
299
|
+
inputPerMTok: 0.3,
|
|
300
|
+
outputPerMTok: 1.2
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
id: "MiniMax-M3",
|
|
305
|
+
provider: "minimax",
|
|
306
|
+
api: "anthropic-messages",
|
|
307
|
+
displayName: "MiniMax M3",
|
|
308
|
+
baseUrl: "https://api.minimax.io/anthropic",
|
|
309
|
+
contextWindow: 1048576,
|
|
310
|
+
maxOutputTokens: 512e3,
|
|
311
|
+
modalities: ["text", "image"],
|
|
312
|
+
reasoning: true,
|
|
313
|
+
cost: {
|
|
314
|
+
inputPerMTok: 0.6,
|
|
315
|
+
outputPerMTok: 2.4,
|
|
316
|
+
cacheReadPerMTok: 0.12
|
|
317
|
+
}
|
|
318
|
+
},
|
|
240
319
|
// ── Ollama (local; pricing is zero — your own hardware) ─────────────────
|
|
241
320
|
{
|
|
242
321
|
id: "llama3.1:8b",
|
|
@@ -342,6 +421,19 @@ var SECRET_TABLE = {
|
|
|
342
421
|
envVars: ["MOONSHOT_API_KEY", "KIMI_API_KEY"],
|
|
343
422
|
hint: "Moonshot AI (Kimi) API key."
|
|
344
423
|
},
|
|
424
|
+
minimax: {
|
|
425
|
+
provider: "minimax",
|
|
426
|
+
scheme: "api-key",
|
|
427
|
+
envVars: ["MINIMAX_API_KEY"],
|
|
428
|
+
hint: "MiniMax global API key (api.minimax.io Anthropic-compatible)."
|
|
429
|
+
},
|
|
430
|
+
"minimax-cn": {
|
|
431
|
+
provider: "minimax-cn",
|
|
432
|
+
scheme: "api-key",
|
|
433
|
+
// Same key often works for both; CN-specific override first when set.
|
|
434
|
+
envVars: ["MINIMAX_CN_API_KEY", "MINIMAX_API_KEY"],
|
|
435
|
+
hint: "MiniMax China API key (api.minimaxi.com Anthropic-compatible)."
|
|
436
|
+
},
|
|
345
437
|
ollama: {
|
|
346
438
|
provider: "ollama",
|
|
347
439
|
scheme: "none",
|
|
@@ -1182,7 +1274,7 @@ function endpointFor(model) {
|
|
|
1182
1274
|
const base = (model.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
1183
1275
|
return `${base}/v1/messages`;
|
|
1184
1276
|
}
|
|
1185
|
-
async function postMessages(url, apiKey, body, signal) {
|
|
1277
|
+
async function postMessages(url, apiKey, body, signal, provider = "anthropic") {
|
|
1186
1278
|
let response;
|
|
1187
1279
|
try {
|
|
1188
1280
|
response = await fetch(url, {
|
|
@@ -1197,24 +1289,24 @@ async function postMessages(url, apiKey, body, signal) {
|
|
|
1197
1289
|
});
|
|
1198
1290
|
} catch (cause) {
|
|
1199
1291
|
if (signal?.aborted) {
|
|
1200
|
-
throw gatewayError("aborted",
|
|
1201
|
-
provider
|
|
1292
|
+
throw gatewayError("aborted", `request canceled before ${provider} responded`, {
|
|
1293
|
+
provider,
|
|
1202
1294
|
cause
|
|
1203
1295
|
});
|
|
1204
1296
|
}
|
|
1205
|
-
throw gatewayError("transport",
|
|
1297
|
+
throw gatewayError("transport", `network call to ${provider} failed`, { provider, cause });
|
|
1206
1298
|
}
|
|
1207
1299
|
if (!response.ok) {
|
|
1208
1300
|
const detail = await readErrorBody(response);
|
|
1209
1301
|
const kind = response.status === 401 || response.status === 403 ? "auth" : response.status === 429 ? "rate_limit" : "http";
|
|
1210
|
-
throw gatewayError(kind,
|
|
1211
|
-
provider
|
|
1302
|
+
throw gatewayError(kind, `${provider} returned HTTP ${response.status}${detail}`, {
|
|
1303
|
+
provider,
|
|
1212
1304
|
status: response.status
|
|
1213
1305
|
});
|
|
1214
1306
|
}
|
|
1215
1307
|
if (response.body === null) {
|
|
1216
|
-
throw gatewayError("transport",
|
|
1217
|
-
provider
|
|
1308
|
+
throw gatewayError("transport", `${provider} response arrived with no body`, {
|
|
1309
|
+
provider,
|
|
1218
1310
|
status: response.status
|
|
1219
1311
|
});
|
|
1220
1312
|
}
|
|
@@ -1236,11 +1328,13 @@ function asGatewayError(cause) {
|
|
|
1236
1328
|
}
|
|
1237
1329
|
function createanthropicConnector(deps2) {
|
|
1238
1330
|
const api = "anthropic-messages";
|
|
1239
|
-
async function requireKey(options) {
|
|
1240
|
-
const
|
|
1331
|
+
async function requireKey(model, options) {
|
|
1332
|
+
const provider = model.provider;
|
|
1333
|
+
const key = await deps2.resolveSecret(provider, options.apiKey);
|
|
1241
1334
|
if (key === void 0 || key === "") {
|
|
1242
|
-
|
|
1243
|
-
|
|
1335
|
+
const hint = provider === "minimax" || provider === "minimax-cn" ? "set MINIMAX_API_KEY (or MINIMAX_CN_API_KEY for CN) or pass options.apiKey" : "set ANTHROPIC_API_KEY or pass options.apiKey";
|
|
1336
|
+
throw gatewayError("auth", `no API key found for provider "${provider}" (${hint})`, {
|
|
1337
|
+
provider
|
|
1244
1338
|
});
|
|
1245
1339
|
}
|
|
1246
1340
|
return key;
|
|
@@ -1249,10 +1343,16 @@ function createanthropicConnector(deps2) {
|
|
|
1249
1343
|
return channelOf(async function* run() {
|
|
1250
1344
|
const collected = [];
|
|
1251
1345
|
try {
|
|
1252
|
-
const apiKey = await requireKey(options);
|
|
1346
|
+
const apiKey = await requireKey(model, options);
|
|
1253
1347
|
const body = toAnthropicRequest(conversation, model, options);
|
|
1254
1348
|
body.stream = true;
|
|
1255
|
-
const response = await postMessages(
|
|
1349
|
+
const response = await postMessages(
|
|
1350
|
+
endpointFor(model),
|
|
1351
|
+
apiKey,
|
|
1352
|
+
body,
|
|
1353
|
+
options.signal,
|
|
1354
|
+
model.provider
|
|
1355
|
+
);
|
|
1256
1356
|
const wire = response.body;
|
|
1257
1357
|
const state = { toolIds: /* @__PURE__ */ new Map(), usage: { inputTokens: 0, outputTokens: 0 } };
|
|
1258
1358
|
for await (const event of sseEvents(wire, options.signal)) {
|