@zhixuan92/multi-model-agent-core 0.4.0 → 1.1.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.
Files changed (128) hide show
  1. package/README.md +33 -93
  2. package/dist/config/load.js +9 -9
  3. package/dist/config/load.js.map +1 -1
  4. package/dist/config/schema.d.ts +169 -275
  5. package/dist/config/schema.d.ts.map +1 -1
  6. package/dist/config/schema.js +31 -40
  7. package/dist/config/schema.js.map +1 -1
  8. package/dist/cost/cost-meter.d.ts +13 -0
  9. package/dist/cost/cost-meter.d.ts.map +1 -0
  10. package/dist/cost/cost-meter.js +20 -0
  11. package/dist/cost/cost-meter.js.map +1 -0
  12. package/dist/delegate-with-escalation.d.ts +1 -28
  13. package/dist/delegate-with-escalation.d.ts.map +1 -1
  14. package/dist/delegate-with-escalation.js +9 -89
  15. package/dist/delegate-with-escalation.js.map +1 -1
  16. package/dist/error-codes.d.ts +4 -0
  17. package/dist/error-codes.d.ts.map +1 -0
  18. package/dist/error-codes.js +16 -0
  19. package/dist/error-codes.js.map +1 -0
  20. package/dist/index.d.ts +5 -5
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +4 -5
  23. package/dist/index.js.map +1 -1
  24. package/dist/model-profiles.json +10 -5
  25. package/dist/provider.d.ts +2 -2
  26. package/dist/provider.d.ts.map +1 -1
  27. package/dist/provider.js +10 -13
  28. package/dist/provider.js.map +1 -1
  29. package/dist/readiness/normalization-budget.d.ts +2 -0
  30. package/dist/readiness/normalization-budget.d.ts.map +1 -0
  31. package/dist/readiness/normalization-budget.js +9 -0
  32. package/dist/readiness/normalization-budget.js.map +1 -0
  33. package/dist/readiness/normalize-brief.d.ts +17 -0
  34. package/dist/readiness/normalize-brief.d.ts.map +1 -0
  35. package/dist/readiness/normalize-brief.js +124 -0
  36. package/dist/readiness/normalize-brief.js.map +1 -0
  37. package/dist/readiness/readiness.d.ts +16 -0
  38. package/dist/readiness/readiness.d.ts.map +1 -0
  39. package/dist/readiness/readiness.js +160 -0
  40. package/dist/readiness/readiness.js.map +1 -0
  41. package/dist/reporting/structured-report.d.ts +18 -0
  42. package/dist/reporting/structured-report.d.ts.map +1 -0
  43. package/dist/reporting/structured-report.js +100 -0
  44. package/dist/reporting/structured-report.js.map +1 -0
  45. package/dist/review/aggregate-result.d.ts +3 -0
  46. package/dist/review/aggregate-result.d.ts.map +1 -0
  47. package/dist/review/aggregate-result.js +31 -0
  48. package/dist/review/aggregate-result.js.map +1 -0
  49. package/dist/review/quality-reviewer.d.ts +13 -0
  50. package/dist/review/quality-reviewer.d.ts.map +1 -0
  51. package/dist/review/quality-reviewer.js +39 -0
  52. package/dist/review/quality-reviewer.js.map +1 -0
  53. package/dist/review/reviewer-prompt.d.ts +10 -0
  54. package/dist/review/reviewer-prompt.d.ts.map +1 -0
  55. package/dist/review/reviewer-prompt.js +58 -0
  56. package/dist/review/reviewer-prompt.js.map +1 -0
  57. package/dist/review/spec-reviewer.d.ts +13 -0
  58. package/dist/review/spec-reviewer.d.ts.map +1 -0
  59. package/dist/review/spec-reviewer.js +37 -0
  60. package/dist/review/spec-reviewer.js.map +1 -0
  61. package/dist/routing/model-profiles.d.ts +5 -0
  62. package/dist/routing/model-profiles.d.ts.map +1 -1
  63. package/dist/routing/model-profiles.js +5 -0
  64. package/dist/routing/model-profiles.js.map +1 -1
  65. package/dist/routing/resolve-agent.d.ts +8 -0
  66. package/dist/routing/resolve-agent.d.ts.map +1 -0
  67. package/dist/routing/resolve-agent.js +45 -0
  68. package/dist/routing/resolve-agent.js.map +1 -0
  69. package/dist/run-tasks.d.ts +0 -23
  70. package/dist/run-tasks.d.ts.map +1 -1
  71. package/dist/run-tasks.js +241 -72
  72. package/dist/run-tasks.js.map +1 -1
  73. package/dist/runners/claude-runner.d.ts +2 -2
  74. package/dist/runners/claude-runner.d.ts.map +1 -1
  75. package/dist/runners/claude-runner.js +76 -28
  76. package/dist/runners/claude-runner.js.map +1 -1
  77. package/dist/runners/codex-runner.d.ts +2 -2
  78. package/dist/runners/codex-runner.d.ts.map +1 -1
  79. package/dist/runners/codex-runner.js +77 -24
  80. package/dist/runners/codex-runner.js.map +1 -1
  81. package/dist/runners/openai-runner.d.ts +2 -2
  82. package/dist/runners/openai-runner.d.ts.map +1 -1
  83. package/dist/runners/openai-runner.js +141 -22
  84. package/dist/runners/openai-runner.js.map +1 -1
  85. package/dist/runners/prevention.d.ts +2 -0
  86. package/dist/runners/prevention.d.ts.map +1 -1
  87. package/dist/runners/prevention.js +12 -0
  88. package/dist/runners/prevention.js.map +1 -1
  89. package/dist/runners/supervision.d.ts +1 -5
  90. package/dist/runners/supervision.d.ts.map +1 -1
  91. package/dist/runners/supervision.js +0 -68
  92. package/dist/runners/supervision.js.map +1 -1
  93. package/dist/tools/call-cache.d.ts +16 -0
  94. package/dist/tools/call-cache.d.ts.map +1 -0
  95. package/dist/tools/call-cache.js +28 -0
  96. package/dist/tools/call-cache.js.map +1 -0
  97. package/dist/tools/claude-adapter.d.ts +2 -2
  98. package/dist/tools/claude-adapter.d.ts.map +1 -1
  99. package/dist/tools/claude-adapter.js +12 -5
  100. package/dist/tools/claude-adapter.js.map +1 -1
  101. package/dist/tools/definitions.d.ts +4 -0
  102. package/dist/tools/definitions.d.ts.map +1 -1
  103. package/dist/tools/definitions.js +4 -0
  104. package/dist/tools/definitions.js.map +1 -1
  105. package/dist/tools/openai-adapter.d.ts +4 -4
  106. package/dist/tools/openai-adapter.d.ts.map +1 -1
  107. package/dist/tools/openai-adapter.js +9 -2
  108. package/dist/tools/openai-adapter.js.map +1 -1
  109. package/dist/types.d.ts +79 -31
  110. package/dist/types.d.ts.map +1 -1
  111. package/dist/types.js.map +1 -1
  112. package/package.json +48 -16
  113. package/dist/routing/capabilities.d.ts +0 -3
  114. package/dist/routing/capabilities.d.ts.map +0 -1
  115. package/dist/routing/capabilities.js +0 -26
  116. package/dist/routing/capabilities.js.map +0 -1
  117. package/dist/routing/get-provider-eligibility.d.ts +0 -8
  118. package/dist/routing/get-provider-eligibility.d.ts.map +0 -1
  119. package/dist/routing/get-provider-eligibility.js +0 -53
  120. package/dist/routing/get-provider-eligibility.js.map +0 -1
  121. package/dist/routing/resolve-task-capabilities.d.ts +0 -7
  122. package/dist/routing/resolve-task-capabilities.d.ts.map +0 -1
  123. package/dist/routing/resolve-task-capabilities.js +0 -19
  124. package/dist/routing/resolve-task-capabilities.js.map +0 -1
  125. package/dist/routing/select-provider-for-task.d.ts +0 -18
  126. package/dist/routing/select-provider-for-task.d.ts.map +0 -1
  127. package/dist/routing/select-provider-for-task.js +0 -50
  128. package/dist/routing/select-provider-for-task.js.map +0 -1
package/README.md CHANGED
@@ -1,16 +1,8 @@
1
1
  # @zhixuan92/multi-model-agent-core
2
2
 
3
- **Runtime library for [`multi-model-agent`](https://github.com/zhixuan312/multi-model-agent) import it to run multi-provider agent tasks directly from your own Node program.**
3
+ **Runtime library for multi-model-agent.** Import it to run multi-provider agent tasks directly from your own Node program — same routing, supervision, and review pipeline, no MCP client needed.
4
4
 
5
- Use this package when you want to embed the same routing and dispatch logic inside your own process instead of going through an MCP client. It ships:
6
-
7
- - **Provider runners** — Claude (`@anthropic-ai/claude-agent-sdk`), Codex (OpenAI Responses API with `codex login` or `OPENAI_API_KEY`), and any OpenAI-compatible endpoint.
8
- - **Routing engine** — capability filter → quality tier filter → cheapest qualifying provider, with the full escalation chain walked automatically on failure.
9
- - **`runTasks`** — a single function that takes a task array and a config, runs them in parallel, and returns one result per task (usage, costUSD, savedCostUSD, files touched, status, escalation log).
10
- - **Config schema** — Zod-validated loader for `~/.multi-model/config.json` so callers get the same config contract as the MCP server.
11
- - **Sandboxed tool layer** — `readFile`, `writeFile`, `grep`, `glob`, `listFiles`, `runShell` with `cwd-only` confinement via `fs.realpath`, size caps, and per-call enforcement.
12
-
13
- > **If you just want a `delegate_tasks` tool in Claude Code / Claude Desktop / Codex CLI**, install [`@zhixuan92/multi-model-agent-mcp`](https://www.npmjs.com/package/@zhixuan92/multi-model-agent-mcp) instead — it wraps this library in an MCP stdio server. You don't need `-core` directly for that.
5
+ > **Just want your AI assistant to delegate work?** Install [`@zhixuan92/multi-model-agent-mcp`](https://www.npmjs.com/package/@zhixuan92/multi-model-agent-mcp) instead it wraps this library in an MCP server.
14
6
 
15
7
  ## Install
16
8
 
@@ -18,104 +10,52 @@ Use this package when you want to embed the same routing and dispatch logic insi
18
10
  npm install @zhixuan92/multi-model-agent-core
19
11
  ```
20
12
 
21
- Requires Node `>= 22`. ESM only.
13
+ Requires Node >= 22. ESM only.
22
14
 
23
- ## What's exported
15
+ ## Quick example
24
16
 
25
17
  ```ts
26
- import {
27
- // Config
28
- loadConfigFromFile,
29
- parseConfig,
30
- multiModelConfigSchema,
31
-
32
- // Provider factory + dispatch
33
- createProvider,
34
- runTasks,
35
-
36
- // Routing helpers
37
- selectProviderForTask,
38
- getProviderEligibility,
39
- getBaseCapabilities,
40
- resolveTaskCapabilities,
41
- findModelProfile,
42
- getEffectiveCostTier,
43
- } from '@zhixuan92/multi-model-agent-core';
44
-
45
- import type {
46
- MultiModelConfig,
47
- ProviderConfig,
48
- TaskSpec,
49
- RunResult,
50
- RunStatus,
51
- Tier,
52
- Capability,
53
- CostTier,
54
- Effort,
55
- SandboxPolicy,
56
- } from '@zhixuan92/multi-model-agent-core';
57
- ```
58
-
59
- Subpath exports are available for tree-shaking-friendly imports:
60
-
61
- | Subpath | What |
62
- | --- | --- |
63
- | `./config/schema` | `parseConfig`, `multiModelConfigSchema` |
64
- | `./config/load` | `loadConfigFromFile` |
65
- | `./routing/capabilities` | base provider capability table |
66
- | `./routing/model-profiles` | tier/cost defaults per model name prefix |
67
- | `./routing/select-provider-for-task` | routing decision |
68
- | `./routing/get-provider-eligibility` | per-provider eligibility breakdown with reasons |
69
- | `./routing/resolve-task-capabilities` | merges per-task overrides into provider capabilities |
70
- | `./provider` | `createProvider` factory |
71
- | `./run-tasks` | `runTasks` parallel dispatcher |
72
- | `./types` | all shared types |
18
+ import { loadConfigFromFile } from '@zhixuan92/multi-model-agent-core/config/load';
19
+ import { runTasks } from '@zhixuan92/multi-model-agent-core/run-tasks';
73
20
 
74
- ## Quick example
21
+ const config = await loadConfigFromFile();
75
22
 
76
- ```ts
77
- import { runTasks } from '@zhixuan92/multi-model-agent-core';
78
-
79
- const config = {
80
- providers: {
81
- claude: { type: 'claude', model: 'claude-sonnet-4-6' },
82
- codex: { type: 'codex', model: 'gpt-5-codex' },
83
- },
84
- defaults: { maxTurns: 200, timeoutMs: 600_000, tools: 'full' },
85
- };
86
-
87
- const results = await runTasks(
88
- [
89
- { prompt: 'Refactor auth.ts to use JWT.', tier: 'reasoning', requiredCapabilities: ['file_read', 'file_write'] },
90
- { prompt: 'List all .ts files.', tier: 'trivial', requiredCapabilities: ['glob'] },
91
- ],
92
- config,
93
- );
23
+ const results = await runTasks([
24
+ { prompt: 'Refactor auth.ts to use JWT.', agentType: 'complex' },
25
+ { prompt: 'Write unit tests for auth module.', agentType: 'standard' },
26
+ ], config);
94
27
 
95
28
  for (const r of results) {
96
- console.log(r.status, r.output);
29
+ console.log(r.status, r.usage.costUSD, r.output);
97
30
  }
98
31
  ```
99
32
 
100
- `runTasks` runs each task on the cheapest eligible provider in parallel and returns a result per task. Pin a task to a specific provider by adding `provider: 'claude'`.
101
-
102
- ## Sandbox
103
-
104
- File tools enforce `sandboxPolicy: 'cwd-only'` by default — paths must resolve (via `fs.realpath`) inside the task's `cwd`. `runShell` is hard-disabled under `cwd-only`. `readFile` rejects targets larger than 50 MiB and `writeFile` rejects content larger than 100 MiB before touching memory or disk.
105
-
106
- ## Updating
107
-
108
- Bump via `npm install @zhixuan92/multi-model-agent-core@latest` (or `npm update`). The package is on **0.x semver**: any MINOR bump (`0.2.x → 0.3.0`) may change the config schema, the `runTasks` task shape, or exported types. PATCH bumps (`0.3.0 → 0.3.1`) are strictly backwards-compatible bug fixes.
33
+ ## What's inside
109
34
 
110
- Always skim [`CHANGELOG.md`](https://github.com/zhixuan312/multi-model-agent/blob/HEAD/CHANGELOG.md) before picking up a new MINOR version if it calls out a schema change, update your config loader and any stored task specs before upgrading. Subpath exports listed above are part of the public API contract and are versioned together with the main entry point.
35
+ - **Provider runners**Claude, Codex, and any OpenAI-compatible endpoint
36
+ - **Routing engine** — capability filter → agent type → cheapest qualifier
37
+ - **`runTasks`** — parallel dispatch, returns per-task results with usage, cost, files touched, status, and escalation log
38
+ - **Reviewed lifecycle** — spec review + quality review by a different agent
39
+ - **Config schema** — Zod-validated, same contract as the MCP server
40
+ - **Sandboxed tools** — `readFile`, `writeFile`, `grep`, `glob`, `listFiles`, `runShell` with `cwd-only` confinement
111
41
 
112
- If you also depend on `@zhixuan92/multi-model-agent-mcp`, keep the two packages on matching MINOR versions — the MCP server declares a `^0.X.0` range on this library and mismatched versions can surface as type drift or schema validation errors.
42
+ ## Subpath exports
113
43
 
114
- ## Documentation
44
+ | Subpath | What |
45
+ |---|---|
46
+ | `./config/schema` | `parseConfig`, `multiModelConfigSchema` |
47
+ | `./config/load` | `loadConfigFromFile` |
48
+ | `./routing/select-provider-for-task` | Routing decision |
49
+ | `./routing/get-provider-eligibility` | Per-provider eligibility with reasons |
50
+ | `./routing/capabilities` | Base provider capability table |
51
+ | `./routing/model-profiles` | Cost/tier defaults per model |
52
+ | `./provider` | `createProvider` factory |
53
+ | `./run-tasks` | `runTasks` parallel dispatcher |
54
+ | `./types` | All shared types |
115
55
 
116
- Full docs, configuration reference, supported providers, and the routing matrix live in the project README:
56
+ ## Full documentation
117
57
 
118
- **<https://github.com/zhixuan312/multi-model-agent#readme>**
58
+ **[github.com/zhixuan312/multi-model-agent](https://github.com/zhixuan312/multi-model-agent)**
119
59
 
120
60
  ## License
121
61
 
@@ -1,24 +1,24 @@
1
1
  import fs from 'fs';
2
2
  import { multiModelConfigSchema } from './schema.js';
3
3
  /**
4
- * Warn if any openai-compatible provider in the parsed config carries an
5
- * inline `apiKey` instead of using `apiKeyEnv`. The schema permits both for
6
- * backwards compatibility, but storing a plaintext API key in a config file
7
- * that may end up in a backup, dotfile repo, or git is a footgun. We surface
8
- * the issue at load time, once, so the operator notices.
4
+ * Warn if any openai-compatible agent in the parsed config carries an
5
+ * inline `apiKey` instead of using `apiKeyEnv`. The schema permits both,
6
+ * but storing a plaintext API key in a config file that may end up in a
7
+ * backup, dotfile repo, or git is a footgun. We surface the issue at load
8
+ * time, once, so the operator notices.
9
9
  */
10
10
  function warnOnInlineApiKey(config, configPath) {
11
11
  const offenders = [];
12
- for (const [name, provider] of Object.entries(config.providers)) {
13
- if (provider.type === 'openai-compatible' &&
14
- typeof provider.apiKey === 'string') {
12
+ for (const [name, agent] of Object.entries(config.agents)) {
13
+ if (agent.type === 'openai-compatible' &&
14
+ typeof agent.apiKey === 'string') {
15
15
  offenders.push(name);
16
16
  }
17
17
  }
18
18
  if (offenders.length > 0) {
19
19
  // eslint-disable-next-line no-console
20
20
  console.warn(`[multi-model-agent] WARNING: ${configPath} stores an inline \`apiKey\` for ` +
21
- `provider(s): ${offenders.join(', ')}. Prefer \`apiKeyEnv\` and read the key ` +
21
+ `agent(s): ${offenders.join(', ')}. Prefer \`apiKeyEnv\` and read the key ` +
22
22
  `from an environment variable so it never lands in version control.`);
23
23
  }
24
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAGrD;;;;;;GAMG;AACH,SAAS,kBAAkB,CAAC,MAAwB,EAAE,UAAkB;IACtE,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;QAChE,IACE,QAAQ,CAAC,IAAI,KAAK,mBAAmB;YACrC,OAAQ,QAAiC,CAAC,MAAM,KAAK,QAAQ,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AAC;gBACjD,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBACjC,OAAO,CAAC,MAAM,CAAC,CAAC;YAClB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,MAAM,CAAC,IAAI,KAAK,CAAC,qBAAqB,IAAI,KAAK,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAChG,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,285 +1,179 @@
1
1
  import { z } from 'zod';
2
2
  import type { MultiModelConfig } from '../types.js';
3
- export declare const codexProviderConfigSchema: z.ZodObject<{
4
- type: z.ZodLiteral<"codex">;
5
- model: z.ZodString;
6
- effort: z.ZodOptional<z.ZodEnum<{
7
- high: "high";
8
- medium: "medium";
9
- low: "low";
10
- none: "none";
11
- }>>;
12
- maxTurns: z.ZodOptional<z.ZodNumber>;
13
- timeoutMs: z.ZodOptional<z.ZodNumber>;
14
- sandboxPolicy: z.ZodOptional<z.ZodEnum<{
15
- none: "none";
16
- "cwd-only": "cwd-only";
17
- }>>;
18
- hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
19
- web_search: "web_search";
20
- image_generation: "image_generation";
21
- code_interpreter: "code_interpreter";
22
- }>>>;
23
- costTier: z.ZodOptional<z.ZodEnum<{
24
- high: "high";
25
- medium: "medium";
26
- low: "low";
27
- free: "free";
28
- }>>;
29
- inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
30
- outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
31
- inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
32
- }, z.core.$strip>;
33
- export declare const claudeProviderConfigSchema: z.ZodObject<{
34
- type: z.ZodLiteral<"claude">;
35
- model: z.ZodString;
36
- effort: z.ZodOptional<z.ZodEnum<{
37
- high: "high";
38
- medium: "medium";
39
- low: "low";
40
- none: "none";
41
- }>>;
42
- maxTurns: z.ZodOptional<z.ZodNumber>;
43
- timeoutMs: z.ZodOptional<z.ZodNumber>;
44
- sandboxPolicy: z.ZodOptional<z.ZodEnum<{
45
- none: "none";
46
- "cwd-only": "cwd-only";
47
- }>>;
48
- hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
49
- web_search: "web_search";
50
- image_generation: "image_generation";
51
- code_interpreter: "code_interpreter";
52
- }>>>;
53
- costTier: z.ZodOptional<z.ZodEnum<{
54
- high: "high";
55
- medium: "medium";
56
- low: "low";
57
- free: "free";
58
- }>>;
59
- inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
60
- outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
61
- inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
62
- }, z.core.$strip>;
63
- export declare const openAICompatibleProviderConfigSchema: z.ZodObject<{
64
- type: z.ZodLiteral<"openai-compatible">;
65
- model: z.ZodString;
66
- baseUrl: z.ZodString;
67
- apiKey: z.ZodOptional<z.ZodString>;
68
- apiKeyEnv: z.ZodOptional<z.ZodString>;
69
- effort: z.ZodOptional<z.ZodEnum<{
70
- high: "high";
71
- medium: "medium";
72
- low: "low";
73
- none: "none";
74
- }>>;
75
- maxTurns: z.ZodOptional<z.ZodNumber>;
76
- timeoutMs: z.ZodOptional<z.ZodNumber>;
77
- sandboxPolicy: z.ZodOptional<z.ZodEnum<{
78
- none: "none";
79
- "cwd-only": "cwd-only";
80
- }>>;
81
- hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
82
- web_search: "web_search";
83
- image_generation: "image_generation";
84
- code_interpreter: "code_interpreter";
85
- }>>>;
86
- costTier: z.ZodOptional<z.ZodEnum<{
87
- high: "high";
88
- medium: "medium";
89
- low: "low";
90
- free: "free";
91
- }>>;
92
- inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
93
- outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
94
- inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
95
- }, z.core.$strip>;
96
- export declare const providerConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
97
- type: z.ZodLiteral<"codex">;
98
- model: z.ZodString;
99
- effort: z.ZodOptional<z.ZodEnum<{
100
- high: "high";
101
- medium: "medium";
102
- low: "low";
103
- none: "none";
104
- }>>;
105
- maxTurns: z.ZodOptional<z.ZodNumber>;
106
- timeoutMs: z.ZodOptional<z.ZodNumber>;
107
- sandboxPolicy: z.ZodOptional<z.ZodEnum<{
108
- none: "none";
109
- "cwd-only": "cwd-only";
110
- }>>;
111
- hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
112
- web_search: "web_search";
113
- image_generation: "image_generation";
114
- code_interpreter: "code_interpreter";
115
- }>>>;
116
- costTier: z.ZodOptional<z.ZodEnum<{
117
- high: "high";
118
- medium: "medium";
119
- low: "low";
120
- free: "free";
121
- }>>;
122
- inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
123
- outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
124
- inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
125
- }, z.core.$strip>, z.ZodObject<{
126
- type: z.ZodLiteral<"claude">;
127
- model: z.ZodString;
128
- effort: z.ZodOptional<z.ZodEnum<{
129
- high: "high";
130
- medium: "medium";
131
- low: "low";
132
- none: "none";
133
- }>>;
134
- maxTurns: z.ZodOptional<z.ZodNumber>;
135
- timeoutMs: z.ZodOptional<z.ZodNumber>;
136
- sandboxPolicy: z.ZodOptional<z.ZodEnum<{
137
- none: "none";
138
- "cwd-only": "cwd-only";
139
- }>>;
140
- hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
141
- web_search: "web_search";
142
- image_generation: "image_generation";
143
- code_interpreter: "code_interpreter";
144
- }>>>;
145
- costTier: z.ZodOptional<z.ZodEnum<{
146
- high: "high";
147
- medium: "medium";
148
- low: "low";
149
- free: "free";
150
- }>>;
151
- inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
152
- outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
153
- inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
154
- }, z.core.$strip>, z.ZodObject<{
155
- type: z.ZodLiteral<"openai-compatible">;
156
- model: z.ZodString;
157
- baseUrl: z.ZodString;
158
- apiKey: z.ZodOptional<z.ZodString>;
159
- apiKeyEnv: z.ZodOptional<z.ZodString>;
160
- effort: z.ZodOptional<z.ZodEnum<{
161
- high: "high";
162
- medium: "medium";
163
- low: "low";
164
- none: "none";
165
- }>>;
166
- maxTurns: z.ZodOptional<z.ZodNumber>;
167
- timeoutMs: z.ZodOptional<z.ZodNumber>;
168
- sandboxPolicy: z.ZodOptional<z.ZodEnum<{
169
- none: "none";
170
- "cwd-only": "cwd-only";
171
- }>>;
172
- hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
173
- web_search: "web_search";
174
- image_generation: "image_generation";
175
- code_interpreter: "code_interpreter";
176
- }>>>;
177
- costTier: z.ZodOptional<z.ZodEnum<{
178
- high: "high";
179
- medium: "medium";
180
- low: "low";
181
- free: "free";
182
- }>>;
183
- inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
184
- outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
185
- inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
186
- }, z.core.$strip>], "type">;
187
3
  export declare const multiModelConfigSchema: z.ZodObject<{
188
- providers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
189
- type: z.ZodLiteral<"codex">;
190
- model: z.ZodString;
191
- effort: z.ZodOptional<z.ZodEnum<{
192
- high: "high";
193
- medium: "medium";
194
- low: "low";
195
- none: "none";
196
- }>>;
197
- maxTurns: z.ZodOptional<z.ZodNumber>;
198
- timeoutMs: z.ZodOptional<z.ZodNumber>;
199
- sandboxPolicy: z.ZodOptional<z.ZodEnum<{
200
- none: "none";
201
- "cwd-only": "cwd-only";
202
- }>>;
203
- hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
204
- web_search: "web_search";
205
- image_generation: "image_generation";
206
- code_interpreter: "code_interpreter";
207
- }>>>;
208
- costTier: z.ZodOptional<z.ZodEnum<{
209
- high: "high";
210
- medium: "medium";
211
- low: "low";
212
- free: "free";
213
- }>>;
214
- inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
215
- outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
216
- inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
217
- }, z.core.$strip>, z.ZodObject<{
218
- type: z.ZodLiteral<"claude">;
219
- model: z.ZodString;
220
- effort: z.ZodOptional<z.ZodEnum<{
221
- high: "high";
222
- medium: "medium";
223
- low: "low";
224
- none: "none";
225
- }>>;
226
- maxTurns: z.ZodOptional<z.ZodNumber>;
227
- timeoutMs: z.ZodOptional<z.ZodNumber>;
228
- sandboxPolicy: z.ZodOptional<z.ZodEnum<{
229
- none: "none";
230
- "cwd-only": "cwd-only";
231
- }>>;
232
- hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
233
- web_search: "web_search";
234
- image_generation: "image_generation";
235
- code_interpreter: "code_interpreter";
236
- }>>>;
237
- costTier: z.ZodOptional<z.ZodEnum<{
238
- high: "high";
239
- medium: "medium";
240
- low: "low";
241
- free: "free";
242
- }>>;
243
- inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
244
- outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
245
- inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
246
- }, z.core.$strip>, z.ZodObject<{
247
- type: z.ZodLiteral<"openai-compatible">;
248
- model: z.ZodString;
249
- baseUrl: z.ZodString;
250
- apiKey: z.ZodOptional<z.ZodString>;
251
- apiKeyEnv: z.ZodOptional<z.ZodString>;
252
- effort: z.ZodOptional<z.ZodEnum<{
253
- high: "high";
254
- medium: "medium";
255
- low: "low";
256
- none: "none";
257
- }>>;
258
- maxTurns: z.ZodOptional<z.ZodNumber>;
259
- timeoutMs: z.ZodOptional<z.ZodNumber>;
260
- sandboxPolicy: z.ZodOptional<z.ZodEnum<{
261
- none: "none";
262
- "cwd-only": "cwd-only";
263
- }>>;
264
- hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
265
- web_search: "web_search";
266
- image_generation: "image_generation";
267
- code_interpreter: "code_interpreter";
268
- }>>>;
269
- costTier: z.ZodOptional<z.ZodEnum<{
270
- high: "high";
271
- medium: "medium";
272
- low: "low";
273
- free: "free";
274
- }>>;
275
- inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
276
- outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
277
- inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
278
- }, z.core.$strip>], "type">>>;
4
+ agents: z.ZodObject<{
5
+ standard: z.ZodDiscriminatedUnion<[z.ZodObject<{
6
+ model: z.ZodString;
7
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
8
+ web_search: "web_search";
9
+ web_fetch: "web_fetch";
10
+ }>>>;
11
+ effort: z.ZodOptional<z.ZodEnum<{
12
+ high: "high";
13
+ medium: "medium";
14
+ low: "low";
15
+ none: "none";
16
+ }>>;
17
+ inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
18
+ outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
19
+ maxTurns: z.ZodOptional<z.ZodNumber>;
20
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
21
+ sandboxPolicy: z.ZodOptional<z.ZodEnum<{
22
+ none: "none";
23
+ "cwd-only": "cwd-only";
24
+ }>>;
25
+ inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
26
+ type: z.ZodLiteral<"openai-compatible">;
27
+ baseUrl: z.ZodString;
28
+ apiKey: z.ZodOptional<z.ZodString>;
29
+ apiKeyEnv: z.ZodOptional<z.ZodString>;
30
+ hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
31
+ web_search: "web_search";
32
+ }>>>;
33
+ }, z.core.$strip>, z.ZodObject<{
34
+ model: z.ZodString;
35
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
36
+ web_search: "web_search";
37
+ web_fetch: "web_fetch";
38
+ }>>>;
39
+ effort: z.ZodOptional<z.ZodEnum<{
40
+ high: "high";
41
+ medium: "medium";
42
+ low: "low";
43
+ none: "none";
44
+ }>>;
45
+ inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
46
+ outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
47
+ maxTurns: z.ZodOptional<z.ZodNumber>;
48
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
49
+ sandboxPolicy: z.ZodOptional<z.ZodEnum<{
50
+ none: "none";
51
+ "cwd-only": "cwd-only";
52
+ }>>;
53
+ inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
54
+ type: z.ZodLiteral<"claude">;
55
+ hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
56
+ web_search: "web_search";
57
+ image_generation: "image_generation";
58
+ code_interpreter: "code_interpreter";
59
+ }>>>;
60
+ }, z.core.$strict>, z.ZodObject<{
61
+ model: z.ZodString;
62
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
63
+ web_search: "web_search";
64
+ web_fetch: "web_fetch";
65
+ }>>>;
66
+ effort: z.ZodOptional<z.ZodEnum<{
67
+ high: "high";
68
+ medium: "medium";
69
+ low: "low";
70
+ none: "none";
71
+ }>>;
72
+ inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
73
+ outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
74
+ maxTurns: z.ZodOptional<z.ZodNumber>;
75
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
76
+ sandboxPolicy: z.ZodOptional<z.ZodEnum<{
77
+ none: "none";
78
+ "cwd-only": "cwd-only";
79
+ }>>;
80
+ inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
81
+ type: z.ZodLiteral<"codex">;
82
+ hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
83
+ web_search: "web_search";
84
+ image_generation: "image_generation";
85
+ code_interpreter: "code_interpreter";
86
+ }>>>;
87
+ }, z.core.$strict>], "type">;
88
+ complex: z.ZodDiscriminatedUnion<[z.ZodObject<{
89
+ model: z.ZodString;
90
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
91
+ web_search: "web_search";
92
+ web_fetch: "web_fetch";
93
+ }>>>;
94
+ effort: z.ZodOptional<z.ZodEnum<{
95
+ high: "high";
96
+ medium: "medium";
97
+ low: "low";
98
+ none: "none";
99
+ }>>;
100
+ inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
101
+ outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
102
+ maxTurns: z.ZodOptional<z.ZodNumber>;
103
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
104
+ sandboxPolicy: z.ZodOptional<z.ZodEnum<{
105
+ none: "none";
106
+ "cwd-only": "cwd-only";
107
+ }>>;
108
+ inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
109
+ type: z.ZodLiteral<"openai-compatible">;
110
+ baseUrl: z.ZodString;
111
+ apiKey: z.ZodOptional<z.ZodString>;
112
+ apiKeyEnv: z.ZodOptional<z.ZodString>;
113
+ hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
114
+ web_search: "web_search";
115
+ }>>>;
116
+ }, z.core.$strip>, z.ZodObject<{
117
+ model: z.ZodString;
118
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
119
+ web_search: "web_search";
120
+ web_fetch: "web_fetch";
121
+ }>>>;
122
+ effort: z.ZodOptional<z.ZodEnum<{
123
+ high: "high";
124
+ medium: "medium";
125
+ low: "low";
126
+ none: "none";
127
+ }>>;
128
+ inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
129
+ outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
130
+ maxTurns: z.ZodOptional<z.ZodNumber>;
131
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
132
+ sandboxPolicy: z.ZodOptional<z.ZodEnum<{
133
+ none: "none";
134
+ "cwd-only": "cwd-only";
135
+ }>>;
136
+ inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
137
+ type: z.ZodLiteral<"claude">;
138
+ hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
139
+ web_search: "web_search";
140
+ image_generation: "image_generation";
141
+ code_interpreter: "code_interpreter";
142
+ }>>>;
143
+ }, z.core.$strict>, z.ZodObject<{
144
+ model: z.ZodString;
145
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
146
+ web_search: "web_search";
147
+ web_fetch: "web_fetch";
148
+ }>>>;
149
+ effort: z.ZodOptional<z.ZodEnum<{
150
+ high: "high";
151
+ medium: "medium";
152
+ low: "low";
153
+ none: "none";
154
+ }>>;
155
+ inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
156
+ outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
157
+ maxTurns: z.ZodOptional<z.ZodNumber>;
158
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
159
+ sandboxPolicy: z.ZodOptional<z.ZodEnum<{
160
+ none: "none";
161
+ "cwd-only": "cwd-only";
162
+ }>>;
163
+ inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
164
+ type: z.ZodLiteral<"codex">;
165
+ hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
166
+ web_search: "web_search";
167
+ image_generation: "image_generation";
168
+ code_interpreter: "code_interpreter";
169
+ }>>>;
170
+ }, z.core.$strict>], "type">;
171
+ }, z.core.$strip>;
279
172
  defaults: z.ZodDefault<z.ZodObject<{
280
173
  maxTurns: z.ZodDefault<z.ZodNumber>;
281
174
  timeoutMs: z.ZodDefault<z.ZodNumber>;
282
175
  tools: z.ZodDefault<z.ZodEnum<{
176
+ readonly: "readonly";
283
177
  none: "none";
284
178
  full: "full";
285
179
  }>>;