@bigduu/bamboo-agent 2026.11.50 → 2026.11.58

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.11.58",
4
+ "sourceRevision": "f37c1bd97dfed7d7aa7d56bdd28ea617a6da9e18",
5
+ "bambooManifestSha256": "140db557d9641582af3542524079c0ca2c6ac726df0c87cfc555be37e03401d4",
6
+ "artifacts": {
7
+ "aarch64-apple-darwin": {
8
+ "executable": {
9
+ "sha256": "d156d69c23c5558bfa8692c8e67b95ca749317fba47e7a159395c402fbbccb7c",
10
+ "sizeBytes": 96640281
11
+ },
12
+ "browserRuntime": {
13
+ "sha256": "5134a39205ec6db7b61de7d70b380e33b232223cf9c603db208d49825c562722",
14
+ "sizeBytes": 134682152
15
+ },
16
+ "browserReceipt": "ewogICJzY2hlbWFWZXJzaW9uIjogMSwKICAidGFyZ2V0IjogImFhcmNoNjQtYXBwbGUtZGFyd2luIiwKICAic291cmNlUmV2aXNpb24iOiAiZjM3YzFiZDk3ZGZlZDdkN2FhN2Q1NmJkZDI4ZWE2MTdhNmRhOWUxOCIsCiAgIm5vZGVWZXJzaW9uIjogIjI0LjIxLjAiLAogICJwbGF5d3JpZ2h0Q29yZVZlcnNpb24iOiAiMS42Mi4xIiwKICAiY2hyb21pdW1WZXJzaW9uIjogIjE1MS4wLjc5MjIuMzQiLAogICJjaHJvbWl1bVJldmlzaW9uIjogIjEyMzQiLAogICJub2RlQXJjaGl2ZVNoYTI1NiI6ICJiZWQ3ZWVhNTMyNWUxMTA4ZjMyY2U1MjI4ZGRkNmE1ZjBmMDhhNDk5ZWU0MmFhNzQ0MmFlYTU4MzcwMmY2MDU3IiwKICAiYnJvd3NlckFyY2hpdmVTaGEyNTYiOiAiY2I0NmEzMzZkYmUzZDZmMTMzOWM1MDM5YzMwODNlNGU1ZGQ4ZTQzNzk3MTA3OTBlMzRmOGY0YTg2NWUyNDUyZCIsCiAgInNpZ25pbmdJZGVudGl0eSI6IG51bGwsCiAgImhvc3RTaGEyNTYiOiAiZWE0ZDU1OTZmODc2OTY4MzljMDRlNDE3NDllODIzYmE4YzEyZGRmMWE5MzFmZGVhMjBhYTk3NWY3YTJkOWQ3ZCIsCiAgInBhY2thZ2VMb2NrU2hhMjU2IjogImEyMjkxZDMyZmNjMGVlOTQ4MGY2ZDYzNDlkNGFhZmMwMTkwZjJjNTI3Y2ZkODIwM2M5YmQwMWU2MGM5ZTRkYjAiLAogICJmaWxlc1NoYTI1NiI6ICI0MWE2Mzk1ZTcyZTA3ZGU5MDQxYWJiZjVhYjBmZWVkMGMwYzg2N2YzYzBjYzBkZGI0NGZmNGIwNDFkMWVhZjUwIgp9Cg=="
17
+ },
18
+ "aarch64-unknown-linux-gnu": {
19
+ "executable": {
20
+ "sha256": "9c8a1636439ff77fe07b2c391a66994f6bf75e58d7b8f368212b117e716717b8",
21
+ "sizeBytes": 106508378
22
+ },
23
+ "browserRuntime": {
24
+ "sha256": "3d686a208dc3d7cb5dbbbbe3e126103c8c3fa6689ba0ef937d2f00e1d91d7963",
25
+ "sizeBytes": 163048655
26
+ },
27
+ "browserReceipt": "ewogICJzY2hlbWFWZXJzaW9uIjogMSwKICAidGFyZ2V0IjogImFhcmNoNjQtdW5rbm93bi1saW51eC1nbnUiLAogICJzb3VyY2VSZXZpc2lvbiI6ICJmMzdjMWJkOTdkZmVkN2Q3YWE3ZDU2YmRkMjhlYTYxN2E2ZGE5ZTE4IiwKICAibm9kZVZlcnNpb24iOiAiMjQuMjEuMCIsCiAgInBsYXl3cmlnaHRDb3JlVmVyc2lvbiI6ICIxLjYyLjEiLAogICJjaHJvbWl1bVZlcnNpb24iOiAiMTUxLjAuNzkyMi4zNCIsCiAgImNocm9taXVtUmV2aXNpb24iOiAiMTIzNCIsCiAgIm5vZGVBcmNoaXZlU2hhMjU2IjogIjcyNDI4MmMzYjQzYWVjOTk4YWE5NTI3MzgwNDY1YjQ1ZDIyOWUwMjFiNTgwMzVmNWY0ZjYzMDk1ZWFiZmU1ZDUiLAogICJicm93c2VyQXJjaGl2ZVNoYTI1NiI6ICJiMDM0NDNlMWUxYTYwZDA2ZTA3YjZjZGZlNjUwYjhjMmJmY2JiM2RiNDk3ZDJiNjUyZjczZGM2OTEyZjRhZTE1IiwKICAic2lnbmluZ0lkZW50aXR5IjogbnVsbCwKICAiaG9zdFNoYTI1NiI6ICJlYTRkNTU5NmY4NzY5NjgzOWMwNGU0MTc0OWU4MjNiYThjMTJkZGYxYTkzMWZkZWEyMGFhOTc1ZjdhMmQ5ZDdkIiwKICAicGFja2FnZUxvY2tTaGEyNTYiOiAiYTIyOTFkMzJmY2MwZWU5NDgwZjZkNjM0OWQ0YWFmYzAxOTBmMmM1MjdjZmQ4MjAzYzliZDAxZTYwYzllNGRiMCIsCiAgImZpbGVzU2hhMjU2IjogIjlhMmVkOGEwYThiYzBmMGZiZjY3MWZjMzEzNDM5MTRlZThiMGJjNWZkOTdhMGI0ZGNhODg5YjcwMDVjMzA3MDUiCn0K"
28
+ },
29
+ "x86_64-unknown-linux-gnu": {
30
+ "executable": {
31
+ "sha256": "dbf2e75bbef63d6efadb3a96e2a93cb148bba9da310a092f0ca3d648d2b753b2",
32
+ "sizeBytes": 103787192
33
+ },
34
+ "browserRuntime": {
35
+ "sha256": "fa1529b2373ca92c8a1a6a73c50e073c4b8c1eab962262cfe055ad0d9082056a",
36
+ "sizeBytes": 156022514
37
+ },
38
+ "browserReceipt": "ewogICJzY2hlbWFWZXJzaW9uIjogMSwKICAidGFyZ2V0IjogIng4Nl82NC11bmtub3duLWxpbnV4LWdudSIsCiAgInNvdXJjZVJldmlzaW9uIjogImYzN2MxYmQ5N2RmZWQ3ZDdhYTdkNTZiZGQyOGVhNjE3YTZkYTllMTgiLAogICJub2RlVmVyc2lvbiI6ICIyNC4yMS4wIiwKICAicGxheXdyaWdodENvcmVWZXJzaW9uIjogIjEuNjIuMSIsCiAgImNocm9taXVtVmVyc2lvbiI6ICIxNTEuMC43OTIyLjM0IiwKICAiY2hyb21pdW1SZXZpc2lvbiI6ICIxMjM0IiwKICAibm9kZUFyY2hpdmVTaGEyNTYiOiAiNmUxZGI4N2VmNThiODgxOWU1ZDU0MDJlZmYxNTM2NDkxYjE4ZWRkOGViN2JlZTVlZjc4OTc4NzZlODhkYzVmZiIsCiAgImJyb3dzZXJBcmNoaXZlU2hhMjU2IjogIjNjZmMyYmQwMGQxYmFmY2Y4YTY4ZGM3NGM5YzkyYmI3MTUwZGRjOGQyNmFkZTk0OGE3NzYzMTZlMWNlYzRmMTQiLAogICJzaWduaW5nSWRlbnRpdHkiOiBudWxsLAogICJob3N0U2hhMjU2IjogImVhNGQ1NTk2Zjg3Njk2ODM5YzA0ZTQxNzQ5ZTgyM2JhOGMxMmRkZjFhOTMxZmRlYTIwYWE5NzVmN2EyZDlkN2QiLAogICJwYWNrYWdlTG9ja1NoYTI1NiI6ICJhMjI5MWQzMmZjYzBlZTk0ODBmNmQ2MzQ5ZDRhYWZjMDE5MGYyYzUyN2NmZDgyMDNjOWJkMDFlNjBjOWU0ZGIwIiwKICAiZmlsZXNTaGEyNTYiOiAiODQxZGVhYjg1NDk4NDg4ZmMzNTliZjJmNDhkYmI3YTNjMjNjOTg3ZDFhNzkxMjkxMmE4Y2I5NzVjNWZkYWQ5NCIKfQo="
39
+ },
40
+ "aarch64-pc-windows-msvc": {
41
+ "executable": {
42
+ "sha256": "0376c6b2ef613250e7ab97a2bc1b90ccc10a499c59b789a8ac4a2d8fab67321a",
43
+ "sizeBytes": 88556923
44
+ },
45
+ "browserRuntime": {
46
+ "sha256": "e52eebaf106d38b45d47c72439e08f2ba8f61634669c67ed14859e8948c37fe0",
47
+ "sizeBytes": 153780610
48
+ },
49
+ "browserReceipt": "ewogICJzY2hlbWFWZXJzaW9uIjogMSwKICAidGFyZ2V0IjogImFhcmNoNjQtcGMtd2luZG93cy1tc3ZjIiwKICAic291cmNlUmV2aXNpb24iOiAiZjM3YzFiZDk3ZGZlZDdkN2FhN2Q1NmJkZDI4ZWE2MTdhNmRhOWUxOCIsCiAgIm5vZGVWZXJzaW9uIjogIjI0LjIxLjAiLAogICJwbGF5d3JpZ2h0Q29yZVZlcnNpb24iOiAiMS42Mi4xIiwKICAiY2hyb21pdW1WZXJzaW9uIjogIjE1MS4wLjc5MjIuMzQiLAogICJjaHJvbWl1bVJldmlzaW9uIjogIjEyMzQiLAogICJub2RlQXJjaGl2ZVNoYTI1NiI6ICI4Nzc5YjFiZGUxZDM5ZjhkNDIwZTNiNTdhYTY1N2IzOTg5MWFmNDM0ZDNkZTQ0YTkxOTA0NGNlYzA2Nzg1OTIxIiwKICAiYnJvd3NlckFyY2hpdmVTaGEyNTYiOiAiNDZjYzY5ZWY1NWJhMjkyNjhmZmUzMmRkYTQxOTJhOWQyMTY1YmU0MmMzZjRlOTIzMjQxMTUzZDUxOTQ5M2FlYSIsCiAgInNpZ25pbmdJZGVudGl0eSI6IG51bGwsCiAgImhvc3RTaGEyNTYiOiAiZWE0ZDU1OTZmODc2OTY4MzljMDRlNDE3NDllODIzYmE4YzEyZGRmMWE5MzFmZGVhMjBhYTk3NWY3YTJkOWQ3ZCIsCiAgInBhY2thZ2VMb2NrU2hhMjU2IjogImEyMjkxZDMyZmNjMGVlOTQ4MGY2ZDYzNDlkNGFhZmMwMTkwZjJjNTI3Y2ZkODIwM2M5YmQwMWU2MGM5ZTRkYjAiLAogICJmaWxlc1NoYTI1NiI6ICJhNDFkMzUxMDNkZjRhNjc3NDU2NmVlMTRjZTUxMTU0YzFjNmJhMGI0YjI5ZDk3NWE0OGNjZTg1MDQxZWM1ZmVmIgp9Cg=="
50
+ },
51
+ "x86_64-pc-windows-msvc": {
52
+ "executable": {
53
+ "sha256": "6a53387028b973fe3fab4ceda32d1918c5de30397d05fb4e8a76612a69911f66",
54
+ "sizeBytes": 94597269
55
+ },
56
+ "browserRuntime": {
57
+ "sha256": "128fa49289f3b4d60c6763b88d178045ee54761492fa26f20bf93ddf55e44f76",
58
+ "sizeBytes": 157808205
59
+ },
60
+ "browserReceipt": "ewogICJzY2hlbWFWZXJzaW9uIjogMSwKICAidGFyZ2V0IjogIng4Nl82NC1wYy13aW5kb3dzLW1zdmMiLAogICJzb3VyY2VSZXZpc2lvbiI6ICJmMzdjMWJkOTdkZmVkN2Q3YWE3ZDU2YmRkMjhlYTYxN2E2ZGE5ZTE4IiwKICAibm9kZVZlcnNpb24iOiAiMjQuMjEuMCIsCiAgInBsYXl3cmlnaHRDb3JlVmVyc2lvbiI6ICIxLjYyLjEiLAogICJjaHJvbWl1bVZlcnNpb24iOiAiMTUxLjAuNzkyMi4zNCIsCiAgImNocm9taXVtUmV2aXNpb24iOiAiMTIzNCIsCiAgIm5vZGVBcmNoaXZlU2hhMjU2IjogIjE1OGY3Njg1YjQ0ZGU1MWY2YzBkZjFkMTUzNTI2Y2JjZDNlMWJjNzM5YThkZmM2MDc3MjFjZWY3NWRlOWU1NDEiLAogICJicm93c2VyQXJjaGl2ZVNoYTI1NiI6ICI0NmNjNjllZjU1YmEyOTI2OGZmZTMyZGRhNDE5MmE5ZDIxNjViZTQyYzNmNGU5MjMyNDExNTNkNTE5NDkzYWVhIiwKICAic2lnbmluZ0lkZW50aXR5IjogbnVsbCwKICAiaG9zdFNoYTI1NiI6ICJlYTRkNTU5NmY4NzY5NjgzOWMwNGU0MTc0OWU4MjNiYThjMTJkZGYxYTkzMWZkZWEyMGFhOTc1ZjdhMmQ5ZDdkIiwKICAicGFja2FnZUxvY2tTaGEyNTYiOiAiYTIyOTFkMzJmY2MwZWU5NDgwZjZkNjM0OWQ0YWFmYzAxOTBmMmM1MjdjZmQ4MjAzYzliZDAxZTYwYzllNGRiMCIsCiAgImZpbGVzU2hhMjU2IjogIjE2YzBhNDRiMzM1NDRhNmQ1ZDk3ZmM3OWQ1MGNiYzhlZjA3OGI5MGVhYWUzMTRiOGNiNjI0YWEzYTc5YTgzMWYiCn0K"
61
+ }
62
+ }
63
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 3,
3
- "version": "2026.11.50",
4
- "sourceRevision": "08349582e073daba1a5e3674464a885b75427c79",
3
+ "version": "2026.11.58",
4
+ "sourceRevision": "f37c1bd97dfed7d7aa7d56bdd28ea617a6da9e18",
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": "a629cde2ebb9fffe8444dc44cd06a53955f16fc83c58691bd5683429b6f86a30",
13
- "sizeBytes": 274197216
12
+ "sha256": "d9b654f0d057db2acacd05b4fba46b6411505e84722f5805c12f60a952d4c7b4",
13
+ "sizeBytes": 283563520
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": "8110f3efc59eb72a24265f18bdbf207c03537759f7227b09e7aaec98fce9e8b3",
22
- "sizeBytes": 222359552
21
+ "sha256": "d6e08c76a2d74f788b1fe747c627bec9c91e9678de66c099cd95a050337c73af",
22
+ "sizeBytes": 230812160
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": "02b86cdabddab1a36e2c98490bdfe67ede3719364c236d38e3741068f83e73c8",
31
- "sizeBytes": 300449056
30
+ "sha256": "6e40f08e026bfe0eb6a241aceff2fbfb7da38497b3c80b153313e9cc834fc599",
31
+ "sizeBytes": 310826728
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": "46579b33c01d0b77b8da25076bf70d00e42e49eabc6af1a07ac80b68ed0c36cc",
40
- "sizeBytes": 269241856
39
+ "sha256": "027c89954ec99c1824c6741e382bbd5582b7489bd3228da2b9b6209296a54afd",
40
+ "sizeBytes": 279003136
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": "bb69dd52c5c82337dccbfed17d6da218836a23567c580df367d05571588ab374",
49
- "sizeBytes": 314850128
48
+ "sha256": "85445cd63026603b923ab0b644f0da29bfffc0001129d4e6887910b011a1a225",
49
+ "sizeBytes": 325485376
50
50
  }
51
51
  ],
52
52
  "browserHost": {
53
53
  "assetName": "bamboo-browser-host-v1.tar.gz",
54
- "sha256": "504012f0cf2f75a4c62063bb7b6711f25e12d23bdcecebd208b4624f1e9eb8d9",
55
- "sizeBytes": 47295,
54
+ "sha256": "3f90d5878275784d2438d98901acb744f6fb985b7c7e1175eba195824841df1e",
55
+ "sizeBytes": 49048,
56
56
  "files": [
57
57
  {
58
58
  "path": "browser-runtime/host.cjs",
59
- "sha256": "ecdc2bb96fa63c219d721603d7ca245f79cf0fd7b820577dbc26c696414a762f",
60
- "sizeBytes": 196265
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'),
@@ -584,9 +584,24 @@ function createNativeRootTracker(spawns, expectedProfile, policy = {}) {
584
584
 
585
585
  const MAX_SNAPSHOT_CHARS = 80_000;
586
586
  const MAX_HTML_CHARS = 100_000;
587
+
588
+ function boundedUnicodeText(value, maximum) {
589
+ let end = Math.min(value.length, maximum);
590
+ if (end < value.length) {
591
+ const before = value.charCodeAt(end - 1);
592
+ const after = value.charCodeAt(end);
593
+ // Leave the whole character out when it crosses the UTF-16 limit.
594
+ if (before >= 0xD800 && before <= 0xDBFF && after >= 0xDC00 && after <= 0xDFFF) {
595
+ end -= 1;
596
+ }
597
+ }
598
+ return { text: value.slice(0, end).toWellFormed(), truncated: end < value.length };
599
+ }
600
+
587
601
  const MAX_TABS = 8;
588
602
  // Rust retires this host after 30 seconds. Leave time for state() and stdio.
589
603
  const POINTER_ACTION_BUDGET_MS = 22_000;
604
+ const EXISTING_TAB_OBSERVER_SETUP_BUDGET_MS = 1_000;
590
605
  // Bound returned bytes, not OS disk usage: Chromium may buffer a chunk before
591
606
  // its next progress event lets us cancel an oversized transfer.
592
607
  const MAX_DOWNLOAD_BYTES = 256 * 1024;
@@ -1396,18 +1411,6 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
1396
1411
  return value.length > maximum ? value.slice(0, maximum) : value;
1397
1412
  }
1398
1413
 
1399
- function boundedDialogText(value) {
1400
- let text = '';
1401
- let consumed = 0;
1402
- for (const character of value) {
1403
- if (consumed + character.length > MAX_DIALOG_CHARS) break;
1404
- const codePoint = character.codePointAt(0);
1405
- text += codePoint >= 0xD800 && codePoint <= 0xDFFF ? '\uFFFD' : character;
1406
- consumed += character.length;
1407
- }
1408
- return { text, truncated: consumed < value.length };
1409
- }
1410
-
1411
1414
  function staleEpochError() {
1412
1415
  const error = new Error('browser page changed; refresh state and retry');
1413
1416
  error.code = 'stale_epoch';
@@ -1442,8 +1445,8 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
1442
1445
  function dialogState() {
1443
1446
  const tab = requireActiveTab();
1444
1447
  const pending = pendingDialog;
1445
- const message = pending && boundedDialogText(pending.message);
1446
- const defaultValue = pending && boundedDialogText(pending.defaultValue);
1448
+ const message = pending && boundedUnicodeText(pending.message, MAX_DIALOG_CHARS);
1449
+ const defaultValue = pending && boundedUnicodeText(pending.defaultValue, MAX_DIALOG_CHARS);
1447
1450
  return {
1448
1451
  page_epoch: epoch,
1449
1452
  active_tab_id: tab.id,
@@ -2965,6 +2968,128 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
2965
2968
  return null;
2966
2969
  }
2967
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
+
2968
3093
  async function observeActionNavigation(page, deadlineAt) {
2969
3094
  let started = false;
2970
3095
  let committed = false;
@@ -2972,10 +3097,12 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
2972
3097
  const pendingRequests = new Map();
2973
3098
  let revision = 0;
2974
3099
  let observedPage = page;
3100
+ let existingTab;
2975
3101
  let blankPopupExpected = false;
2976
3102
  let pendingPopupOpens = 0;
2977
3103
  const listeners = [];
2978
3104
  let cdp;
3105
+ let existingTabObserver;
2979
3106
  const onWindowOpen = event => {
2980
3107
  // Playwright's popup/page events can be delayed until a slow destination
2981
3108
  // response starts. CDP reports window.open at the triggering gesture.
@@ -2987,14 +3114,12 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
2987
3114
  pendingPopupOpens++;
2988
3115
  revision++;
2989
3116
  };
2990
- const watch = (target, popup = false) => {
3117
+ const watch = (target, navigationCommitted = null) => {
2991
3118
  if (listeners.some(item => item.page === target)) return;
2992
- if (popup) {
2993
- // adoptPage activates popups before their navigation commits. An initial
2994
- // about:blank page is not the destination of window.open(url).
3119
+ if (navigationCommitted !== null) {
2995
3120
  observedPage = target;
2996
3121
  started = true;
2997
- committed = target.url() !== 'about:blank' || blankPopupExpected;
3122
+ committed = navigationCommitted;
2998
3123
  failed = false;
2999
3124
  pendingRequests.clear();
3000
3125
  revision++;
@@ -3067,9 +3192,11 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
3067
3192
  };
3068
3193
  const onPopup = target => {
3069
3194
  if (pendingPopupOpens) pendingPopupOpens--;
3070
- 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);
3071
3197
  };
3072
3198
  const dispose = () => {
3199
+ existingTabObserver?.dispose();
3073
3200
  cdp?.off('Page.windowOpen', onWindowOpen);
3074
3201
  page.off('popup', onPopup);
3075
3202
  for (const { page: target, onRequest, onFailed, onFinished, onFrame, onClose } of listeners) {
@@ -3090,6 +3217,11 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
3090
3217
  if (!cdp) throw targetError('browser_error', 'browser page navigation observer unavailable');
3091
3218
  cdp.on('Page.windowOpen', onWindowOpen);
3092
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
+ });
3093
3225
  if (TEST_OBSERVER_SETUP_DELAY_MS) {
3094
3226
  emit({ event: 'test_observer_setup_waiting' });
3095
3227
  await new Promise(resolve => setTimeout(resolve, TEST_OBSERVER_SETUP_DELAY_MS));
@@ -3099,7 +3231,7 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
3099
3231
  throw error;
3100
3232
  }
3101
3233
  return {
3102
- get started() { return started; },
3234
+ get started() { return started || Boolean(existingTabObserver?.hasUnconfirmedNavigation()); },
3103
3235
  async finish() {
3104
3236
  // A newly committed document can immediately request another navigation.
3105
3237
  // Each request invalidates the prior commit; return only after the latest
@@ -3116,7 +3248,13 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
3116
3248
  continue;
3117
3249
  }
3118
3250
  if (failed) break;
3119
- 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
+ }
3120
3258
  }
3121
3259
  if (deadlineAt !== undefined && Date.now() >= deadlineAt) pointerTimeout(deadlineAt);
3122
3260
  if (!failed && (pendingPopupOpens || (started && !committed))) {
@@ -3561,14 +3699,15 @@ function createChatScope({ id, generation, profileMode, context, downloadDir,
3561
3699
  }
3562
3700
  return stableRead(async tab => {
3563
3701
  const page = tab.page;
3564
- const snapshot = await page.ariaSnapshot({ mode: 'ai', depth: 12, timeout: 10_000 });
3565
- const html = await page.content();
3702
+ const snapshot = boundedUnicodeText(
3703
+ await page.ariaSnapshot({ mode: 'ai', depth: 12, timeout: 10_000 }), MAX_SNAPSHOT_CHARS);
3704
+ const html = boundedUnicodeText(await page.content(), MAX_HTML_CHARS);
3566
3705
  return {
3567
3706
  title: await page.title(),
3568
- snapshot: bounded(snapshot, MAX_SNAPSHOT_CHARS),
3569
- html: bounded(html, MAX_HTML_CHARS),
3570
- snapshot_truncated: snapshot.length > MAX_SNAPSHOT_CHARS,
3571
- html_truncated: html.length > MAX_HTML_CHARS,
3707
+ snapshot: snapshot.text,
3708
+ html: html.text,
3709
+ snapshot_truncated: snapshot.truncated,
3710
+ html_truncated: html.truncated,
3572
3711
  };
3573
3712
  });
3574
3713
  }
@@ -4326,7 +4465,7 @@ if (require.main === module) {
4326
4465
  await closeHost().catch(() => {});
4327
4466
  });
4328
4467
  } else {
4329
- module.exports = { installScriptBlobCapture, installDownloadLinkInspector,
4468
+ module.exports = { installScriptBlobCapture, installDownloadLinkInspector, boundedUnicodeText,
4330
4469
  IMAGE_BYTES, QUOTA_BYTES, ACCOUNT_KEY, macSharedStoragePlan,
4331
4470
  validateMacStorageObservation, inspectMacSharedStorage,
4332
4471
  validateMacStorageResetObservation, inspectMacStorageForReset,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bigduu/bamboo-agent",
3
- "version": "2026.11.50",
4
- "description": "Bamboo agent harness CLI from the official Bamboo release",
3
+ "version": "2026.11.58",
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.11.58",
48
+ "@bigduu/bamboo-agent-linux-arm64": "2026.11.58",
49
+ "@bigduu/bamboo-agent-linux-x64": "2026.11.58",
50
+ "@bigduu/bamboo-agent-win32-arm64": "2026.11.58",
51
+ "@bigduu/bamboo-agent-win32-x64": "2026.11.58"
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
+ }