@mantyx/sdk 2026.10.3 → 2026.11.2
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/CHANGELOG.md +4 -0
- package/dist/a2a-server.cjs +2 -0
- package/dist/a2a-server.d.ts +2 -0
- package/dist/a2a-server.js +3 -1
- package/dist/{chunk-ZGBSE23M.js → chunk-RT44KYDO.js} +19 -0
- package/dist/client.d.ts +52 -0
- package/dist/decisions.d.ts +106 -0
- package/dist/index.cjs +20 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -2
- package/dist/version.d.ts +1 -1
- package/docs/agent-runs-protocol.md +72 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,10 @@ and new releases use calendar versions (`YYYY.M.RELEASE`). Historical versions r
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
### Decisions
|
|
9
|
+
|
|
10
|
+
- Add inline decision execution, decision-model discovery, and execution history APIs.
|
|
11
|
+
|
|
8
12
|
### Added
|
|
9
13
|
|
|
10
14
|
- Configure a fallback model for ephemeral runs and sessions. MANTYX preserves
|
package/dist/a2a-server.cjs
CHANGED
|
@@ -323,6 +323,7 @@ function specForRun(spec) {
|
|
|
323
323
|
if (spec.systemPrompt) out.systemPrompt = spec.systemPrompt;
|
|
324
324
|
if (spec.modelId) out.modelId = spec.modelId;
|
|
325
325
|
if (spec.tools) out.tools = spec.tools;
|
|
326
|
+
if (spec.openRouterProvider !== void 0) out.openRouterProvider = spec.openRouterProvider;
|
|
326
327
|
if (spec.reasoningLevel !== void 0) out.reasoningLevel = spec.reasoningLevel;
|
|
327
328
|
if (spec.outputSchema !== void 0) out.outputSchema = spec.outputSchema;
|
|
328
329
|
if (spec.metadata) out.metadata = spec.metadata;
|
|
@@ -336,6 +337,7 @@ function specForSession(spec, contextId) {
|
|
|
336
337
|
if (spec.systemPrompt) out.systemPrompt = spec.systemPrompt;
|
|
337
338
|
if (spec.modelId) out.modelId = spec.modelId;
|
|
338
339
|
if (spec.tools) out.tools = spec.tools;
|
|
340
|
+
if (spec.openRouterProvider !== void 0) out.openRouterProvider = spec.openRouterProvider;
|
|
339
341
|
if (spec.reasoningLevel !== void 0) out.reasoningLevel = spec.reasoningLevel;
|
|
340
342
|
if (spec.outputSchema !== void 0) out.outputSchema = spec.outputSchema;
|
|
341
343
|
const meta = { ...spec.metadata ?? {} };
|
package/dist/a2a-server.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { OpenRouterProviderPreferences } from "./client.js";
|
|
1
2
|
/**
|
|
2
3
|
* Expose a MANTYX agent over the [Agent2Agent (A2A)](https://google-a2a.github.io/A2A/)
|
|
3
4
|
* protocol so other agents can talk to it as a peer.
|
|
@@ -59,6 +60,7 @@ export interface MantyxAgentSpec {
|
|
|
59
60
|
modelId?: string;
|
|
60
61
|
tools?: ToolRef[];
|
|
61
62
|
reasoningLevel?: ReasoningLevel;
|
|
63
|
+
openRouterProvider?: OpenRouterProviderPreferences;
|
|
62
64
|
/**
|
|
63
65
|
* Constrains the model's final assistant text to a JSON document matching
|
|
64
66
|
* a JSON Schema (or Zod schema, auto-converted). See
|
package/dist/a2a-server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MantyxError,
|
|
3
3
|
MantyxRunError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RT44KYDO.js";
|
|
5
5
|
|
|
6
6
|
// src/a2a-server.ts
|
|
7
7
|
import {
|
|
@@ -239,6 +239,7 @@ function specForRun(spec) {
|
|
|
239
239
|
if (spec.systemPrompt) out.systemPrompt = spec.systemPrompt;
|
|
240
240
|
if (spec.modelId) out.modelId = spec.modelId;
|
|
241
241
|
if (spec.tools) out.tools = spec.tools;
|
|
242
|
+
if (spec.openRouterProvider !== void 0) out.openRouterProvider = spec.openRouterProvider;
|
|
242
243
|
if (spec.reasoningLevel !== void 0) out.reasoningLevel = spec.reasoningLevel;
|
|
243
244
|
if (spec.outputSchema !== void 0) out.outputSchema = spec.outputSchema;
|
|
244
245
|
if (spec.metadata) out.metadata = spec.metadata;
|
|
@@ -252,6 +253,7 @@ function specForSession(spec, contextId) {
|
|
|
252
253
|
if (spec.systemPrompt) out.systemPrompt = spec.systemPrompt;
|
|
253
254
|
if (spec.modelId) out.modelId = spec.modelId;
|
|
254
255
|
if (spec.tools) out.tools = spec.tools;
|
|
256
|
+
if (spec.openRouterProvider !== void 0) out.openRouterProvider = spec.openRouterProvider;
|
|
255
257
|
if (spec.reasoningLevel !== void 0) out.reasoningLevel = spec.reasoningLevel;
|
|
256
258
|
if (spec.outputSchema !== void 0) out.outputSchema = spec.outputSchema;
|
|
257
259
|
const meta = { ...spec.metadata ?? {} };
|
|
@@ -742,6 +742,23 @@ var MantyxClient = class {
|
|
|
742
742
|
};
|
|
743
743
|
}
|
|
744
744
|
// -------------------------------------------------------------- Models
|
|
745
|
+
/** List decision-capable models and exact workspace connection ids. */
|
|
746
|
+
async listDecisionModels() {
|
|
747
|
+
return this.request({ method: "GET", path: "/decisions/models" });
|
|
748
|
+
}
|
|
749
|
+
/** Evaluate inline questions. No chat session or saved definition is created. */
|
|
750
|
+
async runDecision(spec) {
|
|
751
|
+
return this.request({ method: "POST", path: "/decisions", body: spec });
|
|
752
|
+
}
|
|
753
|
+
async listDecisionRuns(options = {}) {
|
|
754
|
+
return this.request({ method: "GET", path: "/decisions/runs", query: options });
|
|
755
|
+
}
|
|
756
|
+
async getDecisionRun(runId) {
|
|
757
|
+
return this.request({ method: "GET", path: `/decisions/runs/${encodeURIComponent(runId)}` });
|
|
758
|
+
}
|
|
759
|
+
async deleteDecisionRun(runId) {
|
|
760
|
+
return this.request({ method: "DELETE", path: `/decisions/runs/${encodeURIComponent(runId)}` });
|
|
761
|
+
}
|
|
745
762
|
async listModels() {
|
|
746
763
|
return this.request({
|
|
747
764
|
method: "GET",
|
|
@@ -1427,6 +1444,7 @@ var AgentSession = class {
|
|
|
1427
1444
|
}
|
|
1428
1445
|
if (this.tools.length > 0) body.tools = serializeToolRefs(this.tools);
|
|
1429
1446
|
if (opts.metadata && Object.keys(opts.metadata).length > 0) body.metadata = opts.metadata;
|
|
1447
|
+
if (opts.openRouterProvider !== void 0) body.openRouterProvider = opts.openRouterProvider;
|
|
1430
1448
|
if (opts.reasoningLevel !== void 0) {
|
|
1431
1449
|
body.reasoningLevel = normalizeReasoningLevel(opts.reasoningLevel);
|
|
1432
1450
|
}
|
|
@@ -1513,6 +1531,7 @@ function serializeAgentSpec(spec, extra = {}) {
|
|
|
1513
1531
|
if (spec.name) body.name = spec.name;
|
|
1514
1532
|
if (spec.modelId) body.modelId = spec.modelId;
|
|
1515
1533
|
if (spec.fallbackModelId) body.fallbackModelId = spec.fallbackModelId;
|
|
1534
|
+
if (spec.openRouterProvider !== void 0) body.openRouterProvider = spec.openRouterProvider;
|
|
1516
1535
|
if (spec.reasoningLevel !== void 0) {
|
|
1517
1536
|
body.reasoningLevel = normalizeReasoningLevel(spec.reasoningLevel);
|
|
1518
1537
|
}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
/** OpenRouter provider-routing wire preferences (snake_case). */
|
|
2
|
+
export interface OpenRouterProviderPreferences {
|
|
3
|
+
order?: string[] | null;
|
|
4
|
+
allow_fallbacks?: boolean | null;
|
|
5
|
+
require_parameters?: boolean | null;
|
|
6
|
+
data_collection?: "allow" | "deny" | null;
|
|
7
|
+
zdr?: boolean | null;
|
|
8
|
+
enforce_distillable_text?: boolean | null;
|
|
9
|
+
only?: string[] | null;
|
|
10
|
+
ignore?: string[] | null;
|
|
11
|
+
quantizations?: ("int4" | "int8" | "fp4" | "mxfp4" | "nvfp4" | "fp6" | "fp8" | "mxfp8" | "fp16" | "bf16" | "fp32" | "unknown")[] | null;
|
|
12
|
+
sort?: "price" | "throughput" | "latency" | "exacto" | {
|
|
13
|
+
by?: "price" | "throughput" | "latency" | "exacto" | null;
|
|
14
|
+
partition?: "model" | "none" | null;
|
|
15
|
+
} | null;
|
|
16
|
+
preferred_min_throughput?: number | {
|
|
17
|
+
p50?: number;
|
|
18
|
+
p75?: number;
|
|
19
|
+
p90?: number;
|
|
20
|
+
p99?: number;
|
|
21
|
+
} | null;
|
|
22
|
+
preferred_max_latency?: number | {
|
|
23
|
+
p50?: number;
|
|
24
|
+
p75?: number;
|
|
25
|
+
p90?: number;
|
|
26
|
+
p99?: number;
|
|
27
|
+
} | null;
|
|
28
|
+
max_price?: {
|
|
29
|
+
prompt?: number | string;
|
|
30
|
+
completion?: number | string;
|
|
31
|
+
image?: number | string;
|
|
32
|
+
audio?: number | string;
|
|
33
|
+
request?: number | string;
|
|
34
|
+
} | null;
|
|
35
|
+
}
|
|
1
36
|
import type { TokenSource } from "./oauth.js";
|
|
2
37
|
import type { OutputSchemaEnforcement, StructuredOutputInfo } from "./structured-output.js";
|
|
3
38
|
import type { LocalA2ATool, LocalMcpServer, LocalTool, LocalToolSchemaInput, ReasoningLevel, ToolRef, ToolResultFile } from "./tools.js";
|
|
@@ -354,6 +389,7 @@ export interface AgentSpecBase {
|
|
|
354
389
|
* overrides on `session.send` apply to that single run.
|
|
355
390
|
*/
|
|
356
391
|
reasoningLevel?: ReasoningLevel;
|
|
392
|
+
openRouterProvider?: OpenRouterProviderPreferences;
|
|
357
393
|
budgets?: {
|
|
358
394
|
maxToolTurns?: number;
|
|
359
395
|
};
|
|
@@ -1107,6 +1143,19 @@ export declare class MantyxClient {
|
|
|
1107
1143
|
tokenSource: TokenSource | null;
|
|
1108
1144
|
};
|
|
1109
1145
|
constructor(opts: MantyxClientOptions);
|
|
1146
|
+
/** List decision-capable models and exact workspace connection ids. */
|
|
1147
|
+
listDecisionModels(): Promise<{
|
|
1148
|
+
models: import("./decisions.js").DecisionModelInfo[];
|
|
1149
|
+
}>;
|
|
1150
|
+
/** Evaluate inline questions. No chat session or saved definition is created. */
|
|
1151
|
+
runDecision(spec: import("./decisions.js").DecisionRequest): Promise<import("./decisions.js").DecisionResult>;
|
|
1152
|
+
listDecisionRuns(options?: {
|
|
1153
|
+
limit?: number;
|
|
1154
|
+
cursor?: string;
|
|
1155
|
+
status?: "running" | "completed" | "failed";
|
|
1156
|
+
}): Promise<import("./decisions.js").DecisionRunList>;
|
|
1157
|
+
getDecisionRun(runId: string): Promise<import("./decisions.js").DecisionRunDetail>;
|
|
1158
|
+
deleteDecisionRun(runId: string): Promise<void>;
|
|
1110
1159
|
listModels(): Promise<ModelCatalog>;
|
|
1111
1160
|
runAgent(spec: RunSpec): Promise<RunResult>;
|
|
1112
1161
|
/**
|
|
@@ -1270,6 +1319,7 @@ export declare class AgentSession {
|
|
|
1270
1319
|
* and does not mutate the session's stored value.
|
|
1271
1320
|
*/
|
|
1272
1321
|
reasoningLevel?: ReasoningLevel;
|
|
1322
|
+
openRouterProvider?: OpenRouterProviderPreferences;
|
|
1273
1323
|
/**
|
|
1274
1324
|
* Per-message override for `outputSchema`. Applies only to this run
|
|
1275
1325
|
* and does not mutate the session's stored value.
|
|
@@ -1303,6 +1353,7 @@ export declare class AgentSession {
|
|
|
1303
1353
|
attachments?: MessageAttachment[];
|
|
1304
1354
|
metadata?: Record<string, string>;
|
|
1305
1355
|
reasoningLevel?: ReasoningLevel;
|
|
1356
|
+
openRouterProvider?: OpenRouterProviderPreferences;
|
|
1306
1357
|
outputSchema?: OutputSchema;
|
|
1307
1358
|
loopDetection?: LoopDetection | false;
|
|
1308
1359
|
toolBudgets?: ToolBudgets;
|
|
@@ -1318,6 +1369,7 @@ export declare class AgentSession {
|
|
|
1318
1369
|
signal?: AbortSignal;
|
|
1319
1370
|
metadata?: Record<string, string>;
|
|
1320
1371
|
reasoningLevel?: ReasoningLevel;
|
|
1372
|
+
openRouterProvider?: OpenRouterProviderPreferences;
|
|
1321
1373
|
outputSchema?: OutputSchema;
|
|
1322
1374
|
loopDetection?: LoopDetection | false;
|
|
1323
1375
|
toolBudgets?: ToolBudgets;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/** Inline decision calls. These do not create saved agents or decision definitions. */
|
|
2
|
+
export type DecisionQuestion = {
|
|
3
|
+
name: string;
|
|
4
|
+
type: "predicate";
|
|
5
|
+
instructions: string;
|
|
6
|
+
} | {
|
|
7
|
+
name: string;
|
|
8
|
+
type: "choice";
|
|
9
|
+
instructions: string;
|
|
10
|
+
choices: {
|
|
11
|
+
value: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
}[];
|
|
14
|
+
} | {
|
|
15
|
+
name: string;
|
|
16
|
+
type: "score";
|
|
17
|
+
instructions: string;
|
|
18
|
+
levels: {
|
|
19
|
+
label: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
export interface DecisionRequest {
|
|
24
|
+
/** Use an exact id returned by listDecisionModels(). */
|
|
25
|
+
modelId: string;
|
|
26
|
+
input: string | Record<string, unknown> | unknown[];
|
|
27
|
+
questions: DecisionQuestion[];
|
|
28
|
+
metadata?: Record<string, string>;
|
|
29
|
+
}
|
|
30
|
+
export type DecisionAnswer = {
|
|
31
|
+
type: "predicate";
|
|
32
|
+
probability: number;
|
|
33
|
+
} | {
|
|
34
|
+
type: "choice";
|
|
35
|
+
value: string;
|
|
36
|
+
confidence?: number;
|
|
37
|
+
probabilities: {
|
|
38
|
+
value: string;
|
|
39
|
+
probability: number;
|
|
40
|
+
}[];
|
|
41
|
+
} | {
|
|
42
|
+
type: "score";
|
|
43
|
+
value: number;
|
|
44
|
+
confidence?: number;
|
|
45
|
+
probabilities: {
|
|
46
|
+
value: number;
|
|
47
|
+
label: string;
|
|
48
|
+
probability: number;
|
|
49
|
+
}[];
|
|
50
|
+
} | {
|
|
51
|
+
type: "refusal";
|
|
52
|
+
};
|
|
53
|
+
export interface DecisionResult {
|
|
54
|
+
runId: string;
|
|
55
|
+
status: "completed";
|
|
56
|
+
answers: Record<string, DecisionAnswer>;
|
|
57
|
+
model: {
|
|
58
|
+
id: string;
|
|
59
|
+
provider: "openai" | "openrouter";
|
|
60
|
+
requested: string;
|
|
61
|
+
resolved: string;
|
|
62
|
+
};
|
|
63
|
+
usage: {
|
|
64
|
+
inputTokens: number;
|
|
65
|
+
cachedTokens: number;
|
|
66
|
+
outputTokens: number;
|
|
67
|
+
costUsd: number | null;
|
|
68
|
+
};
|
|
69
|
+
durationMs: number;
|
|
70
|
+
}
|
|
71
|
+
export interface DecisionModelInfo {
|
|
72
|
+
id: string;
|
|
73
|
+
label: string;
|
|
74
|
+
provider: "openai" | "openrouter";
|
|
75
|
+
vendorModelId: string;
|
|
76
|
+
connectionName: string;
|
|
77
|
+
source: "workspace_provider";
|
|
78
|
+
maxQuestions: number;
|
|
79
|
+
questionTypes: ("predicate" | "choice" | "score")[];
|
|
80
|
+
}
|
|
81
|
+
export interface DecisionRunSummary {
|
|
82
|
+
metadata?: Record<string, string>;
|
|
83
|
+
id: string;
|
|
84
|
+
source: "sdk" | "playground";
|
|
85
|
+
status: "running" | "completed" | "failed";
|
|
86
|
+
provider: string;
|
|
87
|
+
requestedModel: string;
|
|
88
|
+
resolvedModel: string | null;
|
|
89
|
+
connectionName: string;
|
|
90
|
+
definitionHash: string;
|
|
91
|
+
durationMs: number | null;
|
|
92
|
+
error: string | null;
|
|
93
|
+
errorCode: string | null;
|
|
94
|
+
createdAt: string;
|
|
95
|
+
completedAt: string | null;
|
|
96
|
+
}
|
|
97
|
+
export interface DecisionRunDetail extends DecisionRunSummary {
|
|
98
|
+
modelId: string;
|
|
99
|
+
request: DecisionRequest;
|
|
100
|
+
response: DecisionResult | null;
|
|
101
|
+
providerRequestId: string | null;
|
|
102
|
+
}
|
|
103
|
+
export interface DecisionRunList {
|
|
104
|
+
runs: DecisionRunSummary[];
|
|
105
|
+
nextCursor: string | null;
|
|
106
|
+
}
|
package/dist/index.cjs
CHANGED
|
@@ -816,6 +816,23 @@ var MantyxClient = class {
|
|
|
816
816
|
};
|
|
817
817
|
}
|
|
818
818
|
// -------------------------------------------------------------- Models
|
|
819
|
+
/** List decision-capable models and exact workspace connection ids. */
|
|
820
|
+
async listDecisionModels() {
|
|
821
|
+
return this.request({ method: "GET", path: "/decisions/models" });
|
|
822
|
+
}
|
|
823
|
+
/** Evaluate inline questions. No chat session or saved definition is created. */
|
|
824
|
+
async runDecision(spec) {
|
|
825
|
+
return this.request({ method: "POST", path: "/decisions", body: spec });
|
|
826
|
+
}
|
|
827
|
+
async listDecisionRuns(options = {}) {
|
|
828
|
+
return this.request({ method: "GET", path: "/decisions/runs", query: options });
|
|
829
|
+
}
|
|
830
|
+
async getDecisionRun(runId) {
|
|
831
|
+
return this.request({ method: "GET", path: `/decisions/runs/${encodeURIComponent(runId)}` });
|
|
832
|
+
}
|
|
833
|
+
async deleteDecisionRun(runId) {
|
|
834
|
+
return this.request({ method: "DELETE", path: `/decisions/runs/${encodeURIComponent(runId)}` });
|
|
835
|
+
}
|
|
819
836
|
async listModels() {
|
|
820
837
|
return this.request({
|
|
821
838
|
method: "GET",
|
|
@@ -1501,6 +1518,7 @@ var AgentSession = class {
|
|
|
1501
1518
|
}
|
|
1502
1519
|
if (this.tools.length > 0) body.tools = serializeToolRefs(this.tools);
|
|
1503
1520
|
if (opts.metadata && Object.keys(opts.metadata).length > 0) body.metadata = opts.metadata;
|
|
1521
|
+
if (opts.openRouterProvider !== void 0) body.openRouterProvider = opts.openRouterProvider;
|
|
1504
1522
|
if (opts.reasoningLevel !== void 0) {
|
|
1505
1523
|
body.reasoningLevel = normalizeReasoningLevel(opts.reasoningLevel);
|
|
1506
1524
|
}
|
|
@@ -1587,6 +1605,7 @@ function serializeAgentSpec(spec, extra = {}) {
|
|
|
1587
1605
|
if (spec.name) body.name = spec.name;
|
|
1588
1606
|
if (spec.modelId) body.modelId = spec.modelId;
|
|
1589
1607
|
if (spec.fallbackModelId) body.fallbackModelId = spec.fallbackModelId;
|
|
1608
|
+
if (spec.openRouterProvider !== void 0) body.openRouterProvider = spec.openRouterProvider;
|
|
1590
1609
|
if (spec.reasoningLevel !== void 0) {
|
|
1591
1610
|
body.reasoningLevel = normalizeReasoningLevel(spec.reasoningLevel);
|
|
1592
1611
|
}
|
|
@@ -2745,7 +2764,7 @@ async function runComputerUse(opts) {
|
|
|
2745
2764
|
}
|
|
2746
2765
|
|
|
2747
2766
|
// src/version.ts
|
|
2748
|
-
var SDK_VERSION = "2026.
|
|
2767
|
+
var SDK_VERSION = "2026.11.2";
|
|
2749
2768
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2750
2769
|
0 && (module.exports = {
|
|
2751
2770
|
AgentSession,
|
package/dist/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
*
|
|
34
34
|
* console.log(result.text);
|
|
35
35
|
*/
|
|
36
|
+
export type { DecisionQuestion, DecisionRequest, DecisionAnswer, DecisionResult, DecisionModelInfo, DecisionRunSummary, DecisionRunDetail, DecisionRunList } from "./decisions.js";
|
|
36
37
|
export { MantyxClient, AgentSession, DEFAULT_BASE_URL, parseRunOutput, planOnly, taskPlanFromEventData, inputFileAttachment, inputFileUrlAttachment, } from "./client.js";
|
|
37
38
|
export type { MantyxClientOptions, ModelInfo, ModelCatalog, AgentSpecBase, RunSpec, SessionSpec, OutputSchema, OutputSchemaValue, LoopDetection, ToolBudget, ToolBudgets, Supervisor, SupervisorAction, SupervisorPhase, ReasoningTrigger, PlanOptions, PlanMode, PlanSpec, TaskPlan, TaskPlanStep, TaskPlanStepStatus, TaskPlanTransition, RunResult, RunTokenUsage, RunModelInfo, RunEvent, RunEventBase, AssistantDeltaEvent, ThinkingDeltaEvent, AssistantMessageEvent, ModelFallbackEvent, UserMessageEvent, InputFileAttachment, InputFileUrlAttachment, MessageAttachment, InputFileAttachmentMetadata, InputFileUrlAttachmentMetadata, AttachmentMetadata, ConversationMessage, ServerToolResultEvent, LocalToolCallEvent, LocalToolResultInEvent, LoopDetectedEvent, ToolBudgetExceededEvent, SupervisorEvent, TaskPlanEvent, ResultEvent, ErrorEvent, CancelledEvent, SessionInfo, SessionSummary, SessionListResult, SessionEventsPage, LocalHandlers, RunFeedbackVerdict, RunFeedbackInput, RunFeedbackResult, EvalRunStatus, InlineEvalCaseSpec, InlineEvalDatasetSpec, AgentEvalOverrides, CreateEvalRunRequest, EvalDatasetSummary, EvalDatasetList, EvalCase, EvalDatasetDetail, EvalRunAccepted, EvalRunSummary, EvalCaseResult, EvalRunDetail, EvalRunList, EvalRunCompareSide, EvalRunCompareCase, EvalRunCompare, EvalRunEvent, ListEvalRunsOptions, RunEvalOptions, } from "./client.js";
|
|
38
39
|
export { defineLocalTool, mantyxTool, mantyxPluginTool, mantyxA2A, defineLocalA2A, mantyxMcp, defineLocalMcp, isLocalTool, isLocalA2ATool, isLocalMcpServer, } from "./tools.js";
|
|
@@ -48,3 +49,4 @@ export { zodToJsonSchema, toToolParametersWire } from "./zod-to-json-schema.js";
|
|
|
48
49
|
export { readSseStream } from "./sse.js";
|
|
49
50
|
export type { SseEvent, SseStreamOptions } from "./sse.js";
|
|
50
51
|
export { SDK_VERSION } from "./version.js";
|
|
52
|
+
export type { OpenRouterProviderPreferences } from "./client.js";
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
taskPlanFromEventData,
|
|
28
28
|
toToolParametersWire,
|
|
29
29
|
zodToJsonSchema
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-RT44KYDO.js";
|
|
31
31
|
|
|
32
32
|
// src/oauth.ts
|
|
33
33
|
var DEFAULT_OAUTH_BASE_URL = "https://app.mantyx.io";
|
|
@@ -603,7 +603,7 @@ async function runComputerUse(opts) {
|
|
|
603
603
|
}
|
|
604
604
|
|
|
605
605
|
// src/version.ts
|
|
606
|
-
var SDK_VERSION = "2026.
|
|
606
|
+
var SDK_VERSION = "2026.11.2";
|
|
607
607
|
export {
|
|
608
608
|
AgentSession,
|
|
609
609
|
COMPUTER_USE_ACTIONS,
|
package/dist/version.d.ts
CHANGED
|
@@ -777,6 +777,66 @@ For session-scoped runs the inheritance rules are:
|
|
|
777
777
|
per-message override; applies to that one run only and does not mutate
|
|
778
778
|
the session's stored value.
|
|
779
779
|
|
|
780
|
+
### 4.4.1 `openRouterProvider` (OpenRouter provider routing)
|
|
781
|
+
|
|
782
|
+
Run creation accepts an optional `openRouterProvider` JSON object. It uses
|
|
783
|
+
[OpenRouter's provider-routing wire format](https://openrouter.ai/docs/guides/routing/provider-selection),
|
|
784
|
+
including snake_case field names. MANTYX forwards the effective object as
|
|
785
|
+
`provider` on OpenRouter Responses API requests (streaming and non-streaming).
|
|
786
|
+
|
|
787
|
+
```json
|
|
788
|
+
{"openRouterProvider":{"order":["anthropic"],"allow_fallbacks":false}}
|
|
789
|
+
```
|
|
790
|
+
|
|
791
|
+
All top-level fields are optional and nullable (`null` means unset):
|
|
792
|
+
|
|
793
|
+
| Field | Accepted value |
|
|
794
|
+
| --- | --- |
|
|
795
|
+
| `order`, `only`, `ignore` | Arrays of provider slugs, including variant/region suffixes such as `deepinfra/turbo` or `google-vertex/us-east5` |
|
|
796
|
+
| `allow_fallbacks`, `require_parameters`, `zdr`, `enforce_distillable_text` | Boolean |
|
|
797
|
+
| `data_collection` | `"allow"` or `"deny"` |
|
|
798
|
+
| `quantizations` | Array of `int4`, `int8`, `fp4`, `mxfp4`, `nvfp4`, `fp6`, `fp8`, `mxfp8`, `fp16`, `bf16`, `fp32`, `unknown` |
|
|
799
|
+
| `sort` | `"price"`, `"throughput"`, `"latency"`, `"exacto"`, or `{ "by"?: <same enum> or null, "partition"?: "model" or "none" or null }` |
|
|
800
|
+
| `preferred_min_throughput` | Number (tokens/sec), or an object with optional numeric `p50`, `p75`, `p90`, `p99` |
|
|
801
|
+
| `preferred_max_latency` | Number (seconds), or the same percentile object |
|
|
802
|
+
| `max_price` | Object with optional `prompt`, `completion`, `image`, `audio`, `request` prices (USD), each a number or string |
|
|
803
|
+
|
|
804
|
+
Provider create (`POST /api/llm-providers`, including marketplace connections
|
|
805
|
+
and BYOK duplication) accepts `openRouterProvider` as a stored default on the
|
|
806
|
+
workspace provider. Provider update (`PATCH /api/llm-providers/:id`) also accepts
|
|
807
|
+
`null` to clear the default. Provider responses return the object or `null`.
|
|
808
|
+
Changing a stored default requires a workspace admin; a `PATCH` that resubmits
|
|
809
|
+
the stored value unchanged does not.
|
|
810
|
+
|
|
811
|
+
Effective routing is a shallow per-key merge:
|
|
812
|
+
`{ ...providerDefault, ...runOverride }`. Arrays and nested objects in the
|
|
813
|
+
run override replace the corresponding default value entirely. A null field in
|
|
814
|
+
the override removes that inherited key; null fields in stored defaults are
|
|
815
|
+
dropped. Nullable `sort` members are also omitted upstream. An empty object
|
|
816
|
+
preserves defaults; absent or empty effective preferences are omitted from the
|
|
817
|
+
upstream request. The entire run-level `openRouterProvider` object cannot be null.
|
|
818
|
+
|
|
819
|
+
Stored privacy controls are the exception: when the provider default sets
|
|
820
|
+
`data_collection: "deny"` or `zdr: true`, a run, session or message override
|
|
821
|
+
can tighten privacy but cannot loosen or remove those values (a `"allow"`,
|
|
822
|
+
`false` or `null` override is ignored for that key).
|
|
823
|
+
|
|
824
|
+
Sessions accept the same field as a session default. A per-message value on
|
|
825
|
+
`POST /agent-sessions/:id/messages` replaces the session override for that one
|
|
826
|
+
run, without changing the stored session; provider defaults still merge beneath it.
|
|
827
|
+
|
|
828
|
+
Unknown keys (including nested keys) and invalid values return HTTP 400.
|
|
829
|
+
Setting routing on a non-OpenRouter provider, or creating a run whose effective
|
|
830
|
+
model uses another provider, returns HTTP 400 with a clear error before queueing.
|
|
831
|
+
An explicitly configured fallback model must also use OpenRouter when a run
|
|
832
|
+
routing override is present. No routing configuration is stored on platform
|
|
833
|
+
catalog offerings themselves.
|
|
834
|
+
|
|
835
|
+
MANTYX-hosted OpenRouter models are billed at the cost OpenRouter reports for
|
|
836
|
+
each request (`usage.cost`), so a pinned provider or `sort` is billed at what
|
|
837
|
+
it actually cost. The catalog's per-token prices are a reference estimate and
|
|
838
|
+
are used only when OpenRouter does not report a cost.
|
|
839
|
+
|
|
780
840
|
### 4.5 `outputSchema` (structured final reply)
|
|
781
841
|
|
|
782
842
|
`outputSchema` constrains the model's **final assistant text** to a JSON
|
|
@@ -1853,3 +1913,15 @@ A reference SDK should:
|
|
|
1853
1913
|
The npm package [`@mantyx/sdk`](https://www.npmjs.com/package/@mantyx/sdk) and the Go module
|
|
1854
1914
|
[`github.com/mantyx/mantyx-go-sdk`](https://github.com/mantyx/mantyx-go-sdk) are reference implementations of this protocol
|
|
1855
1915
|
(maintained in the official **mantyx-sdk** repositories).
|
|
1916
|
+
|
|
1917
|
+
|
|
1918
|
+
## Inline decisions
|
|
1919
|
+
|
|
1920
|
+
Decisions run synchronously through `POST /decisions` alongside the agent-runs
|
|
1921
|
+
surface. Discover connection-specific models with `GET /decisions/models`; inspect
|
|
1922
|
+
and delete terminal runs through `/decisions/runs`. These use `models:read`,
|
|
1923
|
+
`runs:read`, and `runs:write` OAuth scopes and the same workspace API-key
|
|
1924
|
+
authentication. Questions are inline; there is no saved decision registry.
|
|
1925
|
+
|
|
1926
|
+
See the [decision guide](https://mantyx-io.github.io/mantyx-sdk/docs/decisions/)
|
|
1927
|
+
for request types, normalized answers, SDK examples, and execution semantics.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantyx/sdk",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.11.2",
|
|
4
4
|
"description": "MANTYX as a hosted agent runtime: define ephemeral agents, mix server-side MANTYX tools with locally-executed tools, run them remotely.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|