@oh-my-ai-sdk/omakase 0.2.0-beta.1 → 0.2.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +147 -8
  2. package/dist/agent-runtime/adapters/harness-claude-code/bridge/index.mjs +1849 -0
  3. package/dist/agent-runtime/adapters/harness-claude-code/bridge/package.json +13 -0
  4. package/dist/agent-runtime/adapters/harness-claude-code/bridge/pnpm-lock.yaml +1041 -0
  5. package/dist/agent-runtime/adapters/harness-claude-code/bridge/pnpm-workspace.yaml +2 -0
  6. package/dist/agent-runtime/adapters/harness-claude-code/index.js +20386 -0
  7. package/dist/agent-runtime/adapters/harness-codex/bridge/index.mjs +1579 -0
  8. package/dist/agent-runtime/adapters/harness-codex/bridge/package.json +10 -0
  9. package/dist/agent-runtime/adapters/harness-codex/bridge/pnpm-lock.yaml +110 -0
  10. package/dist/agent-runtime/adapters/harness-codex/index.js +19608 -0
  11. package/dist/agent-runtime/adapters/harness-opencode/bridge/host-tool-mcp.mjs +101 -0
  12. package/dist/agent-runtime/adapters/harness-opencode/bridge/index.mjs +3009 -0
  13. package/dist/agent-runtime/adapters/harness-opencode/bridge/package.json +13 -0
  14. package/dist/agent-runtime/adapters/harness-opencode/bridge/pnpm-lock.yaml +933 -0
  15. package/dist/agent-runtime/adapters/harness-opencode/bridge/pnpm-workspace.yaml +2 -0
  16. package/dist/agent-runtime/adapters/harness-opencode/index.js +19940 -0
  17. package/dist/agent-runtime/licenses/@ai-sdk/gateway/LICENSE +13 -0
  18. package/dist/agent-runtime/licenses/@ai-sdk/harness/LICENSE +13 -0
  19. package/dist/agent-runtime/licenses/@ai-sdk/harness-acp/LICENSE +13 -0
  20. package/dist/agent-runtime/licenses/@ai-sdk/harness-claude-code/LICENSE +13 -0
  21. package/dist/agent-runtime/licenses/@ai-sdk/harness-codex/LICENSE +13 -0
  22. package/dist/agent-runtime/licenses/@ai-sdk/harness-cursor/LICENSE +13 -0
  23. package/dist/agent-runtime/licenses/@ai-sdk/harness-grok-build/LICENSE +13 -0
  24. package/dist/agent-runtime/licenses/@ai-sdk/harness-opencode/LICENSE +13 -0
  25. package/dist/agent-runtime/licenses/@ai-sdk/harness-pi/LICENSE +13 -0
  26. package/dist/agent-runtime/licenses/@ai-sdk/provider/LICENSE +13 -0
  27. package/dist/agent-runtime/licenses/@anthropic-ai/sdk/LICENSE +8 -0
  28. package/dist/agent-runtime/licenses/@archeism/local-fs/LICENSE +21 -0
  29. package/dist/agent-runtime/licenses/@google/genai/LICENSE +202 -0
  30. package/dist/agent-runtime/licenses/@oh-my-ai-sdk/omakase/LICENSE +201 -0
  31. package/dist/agent-runtime/licenses/@silvia-odwyer/photon-node/LICENSE.md +201 -0
  32. package/dist/agent-runtime/licenses/@vercel/oidc/LICENSE +202 -0
  33. package/dist/agent-runtime/licenses/@workflow/serde/LICENSE.md +3 -0
  34. package/dist/agent-runtime/licenses/agent-base/LICENSE +22 -0
  35. package/dist/agent-runtime/licenses/ai/LICENSE +13 -0
  36. package/dist/agent-runtime/licenses/base64-js/LICENSE +21 -0
  37. package/dist/agent-runtime/licenses/buffer-equal-constant-time/LICENSE.txt +12 -0
  38. package/dist/agent-runtime/licenses/cross-spawn/LICENSE +21 -0
  39. package/dist/agent-runtime/licenses/debug/LICENSE +20 -0
  40. package/dist/agent-runtime/licenses/ecdsa-sig-formatter/LICENSE +201 -0
  41. package/dist/agent-runtime/licenses/eventsource-parser/LICENSE +21 -0
  42. package/dist/agent-runtime/licenses/extend/LICENSE +23 -0
  43. package/dist/agent-runtime/licenses/fetch-blob/LICENSE +21 -0
  44. package/dist/agent-runtime/licenses/formdata-polyfill/LICENSE +21 -0
  45. package/dist/agent-runtime/licenses/gaxios/LICENSE +202 -0
  46. package/dist/agent-runtime/licenses/gcp-metadata/LICENSE +202 -0
  47. package/dist/agent-runtime/licenses/google-auth-library/LICENSE +202 -0
  48. package/dist/agent-runtime/licenses/google-logging-utils/LICENSE +202 -0
  49. package/dist/agent-runtime/licenses/graceful-fs/LICENSE +15 -0
  50. package/dist/agent-runtime/licenses/grok-mermaid/LICENSE +205 -0
  51. package/dist/agent-runtime/licenses/highlight.js/LICENSE +29 -0
  52. package/dist/agent-runtime/licenses/hosted-git-info/LICENSE +13 -0
  53. package/dist/agent-runtime/licenses/https-proxy-agent/LICENSE +22 -0
  54. package/dist/agent-runtime/licenses/ignore/LICENSE-MIT +21 -0
  55. package/dist/agent-runtime/licenses/isexe/LICENSE +15 -0
  56. package/dist/agent-runtime/licenses/jiti/LICENSE +21 -0
  57. package/dist/agent-runtime/licenses/json-bigint/LICENSE +20 -0
  58. package/dist/agent-runtime/licenses/jwa/LICENSE +17 -0
  59. package/dist/agent-runtime/licenses/jws/LICENSE +17 -0
  60. package/dist/agent-runtime/licenses/marked/LICENSE +44 -0
  61. package/dist/agent-runtime/licenses/node-domexception/LICENSE +21 -0
  62. package/dist/agent-runtime/licenses/node-fetch/LICENSE.md +22 -0
  63. package/dist/agent-runtime/licenses/openai/LICENSE +201 -0
  64. package/dist/agent-runtime/licenses/partial-json/LICENSE +21 -0
  65. package/dist/agent-runtime/licenses/proper-lockfile/LICENSE +21 -0
  66. package/dist/agent-runtime/licenses/safe-buffer/LICENSE +21 -0
  67. package/dist/agent-runtime/licenses/semver/LICENSE +15 -0
  68. package/dist/agent-runtime/licenses/signal-exit/LICENSE.txt +16 -0
  69. package/dist/agent-runtime/licenses/undici/LICENSE +21 -0
  70. package/dist/agent-runtime/licenses/web-streams-polyfill/LICENSE +22 -0
  71. package/dist/agent-runtime/licenses/which/LICENSE +15 -0
  72. package/dist/agent-runtime/licenses/yaml/LICENSE +13 -0
  73. package/dist/agent-runtime/licenses/zod/LICENSE +21 -0
  74. package/dist/agent-runtime/manifest.json +53 -0
  75. package/dist/agent-runtime/versions.json +83 -0
  76. package/dist/agent-runtime/worker.mjs +339169 -0
  77. package/dist/agents.d.ts +37 -0
  78. package/dist/agents.js +417 -0
  79. package/dist/cli.js +2 -1
  80. package/dist/code-mode.js +2 -2
  81. package/dist/durable-worker/versions.json +1 -1
  82. package/package.json +10 -4
package/README.md CHANGED
@@ -11,9 +11,10 @@ configured URI sources. No model-facing registry-management tools.
11
11
 
12
12
  ## CLI setup
13
13
 
14
- Requires Node.js22.13 or newer. No model key is needed by the host: your existing
15
- Claude/Codex session supplies the model. Configuration stays outside harness MCP
16
- registration.
14
+ Requires Node.js 22.13 or newer. The host itself needs no model key; your calling
15
+ Claude/Codex session supplies its own model. Registered child agents additionally
16
+ need Bun, their bootstrap prerequisites, and their own configured credentials
17
+ (see below). Configuration stays outside harness MCP registration.
17
18
 
18
19
  For a local beta candidate, install its packed `.tgz` with `bun add /absolute/path/to/archive.tgz`
19
20
  and configure your MCP client with the absolute path to that installation's
@@ -147,9 +148,146 @@ remains alive. Closing the server stops its worker and drains admitted handlers.
147
148
  Repeating `cell` creates a new intent, **not** a resume request; tools still need
148
149
  application idempotency or reconciliation for external effects.
149
150
 
150
- Keep ordinary mode for work that does not need these checkpoints. Parent–child
151
- agent enhancements and legacy Flow migration are not included in this beta.
151
+ Keep ordinary mode for work that does not need these checkpoints. Ordinary
152
+ execution shares its configured invocation deadline across guest code and tool
153
+ waits (120 seconds by default); durable mode is the long-running path.
154
+ Registered agent runs are available below; the old Flow DSL is not imported.
155
+
156
+
157
+ ## Registered agents in ordinary or durable cells
158
+
159
+ `@oh-my-ai-sdk/omakase/agents` exports `mountAgents(host, options)` and
160
+ `createAgentHost(options)`. Registration reuses Flow's `agent.yaml` directories,
161
+ named profiles, ordinary AI SDK tools under `tools/`, and runtime-download cache.
162
+ There is no new `run` DSL or separate agent MCP server: each trusted registration
163
+ becomes `agents.NAME({ prompt, workspaceDir? })` in the existing cell catalog.
164
+
165
+ The agent feature needs **Bun >=1.3.14** on PATH in addition to Node. Bridge-backed
166
+ Claude, Codex and OpenCode bootstraps also need **pnpm** and first-use registry
167
+ access; `bun add --global pnpm@10.32.1` installs the tested prerequisite. Adapters
168
+ and their pinned bootstrap recipes ship inside Omakase. The native CLI/SDK
169
+ dependencies are downloaded on first use, not bundled into the MCP executable.
170
+ Flow's content-addressed `~/.cache/ai-sdk-harness` store shares those downloads;
171
+ `AI_SDK_HARNESS_STORE` selects a different cache. Parallel runs still have
172
+ separate sessions and processes, not shared model credentials.
173
+
174
+ For Claude with GLM, create `.omakase/agents/reviewer/agent.yaml` in your project:
175
+
176
+ ```yaml
177
+ name: reviewer
178
+ harness: glm
179
+ permissionMode: allow-reads
180
+ activeTools: [read]
181
+ harnesses:
182
+ glm:
183
+ harness: claude-code
184
+ options:
185
+ auth: direct
186
+ model: glm-5.3
187
+ env:
188
+ ANTHROPIC_BASE_URL: https://api.z.ai/api/anthropic
189
+ ANTHROPIC_AUTH_TOKEN: ${ZHIPU_API_KEY}
190
+ sandbox:
191
+ type: local-persistent
192
+ ```
193
+
194
+ Supply `ZHIPU_API_KEY` to the MCP server environment; alternatively use a
195
+ `${file:/absolute/private/key-file}` reference. Do not commit credential values.
196
+ An adjacent `instructions.md` supplies the agent's standing instructions.
197
+ Other existing Flow names, directory references and `name#profile` references
198
+ resolve the same way; callers cannot choose manifests, models or environment
199
+ variables through tool arguments.
200
+
201
+ `activeTools` is the native SDK's optional capability allowlist, not a prompt.
202
+ This reviewer exposes only file reads. Omit it for the harness's usual tool set,
203
+ or list the built-in/custom tools the role actually needs. Approval policy is
204
+ separate; restricting capabilities does not grant approval or sandbox the agent.
205
+
206
+ Create `host.config.mjs` at that project's root:
207
+
208
+ ```js
209
+ import { fileURLToPath } from 'node:url';
210
+
211
+ export default async ({ createAgentHost }) => createAgentHost({
212
+ workspaceDir: fileURLToPath(new URL('.', import.meta.url)),
213
+ agents: {
214
+ reviewer: { ref: 'reviewer#glm' },
215
+ },
216
+ });
217
+ ```
218
+
219
+ Connect the same MCP server as before, now using this config:
220
+
221
+ ```sh
222
+ claude mcp add --scope project --transport stdio omakase -- \
223
+ npx -y @oh-my-ai-sdk/omakase@beta --config "$PWD/host.config.mjs"
224
+ ```
225
+
226
+ Long agent sessions also need a suitable **caller's MCP request deadline**.
227
+ For example, start Claude Code with `MCP_TOOL_TIMEOUT=900000 claude` for a
228
+ 15-minute deadline. Set this on the caller process, not in the MCP server's
229
+ environment; other harnesses have their own request limits.
230
+
231
+ Ask the caller to execute this body with `execution: "durable"`:
232
+
233
+ ```ts
234
+ const reviews = await Promise.all(
235
+ ['README.md', 'package.json'].map(path =>
236
+ agents.reviewer({ prompt: `Inspect ${path}; report concrete issues.` }),
237
+ ),
238
+ );
239
+ const synthesis = await agents.reviewer({
240
+ prompt: `Combine these actual findings: ${JSON.stringify(reviews)}`,
241
+ });
242
+ return { reviews, synthesis };
243
+ ```
152
244
 
245
+ Without `outputSchema`, a registered tool returns `{ sessionId, text }`. Set a
246
+ registration's `outputSchema` to a concrete JSON Schema to get that structured
247
+ value **directly** instead; its exact schema appears in the catalog and cell
248
+ type checker. Native/answer-tool schema support depends on the selected harness;
249
+ unsupported schemas fail rather than falling back to unvalidated prose.
250
+
251
+ Omit `workspaceDir` to use the registered workspace. A per-call override must
252
+ resolve inside that root, including symlink resolution. This selects the working
253
+ directory; it is not filesystem confinement or a hostile-code security boundary.
254
+ Child capabilities and permissions remain those of the trusted manifest.
255
+ Workers inherit the MCP server's environment; a manifest's `env` is not a
256
+ credential allowlist. Use a suitably restricted server environment.
257
+
258
+ To retain skills or other tools, call `mountAgents` on your existing host. CLI
259
+ factories receive both helpers alongside `createSkillsHost`; native applications
260
+ import them from `/agents` and use the same host snapshots/cell frontends. Direct
261
+ snapshot callers should provide stable `sessionId`/`harnessId` labels: repeated
262
+ tool IDs within that context denote the same intent, and changed input conflicts.
263
+
264
+ **Recovery and limits:** WDK-worker replacement reattaches still-live agent runs
265
+ and reuses completed agent results. It does not restart an interrupted native
266
+ agent or recover after whole-MCP-server death. Failed/unknown intents are not
267
+ silently rerun. Runs retain private state under `~/.local/share/omakase/agents`
268
+ (`stateDir` or `OMAKASE_AGENT_STATE_DIR` overrides it). Cancellation stops owned
269
+ processes. A separate parent-liveness pipe also makes host death stop the worker
270
+ and its owned native processes; it does not recover them or undo effects.
271
+ Retained state may need reconciliation.
272
+ `execution.json` records last-observed diagnostics, not liveness or a complete
273
+ effect journal: abrupt cancellation can leave it marked `running`. Host receipts
274
+ record the invocation outcome. Retention is explicit; no automatic pruning runs.
275
+ The live host also retains invocation inputs and full settled results in memory
276
+ for its lifetime, including ordinary calls. This beta has no bounded replay
277
+ cache. Evicting identities blindly could repeat effects; memory grows with the
278
+ number and size of calls. Retire only drained hosts, since host replacement
279
+ does not recover active work.
280
+ The default executable is `bun`; `OMAKASE_AGENT_RUNTIME_EXECUTABLE` can select an
281
+ absolute Bun path.
282
+
283
+ This ports registration and running agents, not Flow's verb set. JS loops,
284
+ branches, `Promise.all`, dependent calls and unrelated host tools remain available.
285
+ Live steering, `ask`/`pause`, and forwarding a child agent's human approval are
286
+ deferred. Automatic native decisions are honored; an unresolved child approval
287
+ fails closed. The cell host's existing approval transport is unchanged.
288
+ The private OMP adapter is not bundled: OMP **as a child backend** requires its
289
+ separately installed/built adapter; using an MCP-capable harness as the caller
290
+ does not require that child adapter.
153
291
 
154
292
  ## Skill reads through Code Mode
155
293
 
@@ -210,9 +348,10 @@ not claimed.
210
348
 
211
349
  Exports: root host/caller/reader APIs, `/mcp-sdk` for the official SDK client,
212
350
  `/skills-server` for the standalone service, `/skills-host` for the bundled host,
213
- and `/workflow` plus `/workflow-host` for Workflow-backed cells.
214
- For custom ESM CLI factories, import APIs from your own installed dependencies;
215
- the injected helper covers the simple skills configuration shown above.
351
+ `/agents` for registered native agent runs, and `/workflow` plus `/workflow-host`
352
+ for Workflow-backed cells. Custom ESM CLI factories can use the injected
353
+ `createSkillsHost`, `createAgentHost` and `mountAgents` helpers without resolving
354
+ Omakase imports from the npx cache.
216
355
 
217
356
  ## Bounds and release status
218
357