@bigduu/bamboo-agent 2026.11.56 → 2026.12.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/README.md CHANGED
@@ -5,12 +5,13 @@ Install the Bamboo CLI with Node.js 22.14 or newer.
5
5
  ~~~sh
6
6
  npm install --global @bigduu/bamboo-agent
7
7
  bamboo --version
8
+ bamboo serve
8
9
  ~~~
9
10
 
10
- The first invocation downloads the corresponding executable from the exact
11
- version of the official GitHub Release. The launcher verifies its size and
12
- SHA-256 against the included manifest and stores it in the per-user cache.
13
- Subsequent invocations verify and use the cached executable.
11
+ npm installs the same-version native package for your system and architecture.
12
+ Leave optional dependencies enabled so npm can select it. The launcher verifies
13
+ the installed executable's size and SHA-256 against the included release
14
+ manifest. The installed CLI and server start without downloading any program.
14
15
 
15
16
  Bamboo supports macOS ARM64, Linux x64 and ARM64, and Windows x64 and ARM64.
16
17
  The Linux binaries use the GNU runtime. The package includes the Release's
@@ -0,0 +1,63 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "version": "2026.12.1",
4
+ "sourceRevision": "1cf4477328119934045c0f865881ef0a65fc64d1",
5
+ "bambooManifestSha256": "8d6fb4f513ecdafa147a5924a45743d7acb395ed46f40097a12770e96883e7fd",
6
+ "artifacts": {
7
+ "aarch64-apple-darwin": {
8
+ "executable": {
9
+ "sha256": "7ae348e124db4b20d0e024ee5dad1650f238235f47498455c9db7fda472f7244",
10
+ "sizeBytes": 97586169
11
+ },
12
+ "browserRuntime": {
13
+ "sha256": "90436bf20babf5c00d42bcee0a36f31b6cc8b738f106fb6ff7d1a815c5f591ca",
14
+ "sizeBytes": 134683227
15
+ },
16
+ "browserReceipt": "ewogICJzY2hlbWFWZXJzaW9uIjogMSwKICAidGFyZ2V0IjogImFhcmNoNjQtYXBwbGUtZGFyd2luIiwKICAic291cmNlUmV2aXNpb24iOiAiMWNmNDQ3NzMyODExOTkzNDA0NWMwZjg2NTg4MWVmMGE2NWZjNjRkMSIsCiAgIm5vZGVWZXJzaW9uIjogIjI0LjIxLjAiLAogICJwbGF5d3JpZ2h0Q29yZVZlcnNpb24iOiAiMS42Mi4xIiwKICAiY2hyb21pdW1WZXJzaW9uIjogIjE1MS4wLjc5MjIuMzQiLAogICJjaHJvbWl1bVJldmlzaW9uIjogIjEyMzQiLAogICJub2RlQXJjaGl2ZVNoYTI1NiI6ICJiZWQ3ZWVhNTMyNWUxMTA4ZjMyY2U1MjI4ZGRkNmE1ZjBmMDhhNDk5ZWU0MmFhNzQ0MmFlYTU4MzcwMmY2MDU3IiwKICAiYnJvd3NlckFyY2hpdmVTaGEyNTYiOiAiY2I0NmEzMzZkYmUzZDZmMTMzOWM1MDM5YzMwODNlNGU1ZGQ4ZTQzNzk3MTA3OTBlMzRmOGY0YTg2NWUyNDUyZCIsCiAgInNpZ25pbmdJZGVudGl0eSI6IG51bGwsCiAgImhvc3RTaGEyNTYiOiAiZWE0ZDU1OTZmODc2OTY4MzljMDRlNDE3NDllODIzYmE4YzEyZGRmMWE5MzFmZGVhMjBhYTk3NWY3YTJkOWQ3ZCIsCiAgInBhY2thZ2VMb2NrU2hhMjU2IjogImEyMjkxZDMyZmNjMGVlOTQ4MGY2ZDYzNDlkNGFhZmMwMTkwZjJjNTI3Y2ZkODIwM2M5YmQwMWU2MGM5ZTRkYjAiLAogICJmaWxlc1NoYTI1NiI6ICI0MWE2Mzk1ZTcyZTA3ZGU5MDQxYWJiZjVhYjBmZWVkMGMwYzg2N2YzYzBjYzBkZGI0NGZmNGIwNDFkMWVhZjUwIgp9Cg=="
17
+ },
18
+ "aarch64-unknown-linux-gnu": {
19
+ "executable": {
20
+ "sha256": "04eef7db00d1086561d1fd53a004a12943733cc3b4c05493797ee73def295759",
21
+ "sizeBytes": 107591793
22
+ },
23
+ "browserRuntime": {
24
+ "sha256": "e01df7f28b67dfdbb92f8dcbf2b7284fdb860e6f779099e2f9bd374bb130144b",
25
+ "sizeBytes": 163046805
26
+ },
27
+ "browserReceipt": "ewogICJzY2hlbWFWZXJzaW9uIjogMSwKICAidGFyZ2V0IjogImFhcmNoNjQtdW5rbm93bi1saW51eC1nbnUiLAogICJzb3VyY2VSZXZpc2lvbiI6ICIxY2Y0NDc3MzI4MTE5OTM0MDQ1YzBmODY1ODgxZWYwYTY1ZmM2NGQxIiwKICAibm9kZVZlcnNpb24iOiAiMjQuMjEuMCIsCiAgInBsYXl3cmlnaHRDb3JlVmVyc2lvbiI6ICIxLjYyLjEiLAogICJjaHJvbWl1bVZlcnNpb24iOiAiMTUxLjAuNzkyMi4zNCIsCiAgImNocm9taXVtUmV2aXNpb24iOiAiMTIzNCIsCiAgIm5vZGVBcmNoaXZlU2hhMjU2IjogIjcyNDI4MmMzYjQzYWVjOTk4YWE5NTI3MzgwNDY1YjQ1ZDIyOWUwMjFiNTgwMzVmNWY0ZjYzMDk1ZWFiZmU1ZDUiLAogICJicm93c2VyQXJjaGl2ZVNoYTI1NiI6ICJiMDM0NDNlMWUxYTYwZDA2ZTA3YjZjZGZlNjUwYjhjMmJmY2JiM2RiNDk3ZDJiNjUyZjczZGM2OTEyZjRhZTE1IiwKICAic2lnbmluZ0lkZW50aXR5IjogbnVsbCwKICAiaG9zdFNoYTI1NiI6ICJlYTRkNTU5NmY4NzY5NjgzOWMwNGU0MTc0OWU4MjNiYThjMTJkZGYxYTkzMWZkZWEyMGFhOTc1ZjdhMmQ5ZDdkIiwKICAicGFja2FnZUxvY2tTaGEyNTYiOiAiYTIyOTFkMzJmY2MwZWU5NDgwZjZkNjM0OWQ0YWFmYzAxOTBmMmM1MjdjZmQ4MjAzYzliZDAxZTYwYzllNGRiMCIsCiAgImZpbGVzU2hhMjU2IjogIjlhMmVkOGEwYThiYzBmMGZiZjY3MWZjMzEzNDM5MTRlZThiMGJjNWZkOTdhMGI0ZGNhODg5YjcwMDVjMzA3MDUiCn0K"
28
+ },
29
+ "x86_64-unknown-linux-gnu": {
30
+ "executable": {
31
+ "sha256": "6b43b578cb06322a14ff623b9013d62e7f8c281ae39aca8eab60b70651027797",
32
+ "sizeBytes": 104873901
33
+ },
34
+ "browserRuntime": {
35
+ "sha256": "fe22505b34a44ae475bc7bff09a2599a8efab14abe55592791fbe180323936c4",
36
+ "sizeBytes": 156022844
37
+ },
38
+ "browserReceipt": "ewogICJzY2hlbWFWZXJzaW9uIjogMSwKICAidGFyZ2V0IjogIng4Nl82NC11bmtub3duLWxpbnV4LWdudSIsCiAgInNvdXJjZVJldmlzaW9uIjogIjFjZjQ0NzczMjgxMTk5MzQwNDVjMGY4NjU4ODFlZjBhNjVmYzY0ZDEiLAogICJub2RlVmVyc2lvbiI6ICIyNC4yMS4wIiwKICAicGxheXdyaWdodENvcmVWZXJzaW9uIjogIjEuNjIuMSIsCiAgImNocm9taXVtVmVyc2lvbiI6ICIxNTEuMC43OTIyLjM0IiwKICAiY2hyb21pdW1SZXZpc2lvbiI6ICIxMjM0IiwKICAibm9kZUFyY2hpdmVTaGEyNTYiOiAiNmUxZGI4N2VmNThiODgxOWU1ZDU0MDJlZmYxNTM2NDkxYjE4ZWRkOGViN2JlZTVlZjc4OTc4NzZlODhkYzVmZiIsCiAgImJyb3dzZXJBcmNoaXZlU2hhMjU2IjogIjNjZmMyYmQwMGQxYmFmY2Y4YTY4ZGM3NGM5YzkyYmI3MTUwZGRjOGQyNmFkZTk0OGE3NzYzMTZlMWNlYzRmMTQiLAogICJzaWduaW5nSWRlbnRpdHkiOiBudWxsLAogICJob3N0U2hhMjU2IjogImVhNGQ1NTk2Zjg3Njk2ODM5YzA0ZTQxNzQ5ZTgyM2JhOGMxMmRkZjFhOTMxZmRlYTIwYWE5NzVmN2EyZDlkN2QiLAogICJwYWNrYWdlTG9ja1NoYTI1NiI6ICJhMjI5MWQzMmZjYzBlZTk0ODBmNmQ2MzQ5ZDRhYWZjMDE5MGYyYzUyN2NmZDgyMDNjOWJkMDFlNjBjOWU0ZGIwIiwKICAiZmlsZXNTaGEyNTYiOiAiODQxZGVhYjg1NDk4NDg4ZmMzNTliZjJmNDhkYmI3YTNjMjNjOTg3ZDFhNzkxMjkxMmE4Y2I5NzVjNWZkYWQ5NCIKfQo="
39
+ },
40
+ "aarch64-pc-windows-msvc": {
41
+ "executable": {
42
+ "sha256": "abe03447d32ed0dfbcc83b6084b37f33abeaf50403957cf91f1147f332588562",
43
+ "sizeBytes": 89335084
44
+ },
45
+ "browserRuntime": {
46
+ "sha256": "e637b29c4870a5a51965a37aada5d5c98fab3afa5caf3d651a0555d79478d6dd",
47
+ "sizeBytes": 153779115
48
+ },
49
+ "browserReceipt": "ewogICJzY2hlbWFWZXJzaW9uIjogMSwKICAidGFyZ2V0IjogImFhcmNoNjQtcGMtd2luZG93cy1tc3ZjIiwKICAic291cmNlUmV2aXNpb24iOiAiMWNmNDQ3NzMyODExOTkzNDA0NWMwZjg2NTg4MWVmMGE2NWZjNjRkMSIsCiAgIm5vZGVWZXJzaW9uIjogIjI0LjIxLjAiLAogICJwbGF5d3JpZ2h0Q29yZVZlcnNpb24iOiAiMS42Mi4xIiwKICAiY2hyb21pdW1WZXJzaW9uIjogIjE1MS4wLjc5MjIuMzQiLAogICJjaHJvbWl1bVJldmlzaW9uIjogIjEyMzQiLAogICJub2RlQXJjaGl2ZVNoYTI1NiI6ICI4Nzc5YjFiZGUxZDM5ZjhkNDIwZTNiNTdhYTY1N2IzOTg5MWFmNDM0ZDNkZTQ0YTkxOTA0NGNlYzA2Nzg1OTIxIiwKICAiYnJvd3NlckFyY2hpdmVTaGEyNTYiOiAiNDZjYzY5ZWY1NWJhMjkyNjhmZmUzMmRkYTQxOTJhOWQyMTY1YmU0MmMzZjRlOTIzMjQxMTUzZDUxOTQ5M2FlYSIsCiAgInNpZ25pbmdJZGVudGl0eSI6IG51bGwsCiAgImhvc3RTaGEyNTYiOiAiZWE0ZDU1OTZmODc2OTY4MzljMDRlNDE3NDllODIzYmE4YzEyZGRmMWE5MzFmZGVhMjBhYTk3NWY3YTJkOWQ3ZCIsCiAgInBhY2thZ2VMb2NrU2hhMjU2IjogImEyMjkxZDMyZmNjMGVlOTQ4MGY2ZDYzNDlkNGFhZmMwMTkwZjJjNTI3Y2ZkODIwM2M5YmQwMWU2MGM5ZTRkYjAiLAogICJmaWxlc1NoYTI1NiI6ICJhNDFkMzUxMDNkZjRhNjc3NDU2NmVlMTRjZTUxMTU0YzFjNmJhMGI0YjI5ZDk3NWE0OGNjZTg1MDQxZWM1ZmVmIgp9Cg=="
50
+ },
51
+ "x86_64-pc-windows-msvc": {
52
+ "executable": {
53
+ "sha256": "2768c96b0a31b36ad1097a1dfeb2d34a25090967f980dc2f37e883330886db61",
54
+ "sizeBytes": 95521638
55
+ },
56
+ "browserRuntime": {
57
+ "sha256": "1f2935fb686ba732c9caceaff754f6bb9987eaed6dcab8146fe8ec80bff38f47",
58
+ "sizeBytes": 157813451
59
+ },
60
+ "browserReceipt": "ewogICJzY2hlbWFWZXJzaW9uIjogMSwKICAidGFyZ2V0IjogIng4Nl82NC1wYy13aW5kb3dzLW1zdmMiLAogICJzb3VyY2VSZXZpc2lvbiI6ICIxY2Y0NDc3MzI4MTE5OTM0MDQ1YzBmODY1ODgxZWYwYTY1ZmM2NGQxIiwKICAibm9kZVZlcnNpb24iOiAiMjQuMjEuMCIsCiAgInBsYXl3cmlnaHRDb3JlVmVyc2lvbiI6ICIxLjYyLjEiLAogICJjaHJvbWl1bVZlcnNpb24iOiAiMTUxLjAuNzkyMi4zNCIsCiAgImNocm9taXVtUmV2aXNpb24iOiAiMTIzNCIsCiAgIm5vZGVBcmNoaXZlU2hhMjU2IjogIjE1OGY3Njg1YjQ0ZGU1MWY2YzBkZjFkMTUzNTI2Y2JjZDNlMWJjNzM5YThkZmM2MDc3MjFjZWY3NWRlOWU1NDEiLAogICJicm93c2VyQXJjaGl2ZVNoYTI1NiI6ICI0NmNjNjllZjU1YmEyOTI2OGZmZTMyZGRhNDE5MmE5ZDIxNjViZTQyYzNmNGU5MjMyNDExNTNkNTE5NDkzYWVhIiwKICAic2lnbmluZ0lkZW50aXR5IjogbnVsbCwKICAiaG9zdFNoYTI1NiI6ICJlYTRkNTU5NmY4NzY5NjgzOWMwNGU0MTc0OWU4MjNiYThjMTJkZGYxYTkzMWZkZWEyMGFhOTc1ZjdhMmQ5ZDdkIiwKICAicGFja2FnZUxvY2tTaGEyNTYiOiAiYTIyOTFkMzJmY2MwZWU5NDgwZjZkNjM0OWQ0YWFmYzAxOTBmMmM1MjdjZmQ4MjAzYzliZDAxZTYwYzllNGRiMCIsCiAgImZpbGVzU2hhMjU2IjogIjE2YzBhNDRiMzM1NDRhNmQ1ZDk3ZmM3OWQ1MGNiYzhlZjA3OGI5MGVhYWUzMTRiOGNiNjI0YWEzYTc5YTgzMWYiCn0K"
61
+ }
62
+ }
63
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 3,
3
- "version": "2026.11.56",
4
- "sourceRevision": "4ba5fc0094b18ac5373582c88274245182508179",
3
+ "version": "2026.12.1",
4
+ "sourceRevision": "1cf4477328119934045c0f865881ef0a65fc64d1",
5
5
  "artifacts": [
6
6
  {
7
7
  "target": "aarch64-apple-darwin",
@@ -9,8 +9,8 @@
9
9
  "embeddedFrontend": true,
10
10
  "format": "raw",
11
11
  "assetName": "bamboo-aarch64-apple-darwin",
12
- "sha256": "6b66774f634d18eaecd86256d981103b3a87773debdf3fcef971e059853c5a0b",
13
- "sizeBytes": 283656368
12
+ "sha256": "372bd0a9521016d4f1032f66cb4eb1ba158b34a2d1a63f3bf1818c87460b1c5d",
13
+ "sizeBytes": 286204144
14
14
  },
15
15
  {
16
16
  "target": "aarch64-pc-windows-msvc",
@@ -18,8 +18,8 @@
18
18
  "embeddedFrontend": true,
19
19
  "format": "raw",
20
20
  "assetName": "bamboo-aarch64-pc-windows-msvc.exe",
21
- "sha256": "d86f502637a879b6ad07dabe1251a0945ad79e89f7e71644112fa1bedfd3c36b",
22
- "sizeBytes": 230084096
21
+ "sha256": "6dd4a65e733526097531fe790126689f65b29fee075133730bf97ca9c48c7c8f",
22
+ "sizeBytes": 233026048
23
23
  },
24
24
  {
25
25
  "target": "aarch64-unknown-linux-gnu",
@@ -27,8 +27,8 @@
27
27
  "embeddedFrontend": true,
28
28
  "format": "raw",
29
29
  "assetName": "bamboo-aarch64-unknown-linux-gnu",
30
- "sha256": "e7cb9d377d662962c9a090407ad8df3423581cd39419bddcb887b3f689b9d16d",
31
- "sizeBytes": 310818696
30
+ "sha256": "990f91e8321082f7c4540a0264d05685c9a96b64e8b14eb5359662b083d9188e",
31
+ "sizeBytes": 313503216
32
32
  },
33
33
  {
34
34
  "target": "x86_64-pc-windows-msvc",
@@ -36,8 +36,8 @@
36
36
  "embeddedFrontend": true,
37
37
  "format": "raw",
38
38
  "assetName": "bamboo-x86_64-pc-windows-msvc.exe",
39
- "sha256": "b9834b72b91dfd5ecdd88df71ce97d752248042b79a1b3df34c24e2ff5be3d3f",
40
- "sizeBytes": 278475264
39
+ "sha256": "1ef9b492f5a34f4a9e80ee2aeca3efb13f88efbde0cfd484e537a467de2c5c1d",
40
+ "sizeBytes": 281999872
41
41
  },
42
42
  {
43
43
  "target": "x86_64-unknown-linux-gnu",
@@ -45,19 +45,19 @@
45
45
  "embeddedFrontend": true,
46
46
  "format": "raw",
47
47
  "assetName": "bamboo-x86_64-unknown-linux-gnu",
48
- "sha256": "ffc1802c1495b47e94856b4d946b57c9bdc7f3f2eaa772b0212464a6883771ae",
49
- "sizeBytes": 324776216
48
+ "sha256": "0dd953b293109b37d805ed0a753e72f700d80feff342d3f394325459c692741e",
49
+ "sizeBytes": 328698112
50
50
  }
51
51
  ],
52
52
  "browserHost": {
53
53
  "assetName": "bamboo-browser-host-v1.tar.gz",
54
- "sha256": "cd3764b9d893bcf5322105a198360bca16d38ea0bcb1dd274f53299795638f3b",
55
- "sizeBytes": 47381,
54
+ "sha256": "3f90d5878275784d2438d98901acb744f6fb985b7c7e1175eba195824841df1e",
55
+ "sizeBytes": 49048,
56
56
  "files": [
57
57
  {
58
58
  "path": "browser-runtime/host.cjs",
59
- "sha256": "acab2f270c6fe7dd369db9ac532031d39d2c8607c76e131f197b0f1a1d2e075d",
60
- "sizeBytes": 196399
59
+ "sha256": "ea4d5596f87696839c04e41749e823ba8c12ddf1a931fdea20aa975f7a2d9d7d",
60
+ "sizeBytes": 202848
61
61
  },
62
62
  {
63
63
  "path": "browser-runtime/package-lock.json",
package/bin/bamboo.cjs CHANGED
@@ -4,37 +4,13 @@
4
4
  const { spawn } = require('node:child_process')
5
5
  const { createHash } = require('node:crypto')
6
6
  const { once } = require('node:events')
7
- const { constants, createWriteStream } = require('node:fs')
8
- const { lstat, mkdir, mkdtemp, open, rename, rm } = require('node:fs/promises')
7
+ const { constants } = require('node:fs')
8
+ const { lstat, open } = require('node:fs/promises')
9
9
  const os = require('node:os')
10
10
  const path = require('node:path')
11
- const { Readable, Transform } = require('node:stream')
12
- const { pipeline } = require('node:stream/promises')
13
11
  const manifest = require('../bamboo-sidecars-v3.json')
14
- const { version } = require('../package.json')
15
-
16
- const targets = {
17
- 'darwin-arm64': 'aarch64-apple-darwin',
18
- 'linux-arm64': 'aarch64-unknown-linux-gnu',
19
- 'linux-x64': 'x86_64-unknown-linux-gnu',
20
- 'win32-arm64': 'aarch64-pc-windows-msvc',
21
- 'win32-x64': 'x86_64-pc-windows-msvc',
22
- }
23
-
24
- function cacheRoot() {
25
- const override = process.env.BAMBOO_NPM_CACHE_DIR
26
- if (override) {
27
- if (!path.isAbsolute(override)) throw new Error('BAMBOO_NPM_CACHE_DIR must be absolute')
28
- return override
29
- }
30
- if (process.platform === 'win32') {
31
- const local = process.env.LOCALAPPDATA
32
- return path.join(local && path.isAbsolute(local) ? local : path.join(os.homedir(), 'AppData', 'Local'), 'Bamboo', 'npm')
33
- }
34
- const xdg = process.env.XDG_CACHE_HOME
35
- if (xdg && path.isAbsolute(xdg)) return path.join(xdg, 'bamboo-agent', 'npm')
36
- return path.join(os.homedir(), process.platform === 'darwin' ? 'Library/Caches' : '.cache', 'bamboo-agent', 'npm')
37
- }
12
+ const { name, version } = require('../package.json')
13
+ const targets = require('../targets.json')
38
14
 
39
15
  async function matchesPublishedBinary(file, entry) {
40
16
  let stat
@@ -55,58 +31,35 @@ async function matchesPublishedBinary(file, entry) {
55
31
  }
56
32
  }
57
33
 
58
- function verifyDownload(entry) {
59
- const hash = createHash('sha256')
60
- let bytes = 0
61
- return new Transform({
62
- transform(chunk, encoding, done) {
63
- bytes += chunk.length
64
- if (bytes > entry.sizeBytes) return done(new Error('Download exceeds the published binary size'))
65
- hash.update(chunk)
66
- done(null, chunk)
67
- },
68
- flush(done) {
69
- if (bytes !== entry.sizeBytes || hash.digest('hex') !== entry.sha256) {
70
- return done(new Error('Download does not match the published binary SHA-256 and size'))
71
- }
72
- done()
73
- },
74
- })
75
- }
76
-
77
- async function ensureExecutable(entry) {
78
- const root = path.join(cacheRoot(), version, entry.target)
79
- const destination = path.join(root, entry.assetName)
80
- await mkdir(root, { recursive: true, mode: 0o700 })
81
- if (await matchesPublishedBinary(destination, entry)) return destination
82
-
83
- const temporary = await mkdtemp(path.join(root, '.download-'))
84
- const file = path.join(temporary, entry.assetName)
34
+ async function installedExecutable(platform, entry) {
35
+ const packageName = name + '-' + platform
36
+ let metadataPath
85
37
  try {
86
- process.stderr.write('Downloading Bamboo ' + version + ' for ' + entry.target + '\n')
87
- const url = 'https://github.com/bigduu/Bamboo-agent/releases/download/v' + version + '/' + entry.assetName
88
- const response = await fetch(url, { signal: AbortSignal.timeout(10 * 60 * 1000) })
89
- if (!response.ok || !response.body) throw new Error('GitHub Release download failed (HTTP ' + response.status + ')')
90
- await pipeline(Readable.fromWeb(response.body), verifyDownload(entry), createWriteStream(file, { flags: 'wx', mode: 0o700 }))
91
- try {
92
- await rename(file, destination)
93
- } catch (error) {
94
- if (!await matchesPublishedBinary(destination, entry)) throw error
95
- }
96
- return destination
97
- } finally {
98
- await rm(temporary, { recursive: true, force: true })
38
+ metadataPath = require.resolve(packageName + '/package.json')
39
+ } catch (error) {
40
+ if (error.code !== 'MODULE_NOT_FOUND') throw error
41
+ throw new Error(`Missing ${packageName}@${version}. Reinstall ${name}@${version} with optional dependencies enabled.`)
42
+ }
43
+ const installed = require(metadataPath)
44
+ if (installed.name !== packageName || installed.version !== version) {
45
+ throw new Error(`Expected ${packageName}@${version}`)
46
+ }
47
+ const executable = path.join(path.dirname(metadataPath), 'bin', entry.assetName)
48
+ if (!await matchesPublishedBinary(executable, entry)) {
49
+ throw new Error('The installed executable does not match the published Bamboo SHA-256 and size')
99
50
  }
51
+ return executable
100
52
  }
101
53
 
102
54
  async function main() {
103
55
  if (manifest.schemaVersion !== 3 || manifest.version !== version) {
104
56
  throw new Error('The included Bamboo release manifest does not match this package version')
105
57
  }
106
- const target = targets[process.platform + '-' + process.arch]
58
+ const platform = process.platform + '-' + process.arch
59
+ const target = targets[platform]
107
60
  const entry = manifest.artifacts.find((candidate) => candidate.target === target)
108
61
  if (!entry) throw new Error('Bamboo ' + version + ' has no executable for ' + process.platform + '/' + process.arch)
109
- const executable = await ensureExecutable(entry)
62
+ const executable = await installedExecutable(platform, entry)
110
63
  const env = {
111
64
  ...process.env,
112
65
  BAMBOO_BROWSER_HOST_SCRIPT: process.env.BAMBOO_BROWSER_HOST_SCRIPT || path.join(__dirname, '..', 'browser-runtime', 'host.cjs'),
@@ -601,6 +601,7 @@ function boundedUnicodeText(value, maximum) {
601
601
  const MAX_TABS = 8;
602
602
  // Rust retires this host after 30 seconds. Leave time for state() and stdio.
603
603
  const POINTER_ACTION_BUDGET_MS = 22_000;
604
+ const EXISTING_TAB_OBSERVER_SETUP_BUDGET_MS = 1_000;
604
605
  // Bound returned bytes, not OS disk usage: Chromium may buffer a chunk before
605
606
  // its next progress event lets us cancel an oversized transfer.
606
607
  const MAX_DOWNLOAD_BYTES = 256 * 1024;
@@ -2967,6 +2968,128 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
2967
2968
  return null;
2968
2969
  }
2969
2970
 
2971
+ async function observeExistingTabNavigations(page, deadlineAt, onNavigation) {
2972
+ const candidates = tabs.filter(tab => tab.page !== page);
2973
+ if (!candidates.length) return null;
2974
+
2975
+ const sessions = [];
2976
+ const scripts = new Map();
2977
+ const observed = new Map();
2978
+ const isSourceScript = ({ scriptId, url }) => scripts.has(scriptId) && scripts.get(scriptId) === url;
2979
+ let observing = true;
2980
+ const dispose = () => {
2981
+ if (!observing) return;
2982
+ observing = false;
2983
+ for (const client of sessions) void client.detach().catch(() => {});
2984
+ };
2985
+ async function attach(target) {
2986
+ const client = await context.newCDPSession(target);
2987
+ if (!observing) {
2988
+ void client.detach().catch(() => {});
2989
+ return null;
2990
+ }
2991
+ sessions.push(client);
2992
+ return client;
2993
+ }
2994
+ async function setup() {
2995
+ const sourceClient = await attach(page);
2996
+ if (!sourceClient) return;
2997
+ const { id: sourceIsolate } = await sourceClient.send('Runtime.getIsolateId');
2998
+ const tabsByFrame = new Map();
2999
+ const isWindowNavigation = event => event.reason === 'other' && event.disposition === 'currentTab';
3000
+ sourceClient.on('Page.frameRequestedNavigation', event => {
3001
+ // For a destination in another renderer, Chromium reports the exact
3002
+ // target frame to the initiating page.
3003
+ const tab = tabsByFrame.get(event.frameId);
3004
+ if (observing && tab && isWindowNavigation(event)) onNavigation(tab, false);
3005
+ });
3006
+ function followIfMatched(tab, navigation) {
3007
+ const { initiator, committed, isolate } = navigation;
3008
+ if (observing && isolate?.id === sourceIsolate && isSourceScript(initiator)) {
3009
+ observed.delete(tab);
3010
+ onNavigation(tab, committed);
3011
+ }
3012
+ }
3013
+ sourceClient.on('Debugger.scriptParsed', ({ scriptId, url, executionContextAuxData }) => {
3014
+ if (!executionContextAuxData?.isDefault) return;
3015
+ scripts.set(scriptId, url);
3016
+ // A lazily compiled inline handler and its navigation arrive through
3017
+ // different CDP sessions. Either notification can be delivered first.
3018
+ for (const [tab, navigation] of observed) {
3019
+ if (navigation.initiator.scriptId === scriptId) followIfMatched(tab, navigation);
3020
+ }
3021
+ });
3022
+ await sourceClient.send('Debugger.setSkipAllPauses', { skip: true });
3023
+ await Promise.all([sourceClient.send('Debugger.enable'), sourceClient.send('Page.enable')]);
3024
+
3025
+ await Promise.allSettled(candidates.map(async tab => {
3026
+ const client = await attach(tab.page);
3027
+ if (!client) return;
3028
+ const { frameTree: { frame: { id: frameId } } } = await client.send('Page.getFrameTree');
3029
+ tabsByFrame.set(frameId, tab);
3030
+ let currentIsolate;
3031
+ async function refreshIsolate() {
3032
+ const probe = { id: undefined };
3033
+ currentIsolate = probe;
3034
+ const { id } = await client.send('Runtime.getIsolateId');
3035
+ if (currentIsolate !== probe) return;
3036
+ probe.id = id;
3037
+ const navigation = observed.get(tab);
3038
+ if (navigation?.isolate === probe) followIfMatched(tab, navigation);
3039
+ }
3040
+ let requested;
3041
+ client.on('Page.frameRequestedNavigation', event => {
3042
+ if (event.frameId !== frameId) return;
3043
+ requested = isWindowNavigation(event) ? { url: event.url, isolate: currentIsolate } : undefined;
3044
+ });
3045
+ client.on('Network.requestWillBeSent', event => {
3046
+ if (!observing || event.frameId !== frameId || event.type !== 'Document') return;
3047
+ if (event.redirectResponse && observed.get(tab)?.loaderId === event.loaderId) return;
3048
+ const request = requested;
3049
+ requested = undefined;
3050
+ observed.delete(tab);
3051
+ const initiator = event.initiator?.stack?.callFrames[0];
3052
+ const url = event.request.url + (event.request.urlFragment ?? '');
3053
+ if (request?.url !== url || !initiator) return;
3054
+ const navigation = { initiator, loaderId: event.loaderId, committed: false, isolate: request.isolate };
3055
+ observed.set(tab, navigation);
3056
+ followIfMatched(tab, navigation);
3057
+ });
3058
+ client.on('Page.frameNavigated', ({ frame }) => {
3059
+ if (frame.id !== frameId) return;
3060
+ const pending = observed.get(tab);
3061
+ if (pending && pending.loaderId === frame.loaderId) pending.committed = true;
3062
+ // A renderer can change between two requests. Probe after the
3063
+ // commit, since a new in-flight navigation can suspend CDP replies.
3064
+ void refreshIsolate().catch(() => {});
3065
+ });
3066
+ await Promise.all([client.send('Page.enable'), client.send('Network.enable'), refreshIsolate()]);
3067
+ }));
3068
+ }
3069
+
3070
+ let setupTimer;
3071
+ const wait = Math.min(pointerTimeout(deadlineAt), EXISTING_TAB_OBSERVER_SETUP_BUDGET_MS);
3072
+ try {
3073
+ // Keep the gesture responsive when an unrelated tab closes or its CDP
3074
+ // setup stalls. Already armed observers remain usable until disposal.
3075
+ await Promise.race([setup(), new Promise(resolve => { setupTimer = setTimeout(resolve, wait); })]);
3076
+ } catch {
3077
+ dispose();
3078
+ } finally {
3079
+ clearTimeout(setupTimer);
3080
+ }
3081
+ return {
3082
+ dispose,
3083
+ hasUnconfirmedNavigation() {
3084
+ // Matching script data cannot prove a handoff while the destination's
3085
+ // renderer is still being verified. Keep the opener from claiming a
3086
+ // settled reply in that window.
3087
+ return observing && [...observed].some(([tab, { isolate, initiator }]) =>
3088
+ !tab.page.isClosed() && isolate?.id === undefined && isSourceScript(initiator));
3089
+ },
3090
+ };
3091
+ }
3092
+
2970
3093
  async function observeActionNavigation(page, deadlineAt) {
2971
3094
  let started = false;
2972
3095
  let committed = false;
@@ -2974,10 +3097,12 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
2974
3097
  const pendingRequests = new Map();
2975
3098
  let revision = 0;
2976
3099
  let observedPage = page;
3100
+ let existingTab;
2977
3101
  let blankPopupExpected = false;
2978
3102
  let pendingPopupOpens = 0;
2979
3103
  const listeners = [];
2980
3104
  let cdp;
3105
+ let existingTabObserver;
2981
3106
  const onWindowOpen = event => {
2982
3107
  // Playwright's popup/page events can be delayed until a slow destination
2983
3108
  // response starts. CDP reports window.open at the triggering gesture.
@@ -2989,14 +3114,12 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
2989
3114
  pendingPopupOpens++;
2990
3115
  revision++;
2991
3116
  };
2992
- const watch = (target, popup = false) => {
3117
+ const watch = (target, navigationCommitted = null) => {
2993
3118
  if (listeners.some(item => item.page === target)) return;
2994
- if (popup) {
2995
- // adoptPage activates popups before their navigation commits. An initial
2996
- // about:blank page is not the destination of window.open(url).
3119
+ if (navigationCommitted !== null) {
2997
3120
  observedPage = target;
2998
3121
  started = true;
2999
- committed = target.url() !== 'about:blank' || blankPopupExpected;
3122
+ committed = navigationCommitted;
3000
3123
  failed = false;
3001
3124
  pendingRequests.clear();
3002
3125
  revision++;
@@ -3069,9 +3192,11 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
3069
3192
  };
3070
3193
  const onPopup = target => {
3071
3194
  if (pendingPopupOpens) pendingPopupOpens--;
3072
- watch(target, true);
3195
+ // An initial about:blank page is only settled for a blank popup request.
3196
+ watch(target, target.url() !== 'about:blank' || blankPopupExpected);
3073
3197
  };
3074
3198
  const dispose = () => {
3199
+ existingTabObserver?.dispose();
3075
3200
  cdp?.off('Page.windowOpen', onWindowOpen);
3076
3201
  page.off('popup', onPopup);
3077
3202
  for (const { page: target, onRequest, onFailed, onFinished, onFrame, onClose } of listeners) {
@@ -3092,6 +3217,11 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
3092
3217
  if (!cdp) throw targetError('browser_error', 'browser page navigation observer unavailable');
3093
3218
  cdp.on('Page.windowOpen', onWindowOpen);
3094
3219
  await cdp.send('Page.enable');
3220
+ existingTabObserver = await observeExistingTabNavigations(page, deadlineAt, (tab, committed) => {
3221
+ if (observedPage !== page || pendingPopupOpens || tab.page.isClosed()) return;
3222
+ existingTab = tab;
3223
+ watch(tab.page, committed);
3224
+ });
3095
3225
  if (TEST_OBSERVER_SETUP_DELAY_MS) {
3096
3226
  emit({ event: 'test_observer_setup_waiting' });
3097
3227
  await new Promise(resolve => setTimeout(resolve, TEST_OBSERVER_SETUP_DELAY_MS));
@@ -3101,7 +3231,7 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
3101
3231
  throw error;
3102
3232
  }
3103
3233
  return {
3104
- get started() { return started; },
3234
+ get started() { return started || Boolean(existingTabObserver?.hasUnconfirmedNavigation()); },
3105
3235
  async finish() {
3106
3236
  // A newly committed document can immediately request another navigation.
3107
3237
  // Each request invalidates the prior commit; return only after the latest
@@ -3118,7 +3248,13 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
3118
3248
  continue;
3119
3249
  }
3120
3250
  if (failed) break;
3121
- if (!pendingPopupOpens && (!started || committed)) return;
3251
+ if (!pendingPopupOpens && (!started || committed)) {
3252
+ if (observedPage === page && existingTabObserver?.hasUnconfirmedNavigation()) {
3253
+ throw targetError('navigation_pending', 'a navigation to another browser tab is still being confirmed');
3254
+ }
3255
+ if (observedPage === existingTab?.page) activateTab(existingTab);
3256
+ return;
3257
+ }
3122
3258
  }
3123
3259
  if (deadlineAt !== undefined && Date.now() >= deadlineAt) pointerTimeout(deadlineAt);
3124
3260
  if (!failed && (pendingPopupOpens || (started && !committed))) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bigduu/bamboo-agent",
3
- "version": "2026.11.56",
4
- "description": "Bamboo agent harness CLI from the official Bamboo release",
3
+ "version": "2026.12.1",
4
+ "description": "Bamboo CLI and server with native packages from the official Bamboo release",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -29,6 +29,8 @@
29
29
  "files": [
30
30
  "bin/bamboo.cjs",
31
31
  "bamboo-sidecars-v3.json",
32
+ "bamboo-npm-assets-v1.json",
33
+ "targets.json",
32
34
  "browser-runtime",
33
35
  "README.md",
34
36
  "LICENSE"
@@ -40,5 +42,12 @@
40
42
  },
41
43
  "dependencies": {
42
44
  "playwright-core": "1.62.1"
45
+ },
46
+ "optionalDependencies": {
47
+ "@bigduu/bamboo-agent-darwin-arm64": "2026.12.1",
48
+ "@bigduu/bamboo-agent-linux-arm64": "2026.12.1",
49
+ "@bigduu/bamboo-agent-linux-x64": "2026.12.1",
50
+ "@bigduu/bamboo-agent-win32-arm64": "2026.12.1",
51
+ "@bigduu/bamboo-agent-win32-x64": "2026.12.1"
43
52
  }
44
53
  }
package/targets.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "darwin-arm64": "aarch64-apple-darwin",
3
+ "linux-arm64": "aarch64-unknown-linux-gnu",
4
+ "linux-x64": "x86_64-unknown-linux-gnu",
5
+ "win32-arm64": "aarch64-pc-windows-msvc",
6
+ "win32-x64": "x86_64-pc-windows-msvc"
7
+ }