@inixiative/agent-session 0.6.0 → 0.6.1
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/README.md +15 -13
- package/package.json +3 -3
- package/src/claude-agent-sdk-session.ts +8 -0
- package/src/claude-code-session.ts +79 -12
- package/src/claude-primed.ts +153 -35
- package/src/codex-session.ts +103 -609
- package/src/harness-session.ts +1 -1
- package/src/index.ts +1 -4
- package/src/pool.ts +1 -1
- package/src/primed.ts +1 -1
- package/src/transport.ts +5 -34
- package/src/transports.ts +1 -4
package/src/harness-session.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// HarnessSession is stateful: it owns a running process, tracks turns,
|
|
11
11
|
// captures every event for Oracle, and supports fork/interrupt.
|
|
12
12
|
//
|
|
13
|
-
// Implementations: ClaudeCodeSession,
|
|
13
|
+
// Implementations: ClaudeCodeSession, CodexAppServerSession,
|
|
14
14
|
// ClaudeAgentSdkSession. How a model is reached is the session's transport
|
|
15
15
|
// (see transport.ts); every transport implements this one contract.
|
|
16
16
|
// ---------------------------------------------------------------------------
|
package/src/index.ts
CHANGED
|
@@ -27,15 +27,12 @@ export {
|
|
|
27
27
|
codexTokens,
|
|
28
28
|
} from './codex-primed';
|
|
29
29
|
|
|
30
|
-
// Codex CLI adapter
|
|
31
|
-
// mcp-server variant; CodexAppServerSession is the app-server one.
|
|
30
|
+
// Codex CLI adapter: one persistent `codex app-server` JSON-RPC session.
|
|
32
31
|
export {
|
|
33
32
|
type CodexApprovalPolicy,
|
|
34
33
|
CodexAppServerSession,
|
|
35
34
|
type CodexFileChange,
|
|
36
|
-
CodexMcpSession,
|
|
37
35
|
type CodexSandbox,
|
|
38
|
-
CodexSession,
|
|
39
36
|
type CodexSessionConfig,
|
|
40
37
|
type CodexSpawn,
|
|
41
38
|
codexPermissions,
|
package/src/pool.ts
CHANGED
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
import { TRANSPORTS, type TransportKind } from './transport';
|
|
32
32
|
import { createSession } from './transports';
|
|
33
33
|
|
|
34
|
-
export type PooledTransport = 'claude-cli' | 'codex-
|
|
34
|
+
export type PooledTransport = 'claude-cli' | 'codex-app-server' | 'claude-agent-sdk';
|
|
35
35
|
|
|
36
36
|
export interface InstanceConfig {
|
|
37
37
|
readonly id: string;
|
package/src/primed.ts
CHANGED
|
@@ -262,7 +262,7 @@ export class Slots {
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
/** Per-key serialization: a key's
|
|
265
|
+
/** Per-key serialization: a key's tasks run one at a time, in order. */
|
|
266
266
|
export class KeyedQueue {
|
|
267
267
|
private _tails = new Map<string, Promise<void>>();
|
|
268
268
|
run<T>(key: string, task: () => Promise<T>): Promise<T> {
|
package/src/transport.ts
CHANGED
|
@@ -13,21 +13,15 @@
|
|
|
13
13
|
// is declared absent, with a note.
|
|
14
14
|
// ---------------------------------------------------------------------------
|
|
15
15
|
|
|
16
|
-
export type TransportKind =
|
|
17
|
-
| 'claude-cli'
|
|
18
|
-
| 'codex-mcp'
|
|
19
|
-
| 'codex-app-server'
|
|
20
|
-
| 'claude-agent-sdk'
|
|
21
|
-
| 'acp'
|
|
22
|
-
| 'api';
|
|
16
|
+
export type TransportKind = 'claude-cli' | 'codex-app-server' | 'claude-agent-sdk' | 'acp' | 'api';
|
|
23
17
|
|
|
24
18
|
export type TransportRuntime = 'claude' | 'codex' | 'external';
|
|
25
19
|
|
|
26
20
|
export interface TransportCapabilities {
|
|
27
|
-
/** Continue a thread by native ID in a new process
|
|
28
|
-
readonly resume: 'native' | '
|
|
29
|
-
/** `native`: a new branch with its own ID
|
|
30
|
-
readonly fork: 'native' | '
|
|
21
|
+
/** Continue a thread by native ID in a new process. */
|
|
22
|
+
readonly resume: 'native' | 'none';
|
|
23
|
+
/** `native`: a new branch with its own ID. */
|
|
24
|
+
readonly fork: 'native' | 'none';
|
|
31
25
|
/** Drop the last N turns of native history. */
|
|
32
26
|
readonly rollback: 'native' | 'none';
|
|
33
27
|
/** `acknowledged`: interruptNative() confirms the stop through the turn's terminal; `local-only`: interrupt() releases the local waiter only. */
|
|
@@ -88,29 +82,6 @@ export const TRANSPORTS: Readonly<Record<TransportKind, TransportDescriptor>> =
|
|
|
88
82
|
'Rollback (`--resume-session-at`) exists natively but is not wired here.',
|
|
89
83
|
],
|
|
90
84
|
},
|
|
91
|
-
'codex-mcp': {
|
|
92
|
-
kind: 'codex-mcp',
|
|
93
|
-
runtime: 'codex',
|
|
94
|
-
status: 'implemented',
|
|
95
|
-
verified: 'live',
|
|
96
|
-
capabilities: {
|
|
97
|
-
resume: 'loaded-only',
|
|
98
|
-
fork: 'same-thread',
|
|
99
|
-
rollback: 'none',
|
|
100
|
-
interrupt: 'local-only',
|
|
101
|
-
push: 'none',
|
|
102
|
-
approvals: 'mode',
|
|
103
|
-
usage: true,
|
|
104
|
-
limits: none,
|
|
105
|
-
textOnly: false,
|
|
106
|
-
primed: 'none',
|
|
107
|
-
billing: 'subscription',
|
|
108
|
-
},
|
|
109
|
-
notes: [
|
|
110
|
-
'`codex mcp-server`; `codex-reply` continues only threads loaded in the same process.',
|
|
111
|
-
'fork() continues the parent thread; it is not a native fork.',
|
|
112
|
-
],
|
|
113
|
-
},
|
|
114
85
|
'codex-app-server': {
|
|
115
86
|
kind: 'codex-app-server',
|
|
116
87
|
runtime: 'codex',
|
package/src/transports.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
type ClaudeAgentSdkSessionConfig,
|
|
7
7
|
} from './claude-agent-sdk-session';
|
|
8
8
|
import { ClaudeCodeSession, type ClaudeCodeSessionConfig } from './claude-code-session';
|
|
9
|
-
import { CodexAppServerSession,
|
|
9
|
+
import { CodexAppServerSession, type CodexSessionConfig } from './codex-session';
|
|
10
10
|
import type { HarnessSession } from './harness-session';
|
|
11
11
|
import {
|
|
12
12
|
TRANSPORTS,
|
|
@@ -36,7 +36,6 @@ export interface ApiSessionConfig {
|
|
|
36
36
|
|
|
37
37
|
export interface TransportConfigs {
|
|
38
38
|
'claude-cli': ClaudeCodeSessionConfig;
|
|
39
|
-
'codex-mcp': CodexSessionConfig;
|
|
40
39
|
'codex-app-server': CodexSessionConfig;
|
|
41
40
|
'claude-agent-sdk': ClaudeAgentSdkSessionConfig;
|
|
42
41
|
acp: AcpSessionConfig;
|
|
@@ -81,8 +80,6 @@ export function createSession<K extends TransportKind>(
|
|
|
81
80
|
switch (kind) {
|
|
82
81
|
case 'claude-cli':
|
|
83
82
|
return new ClaudeCodeSession(config as ClaudeCodeSessionConfig);
|
|
84
|
-
case 'codex-mcp':
|
|
85
|
-
return new CodexMcpSession(config as CodexSessionConfig);
|
|
86
83
|
case 'codex-app-server':
|
|
87
84
|
return new CodexAppServerSession(config as CodexSessionConfig);
|
|
88
85
|
case 'claude-agent-sdk':
|