{"_id":"@alint-js/model-adapter-acp","_rev":"5-444362f713a7731326ee396755227d74","name":"@alint-js/model-adapter-acp","dist-tags":{"latest":"0.7.1"},"versions":{"0.4.0":{"name":"@alint-js/model-adapter-acp","version":"0.4.0","_id":"@alint-js/model-adapter-acp@0.4.0","maintainers":[{"name":"nekomeowww","email":"neko@ayaka.moe"}],"dist":{"shasum":"96b7e898169cd16b5748f2348f42ca97b2ee5d54","tarball":"https://registry.npmjs.org/@alint-js/model-adapter-acp/-/model-adapter-acp-0.4.0.tgz","fileCount":5,"integrity":"sha512-rs8YcQLm5zjIBKaZ4swsdYU/GMOxDBh9mUPhAbSIJWD1rBx11VdQCa3P13s7yAVZ7jGInsVz+kB5MmqLWytZWw==","signatures":[{"sig":"MEUCIQDlaZTfIYkpq4PJCNd973qybwFc/6/IgS4sR5KU5acffAIgFFzDFTtzG0fbZtTA15GJPaIafbul6RdeCGpg7gBk0EA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32169},"type":"module","exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./package.json":"./package.json"},"scripts":{"test":"vitest run --config vitest.config.ts","build":"tsdown","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"nekomeowww","email":"neko@ayaka.moe"},"directories":{},"_nodeVersion":"24.18.0","dependencies":{"h3":"2.0.1-rc.25","zod":"^4.4.3","valibot":"^1.4.2","tinyexec":"^1.2.4","@agentclientprotocol/sdk":"^1.3.0","@modelcontextprotocol/sdk":"^1.30.0"},"_hasShrinkwrap":false,"devDependencies":{"@alint-js/core":"0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/model-adapter-acp_0.4.0_1786127598621_0.07647376846646115","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@alint-js/model-adapter-acp","version":"0.5.0","_id":"@alint-js/model-adapter-acp@0.5.0","maintainers":[{"name":"nekomeowww","email":"neko@ayaka.moe"}],"dist":{"shasum":"c403933c5321607a87ec70030f6ee4c0b4919638","tarball":"https://registry.npmjs.org/@alint-js/model-adapter-acp/-/model-adapter-acp-0.5.0.tgz","fileCount":5,"integrity":"sha512-v6dJpYarxW3iSAOuiTuCosw+bwcxvP5Enwpad+8r4+onwe7GJu397bDsWkOQZSwWKwH61PRDshMM2vhDTWPGuw==","signatures":[{"sig":"MEYCIQChoVUKTtHyDmQBfraUD/M4yh1damyvwDyMwY8b8IryyAIhAPE1mmTFJ3vZtyE9a9on3eweL2FXITyoYma0CgkY8175","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33404},"type":"module","exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./package.json":"./package.json"},"scripts":{"test":"vitest run --config vitest.config.ts","build":"tsdown","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"nekomeowww","email":"neko@ayaka.moe"},"directories":{},"_nodeVersion":"24.19.0","dependencies":{"h3":"2.0.1-rc.25","zod":"^4.4.3","valibot":"^1.4.2","tinyexec":"^1.2.4","@agentclientprotocol/sdk":"^1.3.0","@modelcontextprotocol/sdk":"^1.30.0"},"_hasShrinkwrap":false,"devDependencies":{"@alint-js/core":"0.5.0"},"_npmOperationalInternal":{"tmp":"tmp/model-adapter-acp_0.5.0_1786864094308_0.4132225750528664","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@alint-js/model-adapter-acp","version":"0.6.0","keywords":["alint","agent-client-protocol","acp","openai-compatible","ai","gateway"],"license":"MIT","_id":"@alint-js/model-adapter-acp@0.6.0","maintainers":[{"name":"nekomeowww","email":"neko@ayaka.moe"}],"dist":{"shasum":"4822835db5cccecddf9a1863b48116eb9c4f11e7","tarball":"https://registry.npmjs.org/@alint-js/model-adapter-acp/-/model-adapter-acp-0.6.0.tgz","fileCount":5,"integrity":"sha512-+/mwNyJjmUXYcIJ4IWIS3+QFrSb+2LQGWzcax/kGlUszwokspmTvNo+I0RNc8S/XGlRO+3kSjTOaFIEgOfjcaA==","signatures":[{"sig":"MEUCIQD0dtHEaBo/rKbV/oKxLlGfOBiXWHaJl1/7BQcH2hpfEwIgS6vlkdv2hURMmh+AdllRE4pIP2DHFwTfu7/YOirVVsc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33782},"type":"module","exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./package.json":"./package.json"},"scripts":{"test":"vitest run --config vitest.config.ts","build":"tsdown","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"nekomeowww","email":"neko@ayaka.moe"},"repository":{"url":"git+https://github.com/moeru-ai/alint.git","type":"git","directory":"packages/model-adapter-acp"},"description":"OpenAI-compatible HTTP gateway for Agent Client Protocol coding agents","directories":{},"_nodeVersion":"24.19.0","dependencies":{"h3":"2.0.1-rc.25","zod":"^4.4.3","valibot":"^1.4.2","tinyexec":"^1.2.4","@agentclientprotocol/sdk":"^1.3.0","@modelcontextprotocol/sdk":"^1.30.0"},"_hasShrinkwrap":false,"devDependencies":{"@alint-js/core":"0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/model-adapter-acp_0.6.0_1787133854559_0.23107148264016342","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@alint-js/model-adapter-acp","version":"0.7.0","keywords":["alint","agent-client-protocol","acp","openai-compatible","ai","gateway"],"license":"MIT","_id":"@alint-js/model-adapter-acp@0.7.0","maintainers":[{"name":"nekomeowww","email":"neko@ayaka.moe"}],"dist":{"shasum":"16fcc7f0d2bac2cec27cc3f0cd3343759bd813d4","tarball":"https://registry.npmjs.org/@alint-js/model-adapter-acp/-/model-adapter-acp-0.7.0.tgz","fileCount":5,"integrity":"sha512-aHgaMsFFGB8F72NO/iJP1BCDqVZuX3iExlIPsJ2dXDKgC3Nxz0B4ThIWenyOU8D8RHeskOuyjzTXrCBDQG6uHw==","signatures":[{"sig":"MEYCIQDiB1leUPTrTg9kvOw7otUDPeyIttpJGrbS23sZnkxAogIhAP7/dtRw3FoMXxjMr3m2w9slSkuDFLgzcefeIX4V0QR8","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCICVuYFzdXQH8e5OYjV7jROzHiLoW7n4mJ9RWEuyVdrjiAiEAjwfHdclSWKdqe9IRcvcy5tyAmK4y/Rqe553QGivlVa4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33874},"type":"module","exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./package.json":"./package.json"},"scripts":{"test":"vitest run --config vitest.config.ts","build":"tsdown","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"nekomeowww","email":"neko@ayaka.moe"},"repository":{"url":"git+https://github.com/moeru-ai/alint.git","type":"git","directory":"packages/model-adapter-acp"},"description":"OpenAI-compatible HTTP gateway for Agent Client Protocol coding agents","directories":{},"_nodeVersion":"24.19.0","dependencies":{"h3":"2.0.1-rc.25","zod":"^4.4.3","valibot":"^1.4.2","tinyexec":"^1.2.4","@agentclientprotocol/sdk":"^1.3.0","@modelcontextprotocol/sdk":"^1.30.0"},"_hasShrinkwrap":false,"devDependencies":{"@alint-js/core":"0.7.0"},"_npmOperationalInternal":{"tmp":"tmp/model-adapter-acp_0.7.0_1787937847152_0.9051438516247197","host":"s3://npm-registry-packages-npm-production"}},"0.7.1":{"_id":"@alint-js/model-adapter-acp@0.7.1","dist":{"shasum":"6055903e9f13c0233b33bcb1d08c7ef6d6738fa4","tarball":"https://registry.npmjs.org/@alint-js/model-adapter-acp/-/model-adapter-acp-0.7.1.tgz","fileCount":5,"integrity":"sha512-HkyV80A5JFjLi7ZjQcTQqdn0/8vYFSIkz0Dtax0o2vA2uc/qZ1vbQqH1FVKLIwc/dpnEQi8RpN5M1RZC9O66qg==","signatures":[{"sig":"MEQCICpAxW8R+EbopW6B2EvPdAGKAePBW1ABt26M9KfGqxfvAiAG6/k42ScYwtSwGi3aUvp/2yMM5Y2OcyEAO/mOjB2GkA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICexjc0DHqSEV2V4MRTE/zVjaAvGs204LlZQM/Vy950uAiBrzTqdfbS5z6tsh00OVze3PO5VFp3LVQNwrNo+TKADSw=="}],"unpackedSize":33874},"name":"@alint-js/model-adapter-acp","type":"module","exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./package.json":"./package.json"},"license":"MIT","scripts":{"test":"vitest run --config vitest.config.ts","build":"tsdown","typecheck":"tsc -p tsconfig.json --noEmit"},"version":"0.7.1","_npmUser":{"name":"nekomeowww","email":"neko@ayaka.moe"},"keywords":["alint","agent-client-protocol","acp","openai-compatible","ai","gateway"],"repository":{"url":"git+https://github.com/moeru-ai/alint.git","type":"git","directory":"packages/model-adapter-acp"},"description":"OpenAI-compatible HTTP gateway for Agent Client Protocol coding agents","directories":{},"maintainers":[{"name":"nekomeowww","email":"neko@ayaka.moe"}],"_nodeVersion":"24.19.0","dependencies":{"h3":"2.0.1-rc.25","zod":"^4.4.3","valibot":"^1.4.2","tinyexec":"^1.2.4","@agentclientprotocol/sdk":"^1.3.0","@modelcontextprotocol/sdk":"^1.30.0"},"_hasShrinkwrap":false,"devDependencies":{"@alint-js/core":"0.7.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/model-adapter-acp_0.7.1_1788006531998_0.46645067312397703"}}},"time":{"created":"2026-08-07T18:33:18.391Z","modified":"2026-08-29T12:28:52.250Z","0.4.0":"2026-08-07T18:33:18.759Z","0.5.0":"2026-08-16T07:08:14.444Z","0.6.0":"2026-08-19T10:04:14.731Z","0.7.0":"2026-08-28T17:24:07.227Z","0.7.1":"2026-08-29T12:28:52.085Z"},"license":"MIT","keywords":["alint","agent-client-protocol","acp","openai-compatible","ai","gateway"],"repository":{"url":"git+https://github.com/moeru-ai/alint.git","type":"git","directory":"packages/model-adapter-acp"},"description":"OpenAI-compatible HTTP gateway for Agent Client Protocol coding agents","maintainers":[{"name":"nekomeowww","email":"neko@ayaka.moe"}],"readme":"# `@alint-js/model-adapter-acp`\n\nAn OpenAI-compatible HTTP gateway for ACP coding agents.\n\n## What it does\n\nThe package keeps ACP session semantics outside alint. It exposes configured ACP agents as\nOpenAI-compatible models and implements:\n\n- `GET /v1/models`\n- non-streaming and SSE text chat completions\n- request-scoped OpenAI function tools exposed to ACP through MCP Streamable HTTP\n- deferred `tool_calls` continuation through a later `role: tool` message\n- `tool_choice`, usage, abort, continuation TTL, and permission-denial handling\n\nThe integration suite also runs a real `runAlint` file rule through `ctx.model()`, xsAI\n`generateStructured`, this HTTP gateway, an ACP session, and the MCP `reportFindings` tool before\nasserting the diagnostic returned by alint.\n\nThe MCP bridge uses a random route and bearer token for each completion turn. When the public\ngateway address is not loopback, configure `mcpBaseUrl`; request Host headers are not trusted to\nchoose the authenticated MCP destination.\n\nACP has no equivalent for OpenAI `temperature`, and final ACP usage is unavailable while a\ndeferred tool call is pending. Use `onCompatibilityDiagnostic` to observe those cases. Pending\ntool-call responses report zero usage because xsAI requires the OpenAI `usage` object.\n\n## How to use with a command\n\n`createCommandModel` uses `tinyexec` to start one ACP process per completion. `startGateway` owns the loopback HTTP server and closes active ACP processes when it shuts down.\n\n```ts\nimport { createCommandModel, startGateway } from '@alint-js/model-adapter-acp'\n\nconst gateway = await startGateway({\n  cwd: process.cwd(),\n  models: [createCommandModel({\n    command: 'codex-acp',\n    cwd: process.cwd(),\n    id: 'codex',\n    name: 'Codex ACP',\n  })],\n})\n\nconsole.info(gateway.endpoint)\nawait gateway.shutdown()\n```\n\nThe alint CLI wraps this interface. Users normally set `driver = \"acp\"` on a provider model in global setup or `.alint/config.toml` instead of starting the gateway themselves.\n\n## How to embed an ACP connection\n\n```ts\nimport { createGateway } from '@alint-js/model-adapter-acp'\nimport { serve } from 'h3/node'\n\nconst app = createGateway({\n  cwd: process.cwd(),\n  mcpBaseUrl: 'http://127.0.0.1:7419',\n  models: [{\n    id: 'reviewer',\n    name: 'Review Agent',\n    openConnection: async () => ({\n      kind: 'stream',\n      stream: await openYourAcpStream(),\n    }),\n  }],\n})\n\nconst server = await serve(app, { hostname: '127.0.0.1', port: 7419 }).ready()\n\n// On shutdown, stop accepting HTTP first, then cancel retained ACP continuations.\nawait server.close()\nawait app.shutdown()\n```\n\n`openConnection` accepts either an official ACP `AgentApp` or `Stream`. An embedding application can own a different transport or lifecycle policy without using the command adapter.\n\nOther OpenAI-compatible consumers can use the resulting ordinary provider endpoint:\n\n```toml\n[[providers]]\nid = \"acp\"\ntype = \"openai-compatible\"\nendpoint = \"http://127.0.0.1:7419/v1\"\n```\n\n## When to use\n\n- You need existing OpenAI-compatible consumers to call an ACP coding agent.\n- The ACP agent supports MCP over HTTP when request tools are used.\n- The OpenAI client executes function calls and returns `role: tool` messages.\n\n## When not to use\n\n- Use an alint agent adapter when a rule intentionally depends on agent-specific behavior.\n- Do not use this package as an OpenAI Responses, realtime, audio, or image compatibility layer.\n- Sequential tool calls work with streaming and non-streaming chat completions.\n- Parallel tool calls are not supported.\n","readmeFilename":""}