@linzumi/cli 0.0.5-beta → 0.0.7-beta
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 +197 -85
- package/package.json +18 -11
- package/src/authResolution.ts +2 -0
- package/src/boundedCache.ts +57 -0
- package/src/channelSession.ts +907 -453
- package/src/codexRuntimeOptions.ts +80 -0
- package/src/dependencyStatus.ts +198 -0
- package/src/forwardTunnel.ts +834 -0
- package/src/forwardTunnelProtocol.ts +324 -0
- package/src/index.ts +414 -30
- package/src/kandanTls.ts +86 -0
- package/src/localCapabilities.ts +130 -0
- package/src/localCodexMessageState.ts +135 -0
- package/src/localCodexTurnState.ts +108 -0
- package/src/localEditor.ts +963 -0
- package/src/localEditorRuntime.ts +603 -0
- package/src/localForwarding.ts +500 -0
- package/src/oauth.ts +135 -4
- package/src/pendingKandanMessageQueue.ts +109 -0
- package/src/phoenix.ts +8 -0
- package/src/portForwardApproval.ts +181 -0
- package/src/portForwardWatcher.ts +404 -0
- package/src/protocol.ts +97 -3
- package/src/runner.ts +391 -30
- package/src/streamDeltaCoalescing.ts +129 -0
- package/src/streamDeltaQueue.ts +102 -0
package/src/protocol.ts
CHANGED
|
@@ -14,6 +14,29 @@
|
|
|
14
14
|
Relationship: Defines the typed runner control that carries a Kandan
|
|
15
15
|
Approve/Deny decision back to the local Codex app-server approval request
|
|
16
16
|
without exposing a browser-to-runner socket.
|
|
17
|
+
|
|
18
|
+
- Date: 2026-04-26
|
|
19
|
+
Spec: plans/2026-04-26-local-codex-driver-worldclass-spec.md
|
|
20
|
+
Relationship: Carries the runner streaming flush interval so live Codex
|
|
21
|
+
output can be batched before Kandan persistence without changing the logical
|
|
22
|
+
transcript protocol.
|
|
23
|
+
|
|
24
|
+
- Date: 2026-04-26
|
|
25
|
+
Spec: plans/2026-04-26-local-runner-forwarding-and-editor-plan.md
|
|
26
|
+
Relationship: Defines the typed control used by Kandan to ask a connected
|
|
27
|
+
runner to perform one bounded HTTP request against an explicitly allowed
|
|
28
|
+
local preview port, and the typed control used to ask the runner to start a
|
|
29
|
+
loopback-only local code-server editor for an allowed cwd.
|
|
30
|
+
|
|
31
|
+
- Date: 2026-04-26
|
|
32
|
+
Spec: plans/2026-04-26-local-runner-port-forward-approval.md
|
|
33
|
+
Relationship: Defines the typed approval control Kandan sends after the
|
|
34
|
+
in-app local port prompt is resolved by the authorized listener user.
|
|
35
|
+
|
|
36
|
+
- Date: 2026-04-26
|
|
37
|
+
Spec: plans/2026-04-26-local-runner-subdomain-forwarding-epr.md
|
|
38
|
+
Relationship: Defines the typed WebSocket forwarding controls used by
|
|
39
|
+
isolated preview subdomains.
|
|
17
40
|
*/
|
|
18
41
|
export type JsonValue =
|
|
19
42
|
| null
|
|
@@ -56,14 +79,17 @@ export type JsonRpcResponse =
|
|
|
56
79
|
};
|
|
57
80
|
};
|
|
58
81
|
|
|
59
|
-
export type JsonRpcMessage =
|
|
82
|
+
export type JsonRpcMessage =
|
|
83
|
+
| JsonRpcRequest
|
|
84
|
+
| JsonRpcNotification
|
|
85
|
+
| JsonRpcResponse;
|
|
60
86
|
|
|
61
87
|
export type PhoenixFrame = readonly [
|
|
62
88
|
joinRef: string | null,
|
|
63
89
|
ref: string | null,
|
|
64
90
|
topic: string,
|
|
65
91
|
event: string,
|
|
66
|
-
payload: JsonValue
|
|
92
|
+
payload: JsonValue,
|
|
67
93
|
];
|
|
68
94
|
|
|
69
95
|
export type RunnerToKandanEvent =
|
|
@@ -108,6 +134,11 @@ export type KandanControl =
|
|
|
108
134
|
readonly instanceId?: string;
|
|
109
135
|
readonly cwd?: string;
|
|
110
136
|
readonly launchTui?: boolean;
|
|
137
|
+
readonly model?: string;
|
|
138
|
+
readonly reasoningEffort?: string;
|
|
139
|
+
readonly approvalPolicy?: string;
|
|
140
|
+
readonly sandbox?: string;
|
|
141
|
+
readonly fast?: boolean;
|
|
111
142
|
}
|
|
112
143
|
| {
|
|
113
144
|
readonly type: "stop_instance";
|
|
@@ -150,11 +181,73 @@ export type KandanControl =
|
|
|
150
181
|
readonly requestId: string;
|
|
151
182
|
readonly decision: "approve" | "deny";
|
|
152
183
|
}
|
|
184
|
+
| {
|
|
185
|
+
readonly type: "resolve_port_forward_request";
|
|
186
|
+
readonly instanceId: string;
|
|
187
|
+
readonly requestId: string;
|
|
188
|
+
readonly decision: "approve" | "deny";
|
|
189
|
+
readonly actorUserId?: number | undefined;
|
|
190
|
+
readonly actorSlug?: string | undefined;
|
|
191
|
+
}
|
|
153
192
|
| {
|
|
154
193
|
readonly type: "read_thread";
|
|
155
194
|
readonly instanceId: string;
|
|
156
195
|
readonly threadId: string;
|
|
157
196
|
readonly includeTurns?: boolean;
|
|
197
|
+
}
|
|
198
|
+
| {
|
|
199
|
+
readonly type: "forward_http_request";
|
|
200
|
+
readonly instanceId?: string;
|
|
201
|
+
readonly requestId: string;
|
|
202
|
+
readonly port: number;
|
|
203
|
+
readonly method: string;
|
|
204
|
+
readonly path: string;
|
|
205
|
+
readonly queryString?: string;
|
|
206
|
+
readonly headers?: JsonValue;
|
|
207
|
+
readonly bodyBase64?: string;
|
|
208
|
+
}
|
|
209
|
+
| {
|
|
210
|
+
readonly type: "forward_websocket_open";
|
|
211
|
+
readonly instanceId?: string;
|
|
212
|
+
readonly socketId: string;
|
|
213
|
+
readonly port: number;
|
|
214
|
+
readonly path: string;
|
|
215
|
+
readonly queryString?: string;
|
|
216
|
+
readonly headers?: JsonValue;
|
|
217
|
+
}
|
|
218
|
+
| {
|
|
219
|
+
readonly type: "forward_websocket_send";
|
|
220
|
+
readonly instanceId?: string;
|
|
221
|
+
readonly socketId: string;
|
|
222
|
+
readonly opcode: "text" | "binary" | "ping" | "pong";
|
|
223
|
+
readonly bodyBase64: string;
|
|
224
|
+
}
|
|
225
|
+
| {
|
|
226
|
+
readonly type: "forward_websocket_close";
|
|
227
|
+
readonly instanceId?: string;
|
|
228
|
+
readonly socketId: string;
|
|
229
|
+
}
|
|
230
|
+
| {
|
|
231
|
+
readonly type: "update_runner_config";
|
|
232
|
+
readonly instanceId?: string;
|
|
233
|
+
readonly allowedCwds: readonly string[];
|
|
234
|
+
readonly configVersion?: number;
|
|
235
|
+
}
|
|
236
|
+
| {
|
|
237
|
+
readonly type: "start_local_editor";
|
|
238
|
+
readonly instanceId?: string;
|
|
239
|
+
readonly requestId?: string;
|
|
240
|
+
readonly cwd: string;
|
|
241
|
+
readonly browserBaseUrl?: string;
|
|
242
|
+
readonly collaboration?: {
|
|
243
|
+
readonly provider: "oct";
|
|
244
|
+
readonly editorSessionId: number;
|
|
245
|
+
readonly runtimeSessionId: string;
|
|
246
|
+
readonly roomId: string;
|
|
247
|
+
readonly extensionAssetPath: string;
|
|
248
|
+
readonly serverAssetPath: string;
|
|
249
|
+
readonly bootstrapToken?: string;
|
|
250
|
+
};
|
|
158
251
|
};
|
|
159
252
|
|
|
160
253
|
export type KandanChannelSessionOptions = {
|
|
@@ -166,6 +259,7 @@ export type KandanChannelSessionOptions = {
|
|
|
166
259
|
readonly reasoningEffort?: string | undefined;
|
|
167
260
|
readonly sandbox?: string | undefined;
|
|
168
261
|
readonly approvalPolicy?: string | undefined;
|
|
262
|
+
readonly streamFlushMs?: number | undefined;
|
|
169
263
|
};
|
|
170
264
|
|
|
171
265
|
export function parseJsonObject(text: string): JsonObject {
|
|
@@ -204,7 +298,7 @@ export function extractCodexIds(params: JsonObject): JsonObject {
|
|
|
204
298
|
["turnId", params.turnId],
|
|
205
299
|
["itemId", params.itemId],
|
|
206
300
|
["processId", params.processId],
|
|
207
|
-
["requestId", params.requestId]
|
|
301
|
+
["requestId", params.requestId],
|
|
208
302
|
].filter((entry): entry is [string, JsonValue] => entry[1] !== undefined);
|
|
209
303
|
|
|
210
304
|
return Object.fromEntries(entries) as JsonObject;
|