@selesai/code 0.9.0 → 0.9.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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@selesai/code` will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.9.2] - 2026-08-20
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **Token-In premium model availability.** Restore the bundled `auto-premium` model so existing premium model selections continue to resolve while the default remains the supported `tokenin/auto:max`.
|
|
9
|
+
|
|
10
|
+
## [0.9.1] - 2026-08-20
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- **Token-In model defaults.** Use the supported `auto` model for the main session and core subagent roles, remove the unsupported `auto-premium` default, and update its bundled context window to 384K.
|
|
14
|
+
|
|
5
15
|
## [0.9.0] - 2026-08-20
|
|
6
16
|
|
|
7
17
|
### Added
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"name": "Auto",
|
|
16
16
|
"reasoning": true,
|
|
17
17
|
"input": ["text"],
|
|
18
|
-
"contextWindow":
|
|
18
|
+
"contextWindow": 393216,
|
|
19
19
|
"maxTokens": 64000,
|
|
20
20
|
"thinkingLevelMap": {
|
|
21
21
|
"minimal": null,
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"id": "auto-premium",
|
|
31
|
-
"name": "Auto
|
|
31
|
+
"name": "Auto",
|
|
32
32
|
"reasoning": true,
|
|
33
33
|
"input": ["text"],
|
|
34
|
-
"contextWindow":
|
|
34
|
+
"contextWindow": 393216,
|
|
35
35
|
"maxTokens": 64000,
|
|
36
36
|
"thinkingLevelMap": {
|
|
37
37
|
"minimal": null,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"keepRecentTokens": 32000,
|
|
10
10
|
"reserveTokens": 64000
|
|
11
11
|
},
|
|
12
|
-
"defaultModel": "auto
|
|
12
|
+
"defaultModel": "auto",
|
|
13
13
|
"defaultProvider": "tokenin",
|
|
14
14
|
"defaultThinkingLevel": "max",
|
|
15
15
|
"doubleEscapeAction": "tree",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"subagents": {
|
|
45
45
|
"agentOverrides": {
|
|
46
46
|
"architect": {
|
|
47
|
-
"model": "tokenin/auto
|
|
47
|
+
"model": "tokenin/auto:max"
|
|
48
48
|
},
|
|
49
49
|
"builder": {
|
|
50
|
-
"model": "tokenin/auto
|
|
50
|
+
"model": "tokenin/auto:max"
|
|
51
51
|
},
|
|
52
52
|
"commentator": {
|
|
53
|
-
"model": "tokenin/auto
|
|
53
|
+
"model": "tokenin/auto:max"
|
|
54
54
|
},
|
|
55
55
|
"explorer": {
|
|
56
56
|
"model": "tokenin/auto:max"
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
# Kilo Code VS Code Architecture and Selesai Integration Feasibility
|
|
2
|
+
|
|
3
|
+
**Research date:** 2026-08-20
|
|
4
|
+
**Repositories:** [Kilo Code](https://github.com/Kilo-Org/kilocode), this Selesai Code repository
|
|
5
|
+
**Question:** Does Kilo use RPA or another integration mechanism, and can Selesai provide a similar or better VS Code extension?
|
|
6
|
+
|
|
7
|
+
## Executive conclusion
|
|
8
|
+
|
|
9
|
+
Kilo Code is **not primarily an RPA application** and its core is not an LSP client/server. It is a layered VS Code product:
|
|
10
|
+
|
|
11
|
+
1. A normal VS Code extension host (`packages/kilo-vscode`) activated through `vscode` APIs.
|
|
12
|
+
2. Webview-based UI surfaces (sidebar, panels, agent manager, settings, diffs).
|
|
13
|
+
3. A lazily spawned local Kilo CLI backend (`kilo serve --port 0`).
|
|
14
|
+
4. An SDK/client connection from the extension host to that backend over authenticated local HTTP APIs and SSE event streaming.
|
|
15
|
+
5. Separate WebSocket paths for selected features such as PTY terminal streaming and cloud event service.
|
|
16
|
+
6. MCP client transports for tool/server integration: local stdio subprocesses and remote HTTP/SSE transports.
|
|
17
|
+
|
|
18
|
+
The important correction to a simplistic “Webview only” description is that **Webview `postMessage` is only the UI bridge**. In the current Kilo repository, the extension also connects to a local backend server. The extension spawns the backend, discovers its ephemeral port from stdout, gives it a generated password, and uses an SDK plus HTTP/SSE with Basic authentication.
|
|
19
|
+
|
|
20
|
+
Selesai can absolutely support a comparable VS Code extension. The shortest path is a VS Code extension-host backend that starts `selesai --mode rpc` and adapts the existing strict JSONL RPC client/events into a Webview. The best long-term path is probably a two-tier design:
|
|
21
|
+
|
|
22
|
+
- **MVP:** local child process + existing Selesai RPC over private stdin/stdout.
|
|
23
|
+
- **Better product integration:** a small authenticated local HTTP/SSE or WebSocket server facade, or direct in-process SDK use where safe, with a stable VS Code-oriented protocol.
|
|
24
|
+
|
|
25
|
+
Selesai already has unusually strong agent/session/extension primitives. Its main missing pieces for Kilo-level VS Code integration are a polished VS Code package, a durable UI protocol/adapter, explicit trust UX, and (if remote or multi-client use is desired) authenticated network transport.
|
|
26
|
+
|
|
27
|
+
## 1. What Kilo actually uses
|
|
28
|
+
|
|
29
|
+
### 1.1 VS Code extension activation
|
|
30
|
+
|
|
31
|
+
Kilo's extension is a conventional TypeScript VS Code extension. The activation function accepts `vscode.ExtensionContext`, constructs shared services, and registers views/providers through the VS Code API:
|
|
32
|
+
|
|
33
|
+
- [`packages/kilo-vscode/src/extension.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/extension.ts#L45-L61) — `activate(context)` and shared `KiloConnectionService`.
|
|
34
|
+
- [`packages/kilo-vscode/src/extension.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/extension.ts#L131-L143) — creates `KiloProvider` and calls `vscode.window.registerWebviewViewProvider(...)`.
|
|
35
|
+
- The extension manifest/build configuration is in [`packages/kilo-vscode/package.json`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/package.json) and the repository root package configuration.
|
|
36
|
+
|
|
37
|
+
This is ordinary VS Code extension-host architecture, not RPA automation of the VS Code UI.
|
|
38
|
+
|
|
39
|
+
### 1.2 Webview UI bridge
|
|
40
|
+
|
|
41
|
+
Kilo's chat and panels use Webviews. The extension host attaches a Webview and receives structured messages with `webview.onDidReceiveMessage`; it sends state, stream, and command results back using `webview.postMessage`:
|
|
42
|
+
|
|
43
|
+
- [`KiloProvider.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/KiloProvider.ts#L987-L1019) — `attachToWebview`, handler setup, interception, and routing.
|
|
44
|
+
- [`KiloProvider.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/KiloProvider.ts#L1013-L1040) — inbound message handling and dispatch.
|
|
45
|
+
- [`extension.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/extension.ts#L137-L143) — sidebar Webview registration.
|
|
46
|
+
|
|
47
|
+
The Webview bridge is **structured local message passing across the VS Code extension/Webview boundary**. It is not HTTP RPC, LSP, or RPA.
|
|
48
|
+
|
|
49
|
+
### 1.3 The extension spawns a local backend
|
|
50
|
+
|
|
51
|
+
The current code explicitly documents that the CLI backend starts lazily rather than during extension activation:
|
|
52
|
+
|
|
53
|
+
> “The CLI backend is NOT spawned here; it starts lazily when a webview connects or when ensureBackendForAutocomplete() triggers it.”
|
|
54
|
+
|
|
55
|
+
Source: [`packages/kilo-vscode/src/extension.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/extension.ts#L45-L49).
|
|
56
|
+
|
|
57
|
+
The server manager starts a local CLI process with an ephemeral port:
|
|
58
|
+
|
|
59
|
+
- [`server-manager.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/services/cli-backend/server-manager.ts#L92-L120) — spawns `cliPath serve --port 0` with a workspace-derived cwd.
|
|
60
|
+
- [`server-manager.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/services/cli-backend/server-manager.ts#L118-L161) — passes environment, including `KILO_SERVER_PASSWORD`, parent PID, VS Code metadata, and `stdio: ["ignore", "pipe", "pipe"]`.
|
|
61
|
+
- [`server-manager.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/services/cli-backend/server-manager.ts#L167-L177) — reads child stdout and parses the selected port.
|
|
62
|
+
|
|
63
|
+
This is a **local child process plus local server** architecture. It is RPC-like in the broad sense, but it is not RPA.
|
|
64
|
+
|
|
65
|
+
### 1.4 HTTP/API client and SSE events
|
|
66
|
+
|
|
67
|
+
`KiloConnectionService` owns one backend manager, one Kilo SDK client, and one SSE adapter for multiple UI providers:
|
|
68
|
+
|
|
69
|
+
- [`connection-service.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/services/cli-backend/connection-service.ts#L80-L99) — describes and declares the shared service, client, and SSE adapter.
|
|
70
|
+
- [`connection-service.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/services/cli-backend/connection-service.ts#L149-L150) — lazy startup/connection entrypoint.
|
|
71
|
+
- [`types.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/services/cli-backend/types.ts#L1-L20) — server configuration includes `baseUrl` and `password`.
|
|
72
|
+
|
|
73
|
+
The extension checks backend health over HTTP with Basic authentication:
|
|
74
|
+
|
|
75
|
+
- [`connection-service.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/services/cli-backend/connection-service.ts#L733-L777) — periodic `GET ${baseUrl}/global/health`, `Authorization: Basic ...`, and reconnect behavior.
|
|
76
|
+
|
|
77
|
+
Thus the current Kilo architecture is more accurately:
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
VS Code Webview
|
|
81
|
+
│ postMessage / onDidReceiveMessage
|
|
82
|
+
▼
|
|
83
|
+
Kilo extension host
|
|
84
|
+
│ Kilo SDK over authenticated localhost HTTP
|
|
85
|
+
│ SSE event stream
|
|
86
|
+
▼
|
|
87
|
+
local `kilo serve --port 0` process
|
|
88
|
+
│
|
|
89
|
+
├─ model/provider APIs
|
|
90
|
+
├─ sessions/tools/filesystem
|
|
91
|
+
└─ MCP clients
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 1.5 WebSockets are feature-specific, not the basic UI bridge
|
|
95
|
+
|
|
96
|
+
The repository has WebSocket use for feature-specific paths. For example, the Agent Manager terminal routes PTY bytes over a WebSocket rather than through Webview messages:
|
|
97
|
+
|
|
98
|
+
- [`terminal-manager.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/agent-manager/terminal-manager.ts#L1-L10) — describes PTY output over `/pty/:id/connect` WebSocket.
|
|
99
|
+
- [`terminal-routing.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/agent-manager/terminal-routing.ts#L242-L248) — builds an authenticated loopback WebSocket URL with `auth_token`.
|
|
100
|
+
- [`event-service-client.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/kiloclaw/event-service-client.ts#L1-L10) — cloud event-service ticket flow and WebSocket subprotocol.
|
|
101
|
+
|
|
102
|
+
This demonstrates that Kilo chooses transport by use case: Webview messages for UI commands/state, HTTP/SSE for backend API/events, and WebSocket for high-volume or cloud event paths.
|
|
103
|
+
|
|
104
|
+
### 1.6 MCP is an integration protocol, not the extension connection
|
|
105
|
+
|
|
106
|
+
Kilo's MCP code imports multiple official MCP SDK transports:
|
|
107
|
+
|
|
108
|
+
- [`packages/opencode/src/mcp/index.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/opencode/src/mcp/index.ts#L15-L19) — `StreamableHTTPClientTransport`, `SSEClientTransport`, and `StdioClientTransport`.
|
|
109
|
+
- [`packages/opencode/src/mcp/index.ts`](https://github.com/Kilo-Org/kilocode/blob/main/packages/opencode/src/mcp/index.ts#L369-L389) — local MCP config launches a command using `StdioClientTransport` with cwd/environment.
|
|
110
|
+
|
|
111
|
+
MCP lets the coding agent connect to tools/resources exposed by configured MCP servers. It does **not** appear to be the protocol connecting Kilo's VS Code Webview to its extension host. Those are separate layers.
|
|
112
|
+
|
|
113
|
+
## 2. Is it RPA, LSP, RPC, or something else?
|
|
114
|
+
|
|
115
|
+
| Technology | Kilo role | Conclusion |
|
|
116
|
+
|---|---|---|
|
|
117
|
+
| RPA (Robotic Process Automation) | None identified as a framework/protocol | No. Agentic file/terminal/browser automation is not conventional RPA architecture. |
|
|
118
|
+
| VS Code Extension API | Activation, commands, views, workspace, terminals, Webviews | Yes; foundational. |
|
|
119
|
+
| Webview message bridge | UI ↔ extension host messages | Yes; local structured messaging. |
|
|
120
|
+
| Local child process | Extension starts `kilo serve` | Yes. |
|
|
121
|
+
| HTTP | Extension ↔ local backend API and health checks | Yes; authenticated localhost API. |
|
|
122
|
+
| SSE | Backend event stream to extension | Yes. |
|
|
123
|
+
| WebSocket | PTY and selected cloud/event paths | Yes, feature-specific. |
|
|
124
|
+
| MCP | Agent ↔ configured external tools/resources | Yes; separate integration layer. |
|
|
125
|
+
| LSP | Language server/client lifecycle | No evidence of core LSP architecture. |
|
|
126
|
+
| JSON-RPC | Not the main current VS Code connection identified in Kilo | Do not assume this is Kilo's transport. |
|
|
127
|
+
|
|
128
|
+
## 3. What Selesai already provides
|
|
129
|
+
|
|
130
|
+
### 3.1 Existing RPC mode
|
|
131
|
+
|
|
132
|
+
Selesai RPC is a headless JSONL protocol over a child process:
|
|
133
|
+
|
|
134
|
+
- [`docs/rpc.md`](../rpc.md) — protocol, commands, event stream, extension UI protocol, framing, and client examples.
|
|
135
|
+
- [`src/modes/rpc/rpc-mode.ts`](../../src/modes/rpc/rpc-mode.ts) — server implementation over stdin/stdout.
|
|
136
|
+
- [`src/modes/rpc/rpc-types.ts`](../../src/modes/rpc/rpc-types.ts) — typed commands, responses, events, and extension UI messages.
|
|
137
|
+
- [`src/modes/rpc/rpc-client.ts`](../../src/modes/rpc/rpc-client.ts) — typed subprocess client and request correlation.
|
|
138
|
+
- [`src/rpc-entry.ts`](../../src/rpc-entry.ts) — RPC executable entrypoint.
|
|
139
|
+
|
|
140
|
+
The transport is strict LF-delimited JSONL. It has request IDs for responses and asynchronous events for streaming output/tool lifecycle. A VS Code extension can spawn:
|
|
141
|
+
|
|
142
|
+
```text
|
|
143
|
+
selesai --mode rpc --cwd <workspace> [other options]
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
(or spawn the packaged Node CLI with equivalent arguments), then:
|
|
147
|
+
|
|
148
|
+
1. Write one JSON object plus `\n` to stdin.
|
|
149
|
+
2. Parse stdout one LF record at a time.
|
|
150
|
+
3. Correlate `type: "response"` records by `id`.
|
|
151
|
+
4. Render `message_update`, `tool_execution_*`, and lifecycle events.
|
|
152
|
+
5. Wait for `agent_settled`/`agent_end`, not merely prompt acceptance.
|
|
153
|
+
6. Answer `extension_ui_request` records when an extension asks for a dialog.
|
|
154
|
+
|
|
155
|
+
This is sufficient for a local VS Code extension MVP.
|
|
156
|
+
|
|
157
|
+
### 3.2 Direct SDK option
|
|
158
|
+
|
|
159
|
+
Selesai also exports a direct TypeScript/Node SDK:
|
|
160
|
+
|
|
161
|
+
- [`docs/sdk.md`](../sdk.md) — `createAgentSession`, `createAgentSessionRuntime`, event subscription, tools, sessions, cwd, auth, and resources.
|
|
162
|
+
- [`src/core/sdk.ts`](../../src/core/sdk.ts) — SDK options and construction.
|
|
163
|
+
- [`src/index.ts`](../../src/index.ts) — public exports.
|
|
164
|
+
|
|
165
|
+
A VS Code extension host is itself Node-based, so it can potentially use `createAgentSession()` in-process. Advantages are lower latency, no JSON serialization, direct typed events, and custom tool/resource integration. Disadvantages are tighter coupling, more difficult fault isolation, extension-host memory/lifecycle risk, and the need to manage session replacement and extension binding carefully.
|
|
166
|
+
|
|
167
|
+
### 3.3 Existing extension system and RPC UI support
|
|
168
|
+
|
|
169
|
+
Selesai extensions can register tools, commands, event handlers, and UI operations. In RPC mode, dialog and notification UI is translated into an explicit request/response protocol:
|
|
170
|
+
|
|
171
|
+
- [`docs/extensions.md`](../extensions.md) — extension API and security model.
|
|
172
|
+
- [`docs/rpc.md`](../rpc.md) — `select`, `confirm`, `input`, `editor`, `notify`, status, widget, title, and editor-text requests.
|
|
173
|
+
|
|
174
|
+
This is a useful foundation for mapping agent permission questions to VS Code dialogs, status bar items, notifications, and editor input.
|
|
175
|
+
|
|
176
|
+
## 4. Selesai versus Kilo: capability comparison
|
|
177
|
+
|
|
178
|
+
| Capability | Kilo current approach | Selesai current position | Assessment |
|
|
179
|
+
|---|---|---|---|
|
|
180
|
+
| VS Code package | Dedicated `packages/kilo-vscode` extension | No dedicated VS Code extension found in this repository | Kilo leads on product packaging. |
|
|
181
|
+
| Main UI | Multiple Webviews/panels/providers | RPC UI protocol can feed a new Webview | Selesai has protocol primitives; Kilo has finished UI. |
|
|
182
|
+
| Agent backend isolation | Spawned local CLI server | Spawned local RPC process | Both isolate backend; Selesai MVP is simpler. |
|
|
183
|
+
| Backend network API | Authenticated localhost HTTP + SSE | No TCP/HTTP RPC server; stdin/stdout JSONL | Kilo leads for multi-client/network-capable architecture. |
|
|
184
|
+
| Transport auth | Generated password; Basic/loopback auth | No RPC auth handshake; private pipes only | Selesai needs auth before exposing network transport. |
|
|
185
|
+
| Streaming | SSE and WebSocket for relevant paths | JSONL event stream | Both support streaming; Selesai JSONL is easy to adapt. |
|
|
186
|
+
| Sessions | Backend session APIs and shared connection service | Rich RPC/SDK session lifecycle and tree operations | Selesai is strong at protocol-level session control. |
|
|
187
|
+
| Extensions/plugins | Agent/runtime extensions and Kilo services | Extension-first tools/events/UI; RPC-compatible UI | Selesai is potentially more extensible, but needs VS Code UX. |
|
|
188
|
+
| MCP | Local stdio and remote transports | Extension/tool ecosystem exists; MCP parity should be audited separately | Kilo has explicit MCP transport integration. |
|
|
189
|
+
| Terminal/PTy | Dedicated terminal manager and WebSocket streaming | RPC bash exists; no Kilo-equivalent VS Code PTY bridge identified | Kilo leads for native terminal UX. |
|
|
190
|
+
| Trust/security | Backend password and process lifecycle controls | Explicit extension trust exists, but RPC has no auth | Selesai needs a dedicated integration security model. |
|
|
191
|
+
| In-process embedding | Backend/client architecture | First-class SDK | Selesai may be better for tightly integrated custom clients. |
|
|
192
|
+
|
|
193
|
+
## 5. Feasibility: how to build a Selesai VS Code extension
|
|
194
|
+
|
|
195
|
+
### Phase 1 — local MVP (recommended first)
|
|
196
|
+
|
|
197
|
+
Build a conventional VS Code extension with:
|
|
198
|
+
|
|
199
|
+
```text
|
|
200
|
+
VS Code Webview UI
|
|
201
|
+
│ vscode.postMessage
|
|
202
|
+
▼
|
|
203
|
+
Extension host controller
|
|
204
|
+
│ child_process / existing RpcClient
|
|
205
|
+
▼
|
|
206
|
+
selesai --mode rpc (private stdin/stdout)
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Minimum components:
|
|
210
|
+
|
|
211
|
+
- `ExtensionHostController`: owns one Selesai process per workspace/session.
|
|
212
|
+
- `RpcClientAdapter`: wraps the existing `RpcClient`; add or expose extension UI request handling if the current public client does not already do so.
|
|
213
|
+
- `WorkspaceManager`: resolves workspace cwd, session directory, and project trust.
|
|
214
|
+
- `EventStore`: maps streamed events into Webview state, with bounded history and reconnection handling.
|
|
215
|
+
- `WebviewProvider`: chat, streaming text, tool calls, approval questions, model picker, session picker.
|
|
216
|
+
- `Command` registrations: open sidebar, new session, abort, steer, follow-up, model selection.
|
|
217
|
+
- `dispose()` handling: send shutdown/EOF, wait briefly, terminate if necessary.
|
|
218
|
+
|
|
219
|
+
This does **not** need RPA, LSP, MCP, or a network server.
|
|
220
|
+
|
|
221
|
+
### Phase 2 — native VS Code experience
|
|
222
|
+
|
|
223
|
+
Add the features that make an extension feel better than a terminal wrapper:
|
|
224
|
+
|
|
225
|
+
- Inline editor selection/context actions (“Ask Selesai about this”, “Fix this”).
|
|
226
|
+
- Diff-aware edit review using VS Code `WorkspaceEdit` or controlled file edits.
|
|
227
|
+
- Native permission prompts for writes, shell commands, and external tools.
|
|
228
|
+
- Diagnostics/code actions where agent output can be represented safely.
|
|
229
|
+
- Native terminal/task integration and cancellation.
|
|
230
|
+
- Status bar progress, notifications, output channel, and session restoration.
|
|
231
|
+
- Workspace-specific context files and explicit trust prompts.
|
|
232
|
+
- Webview state restoration and multiple workspace/session routing.
|
|
233
|
+
|
|
234
|
+
### Phase 3 — Kilo-like backend facade (only if needed)
|
|
235
|
+
|
|
236
|
+
If Selesai needs multiple clients, remote control, or richer WebSocket/SSE behavior, add an authenticated local server mode rather than exposing raw stdin/stdout through an ad-hoc bridge.
|
|
237
|
+
|
|
238
|
+
Suggested shape:
|
|
239
|
+
|
|
240
|
+
```text
|
|
241
|
+
VS Code extension ── authenticated HTTP/SSE or WebSocket ── Selesai server
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Requirements before shipping:
|
|
245
|
+
|
|
246
|
+
- Bind to loopback by default, never `0.0.0.0` by accident.
|
|
247
|
+
- Generate a high-entropy per-process secret.
|
|
248
|
+
- Require authentication on every endpoint/stream.
|
|
249
|
+
- Scope sessions and cwd to the requesting workspace/client.
|
|
250
|
+
- Validate origin and reject cross-workspace access.
|
|
251
|
+
- Provide process parent watchdog and graceful shutdown.
|
|
252
|
+
- Avoid leaking session paths, API keys, prompts, or tool output in logs.
|
|
253
|
+
- Define protocol versioning and event replay/reconnect semantics.
|
|
254
|
+
- Add rate limits and explicit authorization for destructive operations.
|
|
255
|
+
|
|
256
|
+
## 6. Key risks and design decisions
|
|
257
|
+
|
|
258
|
+
### Security
|
|
259
|
+
|
|
260
|
+
Selesai's RPC stdin/stdout is relatively safe because it is private to the spawned child process. It has no token, handshake, or authorization layer. It must **not** simply be put behind a TCP port. A Kilo-like server facade needs authentication, loopback binding, workspace isolation, and process lifecycle controls.
|
|
261
|
+
|
|
262
|
+
Selesai extensions execute with full system permissions, as documented in [`docs/extensions.md`](../extensions.md). The VS Code extension should not silently enable untrusted project-local extensions or resources. Mirror VS Code's workspace trust decision in the agent startup path.
|
|
263
|
+
|
|
264
|
+
### Prompt completion versus acceptance
|
|
265
|
+
|
|
266
|
+
RPC prompt acceptance is not completion. The UI must track the asynchronous event stream and mark a run complete only on the settled/end lifecycle event. This is essential for streaming text, tool progress, approval prompts, and cancellation.
|
|
267
|
+
|
|
268
|
+
### RPC UI limitations
|
|
269
|
+
|
|
270
|
+
RPC mode supports dialogs and simple status/widget notifications but not all TUI capabilities. A VS Code adapter needs to decide how to map or replace unsupported methods such as custom TUI components, terminal raw input, and theme-specific rendering.
|
|
271
|
+
|
|
272
|
+
### Process versus in-process SDK
|
|
273
|
+
|
|
274
|
+
Use RPC first when reliability and isolation matter. Use the SDK when the extension needs deep typed access and can own the agent lifecycle. A hybrid is possible: keep the default backend out-of-process, offer an in-process mode for development/advanced integrations.
|
|
275
|
+
|
|
276
|
+
### Multi-root workspaces
|
|
277
|
+
|
|
278
|
+
Both resource discovery and tool paths depend on cwd. The extension must choose and persist a workspace root/session mapping rather than relying on the extension host's process cwd. For multi-root workspaces, each session should carry an explicit workspace directory.
|
|
279
|
+
|
|
280
|
+
## 7. Recommended product strategy
|
|
281
|
+
|
|
282
|
+
Selesai can be “similar or better than Kilo” if it focuses on its existing strengths instead of copying every transport immediately:
|
|
283
|
+
|
|
284
|
+
1. **Ship a focused Webview extension over existing RPC.** This delivers value quickly and preserves process isolation.
|
|
285
|
+
2. **Use Selesai's extension-first model as the differentiator:** custom tools, lifecycle hooks, prompt/context injection, subagents, workflows, and provider customization.
|
|
286
|
+
3. **Provide native approvals and diffs**, rather than exposing a terminal transcript inside a Webview.
|
|
287
|
+
4. **Add robust session restoration and workspace routing.** Selesai's RPC/session APIs already provide a good base.
|
|
288
|
+
5. **Add an authenticated HTTP/SSE server only when remote/multi-client requirements justify it.** Do not introduce a network daemon solely to imitate Kilo.
|
|
289
|
+
6. **Add MCP transport parity deliberately** if tool-server interoperability is a product requirement; keep MCP separate from the VS Code UI protocol.
|
|
290
|
+
|
|
291
|
+
### Final answer to the user's questions
|
|
292
|
+
|
|
293
|
+
- **Did Kilo connect using RPA?** No evidence. It uses VS Code APIs, Webview messages, a spawned local CLI backend, authenticated localhost HTTP/SSE, feature-specific WebSockets, and MCP for external tools.
|
|
294
|
+
- **Can Selesai connect through RPC?** Yes. Existing Selesai RPC is a strong local integration seam: strict JSONL over a private child process with typed commands/events and extension UI requests.
|
|
295
|
+
- **Can Selesai have a similar or better VS Code extension?** Yes. A local RPC-backed extension is straightforward and likely the right MVP. Selesai can exceed Kilo in extensibility and session/workflow customization, while Kilo currently has an advantage in mature VS Code UX, native terminal/PTY integration, backend HTTP/SSE, and polished multi-provider UI.
|
|
296
|
+
|
|
297
|
+
## Primary-source references
|
|
298
|
+
|
|
299
|
+
### Kilo Code
|
|
300
|
+
|
|
301
|
+
- [Extension activation](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/extension.ts)
|
|
302
|
+
- [Kilo Webview provider](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/KiloProvider.ts)
|
|
303
|
+
- [CLI server manager](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/services/cli-backend/server-manager.ts)
|
|
304
|
+
- [Shared backend connection service](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/services/cli-backend/connection-service.ts)
|
|
305
|
+
- [Backend server config](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/services/cli-backend/types.ts)
|
|
306
|
+
- [MCP transports](https://github.com/Kilo-Org/kilocode/blob/main/packages/opencode/src/mcp/index.ts)
|
|
307
|
+
- [PTY WebSocket routing](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/agent-manager/terminal-routing.ts)
|
|
308
|
+
- [PTY WebSocket manager](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-vscode/src/agent-manager/terminal-manager.ts)
|
|
309
|
+
|
|
310
|
+
### Selesai Code
|
|
311
|
+
|
|
312
|
+
- [`docs/rpc.md`](../rpc.md)
|
|
313
|
+
- [`docs/sdk.md`](../sdk.md)
|
|
314
|
+
- [`docs/extensions.md`](../extensions.md)
|
|
315
|
+
- [`src/modes/rpc/rpc-mode.ts`](../../src/modes/rpc/rpc-mode.ts)
|
|
316
|
+
- [`src/modes/rpc/rpc-types.ts`](../../src/modes/rpc/rpc-types.ts)
|
|
317
|
+
- [`src/modes/rpc/rpc-client.ts`](../../src/modes/rpc/rpc-client.ts)
|
|
318
|
+
- [`src/core/sdk.ts`](../../src/core/sdk.ts)
|
|
319
|
+
- [`src/index.ts`](../../src/index.ts)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selesai/code",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Maintained, extension-first Pi coding agent with built-in workflows, subagents, web research, questions, skills, and an enhanced terminal UI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|