@spunto/build 0.31.0 → 0.33.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.
@@ -210,28 +210,6 @@ export const AVAILABLE_FEATURES: DevFeature[] = [
210
210
  localScript: "google-cloud-cli.sh",
211
211
  description: "gcloud, gsutil, bq (local install script)",
212
212
  },
213
- {
214
- // The agent apps' features (RFC 0048, `../agent-runners`): injected, never picked.
215
- id: "spunto-agent-claude",
216
- label: "Claude (agent app)",
217
- localScript: "spunto-agent-claude.sh",
218
- description: "The Claude Agent SDK and the Node its runner uses — injected by the Claude app",
219
- injected: true,
220
- },
221
- {
222
- id: "spunto-agent-codex",
223
- label: "Codex (agent app)",
224
- localScript: "spunto-agent-codex.sh",
225
- description: "The Codex SDK and the Node its runner uses — injected by the Codex app",
226
- injected: true,
227
- },
228
- {
229
- id: "spunto-agent-mistral",
230
- label: "Mistral Vibe (agent app)",
231
- localScript: "spunto-agent-mistral.sh",
232
- description: "Mistral Vibe (with its own Python) and the Node its runner uses — injected by the Mistral app",
233
- injected: true,
234
- },
235
213
  {
236
214
  // Always installed, whether or not it's picked here (lib/setup-script.ts § the two features
237
215
  // every worker image is made of): it's what creates the `vscode` user. Listed anyway so a
@@ -8,11 +8,7 @@
8
8
  //
9
9
  // Keyed by the catalog's `localScript` filename so the two stay legible together.
10
10
 
11
- import { AGENT_FEATURE_SCRIPTS } from "../agent-runners/features"
12
-
13
11
  export const LOCAL_FEATURE_SCRIPTS: Record<string, string> = {
14
- // The agent apps' features (RFC 0048): ours by definition — nobody upstream installs our runner's SDK.
15
- ...AGENT_FEATURE_SCRIPTS,
16
12
  // Google's own apt repository; the upstream devcontainer feature pins a gcloud version and
17
13
  // breaks whenever Google retires it.
18
14
  "google-cloud-cli.sh": `#!/bin/sh
@@ -1,183 +0,0 @@
1
- /**
2
- * What each agent app (RFC 0048) lets a task choose: its models, and **its own parameters** —
3
- * effort, reasoning, web search… The platform knows none of them by name. It shows what an app
4
- * declares, checks a task's choice against it (`validateAgentOptions`), and hands the choice to the
5
- * runner (`OPTIONS_ENV`), which is the only code that knows what a parameter means to its SDK.
6
- *
7
- * **Measured, not remembered.** Each catalog is what the SDK pinned by its feature
8
- * (`./features.ts`) answers, and it changes when that pin moves:
9
- *
10
- * - Claude: `query().supportedModels()` of `@anthropic-ai/claude-agent-sdk` 0.3.310, on
11
- * 2026-10-26. Each model comes back with `supportedEffortLevels`;
12
- * - Codex: `codex debug models` of `@openai/codex` 0.164.0 — the catalog bundled in the binary,
13
- * offline, on 2026-10-26 — the `visibility: "list"` models, with their
14
- * `supported_reasoning_levels` and `default_reasoning_level`;
15
- * - Mistral: the `model` and `thinking` options of a `session/new` of `vibe-acp` 3.0.4, then of
16
- * `session/set_config_option` for each model, on 2026-10-31, with a pay-as-you-go API key.
17
- * Not all in the binary: Vibe's own default is Medium 3.5, and the others came from Mistral's
18
- * remote config (a rollout of Large 4 as the default the account was in) — an account outside
19
- * it may lack them, which the runner then says, with the models it does have.
20
- *
21
- * `packages/build/scripts/agent-catalogs.mjs` prints both again, to diff against this file when a
22
- * pin is bumped.
23
- */
24
-
25
- export type AgentParamValue = { value: string; label: string; description?: string }
26
-
27
- /** A parameter an app defines. A choice among values — the one shape both SDKs need today. */
28
- export type AgentParam = {
29
- id: string
30
- label: string
31
- description?: string
32
- values: AgentParamValue[]
33
- }
34
-
35
- export type AgentModel = {
36
- value: string
37
- label: string
38
- description?: string
39
- /** What the harness runs when no model is picked. */
40
- default?: boolean
41
- /** Values of a parameter this model allows, when it does not take all of them. */
42
- params?: Record<string, string[]>
43
- /** What this model runs with when the parameter is left unset — shown as the chip's placeholder. */
44
- paramDefaults?: Record<string, string>
45
- }
46
-
47
- export type AgentCatalog = {
48
- models: AgentModel[]
49
- params: AgentParam[]
50
- }
51
-
52
- /** The variable a task's chosen parameters reach the runner in, as one JSON object. */
53
- export const OPTIONS_ENV = "SPUNTO_AGENT_OPTIONS"
54
-
55
- /**
56
- * `"1"` when the session should stream the tokens of a message as they are written (partial
57
- * messages, folded into the draft by `foldDraft`). Set by the platform behind the org flag
58
- * `token-streaming`; absent, a runner prints finished messages only — the system before it.
59
- */
60
- export const STREAM_ENV = "SPUNTO_AGENT_STREAM"
61
-
62
- /**
63
- * The variable the org's MCP servers reach the runner in (RFC 0049): a JSON array of
64
- * `{ name, path }`, `path` being the platform's gateway for that server, resolved by the runner
65
- * against `SPUNTO_API_URL` and called with `SPUNTO_WORKER_TOKEN`. No vendor token, no harness shape.
66
- */
67
- export const MCP_ENV = "SPUNTO_AGENT_MCP"
68
-
69
- export type AgentMcpServer = { name: string; path: string }
70
-
71
- const CLAUDE_EFFORT: AgentParamValue[] = [
72
- { value: "low", label: "Low" },
73
- { value: "medium", label: "Medium" },
74
- { value: "high", label: "High" },
75
- { value: "xhigh", label: "Extra high" },
76
- { value: "max", label: "Max" },
77
- ]
78
-
79
- const CODEX_REASONING: AgentParamValue[] = [
80
- { value: "low", label: "Low", description: "Fast responses with lighter reasoning" },
81
- { value: "medium", label: "Medium", description: "Balances speed and reasoning depth for everyday tasks" },
82
- { value: "high", label: "High", description: "Greater reasoning depth for complex problems" },
83
- { value: "xhigh", label: "Extra high", description: "Extra high reasoning depth for complex problems" },
84
- { value: "max", label: "Max", description: "Maximum reasoning depth for the hardest problems" },
85
- { value: "ultra", label: "Ultra", description: "Maximum reasoning with automatic task delegation" },
86
- ]
87
-
88
- const ALL_BUT_ULTRA = ["low", "medium", "high", "xhigh", "max"]
89
-
90
- export const AGENT_CATALOGS: Record<"claude" | "codex" | "mistral", AgentCatalog> = {
91
- claude: {
92
- // The SDK's aliases (`default`, `sonnet`, `opus`, `fable`, `haiku`) resolved to the ids they
93
- // stand for: a task records the model it ran, not a name whose meaning moves.
94
- models: [
95
- { value: "claude-sonnet-5-5", label: "Claude Sonnet 5.5", description: "Default (recommended)", default: true },
96
- { value: "claude-opus-5-5", label: "Claude Opus 5.5" },
97
- { value: "claude-fable-5-2", label: "Claude Fable 5.2" },
98
- { value: "claude-haiku-5-5", label: "Claude Haiku 5.5" },
99
- ],
100
- params: [
101
- {
102
- id: "effort",
103
- label: "Effort",
104
- description: "How much Claude thinks before it acts. Unset = the model's own default.",
105
- values: CLAUDE_EFFORT,
106
- },
107
- ],
108
- },
109
- codex: {
110
- models: [
111
- { value: "gpt-6-astra", label: "GPT-6-Astra", description: "Frontier intelligence for the most demanding work.", paramDefaults: { reasoningEffort: "low" } },
112
- { value: "gpt-6.1-sol", label: "GPT-6.1-Sol", description: "Latest workhorse model for coding and everyday work.", paramDefaults: { reasoningEffort: "low" } },
113
- { value: "gpt-6-sol", label: "GPT-6-Sol", description: "Previous generation workhorse model.", paramDefaults: { reasoningEffort: "medium" } },
114
- { value: "gpt-6-luna", label: "GPT-6-Luna", description: "Fast and affordable model for easier tasks.", params: { reasoningEffort: ALL_BUT_ULTRA }, paramDefaults: { reasoningEffort: "medium" } },
115
- { value: "gpt-5.6-sol", label: "GPT-5.6-Sol", description: "Older generation workhorse model.", paramDefaults: { reasoningEffort: "low" } },
116
- { value: "gpt-5.6-terra", label: "GPT-5.6-Terra", description: "Older balanced model for straightforward work.", paramDefaults: { reasoningEffort: "medium" } },
117
- { value: "gpt-5.6-luna", label: "GPT-5.6-Luna", description: "Older fast and efficient model.", params: { reasoningEffort: ALL_BUT_ULTRA }, paramDefaults: { reasoningEffort: "medium" } },
118
- { value: "gpt-5.5", label: "GPT-5.5", description: "Legacy coding model.", params: { reasoningEffort: ["low", "medium", "high", "xhigh"] }, paramDefaults: { reasoningEffort: "medium" } },
119
- ],
120
- params: [
121
- {
122
- id: "reasoningEffort",
123
- label: "Reasoning",
124
- description: "How deeply Codex reasons. Unset = the model's own default.",
125
- values: CODEX_REASONING,
126
- },
127
- {
128
- id: "webSearch",
129
- label: "Web search",
130
- description: "Whether Codex may search the web: from a cache, live, or not at all. Unset = Codex's default.",
131
- values: [
132
- { value: "disabled", label: "Off" },
133
- { value: "cached", label: "Cached" },
134
- { value: "live", label: "Live" },
135
- ],
136
- },
137
- ],
138
- }, mistral: {
139
- // Vibe's aliases, which are what `session/set_config_option` takes (and what `--model` gets).
140
- models: [
141
- { value: "mistral-medium-3.5", label: "Mistral Medium 3.5", description: "Vibe's own default (mistral-vibe-cli-latest)", default: true, params: { thinking: ["off", "high"] }, paramDefaults: { thinking: "high" } },
142
- { value: "mistral-large-4-0-3", label: "Mistral Large 4", description: "mistral-large-4-0 — rolling out as Vibe's default", params: { thinking: ["low", "medium", "high"] }, paramDefaults: { thinking: "high" } },
143
- { value: "glm-5-3", label: "GLM-5.3", description: "zai-glm-5-3, hosted by Mistral", params: { thinking: ["low", "high", "max"] }, paramDefaults: { thinking: "high" } },
144
- { value: "zai-glm-5-3-flash", label: "GLM-5.3 Flash", description: "zai-glm-5-3-flash, hosted by Mistral", params: { thinking: ["low", "high", "max"] }, paramDefaults: { thinking: "high" } },
145
- ],
146
- params: [
147
- {
148
- id: "thinking",
149
- label: "Thinking",
150
- description: "How much the model reasons before it acts. Unset = the level Vibe last used for the model.",
151
- values: [
152
- { value: "off", label: "Off" },
153
- { value: "low", label: "Low" },
154
- { value: "medium", label: "Medium" },
155
- { value: "high", label: "High" },
156
- { value: "max", label: "Max" },
157
- ],
158
- },
159
- ],
160
- },
161
- }
162
-
163
- /**
164
- * Why these options cannot run under this catalog and model — or null when they can. An unknown
165
- * parameter, a value the parameter does not have, or one the model does not take. A model the
166
- * catalog does not list (typed by hand) is held to the parameter's values only: the catalog cannot
167
- * speak for it.
168
- */
169
- export function agentOptionsError(catalog: AgentCatalog, model: string | null | undefined, options: Record<string, string>): string | null {
170
- const known = model ? catalog.models.find((m) => m.value === model) : undefined
171
- for (const [id, value] of Object.entries(options)) {
172
- const param = catalog.params.find((p) => p.id === id)
173
- if (!param) return `Unknown parameter "${id}" — this harness takes ${catalog.params.map((p) => p.id).join(", ") || "none"}.`
174
- if (!param.values.some((v) => v.value === value)) {
175
- return `"${value}" is not a value of ${param.label} — one of ${param.values.map((v) => v.value).join(", ")}.`
176
- }
177
- const allowed = known?.params?.[id]
178
- if (allowed && !allowed.includes(value)) {
179
- return `${known!.label} does not take ${param.label} "${value}" — one of ${allowed.join(", ")}.`
180
- }
181
- }
182
- return null
183
- }