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/cli.js
CHANGED
|
@@ -478,6 +478,85 @@ var MODEL_CARDS = [
|
|
|
478
478
|
cacheReadPerMTok: 0.15
|
|
479
479
|
}
|
|
480
480
|
},
|
|
481
|
+
// ── MiniMax (Anthropic-compatible Messages API) ─────────────────────────
|
|
482
|
+
// Wire: same dialect as Claude (`anthropic-messages`) at api.minimax.io.
|
|
483
|
+
// Auth: MINIMAX_API_KEY. Ids match facade/models.generated.ts.
|
|
484
|
+
{
|
|
485
|
+
id: "MiniMax-M2",
|
|
486
|
+
provider: "minimax",
|
|
487
|
+
api: "anthropic-messages",
|
|
488
|
+
displayName: "MiniMax M2",
|
|
489
|
+
baseUrl: "https://api.minimax.io/anthropic",
|
|
490
|
+
contextWindow: 204800,
|
|
491
|
+
maxOutputTokens: 131072,
|
|
492
|
+
modalities: ["text"],
|
|
493
|
+
reasoning: true,
|
|
494
|
+
cost: {
|
|
495
|
+
inputPerMTok: 0.3,
|
|
496
|
+
outputPerMTok: 1.2
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
id: "MiniMax-M2.1",
|
|
501
|
+
provider: "minimax",
|
|
502
|
+
api: "anthropic-messages",
|
|
503
|
+
displayName: "MiniMax M2.1",
|
|
504
|
+
baseUrl: "https://api.minimax.io/anthropic",
|
|
505
|
+
contextWindow: 204800,
|
|
506
|
+
maxOutputTokens: 131072,
|
|
507
|
+
modalities: ["text"],
|
|
508
|
+
reasoning: true,
|
|
509
|
+
cost: {
|
|
510
|
+
inputPerMTok: 0.3,
|
|
511
|
+
outputPerMTok: 1.2
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
id: "MiniMax-M2.5",
|
|
516
|
+
provider: "minimax",
|
|
517
|
+
api: "anthropic-messages",
|
|
518
|
+
displayName: "MiniMax M2.5",
|
|
519
|
+
baseUrl: "https://api.minimax.io/anthropic",
|
|
520
|
+
contextWindow: 204800,
|
|
521
|
+
maxOutputTokens: 131072,
|
|
522
|
+
modalities: ["text"],
|
|
523
|
+
reasoning: true,
|
|
524
|
+
cost: {
|
|
525
|
+
inputPerMTok: 0.3,
|
|
526
|
+
outputPerMTok: 1.2
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
id: "MiniMax-M2.7",
|
|
531
|
+
provider: "minimax",
|
|
532
|
+
api: "anthropic-messages",
|
|
533
|
+
displayName: "MiniMax M2.7",
|
|
534
|
+
baseUrl: "https://api.minimax.io/anthropic",
|
|
535
|
+
contextWindow: 204800,
|
|
536
|
+
maxOutputTokens: 131072,
|
|
537
|
+
modalities: ["text"],
|
|
538
|
+
reasoning: true,
|
|
539
|
+
cost: {
|
|
540
|
+
inputPerMTok: 0.3,
|
|
541
|
+
outputPerMTok: 1.2
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
id: "MiniMax-M3",
|
|
546
|
+
provider: "minimax",
|
|
547
|
+
api: "anthropic-messages",
|
|
548
|
+
displayName: "MiniMax M3",
|
|
549
|
+
baseUrl: "https://api.minimax.io/anthropic",
|
|
550
|
+
contextWindow: 1048576,
|
|
551
|
+
maxOutputTokens: 512e3,
|
|
552
|
+
modalities: ["text", "image"],
|
|
553
|
+
reasoning: true,
|
|
554
|
+
cost: {
|
|
555
|
+
inputPerMTok: 0.6,
|
|
556
|
+
outputPerMTok: 2.4,
|
|
557
|
+
cacheReadPerMTok: 0.12
|
|
558
|
+
}
|
|
559
|
+
},
|
|
481
560
|
// ── Ollama (local; pricing is zero — your own hardware) ─────────────────
|
|
482
561
|
{
|
|
483
562
|
id: "llama3.1:8b",
|
|
@@ -599,6 +678,19 @@ var SECRET_TABLE = {
|
|
|
599
678
|
envVars: ["MOONSHOT_API_KEY", "KIMI_API_KEY"],
|
|
600
679
|
hint: "Moonshot AI (Kimi) API key."
|
|
601
680
|
},
|
|
681
|
+
minimax: {
|
|
682
|
+
provider: "minimax",
|
|
683
|
+
scheme: "api-key",
|
|
684
|
+
envVars: ["MINIMAX_API_KEY"],
|
|
685
|
+
hint: "MiniMax global API key (api.minimax.io Anthropic-compatible)."
|
|
686
|
+
},
|
|
687
|
+
"minimax-cn": {
|
|
688
|
+
provider: "minimax-cn",
|
|
689
|
+
scheme: "api-key",
|
|
690
|
+
// Same key often works for both; CN-specific override first when set.
|
|
691
|
+
envVars: ["MINIMAX_CN_API_KEY", "MINIMAX_API_KEY"],
|
|
692
|
+
hint: "MiniMax China API key (api.minimaxi.com Anthropic-compatible)."
|
|
693
|
+
},
|
|
602
694
|
ollama: {
|
|
603
695
|
provider: "ollama",
|
|
604
696
|
scheme: "none",
|
|
@@ -1439,7 +1531,7 @@ function endpointFor(model) {
|
|
|
1439
1531
|
const base = (model.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
1440
1532
|
return `${base}/v1/messages`;
|
|
1441
1533
|
}
|
|
1442
|
-
async function postMessages(url, apiKey, body, signal) {
|
|
1534
|
+
async function postMessages(url, apiKey, body, signal, provider = "anthropic") {
|
|
1443
1535
|
let response;
|
|
1444
1536
|
try {
|
|
1445
1537
|
response = await fetch(url, {
|
|
@@ -1454,24 +1546,24 @@ async function postMessages(url, apiKey, body, signal) {
|
|
|
1454
1546
|
});
|
|
1455
1547
|
} catch (cause) {
|
|
1456
1548
|
if (signal?.aborted) {
|
|
1457
|
-
throw gatewayError("aborted",
|
|
1458
|
-
provider
|
|
1549
|
+
throw gatewayError("aborted", `request canceled before ${provider} responded`, {
|
|
1550
|
+
provider,
|
|
1459
1551
|
cause
|
|
1460
1552
|
});
|
|
1461
1553
|
}
|
|
1462
|
-
throw gatewayError("transport",
|
|
1554
|
+
throw gatewayError("transport", `network call to ${provider} failed`, { provider, cause });
|
|
1463
1555
|
}
|
|
1464
1556
|
if (!response.ok) {
|
|
1465
1557
|
const detail = await readErrorBody(response);
|
|
1466
1558
|
const kind = response.status === 401 || response.status === 403 ? "auth" : response.status === 429 ? "rate_limit" : "http";
|
|
1467
|
-
throw gatewayError(kind,
|
|
1468
|
-
provider
|
|
1559
|
+
throw gatewayError(kind, `${provider} returned HTTP ${response.status}${detail}`, {
|
|
1560
|
+
provider,
|
|
1469
1561
|
status: response.status
|
|
1470
1562
|
});
|
|
1471
1563
|
}
|
|
1472
1564
|
if (response.body === null) {
|
|
1473
|
-
throw gatewayError("transport",
|
|
1474
|
-
provider
|
|
1565
|
+
throw gatewayError("transport", `${provider} response arrived with no body`, {
|
|
1566
|
+
provider,
|
|
1475
1567
|
status: response.status
|
|
1476
1568
|
});
|
|
1477
1569
|
}
|
|
@@ -1493,11 +1585,13 @@ function asGatewayError(cause) {
|
|
|
1493
1585
|
}
|
|
1494
1586
|
function createanthropicConnector(deps2) {
|
|
1495
1587
|
const api = "anthropic-messages";
|
|
1496
|
-
async function requireKey(options) {
|
|
1497
|
-
const
|
|
1588
|
+
async function requireKey(model, options) {
|
|
1589
|
+
const provider = model.provider;
|
|
1590
|
+
const key = await deps2.resolveSecret(provider, options.apiKey);
|
|
1498
1591
|
if (key === void 0 || key === "") {
|
|
1499
|
-
|
|
1500
|
-
|
|
1592
|
+
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";
|
|
1593
|
+
throw gatewayError("auth", `no API key found for provider "${provider}" (${hint})`, {
|
|
1594
|
+
provider
|
|
1501
1595
|
});
|
|
1502
1596
|
}
|
|
1503
1597
|
return key;
|
|
@@ -1506,10 +1600,16 @@ function createanthropicConnector(deps2) {
|
|
|
1506
1600
|
return channelOf(async function* run2() {
|
|
1507
1601
|
const collected = [];
|
|
1508
1602
|
try {
|
|
1509
|
-
const apiKey = await requireKey(options);
|
|
1603
|
+
const apiKey = await requireKey(model, options);
|
|
1510
1604
|
const body = toAnthropicRequest(conversation, model, options);
|
|
1511
1605
|
body.stream = true;
|
|
1512
|
-
const response = await postMessages(
|
|
1606
|
+
const response = await postMessages(
|
|
1607
|
+
endpointFor(model),
|
|
1608
|
+
apiKey,
|
|
1609
|
+
body,
|
|
1610
|
+
options.signal,
|
|
1611
|
+
model.provider
|
|
1612
|
+
);
|
|
1513
1613
|
const wire = response.body;
|
|
1514
1614
|
const state = { toolIds: /* @__PURE__ */ new Map(), usage: { inputTokens: 0, outputTokens: 0 } };
|
|
1515
1615
|
for await (const event of sseEvents(wire, options.signal)) {
|