acp-port 0.1.0 → 0.1.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 CHANGED
@@ -178,7 +178,7 @@ The [configuration reference](docs/configuration.md) documents validation, model
178
178
  - Validates file paths and command working directories against the session workspace. Commands run with the editor's permissions; acp-port provides no operating-system sandbox.
179
179
  - Keeps sessions in memory. Restarting the agent loses their history; session reload and automatic history summarization are unavailable.
180
180
  - Defaults to 12 model requests per turn, 200,000 history characters, and 120-second provider/tool timeouts. A character budget is not a model token budget.
181
- - Supports text-based coding workflows. Images, audio, binary attachments, and MCP servers are unsupported; sessions that forward MCP servers are rejected.
181
+ - Supports text-based coding workflows. Images, audio, binary attachments, and MCP tools are unsupported. Forwarded MCP servers are ignored with a warning on stderr; chat and supported editor tools remain available.
182
182
 
183
183
  Prompts, attached text, conversation history, and tool results are sent to the selected model endpoint. Choose that endpoint with your workspace's data requirements in mind. See [capabilities and limits](docs/capabilities.md) for the exact tool behavior and data flow.
184
184
 
package/dist/acp/stdio.js CHANGED
@@ -4,9 +4,15 @@ import { createAgent } from "../agent/agent.js";
4
4
  import { createProvider } from "../providers/create-provider.js";
5
5
  import { ProviderRegistry } from "../providers/provider-registry.js";
6
6
  export async function serve(config, options) {
7
- const registry = new ProviderRegistry(config.providers, createProvider, (message) => process.stderr.write(`acp-port: ${message}\n`));
7
+ const warn = (message) => {
8
+ process.stderr.write(`acp-port: ${message}\n`);
9
+ };
10
+ const registry = new ProviderRegistry(config.providers, createProvider, warn);
8
11
  const transport = ndJsonStream(stream.Writable.toWeb(process.stdout), stream.Readable.toWeb(process.stdin));
9
- const connection = createAgent(config, registry, options).connect(transport);
12
+ const connection = createAgent(config, registry, {
13
+ ...options,
14
+ warn,
15
+ }).connect(transport);
10
16
  const close = () => {
11
17
  void connection.close();
12
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../src/acp/stdio.ts"],"names":[],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CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAChC,CAAC;AACH,CAAC"}
@@ -67,10 +67,10 @@ export function createAgent(config, registry, options = {}) {
67
67
  if (!initialized) {
68
68
  throw RequestError.invalidRequest(undefined, "Initialize the connection first.");
69
69
  }
70
+ const session = await createSession(params.cwd, config, registry, options, signal);
70
71
  if (params.mcpServers.length) {
71
- throw RequestError.invalidParams(undefined, "MCP servers are not supported by acp-port. Disable MCP forwarding for this agent in the editor.");
72
+ options.warn?.("Ignoring forwarded MCP servers: MCP tools are not supported by acp-port. Chat and supported editor tools remain available.");
72
73
  }
73
- const session = await createSession(params.cwd, config, registry, options, signal);
74
74
  sessions.set(session.id, session);
75
75
  return {
76
76
  sessionId: session.id,
@@ -1 +1 @@
1
- {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/agent/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,EAEL,gBAAgB,EAChB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,GAAG,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAG3D,OAAO,EAGL,aAAa,EACb,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAI7C,MAAM,UAAU,WAAW,CACzB,MAAc,EACd,QAA0B,EAC1B,OAAO,GAAiB,EAAE;IAE1B,IAAI,WAAW,GAAG,KAAK,CAAC;IACxB,IAAI,YAAY,GAAuB,EAAE,CAAC;IAC1C,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAwB,CAAC;IACjD,MAAM,UAAU,GAAG,CAAC,EAAU,EAAE,EAAE;QAChC,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,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M;SACtB,CAAC,CAAC;IACL,CAAC,CAAC,CACL,CAAC;AACJ,CAAC"}
@@ -5,6 +5,7 @@ import type { ProviderRegistry, RegisteredModel } from "../providers/provider-re
5
5
  export interface AgentOptions {
6
6
  provider?: string;
7
7
  model?: string;
8
+ warn?: (message: string) => void;
8
9
  }
9
10
  export interface AgentSession {
10
11
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/agent/session.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,YAAY,GAEb,MAAM,0BAA0B,CAAC;AAsBlC,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,kBAA0B,EAC1B,MAAc,EACd,QAA0B,EAC1B,OAAqB,EACrB,MAAmB;IAEnB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACzC,MAAM,YAAY,CAAC,aAAa,CAC9B,SAAS,EACT,+BAA+B,CAChC,CAAC;IACJ,CAAC;IACD,IAAI,CAAC;QACH,kBAAkB,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;QACnE,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;YAC/D,MAAM,IAAI,KAAK,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,YAAY,CAAC,aAAa,CAC9B,SAAS,EACT,kDAAkD,CACnD,CAAC;IACJ,CAAC;IACD,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACvE,MAAM,gBAAgB,GACpB,OAAO,CAAC,KAAK;QACb,CAAC,CAAC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ACb,QAAQ,EAAE,OAAO;YACjB,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,OAAO,CAAC,aAAa,CAAC,EAAE;YACtC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBAC5C,KAAK,EAAE,KAAK,CAAC,EAAE;gBACf,IAAI,EAAE,KAAK,CAAC,IAAI;aACjB,CAAC,CAAC;SACJ;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,OAAqB,EACrB,OAAe;IAEf,MAAM,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,IAAI,CAC7C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,OAAO,CAChC,CAAC;IACF,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,YAAY,CAAC,aAAa,CAC9B,SAAS,EACT,gFAAgF,CACjF,CAAC;IACJ,CAAC;IACD,gFAAgF;IAChF,OAAO,CAAC,aAAa,GAAG,aAAa,CAAC;AACxC,CAAC"}
@@ -41,7 +41,7 @@ flowchart LR
41
41
 
42
42
  1. The editor launches the CLI and communicates using newline-delimited JSON over stdin/stdout. Human-readable diagnostics go to stderr.
43
43
  2. `initialize` records the editor's capabilities and returns the supported ACP capabilities. A second initialization is rejected. Interactive authentication is unsupported; credentials come from the configured environment variable.
44
- 3. `session/new` requires an existing absolute local directory. ACP Port resolves it with `realpath`, rejects forwarded MCP servers, discovers models, and creates an in-memory session.
44
+ 3. `session/new` requires an existing absolute local directory. ACP Port resolves it with `realpath`, discovers models, and creates an in-memory session. Forwarded MCP servers are ignored with a warning on stderr; they do not prevent session creation and are never launched or connected to.
45
45
  4. The response includes a `model` select configuration option. `session/set_config_option` changes it; a `session/set_model` compatibility handler supports older clients. The new value also produces a `config_option_update` notification.
46
46
  5. `session/prompt` runs the provider/tool loop and returns an ACP stop reason. Different sessions keep separate histories. A second simultaneous prompt in the same session is rejected.
47
47
  6. `session/cancel` aborts that session's active turn. Disconnecting aborts active turns and clears all sessions. `SIGINT` and `SIGTERM` close the stdio connection.
@@ -108,7 +108,7 @@ Credentials come from environment variables. In the CLI, all adapters use `API_K
108
108
 
109
109
  ## Unsupported features
110
110
 
111
- - MCP servers: sessions with a nonempty `mcpServers` list are rejected, including stdio MCP servers. Disable forwarding for this agent.
111
+ - MCP tools: forwarded stdio, HTTP, and SSE servers are ignored with a warning on stderr. acp-port does not launch or connect to them, but the session can use chat and supported editor tools. Disable forwarding for this agent to suppress the warning.
112
112
  - Image/audio generation or interpretation and binary file attachments.
113
113
  - Persistent sessions, automatic summarization, or semantic workspace indexing.
114
114
  - An HTTP ACP server, standalone terminal chat UI, or model downloading.
@@ -86,7 +86,7 @@ acp-port authenticates with the endpoint using `API_KEY`. It does not expose a b
86
86
 
87
87
  In an IDE version with ACP support, open **AI Chat → Add Custom Agent** from the chat's upper-right menu. The IDE opens `~/.jetbrains/acp.json`. Use the same `agent_servers` entry and `command`/`args`/`env` fields as the Air example above. This is the [AI Assistant custom-agent configuration](https://www.jetbrains.com/help/ai-assistant/acp.html#add-a-custom-agent); it is separate from the Air app's configuration file.
88
88
 
89
- Ensure that the IDE does not forward MCP servers to acp-port. AI Assistant documents the **Pass custom MCP servers** and **Pass IntelliJ MCP server** controls under **Settings → Tools → AI Assistant → Agents**. Its JSON defaults can also disable forwarding:
89
+ acp-port ignores forwarded MCP servers and logs a warning, while chat and supported editor tools remain available. To suppress the warning, disable forwarding for this agent. AI Assistant documents the **Pass custom MCP servers** and **Pass IntelliJ MCP server** controls under **Settings → Tools → AI Assistant → Agents**. Its JSON defaults can also disable forwarding:
90
90
 
91
91
  ```json
92
92
  {
@@ -176,7 +176,7 @@ File paths and the requested command working directory must stay within the work
176
176
 
177
177
  ## MCP, context, and session limits
178
178
 
179
- Disable MCP forwarding for this agent. Session creation fails if the editor passes any MCP servers, even though the editor may support them for other agents. There is no acp-port flag to enable MCP. This also applies to IDE-provided MCP tools.
179
+ Forwarded MCP servers are ignored with a warning on stderr, so they do not prevent session creation or chat. acp-port does not launch or connect to stdio, HTTP, or SSE MCP servers, including IDE-provided ones. Its supported ACP file and terminal tools remain available when the editor advertises them. Disable MCP forwarding for this agent to suppress the warning; there is no acp-port flag to enable MCP tools.
180
180
 
181
181
  Prompts support text and embedded text resources. Resource links are included as names and URIs; acp-port does not fetch them automatically. Images, audio, and binary resources are unsupported. Attach the relevant text or ask the agent to read a workspace file when file reading is available.
182
182
 
@@ -101,7 +101,7 @@ There is no `--timeout` flag. See the [runtime defaults](configuration.md#runtim
101
101
 
102
102
  ## Unsupported context or session features
103
103
 
104
- - **MCP error at session creation:** disable MCP forwarding for this agent. All nonempty `mcpServers` lists are rejected, including stdio servers.
104
+ - **`MCP servers are not supported by acp-port` error at session creation:** older versions reject forwarded MCP servers. Update acp-port and restart the editor's agent process, or disable MCP forwarding for this agent as a workaround. The current implementation ignores forwarded servers with a warning on stderr and allows chat and supported editor tools to continue; MCP tools remain unavailable. When testing a source checkout, rebuild and use its local entry point as described in [contributing](../CONTRIBUTING.md).
105
105
  - **Image, audio, or binary resource error:** send text or embed the relevant text resource instead.
106
106
  - **A linked file or URL was not read:** resource links are metadata; their contents are not automatically downloaded. Attach text or request an available file tool.
107
107
  - **History limit reached:** start a new session. There is no automatic compaction. The editor's error may mention `agent.maxHistoryChars`, the internal setting for the fixed CLI history budget.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acp-port",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "An ACP agent for local models and LLM proxy APIs",
5
5
  "license": "MIT",
6
6
  "repository": {