@felan-ai/felan 0.24.3 → 0.24.5
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/NOTICE +4 -0
- package/README.md +101 -16
- package/dist/acp/interactions.d.ts +22 -0
- package/dist/acp/interactions.d.ts.map +1 -0
- package/dist/acp/interactions.js +352 -0
- package/dist/acp/interactions.js.map +1 -0
- package/dist/acp/login.d.ts +39 -0
- package/dist/acp/login.d.ts.map +1 -0
- package/dist/acp/login.js +500 -0
- package/dist/acp/login.js.map +1 -0
- package/dist/acp/server.d.ts +25 -0
- package/dist/acp/server.d.ts.map +1 -0
- package/dist/acp/server.js +96 -0
- package/dist/acp/server.js.map +1 -0
- package/dist/acp/session-registry.d.ts +25 -0
- package/dist/acp/session-registry.d.ts.map +1 -0
- package/dist/acp/session-registry.js +450 -0
- package/dist/acp/session-registry.js.map +1 -0
- package/dist/acp/session-updates.d.ts +44 -0
- package/dist/acp/session-updates.d.ts.map +1 -0
- package/dist/acp/session-updates.js +1076 -0
- package/dist/acp/session-updates.js.map +1 -0
- package/dist/acp/stdio.d.ts +13 -0
- package/dist/acp/stdio.d.ts.map +1 -0
- package/dist/acp/stdio.js +55 -0
- package/dist/acp/stdio.js.map +1 -0
- package/dist/cli-main.d.ts +2 -0
- package/dist/cli-main.d.ts.map +1 -1
- package/dist/cli-main.js +34 -3
- package/dist/cli-main.js.map +1 -1
- package/dist/dependencies.js +14 -14
- package/dist/dependencies.js.map +1 -1
- package/dist/extension-settings.js +2 -2
- package/dist/extension-settings.js.map +1 -1
- package/dist/mcp/oauth-host.js +2 -2
- package/dist/mcp/oauth-host.js.map +1 -1
- package/dist/memory/coordinator.js +1 -1
- package/dist/memory/coordinator.js.map +1 -1
- package/dist/process-restart.js +1 -1
- package/dist/process-restart.js.map +1 -1
- package/dist/restart-command.js +3 -3
- package/dist/restart-command.js.map +1 -1
- package/dist/runtime.d.ts +8 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +15 -1
- package/dist/runtime.js.map +1 -1
- package/dist/savings.js +1 -1
- package/dist/savings.js.map +1 -1
- package/dist/startup-header.js +1 -1
- package/dist/startup-header.js.map +1 -1
- package/dist/subagents/catalog.js +8 -8
- package/dist/subagents/catalog.js.map +1 -1
- package/dist/subagents/host.d.ts +4 -0
- package/dist/subagents/host.d.ts.map +1 -1
- package/dist/subagents/host.js +7 -2
- package/dist/subagents/host.js.map +1 -1
- package/dist/update-notification.js +2 -2
- package/dist/update-notification.js.map +1 -1
- package/dist/update.js +8 -8
- package/dist/update.js.map +1 -1
- package/package.json +8 -7
package/NOTICE
CHANGED
|
@@ -23,6 +23,10 @@ Copyright (c) 2025 Mario Zechner.
|
|
|
23
23
|
It also uses @earendil-works/pi-server 0.85.1 from the same project under the
|
|
24
24
|
MIT License.
|
|
25
25
|
|
|
26
|
+
This package uses @agentclientprotocol/sdk 1.4.0 from
|
|
27
|
+
https://github.com/agentclientprotocol/typescript-sdk, licensed under the
|
|
28
|
+
Apache License 2.0. Copyright 2025 Zed Industries, Inc. and contributors.
|
|
29
|
+
|
|
26
30
|
The local powerline subscription host adapts provider request behavior from
|
|
27
31
|
packages/pi-powerline in https://github.com/mslavov/pi-extensions at commit
|
|
28
32
|
7e72e509fe45a5a87c4c2e176cb711de994a8c1d. Copyright (c) 2026 Milko Slavov.
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Felan Code
|
|
2
2
|
|
|
3
3
|
Local, account-free, model-portable coding agent built for cost-efficient,
|
|
4
4
|
verifiable software work on `@felan-ai/agent-core` and Pi's interactive TUI
|
|
@@ -19,7 +19,7 @@ in the `@felan-ai/ext-*` packages.
|
|
|
19
19
|
|
|
20
20
|
## Requirements and quick start
|
|
21
21
|
|
|
22
|
-
Felan supports Node.js 22.19.0 or newer. Repository development and CI use
|
|
22
|
+
Felan Code supports Node.js 22.19.0 or newer. Repository development and CI use
|
|
23
23
|
Node.js 22.20.0 with pnpm 9.15.5.
|
|
24
24
|
|
|
25
25
|
```sh
|
|
@@ -51,15 +51,17 @@ felan [options] [message]
|
|
|
51
51
|
--session <id> Resume a specific session
|
|
52
52
|
--session-dir <dir> Session directory for --session
|
|
53
53
|
--diagnostics Print runtime versions and configuration mode
|
|
54
|
-
update Update a global npm installation of Felan
|
|
54
|
+
update Update a global npm installation of Felan Code
|
|
55
55
|
savings Show persisted estimated API-equivalent savings
|
|
56
|
+
acp Serve Agent Client Protocol v1 over stdio
|
|
57
|
+
acp login Configure model-provider credentials in a finite terminal flow
|
|
56
58
|
-h, --help Show help
|
|
57
|
-
-v, --version Print the Felan version
|
|
59
|
+
-v, --version Print the Felan Code version
|
|
58
60
|
--verbose Show verbose startup details
|
|
59
61
|
```
|
|
60
62
|
|
|
61
|
-
After rebuilding Felan from this repository, use `/restart` in the interactive
|
|
62
|
-
TUI to reload Felan, Agent Core, and extension modules while preserving the
|
|
63
|
+
After rebuilding Felan Code from this repository, use `/restart` in the interactive
|
|
64
|
+
TUI to reload Felan Code, Agent Core, and extension modules while preserving the
|
|
63
65
|
current session. It replaces the Node process and resumes the same session;
|
|
64
66
|
unlike Pi's `/reload`, it is not an in-process resource reload.
|
|
65
67
|
|
|
@@ -70,10 +72,10 @@ package-manager installations are not changed; update those with the command
|
|
|
70
72
|
that installed them.
|
|
71
73
|
|
|
72
74
|
Interactive startup also checks npm once, asynchronously, for a newer stable
|
|
73
|
-
release. If one is available, Felan tells you to exit all Felan sessions and
|
|
75
|
+
release. If one is available, Felan Code tells you to exit all Felan Code sessions and
|
|
74
76
|
run `felan update` for a global npm installation, or use the package manager
|
|
75
|
-
that launched Felan. Offline, failed, and malformed responses stay silent, and
|
|
76
|
-
Felan never installs an update automatically. Set
|
|
77
|
+
that launched Felan Code. Offline, failed, and malformed responses stay silent, and
|
|
78
|
+
Felan Code never installs an update automatically. Set
|
|
77
79
|
`FELAN_SKIP_VERSION_CHECK=1` to disable this startup request.
|
|
78
80
|
|
|
79
81
|
Invocations without `--mode` start the interactive TUI. `--mode text` runs one
|
|
@@ -84,6 +86,89 @@ support `--continue` and `--session`, and accept `--provider`, `--model`, and
|
|
|
84
86
|
`--thinking` for reproducible model selection. `--resume` remains interactive-only.
|
|
85
87
|
Headless startup never runs dependency onboarding or the interactive update check.
|
|
86
88
|
|
|
89
|
+
## Native ACP v1
|
|
90
|
+
|
|
91
|
+
Run Felan Code as a local Agent Client Protocol server:
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
felan acp
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Or run the published package without a global install:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
npx --yes @felan-ai/felan acp
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`felan acp` serves stable ACP v1 over newline-delimited JSON on stdio. Stdout
|
|
104
|
+
is reserved for protocol frames; diagnostics go to stderr. ACP clients receive
|
|
105
|
+
the machine name `felan` and display title `Felan Code`. Each ACP session gets
|
|
106
|
+
an isolated local runtime and can create, load, prompt, cancel, and close Felan Code
|
|
107
|
+
sessions. Felan Code accepts baseline text and resource-link prompt blocks, replays
|
|
108
|
+
the current persisted branch on load, and streams user, assistant, thought,
|
|
109
|
+
and bounded tool-call updates.
|
|
110
|
+
|
|
111
|
+
When the client advertises terminal authentication, Felan Code offers a terminal
|
|
112
|
+
method that appends `login` to the configured `felan acp` invocation. Run the
|
|
113
|
+
same flow manually with:
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
felan acp login
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
When the client launches Felan Code through `npx`, the equivalent command is:
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
npx --yes @felan-ai/felan acp login
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The finite login process supports configurable API-key and OAuth provider
|
|
126
|
+
methods, hides secret and manual-code input, and saves credentials only through
|
|
127
|
+
the local `ModelRuntime` credential store at `$FELAN_AGENT_DIR/auth.json`
|
|
128
|
+
(`~/.felan/auth.json` by default). Do not commit or share that file. An ACP
|
|
129
|
+
client should reconnect after successful terminal authentication. Form-capable
|
|
130
|
+
clients also receive `ask_user` and Prewalk review as ACP elicitations.
|
|
131
|
+
|
|
132
|
+
### Zed custom agent
|
|
133
|
+
|
|
134
|
+
Install `felan` on Zed's `PATH`, then add this custom agent in Zed's
|
|
135
|
+
`settings.json`:
|
|
136
|
+
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"agent_servers": {
|
|
140
|
+
"Felan Code": {
|
|
141
|
+
"type": "custom",
|
|
142
|
+
"command": "felan",
|
|
143
|
+
"args": ["acp"],
|
|
144
|
+
"env": {}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
For an on-demand package launch, use `"command": "npx"` and
|
|
151
|
+
`"args": ["--yes", "@felan-ai/felan", "acp"]`. The advertised terminal
|
|
152
|
+
auth arguments are appended, producing the separate
|
|
153
|
+
`npx --yes @felan-ai/felan acp login` flow.
|
|
154
|
+
|
|
155
|
+
Zed and Felan Code do not share provider credentials automatically. If Felan Code needs
|
|
156
|
+
authentication, select its terminal login method or run `felan acp login`, then
|
|
157
|
+
start a new external-agent connection.
|
|
158
|
+
|
|
159
|
+
ACP action safety is host-owned. Known mutation, process, network, and unknown
|
|
160
|
+
tools request `allow once` or `reject once`; known read-only/internal tools can
|
|
161
|
+
proceed. This is not a durable permission policy or sandbox. MCP definitions
|
|
162
|
+
supplied in ACP `session/new` or `session/load` are accepted for client
|
|
163
|
+
compatibility and ignored. Configure Felan Code's separate OAuth-only remote HTTP
|
|
164
|
+
MCP gateway through `mcp.json` instead.
|
|
165
|
+
|
|
166
|
+
Current non-goals include remote ACP transports, additional workspace roots,
|
|
167
|
+
image/audio/embedded-resource prompt blocks, session modes and config options,
|
|
168
|
+
and all session-provided MCP servers. ACP does not launch client-provided MCP
|
|
169
|
+
processes or expose client-provided MCP tools, resources, prompts, sampling,
|
|
170
|
+
Apps, or scripting.
|
|
171
|
+
|
|
87
172
|
`felan --resume` opens a selection-only session picker. Press Tab to switch
|
|
88
173
|
between the current folder and all local sessions, Ctrl+S to change sorting,
|
|
89
174
|
Ctrl+N to filter to named sessions, and Ctrl+P to toggle session paths. Escape
|
|
@@ -94,7 +179,7 @@ New interactive root sessions receive an asynchronous, concise name derived
|
|
|
94
179
|
from the first prompt. Names are persisted in the session file and existing
|
|
95
180
|
names are never replaced. Disable this with `builtinExtensions.sessionTitle`.
|
|
96
181
|
|
|
97
|
-
`felan --diagnostics` reports Felan, Agent Core, Pi, and Node.js versions plus
|
|
182
|
+
`felan --diagnostics` reports Felan Code, Agent Core, Pi, and Node.js versions plus
|
|
98
183
|
runtime and credential modes.
|
|
99
184
|
|
|
100
185
|
## Local state and policy
|
|
@@ -105,12 +190,12 @@ and project memory. Root-session storage is scoped under
|
|
|
105
190
|
`$FELAN_AGENT_DIR/storage/sessions/<encoded-root-session-id>` and longer-lived
|
|
106
191
|
extension state under `$FELAN_AGENT_DIR/storage/agent`.
|
|
107
192
|
|
|
108
|
-
The local host loads only source-controlled Felan built-ins, Felan-owned
|
|
109
|
-
settings and prompt appends, explicit Felan agents and Agent Skills, and the
|
|
193
|
+
The local host loads only source-controlled Felan Code built-ins, Felan-owned
|
|
194
|
+
settings and prompt appends, explicit Felan Code agents and Agent Skills, and the
|
|
110
195
|
Agent Core-selected cwd instruction file. Ambient Pi extensions, packages,
|
|
111
196
|
prompts, themes, project settings, and package resources are filtered.
|
|
112
197
|
|
|
113
|
-
When launched inside Herdr, the TUI reports its Felan lifecycle and session
|
|
198
|
+
When launched inside Herdr, the TUI reports its Felan Code lifecycle and session
|
|
114
199
|
identity through Herdr's inherited local socket environment. This is TUI-only
|
|
115
200
|
and does not enable ambient extensions or ACP. User-attention waits from Pi
|
|
116
201
|
extensions, including `ask_user`, Prewalk approval/review, and local MCP OAuth,
|
|
@@ -127,16 +212,16 @@ search, symbol reads, and bounded grep augmentation, backed by the
|
|
|
127
212
|
|
|
128
213
|
The binary is a separate download and is not installed automatically.
|
|
129
214
|
Run `/codebase-memory install` to fetch the reviewed managed binary.
|
|
130
|
-
Once it is available, Felan indexes the active repository at session
|
|
215
|
+
Once it is available, Felan Code indexes the active repository at session
|
|
131
216
|
start and re-uses the index across sessions.
|
|
132
217
|
|
|
133
218
|
Run `/codebase-memory refresh` to rebuild the index after significant
|
|
134
219
|
edits.
|
|
135
220
|
|
|
136
221
|
The local TUI provides `felan-light` and `felan-dark` as host-owned Pi themes.
|
|
137
|
-
The startup view uses a compact Felan welcome; press `Ctrl+O` when you need
|
|
222
|
+
The startup view uses a compact Felan Code welcome; press `Ctrl+O` when you need
|
|
138
223
|
the full startup help and loaded-resource listing. When no theme is saved,
|
|
139
|
-
Felan follows the terminal appearance automatically. The `felan-*` names are
|
|
224
|
+
Felan Code follows the terminal appearance automatically. The `felan-*` names are
|
|
140
225
|
intentional: Pi 0.85.1 reserves `dark` and `light` for its built-in export
|
|
141
226
|
themes, so colliding IDs would make exported sessions use different colors.
|
|
142
227
|
Powerline consumes that same active theme instead of defining its own colors.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type AgentContext } from '@agentclientprotocol/sdk';
|
|
2
|
+
import type { AgentSession, CreateAgentCoreSessionOptions } from '@felan-ai/agent-core';
|
|
3
|
+
import { AcpToolCallIdRegistry } from './session-updates.js';
|
|
4
|
+
type InlineExtension = NonNullable<CreateAgentCoreSessionOptions['inlineExtensions']>[number];
|
|
5
|
+
type ExtensionUiContext = NonNullable<NonNullable<Parameters<AgentSession['bindExtensions']>[0]>['uiContext']>;
|
|
6
|
+
export interface AcpSessionInteractionsOptions {
|
|
7
|
+
readonly client: AgentContext;
|
|
8
|
+
readonly supportsFormElicitation: boolean;
|
|
9
|
+
readonly toolCallIds: AcpToolCallIdRegistry;
|
|
10
|
+
}
|
|
11
|
+
export declare class AcpSessionInteractions {
|
|
12
|
+
#private;
|
|
13
|
+
readonly inlineExtension: InlineExtension;
|
|
14
|
+
constructor(options: AcpSessionInteractionsOptions);
|
|
15
|
+
get uiContext(): ExtensionUiContext | undefined;
|
|
16
|
+
bindSession(sessionId: string): void;
|
|
17
|
+
beginPrompt(client: AgentContext): void;
|
|
18
|
+
cancelPending(): void;
|
|
19
|
+
close(): void;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=interactions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactions.d.ts","sourceRoot":"","sources":["../../src/acp/interactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EAGlB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,YAAY,EACZ,6BAA6B,EAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,qBAAqB,EAEtB,MAAM,sBAAsB,CAAC;AAmC9B,KAAK,eAAe,GAAG,WAAW,CAChC,6BAA6B,CAAC,kBAAkB,CAAC,CAClD,CAAC,MAAM,CAAC,CAAC;AACV,KAAK,kBAAkB,GAAG,WAAW,CACnC,WAAW,CAAC,UAAU,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CACxE,CAAC;AAGF,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAC1C,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAC;CAC7C;AAED,qBAAa,sBAAsB;;IAWjC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAiBvC;gBAIU,OAAO,EAAE,6BAA6B;IAOlD,IAAI,SAAS,IAAI,kBAAkB,GAAG,SAAS,CAE9C;IAED,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAOpC,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IASvC,aAAa,IAAI,IAAI;IAMrB,KAAK,IAAI,IAAI;CA4Od"}
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { methods, } from '@agentclientprotocol/sdk';
|
|
2
|
+
import { AcpToolCallIdRegistry, createAcpToolCallUpdate, } from './session-updates.js';
|
|
3
|
+
const MAX_PENDING_REQUESTS = 32;
|
|
4
|
+
const MAX_DETACHED_REQUESTS = 128;
|
|
5
|
+
const MAX_MESSAGE_BYTES = 192 * 1024;
|
|
6
|
+
const MAX_FIELD_LABEL_BYTES = 8 * 1024;
|
|
7
|
+
const MAX_OPTION_BYTES = 2 * 1024;
|
|
8
|
+
const MAX_OPTIONS = 100;
|
|
9
|
+
const MAX_VALUE_LENGTH = 32 * 1024;
|
|
10
|
+
const MAX_TIMEOUT_MS = 2_147_483_647;
|
|
11
|
+
const ALLOW_ONCE = 'allow-once';
|
|
12
|
+
const REJECT_ONCE = 'reject-once';
|
|
13
|
+
const UNSAFE_CONTROL_CHARACTERS = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/u;
|
|
14
|
+
const SAFE_TOOL_NAMES = new Set([
|
|
15
|
+
'TaskGet',
|
|
16
|
+
'TaskList',
|
|
17
|
+
'ask_user',
|
|
18
|
+
'codebase_memory',
|
|
19
|
+
'enter_prewalk',
|
|
20
|
+
'exit_plan_mode',
|
|
21
|
+
'find',
|
|
22
|
+
'get_subagent_result',
|
|
23
|
+
'grep',
|
|
24
|
+
'list_background_bash',
|
|
25
|
+
'list_subagents',
|
|
26
|
+
'ls',
|
|
27
|
+
'read',
|
|
28
|
+
'read_background_bash',
|
|
29
|
+
'read_symbol',
|
|
30
|
+
'search_and_read_symbols',
|
|
31
|
+
'search_code',
|
|
32
|
+
'wait_background_bash',
|
|
33
|
+
]);
|
|
34
|
+
export class AcpSessionInteractions {
|
|
35
|
+
#supportsFormElicitation;
|
|
36
|
+
#toolCallIds;
|
|
37
|
+
#activeRequests = new Set();
|
|
38
|
+
#detachedRequests = new Set();
|
|
39
|
+
#client;
|
|
40
|
+
#sessionId;
|
|
41
|
+
#requestController = new AbortController();
|
|
42
|
+
#cancelled = false;
|
|
43
|
+
#closed = false;
|
|
44
|
+
inlineExtension = {
|
|
45
|
+
name: '@felan-ai/felan/acp-action-permissions',
|
|
46
|
+
hidden: true,
|
|
47
|
+
factory: (pi) => {
|
|
48
|
+
pi.on('tool_call', (event, ctx) => {
|
|
49
|
+
if (SAFE_TOOL_NAMES.has(event.toolName))
|
|
50
|
+
return undefined;
|
|
51
|
+
return this.#authorizeToolCall(event.toolCallId, event.toolName, event.input, ctx.cwd, ctx.sessionManager.getSessionId(), ctx.signal, () => ctx.abort());
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
#uiContext;
|
|
56
|
+
constructor(options) {
|
|
57
|
+
this.#client = options.client;
|
|
58
|
+
this.#supportsFormElicitation = options.supportsFormElicitation;
|
|
59
|
+
this.#toolCallIds = options.toolCallIds;
|
|
60
|
+
this.#uiContext = this.#createUiContext();
|
|
61
|
+
}
|
|
62
|
+
get uiContext() {
|
|
63
|
+
return this.#supportsFormElicitation ? this.#uiContext : undefined;
|
|
64
|
+
}
|
|
65
|
+
bindSession(sessionId) {
|
|
66
|
+
if (this.#sessionId !== undefined && this.#sessionId !== sessionId) {
|
|
67
|
+
throw new Error('ACP interaction channel is already bound to another session');
|
|
68
|
+
}
|
|
69
|
+
this.#sessionId = sessionId;
|
|
70
|
+
}
|
|
71
|
+
beginPrompt(client) {
|
|
72
|
+
if (this.#closed)
|
|
73
|
+
return;
|
|
74
|
+
this.#client = client;
|
|
75
|
+
if (this.#cancelled) {
|
|
76
|
+
this.#requestController = new AbortController();
|
|
77
|
+
this.#cancelled = false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
cancelPending() {
|
|
81
|
+
if (this.#closed || this.#cancelled)
|
|
82
|
+
return;
|
|
83
|
+
this.#cancelled = true;
|
|
84
|
+
this.#requestController.abort();
|
|
85
|
+
}
|
|
86
|
+
close() {
|
|
87
|
+
if (this.#closed)
|
|
88
|
+
return;
|
|
89
|
+
this.#closed = true;
|
|
90
|
+
this.#requestController.abort();
|
|
91
|
+
}
|
|
92
|
+
#createUiContext() {
|
|
93
|
+
return {
|
|
94
|
+
select: async (title, options, requestOptions) => {
|
|
95
|
+
if (options.length === 0
|
|
96
|
+
|| options.length > MAX_OPTIONS
|
|
97
|
+
|| new Set(options).size !== options.length
|
|
98
|
+
|| options.some((option) => !isBoundedString(option, MAX_OPTION_BYTES)))
|
|
99
|
+
return undefined;
|
|
100
|
+
const response = await this.#elicit(title, {
|
|
101
|
+
type: 'object',
|
|
102
|
+
properties: {
|
|
103
|
+
value: {
|
|
104
|
+
type: 'string',
|
|
105
|
+
title: boundString(title, MAX_FIELD_LABEL_BYTES),
|
|
106
|
+
enum: options,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
required: ['value'],
|
|
110
|
+
}, requestOptions?.signal, requestOptions?.timeout);
|
|
111
|
+
const value = acceptedValue(response);
|
|
112
|
+
return typeof value === 'string' && options.includes(value) ? value : undefined;
|
|
113
|
+
},
|
|
114
|
+
confirm: async (title, message, requestOptions) => {
|
|
115
|
+
const response = await this.#elicit(`${title}\n\n${message}`, {
|
|
116
|
+
type: 'object',
|
|
117
|
+
properties: {
|
|
118
|
+
value: {
|
|
119
|
+
type: 'boolean',
|
|
120
|
+
title: boundString(title, MAX_FIELD_LABEL_BYTES),
|
|
121
|
+
description: boundString(message, MAX_MESSAGE_BYTES),
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
required: ['value'],
|
|
125
|
+
}, requestOptions?.signal, requestOptions?.timeout);
|
|
126
|
+
return acceptedValue(response) === true;
|
|
127
|
+
},
|
|
128
|
+
input: async (title, placeholder, requestOptions) => {
|
|
129
|
+
if (placeholder !== undefined && !isSafeBoundedText(placeholder, MAX_MESSAGE_BYTES)) {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
const response = await this.#elicit(title, stringSchema(title, placeholder), requestOptions?.signal, requestOptions?.timeout);
|
|
133
|
+
const value = acceptedValue(response);
|
|
134
|
+
return isBoundedValue(value) ? value : undefined;
|
|
135
|
+
},
|
|
136
|
+
editor: async (title, prefill) => {
|
|
137
|
+
if (prefill !== undefined && !isBoundedValue(prefill))
|
|
138
|
+
return undefined;
|
|
139
|
+
const response = await this.#elicit(title, stringSchema(title, undefined, prefill));
|
|
140
|
+
const value = acceptedValue(response);
|
|
141
|
+
return isBoundedValue(value) ? value : undefined;
|
|
142
|
+
},
|
|
143
|
+
notify: () => { },
|
|
144
|
+
onTerminalInput: () => () => { },
|
|
145
|
+
setStatus: () => { },
|
|
146
|
+
setWorkingMessage: () => { },
|
|
147
|
+
setWorkingVisible: () => { },
|
|
148
|
+
setWorkingIndicator: () => { },
|
|
149
|
+
setHiddenThinkingLabel: () => { },
|
|
150
|
+
setWidget: () => { },
|
|
151
|
+
setFooter: () => { },
|
|
152
|
+
setHeader: () => { },
|
|
153
|
+
setTitle: () => { },
|
|
154
|
+
custom: async () => undefined,
|
|
155
|
+
pasteToEditor: () => { },
|
|
156
|
+
setEditorText: () => { },
|
|
157
|
+
getEditorText: () => '',
|
|
158
|
+
addAutocompleteProvider: () => { },
|
|
159
|
+
setEditorComponent: () => { },
|
|
160
|
+
getEditorComponent: () => undefined,
|
|
161
|
+
theme: neutralTheme,
|
|
162
|
+
getAllThemes: () => [],
|
|
163
|
+
getTheme: () => undefined,
|
|
164
|
+
setTheme: () => ({ success: false, error: 'Themes are unavailable over ACP' }),
|
|
165
|
+
getToolsExpanded: () => false,
|
|
166
|
+
setToolsExpanded: () => { },
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
async #elicit(message, requestedSchema, signal, timeout) {
|
|
170
|
+
if (!this.#supportsFormElicitation || !isBoundedString(message, MAX_MESSAGE_BYTES)) {
|
|
171
|
+
return undefined;
|
|
172
|
+
}
|
|
173
|
+
const sessionId = this.#sessionId;
|
|
174
|
+
if (sessionId === undefined)
|
|
175
|
+
return undefined;
|
|
176
|
+
return this.#request((cancellationSignal) => this.#client.request(methods.client.elicitation.create, {
|
|
177
|
+
mode: 'form',
|
|
178
|
+
sessionId,
|
|
179
|
+
message,
|
|
180
|
+
requestedSchema,
|
|
181
|
+
}, { cancellationSignal }), signal, timeout);
|
|
182
|
+
}
|
|
183
|
+
async #authorizeToolCall(providerToolCallId, toolName, input, cwd, sourceSessionId, signal, abort) {
|
|
184
|
+
const sessionId = this.#sessionId;
|
|
185
|
+
if (sessionId === undefined)
|
|
186
|
+
return denyToolCall(abort);
|
|
187
|
+
const wireId = sourceSessionId === sessionId
|
|
188
|
+
? this.#toolCallIds.current(providerToolCallId) ?? this.#toolCallIds.claim(providerToolCallId)
|
|
189
|
+
: this.#toolCallIds.claim(providerToolCallId, sourceSessionId);
|
|
190
|
+
const response = await this.#request((cancellationSignal) => this.#client.request(methods.client.session.requestPermission, {
|
|
191
|
+
sessionId,
|
|
192
|
+
toolCall: {
|
|
193
|
+
...createAcpToolCallUpdate(cwd, wireId, toolName, input),
|
|
194
|
+
status: 'pending',
|
|
195
|
+
},
|
|
196
|
+
options: [
|
|
197
|
+
{ optionId: ALLOW_ONCE, name: 'Allow once', kind: 'allow_once' },
|
|
198
|
+
{ optionId: REJECT_ONCE, name: 'Reject once', kind: 'reject_once' },
|
|
199
|
+
],
|
|
200
|
+
}, { cancellationSignal }), signal);
|
|
201
|
+
if (isAllowOnceResponse(response))
|
|
202
|
+
return undefined;
|
|
203
|
+
return denyToolCall(abort);
|
|
204
|
+
}
|
|
205
|
+
async #request(send, externalSignal, timeout) {
|
|
206
|
+
if (this.#closed
|
|
207
|
+
|| this.#cancelled
|
|
208
|
+
|| this.#activeRequests.size >= MAX_PENDING_REQUESTS
|
|
209
|
+
|| this.#detachedRequests.size >= MAX_DETACHED_REQUESTS
|
|
210
|
+
|| externalSignal?.aborted
|
|
211
|
+
|| (timeout !== undefined && (!Number.isFinite(timeout) || timeout <= 0)))
|
|
212
|
+
return undefined;
|
|
213
|
+
const timeoutController = new AbortController();
|
|
214
|
+
const signals = [this.#requestController.signal, timeoutController.signal];
|
|
215
|
+
if (externalSignal !== undefined)
|
|
216
|
+
signals.push(externalSignal);
|
|
217
|
+
const signal = AbortSignal.any(signals);
|
|
218
|
+
if (signal.aborted)
|
|
219
|
+
return undefined;
|
|
220
|
+
const requestToken = Symbol('request');
|
|
221
|
+
this.#activeRequests.add(requestToken);
|
|
222
|
+
let timeoutHandle;
|
|
223
|
+
if (timeout !== undefined && Number.isFinite(timeout) && timeout > 0) {
|
|
224
|
+
timeoutHandle = setTimeout(() => timeoutController.abort(), Math.min(Math.ceil(timeout), MAX_TIMEOUT_MS));
|
|
225
|
+
}
|
|
226
|
+
let wireRequest;
|
|
227
|
+
try {
|
|
228
|
+
wireRequest = send(signal);
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
if (timeoutHandle !== undefined)
|
|
232
|
+
clearTimeout(timeoutHandle);
|
|
233
|
+
this.#activeRequests.delete(requestToken);
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
let wireSettled = false;
|
|
237
|
+
const detachedRequests = this.#detachedRequests;
|
|
238
|
+
void wireRequest.then(() => {
|
|
239
|
+
wireSettled = true;
|
|
240
|
+
detachedRequests.delete(wireRequest);
|
|
241
|
+
}, () => {
|
|
242
|
+
wireSettled = true;
|
|
243
|
+
detachedRequests.delete(wireRequest);
|
|
244
|
+
});
|
|
245
|
+
const aborted = Symbol('aborted');
|
|
246
|
+
let abortListener;
|
|
247
|
+
const abortPromise = new Promise((resolve) => {
|
|
248
|
+
abortListener = () => resolve(aborted);
|
|
249
|
+
if (signal.aborted)
|
|
250
|
+
abortListener();
|
|
251
|
+
else
|
|
252
|
+
signal.addEventListener('abort', abortListener, { once: true });
|
|
253
|
+
});
|
|
254
|
+
try {
|
|
255
|
+
const result = await Promise.race([wireRequest, abortPromise]);
|
|
256
|
+
if (result !== aborted)
|
|
257
|
+
return result;
|
|
258
|
+
if (!wireSettled)
|
|
259
|
+
this.#detachedRequests.add(wireRequest);
|
|
260
|
+
return undefined;
|
|
261
|
+
}
|
|
262
|
+
catch {
|
|
263
|
+
return undefined;
|
|
264
|
+
}
|
|
265
|
+
finally {
|
|
266
|
+
if (timeoutHandle !== undefined)
|
|
267
|
+
clearTimeout(timeoutHandle);
|
|
268
|
+
if (abortListener !== undefined)
|
|
269
|
+
signal.removeEventListener('abort', abortListener);
|
|
270
|
+
this.#activeRequests.delete(requestToken);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
function stringSchema(title, description, defaultValue) {
|
|
275
|
+
return {
|
|
276
|
+
type: 'object',
|
|
277
|
+
properties: {
|
|
278
|
+
value: {
|
|
279
|
+
type: 'string',
|
|
280
|
+
title: boundString(title, MAX_FIELD_LABEL_BYTES),
|
|
281
|
+
maxLength: MAX_VALUE_LENGTH,
|
|
282
|
+
...(description === undefined
|
|
283
|
+
? {}
|
|
284
|
+
: { description: boundString(description, MAX_MESSAGE_BYTES) }),
|
|
285
|
+
...(defaultValue === undefined ? {} : { default: defaultValue }),
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
required: ['value'],
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
function acceptedValue(response) {
|
|
292
|
+
if (response?.action !== 'accept')
|
|
293
|
+
return undefined;
|
|
294
|
+
const content = response.content;
|
|
295
|
+
return typeof content === 'object' && content !== null && 'value' in content
|
|
296
|
+
? content.value
|
|
297
|
+
: undefined;
|
|
298
|
+
}
|
|
299
|
+
function isAllowOnceResponse(response) {
|
|
300
|
+
if (typeof response !== 'object' || response === null || !('outcome' in response))
|
|
301
|
+
return false;
|
|
302
|
+
const outcome = response.outcome;
|
|
303
|
+
return typeof outcome === 'object'
|
|
304
|
+
&& outcome !== null
|
|
305
|
+
&& 'outcome' in outcome
|
|
306
|
+
&& outcome.outcome === 'selected'
|
|
307
|
+
&& 'optionId' in outcome
|
|
308
|
+
&& outcome.optionId === ALLOW_ONCE;
|
|
309
|
+
}
|
|
310
|
+
function isBoundedValue(value) {
|
|
311
|
+
return typeof value === 'string'
|
|
312
|
+
&& value.length <= MAX_VALUE_LENGTH
|
|
313
|
+
&& isSafeBoundedText(value, MAX_VALUE_LENGTH * 4);
|
|
314
|
+
}
|
|
315
|
+
function isBoundedString(value, maxBytes) {
|
|
316
|
+
return value.length > 0 && isSafeBoundedText(value, maxBytes);
|
|
317
|
+
}
|
|
318
|
+
function isSafeBoundedText(value, maxBytes) {
|
|
319
|
+
return Buffer.byteLength(value, 'utf8') <= maxBytes
|
|
320
|
+
&& !UNSAFE_CONTROL_CHARACTERS.test(value);
|
|
321
|
+
}
|
|
322
|
+
function boundString(value, maxBytes) {
|
|
323
|
+
if (Buffer.byteLength(value, 'utf8') <= maxBytes)
|
|
324
|
+
return value;
|
|
325
|
+
return Buffer.from(value, 'utf8').subarray(0, maxBytes).toString('utf8').replace(/�$/u, '');
|
|
326
|
+
}
|
|
327
|
+
function denyToolCall(abort) {
|
|
328
|
+
try {
|
|
329
|
+
abort();
|
|
330
|
+
}
|
|
331
|
+
catch { }
|
|
332
|
+
return {
|
|
333
|
+
block: true,
|
|
334
|
+
reason: 'The tool call was not approved by the user.',
|
|
335
|
+
terminate: true,
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
const neutralTheme = {
|
|
339
|
+
fg: (_color, text) => text,
|
|
340
|
+
bg: (_color, text) => text,
|
|
341
|
+
bold: (text) => text,
|
|
342
|
+
italic: (text) => text,
|
|
343
|
+
underline: (text) => text,
|
|
344
|
+
inverse: (text) => text,
|
|
345
|
+
strikethrough: (text) => text,
|
|
346
|
+
getFgAnsi: () => '',
|
|
347
|
+
getBgAnsi: () => '',
|
|
348
|
+
getColorMode: () => 'truecolor',
|
|
349
|
+
getThinkingBorderColor: () => (text) => text,
|
|
350
|
+
getBashModeBorderColor: () => (text) => text,
|
|
351
|
+
};
|
|
352
|
+
//# sourceMappingURL=interactions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactions.js","sourceRoot":"","sources":["../../src/acp/interactions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,GAIR,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EACL,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAClC,MAAM,iBAAiB,GAAG,GAAG,GAAG,IAAI,CAAC;AACrC,MAAM,qBAAqB,GAAG,CAAC,GAAG,IAAI,CAAC;AACvC,MAAM,gBAAgB,GAAG,CAAC,GAAG,IAAI,CAAC;AAClC,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,CAAC;AACnC,MAAM,cAAc,GAAG,aAAa,CAAC;AACrC,MAAM,UAAU,GAAG,YAAY,CAAC;AAChC,MAAM,WAAW,GAAG,aAAa,CAAC;AAClC,MAAM,yBAAyB,GAAG,iDAAiD,CAAC;AAEpF,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC9B,SAAS;IACT,UAAU;IACV,UAAU;IACV,iBAAiB;IACjB,eAAe;IACf,gBAAgB;IAChB,MAAM;IACN,qBAAqB;IACrB,MAAM;IACN,sBAAsB;IACtB,gBAAgB;IAChB,IAAI;IACJ,MAAM;IACN,sBAAsB;IACtB,aAAa;IACb,yBAAyB;IACzB,aAAa;IACb,sBAAsB;CACvB,CAAC,CAAC;AAgBH,MAAM,OAAO,sBAAsB;IACxB,wBAAwB,CAAU;IAClC,YAAY,CAAwB;IACpC,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;IACpC,iBAAiB,GAAG,IAAI,GAAG,EAAoB,CAAC;IACzD,OAAO,CAAe;IACtB,UAAU,CAAqB;IAC/B,kBAAkB,GAAG,IAAI,eAAe,EAAE,CAAC;IAC3C,UAAU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CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,OAAO;QACL,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,6CAA6C;QACrD,SAAS,EAAE,IAAI;KAChB,CAAC;AACJ,CAAC;AAED,MAAM,YAAY,GAAG;IACnB,EAAE,EAAE,CAAC,MAAe,EAAE,IAAY,EAAE,EAAE,CAAC,IAAI;IAC3C,EAAE,EAAE,CAAC,MAAe,EAAE,IAAY,EAAE,EAAE,CAAC,IAAI;IAC3C,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI;IAC5B,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI;IAC9B,SAAS,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI;IACjC,OAAO,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI;IAC/B,aAAa,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI;IACrC,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE;IACnB,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE;IACnB,YAAY,EAAE,GAAG,EAAE,CAAC,WAAW;IAC/B,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI;IACpD,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI;CACxB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ModelRuntime } from '@felan-ai/agent-core';
|
|
2
|
+
export interface AcpLoginChoice {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly description?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AcpLoginTerminal {
|
|
8
|
+
select(message: string, options: readonly AcpLoginChoice[], signal: AbortSignal): Promise<string | undefined>;
|
|
9
|
+
input(message: string, options: {
|
|
10
|
+
readonly secret: boolean;
|
|
11
|
+
readonly placeholder?: string;
|
|
12
|
+
}, signal: AbortSignal): Promise<string | undefined>;
|
|
13
|
+
writeLine(message: string): void;
|
|
14
|
+
}
|
|
15
|
+
export interface AcpLoginSignalSource {
|
|
16
|
+
once(signal: 'SIGINT' | 'SIGTERM', listener: () => void): unknown;
|
|
17
|
+
off(signal: 'SIGINT' | 'SIGTERM', listener: () => void): unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface RunLocalFelanAcpLoginOptions {
|
|
20
|
+
readonly agentDir?: string;
|
|
21
|
+
readonly terminal?: AcpLoginTerminal;
|
|
22
|
+
readonly createModelRuntime?: (agentDir: string, signal: AbortSignal) => Promise<ModelRuntime>;
|
|
23
|
+
readonly writeError?: (message: string) => void;
|
|
24
|
+
readonly signalSource?: AcpLoginSignalSource;
|
|
25
|
+
readonly signal?: AbortSignal;
|
|
26
|
+
readonly terminateProcess?: (exitCode: number) => void;
|
|
27
|
+
}
|
|
28
|
+
export declare function runLocalFelanAcpLogin(options?: RunLocalFelanAcpLoginOptions): Promise<number>;
|
|
29
|
+
export declare class NodeAcpLoginTerminal implements AcpLoginTerminal {
|
|
30
|
+
#private;
|
|
31
|
+
constructor(input?: NodeJS.ReadStream, output?: NodeJS.WriteStream);
|
|
32
|
+
select(message: string, options: readonly AcpLoginChoice[], signal: AbortSignal): Promise<string | undefined>;
|
|
33
|
+
input(message: string, options: {
|
|
34
|
+
readonly secret: boolean;
|
|
35
|
+
readonly placeholder?: string;
|
|
36
|
+
}, signal: AbortSignal): Promise<string | undefined>;
|
|
37
|
+
writeLine(message: string): void;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/acp/login.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAoB9B,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,C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