@agentproto/adapter-copilot-cli 0.2.2 → 0.3.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/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -49,6 +49,14 @@ var copilotCli = defineAgentCli({
|
|
|
49
49
|
]
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
+
// Copilot bills through the user's GitHub Copilot subscription, and the
|
|
53
|
+
// `copilot` CLI owns that login (`copilot login` → system keychain, or
|
|
54
|
+
// `~/.copilot/config.json`; `gh auth token` as a last fallback). `external:
|
|
55
|
+
// true` declares exactly that: the runtime injects NO bearer and the CLI
|
|
56
|
+
// reads its own stored login. The token env vars in `auth.state` above are
|
|
57
|
+
// the same GitHub identity, not a per-token API-billing route, so there is
|
|
58
|
+
// no api-key var to scrub (no `conflictEnv`).
|
|
59
|
+
authSubscription: { external: true },
|
|
52
60
|
sandbox: "./SANDBOX.md",
|
|
53
61
|
protocol: "acp",
|
|
54
62
|
acp: "./copilot-acp.ACP.md",
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;AAsCO,IAAM,aAA6B,cAAA,CAAe;AAAA,EACvD,IAAA,EAAM,aAAA;AAAA,EACN,EAAA,EAAI,aAAA;AAAA,EACJ,WAAA,EACE,gPAAA;AAAA,EACF,OAAA,EAAS,OAAA;AAAA,EACT,GAAA,EAAK,SAAA;AAAA;AAAA;AAAA,EAGL,QAAA,EAAU,CAAC,OAAA,EAAS,SAAS,CAAA;AAAA,EAC7B,OAAA,EAAS;AAAA,IACP,EAAE,MAAA,EAAQ,KAAA,EAAO,OAAA,EAAS,iBAAA,EAAmB,QAAQ,IAAA,EAAK;AAAA,IAC1D,EAAE,MAAA,EAAQ,MAAA,EAAQ,OAAA,EAAS,aAAA,E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EAAM,MAAA;AAAA,MACN,MAAM,CAAC,KAAA,EAAO,QAAA,EAAU,MAAA,EAAQ,SAAS,KAAK,CAAA;AAAA,MAC9C,WAAA,EACE;AAAA,KAEJ;AAAA,IACA;AAAA,MACE,EAAA,EAAI,aAAA;AAAA,MACJ,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EACE,0NAAA;AAAA,MAGF,GAAA,EAAK,EAAE,OAAA,EAAS,SAAA;AAAU;AAC5B,GACF;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,OAAA,EAAS,eAAA;AAAA,IACT,SAAA,EAAW,CAAC,eAAA,EAAiB,gBAAA,EAAkB,cAAc,MAAM,CAAA;AAAA,IACnE,cAAA,EAAgB;AAAA,MACd,eAAA,EAAiB,IAAA;AAAA,MACjB,SAAA,EAAW,CAAC,cAAA,EAAgB,UAAU;AAAA;AACxC,GACF;AAAA,EACA,QAAA,EAAU;AAAA,IACR,GAAA,EAAK;AAAA,MACH,OAAA,EAAS,YAAA;AAAA,MACT,MAAA,EACE;AAAA,KAKJ;AAAA,IACA,KAAA,EAAO;AAAA,MACL,OAAA,EAAS,YAAA;AAAA,MACT,MAAA,EACE;AAAA,KAIJ;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,OAAA,EAAS,YAAA;AAAA,MACT,MAAA,EACE;AAAA;AAMJ,GACF;AAAA,EACA,MAAM,CAAC,SAAA,EAAW,UAAU,KAAA,EAAO,eAAA,EAAiB,UAAU,YAAY;AAC5E,CAAC;AAEM,SAAS,iBAAA,GAAqC;AACnD,EAAA,OAAO,sBAAsB,UAAU,CAAA;AACzC","file":"index.mjs","sourcesContent":["/**\n * @agentproto/adapter-copilot-cli — AIP-45 adapter for GitHub Copilot CLI.\n *\n * GitHub Copilot CLI (binary `copilot`, product name \"GitHub Copilot CLI\") is\n * GitHub's official terminal coding agent — https://github.com/github/copilot-cli,\n * docs at\n * https://docs.github.com/en/copilot/concepts/agents/copilot-cli/about-copilot-cli.\n *\n * It ships a FIRST-PARTY ACP server, so — like the `grok-cli` adapter — this is\n * a `protocol: \"acp\"` arm, not a print/headless one. `copilot --acp --stdio`\n * speaks Agent Client Protocol JSON-RPC 2.0 as NDJSON over stdio (verified\n * against the official docs at\n * https://docs.github.com/en/copilot/reference/copilot-cli-reference/acp-server;\n * ACP was added in 0.0.397 on 2026-01-28 and is in public preview). The server\n * exposes model and reasoning-effort ACP session config options and supports\n * loading existing sessions.\n *\n * A headless one-shot surface also exists — `copilot -p \"<prompt>\"\n * --output-format json` emits JSONL — but the ACP arm is the richer, persistent,\n * resumable posture, and it avoids a bespoke print event mapper in the driver.\n *\n * import { copilotCli, copilotCliRuntime } from \"@agentproto/adapter-copilot-cli\"\n * const session = await copilotCliRuntime().start({\n * env: { GH_TOKEN: \"github_pat_...\" },\n * })\n * for await (const evt of session.send({ role: \"user\", content: \"...\" })) {\n * console.log(evt)\n * }\n * await session.close()\n */\n\nimport {\n createAgentCliRuntime,\n defineAgentCli,\n type AgentCliHandle,\n type AgentCliRuntime,\n} from \"@agentproto/driver-agent-cli\"\n\nexport const copilotCli: AgentCliHandle = defineAgentCli({\n name: \"copilot-cli\",\n id: \"copilot-cli\",\n description:\n \"GitHub's official Copilot CLI (`copilot --acp --stdio`) — a terminal coding agent driving GitHub-hosted models (Claude, GPT, Gemini, Grok, …) over the Agent Client Protocol. Works with github.com and GitHub Enterprise (GH_HOST).\",\n version: \"0.1.0\",\n bin: \"copilot\",\n // First-party ACP server over stdio (the default transport when `--acp` is\n // set; `--stdio` is passed explicitly to disambiguate from TCP `--port`).\n bin_args: [\"--acp\", \"--stdio\"],\n install: [\n { method: \"npm\", package: \"@github/copilot\", global: true },\n { method: \"brew\", package: \"copilot-cli\" },\n { method: \"curl\", url: \"https://gh.io/copilot-install\" },\n ],\n version_check: {\n // `copilot --version` / `-v` prints version information. The ACP server\n // landed in 0.0.397 (2026-01-28); ACP session LOAD — the resume surface\n // this adapter's `native-resume` continuation rides on — landed in 0.0.410\n // (2026-02-14), so that is the floor. The exact stdout shape is UNVERIFIED\n // (the CLI is not installed in this worktree), so the parse is the\n // conventional semver grab.\n cmd: \"copilot --version\",\n parse: \"(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\",\n range: \">=0.0.410\",\n timeout_ms: 15_000,\n },\n auth: {\n ref: \"./SECRETS.md\",\n // Documented token precedence: COPILOT_GITHUB_TOKEN > GH_TOKEN >\n // GITHUB_TOKEN (github.com and ghe.com subdomains). GitHub Enterprise\n // Server uses GH_ENTERPRISE_TOKEN / GITHUB_ENTERPRISE_TOKEN. Supported\n // token types: OAuth (`gho_`), fine-grained PAT with the \"Copilot\n // Requests\" permission (`github_pat_`), and GitHub App user-to-server\n // (`ghu_`). Classic PATs (`ghp_`) are NOT supported.\n state: {\n env: [\n \"COPILOT_GITHUB_TOKEN\",\n \"GH_TOKEN\",\n \"GITHUB_TOKEN\",\n \"GH_ENTERPRISE_TOKEN\",\n \"GITHUB_ENTERPRISE_TOKEN\",\n ],\n },\n },\n sandbox: \"./SANDBOX.md\",\n protocol: \"acp\",\n acp: \"./copilot-acp.ACP.md\",\n session: {\n mode: \"persistent\",\n idle_timeout_ms: 1_800_000,\n context_carryover: true,\n },\n // No `models` block by design: the model menu is plan/entitlement-dependent\n // and served under ONE GitHub identity (not a per-provider api-key route the\n // catalog could bill), and the exact `--model` slugs are not documented in a\n // stable table. The honest surface is the free-form `model` option below,\n // which the ACP arm applies via the `model` session config option; the CLI\n // validates explicit ids against the account. `models.apply` therefore\n // defaults to `\"config\"` (ACP set_config_option), and no catalog `provider`\n // is declared — Copilot bills through the GitHub subscription, not a\n // provider API key.\n capabilities: {\n streaming: true,\n tool_calls: true,\n // The ACP server reports subagent activity to its client, but that is the\n // agent's own internal delegation, not an AIP-45 `sub_agents` surface —\n // declared false, same posture as grok-cli.\n sub_agents: false,\n file_io: true,\n // The ACP `promptCapabilities` for this server are not documented; declared\n // false rather than overclaiming (the interactive CLI does accept pasted\n // images, but that is not an ACP content-block channel).\n multimodal: false,\n // ACP session load (0.0.410+) backs the `native-resume` continuation.\n resumable: true,\n bidirectional: true,\n },\n options: [\n {\n id: \"model\",\n type: \"string\",\n description:\n \"Copilot model id for this session (e.g. `claude-sonnet-4.5`, `gpt-5`, \" +\n \"`auto`). Applied via the ACP `model` session config option; the CLI \" +\n \"validates the id against your plan/entitlements and rejects an unknown one.\",\n },\n {\n id: \"effort\",\n type: \"enum\",\n enum: [\"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n description:\n \"Reasoning effort for this session. Applied via the ACP `effort` session \" +\n \"config option (the server also accepts `--effort`/`--reasoning-effort` at start).\",\n },\n {\n id: \"github_host\",\n type: \"string\",\n description:\n \"GitHub hostname for GitHub Enterprise — GHEC with data residency \" +\n \"(e.g. `example.ghe.com`) or a GHES host. Sets `GH_HOST`; pair with \" +\n \"`GH_ENTERPRISE_TOKEN` / `GITHUB_ENTERPRISE_TOKEN` for GitHub Enterprise Server.\",\n env: { GH_HOST: \"{value}\" },\n },\n ],\n continuation: {\n default: \"native-resume\",\n supported: [\"native-resume\", \"pinned-session\", \"transcript\", \"none\"],\n pinned_session: {\n idle_timeout_ms: 1_800_000,\n key_scope: [\"conversation\", \"operator\"],\n },\n },\n metadata: {\n acp: {\n checked: \"2026-10-01\",\n result:\n \"GitHub Copilot CLI ships a first-party ACP server: `copilot --acp --stdio` \" +\n \"(NDJSON JSON-RPC 2.0 over stdio; TCP via `--acp --port`). Added in 0.0.397 \" +\n \"(2026-01-28), public preview. The server exposes model and reasoning-effort \" +\n \"ACP session config options and supports loading existing sessions (0.0.410+). \" +\n \"This adapter drives ACP, not the print/headless surface.\",\n },\n print: {\n checked: \"2026-10-01\",\n result:\n \"A headless one-shot surface also exists: `copilot -p \\\"<prompt>\\\" \" +\n \"--output-format json` emits JSONL, with `--model`, `--resume[=ID]`, \" +\n \"`--allow-all-tools`, `--stream`, and `--share-gist`. Not wired here — \" +\n \"ACP is the richer posture and avoids a bespoke print event mapper.\",\n },\n auth: {\n checked: \"2026-10-01\",\n result:\n \"Token env precedence: COPILOT_GITHUB_TOKEN > GH_TOKEN > GITHUB_TOKEN. \" +\n \"GitHub Enterprise Cloud (data residency) uses `copilot login --host` or \" +\n \"GH_HOST + a token; GitHub Enterprise Server uses GH_HOST + \" +\n \"GH_ENTERPRISE_TOKEN/GITHUB_ENTERPRISE_TOKEN (or the COPILOT_PROVIDER_GHES_* \" +\n \"vars). BYOK (COPILOT_PROVIDER_BASE_URL/TYPE/API_KEY/MODEL) can run without \" +\n \"a GitHub login — not wired here.\",\n },\n },\n tags: [\"copilot\", \"github\", \"acp\", \"agent-runtime\", \"coding\", \"enterprise\"],\n})\n\nexport function copilotCliRuntime(): AgentCliRuntime {\n return createAgentCliRuntime(copilotCli)\n}\n\nexport type { AgentCliHandle, AgentCliRuntime }\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;AAsCO,IAAM,aAA6B,cAAA,CAAe;AAAA,EACvD,IAAA,EAAM,aAAA;AAAA,EACN,EAAA,EAAI,aAAA;AAAA,EACJ,WAAA,EACE,gPAAA;AAAA,EACF,OAAA,EAAS,OAAA;AAAA,EACT,GAAA,EAAK,SAAA;AAAA;AAAA;AAAA,EAGL,QAAA,EAAU,CAAC,OAAA,EAAS,SAAS,CAAA;AAAA,EAC7B,OAAA,EAAS;AAAA,IACP,EAAE,MAAA,EAAQ,KAAA,EAAO,OAAA,EAAS,iBAAA,EAAmB,QAAQ,IAAA,EAAK;AAAA,IAC1D,EAAE,MAAA,EAAQ,MAAA,EAAQ,OAAA,EAAS,aAAA,EAAc;AAAA,IACzC,EAAE,MAAA,EAAQ,MAAA,EAAQ,GAAA,EAAK,+BAAA;AAAgC,GACzD;AAAA,EACA,aAAA,EAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOb,GAAA,EAAK,mBAAA;AAAA,IACL,KAAA,EAAO,sBAAA;AAAA,IACP,KAAA,EAAO,WAAA;AAAA,IACP,UAAA,EAAY;A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EAAI,aAAA;AAAA,MACJ,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EACE,0NAAA;AAAA,MAGF,GAAA,EAAK,EAAE,OAAA,EAAS,SAAA;AAAU;AAC5B,GACF;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,OAAA,EAAS,eAAA;AAAA,IACT,SAAA,EAAW,CAAC,eAAA,EAAiB,gBAAA,EAAkB,cAAc,MAAM,CAAA;AAAA,IACnE,cAAA,EAAgB;AAAA,MACd,eAAA,EAAiB,IAAA;AAAA,MACjB,SAAA,EAAW,CAAC,cAAA,EAAgB,UAAU;AAAA;AACxC,GACF;AAAA,EACA,QAAA,EAAU;AAAA,IACR,GAAA,EAAK;AAAA,MACH,OAAA,EAAS,YAAA;AAAA,MACT,MAAA,EACE;AAAA,KAKJ;AAAA,IACA,KAAA,EAAO;AAAA,MACL,OAAA,EAAS,YAAA;AAAA,MACT,MAAA,EACE;AAAA,KAIJ;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,OAAA,EAAS,YAAA;AAAA,MACT,MAAA,EACE;AAAA;AAMJ,GACF;AAAA,EACA,MAAM,CAAC,SAAA,EAAW,UAAU,KAAA,EAAO,eAAA,EAAiB,UAAU,YAAY;AAC5E,CAAC;AAEM,SAAS,iBAAA,GAAqC;AACnD,EAAA,OAAO,sBAAsB,UAAU,CAAA;AACzC","file":"index.mjs","sourcesContent":["/**\n * @agentproto/adapter-copilot-cli — AIP-45 adapter for GitHub Copilot CLI.\n *\n * GitHub Copilot CLI (binary `copilot`, product name \"GitHub Copilot CLI\") is\n * GitHub's official terminal coding agent — https://github.com/github/copilot-cli,\n * docs at\n * https://docs.github.com/en/copilot/concepts/agents/copilot-cli/about-copilot-cli.\n *\n * It ships a FIRST-PARTY ACP server, so — like the `grok-cli` adapter — this is\n * a `protocol: \"acp\"` arm, not a print/headless one. `copilot --acp --stdio`\n * speaks Agent Client Protocol JSON-RPC 2.0 as NDJSON over stdio (verified\n * against the official docs at\n * https://docs.github.com/en/copilot/reference/copilot-cli-reference/acp-server;\n * ACP was added in 0.0.397 on 2026-01-28 and is in public preview). The server\n * exposes model and reasoning-effort ACP session config options and supports\n * loading existing sessions.\n *\n * A headless one-shot surface also exists — `copilot -p \"<prompt>\"\n * --output-format json` emits JSONL — but the ACP arm is the richer, persistent,\n * resumable posture, and it avoids a bespoke print event mapper in the driver.\n *\n * import { copilotCli, copilotCliRuntime } from \"@agentproto/adapter-copilot-cli\"\n * const session = await copilotCliRuntime().start({\n * env: { GH_TOKEN: \"github_pat_...\" },\n * })\n * for await (const evt of session.send({ role: \"user\", content: \"...\" })) {\n * console.log(evt)\n * }\n * await session.close()\n */\n\nimport {\n createAgentCliRuntime,\n defineAgentCli,\n type AgentCliHandle,\n type AgentCliRuntime,\n} from \"@agentproto/driver-agent-cli\"\n\nexport const copilotCli: AgentCliHandle = defineAgentCli({\n name: \"copilot-cli\",\n id: \"copilot-cli\",\n description:\n \"GitHub's official Copilot CLI (`copilot --acp --stdio`) — a terminal coding agent driving GitHub-hosted models (Claude, GPT, Gemini, Grok, …) over the Agent Client Protocol. Works with github.com and GitHub Enterprise (GH_HOST).\",\n version: \"0.1.0\",\n bin: \"copilot\",\n // First-party ACP server over stdio (the default transport when `--acp` is\n // set; `--stdio` is passed explicitly to disambiguate from TCP `--port`).\n bin_args: [\"--acp\", \"--stdio\"],\n install: [\n { method: \"npm\", package: \"@github/copilot\", global: true },\n { method: \"brew\", package: \"copilot-cli\" },\n { method: \"curl\", url: \"https://gh.io/copilot-install\" },\n ],\n version_check: {\n // `copilot --version` / `-v` prints version information. The ACP server\n // landed in 0.0.397 (2026-01-28); ACP session LOAD — the resume surface\n // this adapter's `native-resume` continuation rides on — landed in 0.0.410\n // (2026-02-14), so that is the floor. The exact stdout shape is UNVERIFIED\n // (the CLI is not installed in this worktree), so the parse is the\n // conventional semver grab.\n cmd: \"copilot --version\",\n parse: \"(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\",\n range: \">=0.0.410\",\n timeout_ms: 15_000,\n },\n auth: {\n ref: \"./SECRETS.md\",\n // Documented token precedence: COPILOT_GITHUB_TOKEN > GH_TOKEN >\n // GITHUB_TOKEN (github.com and ghe.com subdomains). GitHub Enterprise\n // Server uses GH_ENTERPRISE_TOKEN / GITHUB_ENTERPRISE_TOKEN. Supported\n // token types: OAuth (`gho_`), fine-grained PAT with the \"Copilot\n // Requests\" permission (`github_pat_`), and GitHub App user-to-server\n // (`ghu_`). Classic PATs (`ghp_`) are NOT supported.\n state: {\n env: [\n \"COPILOT_GITHUB_TOKEN\",\n \"GH_TOKEN\",\n \"GITHUB_TOKEN\",\n \"GH_ENTERPRISE_TOKEN\",\n \"GITHUB_ENTERPRISE_TOKEN\",\n ],\n },\n },\n // Copilot bills through the user's GitHub Copilot subscription, and the\n // `copilot` CLI owns that login (`copilot login` → system keychain, or\n // `~/.copilot/config.json`; `gh auth token` as a last fallback). `external:\n // true` declares exactly that: the runtime injects NO bearer and the CLI\n // reads its own stored login. The token env vars in `auth.state` above are\n // the same GitHub identity, not a per-token API-billing route, so there is\n // no api-key var to scrub (no `conflictEnv`).\n authSubscription: { external: true },\n sandbox: \"./SANDBOX.md\",\n protocol: \"acp\",\n acp: \"./copilot-acp.ACP.md\",\n session: {\n mode: \"persistent\",\n idle_timeout_ms: 1_800_000,\n context_carryover: true,\n },\n // No `models` block by design: the model menu is plan/entitlement-dependent\n // and served under ONE GitHub identity (not a per-provider api-key route the\n // catalog could bill), and the exact `--model` slugs are not documented in a\n // stable table. The honest surface is the free-form `model` option below,\n // which the ACP arm applies via the `model` session config option; the CLI\n // validates explicit ids against the account. `models.apply` therefore\n // defaults to `\"config\"` (ACP set_config_option), and no catalog `provider`\n // is declared — Copilot bills through the GitHub subscription, not a\n // provider API key.\n capabilities: {\n streaming: true,\n tool_calls: true,\n // The ACP server reports subagent activity to its client, but that is the\n // agent's own internal delegation, not an AIP-45 `sub_agents` surface —\n // declared false, same posture as grok-cli.\n sub_agents: false,\n file_io: true,\n // The ACP `promptCapabilities` for this server are not documented; declared\n // false rather than overclaiming (the interactive CLI does accept pasted\n // images, but that is not an ACP content-block channel).\n multimodal: false,\n // ACP session load (0.0.410+) backs the `native-resume` continuation.\n resumable: true,\n bidirectional: true,\n },\n options: [\n {\n id: \"model\",\n type: \"string\",\n description:\n \"Copilot model id for this session (e.g. `claude-sonnet-4.5`, `gpt-5`, \" +\n \"`auto`). Applied via the ACP `model` session config option; the CLI \" +\n \"validates the id against your plan/entitlements and rejects an unknown one.\",\n },\n {\n id: \"effort\",\n type: \"enum\",\n enum: [\"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n description:\n \"Reasoning effort for this session. Applied via the ACP `effort` session \" +\n \"config option (the server also accepts `--effort`/`--reasoning-effort` at start).\",\n },\n {\n id: \"github_host\",\n type: \"string\",\n description:\n \"GitHub hostname for GitHub Enterprise — GHEC with data residency \" +\n \"(e.g. `example.ghe.com`) or a GHES host. Sets `GH_HOST`; pair with \" +\n \"`GH_ENTERPRISE_TOKEN` / `GITHUB_ENTERPRISE_TOKEN` for GitHub Enterprise Server.\",\n env: { GH_HOST: \"{value}\" },\n },\n ],\n continuation: {\n default: \"native-resume\",\n supported: [\"native-resume\", \"pinned-session\", \"transcript\", \"none\"],\n pinned_session: {\n idle_timeout_ms: 1_800_000,\n key_scope: [\"conversation\", \"operator\"],\n },\n },\n metadata: {\n acp: {\n checked: \"2026-10-01\",\n result:\n \"GitHub Copilot CLI ships a first-party ACP server: `copilot --acp --stdio` \" +\n \"(NDJSON JSON-RPC 2.0 over stdio; TCP via `--acp --port`). Added in 0.0.397 \" +\n \"(2026-01-28), public preview. The server exposes model and reasoning-effort \" +\n \"ACP session config options and supports loading existing sessions (0.0.410+). \" +\n \"This adapter drives ACP, not the print/headless surface.\",\n },\n print: {\n checked: \"2026-10-01\",\n result:\n \"A headless one-shot surface also exists: `copilot -p \\\"<prompt>\\\" \" +\n \"--output-format json` emits JSONL, with `--model`, `--resume[=ID]`, \" +\n \"`--allow-all-tools`, `--stream`, and `--share-gist`. Not wired here — \" +\n \"ACP is the richer posture and avoids a bespoke print event mapper.\",\n },\n auth: {\n checked: \"2026-10-01\",\n result:\n \"Token env precedence: COPILOT_GITHUB_TOKEN > GH_TOKEN > GITHUB_TOKEN. \" +\n \"GitHub Enterprise Cloud (data residency) uses `copilot login --host` or \" +\n \"GH_HOST + a token; GitHub Enterprise Server uses GH_HOST + \" +\n \"GH_ENTERPRISE_TOKEN/GITHUB_ENTERPRISE_TOKEN (or the COPILOT_PROVIDER_GHES_* \" +\n \"vars). BYOK (COPILOT_PROVIDER_BASE_URL/TYPE/API_KEY/MODEL) can run without \" +\n \"a GitHub login — not wired here.\",\n },\n },\n tags: [\"copilot\", \"github\", \"acp\", \"agent-runtime\", \"coding\", \"enterprise\"],\n})\n\nexport function copilotCliRuntime(): AgentCliRuntime {\n return createAgentCliRuntime(copilotCli)\n}\n\nexport type { AgentCliHandle, AgentCliRuntime }\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentproto/adapter-copilot-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "@agentproto/adapter-copilot-cli — AIP-45 AGENT-CLI adapter for GitHub's official Copilot CLI (`copilot --acp --stdio`). Public github.com and GitHub Enterprise (GH_HOST).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentproto",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@agentproto/driver-agent-cli": "2.
|
|
45
|
+
"@agentproto/driver-agent-cli": "2.9.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^25.9.5",
|