linkshell-cli 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/src/index.js +1 -1
- package/dist/cli/src/index.js.map +1 -1
- package/dist/cli/src/runtime/acp/acp-client.d.ts +16 -0
- package/dist/cli/src/runtime/acp/acp-client.js +40 -2
- package/dist/cli/src/runtime/acp/acp-client.js.map +1 -1
- package/dist/cli/src/runtime/acp/agent-workspace-git.d.ts +63 -0
- package/dist/cli/src/runtime/acp/agent-workspace-git.js +297 -0
- package/dist/cli/src/runtime/acp/agent-workspace-git.js.map +1 -0
- package/dist/cli/src/runtime/acp/agent-workspace.d.ts +6 -0
- package/dist/cli/src/runtime/acp/agent-workspace.js +690 -81
- package/dist/cli/src/runtime/acp/agent-workspace.js.map +1 -1
- package/dist/cli/src/runtime/acp/claude-sdk-client.d.ts +17 -1
- package/dist/cli/src/runtime/acp/claude-sdk-client.js +331 -19
- package/dist/cli/src/runtime/acp/claude-sdk-client.js.map +1 -1
- package/dist/cli/src/runtime/acp/claude-stream-json-client.js +69 -14
- package/dist/cli/src/runtime/acp/claude-stream-json-client.js.map +1 -1
- package/dist/cli/src/runtime/acp/json-rpc.d.ts +1 -0
- package/dist/cli/src/runtime/acp/json-rpc.js +6 -0
- package/dist/cli/src/runtime/acp/json-rpc.js.map +1 -1
- package/dist/cli/src/runtime/acp-relay.d.ts +23 -0
- package/dist/cli/src/runtime/acp-relay.js +73 -0
- package/dist/cli/src/runtime/acp-relay.js.map +1 -0
- package/dist/cli/src/runtime/bridge-session.d.ts +5 -0
- package/dist/cli/src/runtime/bridge-session.js +104 -57
- package/dist/cli/src/runtime/bridge-session.js.map +1 -1
- package/dist/cli/tsconfig.tsbuildinfo +1 -1
- package/dist/shared-protocol/src/index.d.ts +2505 -2479
- package/dist/shared-protocol/src/index.js +46 -0
- package/dist/shared-protocol/src/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -1
- package/src/runtime/acp/acp-client.ts +53 -2
- package/src/runtime/acp/agent-workspace.ts +752 -76
- package/src/runtime/acp/claude-sdk-client.ts +352 -31
- package/src/runtime/acp/claude-stream-json-client.ts +66 -16
- package/src/runtime/acp/json-rpc.ts +5 -0
- package/src/runtime/bridge-session.ts +114 -61
- package/dist/cli/src/runtime/acp/claude-sessions.d.ts +0 -57
- package/dist/cli/src/runtime/acp/claude-sessions.js +0 -506
- package/dist/cli/src/runtime/acp/claude-sessions.js.map +0 -1
- package/dist/cli/src/runtime/acp/codex-rpc-bridge.d.ts +0 -34
- package/dist/cli/src/runtime/acp/codex-rpc-bridge.js +0 -204
- package/dist/cli/src/runtime/acp/codex-rpc-bridge.js.map +0 -1
- package/dist/cli/src/runtime/acp/codex-sessions.d.ts +0 -60
- package/dist/cli/src/runtime/acp/codex-sessions.js +0 -731
- package/dist/cli/src/runtime/acp/codex-sessions.js.map +0 -1
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import { createEnvelope } from "@linkshell/protocol";
|
|
2
|
-
import { JsonRpcStdioTransport } from "./json-rpc.js";
|
|
3
|
-
import { resolveCodexAppServerCommands } from "./provider-resolver.js";
|
|
4
|
-
const CODEX_PROXY_STARTUP_GRACE_MS = 250;
|
|
5
|
-
export class CodexRpcBridge {
|
|
6
|
-
input;
|
|
7
|
-
transport;
|
|
8
|
-
transportReady = false;
|
|
9
|
-
starting = false;
|
|
10
|
-
stopping = false;
|
|
11
|
-
candidateIndex = 0;
|
|
12
|
-
startupTimer;
|
|
13
|
-
queuedMessages = [];
|
|
14
|
-
inFlightRequests = new Map();
|
|
15
|
-
constructor(input) {
|
|
16
|
-
this.input = input;
|
|
17
|
-
}
|
|
18
|
-
send(message) {
|
|
19
|
-
const jsonMessage = message;
|
|
20
|
-
if (isJsonRpcNotification(jsonMessage) && jsonMessage.method === "initialized") {
|
|
21
|
-
if (this.input.verbose) {
|
|
22
|
-
process.stderr.write("[agent:codex-rpc] dropped initialized notification for Codex app-server\n");
|
|
23
|
-
}
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
this.ensureTransport();
|
|
27
|
-
if (!this.transportReady) {
|
|
28
|
-
this.queuedMessages.push(jsonMessage);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
this.rememberRequest(jsonMessage);
|
|
32
|
-
this.transport?.send(jsonMessage);
|
|
33
|
-
}
|
|
34
|
-
stop() {
|
|
35
|
-
this.stopping = true;
|
|
36
|
-
if (this.startupTimer) {
|
|
37
|
-
clearTimeout(this.startupTimer);
|
|
38
|
-
this.startupTimer = undefined;
|
|
39
|
-
}
|
|
40
|
-
this.transport?.stop();
|
|
41
|
-
this.transport = undefined;
|
|
42
|
-
this.transportReady = false;
|
|
43
|
-
this.starting = false;
|
|
44
|
-
this.queuedMessages = [];
|
|
45
|
-
this.inFlightRequests.clear();
|
|
46
|
-
this.stopping = false;
|
|
47
|
-
}
|
|
48
|
-
ensureTransport() {
|
|
49
|
-
if (this.transport || this.starting)
|
|
50
|
-
return;
|
|
51
|
-
const candidates = this.commandCandidates();
|
|
52
|
-
if (candidates.length === 0) {
|
|
53
|
-
throw new Error("Codex app-server command is unavailable.");
|
|
54
|
-
}
|
|
55
|
-
this.startCandidate(this.candidateIndex);
|
|
56
|
-
}
|
|
57
|
-
commandCandidates() {
|
|
58
|
-
return this.input.commandCandidates ?? resolveCodexAppServerCommands({
|
|
59
|
-
command: this.input.command,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
startCandidate(index) {
|
|
63
|
-
const config = this.commandCandidates()[index];
|
|
64
|
-
if (!config) {
|
|
65
|
-
this.failQueued("Codex app-server command is unavailable.");
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
this.candidateIndex = index;
|
|
69
|
-
this.starting = true;
|
|
70
|
-
this.transportReady = false;
|
|
71
|
-
this.transport = new JsonRpcStdioTransport(config.command, config.framing, () => { }, () => ({}), (message) => this.handleTransportExit(message), (message) => {
|
|
72
|
-
this.forgetRequest(message);
|
|
73
|
-
this.input.send(createEnvelope({
|
|
74
|
-
type: "agent.codex.rpc",
|
|
75
|
-
hostDeviceId: this.input.hostDeviceId,
|
|
76
|
-
payload: message,
|
|
77
|
-
}));
|
|
78
|
-
return true;
|
|
79
|
-
}, {
|
|
80
|
-
includeJsonrpc: false,
|
|
81
|
-
verbose: this.input.verbose,
|
|
82
|
-
onStderrData: (message) => this.handleTransportStderr(message),
|
|
83
|
-
});
|
|
84
|
-
this.transport.start(this.input.cwd);
|
|
85
|
-
if (this.input.verbose) {
|
|
86
|
-
process.stderr.write(`[agent:codex-rpc] started ${config.command}\n`);
|
|
87
|
-
}
|
|
88
|
-
this.startupTimer = setTimeout(() => {
|
|
89
|
-
this.startupTimer = undefined;
|
|
90
|
-
this.transportReady = true;
|
|
91
|
-
this.starting = false;
|
|
92
|
-
this.flushQueued();
|
|
93
|
-
}, CODEX_PROXY_STARTUP_GRACE_MS);
|
|
94
|
-
}
|
|
95
|
-
handleTransportExit(message) {
|
|
96
|
-
if (this.stopping)
|
|
97
|
-
return;
|
|
98
|
-
if (this.startupTimer) {
|
|
99
|
-
clearTimeout(this.startupTimer);
|
|
100
|
-
this.startupTimer = undefined;
|
|
101
|
-
}
|
|
102
|
-
const wasReady = this.transportReady;
|
|
103
|
-
this.transport = undefined;
|
|
104
|
-
this.transportReady = false;
|
|
105
|
-
this.starting = false;
|
|
106
|
-
const nextIndex = this.candidateIndex + 1;
|
|
107
|
-
if (!wasReady && nextIndex < this.commandCandidates().length) {
|
|
108
|
-
if (this.input.verbose) {
|
|
109
|
-
process.stderr.write(`[agent:codex-rpc] ${message}; falling back\n`);
|
|
110
|
-
}
|
|
111
|
-
this.startCandidate(nextIndex);
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
this.failQueued(message);
|
|
115
|
-
this.failInFlight(message);
|
|
116
|
-
this.emitError(message);
|
|
117
|
-
}
|
|
118
|
-
flushQueued() {
|
|
119
|
-
const messages = this.queuedMessages.splice(0);
|
|
120
|
-
for (const message of messages) {
|
|
121
|
-
this.rememberRequest(message);
|
|
122
|
-
this.transport?.send(message);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
failQueued(message) {
|
|
126
|
-
const queued = this.queuedMessages.splice(0);
|
|
127
|
-
for (const item of queued) {
|
|
128
|
-
if (!("id" in item) || item.id === undefined || item.id === null)
|
|
129
|
-
continue;
|
|
130
|
-
this.input.send(createEnvelope({
|
|
131
|
-
type: "agent.codex.rpc",
|
|
132
|
-
hostDeviceId: this.input.hostDeviceId,
|
|
133
|
-
payload: {
|
|
134
|
-
jsonrpc: "2.0",
|
|
135
|
-
id: item.id,
|
|
136
|
-
error: { code: -32000, message },
|
|
137
|
-
},
|
|
138
|
-
}));
|
|
139
|
-
}
|
|
140
|
-
if (this.input.verbose) {
|
|
141
|
-
process.stderr.write(`[agent:codex-rpc] ${message}\n`);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
emitError(message) {
|
|
145
|
-
this.input.send(createEnvelope({
|
|
146
|
-
type: "agent.codex.rpc",
|
|
147
|
-
hostDeviceId: this.input.hostDeviceId,
|
|
148
|
-
payload: {
|
|
149
|
-
jsonrpc: "2.0",
|
|
150
|
-
id: "linkshell-codex-rpc-error",
|
|
151
|
-
error: { code: -32000, message },
|
|
152
|
-
},
|
|
153
|
-
}));
|
|
154
|
-
}
|
|
155
|
-
handleTransportStderr(message) {
|
|
156
|
-
if (this.input.verbose) {
|
|
157
|
-
process.stderr.write(`[agent:codex-rpc] stderr ignored while app-server is running: ${message}\n`);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
rememberRequest(message) {
|
|
161
|
-
if (!isJsonRpcRequest(message))
|
|
162
|
-
return;
|
|
163
|
-
this.inFlightRequests.set(message.id, message);
|
|
164
|
-
}
|
|
165
|
-
forgetRequest(message) {
|
|
166
|
-
if (!isJsonRpcResponse(message))
|
|
167
|
-
return;
|
|
168
|
-
this.inFlightRequests.delete(message.id);
|
|
169
|
-
}
|
|
170
|
-
failInFlight(message) {
|
|
171
|
-
const requests = [...this.inFlightRequests.values()];
|
|
172
|
-
this.inFlightRequests.clear();
|
|
173
|
-
for (const item of requests) {
|
|
174
|
-
if (!isJsonRpcRequest(item))
|
|
175
|
-
continue;
|
|
176
|
-
this.input.send(createEnvelope({
|
|
177
|
-
type: "agent.codex.rpc",
|
|
178
|
-
hostDeviceId: this.input.hostDeviceId,
|
|
179
|
-
payload: {
|
|
180
|
-
jsonrpc: "2.0",
|
|
181
|
-
id: item.id,
|
|
182
|
-
error: { code: -32000, message },
|
|
183
|
-
},
|
|
184
|
-
}));
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
function isJsonRpcRequest(message) {
|
|
189
|
-
return "id" in message &&
|
|
190
|
-
"method" in message &&
|
|
191
|
-
(typeof message.id === "string" || typeof message.id === "number") &&
|
|
192
|
-
typeof message.method === "string";
|
|
193
|
-
}
|
|
194
|
-
function isJsonRpcResponse(message) {
|
|
195
|
-
return "id" in message &&
|
|
196
|
-
(typeof message.id === "string" || typeof message.id === "number") &&
|
|
197
|
-
("result" in message || "error" in message);
|
|
198
|
-
}
|
|
199
|
-
function isJsonRpcNotification(message) {
|
|
200
|
-
return !("id" in message) &&
|
|
201
|
-
"method" in message &&
|
|
202
|
-
typeof message.method === "string";
|
|
203
|
-
}
|
|
204
|
-
//# sourceMappingURL=codex-rpc-bridge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codex-rpc-bridge.js","sourceRoot":"","sources":["../../../../../src/runtime/acp/codex-rpc-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,qBAAqB,EAAuB,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,6BAA6B,EAA2B,MAAM,wBAAwB,CAAC;AAEhG,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAIzC,MAAM,OAAO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,SAAS,qBAAqB,CAAC,OAAuB;IACpD,OAAO,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC;QACvB,QAAQ,IAAI,OAAO;QACnB,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC;AACvC,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
export interface CodexStoredSession {
|
|
2
|
-
id: string;
|
|
3
|
-
cwd: string;
|
|
4
|
-
title?: string;
|
|
5
|
-
createdAt?: number;
|
|
6
|
-
lastModified: number;
|
|
7
|
-
archived?: boolean;
|
|
8
|
-
status?: string;
|
|
9
|
-
runningTurnId?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface StoredAgentTimelineItem {
|
|
12
|
-
id: string;
|
|
13
|
-
conversationId: string;
|
|
14
|
-
type: "message" | "tool_call";
|
|
15
|
-
kind?: "tool_activity" | "command_execution" | "file_change";
|
|
16
|
-
itemId?: string;
|
|
17
|
-
role?: "user" | "assistant" | "system";
|
|
18
|
-
content?: Array<{
|
|
19
|
-
type: "text";
|
|
20
|
-
text: string;
|
|
21
|
-
}>;
|
|
22
|
-
text?: string;
|
|
23
|
-
toolCall?: {
|
|
24
|
-
id: string;
|
|
25
|
-
name: string;
|
|
26
|
-
input?: string;
|
|
27
|
-
output?: string;
|
|
28
|
-
createdAt?: number;
|
|
29
|
-
status: "pending" | "running" | "completed" | "failed";
|
|
30
|
-
};
|
|
31
|
-
commandExecution?: {
|
|
32
|
-
command?: string;
|
|
33
|
-
cwd?: string;
|
|
34
|
-
output?: string;
|
|
35
|
-
exitCode?: number | null;
|
|
36
|
-
status?: "pending" | "running" | "completed" | "failed";
|
|
37
|
-
};
|
|
38
|
-
fileChange?: {
|
|
39
|
-
entries: Array<{
|
|
40
|
-
path: string;
|
|
41
|
-
kind?: string;
|
|
42
|
-
added?: number;
|
|
43
|
-
removed?: number;
|
|
44
|
-
}>;
|
|
45
|
-
diff?: string;
|
|
46
|
-
summary?: string;
|
|
47
|
-
status?: "pending" | "running" | "completed" | "failed";
|
|
48
|
-
};
|
|
49
|
-
createdAt: number;
|
|
50
|
-
updatedAt?: number;
|
|
51
|
-
metadata?: Record<string, unknown>;
|
|
52
|
-
}
|
|
53
|
-
export declare function listCodexStoredSessions(inputCwd: string): {
|
|
54
|
-
sessions: CodexStoredSession[];
|
|
55
|
-
};
|
|
56
|
-
export declare function loadCodexStoredTimeline(sessionId: string, conversationId: string, inputCwd: string, options?: {
|
|
57
|
-
maxItems?: number;
|
|
58
|
-
}): {
|
|
59
|
-
items: StoredAgentTimelineItem[];
|
|
60
|
-
};
|