@hunsu/codex-runner 0.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.
package/LICENSE ADDED
@@ -0,0 +1,157 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and
10
+ distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright
13
+ owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other entities
16
+ that control, are controlled by, or are under common control with that entity.
17
+ For the purposes of this definition, "control" means (i) the power, direct or
18
+ indirect, to cause the direction or management of such entity, whether by
19
+ contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
20
+ outstanding shares, or (iii) beneficial ownership of such entity.
21
+
22
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
23
+ permissions granted by this License.
24
+
25
+ "Source" form shall mean the preferred form for making modifications, including
26
+ but not limited to software source code, documentation source, and configuration
27
+ files.
28
+
29
+ "Object" form shall mean any form resulting from mechanical transformation or
30
+ translation of a Source form, including but not limited to compiled object code,
31
+ generated documentation, and conversions to other media types.
32
+
33
+ "Work" shall mean the work of authorship, whether in Source or Object form,
34
+ made available under the License, as indicated by a copyright notice that is
35
+ included in or attached to the work.
36
+
37
+ "Derivative Works" shall mean any work, whether in Source or Object form, that
38
+ is based on (or derived from) the Work and for which the editorial revisions,
39
+ annotations, elaborations, or other modifications represent, as a whole, an
40
+ original work of authorship. For the purposes of this License, Derivative Works
41
+ shall not include works that remain separable from, or merely link (or bind by
42
+ name) to the interfaces of, the Work and Derivative Works thereof.
43
+
44
+ "Contribution" shall mean any work of authorship, including the original version
45
+ of the Work and any modifications or additions to that Work or Derivative Works
46
+ thereof, that is intentionally submitted to Licensor for inclusion in the Work by
47
+ the copyright owner or by an individual or Legal Entity authorized to submit on
48
+ behalf of the copyright owner. For the purposes of this definition, "submitted"
49
+ means any form of electronic, verbal, or written communication sent to the
50
+ Licensor or its representatives, including but not limited to communication on
51
+ electronic mailing lists, source code control systems, and issue tracking systems
52
+ that are managed by, or on behalf of, the Licensor for the purpose of discussing
53
+ and improving the Work, but excluding communication that is conspicuously marked
54
+ or otherwise designated in writing by the copyright owner as "Not a Contribution."
55
+
56
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
57
+ of whom a Contribution has been received by Licensor and subsequently
58
+ incorporated within the Work.
59
+
60
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
61
+ License, each Contributor hereby grants to You a perpetual, worldwide,
62
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
63
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
64
+ sublicense, and distribute the Work and such Derivative Works in Source or
65
+ Object form.
66
+
67
+ 3. Grant of Patent License. Subject to the terms and conditions of this License,
68
+ each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
69
+ no-charge, royalty-free, irrevocable (except as stated in this section) patent
70
+ license to make, have made, use, offer to sell, sell, import, and otherwise
71
+ transfer the Work, where such license applies only to those patent claims
72
+ licensable by such Contributor that are necessarily infringed by their
73
+ Contribution(s) alone or by combination of their Contribution(s) with the Work
74
+ to which such Contribution(s) was submitted. If You institute patent litigation
75
+ against any entity (including a cross-claim or counterclaim in a lawsuit)
76
+ alleging that the Work or a Contribution incorporated within the Work
77
+ constitutes direct or contributory patent infringement, then any patent licenses
78
+ granted to You under this License for that Work shall terminate as of the date
79
+ such litigation is filed.
80
+
81
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
82
+ Derivative Works thereof in any medium, with or without modifications, and in
83
+ Source or Object form, provided that You meet the following conditions:
84
+
85
+ (a) You must give any other recipients of the Work or Derivative Works a copy of
86
+ this License; and
87
+
88
+ (b) You must cause any modified files to carry prominent notices stating that
89
+ You changed the files; and
90
+
91
+ (c) You must retain, in the Source form of any Derivative Works that You
92
+ distribute, all copyright, patent, trademark, and attribution notices from the
93
+ Source form of the Work, excluding those notices that do not pertain to any part
94
+ of the Derivative Works; and
95
+
96
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then
97
+ any Derivative Works that You distribute must include a readable copy of the
98
+ attribution notices contained within such NOTICE file, excluding those notices
99
+ that do not pertain to any part of the Derivative Works, in at least one of the
100
+ following places: within a NOTICE text file distributed as part of the Derivative
101
+ Works; within the Source form or documentation, if provided along with the
102
+ Derivative Works; or, within a display generated by the Derivative Works, if and
103
+ wherever such third-party notices normally appear. The contents of the NOTICE
104
+ file are for informational purposes only and do not modify the License. You may
105
+ add Your own attribution notices within Derivative Works that You distribute,
106
+ alongside or as an addendum to the NOTICE text from the Work, provided that such
107
+ additional attribution notices cannot be construed as modifying the License.
108
+
109
+ You may add Your own copyright statement to Your modifications and may provide
110
+ additional or different license terms and conditions for use, reproduction, or
111
+ distribution of Your modifications, or for any such Derivative Works as a whole,
112
+ provided Your use, reproduction, and distribution of the Work otherwise complies
113
+ with the conditions stated in this License.
114
+
115
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
116
+ Contribution intentionally submitted for inclusion in the Work by You to the
117
+ Licensor shall be under the terms and conditions of this License, without any
118
+ additional terms or conditions. Notwithstanding the above, nothing herein shall
119
+ supersede or modify the terms of any separate license agreement you may have
120
+ executed with Licensor regarding such Contributions.
121
+
122
+ 6. Trademarks. This License does not grant permission to use the trade names,
123
+ trademarks, service marks, or product names of the Licensor, except as required
124
+ for reasonable and customary use in describing the origin of the Work and
125
+ reproducing the content of the NOTICE file.
126
+
127
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
128
+ writing, Licensor provides the Work (and each Contributor provides its
129
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
130
+ KIND, either express or implied, including, without limitation, any warranties or
131
+ conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
132
+ PARTICULAR PURPOSE. You are solely responsible for determining the
133
+ appropriateness of using or redistributing the Work and assume any risks
134
+ associated with Your exercise of permissions under this License.
135
+
136
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
137
+ tort (including negligence), contract, or otherwise, unless required by
138
+ applicable law (such as deliberate and grossly negligent acts) or agreed to in
139
+ writing, shall any Contributor be liable to You for damages, including any
140
+ direct, indirect, special, incidental, or consequential damages of any character
141
+ arising as a result of this License or out of the use or inability to use the
142
+ Work (including but not limited to damages for loss of goodwill, work stoppage,
143
+ computer failure or malfunction, or any and all other commercial damages or
144
+ losses), even if such Contributor has been advised of the possibility of such
145
+ damages.
146
+
147
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or
148
+ Derivative Works thereof, You may choose to offer, and charge a fee for,
149
+ acceptance of support, warranty, indemnity, or other liability obligations
150
+ and/or rights consistent with this License. However, in accepting such
151
+ obligations, You may act only on Your own behalf and on Your sole
152
+ responsibility, not on behalf of any other Contributor, and only if You agree to
153
+ indemnify, defend, and hold each Contributor harmless for any liability incurred
154
+ by, or claims asserted against, such Contributor by reason of your accepting any
155
+ such warranty or additional liability.
156
+
157
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,471 @@
1
+ import type { BoardProjection, Harness, HubPackageLock, HarnessSnapshot, ManagerConfig, MemberPath, Destination } from "@hunsu/protocol";
2
+ export declare const DEFAULT_TEAM_INSTRUCTION = "Create a closure-free ExecutionPlan using the available Members.";
3
+ export declare const TEAM_EXECUTION_PLAN_SCHEMA: {
4
+ readonly type: "object";
5
+ readonly properties: {
6
+ readonly kind: {
7
+ readonly type: "string";
8
+ readonly enum: readonly ["queue"];
9
+ };
10
+ readonly id: {
11
+ readonly type: "string";
12
+ };
13
+ readonly items: {
14
+ readonly type: "array";
15
+ readonly items: {
16
+ readonly type: "object";
17
+ readonly properties: {
18
+ readonly kind: {
19
+ readonly type: "string";
20
+ readonly enum: readonly ["goal"];
21
+ };
22
+ readonly stage: {
23
+ readonly type: "string";
24
+ readonly enum: readonly ["needs_evaluation"];
25
+ };
26
+ readonly id: {
27
+ readonly type: "string";
28
+ };
29
+ readonly assignee: {
30
+ readonly type: "object";
31
+ readonly properties: {
32
+ readonly executorId: {
33
+ readonly type: "string";
34
+ };
35
+ readonly goal: {
36
+ readonly type: "string";
37
+ };
38
+ };
39
+ readonly required: readonly ["executorId", "goal"];
40
+ readonly additionalProperties: false;
41
+ };
42
+ readonly evaluator: {
43
+ readonly type: readonly ["object", "null"];
44
+ readonly properties: {
45
+ readonly executorId: {
46
+ readonly type: "string";
47
+ };
48
+ readonly prompt: {
49
+ readonly type: "string";
50
+ };
51
+ };
52
+ readonly required: readonly ["executorId", "prompt"];
53
+ readonly additionalProperties: false;
54
+ };
55
+ readonly remainingAttempts: {
56
+ readonly type: "integer";
57
+ readonly minimum: 0;
58
+ };
59
+ readonly requires: {
60
+ readonly type: readonly ["string", "array"];
61
+ readonly items: {
62
+ readonly type: "string";
63
+ };
64
+ };
65
+ };
66
+ readonly required: readonly ["kind", "stage", "id", "assignee", "evaluator", "remainingAttempts", "requires"];
67
+ readonly additionalProperties: false;
68
+ };
69
+ };
70
+ };
71
+ readonly required: readonly ["kind", "id", "items"];
72
+ readonly additionalProperties: false;
73
+ };
74
+ export declare const GOAL_EVALUATION_SCHEMA: {
75
+ readonly type: "object";
76
+ readonly properties: {
77
+ readonly type: {
78
+ readonly type: "string";
79
+ readonly enum: readonly ["pass", "fail"];
80
+ };
81
+ readonly summary: {
82
+ readonly type: "string";
83
+ };
84
+ readonly reason: {
85
+ readonly type: "string";
86
+ };
87
+ readonly feedback: {
88
+ readonly type: "string";
89
+ };
90
+ readonly nextGoal: {
91
+ readonly type: "string";
92
+ };
93
+ readonly evidence: {
94
+ readonly type: "array";
95
+ readonly items: {
96
+ readonly type: "string";
97
+ };
98
+ };
99
+ };
100
+ readonly required: readonly ["type", "summary", "reason", "feedback", "nextGoal", "evidence"];
101
+ readonly additionalProperties: false;
102
+ };
103
+ export type CodexRunnerThreadOptions = {
104
+ sandboxMode?: "read-only" | "workspace-write" | "danger-full-access";
105
+ approvalPolicy?: "never" | "on-request" | "on-failure" | "untrusted";
106
+ approvalsReviewer?: "user" | "auto_review";
107
+ networkAccessEnabled?: boolean;
108
+ additionalDirectories?: string[];
109
+ model?: string;
110
+ modelReasoningEffort?: string;
111
+ };
112
+ export type ProcessEnvironment = Record<string, string | undefined>;
113
+ export type JsonObject = Record<string, unknown>;
114
+ type JsonRpcId = string | number;
115
+ export type JsonRpcMessage = JsonObject & {
116
+ id?: JsonRpcId;
117
+ method?: string;
118
+ params?: unknown;
119
+ result?: unknown;
120
+ error?: {
121
+ code: number;
122
+ message: string;
123
+ data?: unknown;
124
+ };
125
+ };
126
+ export type RawCodexEvent = {
127
+ source: "codex.app-server";
128
+ message: JsonRpcMessage;
129
+ };
130
+ export type RunnerStatusPhase = "working" | "thinking" | "exploring" | "running" | "waiting" | "idle";
131
+ export type RunnerStatusChangedEvent = {
132
+ type: "runner.status.changed";
133
+ runId: string;
134
+ phase: RunnerStatusPhase;
135
+ headline: string;
136
+ detail?: string;
137
+ providerThreadId?: string;
138
+ providerTurnId?: string;
139
+ itemId?: string;
140
+ };
141
+ export type RunnerFinalEvent = {
142
+ type: "runner.final";
143
+ runId: string;
144
+ finalResponse: string;
145
+ };
146
+ export type RunnerErrorEvent = {
147
+ type: "runner.error";
148
+ runId: string;
149
+ error: string;
150
+ };
151
+ export type RunnerAppServerCommandAction = {
152
+ type: "read";
153
+ command?: string;
154
+ name?: string;
155
+ path?: string;
156
+ } | {
157
+ type: "listFiles";
158
+ command?: string;
159
+ path?: string;
160
+ } | {
161
+ type: "search";
162
+ command?: string;
163
+ query?: string;
164
+ path?: string;
165
+ } | {
166
+ type: "unknown";
167
+ command?: string;
168
+ };
169
+ export type RunnerAppServerItem = {
170
+ id?: string;
171
+ type: string;
172
+ text?: string;
173
+ summary?: string[];
174
+ content?: string[];
175
+ command?: string;
176
+ cwd?: string;
177
+ status?: string;
178
+ commandActions?: RunnerAppServerCommandAction[];
179
+ aggregatedOutput?: string;
180
+ exitCode?: number;
181
+ durationMs?: number;
182
+ changes?: unknown;
183
+ server?: string;
184
+ tool?: string;
185
+ query?: string;
186
+ raw: JsonObject;
187
+ };
188
+ export type RunnerTurnStartedEvent = {
189
+ type: "runner.turn.started";
190
+ runId: string;
191
+ providerThreadId: string;
192
+ providerTurnId: string;
193
+ turn?: JsonObject;
194
+ startedAtMs?: number;
195
+ };
196
+ export type RunnerTurnCompletedEvent = {
197
+ type: "runner.turn.completed";
198
+ runId: string;
199
+ providerThreadId: string;
200
+ providerTurnId?: string;
201
+ turn?: JsonObject;
202
+ usage?: AppServerUsage;
203
+ completedAtMs?: number;
204
+ };
205
+ export type RunnerItemStartedEvent = {
206
+ type: "runner.item.started";
207
+ runId: string;
208
+ providerThreadId?: string;
209
+ providerTurnId?: string;
210
+ itemId: string;
211
+ item: RunnerAppServerItem;
212
+ startedAtMs?: number;
213
+ };
214
+ export type RunnerItemDeltaEvent = {
215
+ type: "runner.item.delta";
216
+ runId: string;
217
+ providerThreadId?: string;
218
+ providerTurnId?: string;
219
+ itemId: string;
220
+ deltaKind: "agentMessage" | "plan" | "reasoningText" | "reasoningSummary" | "commandOutput" | "fileChangeOutput";
221
+ delta: string;
222
+ contentIndex?: number;
223
+ };
224
+ export type RunnerItemCompletedEvent = {
225
+ type: "runner.item.completed";
226
+ runId: string;
227
+ providerThreadId?: string;
228
+ providerTurnId?: string;
229
+ itemId: string;
230
+ item: RunnerAppServerItem;
231
+ completedAtMs?: number;
232
+ };
233
+ export type RunnerAppServerMessageEvent = {
234
+ type: "runner.appServer.message";
235
+ runId: string;
236
+ direction: "server-notification" | "server-request";
237
+ providerThreadId?: string;
238
+ providerTurnId?: string;
239
+ method?: string;
240
+ message: JsonRpcMessage;
241
+ };
242
+ export type TeamRunEvent = RunnerAppServerMessageEvent | RunnerStatusChangedEvent | RunnerTurnStartedEvent | RunnerTurnCompletedEvent | RunnerItemStartedEvent | RunnerItemDeltaEvent | RunnerItemCompletedEvent | RunnerFinalEvent | RunnerErrorEvent;
243
+ export type RunnerEvent = TeamRunEvent;
244
+ export type StartRunInput = {
245
+ runId: string;
246
+ executeId?: string;
247
+ repositoryPath: string;
248
+ worktreeHash?: string;
249
+ sourceMoveId?: string;
250
+ targetMoveOrdinal?: number;
251
+ requestGoal: string;
252
+ teamName?: string;
253
+ harness?: HarnessSnapshot;
254
+ harnessGraph?: Harness;
255
+ teamScopeId?: string;
256
+ harnessLock?: HubPackageLock;
257
+ activeDestinations: Destination[];
258
+ selectedDestinationIds?: string[];
259
+ futureConstraints?: string[];
260
+ attemptOrdinal?: number;
261
+ maxAttemptCount?: number;
262
+ previousMemberOutputs?: string[];
263
+ conversationRef?: {
264
+ conversationHash: string;
265
+ worktreeHash?: string;
266
+ };
267
+ codexThreadOptions?: CodexRunnerThreadOptions;
268
+ board: BoardProjection;
269
+ };
270
+ export type TeamPlanningInput = StartRunInput;
271
+ export type MemberPathRunInput = StartRunInput & {
272
+ memberPath: MemberPath;
273
+ dependencyOutputs?: string[];
274
+ worktreeStatus?: string;
275
+ worktreeDiff?: string;
276
+ attemptTranscript?: string;
277
+ outputSchema?: unknown;
278
+ };
279
+ export type MoveFinalizerPathOutput = {
280
+ pathId: string;
281
+ executorId: string;
282
+ goal: string;
283
+ commit?: string;
284
+ finalResponse?: string;
285
+ };
286
+ export type MoveFinalizerInput = StartRunInput & {
287
+ moveId: string;
288
+ sourceMoveCommit: string;
289
+ terminalPathCommit: string;
290
+ terminalMemberPathId?: string;
291
+ pathCommits: Record<string, string>;
292
+ pathOutputs: MoveFinalizerPathOutput[];
293
+ completionSummary: string;
294
+ diffStat?: string;
295
+ diffNameStatus?: string;
296
+ diffPatch?: string;
297
+ };
298
+ export type ResumeRunInput = TeamPlanningInput & {
299
+ providerThreadId: string;
300
+ };
301
+ export type HunsuDraftConversationMessage = {
302
+ role: "user" | "draft-agent" | "system";
303
+ text: string;
304
+ createdAt?: string;
305
+ };
306
+ export type HunsuDraftSourceSnapshot = {
307
+ sourceLineId: string;
308
+ sourceNodeId: string;
309
+ sourceMoveId?: string;
310
+ moveOrdinal?: number;
311
+ teamName?: string;
312
+ summary?: string;
313
+ destinationSummaries: Array<{
314
+ id: string;
315
+ title: string;
316
+ status: string;
317
+ }>;
318
+ };
319
+ export type HunsuDraftTurnInput = StartRunInput & {
320
+ draftSessionId: string;
321
+ manager: ManagerConfig;
322
+ sourceArtifactId?: string;
323
+ baseArtifactId?: string;
324
+ draftCheckCommand: string;
325
+ sourceSnapshot: HunsuDraftSourceSnapshot;
326
+ messages: HunsuDraftConversationMessage[];
327
+ userMessage: string;
328
+ providerThreadId?: string;
329
+ };
330
+ export type HunsuDraftSessionInput = Omit<HunsuDraftTurnInput, "userMessage">;
331
+ export type RunnerRun = {
332
+ runId: string;
333
+ provider: "codex";
334
+ providerThreadId?: string;
335
+ providerTurnId?: string;
336
+ finalResponse?: string;
337
+ rawResult?: unknown;
338
+ };
339
+ export type CodexProviderStatus = {
340
+ backend: "app-server";
341
+ available: boolean;
342
+ initialized?: unknown;
343
+ account?: unknown;
344
+ rateLimits?: unknown;
345
+ accountError?: string;
346
+ rateLimitsError?: string;
347
+ error?: string;
348
+ };
349
+ export type Runner = {
350
+ runTeamPlanning(input: TeamPlanningInput): Promise<RunnerRun>;
351
+ runMemberPath(input: MemberPathRunInput): Promise<RunnerRun>;
352
+ runMoveFinalizer(input: MoveFinalizerInput): Promise<RunnerRun>;
353
+ prepareHunsuDraftSession?(input: HunsuDraftSessionInput): Promise<RunnerRun>;
354
+ runHunsuDraftTurn(input: HunsuDraftTurnInput): Promise<RunnerRun>;
355
+ resumeRun(input: ResumeRunInput): Promise<RunnerRun>;
356
+ pauseRun(runId: string): Promise<void>;
357
+ stopRun(runId: string): Promise<void>;
358
+ providerStatus?(): Promise<CodexProviderStatus>;
359
+ events(runId: string): AsyncIterable<RunnerEvent>;
360
+ };
361
+ export declare const DEFAULT_CODEX_THREAD_OPTIONS: {
362
+ sandboxMode: "workspace-write";
363
+ approvalPolicy: "never";
364
+ approvalsReviewer: "user";
365
+ networkAccessEnabled: false;
366
+ };
367
+ type JsonRpcRequestHandler = (message: JsonRpcMessage) => Promise<unknown> | unknown;
368
+ type JsonRpcNotificationHandler = (message: JsonRpcMessage) => void;
369
+ export type CodexAppServerTransport = {
370
+ send(message: JsonObject): void;
371
+ close(): void;
372
+ onMessage(handler: (message: JsonRpcMessage) => void): () => void;
373
+ onError(handler: (error: Error) => void): () => void;
374
+ onClose(handler: () => void): () => void;
375
+ };
376
+ export type CodexAppServerClientOptions = {
377
+ command?: string;
378
+ args?: string[];
379
+ cwd?: string;
380
+ environment?: ProcessEnvironment;
381
+ requestTimeoutMs?: number;
382
+ clientInfo?: {
383
+ name: string;
384
+ title: string | null;
385
+ version: string;
386
+ };
387
+ transportFactory?: () => CodexAppServerTransport;
388
+ handleServerRequest?: JsonRpcRequestHandler;
389
+ };
390
+ export type CodexAppServerRunnerOptions = {
391
+ client?: CodexAppServerClient;
392
+ clientOptions?: CodexAppServerClientOptions;
393
+ threadOptions?: CodexRunnerThreadOptions;
394
+ environment?: ProcessEnvironment;
395
+ };
396
+ export type AppServerUsage = {
397
+ input_tokens: number;
398
+ cached_input_tokens: number;
399
+ output_tokens: number;
400
+ reasoning_output_tokens: number;
401
+ };
402
+ export declare class CodexAppServerClient {
403
+ private readonly requestTimeoutMs;
404
+ private readonly transportFactory;
405
+ private readonly clientInfo;
406
+ private serverRequestHandler;
407
+ private transport?;
408
+ private startPromise?;
409
+ private initialized?;
410
+ private nextId;
411
+ private readonly pending;
412
+ private readonly notificationHandlers;
413
+ constructor(options?: CodexAppServerClientOptions);
414
+ setServerRequestHandler(handler: JsonRpcRequestHandler): void;
415
+ initialize(): Promise<unknown>;
416
+ request(method: string, params?: unknown, options?: {
417
+ timeoutMs?: number;
418
+ }): Promise<unknown>;
419
+ notify(method: string, params?: unknown): void;
420
+ onNotification(handler: JsonRpcNotificationHandler): () => void;
421
+ close(): void;
422
+ private ensureStarted;
423
+ private start;
424
+ private requestRaw;
425
+ private handleMessage;
426
+ private handleResponse;
427
+ private handleServerRequest;
428
+ private rejectPending;
429
+ private disposeTransport;
430
+ }
431
+ export declare class CodexAppServerRunner implements Runner {
432
+ private readonly eventBus;
433
+ private readonly client;
434
+ private readonly threadOptions;
435
+ private readonly activeByRunId;
436
+ private readonly activeByThreadId;
437
+ private readonly activeByTurnId;
438
+ constructor(options?: CodexAppServerRunnerOptions);
439
+ runTeamPlanning(input: TeamPlanningInput): Promise<RunnerRun>;
440
+ runMemberPath(input: MemberPathRunInput): Promise<RunnerRun>;
441
+ runMoveFinalizer(input: MoveFinalizerInput): Promise<RunnerRun>;
442
+ runHunsuDraftTurn(input: HunsuDraftTurnInput): Promise<RunnerRun>;
443
+ prepareHunsuDraftSession(input: HunsuDraftSessionInput): Promise<RunnerRun>;
444
+ resumeRun(input: ResumeRunInput): Promise<RunnerRun>;
445
+ pauseRun(runId: string): Promise<void>;
446
+ stopRun(runId: string): Promise<void>;
447
+ providerStatus(): Promise<CodexProviderStatus>;
448
+ events(runId: string): AsyncIterable<RunnerEvent>;
449
+ private executeTurn;
450
+ private startTurn;
451
+ private prepareThread;
452
+ private threadStartParamsFor;
453
+ private threadResumeParamsFor;
454
+ private threadGoalSetParamsFor;
455
+ private turnStartParamsFor;
456
+ private effectiveThreadOptions;
457
+ private handleNotification;
458
+ private trackCommandExecutionItem;
459
+ private requestBackgroundTerminalCleanupIfNeeded;
460
+ private completeActiveTurn;
461
+ private trackActiveTurn;
462
+ private setActiveTurnId;
463
+ private untrackActiveTurn;
464
+ private handleServerRequest;
465
+ }
466
+ export declare function createDefaultCodexRunner(options?: CodexAppServerRunnerOptions): Runner;
467
+ export declare function buildTeamPlanningPrompt(input: StartRunInput): string;
468
+ export declare function buildMemberPathPrompt(input: MemberPathRunInput): string;
469
+ export declare function buildMoveFinalizerPrompt(input: MoveFinalizerInput): string;
470
+ export declare function buildHunsuDraftPrompt(input: HunsuDraftTurnInput): string;
471
+ export {};