@axhub/acp 0.1.1 → 0.1.2-beta.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.
Files changed (40) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/fallback-build-manifest.json +3 -3
  4. package/.next/server/app/_global-error.html +1 -1
  5. package/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/server/app/_not-found.html +1 -1
  12. package/.next/server/app/_not-found.rsc +1 -1
  13. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  14. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  15. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  16. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  19. package/.next/server/app/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/thread/[threadId]/page_client-reference-manifest.js +1 -1
  21. package/.next/server/chunks/[root-of-the-server]__0aovkxs._.js +1 -1
  22. package/.next/server/chunks/[root-of-the-server]__0gmxr~m._.js +1 -1
  23. package/.next/server/chunks/[root-of-the-server]__0o2epta._.js +1 -1
  24. package/.next/server/chunks/[root-of-the-server]__0os92l7._.js +1 -1
  25. package/.next/server/chunks/[root-of-the-server]__13xepwb._.js +1 -1
  26. package/.next/server/chunks/ssr/_03.pm1z._.js +1 -1
  27. package/.next/server/middleware-build-manifest.js +3 -3
  28. package/.next/server/pages/404.html +1 -1
  29. package/.next/server/pages/500.html +1 -1
  30. package/.next/static/chunks/{0btc2281yau9i.js → 0r125n-._y5ny.js} +1 -1
  31. package/README.md +3 -3
  32. package/bin/acp.mjs +3 -51
  33. package/bin/defaults.mjs +3 -0
  34. package/dist/components/assistant-ui/acp-selectors.mjs +1 -3
  35. package/dist/lib/acp2aisdk/provider-registry.mjs +2 -5
  36. package/dist/lib/acp2aisdk/types.d.ts +0 -1
  37. package/package.json +6 -7
  38. /package/.next/static/{Kri5x_Y9TwyCw9FEY15ME → BmvWWgKyONAT48LROfviV}/_buildManifest.js +0 -0
  39. /package/.next/static/{Kri5x_Y9TwyCw9FEY15ME → BmvWWgKyONAT48LROfviV}/_clientMiddlewareManifest.js +0 -0
  40. /package/.next/static/{Kri5x_Y9TwyCw9FEY15ME → BmvWWgKyONAT48LROfviV}/_ssgManifest.js +0 -0
package/README.md CHANGED
@@ -19,7 +19,7 @@ npx -y @axhub/acp --port 32123
19
19
  npx -y @axhub/acp --cors-origin https://client.example.com
20
20
  ```
21
21
 
22
- `--cors-origin` configures the allowed browser Origin for `/api/*` routes. It also supports comma-separated origins and the aliases `--cors` and `--cor`.
22
+ By default the CLI allows `/api/*` CORS requests from `http://localhost:53817` and `http://127.0.0.1:53817`. `--cors-origin` replaces that default with another allowed browser Origin list. It also supports comma-separated origins and the aliases `--cors` and `--cor`.
23
23
 
24
24
  ### External Integration
25
25
 
@@ -54,10 +54,10 @@ pnpm dev
54
54
 
55
55
  Open [http://localhost:32123](http://localhost:32123) with your browser to see the result.
56
56
 
57
- `npm run dev` uses the local source checkout and runs `next dev`. For a local host app on another origin, pass the same CORS option through npm:
57
+ `npm run dev` uses the local source checkout and runs `next dev`. It allows the same default host-app origins on port `53817`. For a local host app on another origin, pass the CORS option through npm:
58
58
 
59
59
  ```bash
60
- npm run dev -- --cors-origin http://localhost:53817
60
+ npm run dev -- --cors-origin http://localhost:3000
61
61
  ```
62
62
 
63
63
  For the common local host-app setup, use the host-aware development command. It binds the ACP UI dev server on `0.0.0.0`, allows the usual host app origins on port `53817`, and also lets Next.js dev assets/HMR accept those origins:
package/bin/acp.mjs CHANGED
@@ -5,11 +5,11 @@ import { existsSync } from "node:fs";
5
5
  import { createRequire } from "node:module";
6
6
  import { dirname, join } from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
+ import { DEFAULT_CORS_ORIGINS, DEFAULT_PORT } from "./defaults.mjs";
8
9
 
9
10
  const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
10
11
  const launchCwd = process.cwd();
11
12
  const require = createRequire(import.meta.url);
12
- const DEFAULT_PORT = "32123";
13
13
 
14
14
  function printHelp() {
15
15
  console.log(`Usage: acp [options]
@@ -19,7 +19,7 @@ Start the ACP Web UI.
19
19
  Options:
20
20
  -p, --port <port> Port to listen on (default: ${DEFAULT_PORT})
21
21
  -H, --hostname <hostname> Hostname to bind (default: 0.0.0.0)
22
- --cors-origin <origin[,..]> Allowed CORS Origin for /api/* routes
22
+ --cors-origin <origin[,..]> Allowed CORS Origin for /api/* routes (default: ${DEFAULT_CORS_ORIGINS})
23
23
  --cors <origin[,..]> Alias for --cors-origin
24
24
  --cor <origin[,..]> Alias for --cors-origin
25
25
  -h, --help Show help
@@ -49,7 +49,7 @@ function parseArgs(args) {
49
49
  const options = {
50
50
  port: process.env.PORT || DEFAULT_PORT,
51
51
  hostname: process.env.HOSTNAME || "0.0.0.0",
52
- corsOrigins: process.env.ACP_UI_CORS_ORIGINS || "",
52
+ corsOrigins: process.env.ACP_UI_CORS_ORIGINS ?? DEFAULT_CORS_ORIGINS,
53
53
  };
54
54
 
55
55
  for (let index = 0; index < args.length; index += 1) {
@@ -92,10 +92,6 @@ function parseArgs(args) {
92
92
  return { help: false, options };
93
93
  }
94
94
 
95
- function quoteCommandArg(value) {
96
- return /[\s"']/u.test(value) ? `"${value.replace(/"/gu, '\\"')}"` : value;
97
- }
98
-
99
95
  function runtimeHostForUrl(hostname) {
100
96
  const normalized = String(hostname || "")
101
97
  .trim()
@@ -124,47 +120,6 @@ function buildServerRuntimeEnv(options) {
124
120
  };
125
121
  }
126
122
 
127
- function codexAcpCommandLine() {
128
- const codexAcpBin = require.resolve(
129
- "@zed-industries/codex-acp/bin/codex-acp.js",
130
- );
131
- return [process.execPath, codexAcpBin].map(quoteCommandArg).join(" ");
132
- }
133
-
134
- function isCodexProviderName(value) {
135
- const normalized = String(value || "")
136
- .trim()
137
- .toLowerCase();
138
- return normalized === "codex" || normalized === "openai";
139
- }
140
-
141
- function hasCodexCommandOverride(env) {
142
- if (env.ACP_CODEX_COMMAND?.trim()) return true;
143
-
144
- const rawJson =
145
- env.ACP_PROVIDER_COMMAND_OVERRIDES || env.AXHUB_ACP_COMMAND_OVERRIDES;
146
- if (!rawJson) return false;
147
-
148
- try {
149
- const parsed = JSON.parse(rawJson);
150
- if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
151
- return false;
152
- }
153
- for (const [providerName, value] of Object.entries(parsed)) {
154
- if (!isCodexProviderName(providerName)) continue;
155
- if (typeof value === "string") return Boolean(value.trim());
156
- if (!value || typeof value !== "object" || Array.isArray(value)) {
157
- continue;
158
- }
159
- return typeof value.command === "string" && Boolean(value.command.trim());
160
- }
161
- } catch {
162
- return false;
163
- }
164
-
165
- return false;
166
- }
167
-
168
123
  let parsed;
169
124
  try {
170
125
  parsed = parseArgs(process.argv.slice(2));
@@ -208,9 +163,6 @@ const child = spawn(process.execPath, [nextBin, ...nextArgs], {
208
163
  ACP_UI_DEFAULT_WORKSPACE_PATH:
209
164
  process.env.ACP_UI_DEFAULT_WORKSPACE_PATH || launchCwd,
210
165
  ...buildServerRuntimeEnv(parsed.options),
211
- ...(hasCodexCommandOverride(process.env)
212
- ? {}
213
- : { ACP_CODEX_COMMAND: codexAcpCommandLine() }),
214
166
  },
215
167
  stdio: "inherit",
216
168
  });
@@ -0,0 +1,3 @@
1
+ export const DEFAULT_PORT = "32123";
2
+ export const DEFAULT_CORS_ORIGINS =
3
+ "http://localhost:53817,http://127.0.0.1:53817";
@@ -32,9 +32,7 @@ function getOptionLabel(options, value) {
32
32
  const PROVIDER_OPTIONS = ACP_PROVIDER_KEYS.map((provider, index) => ({
33
33
  value: provider,
34
34
  label: ACP_PROVIDER_REGISTRY[provider].label,
35
- description: ACP_PROVIDER_REGISTRY[provider].enabledInP0
36
- ? "已验证"
37
- : "需本地 CLI/登录",
35
+ description: "需先安装并登录",
38
36
  order: index,
39
37
  }));
40
38
  function capabilityOptions(snapshot, key) {
@@ -22,15 +22,14 @@ export const ACP_PROVIDER_REGISTRY = {
22
22
  defaultModel: "sonnet",
23
23
  defaultModeId: ACP_PROVIDER_DEFAULT_MODE_IDS.claude,
24
24
  supportsImages: true,
25
- enabledInP0: false,
26
25
  },
27
26
  codex: {
28
27
  provider: "codex",
29
28
  label: "Codex",
30
- command: "./node_modules/.bin/codex-acp",
29
+ command: "npx",
30
+ args: ["-y", "@zed-industries/codex-acp@^0.15.0"],
31
31
  defaultModeId: ACP_PROVIDER_DEFAULT_MODE_IDS.codex,
32
32
  supportsImages: true,
33
- enabledInP0: true,
34
33
  },
35
34
  gemini: {
36
35
  provider: "gemini",
@@ -40,7 +39,6 @@ export const ACP_PROVIDER_REGISTRY = {
40
39
  defaultModel: "gemini-3-pro-preview",
41
40
  defaultModeId: ACP_PROVIDER_DEFAULT_MODE_IDS.gemini,
42
41
  supportsImages: false,
43
- enabledInP0: false,
44
42
  },
45
43
  opencode: {
46
44
  provider: "opencode",
@@ -50,7 +48,6 @@ export const ACP_PROVIDER_REGISTRY = {
50
48
  defaultModel: "opencode/big-pickle",
51
49
  defaultModeId: ACP_PROVIDER_DEFAULT_MODE_IDS.opencode,
52
50
  supportsImages: false,
53
- enabledInP0: false,
54
51
  },
55
52
  };
56
53
  export function isAcpProviderKey(value) {
@@ -19,7 +19,6 @@ export type AcpProviderRegistryEntry = {
19
19
  defaultModel?: string | null;
20
20
  defaultModeId?: string | null;
21
21
  supportsImages: boolean;
22
- enabledInP0: boolean;
23
22
  };
24
23
  export type AcpProviderOverride = Partial<Pick<AcpProviderRegistryEntry, "command" | "args" | "authMethodId" | "sessionDelayMs" | "persistSession" | "defaultModel" | "defaultModeId">>;
25
24
  export type AcpChatRequest = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axhub/acp",
3
- "version": "0.1.1",
3
+ "version": "0.1.2-beta.1",
4
4
  "private": false,
5
5
  "engines": {
6
6
  "node": ">=20.9.0"
@@ -44,7 +44,7 @@
44
44
  ],
45
45
  "scripts": {
46
46
  "dev": "node scripts/dev-server.mjs",
47
- "dev:host": "node scripts/dev-server.mjs --hostname 0.0.0.0 --cors-origin http://localhost:53817,http://127.0.0.1:53817",
47
+ "dev:host": "node scripts/dev-server.mjs --hostname 0.0.0.0",
48
48
  "build": "next build",
49
49
  "build:public-api": "node scripts/build-public-api.mjs",
50
50
  "build:sanitize": "node scripts/sanitize-next-build.mjs",
@@ -85,21 +85,20 @@
85
85
  "@radix-ui/react-dialog": "^1.1.15",
86
86
  "@radix-ui/react-slot": "^1.2.4",
87
87
  "@radix-ui/react-tooltip": "^1.2.8",
88
- "@zed-industries/codex-acp": "^0.15.0",
89
88
  "ai": "^6.0.188",
90
89
  "class-variance-authority": "^0.7.1",
91
90
  "clsx": "^2.1.1",
92
91
  "lucide-react": "^1.16.0",
93
92
  "next": "^16.2.6",
94
93
  "radix-ui": "^1.4.3",
95
- "react": "^19.2.6",
96
- "react-dom": "^19.2.6",
94
+ "react": ">=18.2.0 <20",
95
+ "react-dom": ">=18.2.0 <20",
97
96
  "remark-gfm": "^4.0.1",
98
97
  "tailwind-merge": "^3.6.0",
99
98
  "tw-animate-css": "^1.4.0",
100
99
  "tw-shimmer": "^0.4.11",
101
- "zustand": "^5.0.13",
102
- "zod": "^4.1.13"
100
+ "zod": "^4.1.13",
101
+ "zustand": "^5.0.13"
103
102
  },
104
103
  "peerDependencies": {
105
104
  "@assistant-ui/react": "^0.14.7",