@aexhq/sdk 0.18.1 → 0.19.0

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/README.md CHANGED
@@ -63,7 +63,7 @@ const aex = new AgentExecutor({
63
63
  // baseUrl defaults to https://api.aex.dev - set it for local or staging planes.
64
64
  });
65
65
 
66
- const runId = await aex.submitRun({
66
+ const runId = await aex.submit({
67
67
  model: RunModels.CLAUDE_HAIKU_4_5,
68
68
  system: "You are a concise automation agent.",
69
69
  prompt: "Write a short answer about agent-first SDK design.",
@@ -94,7 +94,7 @@ function summarise(topic: string) {
94
94
  };
95
95
  }
96
96
 
97
- const runId = await aex.submitRun({
97
+ const runId = await aex.submit({
98
98
  ...summarise("agent-first SDK design"),
99
99
  secrets: { apiKey: process.env.ANTHROPIC_API_KEY! }
100
100
  });
@@ -1,20 +1,82 @@
1
1
  import type { RunProvider } from "./submission.js";
2
2
  /**
3
- * Closed set of model ids accepted by the public run-submission schema.
3
+ * Source of truth for the closed model set: each canonical model id maps to the
4
+ * upstream providers that can serve it and the **provider-native** model string
5
+ * each one expects.
4
6
  *
5
- * The provider-proxy still sends the model id through to the selected upstream
6
- * provider, but callers cannot submit arbitrary strings. Additions belong here
7
- * first so SDK types, CLI validation, docs examples, and platform parsing move
8
- * together.
7
+ * `Models.*` / `RUN_MODELS` are aex's own **canonical, provider-neutral**
8
+ * identifiers they are NOT the strings sent to a provider. The platform
9
+ * translates a `(canonical model, provider)` pair to the native id via
10
+ * {@link resolveProviderModelId} when it builds the run's session manifest. The
11
+ * same canonical model can therefore be served by more than one provider (e.g.
12
+ * `gpt-4o-mini` via `openai` *or* `openrouter`), with a different native string
13
+ * per provider.
14
+ *
15
+ * Ordering matters: the **first** provider listed for a model is its default
16
+ * (see {@link providerForModel}) — list the native vendor before `openrouter`.
17
+ * Additions belong here first so SDK types, CLI validation, docs examples, and
18
+ * platform parsing all move together.
19
+ */
20
+ export declare const MODEL_PROVIDER_IDS: {
21
+ readonly "claude-haiku-4-5": {
22
+ readonly anthropic: "claude-haiku-4-5";
23
+ };
24
+ readonly "claude-3-5-haiku-latest": {
25
+ readonly anthropic: "claude-3-5-haiku-latest";
26
+ };
27
+ readonly "claude-3-5-sonnet-latest": {
28
+ readonly anthropic: "claude-3-5-sonnet-latest";
29
+ };
30
+ readonly "deepseek-v4-flash": {
31
+ readonly deepseek: "deepseek-v4-flash";
32
+ };
33
+ readonly "deepseek-v4-pro": {
34
+ readonly deepseek: "deepseek-v4-pro";
35
+ };
36
+ readonly "deepseek-chat": {
37
+ readonly deepseek: "deepseek-chat";
38
+ };
39
+ readonly "deepseek-reasoner": {
40
+ readonly deepseek: "deepseek-reasoner";
41
+ };
42
+ readonly "gpt-4.1": {
43
+ readonly openai: "gpt-4.1";
44
+ };
45
+ readonly "gpt-4o-mini": {
46
+ readonly openai: "gpt-4o-mini";
47
+ readonly openrouter: "openai/gpt-4o-mini";
48
+ };
49
+ readonly "gpt-4o": {
50
+ readonly openrouter: "openai/gpt-4o";
51
+ };
52
+ readonly "gemini-2.0-flash": {
53
+ readonly gemini: "gemini-2.0-flash";
54
+ readonly openrouter: "google/gemini-2.0-flash-001";
55
+ };
56
+ readonly "gemini-2.5-flash": {
57
+ readonly gemini: "gemini-2.5-flash";
58
+ };
59
+ readonly "mistral-large-latest": {
60
+ readonly mistral: "mistral-large-latest";
61
+ };
62
+ readonly "mistral-small-latest": {
63
+ readonly mistral: "mistral-small-latest";
64
+ };
65
+ };
66
+ /**
67
+ * Closed set of canonical model ids accepted by the public run-submission
68
+ * schema. Derived from {@link MODEL_PROVIDER_IDS} so the two never drift.
9
69
  */
10
- export declare const RUN_MODELS: readonly ["claude-haiku-4-5", "claude-3-5-haiku-latest", "claude-3-5-sonnet-latest", "deepseek-v4-flash", "deepseek-v4-pro", "deepseek-chat", "deepseek-reasoner", "gpt-4.1", "gpt-4o-mini", "gemini-2.0-flash", "gemini-2.5-flash", "mistral-large-latest", "mistral-small-latest", "openai/gpt-4o-mini", "openai/gpt-4o", "google/gemini-2.0-flash-001"];
11
- export type RunModel = (typeof RUN_MODELS)[number];
70
+ export type RunModel = keyof typeof MODEL_PROVIDER_IDS;
71
+ export declare const RUN_MODELS: readonly RunModel[];
12
72
  /**
13
73
  * Symbol-style accessors for the closed model set. Prefer these over raw
14
74
  * strings so an invalid token is a compile error, not a runtime 400 — e.g.
15
- * `Models.CLAUDE_HAIKU_4_5`. The upstream provider is a pure function of the
16
- * model ({@link providerForModel}), so picking a model fully determines
17
- * routing; callers never pass `provider` separately.
75
+ * `Models.CLAUDE_HAIKU_4_5`. These are aex's **canonical** ids, not the native
76
+ * strings sent upstream; the platform translates them per provider (see
77
+ * {@link MODEL_PROVIDER_IDS} / {@link resolveProviderModelId}). When a model is
78
+ * served by more than one provider, pair it with an explicit {@link Providers}
79
+ * value; otherwise the single (default) provider is used.
18
80
  */
19
81
  export declare const Models: {
20
82
  /** Claude Haiku 4.5 — Anthropic. */
@@ -42,9 +104,11 @@ export declare const Models: {
42
104
  readonly DEEPSEEK_REASONER: "deepseek-reasoner";
43
105
  /** GPT-4.1 — OpenAI. */
44
106
  readonly GPT_4_1: "gpt-4.1";
45
- /** GPT-4o mini — OpenAI. */
107
+ /** GPT-4o mini — OpenAI, or via OpenRouter (`provider: Providers.OPENROUTER`). */
46
108
  readonly GPT_4O_MINI: "gpt-4o-mini";
47
- /** Gemini 2.0 Flash Gemini. */
109
+ /** GPT-4o via OpenRouter (`provider: Providers.OPENROUTER`). */
110
+ readonly GPT_4O: "gpt-4o";
111
+ /** Gemini 2.0 Flash — Gemini, or via OpenRouter (`provider: Providers.OPENROUTER`). */
48
112
  readonly GEMINI_2_0_FLASH: "gemini-2.0-flash";
49
113
  /** Gemini 2.5 Flash — Gemini. */
50
114
  readonly GEMINI_2_5_FLASH: "gemini-2.5-flash";
@@ -52,12 +116,6 @@ export declare const Models: {
52
116
  readonly MISTRAL_LARGE_LATEST: "mistral-large-latest";
53
117
  /** Mistral Small (latest) — Mistral. */
54
118
  readonly MISTRAL_SMALL_LATEST: "mistral-small-latest";
55
- /** GPT-4o mini via OpenRouter (provider-prefixed) — cheap, tool-obedient. */
56
- readonly OPENROUTER_GPT_4O_MINI: "openai/gpt-4o-mini";
57
- /** GPT-4o via OpenRouter (provider-prefixed) — stronger, tool-obedient. */
58
- readonly OPENROUTER_GPT_4O: "openai/gpt-4o";
59
- /** Gemini 2.0 Flash via OpenRouter (provider-prefixed) — cheap, tool-obedient. */
60
- readonly OPENROUTER_GEMINI_2_0_FLASH: "google/gemini-2.0-flash-001";
61
119
  };
62
120
  /**
63
121
  * Back-compat alias for {@link Models}. Existing imports of `RunModels`
@@ -89,9 +147,11 @@ export declare const RunModels: {
89
147
  readonly DEEPSEEK_REASONER: "deepseek-reasoner";
90
148
  /** GPT-4.1 — OpenAI. */
91
149
  readonly GPT_4_1: "gpt-4.1";
92
- /** GPT-4o mini — OpenAI. */
150
+ /** GPT-4o mini — OpenAI, or via OpenRouter (`provider: Providers.OPENROUTER`). */
93
151
  readonly GPT_4O_MINI: "gpt-4o-mini";
94
- /** Gemini 2.0 Flash Gemini. */
152
+ /** GPT-4o via OpenRouter (`provider: Providers.OPENROUTER`). */
153
+ readonly GPT_4O: "gpt-4o";
154
+ /** Gemini 2.0 Flash — Gemini, or via OpenRouter (`provider: Providers.OPENROUTER`). */
95
155
  readonly GEMINI_2_0_FLASH: "gemini-2.0-flash";
96
156
  /** Gemini 2.5 Flash — Gemini. */
97
157
  readonly GEMINI_2_5_FLASH: "gemini-2.5-flash";
@@ -99,28 +159,31 @@ export declare const RunModels: {
99
159
  readonly MISTRAL_LARGE_LATEST: "mistral-large-latest";
100
160
  /** Mistral Small (latest) — Mistral. */
101
161
  readonly MISTRAL_SMALL_LATEST: "mistral-small-latest";
102
- /** GPT-4o mini via OpenRouter (provider-prefixed) — cheap, tool-obedient. */
103
- readonly OPENROUTER_GPT_4O_MINI: "openai/gpt-4o-mini";
104
- /** GPT-4o via OpenRouter (provider-prefixed) — stronger, tool-obedient. */
105
- readonly OPENROUTER_GPT_4O: "openai/gpt-4o";
106
- /** Gemini 2.0 Flash via OpenRouter (provider-prefixed) — cheap, tool-obedient. */
107
- readonly OPENROUTER_GEMINI_2_0_FLASH: "google/gemini-2.0-flash-001";
108
- };
109
- export declare const RUN_MODELS_BY_PROVIDER: {
110
- readonly anthropic: readonly ["claude-haiku-4-5", "claude-3-5-haiku-latest", "claude-3-5-sonnet-latest"];
111
- readonly deepseek: readonly ["deepseek-v4-flash", "deepseek-v4-pro", "deepseek-chat", "deepseek-reasoner"];
112
- readonly openai: readonly ["gpt-4.1", "gpt-4o-mini"];
113
- readonly gemini: readonly ["gemini-2.0-flash", "gemini-2.5-flash"];
114
- readonly mistral: readonly ["mistral-large-latest", "mistral-small-latest"];
115
- readonly openrouter: readonly ["openai/gpt-4o-mini", "openai/gpt-4o", "google/gemini-2.0-flash-001"];
116
162
  };
117
163
  /**
118
- * Resolve the upstream provider for a model id. Returns `undefined` when the
119
- * input is not a known {@link RunModel} (so the SDK can fall back to the
120
- * default and let the server reject the model). Total over the closed model
121
- * set, so any `RunModel` resolves.
164
+ * Provider canonical models that provider can serve. Derived from
165
+ * {@link MODEL_PROVIDER_IDS}; every provider currently serves at least one
166
+ * model, so all {@link RunProvider} keys are present.
167
+ */
168
+ export declare const RUN_MODELS_BY_PROVIDER: Readonly<Record<RunProvider, readonly RunModel[]>>;
169
+ /**
170
+ * All upstream providers that can serve a model id, in declaration order.
171
+ * Returns `[]` for an unknown model.
172
+ */
173
+ export declare function providersForModel(model: string): readonly RunProvider[];
174
+ /**
175
+ * The default upstream provider for a model id — the first provider declared
176
+ * for it in {@link MODEL_PROVIDER_IDS}. Returns `undefined` when the input is
177
+ * not a known {@link RunModel} (so the SDK can fall back to the default and let
178
+ * the server reject the model).
122
179
  */
123
180
  export declare function providerForModel(model: string): RunProvider | undefined;
181
+ /**
182
+ * Translate a canonical model id + provider into the provider-native model
183
+ * string the upstream API expects (e.g. `("gpt-4o-mini", "openrouter")` →
184
+ * `"openai/gpt-4o-mini"`). Throws when the provider does not serve the model.
185
+ */
186
+ export declare function resolveProviderModelId(model: string, provider: RunProvider): string;
124
187
  export declare function isRunModel(input: unknown): input is RunModel;
125
188
  export declare function parseRunModel(input: unknown, field?: string): RunModel;
126
189
  export declare function assertRunModelMatchesProvider(provider: RunProvider, model: RunModel, field?: string): void;
@@ -1,35 +1,46 @@
1
1
  /**
2
- * Closed set of model ids accepted by the public run-submission schema.
2
+ * Source of truth for the closed model set: each canonical model id maps to the
3
+ * upstream providers that can serve it and the **provider-native** model string
4
+ * each one expects.
3
5
  *
4
- * The provider-proxy still sends the model id through to the selected upstream
5
- * provider, but callers cannot submit arbitrary strings. Additions belong here
6
- * first so SDK types, CLI validation, docs examples, and platform parsing move
7
- * together.
6
+ * `Models.*` / `RUN_MODELS` are aex's own **canonical, provider-neutral**
7
+ * identifiers they are NOT the strings sent to a provider. The platform
8
+ * translates a `(canonical model, provider)` pair to the native id via
9
+ * {@link resolveProviderModelId} when it builds the run's session manifest. The
10
+ * same canonical model can therefore be served by more than one provider (e.g.
11
+ * `gpt-4o-mini` via `openai` *or* `openrouter`), with a different native string
12
+ * per provider.
13
+ *
14
+ * Ordering matters: the **first** provider listed for a model is its default
15
+ * (see {@link providerForModel}) — list the native vendor before `openrouter`.
16
+ * Additions belong here first so SDK types, CLI validation, docs examples, and
17
+ * platform parsing all move together.
8
18
  */
9
- export const RUN_MODELS = [
10
- "claude-haiku-4-5",
11
- "claude-3-5-haiku-latest",
12
- "claude-3-5-sonnet-latest",
13
- "deepseek-v4-flash",
14
- "deepseek-v4-pro",
15
- "deepseek-chat",
16
- "deepseek-reasoner",
17
- "gpt-4.1",
18
- "gpt-4o-mini",
19
- "gemini-2.0-flash",
20
- "gemini-2.5-flash",
21
- "mistral-large-latest",
22
- "mistral-small-latest",
23
- "openai/gpt-4o-mini",
24
- "openai/gpt-4o",
25
- "google/gemini-2.0-flash-001"
26
- ];
19
+ export const MODEL_PROVIDER_IDS = {
20
+ "claude-haiku-4-5": { anthropic: "claude-haiku-4-5" },
21
+ "claude-3-5-haiku-latest": { anthropic: "claude-3-5-haiku-latest" },
22
+ "claude-3-5-sonnet-latest": { anthropic: "claude-3-5-sonnet-latest" },
23
+ "deepseek-v4-flash": { deepseek: "deepseek-v4-flash" },
24
+ "deepseek-v4-pro": { deepseek: "deepseek-v4-pro" },
25
+ "deepseek-chat": { deepseek: "deepseek-chat" },
26
+ "deepseek-reasoner": { deepseek: "deepseek-reasoner" },
27
+ "gpt-4.1": { openai: "gpt-4.1" },
28
+ "gpt-4o-mini": { openai: "gpt-4o-mini", openrouter: "openai/gpt-4o-mini" },
29
+ "gpt-4o": { openrouter: "openai/gpt-4o" },
30
+ "gemini-2.0-flash": { gemini: "gemini-2.0-flash", openrouter: "google/gemini-2.0-flash-001" },
31
+ "gemini-2.5-flash": { gemini: "gemini-2.5-flash" },
32
+ "mistral-large-latest": { mistral: "mistral-large-latest" },
33
+ "mistral-small-latest": { mistral: "mistral-small-latest" }
34
+ };
35
+ export const RUN_MODELS = Object.keys(MODEL_PROVIDER_IDS);
27
36
  /**
28
37
  * Symbol-style accessors for the closed model set. Prefer these over raw
29
38
  * strings so an invalid token is a compile error, not a runtime 400 — e.g.
30
- * `Models.CLAUDE_HAIKU_4_5`. The upstream provider is a pure function of the
31
- * model ({@link providerForModel}), so picking a model fully determines
32
- * routing; callers never pass `provider` separately.
39
+ * `Models.CLAUDE_HAIKU_4_5`. These are aex's **canonical** ids, not the native
40
+ * strings sent upstream; the platform translates them per provider (see
41
+ * {@link MODEL_PROVIDER_IDS} / {@link resolveProviderModelId}). When a model is
42
+ * served by more than one provider, pair it with an explicit {@link Providers}
43
+ * value; otherwise the single (default) provider is used.
33
44
  */
34
45
  export const Models = {
35
46
  /** Claude Haiku 4.5 — Anthropic. */
@@ -57,71 +68,78 @@ export const Models = {
57
68
  DEEPSEEK_REASONER: "deepseek-reasoner",
58
69
  /** GPT-4.1 — OpenAI. */
59
70
  GPT_4_1: "gpt-4.1",
60
- /** GPT-4o mini — OpenAI. */
71
+ /** GPT-4o mini — OpenAI, or via OpenRouter (`provider: Providers.OPENROUTER`). */
61
72
  GPT_4O_MINI: "gpt-4o-mini",
62
- /** Gemini 2.0 Flash Gemini. */
73
+ /** GPT-4o via OpenRouter (`provider: Providers.OPENROUTER`). */
74
+ GPT_4O: "gpt-4o",
75
+ /** Gemini 2.0 Flash — Gemini, or via OpenRouter (`provider: Providers.OPENROUTER`). */
63
76
  GEMINI_2_0_FLASH: "gemini-2.0-flash",
64
77
  /** Gemini 2.5 Flash — Gemini. */
65
78
  GEMINI_2_5_FLASH: "gemini-2.5-flash",
66
79
  /** Mistral Large (latest) — Mistral. */
67
80
  MISTRAL_LARGE_LATEST: "mistral-large-latest",
68
81
  /** Mistral Small (latest) — Mistral. */
69
- MISTRAL_SMALL_LATEST: "mistral-small-latest",
70
- /** GPT-4o mini via OpenRouter (provider-prefixed) — cheap, tool-obedient. */
71
- OPENROUTER_GPT_4O_MINI: "openai/gpt-4o-mini",
72
- /** GPT-4o via OpenRouter (provider-prefixed) — stronger, tool-obedient. */
73
- OPENROUTER_GPT_4O: "openai/gpt-4o",
74
- /** Gemini 2.0 Flash via OpenRouter (provider-prefixed) — cheap, tool-obedient. */
75
- OPENROUTER_GEMINI_2_0_FLASH: "google/gemini-2.0-flash-001"
82
+ MISTRAL_SMALL_LATEST: "mistral-small-latest"
76
83
  };
77
84
  /**
78
85
  * Back-compat alias for {@link Models}. Existing imports of `RunModels`
79
86
  * keep working; new code should prefer `Models`.
80
87
  */
81
88
  export const RunModels = Models;
82
- export const RUN_MODELS_BY_PROVIDER = {
83
- anthropic: [
84
- Models.CLAUDE_HAIKU_4_5,
85
- Models.CLAUDE_3_5_HAIKU_LATEST,
86
- Models.CLAUDE_3_5_SONNET_LATEST
87
- ],
88
- deepseek: [
89
- Models.DEEPSEEK_V4_FLASH,
90
- Models.DEEPSEEK_V4_PRO,
91
- Models.DEEPSEEK_CHAT,
92
- Models.DEEPSEEK_REASONER
93
- ],
94
- openai: [Models.GPT_4_1, Models.GPT_4O_MINI],
95
- gemini: [Models.GEMINI_2_0_FLASH, Models.GEMINI_2_5_FLASH],
96
- mistral: [Models.MISTRAL_LARGE_LATEST, Models.MISTRAL_SMALL_LATEST],
97
- openrouter: [
98
- Models.OPENROUTER_GPT_4O_MINI,
99
- Models.OPENROUTER_GPT_4O,
100
- Models.OPENROUTER_GEMINI_2_0_FLASH
101
- ]
102
- };
103
89
  /**
104
- * Reverse index: every model id its single upstream provider. Derived from
105
- * {@link RUN_MODELS_BY_PROVIDER} so the two never drift; each model appears
106
- * under exactly one provider.
90
+ * Per-model provider lists, in declaration order. Derived from
91
+ * {@link MODEL_PROVIDER_IDS} so the two never drift.
92
+ */
93
+ const PROVIDERS_BY_MODEL = (() => {
94
+ const map = {};
95
+ for (const [model, providers] of Object.entries(MODEL_PROVIDER_IDS)) {
96
+ map[model] = Object.keys(providers);
97
+ }
98
+ return map;
99
+ })();
100
+ /**
101
+ * Provider → canonical models that provider can serve. Derived from
102
+ * {@link MODEL_PROVIDER_IDS}; every provider currently serves at least one
103
+ * model, so all {@link RunProvider} keys are present.
107
104
  */
108
- const PROVIDER_BY_MODEL = (() => {
105
+ export const RUN_MODELS_BY_PROVIDER = (() => {
109
106
  const map = {};
110
- for (const [provider, models] of Object.entries(RUN_MODELS_BY_PROVIDER)) {
111
- for (const model of models) {
112
- map[model] = provider;
107
+ for (const [model, providers] of Object.entries(MODEL_PROVIDER_IDS)) {
108
+ for (const provider of Object.keys(providers)) {
109
+ (map[provider] ??= []).push(model);
113
110
  }
114
111
  }
115
112
  return map;
116
113
  })();
117
114
  /**
118
- * Resolve the upstream provider for a model id. Returns `undefined` when the
119
- * input is not a known {@link RunModel} (so the SDK can fall back to the
120
- * default and let the server reject the model). Total over the closed model
121
- * set, so any `RunModel` resolves.
115
+ * All upstream providers that can serve a model id, in declaration order.
116
+ * Returns `[]` for an unknown model.
117
+ */
118
+ export function providersForModel(model) {
119
+ return PROVIDERS_BY_MODEL[model] ?? [];
120
+ }
121
+ /**
122
+ * The default upstream provider for a model id — the first provider declared
123
+ * for it in {@link MODEL_PROVIDER_IDS}. Returns `undefined` when the input is
124
+ * not a known {@link RunModel} (so the SDK can fall back to the default and let
125
+ * the server reject the model).
122
126
  */
123
127
  export function providerForModel(model) {
124
- return PROVIDER_BY_MODEL[model];
128
+ return providersForModel(model)[0];
129
+ }
130
+ /**
131
+ * Translate a canonical model id + provider into the provider-native model
132
+ * string the upstream API expects (e.g. `("gpt-4o-mini", "openrouter")` →
133
+ * `"openai/gpt-4o-mini"`). Throws when the provider does not serve the model.
134
+ */
135
+ export function resolveProviderModelId(model, provider) {
136
+ const entry = MODEL_PROVIDER_IDS[model];
137
+ const native = entry?.[provider];
138
+ if (native === undefined) {
139
+ throw new Error(`resolveProviderModelId: model ${JSON.stringify(model)} is not available for provider ${JSON.stringify(provider)}; ` +
140
+ `available: ${providersForModel(model).join(", ") || "(none)"}`);
141
+ }
142
+ return native;
125
143
  }
126
144
  export function isRunModel(input) {
127
145
  return typeof input === "string" && RUN_MODELS.includes(input);
@@ -133,9 +151,10 @@ export function parseRunModel(input, field = "submission.model") {
133
151
  return input;
134
152
  }
135
153
  export function assertRunModelMatchesProvider(provider, model, field = "submission.model") {
136
- if (!RUN_MODELS_BY_PROVIDER[provider].includes(model)) {
154
+ const providers = providersForModel(model);
155
+ if (!providers.includes(provider)) {
137
156
  throw new Error(`${field} ${JSON.stringify(model)} is not supported for provider ${provider}; ` +
138
- `expected one of: ${RUN_MODELS_BY_PROVIDER[provider].join(", ")}`);
157
+ `expected one of: ${providers.join(", ")}`);
139
158
  }
140
159
  }
141
160
  //# sourceMappingURL=models.js.map
@@ -251,7 +251,7 @@ export declare function rejectStdioMcpShape(record: Record<string, unknown>): vo
251
251
  /**
252
252
  * Plain JSON accepted by `aex run --config <path>`. This is not a
253
253
  * platform object; it is only the non-secret run parameters that the CLI folds
254
- * into the normal `submitRun` request.
254
+ * into the normal `submit` request.
255
255
  */
256
256
  export interface RunRequestConfig {
257
257
  readonly model: RunModel;
@@ -466,7 +466,7 @@ export declare class RuntimeValidationError extends Error {
466
466
  }
467
467
  /**
468
468
  * Walk the parsed submission and collect features that the active managed
469
- * runtime cannot serve. Provider-hosted skill refs (`Skill.provider(...)`) are
469
+ * runtime cannot serve. Provider-hosted skill refs (`kind:"provider"`) are
470
470
  * rejected now that new submissions only dispatch through managed runs.
471
471
  */
472
472
  export declare function collectManagedUnsupportedFeatures(req: PlatformRunSubmissionRequest): string[];
@@ -1478,15 +1478,15 @@ export class RuntimeValidationError extends Error {
1478
1478
  }
1479
1479
  /**
1480
1480
  * Walk the parsed submission and collect features that the active managed
1481
- * runtime cannot serve. Provider-hosted skill refs (`Skill.provider(...)`) are
1481
+ * runtime cannot serve. Provider-hosted skill refs (`kind:"provider"`) are
1482
1482
  * rejected now that new submissions only dispatch through managed runs.
1483
1483
  */
1484
1484
  export function collectManagedUnsupportedFeatures(req) {
1485
1485
  const features = [];
1486
1486
  for (const skill of req.submission.skills) {
1487
1487
  if (skill.kind === "provider") {
1488
- const versionSuffix = skill.version ? `, "${skill.version}"` : "";
1489
- features.push(`Skill.provider("${skill.vendor}", "${skill.skillId}"${versionSuffix})`);
1488
+ const versionSuffix = skill.version ? `@${skill.version}` : "";
1489
+ features.push(`provider skill "${skill.vendor}/${skill.skillId}${versionSuffix}" (kind:"provider")`);
1490
1490
  }
1491
1491
  }
1492
1492
  return features;
@@ -5,9 +5,9 @@ import type { AgentsMdRef } from "./_contracts/index.js";
5
5
  * behaviour).
6
6
  *
7
7
  * const rules = await AgentsMd.fromContent("# Be helpful", { name: "rules" });
8
- * await client.submitRun({ agentsMd: [rules], ... });
8
+ * await client.submit({ agentsMd: [rules], ... });
9
9
  *
10
- * `client.submitRun` materializes the bytes to the hosted asset store before
10
+ * `client.submit` materializes the bytes to the hosted asset store before
11
11
  * the run lands. Asset deduplication handles repeated uploads automatically.
12
12
  */
13
13
  export declare class AgentsMd {
@@ -30,7 +30,7 @@ export declare class AgentsMd {
30
30
  }): Promise<AgentsMd>;
31
31
  /**
32
32
  * Internal: yield the draft's zipped bytes + metadata so
33
- * `client.submitRun` can upload it as an asset.
33
+ * `client.submit` can upload it as an asset.
34
34
  */
35
35
  _takeDraftBundle(): {
36
36
  name: string;
package/dist/agents-md.js CHANGED
@@ -7,9 +7,9 @@ import { strToU8, zipSync } from "fflate";
7
7
  * behaviour).
8
8
  *
9
9
  * const rules = await AgentsMd.fromContent("# Be helpful", { name: "rules" });
10
- * await client.submitRun({ agentsMd: [rules], ... });
10
+ * await client.submit({ agentsMd: [rules], ... });
11
11
  *
12
- * `client.submitRun` materializes the bytes to the hosted asset store before
12
+ * `client.submit` materializes the bytes to the hosted asset store before
13
13
  * the run lands. Asset deduplication handles repeated uploads automatically.
14
14
  */
15
15
  export class AgentsMd {
@@ -53,12 +53,12 @@ export class AgentsMd {
53
53
  }
54
54
  /**
55
55
  * Internal: yield the draft's zipped bytes + metadata so
56
- * `client.submitRun` can upload it as an asset.
56
+ * `client.submit` can upload it as an asset.
57
57
  */
58
58
  _takeDraftBundle() {
59
59
  if (this.#consumed) {
60
- throw new Error("AgentsMd: cannot reuse a consumed AgentsMd in submitRun. Build a fresh one " +
61
- "via AgentsMd.fromContent(...) / AgentsMd.fromPath(...) per submitRun call.");
60
+ throw new Error("AgentsMd: cannot reuse a consumed AgentsMd in submit. Build a fresh one " +
61
+ "via AgentsMd.fromContent(...) / AgentsMd.fromPath(...) per submit call.");
62
62
  }
63
63
  if (this.#ref.kind !== "draft" || !this.#zipBytes) {
64
64
  return undefined;
@@ -73,7 +73,7 @@ export class AgentsMd {
73
73
  toJSON() {
74
74
  if (this.#ref.kind === "draft") {
75
75
  throw new Error("AgentsMd: draft AgentsMd cannot be JSON-serialised — it only becomes a wire " +
76
- "ref when client.submitRun uploads the bytes as an asset.");
76
+ "ref when client.submit uploads the bytes as an asset.");
77
77
  }
78
78
  return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AC,IAAI;YACpB,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW;YAClC,KAAK,EAAE,IAAI,CAAC,SAAS;SACtB,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CACb,8EAA8E;gBAC5E,uDAAuD,CAC1D,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF;AAQD,MAAM,iBAAiB,GAAG,mCAAmC,CAAC;AAC9D,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
package/dist/cli.mjs CHANGED
@@ -130,93 +130,35 @@ var PROVIDER_PUBLIC_SUPPORT = {
130
130
  };
131
131
 
132
132
  // ../contracts/dist/models.js
133
- var RUN_MODELS = [
134
- "claude-haiku-4-5",
135
- "claude-3-5-haiku-latest",
136
- "claude-3-5-sonnet-latest",
137
- "deepseek-v4-flash",
138
- "deepseek-v4-pro",
139
- "deepseek-chat",
140
- "deepseek-reasoner",
141
- "gpt-4.1",
142
- "gpt-4o-mini",
143
- "gemini-2.0-flash",
144
- "gemini-2.5-flash",
145
- "mistral-large-latest",
146
- "mistral-small-latest",
147
- "openai/gpt-4o-mini",
148
- "openai/gpt-4o",
149
- "google/gemini-2.0-flash-001"
150
- ];
151
- var Models = {
152
- /** Claude Haiku 4.5 — Anthropic. */
153
- CLAUDE_HAIKU_4_5: "claude-haiku-4-5",
154
- /** Claude 3.5 Haiku (latest) — Anthropic. */
155
- CLAUDE_3_5_HAIKU_LATEST: "claude-3-5-haiku-latest",
156
- /** Claude 3.5 Sonnet (latest) — Anthropic. */
157
- CLAUDE_3_5_SONNET_LATEST: "claude-3-5-sonnet-latest",
158
- /** DeepSeek V4 Flash — DeepSeek (non-thinking, fast). */
159
- DEEPSEEK_V4_FLASH: "deepseek-v4-flash",
160
- /** DeepSeek V4 Pro — DeepSeek (reasoning-heavy). */
161
- DEEPSEEK_V4_PRO: "deepseek-v4-pro",
162
- /**
163
- * @deprecated Legacy alias DeepSeek routes to `deepseek-v4-flash` (non-thinking).
164
- * DeepSeek removes this name on 2026-07-24 15:59 UTC — migrate to
165
- * {@link Models.DEEPSEEK_V4_FLASH}.
166
- */
167
- DEEPSEEK_CHAT: "deepseek-chat",
168
- /**
169
- * @deprecated Legacy alias DeepSeek routes to `deepseek-v4-flash` (thinking).
170
- * DeepSeek removes this name on 2026-07-24 15:59 UTC — migrate to
171
- * {@link Models.DEEPSEEK_V4_FLASH} (or {@link Models.DEEPSEEK_V4_PRO} for
172
- * heavier reasoning).
173
- */
174
- DEEPSEEK_REASONER: "deepseek-reasoner",
175
- /** GPT-4.1 — OpenAI. */
176
- GPT_4_1: "gpt-4.1",
177
- /** GPT-4o mini — OpenAI. */
178
- GPT_4O_MINI: "gpt-4o-mini",
179
- /** Gemini 2.0 Flash — Gemini. */
180
- GEMINI_2_0_FLASH: "gemini-2.0-flash",
181
- /** Gemini 2.5 Flash — Gemini. */
182
- GEMINI_2_5_FLASH: "gemini-2.5-flash",
183
- /** Mistral Large (latest) — Mistral. */
184
- MISTRAL_LARGE_LATEST: "mistral-large-latest",
185
- /** Mistral Small (latest) — Mistral. */
186
- MISTRAL_SMALL_LATEST: "mistral-small-latest",
187
- /** GPT-4o mini via OpenRouter (provider-prefixed) — cheap, tool-obedient. */
188
- OPENROUTER_GPT_4O_MINI: "openai/gpt-4o-mini",
189
- /** GPT-4o via OpenRouter (provider-prefixed) — stronger, tool-obedient. */
190
- OPENROUTER_GPT_4O: "openai/gpt-4o",
191
- /** Gemini 2.0 Flash via OpenRouter (provider-prefixed) — cheap, tool-obedient. */
192
- OPENROUTER_GEMINI_2_0_FLASH: "google/gemini-2.0-flash-001"
133
+ var MODEL_PROVIDER_IDS = {
134
+ "claude-haiku-4-5": { anthropic: "claude-haiku-4-5" },
135
+ "claude-3-5-haiku-latest": { anthropic: "claude-3-5-haiku-latest" },
136
+ "claude-3-5-sonnet-latest": { anthropic: "claude-3-5-sonnet-latest" },
137
+ "deepseek-v4-flash": { deepseek: "deepseek-v4-flash" },
138
+ "deepseek-v4-pro": { deepseek: "deepseek-v4-pro" },
139
+ "deepseek-chat": { deepseek: "deepseek-chat" },
140
+ "deepseek-reasoner": { deepseek: "deepseek-reasoner" },
141
+ "gpt-4.1": { openai: "gpt-4.1" },
142
+ "gpt-4o-mini": { openai: "gpt-4o-mini", openrouter: "openai/gpt-4o-mini" },
143
+ "gpt-4o": { openrouter: "openai/gpt-4o" },
144
+ "gemini-2.0-flash": { gemini: "gemini-2.0-flash", openrouter: "google/gemini-2.0-flash-001" },
145
+ "gemini-2.5-flash": { gemini: "gemini-2.5-flash" },
146
+ "mistral-large-latest": { mistral: "mistral-large-latest" },
147
+ "mistral-small-latest": { mistral: "mistral-small-latest" }
193
148
  };
194
- var RUN_MODELS_BY_PROVIDER = {
195
- anthropic: [
196
- Models.CLAUDE_HAIKU_4_5,
197
- Models.CLAUDE_3_5_HAIKU_LATEST,
198
- Models.CLAUDE_3_5_SONNET_LATEST
199
- ],
200
- deepseek: [
201
- Models.DEEPSEEK_V4_FLASH,
202
- Models.DEEPSEEK_V4_PRO,
203
- Models.DEEPSEEK_CHAT,
204
- Models.DEEPSEEK_REASONER
205
- ],
206
- openai: [Models.GPT_4_1, Models.GPT_4O_MINI],
207
- gemini: [Models.GEMINI_2_0_FLASH, Models.GEMINI_2_5_FLASH],
208
- mistral: [Models.MISTRAL_LARGE_LATEST, Models.MISTRAL_SMALL_LATEST],
209
- openrouter: [
210
- Models.OPENROUTER_GPT_4O_MINI,
211
- Models.OPENROUTER_GPT_4O,
212
- Models.OPENROUTER_GEMINI_2_0_FLASH
213
- ]
214
- };
215
- var PROVIDER_BY_MODEL = (() => {
149
+ var RUN_MODELS = Object.keys(MODEL_PROVIDER_IDS);
150
+ var PROVIDERS_BY_MODEL = (() => {
151
+ const map = {};
152
+ for (const [model, providers] of Object.entries(MODEL_PROVIDER_IDS)) {
153
+ map[model] = Object.keys(providers);
154
+ }
155
+ return map;
156
+ })();
157
+ var RUN_MODELS_BY_PROVIDER = (() => {
216
158
  const map = {};
217
- for (const [provider, models] of Object.entries(RUN_MODELS_BY_PROVIDER)) {
218
- for (const model of models) {
219
- map[model] = provider;
159
+ for (const [model, providers] of Object.entries(MODEL_PROVIDER_IDS)) {
160
+ for (const provider of Object.keys(providers)) {
161
+ (map[provider] ??= []).push(model);
220
162
  }
221
163
  }
222
164
  return map;