maestro-agent-sdk 0.1.37 → 0.1.39

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.
Files changed (73) hide show
  1. package/README.md +55 -62
  2. package/dist/core/loop.d.ts.map +1 -1
  3. package/dist/core/loop.js +5 -43
  4. package/dist/core/loop.js.map +1 -1
  5. package/dist/index.d.ts +1 -5
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -6
  8. package/dist/index.js.map +1 -1
  9. package/dist/memory/aux-model-map.d.ts +2 -43
  10. package/dist/memory/aux-model-map.d.ts.map +1 -1
  11. package/dist/memory/aux-model-map.js +3 -85
  12. package/dist/memory/aux-model-map.js.map +1 -1
  13. package/dist/platform/config.d.ts +0 -7
  14. package/dist/platform/config.d.ts.map +1 -1
  15. package/dist/platform/config.js +0 -14
  16. package/dist/platform/config.js.map +1 -1
  17. package/dist/platform/version.d.ts +1 -1
  18. package/dist/platform/version.js +1 -1
  19. package/dist/provider.d.ts +12 -55
  20. package/dist/provider.d.ts.map +1 -1
  21. package/dist/provider.js +99 -156
  22. package/dist/provider.js.map +1 -1
  23. package/dist/registry.d.ts +6 -39
  24. package/dist/registry.d.ts.map +1 -1
  25. package/dist/registry.js +9 -76
  26. package/dist/registry.js.map +1 -1
  27. package/dist/sub-agent/runner.d.ts.map +1 -1
  28. package/dist/sub-agent/runner.js +0 -3
  29. package/dist/sub-agent/runner.js.map +1 -1
  30. package/dist/tools/builtin/bash.js +2 -2
  31. package/dist/tools/builtin/bash.js.map +1 -1
  32. package/dist/tools/builtin/bash_background.js +1 -1
  33. package/dist/tools/builtin/bash_background.js.map +1 -1
  34. package/dist/tools/builtin/gemini_image_qa.d.ts +12 -0
  35. package/dist/tools/builtin/gemini_image_qa.d.ts.map +1 -0
  36. package/dist/tools/builtin/gemini_image_qa.js +195 -0
  37. package/dist/tools/builtin/gemini_image_qa.js.map +1 -0
  38. package/dist/tools/builtin/read.d.ts.map +1 -1
  39. package/dist/tools/builtin/read.js +6 -6
  40. package/dist/tools/builtin/read.js.map +1 -1
  41. package/dist/tools/index.d.ts +1 -0
  42. package/dist/tools/index.d.ts.map +1 -1
  43. package/dist/tools/index.js +1 -0
  44. package/dist/tools/index.js.map +1 -1
  45. package/dist/types.d.ts +1 -1
  46. package/dist/types.d.ts.map +1 -1
  47. package/dist/types.js +2 -2
  48. package/dist/types.js.map +1 -1
  49. package/package.json +2 -24
  50. package/dist/providers/anthropic.d.ts +0 -328
  51. package/dist/providers/anthropic.d.ts.map +0 -1
  52. package/dist/providers/anthropic.js +0 -857
  53. package/dist/providers/anthropic.js.map +0 -1
  54. package/dist/providers/codex-auth.d.ts +0 -149
  55. package/dist/providers/codex-auth.d.ts.map +0 -1
  56. package/dist/providers/codex-auth.js +0 -332
  57. package/dist/providers/codex-auth.js.map +0 -1
  58. package/dist/providers/codex-stream.d.ts +0 -42
  59. package/dist/providers/codex-stream.d.ts.map +0 -1
  60. package/dist/providers/codex-stream.js +0 -345
  61. package/dist/providers/codex-stream.js.map +0 -1
  62. package/dist/providers/codex-translators.d.ts +0 -105
  63. package/dist/providers/codex-translators.d.ts.map +0 -1
  64. package/dist/providers/codex-translators.js +0 -244
  65. package/dist/providers/codex-translators.js.map +0 -1
  66. package/dist/providers/codex.d.ts +0 -234
  67. package/dist/providers/codex.d.ts.map +0 -1
  68. package/dist/providers/codex.js +0 -461
  69. package/dist/providers/codex.js.map +0 -1
  70. package/dist/providers/fallback.d.ts +0 -71
  71. package/dist/providers/fallback.d.ts.map +0 -1
  72. package/dist/providers/fallback.js +0 -223
  73. package/dist/providers/fallback.js.map +0 -1
@@ -1,104 +1,22 @@
1
- /**
2
- * Map a main model id to the cheapest sibling on the same provider for
3
- * background context compaction.
4
- *
5
- * Why this exists
6
- * ---------------
7
- * `compressIfNeeded` (memory/compressor.ts) reuses the agent's main model
8
- * for its summary call by default. That's fine when the main model is
9
- * already a cheap/fast tier (Haiku, deepseek-flash, gpt-5.4-mini), but
10
- * pathological for the heavy tiers:
11
- *
12
- * - gpt-5.5: a 330K-token compaction call balloons the request body to
13
- * ~1.3 MB and routinely hits undici's 5-minute headersTimeout. The
14
- * v0.1.28 diagnostic logs caught this in production — both the main
15
- * turn *and* the aux LLM compaction call timed out on the same
16
- * response cycle, leaving the loop with a prune-only fallback.
17
- * - claude-opus: each compaction costs 4-8× a Haiku call for the same
18
- * summary quality.
19
- * - deepseek-v4-pro: same shape as gpt-5.5 — the heavy reasoning model
20
- * wasted on a structural summary pass.
21
- *
22
- * The fix is one indirection: pick the cheapest sibling on the *same
23
- * provider* (so we don't have to swap clients) and route compaction
24
- * through it. Cross-provider swaps (e.g. gpt-5.5 main + Haiku aux) would
25
- * require the host to wire a second provider client, so we stay
26
- * intra-provider here and let hosts override via `AIAgentConfig.auxModel`
27
- * if they want something fancier.
28
- *
29
- * Returns the input unchanged when the main model is already the cheapest
30
- * sibling on its provider, or when we don't recognize it (foreign slugs
31
- * pass through so a host's custom model id doesn't get silently rewritten).
32
- */
33
- import { MODEL_CODEX_GPT5_2, MODEL_CODEX_GPT5_3_CODEX, MODEL_CODEX_GPT5_4, MODEL_CODEX_GPT5_4_MINI, MODEL_CODEX_GPT5_5, MODEL_DEEPSEEK_V4_FLASH, MODEL_DEEPSEEK_V4_PRO, MODEL_OPUS, MODEL_SONNET, } from "../platform/config.js";
34
- const CLAUDE_HAIKU = "claude-haiku-4-5";
35
- /**
36
- * Per-family aux model. Pinned by family, not cheapest-strictly: the host
37
- * picks the model it considers the right balance of summary quality and
38
- * latency for each provider line.
39
- *
40
- * - Claude family → sonnet. Haiku turned out too lossy for production
41
- * summary work; sonnet is the chosen aux tier even when main is opus
42
- * (compaction is bounded so the cost differential is small) or when
43
- * main is haiku (the floor is sonnet either way).
44
- * - DeepSeek family → flash.
45
- * - Codex (gpt-5.x) family → gpt-5.4-mini.
46
- *
47
- * The function stays total — callers always get a usable model id back —
48
- * and the same Provider client handles both main and aux, so no extra
49
- * client wiring is required at the host layer.
50
- */
1
+ import { MODEL_DEEPSEEK_V4_FLASH, MODEL_DEEPSEEK_V4_PRO, } from "../platform/config.js";
51
2
  const AUX_MODEL_BY_MAIN = {
52
- // Anthropic (Claude). Sonnet on every tier — host preference, not
53
- // strictly cheapest. Haiku is intentionally avoided as an aux target
54
- // because the summaries it produces dropped too much structural info
55
- // for downstream resume turns.
56
- [MODEL_OPUS]: MODEL_SONNET,
57
- [MODEL_SONNET]: MODEL_SONNET,
58
- [CLAUDE_HAIKU]: MODEL_SONNET,
59
- // DeepSeek V4
60
3
  [MODEL_DEEPSEEK_V4_PRO]: MODEL_DEEPSEEK_V4_FLASH,
61
4
  [MODEL_DEEPSEEK_V4_FLASH]: MODEL_DEEPSEEK_V4_FLASH,
62
- // Codex (gpt-5.x). gpt-5.4-mini is the cheapest tier accepted by the
63
- // Responses endpoint, so every heavier slug routes to it.
64
- [MODEL_CODEX_GPT5_5]: MODEL_CODEX_GPT5_4_MINI,
65
- [MODEL_CODEX_GPT5_4]: MODEL_CODEX_GPT5_4_MINI,
66
- [MODEL_CODEX_GPT5_4_MINI]: MODEL_CODEX_GPT5_4_MINI,
67
- [MODEL_CODEX_GPT5_3_CODEX]: MODEL_CODEX_GPT5_4_MINI,
68
- [MODEL_CODEX_GPT5_2]: MODEL_CODEX_GPT5_4_MINI,
69
5
  };
70
6
  /**
71
7
  * Resolve the aux (compaction) model id for a given main model.
72
8
  *
73
- * - Known main model with a cheaper sibling → that sibling.
74
- * - Known main model that *is* the cheapest sibling → itself (no-op,
75
- * callers can still route compaction through it without a second
76
- * network identity).
77
- * - Unknown slug → returns the input unchanged. Lets hosts pin custom
78
- * model ids (proxies, alternate gateways) without us guessing wrong.
79
- *
80
- * Prefix fallbacks catch model ids that look like a known family but
81
- * differ in version suffix (e.g. `claude-sonnet-4-7`, `deepseek-v5-pro`).
82
- * They are conservative — only match when the slug clearly belongs to
83
- * one of the three supported providers.
9
+ * DeepSeek V4 heavy tiers flash for compaction.
10
+ * Unknown slugs pass through unchanged.
84
11
  */
85
12
  export function resolveAuxModel(mainModel) {
86
13
  const exact = AUX_MODEL_BY_MAIN[mainModel];
87
14
  if (exact !== undefined)
88
15
  return exact;
89
- // Prefix-based fallback for forward-compat with new minor versions.
90
- // Any claude-* slug routes to sonnet (host preference); any heavy gpt-5.*
91
- // routes to mini; any deepseek-pro variant routes to flash.
92
- if (mainModel.startsWith("claude-")) {
93
- return MODEL_SONNET;
94
- }
95
16
  if (mainModel === "deepseek-pro" ||
96
17
  (mainModel.startsWith("deepseek-v") && mainModel.includes("pro"))) {
97
18
  return MODEL_DEEPSEEK_V4_FLASH;
98
19
  }
99
- if (mainModel.startsWith("gpt-5") && !mainModel.includes("mini")) {
100
- return MODEL_CODEX_GPT5_4_MINI;
101
- }
102
20
  return mainModel;
103
21
  }
104
22
  //# sourceMappingURL=aux-model-map.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aux-model-map.js","sourceRoot":"","sources":["../../src/memory/aux-model-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,UAAU,EACV,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAExC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,iBAAiB,GAA2B;IAChD,kEAAkE;IAClE,qEAAqE;IACrE,qEAAqE;IACrE,+BAA+B;IAC/B,CAAC,UAAU,CAAC,EAAE,YAAY;IAC1B,CAAC,YAAY,CAAC,EAAE,YAAY;IAC5B,CAAC,YAAY,CAAC,EAAE,YAAY;IAE5B,cAAc;IACd,CAAC,qBAAqB,CAAC,EAAE,uBAAuB;IAChD,CAAC,uBAAuB,CAAC,EAAE,uBAAuB;IAElD,qEAAqE;IACrE,0DAA0D;IAC1D,CAAC,kBA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AAiB,CAAC,SAAS,CAAC,CAAC;IAC3C,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAEtC,IACE,SAAS,KAAK,cAAc;QAC5B,CAAC,SAAS,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EACjE,CAAC;QACD,OAAO,uBAAuB,CAAC;IACjC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -1,13 +1,6 @@
1
1
  export declare const DATA_DIR: string;
2
- export declare const MODEL_SONNET: string;
3
- export declare const MODEL_OPUS: string;
4
2
  export declare const MODEL_DEEPSEEK_V4_PRO: string;
5
3
  export declare const MODEL_DEEPSEEK_V4_FLASH: string;
6
- export declare const MODEL_CODEX_GPT5_5: string;
7
- export declare const MODEL_CODEX_GPT5_4: string;
8
- export declare const MODEL_CODEX_GPT5_4_MINI: string;
9
- export declare const MODEL_CODEX_GPT5_3_CODEX: string;
10
- export declare const MODEL_CODEX_GPT5_2: string;
11
4
  export declare const FILE_TAG_REGEX: RegExp;
12
5
  /** Returns `process.env` without `CLAUDECODE` so spawned subprocesses don't
13
6
  * inherit a nested-claude-code detection flag from a parent harness. */
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/platform/config.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,QAAQ,EAAE,MAEM,CAAC;AAK9B,eAAO,MAAM,YAAY,EAAE,MAA4B,CAAC;AACxD,eAAO,MAAM,UAAU,EAAE,MAA0B,CAAC;AAGpD,eAAO,MAAM,qBAAqB,EAAE,MAA0B,CAAC;AAC/D,eAAO,MAAM,uBAAuB,EAAE,MAA4B,CAAC;AAMnE,eAAO,MAAM,kBAAkB,EAAE,MAAkB,CAAC;AACpD,eAAO,MAAM,kBAAkB,EAAE,MAAkB,CAAC;AACpD,eAAO,MAAM,uBAAuB,EAAE,MAAuB,CAAC;AAC9D,eAAO,MAAM,wBAAwB,EAAE,MAAwB,CAAC;AAChE,eAAO,MAAM,kBAAkB,EAAE,MAAkB,CAAC;AAEpD,eAAO,MAAM,cAAc,EAAE,MAAgC,CAAC;AAW9D;yEACyE;AACzE,wBAAgB,WAAW,IAAI,MAAM,CAAC,UAAU,CAI/C"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/platform/config.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,QAAQ,EAAE,MAEM,CAAC;AAG9B,eAAO,MAAM,qBAAqB,EAAE,MAA0B,CAAC;AAC/D,eAAO,MAAM,uBAAuB,EAAE,MAA4B,CAAC;AAEnE,eAAO,MAAM,cAAc,EAAE,MAAgC,CAAC;AAW9D;yEACyE;AACzE,wBAAgB,WAAW,IAAI,MAAM,CAAC,UAAU,CAI/C"}
@@ -22,23 +22,9 @@ const HOME = homedir();
22
22
  export const DATA_DIR = process.env.MAESTRO_DATA_DIR
23
23
  ? resolve(process.env.MAESTRO_DATA_DIR)
24
24
  : resolve(HOME, ".maestro");
25
- // Canonical model IDs used by the SDK's maestro registry. Hosts can pick a
26
- // different default per-query via `AgentQueryOptions.model`, so these are
27
- // just baseline references.
28
- export const MODEL_SONNET = "claude-sonnet-4-6";
29
- export const MODEL_OPUS = "claude-opus-4-7";
30
25
  // DeepSeek V4 (released 2026-04-24). OpenAI-compatible chat-completions API.
31
26
  export const MODEL_DEEPSEEK_V4_PRO = "deepseek-v4-pro";
32
27
  export const MODEL_DEEPSEEK_V4_FLASH = "deepseek-v4-flash";
33
- // Codex Responses API (ChatGPT-backed OAuth). The endpoint only accepts a
34
- // codex-issued whitelist of model slugs — these are the ones surfaced by the
35
- // `/codex/models` endpoint as of 2026-05-23. Adding a new one: list it here
36
- // AND in `MODEL_MAX_OUTPUT_TOKENS` / `ALIAS_MAP` if it deserves a short alias.
37
- export const MODEL_CODEX_GPT5_5 = "gpt-5.5";
38
- export const MODEL_CODEX_GPT5_4 = "gpt-5.4";
39
- export const MODEL_CODEX_GPT5_4_MINI = "gpt-5.4-mini";
40
- export const MODEL_CODEX_GPT5_3_CODEX = "gpt-5.3-codex";
41
- export const MODEL_CODEX_GPT5_2 = "gpt-5.2";
42
28
  export const FILE_TAG_REGEX = /\[FILE:(\/[^\]]+)\]/gi;
43
29
  // Make sure DATA_DIR exists before any tool/skill code tries to readdir into
44
30
  // it. Idempotent and best-effort — hosts that point this at a read-only
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/platform/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;;;;;;GAWG;AAEH,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;AAEvB,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAC5E,uEAAuE;AACvE,4CAA4C;AAC5C,MAAM,CAAC,MAAM,QAAQ,GAAW,OAAO,CAAC,GAAG,CAAC,gBAAgB;IAC1D,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IACvC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AAE9B,2EAA2E;AAC3E,0EAA0E;AAC1E,4BAA4B;AAC5B,MAAM,CAAC,MAAM,YAAY,GAAW,mBAAmB,CAAC;AACxD,MAAM,CAAC,MAAM,UAAU,GAAW,iBAAiB,CAAC;AAEpD,6EAA6E;AAC7E,MAAM,CAAC,MAAM,qBAAqB,GAAW,iBAAiB,CAAC;AAC/D,MAAM,CAAC,MAAM,uBAAuB,GAAW,mBAAmB,CAAC;AAEnE,0EAA0E;AAC1E,6EAA6E;AAC7E,4EAA4E;AAC5E,+EAA+E;AAC/E,MAAM,CAAC,MAAM,kBAAkB,GAAW,SAAS,CAAC;AACpD,MAAM,CAAC,MAAM,kBA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AAM,CAAC,MAAM,uBAAuB,GAAW,mBAAmB,CAAC;AAEnE,MAAM,CAAC,MAAM,cAAc,GAAW,uBAAuB,CAAC;AAE9D,6EAA6E;AAC7E,wEAAwE;AACxE,wDAAwD;AACxD,IAAI,CAAC;IACH,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3C,CAAC;AAAC,MAAM,CAAC;IACP,yDAAyD;AAC3D,CAAC;AAED;yEACyE;AACzE,MAAM,UAAU,WAAW;IACzB,MAAM,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC/B,OAAO,GAAG,CAAC,UAAU,CAAC;IACtB,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -9,5 +9,5 @@
9
9
  *
10
10
  * Bump in lock-step with `package.json#version` on every release.
11
11
  */
12
- export declare const MAESTRO_SDK_VERSION: "0.1.37";
12
+ export declare const MAESTRO_SDK_VERSION: "0.1.39";
13
13
  //# sourceMappingURL=version.d.ts.map
@@ -9,5 +9,5 @@
9
9
  *
10
10
  * Bump in lock-step with `package.json#version` on every release.
11
11
  */
12
- export const MAESTRO_SDK_VERSION = "0.1.37";
12
+ export const MAESTRO_SDK_VERSION = "0.1.39";
13
13
  //# sourceMappingURL=version.js.map
@@ -7,9 +7,7 @@ import type { AgentQueryOptions, UnifiedEvent } from "./types.js";
7
7
  * Multi-turn resume: when `opts.sessionId` is set we hydrate prior messages
8
8
  * from `~/.maestro/sessions/<id>.jsonl` (written by the previous turn's
9
9
  * persistence path or by a cross-agent rollout). Otherwise we mint a fresh
10
- * UUIDv4 matching the contract claude/codex providers expose, so the
11
- * router stays agent-agnostic and `{type:"session", sessionId}` always comes
12
- * back on the first iteration.
10
+ * UUIDv4 and start with empty history.
13
11
  *
14
12
  * After the loop drains we write the updated history back to disk so a
15
13
  * subsequent call resumes correctly. Failures here are logged but never
@@ -18,17 +16,10 @@ import type { AgentQueryOptions, UnifiedEvent } from "./types.js";
18
16
  *
19
17
  * MCP integration: every server in `getMcpServersForQuery(opts)` is leased
20
18
  * from the process-wide cache (`mcp/pool-cache.ts`) and its tools are
21
- * registered under `mcp__<server>__<tool>` the same name convention Claude
22
- * SDK uses, so the model sees consistent tool names across providers in the
23
- * same topic. Unlike claudeProvider / codexProvider which hand `mcpServers`
24
- * to a vendor SDK that owns MCP lifecycle internally — Maestro hits Anthropic's
25
- * Messages API via raw fetch, so we own startup + dispatch + cleanup here.
26
- * Cache key includes (userId, session, groupId) so two users never share an
27
- * MCP client; the cache evicts idle clients via TTL + LRU cap so stale slots
28
- * don't accumulate.
29
- *
30
- * Snapshot pinned to upstream Maestro v0.13.0 (MIT, Nous Research). See
31
- * docs/maestro-integration.md for the porting roadmap.
19
+ * registered under `mcp__<server>__<tool>`. Maestro owns MCP startup +
20
+ * dispatch + cleanup directly. Cache key includes (userId, session, groupId)
21
+ * so two users never share an MCP client; the cache evicts idle clients via
22
+ * TTL + LRU cap so stale slots don't accumulate.
32
23
  */
33
24
  /**
34
25
  * Default tool-iteration cap when the caller doesn't supply
@@ -128,49 +119,15 @@ export declare function iterationBudgetLine(remaining: number, max: number): str
128
119
  * from prose.
129
120
  */
130
121
  export declare function wrapUpOverlayLine(remaining: number, max: number): string | null;
122
+ export declare function providerForModel(_resolvedModel: string): Provider;
131
123
  /**
132
- * Pick the right provider adapter for a resolved model id.
133
- *
134
- * Dispatch table:
135
- * - `gpt-5.*` / `gpt-4.*` / `o3` / `o4` → CodexResponsesProvider
136
- * (ChatGPT-OAuth-backed Responses API at
137
- * chatgpt.com/backend-api/codex; reads ~/.codex/auth.json).
138
- * When `DEEPSEEK_API_KEY` is present, the codex provider is wrapped in a
139
- * `FallbackProvider` that retries against DeepSeek (`deepseek-v4-pro`) if
140
- * codex fails before producing any output (OAuth dead, HTTP 4xx/5xx,
141
- * connect/TTFB timeout). Auto-on — no flag — because the only cost when
142
- * codex is healthy is one cheap wrapper object; the fallback provider is
143
- * lazily constructed and never touched unless codex actually fails.
144
- * - `deepseek-*` → DeepseekProvider
145
- * (DEEPSEEK_API_KEY env).
146
- * - everything else (claude-*, custom full ids)
147
- * → AnthropicProvider
148
- * (ANTHROPIC_API_KEY env).
149
- *
150
- * Exported so tests / hosts can lock the dispatch shape independently of
151
- * `maestroProvider`'s I/O. The codex match is prefix-based so hosts can ship
152
- * new codex slugs (gpt-5.6, future tiers) without a dispatcher change — only
153
- * the registry alias map needs updating.
124
+ * DeepSeek cannot currently consume Maestro image blocks natively in this
125
+ * adapter, so when a Gemini API key is configured we expose a narrow vision
126
+ * fallback tool only for DeepSeek models. Other providers keep their existing
127
+ * tool menu and avoid unnecessary third-party image upload/cost.
154
128
  */
155
- export declare function providerForModel(resolvedModel: string): Provider;
156
- /**
157
- * Combine two optional thinking budgets — keyword-derived and effort-derived
158
- * — by picking the higher non-undefined value. Used by `maestroProvider` so
159
- * an explicit keyword in the prompt can escalate past the caller's static
160
- * effort config, but neither path silently downgrades the other.
161
- *
162
- * Truth table:
163
- * keyword=undef, effort=undef → undef (no thinking)
164
- * keyword=4096, effort=undef → 4096 (keyword only)
165
- * keyword=undef, effort=10000 → 10000 (effort only)
166
- * keyword=4096, effort=10000 → 10000 (effort higher)
167
- * keyword=31999, effort=4096 → 31999 (keyword higher — user
168
- * intent in prompt wins)
169
- *
170
- * Kept as a tiny helper rather than inlining so tests can exercise the
171
- * priority rule without spinning up the full maestroProvider pipeline.
172
- */
173
- export declare function pickHigherBudget(a: number | undefined, b: number | undefined): number | undefined;
129
+ export declare function shouldRegisterGeminiImageQATool(resolvedModel: string, env?: NodeJS.ProcessEnv): boolean;
130
+ export declare function deepseekImageHandlingPrompt(resolvedModel: string, geminiImageQaAvailable: boolean): string | undefined;
174
131
  /**
175
132
  * Recognize the multiple shapes Node + WHATWG fetch use when a request is
176
133
  * cancelled via `AbortController`:
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAGA,OAA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