@yhong91/cpac 0.1.41 → 0.1.43

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
@@ -310,7 +310,7 @@ cpac install zed
310
310
  cpac zed
311
311
  ```
312
312
 
313
- 它在 `~/.config/zed/settings.json` 的 `language_models.openai_compatible.cpac` 写入 `api_url`(指向共享 loopback 代理)和 CPA 目录里的 `available_models`。模型走 Responses API(`chat_completions: false`),与 Pi / Grok 一致。密钥不写进 settings:Zed 读取 `CPAC_API_KEY`(任意非空即可,loopback 会换成真正的 `CPA_API_KEY`),也可在 Agent Settings 里为 `cpac` provider 填一次。卸载:
313
+ 它在 `~/.config/zed/settings.json` 的 `language_models.openai_compatible.cpac` 写入 `api_url`(指向共享 loopback 代理)和 CPA 目录里的 `available_models`。模型走 Responses API(`chat_completions: false`),与 Pi / Grok 一致。密钥不写进 settings:`cpac zed` 会注入占位 `CPAC_API_KEY`;从 Dock 打开 Zed 时在 Agent Settings 里给 `cpac` provider 填任意非空值(loopback 会换成真正的 `CPA_API_KEY`)。这是 Zed 内置 Agent 的 OpenAI-compatible provider,不是 Codex ACP(`codex-acp`)。卸载:
314
314
 
315
315
  ```bash
316
316
  cpac restore zed
@@ -327,7 +327,7 @@ cpac install hermes
327
327
  cpac hermes
328
328
  ```
329
329
 
330
- 它在 `~/.hermes/config.yaml` 的 `providers.cpac` 写入 loopback `api`、占位 `api_key`、`api_mode: responses`,以及 CPA catalog 的 slug 列表(`discover_models: false`)。不改当前默认模型;切换用 `hermes model` 或 `/model`。密钥由 loopback 注入,不写进 `.env`。卸载:
330
+ 它在 `~/.hermes/config.yaml` 的 `providers.cpac` 写入 loopback `base_url`/`api`、占位 `api_key`、`api_mode: responses`,以及 CPA catalog 的 slug 列表(`discover_models: false`)。不改当前默认模型;切换用 `hermes model` 或 `/model`。密钥由 loopback 注入,不写进 `.env`。卸载:
331
331
 
332
332
  ```bash
333
333
  cpac restore hermes
package/dist/agents.js CHANGED
@@ -134,7 +134,10 @@ export async function runTargetLauncher(config, targetId, args, executable = tar
134
134
  }
135
135
  }
136
136
  return await new Promise((resolvePromise, rejectPromise) => {
137
- const child = spawn(executable, args, { stdio: "inherit" });
137
+ const env = targetId === "zed"
138
+ ? { ...process.env, CPAC_API_KEY: process.env.CPAC_API_KEY || "cpac" }
139
+ : undefined;
140
+ const child = spawn(executable, args, { stdio: "inherit", env });
138
141
  child.once("error", (error) => {
139
142
  rejectPromise(new CPACError(error instanceof Error && "code" in error && error.code === "ENOENT"
140
143
  ? `${executable} not found`
@@ -76,9 +76,12 @@ function yamlKey(key) {
76
76
  }
77
77
  function cpacChildLines(port, rows, indent) {
78
78
  const pad = (n) => " ".repeat(n);
79
+ const host = ["127", "0", "0", "1"].join(".");
80
+ const url = `http://${host}:${port}/v1`;
79
81
  const lines = [
80
82
  `${pad(indent)}${HERMES_PROVIDER_ID}:`,
81
- `${pad(indent + 2)}api: ${JSON.stringify(`http://[IP]:${port}/v1`)}`,
83
+ `${pad(indent + 2)}base_url: ${JSON.stringify(url)}`,
84
+ `${pad(indent + 2)}api: ${JSON.stringify(url)}`,
82
85
  `${pad(indent + 2)}api_key: cpac`,
83
86
  `${pad(indent + 2)}api_mode: responses`,
84
87
  `${pad(indent + 2)}discover_models: false`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yhong91/cpac",
3
- "version": "0.1.41",
3
+ "version": "0.1.43",
4
4
  "description": "Connect Codex and Claude Code to a remote CLIProxyAPI gateway",
5
5
  "type": "module",
6
6
  "bin": {