paseo-agy-acp 2.3.2 → 2.4.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 (26) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +26 -12
  3. package/README.zh-CN.md +21 -11
  4. package/dist/ACP Connector/official-kernel/ensure-managed-kernel.d.ts +12 -0
  5. package/dist/ACP Connector/official-kernel/ensure-managed-kernel.js +204 -0
  6. package/dist/ACP Connector/official-kernel/ensure-managed-kernel.js.map +1 -0
  7. package/dist/ACP Connector/official-kernel/kernel-compat-lifecycle.js +13 -1
  8. package/dist/ACP Connector/official-kernel/kernel-compat-lifecycle.js.map +1 -1
  9. package/dist/ACP Connector/official-kernel/kernel-compat-pins.js +5 -5
  10. package/dist/ACP Connector/official-kernel/kernel-compat-pins.js.map +1 -1
  11. package/dist/ACP Connector/official-kernel/login.js +3 -1
  12. package/dist/ACP Connector/official-kernel/login.js.map +1 -1
  13. package/dist/ACP Connector/official-kernel/mcp-protocol-bridge.d.ts +9 -0
  14. package/dist/ACP Connector/official-kernel/mcp-protocol-bridge.js +194 -0
  15. package/dist/ACP Connector/official-kernel/mcp-protocol-bridge.js.map +1 -0
  16. package/dist/ACP Connector/official-kernel/mode-map.d.ts +1 -1
  17. package/dist/ACP Connector/official-kernel/mode-map.js +1 -1
  18. package/dist/ACP Connector/official-kernel/mode-map.js.map +1 -1
  19. package/dist/ACP Connector/official-kernel/proxy.js +3 -1
  20. package/dist/ACP Connector/official-kernel/proxy.js.map +1 -1
  21. package/dist/ACP Connector/official-kernel/run.js +3 -1
  22. package/dist/ACP Connector/official-kernel/run.js.map +1 -1
  23. package/dist/ACP Connector/official-kernel/spawn.js +1 -1
  24. package/dist/ACP Connector/official-kernel/spawn.js.map +1 -1
  25. package/package.json +1 -1
  26. package/scripts/prepare-official-kernel-compat.mjs +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,45 @@
2
2
 
3
3
  All notable changes to `paseo-agy-acp` are recorded here.
4
4
 
5
+ ## 2.4.1 - 2026-09-26
6
+
7
+ ### Fixed
8
+
9
+ - Forward the official kernel's MCP callback through a local bridge. The kernel
10
+ opens that callback with protocol date `2026-07-28`, and Paseo rejects that
11
+ date. The bridge presents `2025-11-25`, which both sides accept, on
12
+ `session/new`, `session/load`, and `session/resume`.
13
+
14
+ ### Verification
15
+
16
+ - Complete validation: 38 test files, 222 passed, 1 skipped; architecture and
17
+ secret checks passed. `session/new`, `session/load`, and `session/resume`
18
+ each hand the kernel a local bridge URL, and a `2026-07-28` initialize is
19
+ delivered upstream as `2025-11-25`.
20
+
21
+ ## 2.4.0 - 2026-09-25
22
+
23
+ ### Changed
24
+
25
+ - On first start, download the official Antigravity ACP 1.2.1 archive that
26
+ matches the current operating system. The npm package stores the official
27
+ URLs and does not contain the kernels. Linux x86_64 also installs the local
28
+ compatibility wrapper. A custom `PASEO_AGY_ACP_OFFICIAL_BIN` that is not a
29
+ managed path is left unchanged.
30
+ - Pin the official Antigravity ACP kernel to registry `antigravity-acp` 1.2.1.
31
+ The local compatibility markers stay the same: the CCPA proxy is unchanged,
32
+ and the Gemini-only catalog filter is still rewritten in place. `server.py`
33
+ stays unmodified.
34
+ - Activating a new pin generation replaces the active wrapper. The previous
35
+ generation stays on disk and is not a lifecycle rollback target.
36
+
37
+ ### Verification
38
+
39
+ - Hashes checked against the Linux x86_64 zip published 2026-09-23.
40
+ - Complete validation: 37 test files, 218 passed, 1 skipped; architecture and
41
+ secret checks passed. A live `session/new` on the 1.2.1 compatibility wrapper
42
+ returned Gemini 3.8 plus the entitled Claude and GPT-OSS ids.
43
+
5
44
  ## 2.3.2 - 2026-09-24
6
45
 
7
46
  ### Fixed
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  **Reliable Paseo adapter for Google's official Antigravity ACP kernel**
6
6
 
7
7
  [![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](./LICENSE)
8
- [![Version](https://img.shields.io/badge/version-2.3.2-blue?style=flat-square)](./package.json)
8
+ [![Version](https://img.shields.io/badge/version-2.4.1-blue?style=flat-square)](./package.json)
9
9
  [![npm](https://img.shields.io/npm/v/paseo-agy-acp?style=flat-square)](https://www.npmjs.com/package/paseo-agy-acp)
10
10
  [![Node](https://img.shields.io/badge/node-%3E%3D22-brightgreen?style=flat-square)](./package.json)
11
11
  [![ACP](https://img.shields.io/badge/ACP-NDJSON%20v1-8A2BE2?style=flat-square)](https://agentclientprotocol.com)
@@ -104,25 +104,27 @@ Paseo agents.
104
104
 
105
105
  - **Paseo** with Generic ACP provider support
106
106
  - **Node.js 22 or newer**
107
- - A locally installed official Antigravity ACP kernel wrapper or `.par`
108
107
  - An Antigravity account able to complete official `oauth-personal`
109
108
  - Linux filesystem ownership and mode support when Admission is enabled
110
109
 
111
- Set `PASEO_AGY_ACP_OFFICIAL_BIN` unless the kernel already exists at the
112
- maintainer-host default pin. If this variable points directly at a `.par`, the
113
- adapter starts it from its own directory and, on Linux, appends the official
114
- `--uid=` launch flag.
110
+ On first start the adapter downloads the official Antigravity ACP 1.2.1 archive
111
+ for the current operating system from Google. The npm package does not contain
112
+ those archives. Linux x86_64 also installs the local compatibility wrapper.
113
+ Leave `PASEO_AGY_ACP_OFFICIAL_BIN` unset, or keep it pointed at the managed
114
+ wrapper. A different existing path is used as-is.
115
115
 
116
116
  <!-- readme:quickstart -->
117
117
  ## Quickstart
118
118
 
119
- ### 1. Point to the official kernel and authenticate
119
+ ### 1. Authenticate
120
120
 
121
121
  ```bash
122
- export PASEO_AGY_ACP_OFFICIAL_BIN="/absolute/path/to/agy-acp-server-wrapper-or.par"
123
- npx -y paseo-agy-acp@2.3.2 --login
122
+ npx -y paseo-agy-acp@2.4.1 --login
124
123
  ```
125
124
 
125
+ The first run downloads and configures official kernel 1.2.1. That download is
126
+ about 320 MiB and stays under `~/.local/opt/`.
127
+
126
128
  OAuth is completed by the official kernel. Its tokens remain in the kernel's
127
129
  own state and are not printed by this adapter.
128
130
 
@@ -134,7 +136,7 @@ delegation.
134
136
  ```bash
135
137
  export AGY_ACP_STATE_DIR="$HOME/.local/state/paseo-agy-acp/account-name"
136
138
  install -d -m 700 "$AGY_ACP_STATE_DIR"
137
- npx -y --package=paseo-agy-acp@2.3.2 \
139
+ npx -y --package=paseo-agy-acp@2.4.1 \
138
140
  agy-acp-prepare-state "$AGY_ACP_STATE_DIR"
139
141
  ```
140
142
 
@@ -151,9 +153,8 @@ Add or update the provider in `$PASEO_HOME/config.json` or
151
153
  "providers": {
152
154
  "antigravity": {
153
155
  "type": "acp",
154
- "command": ["npx", "-y", "paseo-agy-acp@2.3.2"],
156
+ "command": ["npx", "-y", "paseo-agy-acp@2.4.1"],
155
157
  "env": {
156
- "PASEO_AGY_ACP_OFFICIAL_BIN": "/absolute/path/to/agy-acp-server-wrapper-or.par",
157
158
  "AGY_ACP_ADMISSION_ENABLED": "true",
158
159
  "AGY_ACP_STATE_DIR": "/home/YOU/.local/state/paseo-agy-acp/account-name"
159
160
  }
@@ -196,6 +197,15 @@ policy-change procedures are in [Admission operations](docs/operations/admission
196
197
  | `dangerously-skip-permissions` | `yolo` |
197
198
  | `plan` | `default` (the official kernel has no plan mode) |
198
199
 
200
+ Official `yolo` and Paseo's Auto Accept (`features.auto_accept`) are
201
+ separate switches. An unanswered `session/request_permission` keeps
202
+ `session/prompt` open, so the agent can stay `running` after assistant
203
+ text is already visible. For unattended work, enable Auto Accept or
204
+ approve with `paseo permit ls` / `paseo permit allow`, and use `yolo`
205
+ when you also want the kernel to skip tool confirmation. This adapter
206
+ does not treat displayed text as `end_turn`. See
207
+ [#11](https://github.com/tiezbro/paseo-agy-acp/issues/11).
208
+
199
209
  `PASEO_AGY_ACP_KERNEL=legacy` and `--legacy-kernel` fail closed. The official
200
210
  kernel is the only execution path.
201
211
 
@@ -216,6 +226,10 @@ usable name and description.
216
226
  - Restart Paseo after changing provider command, environment, or kernel path.
217
227
  - Enabled Admission with missing identity, unsafe state permissions, or invalid
218
228
  policy refuses to start instead of silently running unfenced.
229
+ - A turn that stays `running` after visible assistant output is often a
230
+ pending permission card, not a missing kernel completion. Check Auto Accept
231
+ and `paseo permit ls`. Paseo's `Worked for …` duration is wall-clock and
232
+ includes those waits.
219
233
  - Tool quality, image generation, backend quota, and provider error text remain
220
234
  owned by the official kernel and Google backend.
221
235
  - For reproducible upgrades or rollback, pin a three-part npm version in the
package/README.zh-CN.md CHANGED
@@ -5,7 +5,7 @@
5
5
  **Google 官方 Antigravity ACP 内核面向 Paseo 的可靠产品适配器**
6
6
 
7
7
  [![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](./LICENSE)
8
- [![Version](https://img.shields.io/badge/version-2.3.2-blue?style=flat-square)](./package.json)
8
+ [![Version](https://img.shields.io/badge/version-2.4.1-blue?style=flat-square)](./package.json)
9
9
  [![npm](https://img.shields.io/npm/v/paseo-agy-acp?style=flat-square)](https://www.npmjs.com/package/paseo-agy-acp)
10
10
  [![Node](https://img.shields.io/badge/node-%3E%3D22-brightgreen?style=flat-square)](./package.json)
11
11
  [![ACP](https://img.shields.io/badge/ACP-NDJSON%20v1-8A2BE2?style=flat-square)](https://agentclientprotocol.com)
@@ -93,24 +93,25 @@ Antigravity 账号服务多个并发 Paseo agent 时建议启用。
93
93
 
94
94
  - 支持 Generic ACP provider 的 **Paseo**
95
95
  - **Node.js 22 或更新版本**
96
- - 本机已安装的官方 Antigravity ACP kernel wrapper 或 `.par`
97
96
  - 可以完成官方 `oauth-personal` 的 Antigravity 账号
98
97
  - 启用 Admission 时,系统需支持 Linux 文件 owner 与 mode
99
98
 
100
- 除非官方内核已经位于维护者主机默认 pin 路径,否则必须设置
101
- `PASEO_AGY_ACP_OFFICIAL_BIN`。若它直接指向 `.par`,适配器会从该文件所在目录
102
- 启动,并仅在 Linux 上附加官方 `--uid=` 启动参数。
99
+ 首次启动时,适配器按当前操作系统从 Google 下载对应的官方 Antigravity ACP 1.2.1
100
+ 包。npm 包本身不包含这些内核。Linux x86_64 还会装上本机兼容包装器。
101
+ `PASEO_AGY_ACP_OFFICIAL_BIN` 留空,或继续指向托管包装器即可。指向其他已存在路径时,
102
+ 按该路径启动。
103
103
 
104
104
  <!-- readme:quickstart -->
105
105
  ## 快速开始
106
106
 
107
- ### 1. 指定官方内核并完成认证
107
+ ### 1. 完成认证
108
108
 
109
109
  ```bash
110
- export PASEO_AGY_ACP_OFFICIAL_BIN="/absolute/path/to/agy-acp-server-wrapper-or.par"
111
- npx -y paseo-agy-acp@2.3.2 --login
110
+ npx -y paseo-agy-acp@2.4.1 --login
112
111
  ```
113
112
 
113
+ 第一次运行会下载并配置官方内核 1.2.1。下载约 320 MiB,放在 `~/.local/opt/`。
114
+
114
115
  OAuth 由官方内核完成。Token 保留在内核自己的状态中,本适配器不会打印。
115
116
 
116
117
  ### 2. 准备 Admission 状态
@@ -120,7 +121,7 @@ OAuth 由官方内核完成。Token 保留在内核自己的状态中,本适
120
121
  ```bash
121
122
  export AGY_ACP_STATE_DIR="$HOME/.local/state/paseo-agy-acp/account-name"
122
123
  install -d -m 700 "$AGY_ACP_STATE_DIR"
123
- npx -y --package=paseo-agy-acp@2.3.2 \
124
+ npx -y --package=paseo-agy-acp@2.4.1 \
124
125
  agy-acp-prepare-state "$AGY_ACP_STATE_DIR"
125
126
  ```
126
127
 
@@ -136,9 +137,8 @@ npx -y --package=paseo-agy-acp@2.3.2 \
136
137
  "providers": {
137
138
  "antigravity": {
138
139
  "type": "acp",
139
- "command": ["npx", "-y", "paseo-agy-acp@2.3.2"],
140
+ "command": ["npx", "-y", "paseo-agy-acp@2.4.1"],
140
141
  "env": {
141
- "PASEO_AGY_ACP_OFFICIAL_BIN": "/absolute/path/to/agy-acp-server-wrapper-or.par",
142
142
  "AGY_ACP_ADMISSION_ENABLED": "true",
143
143
  "AGY_ACP_STATE_DIR": "/home/YOU/.local/state/paseo-agy-acp/account-name"
144
144
  }
@@ -180,6 +180,13 @@ Paseo 会向 provider 进程提供 `PASEO_AGENT_ID` 和 `PASEO_AGENT_CWD`。只
180
180
  | `dangerously-skip-permissions` | `yolo` |
181
181
  | `plan` | `default`(官方内核没有 plan mode) |
182
182
 
183
+ 官方 `yolo` 与 Paseo 的 Auto Accept(`features.auto_accept`)是两套独立开关。
184
+ 未应答的 `session/request_permission` 会让 `session/prompt` 一直保持打开,
185
+ 因此即使 assistant 文本已经可见,agent 仍可能保持 `running`。无人值守运行时,
186
+ 请打开 Auto Accept,或用 `paseo permit ls` / `paseo permit allow` 批准,
187
+ 并在需要内核跳过工具确认时使用 `yolo`。本适配器不会把已显示的文本当成
188
+ `end_turn`。见 [#11](https://github.com/tiezbro/paseo-agy-acp/issues/11)。
189
+
183
190
  `PASEO_AGY_ACP_KERNEL=legacy` 和 `--legacy-kernel` 会 fail closed。官方内核是唯一
184
191
  执行路径。
185
192
 
@@ -198,6 +205,9 @@ Agents/Codex 目录和全局 Gemini/Agents/Codex 目录。每个 skill 目录需
198
205
  - 修改 provider command、环境变量或内核路径后要重启 Paseo。
199
206
  - 已启用 Admission 但 identity 缺失、状态权限不安全或 policy 非法时,系统拒绝启动,
200
207
  不会静默变成 unfenced 运行。
208
+ - assistant 文本已经可见但 turn 仍 `running`,通常是未处理的权限卡片,而不是内核
209
+ 丢失完成态。检查 Auto Accept 和 `paseo permit ls`。Paseo 的 `Worked for …`
210
+ 是墙钟时间,权限等待也会计入。
201
211
  - 工具质量、生图、backend 配额与 provider 错误文案仍由官方内核和 Google backend
202
212
  负责。
203
213
  - 可复现升级或回滚应在 provider command 中固定三段 npm 版本,然后重启 Paseo。
@@ -0,0 +1,12 @@
1
+ export interface OfficialKernelDownload {
2
+ readonly id: string;
3
+ readonly url: string;
4
+ readonly binaryName: string;
5
+ readonly compat: boolean;
6
+ }
7
+ export declare function officialKernelDownload(platform?: NodeJS.Platform, arch?: string): OfficialKernelDownload;
8
+ export declare function managedOfficialKernelRoot(home?: string): string;
9
+ export declare function managedCompatRoot(home?: string): string;
10
+ export declare function managedStableWrapper(home?: string): string;
11
+ export declare function usesManagedOfficialKernel(configured: string | undefined, home?: string): boolean;
12
+ export declare function ensureManagedOfficialKernel(environment?: NodeJS.ProcessEnv): Promise<string>;
@@ -0,0 +1,204 @@
1
+ import { createHash } from "node:crypto";
2
+ import { spawnSync } from "node:child_process";
3
+ import { chmodSync, existsSync, mkdirSync, renameSync } from "node:fs";
4
+ import { homedir } from "node:os";
5
+ import path from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
+ import { OfficialKernelCompatLifecycle } from "./kernel-compat-lifecycle.js";
8
+ import { PRODUCTION_KERNEL_COMPAT_PINS } from "./kernel-compat-pins.js";
9
+ import { RC01_KERNEL_COMPAT_PATCH_PLAN } from "./kernel-compat-rc01-recipe.js";
10
+ const MANAGED_ARTIFACT_PREFIX = "1.2.1-adbf34295671-";
11
+ const OFFICIAL_KERNEL_DOWNLOADS = Object.freeze({
12
+ "linux-x64": Object.freeze({
13
+ id: "linux-x64",
14
+ url: "https://dl.google.com/agy-extensions/releases/linux/agy-acp-server-1.2.1-linux-x86_64.zip",
15
+ binaryName: "agy_acp_server.par",
16
+ compat: true
17
+ }),
18
+ "linux-arm64": Object.freeze({
19
+ id: "linux-arm64",
20
+ url: "https://dl.google.com/agy-extensions/releases/linux/agy-acp-server-1.2.1-linux-arm64.zip",
21
+ binaryName: "agy_acp_server.par",
22
+ compat: false
23
+ }),
24
+ "darwin-arm64": Object.freeze({
25
+ id: "darwin-arm64",
26
+ url: "https://dl.google.com/agy-extensions/releases/macos/agy-acp-server-1.2.1-darwin-arm64.zip",
27
+ binaryName: "agy_acp_server.par",
28
+ compat: false
29
+ }),
30
+ "darwin-x64": Object.freeze({
31
+ id: "darwin-x64",
32
+ url: "https://dl.google.com/agy-extensions/releases/macos/agy-acp-server-1.2.1-darwin-x86_64.zip",
33
+ binaryName: "agy_acp_server.par",
34
+ compat: false
35
+ }),
36
+ "win32-x64": Object.freeze({
37
+ id: "win32-x64",
38
+ url: "https://dl.google.com/agy-extensions/releases/windows/agy-acp-server-1.2.1-windows-x86_64.zip",
39
+ binaryName: "agy_acp_server.exe",
40
+ compat: false
41
+ }),
42
+ "win32-arm64": Object.freeze({
43
+ id: "win32-arm64",
44
+ url: "https://dl.google.com/agy-extensions/releases/windows/agy-acp-server-1.2.1-windows-arm64.zip",
45
+ binaryName: "agy_acp_server.exe",
46
+ compat: false
47
+ })
48
+ });
49
+ export function officialKernelDownload(platform = process.platform, arch = process.arch) {
50
+ const download = OFFICIAL_KERNEL_DOWNLOADS[`${platform}-${arch}`];
51
+ if (download === undefined) {
52
+ throw new Error(`no official Antigravity ACP 1.2.1 download for ${platform} ${arch}`);
53
+ }
54
+ return download;
55
+ }
56
+ export function managedOfficialKernelRoot(home = homedir()) {
57
+ return path.join(home, ".local", "opt", "agy-acp-server-1.2.1");
58
+ }
59
+ export function managedCompatRoot(home = homedir()) {
60
+ return path.join(home, ".local", "opt", "paseo-agy-acp-kernel-compat");
61
+ }
62
+ export function managedStableWrapper(home = homedir()) {
63
+ return path.join(managedCompatRoot(home), "agy-acp-kernel-compat-active");
64
+ }
65
+ export function usesManagedOfficialKernel(configured, home = homedir()) {
66
+ const value = configured?.trim() ?? "";
67
+ if (value.length === 0)
68
+ return true;
69
+ const normalized = path.resolve(value);
70
+ const managed = [
71
+ managedStableWrapper(home),
72
+ path.join(managedOfficialKernelRoot(home), "agy-acp-server-canary"),
73
+ path.join(home, ".local", "opt", "agy-acp-server-agy_acp_server_20260818_01_RC01", "agy-acp-server-canary")
74
+ ];
75
+ return managed.includes(normalized);
76
+ }
77
+ export async function ensureManagedOfficialKernel(environment = process.env) {
78
+ const configured = environment.PASEO_AGY_ACP_OFFICIAL_BIN?.trim();
79
+ if (!usesManagedOfficialKernel(configured))
80
+ return configured ?? "";
81
+ const download = officialKernelDownload();
82
+ const home = environment.HOME?.trim() || homedir();
83
+ const officialRoot = managedOfficialKernelRoot(home);
84
+ if (download.compat) {
85
+ const wrapper = managedStableWrapper(home);
86
+ if (await currentManagedWrapper(home))
87
+ return wrapper;
88
+ await ensureOfficialPayload(officialRoot, download);
89
+ const lifecycle = new OfficialKernelCompatLifecycle({ stateRoot: managedCompatRoot(home) });
90
+ const prepared = await lifecycle.prepare({
91
+ parPath: path.join(officialRoot, download.binaryName),
92
+ externalHarnessPath: path.join(officialRoot, "localharness_external"),
93
+ compatModulePath: compatModulePath(),
94
+ patchPlan: RC01_KERNEL_COMPAT_PATCH_PLAN
95
+ });
96
+ await lifecycle.activate(prepared.artifactId);
97
+ process.stderr.write(`paseo-agy-acp is using the managed 1.2.1 kernel at ${wrapper}\n`);
98
+ return wrapper;
99
+ }
100
+ return ensureStockOfficialBinary(officialRoot, download);
101
+ }
102
+ async function currentManagedWrapper(home) {
103
+ const lifecycle = new OfficialKernelCompatLifecycle({ stateRoot: managedCompatRoot(home) });
104
+ try {
105
+ const status = await lifecycle.status();
106
+ return status.current?.verified === true && status.current.artifactId.startsWith(MANAGED_ARTIFACT_PREFIX) && existsSync(managedStableWrapper(home));
107
+ }
108
+ catch {
109
+ return false;
110
+ }
111
+ }
112
+ async function ensureStockOfficialBinary(root, download) {
113
+ const binaryPath = path.join(root, download.binaryName);
114
+ if (!existsSync(binaryPath))
115
+ await ensureOfficialPayload(root, download);
116
+ process.stderr.write(`paseo-agy-acp is using the official 1.2.1 kernel at ${binaryPath}\n`);
117
+ return binaryPath;
118
+ }
119
+ async function ensureOfficialPayload(root, download) {
120
+ mkdirSync(root, { recursive: true, mode: 0o755 });
121
+ const binaryPath = path.join(root, download.binaryName);
122
+ const harnessPath = path.join(root, "localharness_external");
123
+ if (download.compat && existsSync(binaryPath) && existsSync(harnessPath)) {
124
+ if ((await sha256File(binaryPath)) === PRODUCTION_KERNEL_COMPAT_PINS.parSha256 &&
125
+ (await sha256File(harnessPath)) === PRODUCTION_KERNEL_COMPAT_PINS.externalHarnessSha256) {
126
+ return;
127
+ }
128
+ }
129
+ else if (!download.compat && existsSync(binaryPath)) {
130
+ return;
131
+ }
132
+ const zipPath = path.join(root, "agy-acp-server.zip.partial");
133
+ process.stderr.write(`Downloading the official Antigravity ACP kernel 1.2.1 for ${download.id}\n${download.url}\n`);
134
+ await downloadFile(download.url, zipPath);
135
+ const finalZip = path.join(root, "agy-acp-server.zip");
136
+ renameSync(zipPath, finalZip);
137
+ extractZip(finalZip, root);
138
+ if (process.platform !== "win32") {
139
+ chmodSync(binaryPath, 0o755);
140
+ if (existsSync(harnessPath))
141
+ chmodSync(harnessPath, 0o755);
142
+ }
143
+ if (download.compat) {
144
+ const wrapper = path.join(root, "agy-acp-server-canary");
145
+ await writeFileText(wrapper, "#!/bin/bash\nset -euo pipefail\ncd \"$(dirname \"$(readlink -f \"$0\")\")\"\nexec ./agy_acp_server.par --uid= \"$@\"\n");
146
+ chmodSync(wrapper, 0o755);
147
+ }
148
+ }
149
+ function extractZip(zipPath, root) {
150
+ const extracted = process.platform === "win32"
151
+ ? spawnSync("powershell.exe", ["-NoProfile", "-Command", `Expand-Archive -Force -LiteralPath '${zipPath}' -DestinationPath '${root}'`], { stdio: "inherit" })
152
+ : spawnSync("python3", ["-c", "import sys, zipfile; zipfile.ZipFile(sys.argv[1]).extractall(sys.argv[2])", zipPath, root], { stdio: "inherit" });
153
+ if (extracted.status !== 0)
154
+ throw new Error("official kernel archive could not be extracted");
155
+ }
156
+ function compatModulePath() {
157
+ let directory = path.dirname(fileURLToPath(import.meta.url));
158
+ for (let depth = 0; depth < 6; depth += 1) {
159
+ const candidate = path.join(directory, "assets", "official-kernel-compat", "rc01", "paseo_model_compat.py");
160
+ if (existsSync(candidate))
161
+ return candidate;
162
+ directory = path.dirname(directory);
163
+ }
164
+ throw new Error("bundled kernel compatibility module is missing from the package");
165
+ }
166
+ async function downloadFile(url, destination) {
167
+ const response = await fetch(url);
168
+ if (!response.ok || response.body === null)
169
+ throw new Error(`official kernel download failed with HTTP ${response.status}`);
170
+ const { open } = await import("node:fs/promises");
171
+ const handle = await open(destination, "w", 0o644);
172
+ try {
173
+ const reader = response.body.getReader();
174
+ while (true) {
175
+ const { done, value } = await reader.read();
176
+ if (done)
177
+ return;
178
+ if (value !== undefined)
179
+ await handle.write(value);
180
+ }
181
+ }
182
+ finally {
183
+ await handle.close();
184
+ }
185
+ }
186
+ async function sha256File(filePath) {
187
+ const { open } = await import("node:fs/promises");
188
+ const handle = await open(filePath, "r");
189
+ try {
190
+ const hash = createHash("sha256");
191
+ const stream = handle.createReadStream();
192
+ for await (const chunk of stream)
193
+ hash.update(chunk);
194
+ return hash.digest("hex");
195
+ }
196
+ finally {
197
+ await handle.close();
198
+ }
199
+ }
200
+ async function writeFileText(filePath, contents) {
201
+ const { writeFile } = await import("node:fs/promises");
202
+ await writeFile(filePath, contents, { mode: 0o755 });
203
+ }
204
+ //# sourceMappingURL=ensure-managed-kernel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensure-managed-kernel.js","sourceRoot":"","sources":["../../../ACP Connector/official-kernel/ensure-managed-kernel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAE/E,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAStD,MAAM,yBAAyB,GAAqD,MAAM,CAAC,MAAM,CAAC;IAChG,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC;QACzB,EAAE,EAAE,WAAW;QACf,GAA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,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AACvD,CAAC"}
@@ -88,7 +88,7 @@ export class OfficialKernelCompatLifecycle {
88
88
  return withWriterLock(this.#stateRoot, uid, this.#clock, () => {
89
89
  const selected = verifyRelease(releasePathFor(this.#stateRoot, selectedArtifactId, uid), this.#pins, this.#pinDigest, uid);
90
90
  ensureStableActivationWrapper(this.#stateRoot, this.#pinDigest, uid);
91
- const active = readActiveState(this.#stateRoot, uid, this.#pinDigest);
91
+ const active = readActiveStateForActivation(this.#stateRoot, uid, this.#pinDigest);
92
92
  if (active?.currentArtifactId === selectedArtifactId) {
93
93
  return {
94
94
  changed: false,
@@ -1533,6 +1533,18 @@ function readActiveState(root, uid, expectedPinDigest) {
1533
1533
  }
1534
1534
  return state;
1535
1535
  }
1536
+ function readActiveStateForActivation(root, uid, expectedPinDigest) {
1537
+ try {
1538
+ return readActiveState(root, uid, expectedPinDigest);
1539
+ }
1540
+ catch (error) {
1541
+ if (error instanceof KernelCompatLifecycleError &&
1542
+ error.message === "active compatibility state uses stale or unknown kernel compatibility pins") {
1543
+ return undefined;
1544
+ }
1545
+ throw error;
1546
+ }
1547
+ }
1536
1548
  function readActiveStateReference(root, uid) {
1537
1549
  const referencePath = path.join(root, ACTIVE_REFERENCE);
1538
1550
  const linkStat = tryLstat(referencePath);