@ikenga/contract 0.5.1 → 0.6.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 (42) hide show
  1. package/dist/engine/acp.d.ts +271 -0
  2. package/dist/engine/acp.d.ts.map +1 -0
  3. package/dist/engine/acp.js +13 -0
  4. package/dist/engine/acp.js.map +1 -0
  5. package/dist/{engine.d.ts → engine/adapter.d.ts} +60 -243
  6. package/dist/engine/adapter.d.ts.map +1 -0
  7. package/dist/{engine.js → engine/adapter.js} +14 -6
  8. package/dist/engine/adapter.js.map +1 -0
  9. package/dist/engine/errors.d.ts +17 -0
  10. package/dist/engine/errors.d.ts.map +1 -0
  11. package/dist/engine/errors.js +19 -0
  12. package/dist/engine/errors.js.map +1 -0
  13. package/dist/engine/index.d.ts +12 -0
  14. package/dist/engine/index.d.ts.map +1 -0
  15. package/dist/engine/index.js +12 -0
  16. package/dist/engine/index.js.map +1 -0
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +1 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/manifest.d.ts +147 -0
  22. package/dist/manifest.d.ts.map +1 -1
  23. package/dist/manifest.js +32 -1
  24. package/dist/manifest.js.map +1 -1
  25. package/dist/registry.d.ts +216 -0
  26. package/dist/registry.d.ts.map +1 -1
  27. package/dist/registry.js +23 -0
  28. package/dist/registry.js.map +1 -1
  29. package/dist/rpc.d.ts +1 -1
  30. package/dist/rpc.d.ts.map +1 -1
  31. package/package.json +3 -3
  32. package/src/{engine.ts → engine/acp.ts} +49 -198
  33. package/src/engine/adapter.ts +243 -0
  34. package/src/{engine.test.ts → engine/engine.test.ts} +33 -2
  35. package/src/engine/errors.ts +20 -0
  36. package/src/engine/index.ts +12 -0
  37. package/src/index.ts +1 -1
  38. package/src/manifest.ts +35 -1
  39. package/src/registry.ts +25 -0
  40. package/src/rpc.ts +1 -1
  41. package/dist/engine.d.ts.map +0 -1
  42. package/dist/engine.js.map +0 -1
@@ -0,0 +1,271 @@
1
+ /**
2
+ * ACP (Agent Client Protocol) shapes. Phase 10: a second, ACP-shaped
3
+ * contract sits alongside the legacy `Engine` interface in `./adapter.ts`.
4
+ * The two coexist while Phase 11 retires the legacy adapter. New engines
5
+ * (in-process Rust ACP, Node ACP sidecars, etc.) target `AcpEngine`;
6
+ * existing consumers keep the `Engine` shape until they migrate.
7
+ *
8
+ * Method names mirror ACP's verbatim so the wire layer and the adapter
9
+ * layer share vocabulary — `newSession`, `prompt`, `cancel`, `setMode`,
10
+ * `loadSession`, `forkSession`, `requestPermission`.
11
+ */
12
+ import type { McpServerSpec } from './adapter.js';
13
+ /** ACP `ProtocolVersion`. Numeric. V1 = 1. */
14
+ export type AcpProtocolVersion = number;
15
+ export interface AcpInitializeRequest {
16
+ protocolVersion: AcpProtocolVersion;
17
+ /** Optional `_meta` passthrough; the in-process shell ignores it. */
18
+ _meta?: Record<string, unknown>;
19
+ }
20
+ export interface AcpPromptCapabilities {
21
+ image: boolean;
22
+ audio: boolean;
23
+ embeddedContext: boolean;
24
+ }
25
+ export interface AcpMcpCapabilities {
26
+ http: boolean;
27
+ sse: boolean;
28
+ }
29
+ export interface AcpAgentCapabilities {
30
+ loadSession: boolean;
31
+ promptCapabilities: AcpPromptCapabilities;
32
+ mcpCapabilities: AcpMcpCapabilities;
33
+ }
34
+ export interface AcpInitializeResponse {
35
+ protocolVersion: AcpProtocolVersion;
36
+ agentCapabilities: AcpAgentCapabilities;
37
+ /** Authentication methods the agent supports — opaque structure passed
38
+ * through to the wizard. */
39
+ authMethods?: unknown[];
40
+ _meta?: Record<string, unknown>;
41
+ }
42
+ export interface AcpTextContentBlock {
43
+ type: 'text';
44
+ text: string;
45
+ }
46
+ /** ACP `ContentBlock::Image`. `data` is raw base64 with NO `data:` URI prefix. */
47
+ export interface AcpImageContentBlock {
48
+ type: 'image';
49
+ data: string;
50
+ mimeType: string;
51
+ uri?: string;
52
+ }
53
+ export type AcpContentBlock = AcpTextContentBlock | AcpImageContentBlock | {
54
+ type: 'audio';
55
+ data: string;
56
+ mimeType: string;
57
+ } | {
58
+ type: 'resource_link';
59
+ name: string;
60
+ uri: string;
61
+ } | {
62
+ type: 'resource';
63
+ resource: unknown;
64
+ };
65
+ export interface AcpNewSessionRequest {
66
+ cwd: string;
67
+ mcpServers: McpServerSpec[];
68
+ _meta?: Record<string, unknown>;
69
+ }
70
+ /** The four canonical ACP session modes the Rust ACP server advertises. */
71
+ export type AcpSessionModeId = 'plan' | 'default' | 'auto' | 'bypassPermissions';
72
+ export interface AcpSessionMode {
73
+ id: AcpSessionModeId;
74
+ name: string;
75
+ description?: string;
76
+ _meta?: Record<string, unknown>;
77
+ }
78
+ export interface AcpSessionModes {
79
+ currentModeId: AcpSessionModeId;
80
+ availableModes: AcpSessionMode[];
81
+ _meta?: Record<string, unknown>;
82
+ }
83
+ export interface AcpNewSessionResponse {
84
+ sessionId: string;
85
+ modes?: AcpSessionModes;
86
+ models?: unknown;
87
+ configOptions?: unknown[];
88
+ _meta?: Record<string, unknown>;
89
+ }
90
+ export interface AcpPromptRequest {
91
+ sessionId: string;
92
+ prompt: AcpContentBlock[];
93
+ messageId?: string;
94
+ _meta?: Record<string, unknown>;
95
+ }
96
+ export type AcpStopReason = 'end_turn' | 'max_tokens' | 'max_turn_requests' | 'refusal' | 'cancelled';
97
+ export interface AcpPromptResponse {
98
+ stopReason: AcpStopReason;
99
+ userMessageId?: string;
100
+ usage?: unknown;
101
+ _meta?: Record<string, unknown>;
102
+ }
103
+ /** ACP `SessionUpdate` discriminated union. Open-ended on the `string` tail
104
+ * so adapter-specific extensions don't break TS consumers. */
105
+ export type AcpSessionUpdate = {
106
+ sessionUpdate: 'agent_message_chunk';
107
+ content: AcpContentBlock;
108
+ messageId?: string;
109
+ } | {
110
+ sessionUpdate: 'agent_thought_chunk';
111
+ content: AcpContentBlock;
112
+ messageId?: string;
113
+ } | {
114
+ sessionUpdate: 'user_message_chunk';
115
+ content: AcpContentBlock;
116
+ } | {
117
+ sessionUpdate: 'tool_call';
118
+ toolCallId: string;
119
+ title: string;
120
+ kind?: string;
121
+ status?: string;
122
+ content?: unknown[];
123
+ rawInput?: unknown;
124
+ _meta?: Record<string, unknown>;
125
+ } | {
126
+ sessionUpdate: 'tool_call_update';
127
+ toolCallId: string;
128
+ fields: {
129
+ status?: string;
130
+ content?: unknown[];
131
+ rawOutput?: unknown;
132
+ };
133
+ _meta?: Record<string, unknown>;
134
+ } | {
135
+ sessionUpdate: 'current_mode_update';
136
+ currentModeId: AcpSessionModeId;
137
+ } | {
138
+ sessionUpdate: 'plan_update';
139
+ plan: unknown;
140
+ } | {
141
+ sessionUpdate: string;
142
+ [k: string]: unknown;
143
+ };
144
+ export interface AcpSessionNotification {
145
+ sessionId: string;
146
+ update: AcpSessionUpdate;
147
+ _meta?: Record<string, unknown>;
148
+ }
149
+ export type AcpPermissionOptionKind = 'allow_once' | 'allow_always' | 'reject_once' | 'reject_always';
150
+ export interface AcpPermissionOption {
151
+ optionId: string;
152
+ name: string;
153
+ kind: AcpPermissionOptionKind;
154
+ }
155
+ export interface AcpToolCallSummary {
156
+ toolCallId: string;
157
+ title?: string;
158
+ kind?: string;
159
+ status?: string;
160
+ content?: unknown[];
161
+ rawInput?: unknown;
162
+ rawOutput?: unknown;
163
+ }
164
+ export interface AcpRequestPermissionRequest {
165
+ sessionId: string;
166
+ toolCall: AcpToolCallSummary;
167
+ options: AcpPermissionOption[];
168
+ _meta?: Record<string, unknown>;
169
+ }
170
+ export type AcpRequestPermissionOutcome = {
171
+ outcome: 'cancelled';
172
+ } | {
173
+ outcome: 'selected';
174
+ optionId: string;
175
+ };
176
+ export interface AcpRequestPermissionResponse {
177
+ outcome: AcpRequestPermissionOutcome;
178
+ _meta?: Record<string, unknown>;
179
+ }
180
+ /** Wire envelope: pairs a `requestId` with the request body so the client
181
+ * reply can address the parked Rust-side oneshot. */
182
+ export interface AcpPermissionRequestEnvelope {
183
+ requestId: string;
184
+ request: AcpRequestPermissionRequest;
185
+ }
186
+ export interface AcpLoadSessionResponse {
187
+ /** Optional mode advertisement so the picker can hydrate without paying
188
+ * the cold-spawn cost of `newSession`. */
189
+ modes?: AcpSessionModes;
190
+ }
191
+ export interface AcpForkResult {
192
+ newThreadId: string;
193
+ sourceThreadId: string;
194
+ branchedFromTurn?: number;
195
+ }
196
+ export interface AcpForkOpts {
197
+ upToTurn?: number;
198
+ label?: string;
199
+ }
200
+ export type AcpNotifyKind = 'notification' | 'permissionRequest';
201
+ export interface AcpNotifyPayload {
202
+ threadId: string;
203
+ title: string;
204
+ body: string;
205
+ kind: AcpNotifyKind;
206
+ }
207
+ /**
208
+ * ACP-shaped engine adapter. Implementations:
209
+ * - `pkgs/engine-claude-code` — wraps the in-process Rust ACP server.
210
+ * - future: `pkgs/engine-codex`, `pkgs/engine-aider` — each speaking the
211
+ * same wire shapes.
212
+ *
213
+ * Method names mirror ACP verbatim (`newSession`, `prompt`, `cancel`,
214
+ * `setMode`, `loadSession`, `forkSession`, `respondPermission`) so the wire
215
+ * layer, adapter layer, and host shell share one vocabulary.
216
+ *
217
+ * Subscriptions return a synchronous `() => void` unsubscribe — the
218
+ * implementation may resolve the underlying tauri-listener asynchronously
219
+ * but the caller can drop the registration immediately on unmount.
220
+ */
221
+ export interface AcpEngine {
222
+ initialize(req: AcpInitializeRequest): Promise<AcpInitializeResponse>;
223
+ /** Mint a new session. The agent may lazily spawn its child on the first
224
+ * `prompt` rather than during `newSession` itself. */
225
+ newSession(req: AcpNewSessionRequest): Promise<AcpNewSessionResponse>;
226
+ /** Send a turn. Resolves when the turn ends; in-progress events flow via
227
+ * `onSessionUpdate`. */
228
+ prompt(req: AcpPromptRequest): Promise<AcpPromptResponse>;
229
+ /** Clean interrupt. Preserves the transcript and keeps the child alive
230
+ * for the next turn. */
231
+ cancel(sessionId: string): Promise<void>;
232
+ /** Switch the session's permission mode. */
233
+ setMode(sessionId: string, modeId: AcpSessionModeId): Promise<void>;
234
+ /** Re-attach to an existing session by id. The child stays lazy. */
235
+ loadSession(sessionId: string): Promise<AcpLoadSessionResponse>;
236
+ /** Clone a session from a chosen turn. The new thread inherits the source's
237
+ * on-disk transcript so the first prompt resumes from the cutoff. */
238
+ forkSession(sourceSessionId: string, opts?: AcpForkOpts): Promise<AcpForkResult>;
239
+ /** Subscribe to session updates. Returns a sync unsubscribe. */
240
+ onSessionUpdate(sessionId: string, callback: (update: AcpSessionUpdate) => void): () => void;
241
+ /** Subscribe to permission requests for this session. Reply via
242
+ * `respondPermission`. Returns a sync unsubscribe. */
243
+ onPermissionRequest(sessionId: string, callback: (envelope: AcpPermissionRequestEnvelope) => void): () => void;
244
+ /** Reply to a parked permission request. */
245
+ respondPermission(requestId: string, response: AcpRequestPermissionResponse): Promise<void>;
246
+ /** Subscribe to OS-attention notifications. Returns a sync unsubscribe. */
247
+ onNotify(callback: (payload: AcpNotifyPayload) => void): () => void;
248
+ }
249
+ /** Synchronous unsubscribe handle. */
250
+ export type AcpUnlisten = () => void;
251
+ /**
252
+ * Tauri-side surface the host shell exposes for the ACP engine. The shell
253
+ * binds these to its `acp_*` Tauri commands and `acp://*` event listeners.
254
+ *
255
+ * Each `on*` returns a Promise of an unsubscribe fn — the engine wraps that
256
+ * so callers get a sync unsubscribe.
257
+ */
258
+ export interface AcpHost {
259
+ initialize(req: AcpInitializeRequest): Promise<AcpInitializeResponse>;
260
+ newSession(req: AcpNewSessionRequest): Promise<AcpNewSessionResponse>;
261
+ prompt(req: AcpPromptRequest): Promise<AcpPromptResponse>;
262
+ cancel(sessionId: string): Promise<void>;
263
+ setMode(sessionId: string, modeId: AcpSessionModeId): Promise<void>;
264
+ loadSession(sessionId: string): Promise<AcpLoadSessionResponse>;
265
+ forkSession(sourceSessionId: string, opts?: AcpForkOpts): Promise<AcpForkResult>;
266
+ listenSession(sessionId: string, onUpdate: (notification: AcpSessionNotification) => void): Promise<AcpUnlisten>;
267
+ listenPermissionRequests(sessionId: string, onRequest: (envelope: AcpPermissionRequestEnvelope) => void): Promise<AcpUnlisten>;
268
+ respondPermission(requestId: string, response: AcpRequestPermissionResponse): Promise<void>;
269
+ listenNotify(callback: (payload: AcpNotifyPayload) => void): Promise<AcpUnlisten>;
270
+ }
271
+ //# sourceMappingURL=acp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acp.d.ts","sourceRoot":"","sources":["../../src/engine/acp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,8CAA8C;AAC9C,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAExC,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,kBAAkB,CAAC;IACpC,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,OAAO,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,qBAAqB,CAAC;IAC1C,eAAe,EAAE,kBAAkB,CAAC;CACrC;AAED,MAAM,WAAW,qBAAqB;IACpC,eAAe,EAAE,kBAAkB,CAAC;IACpC,iBAAiB,EAAE,oBAAoB,CAAC;IACxC;iCAC6B;IAC7B,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kFAAkF;AAClF,MAAM,WAA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O,CAAC,qBAAqB,CAAC,CAAC;IACtE,UAAU,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACtE,MAAM,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC1D,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAChE,WAAW,CACT,eAAe,EAAE,MAAM,EACvB,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,aAAa,CAAC,CAAC;IAC1B,aAAa,CACX,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,YAAY,EAAE,sBAAsB,KAAK,IAAI,GACvD,OAAO,CAAC,WAAW,CAAC,CAAC;IACxB,wBAAwB,CACtB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,CAAC,QAAQ,EAAE,4BAA4B,KAAK,IAAI,GAC1D,OAAO,CAAC,WAAW,CAAC,CAAC;IACxB,iBAAiB,CACf,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,4BAA4B,GACrC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,YAAY,CACV,QAAQ,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,GAC5C,OAAO,CAAC,WAAW,CAAC,CAAC;CACzB"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * ACP (Agent Client Protocol) shapes. Phase 10: a second, ACP-shaped
3
+ * contract sits alongside the legacy `Engine` interface in `./adapter.ts`.
4
+ * The two coexist while Phase 11 retires the legacy adapter. New engines
5
+ * (in-process Rust ACP, Node ACP sidecars, etc.) target `AcpEngine`;
6
+ * existing consumers keep the `Engine` shape until they migrate.
7
+ *
8
+ * Method names mirror ACP's verbatim so the wire layer and the adapter
9
+ * layer share vocabulary — `newSession`, `prompt`, `cancel`, `setMode`,
10
+ * `loadSession`, `forkSession`, `requestPermission`.
11
+ */
12
+ export {};
13
+ //# sourceMappingURL=acp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acp.js","sourceRoot":"","sources":["../../src/engine/acp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
@@ -1,16 +1,36 @@
1
+ /**
2
+ * Legacy Engine adapter shape. New adapters target `./acp.ts`. Both are
3
+ * exported through `@ikenga/contract/engine` during the deprecation cycle.
4
+ *
5
+ * Engine adapter contract. Implementations:
6
+ * - engine-claude-code (default, ships preinstalled)
7
+ * - engine-codex (future)
8
+ * - engine-aider (future)
9
+ * - engine-noop (testing / shell-without-AI mode)
10
+ *
11
+ * @deprecated Phase 11 retires this surface. New adapters target the ACP
12
+ * shape in `./acp.ts` (`AcpEngine`, `createAcpEngine`, `AcpHost`).
13
+ */
1
14
  import { z } from 'zod';
15
+ /** @deprecated Use the ACP shape in `./acp.ts`. */
2
16
  export interface SessionOpts {
3
17
  cwd?: string;
4
18
  systemPrompt?: string;
5
19
  toolAllowList?: string[];
6
20
  /** Caller pkg id, used by the engine for per-pkg billing/audit. */
7
21
  callerPkg?: string;
22
+ /** Model override for the session (adapter-specific). */
23
+ model?: string;
24
+ /** Resume a prior session by id (adapter-specific; requires sessionResume cap). */
25
+ resumeSessionId?: string;
8
26
  }
27
+ /** @deprecated Use the ACP shape in `./acp.ts`. */
9
28
  export interface Session {
10
29
  readonly id: string;
11
30
  /** Best-effort cancellation. Resolves once the engine has stopped streaming. */
12
31
  cancel(): Promise<void>;
13
32
  }
33
+ /** @deprecated Use `AcpSessionUpdate` from `./acp.ts`. */
14
34
  export type EngineEvent = {
15
35
  type: 'message_delta';
16
36
  text: string;
@@ -38,6 +58,11 @@ export type EngineEvent = {
38
58
  reason: 'stop' | 'cancel' | 'error';
39
59
  error?: string;
40
60
  };
61
+ /**
62
+ * MCP server spec. Shared between the legacy `Engine` surface and the ACP
63
+ * `newSession` request — not marked `@deprecated` because the ACP shape
64
+ * reuses it verbatim.
65
+ */
41
66
  export interface McpServerSpec {
42
67
  id: string;
43
68
  command: string;
@@ -275,6 +300,39 @@ export declare const EngineProvidesSchema: z.ZodObject<{
275
300
  } | undefined;
276
301
  }>;
277
302
  export type EngineProvides = z.infer<typeof EngineProvidesSchema>;
303
+ /**
304
+ * Static metadata every adapter surfaces via `Engine.metadata`. Mirrors the
305
+ * manifest's `engine` block so the shell + wizard can introspect without
306
+ * re-parsing the manifest.
307
+ */
308
+ export interface EngineMetadata {
309
+ agentId: string;
310
+ display: string;
311
+ capabilities: AgentCapabilities;
312
+ onboarding: EngineOnboarding;
313
+ }
314
+ /**
315
+ * Tauri-command surface the host shell exposes to legacy `Engine` adapters.
316
+ * The shell binds these names to its `claude_chat_*` commands; adapters
317
+ * never call `invoke()` directly so they remain testable.
318
+ *
319
+ * @deprecated Use the ACP shape (`AcpHost` in `./acp.ts`) for new adapters.
320
+ */
321
+ export interface HostBridge {
322
+ spawn(opts: {
323
+ sessionId: string;
324
+ cwd?: string;
325
+ systemPrompt?: string;
326
+ model?: string;
327
+ resumeSessionId?: string;
328
+ }): Promise<void>;
329
+ send(sessionId: string, message: string): Promise<void>;
330
+ kill(sessionId: string): Promise<void>;
331
+ listen(sessionId: string): AsyncIterable<EngineEvent>;
332
+ registerMcp(spec: McpServerSpec): Promise<void>;
333
+ unregisterMcp(id: string): Promise<void>;
334
+ }
335
+ /** @deprecated Use `AcpEngine` from `./acp.ts`. Legacy shape retired in Phase 11. */
278
336
  export interface Engine {
279
337
  /** Stable identifier — matches the pkg id of the engine adapter. */
280
338
  readonly id: string;
@@ -286,12 +344,7 @@ export interface Engine {
286
344
  * / onboarding so the shell and wizard can introspect without re-parsing
287
345
  * the manifest.
288
346
  */
289
- readonly metadata: {
290
- agentId: string;
291
- display: string;
292
- capabilities: AgentCapabilities;
293
- onboarding: EngineOnboarding;
294
- };
347
+ readonly metadata: EngineMetadata;
295
348
  /** Open a new session. Sessions are cheap; create one per pkg invocation. */
296
349
  startSession(opts: SessionOpts): Promise<Session>;
297
350
  /** Send input and stream events. The iterable completes on `done`. */
@@ -335,240 +388,4 @@ export interface AdapterLoader {
335
388
  */
336
389
  fallback(): Engine;
337
390
  }
338
- /** ACP `ProtocolVersion`. Numeric. V1 = 1. */
339
- export type AcpProtocolVersion = number;
340
- export interface AcpInitializeRequest {
341
- protocolVersion: AcpProtocolVersion;
342
- /** Optional `_meta` passthrough; the in-process shell ignores it. */
343
- _meta?: Record<string, unknown>;
344
- }
345
- export interface AcpPromptCapabilities {
346
- image: boolean;
347
- audio: boolean;
348
- embeddedContext: boolean;
349
- }
350
- export interface AcpMcpCapabilities {
351
- http: boolean;
352
- sse: boolean;
353
- }
354
- export interface AcpAgentCapabilities {
355
- loadSession: boolean;
356
- promptCapabilities: AcpPromptCapabilities;
357
- mcpCapabilities: AcpMcpCapabilities;
358
- }
359
- export interface AcpInitializeResponse {
360
- protocolVersion: AcpProtocolVersion;
361
- agentCapabilities: AcpAgentCapabilities;
362
- /** Authentication methods the agent supports — opaque structure passed
363
- * through to the wizard. */
364
- authMethods?: unknown[];
365
- _meta?: Record<string, unknown>;
366
- }
367
- export interface AcpTextContentBlock {
368
- type: 'text';
369
- text: string;
370
- }
371
- /** ACP `ContentBlock::Image`. `data` is raw base64 with NO `data:` URI prefix. */
372
- export interface AcpImageContentBlock {
373
- type: 'image';
374
- data: string;
375
- mimeType: string;
376
- uri?: string;
377
- }
378
- export type AcpContentBlock = AcpTextContentBlock | AcpImageContentBlock | {
379
- type: 'audio';
380
- data: string;
381
- mimeType: string;
382
- } | {
383
- type: 'resource_link';
384
- name: string;
385
- uri: string;
386
- } | {
387
- type: 'resource';
388
- resource: unknown;
389
- };
390
- export interface AcpNewSessionRequest {
391
- cwd: string;
392
- mcpServers: McpServerSpec[];
393
- _meta?: Record<string, unknown>;
394
- }
395
- /** The four canonical ACP session modes the Rust ACP server advertises. */
396
- export type AcpSessionModeId = 'plan' | 'default' | 'auto' | 'bypassPermissions';
397
- export interface AcpSessionMode {
398
- id: AcpSessionModeId;
399
- name: string;
400
- description?: string;
401
- _meta?: Record<string, unknown>;
402
- }
403
- export interface AcpSessionModes {
404
- currentModeId: AcpSessionModeId;
405
- availableModes: AcpSessionMode[];
406
- _meta?: Record<string, unknown>;
407
- }
408
- export interface AcpNewSessionResponse {
409
- sessionId: string;
410
- modes?: AcpSessionModes;
411
- models?: unknown;
412
- configOptions?: unknown[];
413
- _meta?: Record<string, unknown>;
414
- }
415
- export interface AcpPromptRequest {
416
- sessionId: string;
417
- prompt: AcpContentBlock[];
418
- messageId?: string;
419
- _meta?: Record<string, unknown>;
420
- }
421
- export type AcpStopReason = 'end_turn' | 'max_tokens' | 'max_turn_requests' | 'refusal' | 'cancelled';
422
- export interface AcpPromptResponse {
423
- stopReason: AcpStopReason;
424
- userMessageId?: string;
425
- usage?: unknown;
426
- _meta?: Record<string, unknown>;
427
- }
428
- /** ACP `SessionUpdate` discriminated union. Open-ended on the `string` tail
429
- * so adapter-specific extensions don't break TS consumers. */
430
- export type AcpSessionUpdate = {
431
- sessionUpdate: 'agent_message_chunk';
432
- content: AcpContentBlock;
433
- messageId?: string;
434
- } | {
435
- sessionUpdate: 'agent_thought_chunk';
436
- content: AcpContentBlock;
437
- messageId?: string;
438
- } | {
439
- sessionUpdate: 'user_message_chunk';
440
- content: AcpContentBlock;
441
- } | {
442
- sessionUpdate: 'tool_call';
443
- toolCallId: string;
444
- title: string;
445
- kind?: string;
446
- status?: string;
447
- content?: unknown[];
448
- rawInput?: unknown;
449
- _meta?: Record<string, unknown>;
450
- } | {
451
- sessionUpdate: 'tool_call_update';
452
- toolCallId: string;
453
- fields: {
454
- status?: string;
455
- content?: unknown[];
456
- rawOutput?: unknown;
457
- };
458
- _meta?: Record<string, unknown>;
459
- } | {
460
- sessionUpdate: 'current_mode_update';
461
- currentModeId: AcpSessionModeId;
462
- } | {
463
- sessionUpdate: 'plan_update';
464
- plan: unknown;
465
- } | {
466
- sessionUpdate: string;
467
- [k: string]: unknown;
468
- };
469
- export interface AcpSessionNotification {
470
- sessionId: string;
471
- update: AcpSessionUpdate;
472
- _meta?: Record<string, unknown>;
473
- }
474
- export type AcpPermissionOptionKind = 'allow_once' | 'allow_always' | 'reject_once' | 'reject_always';
475
- export interface AcpPermissionOption {
476
- optionId: string;
477
- name: string;
478
- kind: AcpPermissionOptionKind;
479
- }
480
- export interface AcpToolCallSummary {
481
- toolCallId: string;
482
- title?: string;
483
- kind?: string;
484
- status?: string;
485
- content?: unknown[];
486
- rawInput?: unknown;
487
- rawOutput?: unknown;
488
- }
489
- export interface AcpRequestPermissionRequest {
490
- sessionId: string;
491
- toolCall: AcpToolCallSummary;
492
- options: AcpPermissionOption[];
493
- _meta?: Record<string, unknown>;
494
- }
495
- export type AcpRequestPermissionOutcome = {
496
- outcome: 'cancelled';
497
- } | {
498
- outcome: 'selected';
499
- optionId: string;
500
- };
501
- export interface AcpRequestPermissionResponse {
502
- outcome: AcpRequestPermissionOutcome;
503
- _meta?: Record<string, unknown>;
504
- }
505
- /** Wire envelope: pairs a `requestId` with the request body so the client
506
- * reply can address the parked Rust-side oneshot. */
507
- export interface AcpPermissionRequestEnvelope {
508
- requestId: string;
509
- request: AcpRequestPermissionRequest;
510
- }
511
- export interface AcpLoadSessionResponse {
512
- /** Optional mode advertisement so the picker can hydrate without paying
513
- * the cold-spawn cost of `newSession`. */
514
- modes?: AcpSessionModes;
515
- }
516
- export interface AcpForkResult {
517
- newThreadId: string;
518
- sourceThreadId: string;
519
- branchedFromTurn?: number;
520
- }
521
- export interface AcpForkOpts {
522
- upToTurn?: number;
523
- label?: string;
524
- }
525
- export type AcpNotifyKind = 'notification' | 'permissionRequest';
526
- export interface AcpNotifyPayload {
527
- threadId: string;
528
- title: string;
529
- body: string;
530
- kind: AcpNotifyKind;
531
- }
532
- /**
533
- * ACP-shaped engine adapter. Implementations:
534
- * - `pkgs/engine-claude-code` — wraps the in-process Rust ACP server.
535
- * - future: `pkgs/engine-codex`, `pkgs/engine-aider` — each speaking the
536
- * same wire shapes.
537
- *
538
- * Method names mirror ACP verbatim (`newSession`, `prompt`, `cancel`,
539
- * `setMode`, `loadSession`, `forkSession`, `respondPermission`) so the wire
540
- * layer, adapter layer, and host shell share one vocabulary.
541
- *
542
- * Subscriptions return a synchronous `() => void` unsubscribe — the
543
- * implementation may resolve the underlying tauri-listener asynchronously
544
- * but the caller can drop the registration immediately on unmount.
545
- */
546
- export interface AcpEngine {
547
- initialize(req: AcpInitializeRequest): Promise<AcpInitializeResponse>;
548
- /** Mint a new session. The agent may lazily spawn its child on the first
549
- * `prompt` rather than during `newSession` itself. */
550
- newSession(req: AcpNewSessionRequest): Promise<AcpNewSessionResponse>;
551
- /** Send a turn. Resolves when the turn ends; in-progress events flow via
552
- * `onSessionUpdate`. */
553
- prompt(req: AcpPromptRequest): Promise<AcpPromptResponse>;
554
- /** Clean interrupt. Preserves the transcript and keeps the child alive
555
- * for the next turn. */
556
- cancel(sessionId: string): Promise<void>;
557
- /** Switch the session's permission mode. */
558
- setMode(sessionId: string, modeId: AcpSessionModeId): Promise<void>;
559
- /** Re-attach to an existing session by id. The child stays lazy. */
560
- loadSession(sessionId: string): Promise<AcpLoadSessionResponse>;
561
- /** Clone a session from a chosen turn. The new thread inherits the source's
562
- * on-disk transcript so the first prompt resumes from the cutoff. */
563
- forkSession(sourceSessionId: string, opts?: AcpForkOpts): Promise<AcpForkResult>;
564
- /** Subscribe to session updates. Returns a sync unsubscribe. */
565
- onSessionUpdate(sessionId: string, callback: (update: AcpSessionUpdate) => void): () => void;
566
- /** Subscribe to permission requests for this session. Reply via
567
- * `respondPermission`. Returns a sync unsubscribe. */
568
- onPermissionRequest(sessionId: string, callback: (envelope: AcpPermissionRequestEnvelope) => void): () => void;
569
- /** Reply to a parked permission request. */
570
- respondPermission(requestId: string, response: AcpRequestPermissionResponse): Promise<void>;
571
- /** Subscribe to OS-attention notifications. Returns a sync unsubscribe. */
572
- onNotify(callback: (payload: AcpNotifyPayload) => void): () => void;
573
- }
574
- //# sourceMappingURL=engine.d.ts.map
391
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/engine/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,mDAAmD;AACnD,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,mDAAmD;AACnD,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,gFAAgF;IAChF,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB;AAED,0DAA0D;AAC1D,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACrE;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAC9E;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC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preinstalled)
3
- // - engine-codex (future)
4
- // - engine-aider (future)
5
- // - engine-noop (testing / shell-without-AI mode)
1
+ /**
2
+ * Legacy Engine adapter shape. New adapters target `./acp.ts`. Both are
3
+ * exported through `@ikenga/contract/engine` during the deprecation cycle.
4
+ *
5
+ * Engine adapter contract. Implementations:
6
+ * - engine-claude-code (default, ships preinstalled)
7
+ * - engine-codex (future)
8
+ * - engine-aider (future)
9
+ * - engine-noop (testing / shell-without-AI mode)
10
+ *
11
+ * @deprecated Phase 11 retires this surface. New adapters target the ACP
12
+ * shape in `./acp.ts` (`AcpEngine`, `createAcpEngine`, `AcpHost`).
13
+ */
6
14
  import { z } from 'zod';
7
15
  // ---------- Capabilities (single source of truth) ----------
8
16
  /**
@@ -82,4 +90,4 @@ export const EngineProvidesSchema = z.object({
82
90
  requiredEnvVars: [],
83
91
  }),
84
92
  });
85
- //# sourceMappingURL=engine.js.map
93
+ //# sourceMappingURL=adapter.js.map