@cleocode/adapters 2026.4.91 → 2026.4.94

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 (54) hide show
  1. package/dist/index.js +41069 -18278
  2. package/dist/index.js.map +4 -4
  3. package/dist/providers/claude-code/install.d.ts.map +1 -1
  4. package/dist/providers/claude-sdk/index.d.ts +10 -4
  5. package/dist/providers/claude-sdk/index.d.ts.map +1 -1
  6. package/dist/providers/claude-sdk/spawn.d.ts +29 -28
  7. package/dist/providers/claude-sdk/spawn.d.ts.map +1 -1
  8. package/dist/providers/codex/install.d.ts.map +1 -1
  9. package/dist/providers/cursor/install.d.ts.map +1 -1
  10. package/dist/providers/openai-sdk/adapter.d.ts +18 -17
  11. package/dist/providers/openai-sdk/adapter.d.ts.map +1 -1
  12. package/dist/providers/openai-sdk/guardrails.d.ts +71 -18
  13. package/dist/providers/openai-sdk/guardrails.d.ts.map +1 -1
  14. package/dist/providers/openai-sdk/handoff.d.ts +51 -21
  15. package/dist/providers/openai-sdk/handoff.d.ts.map +1 -1
  16. package/dist/providers/openai-sdk/index.d.ts +8 -5
  17. package/dist/providers/openai-sdk/index.d.ts.map +1 -1
  18. package/dist/providers/openai-sdk/install.d.ts +1 -1
  19. package/dist/providers/openai-sdk/spawn.d.ts +54 -21
  20. package/dist/providers/openai-sdk/spawn.d.ts.map +1 -1
  21. package/dist/providers/openai-sdk/tracing.d.ts +87 -21
  22. package/dist/providers/openai-sdk/tracing.d.ts.map +1 -1
  23. package/dist/providers/opencode/install.d.ts.map +1 -1
  24. package/dist/providers/opencode/spawn.d.ts.map +1 -1
  25. package/dist/providers/pi/install.d.ts.map +1 -1
  26. package/dist/providers/shared/paths.d.ts +32 -0
  27. package/dist/providers/shared/paths.d.ts.map +1 -0
  28. package/dist/providers/shared/sdk-result-mapper.d.ts +9 -7
  29. package/dist/providers/shared/sdk-result-mapper.d.ts.map +1 -1
  30. package/package.json +6 -5
  31. package/src/__tests__/claude-code-adapter.test.ts +9 -4
  32. package/src/__tests__/cursor-adapter.test.ts +9 -8
  33. package/src/__tests__/harness-interop.test.ts +451 -0
  34. package/src/__tests__/opencode-adapter.test.ts +9 -4
  35. package/src/providers/claude-code/install.ts +10 -2
  36. package/src/providers/claude-sdk/__tests__/spawn.test.ts +100 -265
  37. package/src/providers/claude-sdk/index.ts +10 -4
  38. package/src/providers/claude-sdk/spawn.ts +69 -106
  39. package/src/providers/codex/install.ts +10 -2
  40. package/src/providers/cursor/install.ts +10 -2
  41. package/src/providers/openai-sdk/__tests__/openai-sdk-spawn.test.ts +134 -103
  42. package/src/providers/openai-sdk/adapter.ts +19 -18
  43. package/src/providers/openai-sdk/guardrails.ts +106 -25
  44. package/src/providers/openai-sdk/handoff.ts +73 -37
  45. package/src/providers/openai-sdk/index.ts +28 -4
  46. package/src/providers/openai-sdk/install.ts +1 -1
  47. package/src/providers/openai-sdk/manifest.json +4 -4
  48. package/src/providers/openai-sdk/spawn.ts +213 -48
  49. package/src/providers/openai-sdk/tracing.ts +105 -22
  50. package/src/providers/opencode/install.ts +10 -2
  51. package/src/providers/opencode/spawn.ts +2 -1
  52. package/src/providers/pi/install.ts +10 -2
  53. package/src/providers/shared/paths.ts +79 -0
  54. package/src/providers/shared/sdk-result-mapper.ts +9 -7
@@ -1 +1 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/providers/claude-code/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAaH,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAYjG;;;;;;;;;;;;;GAaG;AACH,qBAAa,yBAA0B,YAAW,sBAAsB;IACtE;;;;;OAKG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAgC9D;;;;OAIG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAEhC;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAkBrC;;;;;;OAMG;IACG,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpE;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IA+B7B;;;;;;;;OAQG;IACH,OAAO,CAAC,eAAe;IAsBvB;;;;OAIG;IACH,OAAO,CAAC,cAAc;CAiCvB"}
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/providers/claude-code/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAaH,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAoBjG;;;;;;;;;;;;;GAaG;AACH,qBAAa,yBAA0B,YAAW,sBAAsB;IACtE;;;;;OAKG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAgC9D;;;;OAIG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAEhC;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAkBrC;;;;;;OAMG;IACG,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpE;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IA+B7B;;;;;;;;OAQG;IACH,OAAO,CAAC,eAAe;IAsBvB;;;;OAIG;IACH,OAAO,CAAC,cAAc;CAiCvB"}
@@ -1,13 +1,19 @@
1
1
  /**
2
2
  * @packageDocumentation
3
3
  *
4
- * Claude Agent SDK spawn provider for CLEO.
5
- * Uses `@anthropic-ai/claude-agent-sdk` instead of the CLI for programmatic
6
- * subagent execution with structured output and session tracking.
4
+ * Claude SDK spawn provider for CLEO — Vercel AI SDK edition.
5
+ *
6
+ * Uses `@ai-sdk/anthropic` via the Vercel AI SDK (`ai` v6) instead of the
7
+ * legacy `@anthropic-ai/claude-agent-sdk`. CLEO retains its own orchestration
8
+ * primitives (composeSpawnPayload, playbook runtime, agent registry); this
9
+ * provider exposes the LLM bridge for programmatic subagent execution with
10
+ * structured output and session tracking.
7
11
  *
8
12
  * Enabled via `provider.claude.mode = 'sdk'` in CLEO config.
9
13
  *
10
- * @task T581
14
+ * @task T581 (original)
15
+ * @task T933 (SDK consolidation — Vercel AI SDK migration)
16
+ * @see ADR-052 — SDK consolidation decision
11
17
  */
12
18
  export type { McpServerMap, McpStdioConfig } from './mcp-registry.js';
13
19
  export { getServers } from './mcp-registry.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/claude-sdk/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/claude-sdk/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,37 +1,42 @@
1
1
  /**
2
- * Claude SDK Spawn Provider
2
+ * Claude SDK Spawn Provider — Vercel AI SDK edition.
3
3
  *
4
- * Implements `AdapterSpawnProvider` using the `@anthropic-ai/claude-agent-sdk`
5
- * programmatic API instead of shelling out to the `claude` CLI.
4
+ * Implements {@link AdapterSpawnProvider} using the Vercel AI SDK
5
+ * (`ai` v6 + `@ai-sdk/anthropic`) instead of the legacy
6
+ * `@anthropic-ai/claude-agent-sdk`. CLEO retains its own orchestration
7
+ * primitives (`composeSpawnPayload`, playbook runtime, agent registry);
8
+ * the SDK is strictly the LLM bridge.
6
9
  *
7
10
  * Differences from `ClaudeCodeSpawnProvider`:
8
- * - Uses SDK `query()` instead of a detached child process
11
+ * - Uses `generateText()` via Vercel AI SDK instead of a detached child process
9
12
  * - Awaits full completion before returning (synchronous output capture)
10
- * - Session IDs from the SDK enable future multi-turn resumption
13
+ * - Session IDs are generated by CLEO and tracked in `SessionStore`
11
14
  * - No temp files, no OS PIDs — tracking is purely in-memory session IDs
12
15
  * - `canSpawn()` uses 3-tier key resolution (env var → stored key → Claude Code OAuth)
13
16
  *
14
17
  * CANT enrichment is identical to the CLI provider: `buildCantEnrichedPrompt()`
15
- * is called before `query()` and the result is passed as the SDK prompt string.
18
+ * is called before `generateText()` and the result is passed as the user prompt.
16
19
  *
17
- * @task T581
20
+ * @task T581 (original)
21
+ * @task T933 (SDK consolidation — Vercel AI SDK migration)
18
22
  * @see T752 — canSpawn() OAuth fix
23
+ * @see ADR-052 — SDK consolidation decision
19
24
  */
20
25
  import type { AdapterSpawnProvider, SpawnContext, SpawnResult } from '@cleocode/contracts';
21
26
  /**
22
- * Spawn provider that uses the Anthropic Claude Agent SDK for programmatic
23
- * subagent execution.
27
+ * Spawn provider that uses the Vercel AI SDK (`ai` v6 + `@ai-sdk/anthropic`)
28
+ * for programmatic subagent execution.
24
29
  *
25
- * Each call to `spawn()` runs a full SDK `query()` to completion and
26
- * captures the output. Sessions are tracked in `SessionStore` so callers
27
- * can inspect active sessions via `listRunning()` and cancel them via
28
- * `terminate()`.
30
+ * Each call to `spawn()` runs a single `generateText()` call to completion and
31
+ * captures the output. Sessions are tracked in `SessionStore` so callers can
32
+ * inspect active sessions via `listRunning()` and remove them via `terminate()`.
29
33
  *
30
34
  * @remarks
31
- * The `permissionMode: 'bypassPermissions'` + `allowDangerouslySkipPermissions: true`
32
- * combination mirrors the `--dangerously-skip-permissions` flag used by
33
- * the CLI provider. Both are required by the SDK when bypassing all tool
34
- * permission prompts.
35
+ * Unlike the legacy `@anthropic-ai/claude-agent-sdk`, the Vercel AI SDK is
36
+ * strictly an LLM bridge it does not manage a Claude Code subprocess or
37
+ * provide built-in MCP server wiring. Tool use is available through the SDK's
38
+ * tool system, but CLEO orchestration (composeSpawnPayload, playbooks, the
39
+ * agent registry) remains the source of truth for scaffolding.
35
40
  */
36
41
  export declare class ClaudeSDKSpawnProvider implements AdapterSpawnProvider {
37
42
  /** In-memory session registry. */
@@ -44,18 +49,14 @@ export declare class ClaudeSDKSpawnProvider implements AdapterSpawnProvider {
44
49
  * - `~/.local/share/cleo/anthropic-key` (user-stored via cleo config)
45
50
  * - Claude Code OAuth token (zero-config for Claude Code users)
46
51
  *
47
- * No binary check is needed because the SDK manages the Claude Code
48
- * subprocess internally.
49
- *
50
52
  * @returns `true` when any Anthropic credential is available
51
53
  */
52
54
  canSpawn(): Promise<boolean>;
53
55
  /**
54
- * Spawn a subagent using the Claude Agent SDK.
56
+ * Spawn a subagent using the Vercel AI SDK.
55
57
  *
56
- * Enriches the prompt via CANT context, runs the SDK `query()` to
57
- * completion, captures all assistant text output, and returns a
58
- * `SpawnResult` with the final output and exit code.
58
+ * Enriches the prompt via CANT context, runs `generateText()` to completion,
59
+ * and returns a `SpawnResult` with the final output and exit code.
59
60
  *
60
61
  * @param context - Spawn context with taskId, prompt, options
61
62
  * @returns Resolved spawn result (status: 'completed' or 'failed')
@@ -73,10 +74,10 @@ export declare class ClaudeSDKSpawnProvider implements AdapterSpawnProvider {
73
74
  /**
74
75
  * Remove a session from tracking.
75
76
  *
76
- * The underlying SDK query runs inside `spawn()` and cannot be cancelled
77
- * externally once the async iterator is in flight. Removing the entry from
78
- * the store prevents it from appearing in `listRunning()` but does not
79
- * interrupt the in-progress HTTP request.
77
+ * The underlying `generateText()` call runs inside `spawn()` and cannot be
78
+ * cancelled externally once the HTTP request is in flight. Removing the
79
+ * entry from the store prevents it from appearing in `listRunning()` but
80
+ * does not interrupt the in-progress request.
80
81
  *
81
82
  * @param instanceId - ID of the spawn instance to terminate
82
83
  */
@@ -1 +1 @@
1
- {"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../src/providers/claude-sdk/spawn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAgE3F;;;;;;;;;;;;;;GAcG;AACH,qBAAa,sBAAuB,YAAW,oBAAoB;IACjE,kCAAkC;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAE/C;;;;;;;;;;;;OAYG;IACG,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC;IAIlC;;;;;;;;;OASG;IACG,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IA6IxD;;;;;;;OAOG;IACG,WAAW,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAU3C;;;;;;;;;OASG;IACG,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnD"}
1
+ {"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../src/providers/claude-sdk/spawn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AA+D3F;;;;;;;;;;;;;;GAcG;AACH,qBAAa,sBAAuB,YAAW,oBAAoB;IACjE,kCAAkC;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAE/C;;;;;;;;;OASG;IACG,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC;IAIlC;;;;;;;;OAQG;IACG,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAwGxD;;;;;;;OAOG;IACG,WAAW,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAU3C;;;;;;;;;OASG;IACG,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/providers/codex/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKjG;;;;;;;;;;;;;GAaG;AACH,qBAAa,oBAAqB,YAAW,sBAAsB;IACjE;;;;;;OAMG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAoB9D;;;;;OAKG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhC;;;;;OAKG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAgBrC;;;;;;;OAOG;IACG,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpE;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;CA4B9B"}
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/providers/codex/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAajG;;;;;;;;;;;;;GAaG;AACH,qBAAa,oBAAqB,YAAW,sBAAsB;IACjE;;;;;;OAMG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAoB9D;;;;;OAKG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhC;;;;;OAKG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAgBrC;;;;;;;OAOG;IACG,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpE;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;CA4B9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/providers/cursor/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKjG;;;;;;;;;;;;GAYG;AACH,qBAAa,qBAAsB,YAAW,sBAAsB;IAClE;;;;;OAKG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAoB9D;;;;OAIG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAEhC;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAqBrC;;;;;;OAMG;IACG,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpE;;;;;;OAMG;IACH,OAAO,CAAC,sBAAsB;IAgB9B;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAmBzB;;;;;;;OAOG;IACH,OAAO,CAAC,iBAAiB;IA2BzB;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAQ3B"}
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/providers/cursor/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAajG;;;;;;;;;;;;GAYG;AACH,qBAAa,qBAAsB,YAAW,sBAAsB;IAClE;;;;;OAKG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAoB9D;;;;OAIG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAEhC;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAqBrC;;;;;;OAMG;IACG,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpE;;;;;;OAMG;IACH,OAAO,CAAC,sBAAsB;IAgB9B;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAmBzB;;;;;;;OAOG;IACH,OAAO,CAAC,iBAAiB;IA2BzB;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAQ3B"}
@@ -1,39 +1,40 @@
1
1
  /**
2
- * OpenAI Agents SDK Adapter.
2
+ * OpenAI SDK Adapter — Vercel AI SDK edition.
3
3
  *
4
- * Main `CLEOProviderAdapter` implementation for the OpenAI Agents SDK.
5
- * Provides spawn and install capabilities. Hooks are not supported (the
6
- * SDK does not expose a CLI hook system equivalent to Claude Code's).
4
+ * Main `CLEOProviderAdapter` implementation for the OpenAI provider, backed
5
+ * by the Vercel AI SDK (`ai` v6 + `@ai-sdk/openai`). Provides spawn and
6
+ * install capabilities. Hooks are not supported the Vercel AI SDK does not
7
+ * expose a CLI hook system equivalent to Claude Code's.
7
8
  *
8
- * @task T582
9
+ * @task T582 (original)
10
+ * @task T933 (SDK consolidation — Vercel AI SDK migration)
11
+ * @see ADR-052 — SDK consolidation decision
9
12
  */
10
13
  import type { AdapterCapabilities, AdapterHealthStatus, CLEOProviderAdapter } from '@cleocode/contracts';
11
14
  import { OpenAiSdkInstallProvider } from './install.js';
12
15
  import { OpenAiSdkSpawnProvider } from './spawn.js';
13
16
  /**
14
- * CLEO provider adapter for the OpenAI Agents SDK.
17
+ * CLEO provider adapter for the OpenAI provider.
15
18
  *
16
- * Bridges CLEO's adapter system with the `@openai/agents` SDK:
17
- * - Spawn: Launches agents via the SDK runner with handoff topology
19
+ * Bridges CLEO's adapter system with the Vercel AI SDK:
20
+ * - Spawn: Launches agents via the SDK with CLEO-native handoff topology
18
21
  * - Install: Manages AGENTS.md @-references and .openai/ config directory
19
22
  * - Tracing: Default-on conduit span persistence via `CleoConduitTraceProcessor`
20
23
  *
21
24
  * @remarks
22
- * This adapter is the only CLEO provider with first-class handoff support.
23
- * Team Lead Worker topology is declared in `SpawnContext.options.handoffs`
24
- * and wired directly to SDK `Agent.handoffs`. The SDK handles routing
25
- * internally without any CLEO glue code.
26
- *
27
- * This is also the only provider supporting 100+ LLMs via the Vercel AI SDK
28
- * bridge (capability flag: `supportsMultiModel`).
25
+ * Handoff topology is CLEO-owned (see `handoff.ts`): lead agents delegate to
26
+ * worker archetypes in sequence, and the concatenated output is returned.
27
+ * The Vercel AI SDK surface (`generateText` / `streamText`) works uniformly
28
+ * across Anthropic, OpenAI, and compatible providers, so the provider keeps
29
+ * the `supportsMultiModel` capability flag.
29
30
  */
30
31
  export declare class OpenAiSdkAdapter implements CLEOProviderAdapter {
31
32
  /** Unique provider identifier. */
32
33
  readonly id = "openai-sdk";
33
34
  /** Human-readable provider name. */
34
- readonly name = "OpenAI Agents SDK";
35
+ readonly name = "OpenAI SDK (Vercel AI SDK)";
35
36
  /** Adapter version string. */
36
- readonly version = "1.0.0";
37
+ readonly version = "2.0.0";
37
38
  /** Declared capabilities for this provider. */
38
39
  capabilities: AdapterCapabilities;
39
40
  /** Spawn provider for SDK-backed agent runs with handoff topology. */
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/providers/openai-sdk/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,mBAAmB,E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;AACH,qBAAa,gBAAiB,YAAW,mBAAmB;IAC1D,kCAAkC;IAClC,QAAQ,CAAC,EAAE,gBAAgB;IAC3B,oCAAoC;IACpC,QAAQ,CAAC,IAAI,gCAAgC;IAC7C,8BAA8B;IAC9B,QAAQ,CAAC,OAAO,WAAW;IAE3B,+CAA+C;IAC/C,YAAY,EAAE,mBAAmB,CAa/B;IAEF,sEAAsE;IACtE,KAAK,EAAE,sBAAsB,CAAC;IAC9B,+EAA+E;IAC/E,OAAO,EAAE,wBAAwB,CAAC;IAElC,oEAAoE;IACpE,OAAO,CAAC,UAAU,CAAuB;IACzC,kDAAkD;IAClD,OAAO,CAAC,WAAW,CAAS;;IAO5B;;;;OAIG;IACG,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKnD;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAK9B;;;;;;;;OAQG;IACG,WAAW,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAuBjD;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,aAAa,IAAI,MAAM,GAAG,IAAI;CAG/B"}
@@ -1,14 +1,56 @@
1
1
  /**
2
- * CLEO permission rules mapped to OpenAI Agents SDK guardrails.
2
+ * CLEO permission rules for the OpenAI SDK adapter.
3
3
  *
4
- * CLEO ACLs (file-glob path allowlists, tool allowlists) are expressed as
5
- * `InputGuardrail` instances that run before agent execution. A path that
6
- * falls outside the allowed glob list causes the guardrail to trip and
7
- * the agent run is rejected.
4
+ * Historically these rules were expressed as `InputGuardrail` instances from
5
+ * `@openai/agents`. Post T933 (ADR-052 Vercel AI SDK consolidation) they
6
+ * are CLEO-native objects with the same shape so provider code that relies on
7
+ * their behaviour does not need to change. The Vercel AI SDK does not ship an
8
+ * equivalent guardrail abstraction — CLEO implements its own path ACL and
9
+ * tool allowlist enforcement here.
8
10
  *
9
- * @task T582
11
+ * A guardrail evaluates the serialised agent input before the request is sent
12
+ * to the model. A path that falls outside the allowed glob list causes the
13
+ * guardrail to trip and the run is rejected.
14
+ *
15
+ * @task T582 (original)
16
+ * @task T933 (SDK consolidation — provider-neutral rewrite)
17
+ */
18
+ /** Arguments passed to a CLEO input guardrail. */
19
+ export interface CleoInputGuardrailFunctionArgs {
20
+ /** The agent being invoked. Opaque to guardrails. */
21
+ agent: unknown;
22
+ /** Serialised input to scan — may be a string or arbitrary JSON value. */
23
+ input: unknown;
24
+ /** Per-run context (opaque). */
25
+ context: unknown;
26
+ }
27
+ /** Result of evaluating a CLEO input guardrail. */
28
+ export interface CleoGuardrailResult {
29
+ /** When true, the guardrail has tripped and the run MUST be rejected. */
30
+ tripwireTriggered: boolean;
31
+ /** Free-form diagnostic payload for logging and trace spans. */
32
+ outputInfo: unknown;
33
+ }
34
+ /**
35
+ * CLEO-native replacement for `InputGuardrail` from `@openai/agents`.
36
+ *
37
+ * @remarks
38
+ * The shape is identical to the legacy SDK contract so downstream consumers
39
+ * do not require changes. CLEO enforces these guardrails in-process before
40
+ * dispatching a prompt to the Vercel AI SDK.
41
+ */
42
+ export interface CleoInputGuardrail {
43
+ /** Stable guardrail identifier for logs and trace metadata. */
44
+ name: string;
45
+ /** Execute the guardrail against the current run arguments. */
46
+ execute(args: CleoInputGuardrailFunctionArgs): Promise<CleoGuardrailResult>;
47
+ }
48
+ /**
49
+ * @deprecated Use {@link CleoInputGuardrail}. Kept as a named alias for
50
+ * callers that previously imported the legacy `InputGuardrail` name from
51
+ * this module. Removed in a future major.
10
52
  */
11
- import type { InputGuardrail } from '@openai/agents';
53
+ export type InputGuardrail = CleoInputGuardrail;
12
54
  /**
13
55
  * Check whether a file-system path is covered by at least one glob pattern.
14
56
  *
@@ -26,42 +68,53 @@ export declare function isPathAllowed(path: string, allowedGlobs: string[]): boo
26
68
  *
27
69
  * @param allowedGlobs - Glob patterns that tool path arguments must match.
28
70
  * Pass an empty array to allow all paths (permissive mode).
29
- * @returns An {@link InputGuardrail} ready to attach to an `Agent`.
71
+ * @returns A {@link CleoInputGuardrail} ready to attach to an agent.
30
72
  *
31
73
  * @example
32
74
  * ```typescript
33
75
  * const guard = buildPathGuardrail(['/mnt/projects/**', '/tmp/**']);
34
- * const agent = new Agent({ ..., inputGuardrails: [guard] });
76
+ * const agent = buildStandaloneAgent('...', 'gpt-4.1', [guard]);
35
77
  * ```
36
78
  */
37
- export declare function buildPathGuardrail(allowedGlobs: string[]): InputGuardrail;
79
+ export declare function buildPathGuardrail(allowedGlobs: string[]): CleoInputGuardrail;
38
80
  /**
39
81
  * Build an input guardrail that documents the tool allowlist for audit purposes.
40
82
  *
41
- * In the OpenAI Agents SDK, tool-name enforcement is primarily structural —
42
- * agents only receive the tools attached to their `tools` array. This guardrail
43
- * provides an additional audit layer that records the active allowlist in the
44
- * span metadata.
83
+ * Tool-name enforcement is primarily structural — agents only receive the
84
+ * tools declared by CLEO orchestration. This guardrail provides an additional
85
+ * audit layer that records the active allowlist in the span metadata.
45
86
  *
46
87
  * @param allowedTools - Exact tool names permitted for this agent.
47
88
  * Pass an empty array to allow all tools (permissive mode).
48
- * @returns An {@link InputGuardrail} ready to attach to an `Agent`.
89
+ * @returns A {@link CleoInputGuardrail} ready to attach to an agent.
49
90
  *
50
91
  * @example
51
92
  * ```typescript
52
93
  * const guard = buildToolAllowlistGuardrail(['read', 'write']);
53
94
  * ```
54
95
  */
55
- export declare function buildToolAllowlistGuardrail(allowedTools: string[]): InputGuardrail;
96
+ export declare function buildToolAllowlistGuardrail(allowedTools: string[]): CleoInputGuardrail;
56
97
  /**
57
98
  * Build the default CLEO guardrail set from spawn options.
58
99
  *
59
100
  * Combines path ACL and tool allowlist guards into a single array ready to
60
- * pass as `inputGuardrails` on an `Agent` or `RunConfig`.
101
+ * pass as `inputGuardrails` on an agent topology build.
61
102
  *
62
103
  * @param allowedGlobs - File-path glob allowlist.
63
104
  * @param allowedTools - Tool name allowlist.
64
105
  * @returns Array of input guardrails to attach to the agent.
65
106
  */
66
- export declare function buildDefaultGuardrails(allowedGlobs: string[], allowedTools: string[]): InputGuardrail[];
107
+ export declare function buildDefaultGuardrails(allowedGlobs: string[], allowedTools: string[]): CleoInputGuardrail[];
108
+ /**
109
+ * Evaluate a set of CLEO input guardrails against an input payload.
110
+ *
111
+ * Runs every guardrail in sequence and returns the first tripwire result.
112
+ * When no guardrail trips, returns a passing result with diagnostic data
113
+ * aggregated from each guardrail's `outputInfo`.
114
+ *
115
+ * @param guardrails - Guardrails to evaluate.
116
+ * @param input - The input string to test (typically the enriched prompt).
117
+ * @returns Aggregated guardrail result.
118
+ */
119
+ export declare function evaluateGuardrails(guardrails: CleoInputGuardrail[], input: string): Promise<CleoGuardrailResult>;
67
120
  //# sourceMappingURL=guardrails.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"guardrails.d.ts","sourceRoot":"","sources":["../../../src/providers/openai-sdk/guardrails.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAA8B,MAAM,gBAAgB,CAAC;AAwBjF;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAG3E;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,cAAc,CA6BzE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,cAAc,CAclF;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,MAAM,EAAE,EACtB,YAAY,EAAE,MAAM,EAAE,GACrB,cAAc,EAAE,CAYlB"}
1
+ {"version":3,"file":"guardrails.d.ts","sourceRoot":"","sources":["../../../src/providers/openai-sdk/guardrails.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,kDAAkD;AAClD,MAAM,WAAW,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4
- * CLEO agents are organised in a Lead → Worker hierarchy. This module maps
5
- * that topology to the SDK's first-class `handoffs` graph:
4
+ * CLEO agents are organised in a Lead → Worker hierarchy. Historically this
5
+ * was wired into the `@openai/agents` first-class `handoffs` graph. Post T933
6
+ * (ADR-052 — Vercel AI SDK consolidation) CLEO owns the topology entirely:
6
7
  *
7
- * - A Team Lead becomes an `Agent` whose `handoffs` array lists its workers.
8
+ * - A Team Lead is a {@link CleoAgent} whose `handoffs` array lists its workers.
8
9
  * - Each Worker archetype (read-only, write, bash) is declared in
9
10
  * `WORKER_ARCHETYPES` and built on demand.
10
11
  * - The mapping is driven by `SpawnContext.options.handoffs`, which is an
11
12
  * array of worker archetype names.
13
+ * - When a lead agent needs to delegate, the spawn provider runs a separate
14
+ * `generateText` call for the selected worker and injects the result back
15
+ * into the lead's context.
12
16
  *
13
- * @task T582
17
+ * @task T582 (original)
18
+ * @task T933 (SDK consolidation — CLEO-native topology)
14
19
  */
15
- import type { InputGuardrail } from '@openai/agents';
16
- import { Agent } from '@openai/agents';
20
+ import type { CleoInputGuardrail } from './guardrails.js';
21
+ /**
22
+ * Agent descriptor used by the CLEO OpenAI adapter.
23
+ *
24
+ * @remarks
25
+ * Intentionally mirrors the subset of `@openai/agents`'s `Agent` that CLEO
26
+ * actually consumed. The Vercel AI SDK delivers model inference via
27
+ * `generateText` / `streamText`; handoffs are orchestrated by the spawn
28
+ * provider using this descriptor as input.
29
+ */
30
+ export interface CleoAgent {
31
+ /** Agent identifier surfaced in trace spans. */
32
+ name: string;
33
+ /** System-level instructions fed to the model. */
34
+ instructions: string;
35
+ /** Vercel AI SDK model identifier (e.g. `gpt-4.1`, `gpt-4.1-mini`). */
36
+ model: string;
37
+ /** Workers this agent may delegate to. Undefined when the agent is a leaf. */
38
+ handoffs?: CleoAgent[];
39
+ /** Input guardrails evaluated before the model call. */
40
+ inputGuardrails?: CleoInputGuardrail[];
41
+ }
42
+ /**
43
+ * @deprecated Use {@link CleoAgent}. Legacy alias for callers that imported
44
+ * the `Agent` type from this module. Removed in a future major.
45
+ */
46
+ export type Agent = CleoAgent;
17
47
  /**
18
48
  * Descriptor for a pre-configured worker agent archetype.
19
49
  *
20
50
  * Archetypes are declarative templates. `buildWorkerAgent` inflates them into
21
- * live SDK `Agent` instances.
51
+ * live {@link CleoAgent} instances.
22
52
  */
23
53
  export interface WorkerArchetype {
24
- /** Archetype identifier (also used as SDK agent name). */
54
+ /** Archetype identifier (also used as agent name). */
25
55
  name: string;
26
- /** Short description passed as the SDK agent instructions. */
56
+ /** Short description passed as the agent instructions. */
27
57
  instructions: string;
28
58
  /** Preferred model for this archetype. */
29
59
  model: string;
@@ -36,23 +66,23 @@ export interface WorkerArchetype {
36
66
  */
37
67
  export declare const WORKER_ARCHETYPES: Record<string, WorkerArchetype>;
38
68
  /**
39
- * Build a worker `Agent` instance from a named archetype.
69
+ * Build a worker {@link CleoAgent} from a named archetype.
40
70
  *
41
71
  * @param archetypeName - Key in {@link WORKER_ARCHETYPES}.
42
72
  * @param guardrails - Input guardrails to attach to the worker agent.
43
- * @returns A configured SDK `Agent` or `null` when the archetype is unknown.
73
+ * @returns A configured agent descriptor or `null` when the archetype is unknown.
44
74
  */
45
- export declare function buildWorkerAgent(archetypeName: string, guardrails: InputGuardrail[]): Agent | null;
75
+ export declare function buildWorkerAgent(archetypeName: string, guardrails: CleoInputGuardrail[]): CleoAgent | null;
46
76
  /**
47
- * Build a team lead `Agent` whose `handoffs` reference the given workers.
77
+ * Build a team lead {@link CleoAgent} whose `handoffs` reference the given workers.
48
78
  *
49
79
  * @param leadInstructions - System instructions for the lead agent.
50
80
  * @param leadModel - Model to use for the lead agent.
51
81
  * @param workers - Worker agents this lead can hand off to.
52
82
  * @param guardrails - Input guardrails to attach to the lead agent.
53
- * @returns A configured lead SDK `Agent`.
83
+ * @returns A configured lead agent descriptor.
54
84
  */
55
- export declare function buildLeadAgent(leadInstructions: string, leadModel: string, workers: Agent[], guardrails: InputGuardrail[]): Agent;
85
+ export declare function buildLeadAgent(leadInstructions: string, leadModel: string, workers: CleoAgent[], guardrails: CleoInputGuardrail[]): CleoAgent;
56
86
  /**
57
87
  * Build a simple single-tier agent (no handoffs) from prompt and model.
58
88
  *
@@ -62,9 +92,9 @@ export declare function buildLeadAgent(leadInstructions: string, leadModel: stri
62
92
  * @param instructions - Agent system instructions.
63
93
  * @param model - Model identifier.
64
94
  * @param guardrails - Input guardrails.
65
- * @returns A configured SDK `Agent`.
95
+ * @returns A configured agent descriptor.
66
96
  */
67
- export declare function buildStandaloneAgent(instructions: string, model: string, guardrails: InputGuardrail[]): Agent;
97
+ export declare function buildStandaloneAgent(instructions: string, model: string, guardrails: CleoInputGuardrail[]): CleoAgent;
68
98
  /** Options for building the agent topology from a spawn context. */
69
99
  export interface TopologyOptions {
70
100
  /** Prompt / instructions for the entry-point agent. */
@@ -76,7 +106,7 @@ export interface TopologyOptions {
76
106
  /** Names of worker archetypes to create and attach as handoffs. */
77
107
  handoffNames: string[];
78
108
  /** Input guardrails shared across all agents in the topology. */
79
- guardrails: InputGuardrail[];
109
+ guardrails: CleoInputGuardrail[];
80
110
  }
81
111
  /**
82
112
  * Build the entry-point agent and its worker topology from spawn options.
@@ -88,7 +118,7 @@ export interface TopologyOptions {
88
118
  * Unknown archetype names in `handoffNames` are silently skipped.
89
119
  *
90
120
  * @param options - Topology build options.
91
- * @returns The entry-point agent to pass to `runner.run()`.
121
+ * @returns The entry-point agent descriptor.
92
122
  */
93
- export declare function buildAgentTopology(options: TopologyOptions): Agent;
123
+ export declare function buildAgentTopology(options: TopologyOptions): CleoAgent;
94
124
  //# sourceMappingURL=handoff.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handoff.d.ts","sourceRoot":"","sources":["../../../src/providers/openai-sdk/handoff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAA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AAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,cAAc,CAAC;IACzC,mEAAmE;IACnE,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,iEAAiE;IACjE,UAAU,EAAE,kBAAkB,EAAE,CAAC;CAClC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,CAkBtE"}
@@ -1,19 +1,22 @@
1
1
  /**
2
2
  * @packageDocumentation
3
3
  *
4
- * CLEO provider adapter for the OpenAI Agents SDK.
4
+ * CLEO provider adapter for the OpenAI provider, backed by the Vercel AI SDK.
5
5
  * Default export is the adapter class for dynamic loading by AdapterManager.
6
6
  *
7
- * @task T582
7
+ * @task T582 (original)
8
+ * @task T933 (SDK consolidation — Vercel AI SDK migration)
8
9
  */
9
10
  import { OpenAiSdkAdapter } from './adapter.js';
10
11
  export { OpenAiSdkAdapter } from './adapter.js';
11
- export { buildDefaultGuardrails, buildPathGuardrail, buildToolAllowlistGuardrail, isPathAllowed, } from './guardrails.js';
12
- export type { TopologyOptions, WorkerArchetype } from './handoff.js';
12
+ export type { CleoGuardrailResult, CleoInputGuardrail, CleoInputGuardrailFunctionArgs, InputGuardrail, } from './guardrails.js';
13
+ export { buildDefaultGuardrails, buildPathGuardrail, buildToolAllowlistGuardrail, evaluateGuardrails, isPathAllowed, } from './guardrails.js';
14
+ export type { Agent, CleoAgent, TopologyOptions, WorkerArchetype } from './handoff.js';
13
15
  export { buildAgentTopology, buildLeadAgent, buildStandaloneAgent, buildWorkerAgent, WORKER_ARCHETYPES, } from './handoff.js';
14
16
  export { OpenAiSdkInstallProvider } from './install.js';
15
17
  export type { OpenAiSdkSpawnOptions } from './spawn.js';
16
- export { OpenAiSdkSpawnProvider } from './spawn.js';
18
+ export { OpenAiSdkSpawnProvider, registerTraceProcessor, setTracingDisabled, unregisterTraceProcessor, } from './spawn.js';
19
+ export type { CleoAgentSpanData, CleoFunctionSpanData, CleoGenericSpanData, CleoHandoffSpanData, CleoSpan, CleoSpanData, CleoSpanKind, CleoTrace, CleoTraceProcessor, } from './tracing.js';
17
20
  export { CleoConduitTraceProcessor } from './tracing.js';
18
21
  export default OpenAiSdkAdapter;
19
22
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/openai-sdk/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,2BAA2B,EAC3B,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAEzD,eAAe,gBAAgB,CAAC;AAEhC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,IAAI,gBAAgB,CAEhD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/openai-sdk/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,8BAA8B,EAC9B,cAAc,GACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,2BAA2B,EAC3B,kBAAkB,EAClB,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAEzD,eAAe,gBAAgB,CAAC;AAEhC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,IAAI,gBAAgB,CAEhD"}
@@ -9,7 +9,7 @@
9
9
  */
10
10
  import type { AdapterInstallProvider, InstallOptions, InstallResult } from '@cleocode/contracts';
11
11
  /**
12
- * Install provider for the OpenAI Agents SDK.
12
+ * Install provider for the OpenAI SDK adapter (Vercel AI SDK).
13
13
  *
14
14
  * Manages CLEO's integration with OpenAI SDK projects by:
15
15
  * 1. Ensuring AGENTS.md contains @-references to CLEO instruction files