stackbite 0.5.91 → 0.5.92

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stackbite",
3
- "version": "0.5.91",
3
+ "version": "0.5.92",
4
4
  "description": "Verified native Stackbite CLI bootstrapper",
5
5
  "license": "UNLICENSED",
6
6
  "engines": {
@@ -141,8 +141,8 @@ async function checkProductIdentity(root, spec, metadata) {
141
141
  || ((spec.platform === 'darwin' || value.platform !== undefined) && value.platform !== spec.host)) fail('Release product/version/commit identity mismatch');
142
142
  }
143
143
  }
144
- async function nativeExecutable(root, spec) {
145
- const executable = path.join(root, spec.platform === 'win32' ? 'stackbite.exe' : 'stackbite');
144
+ async function nativeExecutable(root, spec, name = 'stackbite') {
145
+ const executable = path.join(root, name + (spec.platform === 'win32' ? '.exe' : ''));
146
146
  const image = await fs.lstat(executable);
147
147
  if (!image.isFile() || image.isSymbolicLink()) fail('Native release executable is missing or a link');
148
148
  const file = await fs.open(executable, 'r');
@@ -157,6 +157,28 @@ async function nativeExecutable(root, spec) {
157
157
  if (spec.platform !== 'win32' && process.platform !== 'win32' && !(image.mode & 0o111)) fail('Native release executable has no execute permission');
158
158
  return executable;
159
159
  }
160
+ // The release pins the whole payload before this mapping. Old releases keep
161
+ // their original engine; a present native entry is never silently bypassed.
162
+ async function publicExecutable(root, spec, hashes) {
163
+ const engine = await nativeExecutable(root, spec);
164
+ const name = 'stackbite-launcher' + (spec.platform === 'win32' ? '.exe' : '');
165
+ if (!Object.hasOwn(hashes, name)) {
166
+ if (await exists(path.join(root, name))) fail('Native entry is present without a release pin');
167
+ return engine;
168
+ }
169
+ const manifest = JSON.parse((await readSmall(path.join(root, 'manifest.json'))).toString('utf8'));
170
+ const entry = manifest.binaries?.['stackbite-launcher'], info = entry?.build_info;
171
+ const target = { win32: 'x86_64-pc-windows-msvc', linux: 'x86_64-unknown-linux-gnu', darwin: 'aarch64-apple-darwin' }[spec.platform];
172
+ if (manifest.schema !== 'stackbite-rust-terminal-build-v1' || manifest.product !== 'Stackbite'
173
+ || manifest.version !== spec.version || manifest.commit !== spec.commit || manifest.target !== target || manifest.protocol !== 1
174
+ || !entry || Object.keys(entry).sort().join(',') !== 'build_info,path,sha256'
175
+ || entry.path !== name || entry.sha256 !== hashes[name] || manifest.artifacts?.[name]?.sha256 !== hashes[name]
176
+ || manifest.artifacts?.[name]?.kind !== 'binary' || !Number.isSafeInteger(manifest.artifacts?.[name]?.size) || manifest.artifacts[name].size < 1
177
+ || !info || Object.keys(info).sort().join(',') !== 'binary,commit,product,protocol,target,version'
178
+ || info.product !== 'Stackbite' || info.binary !== 'stackbite-launcher' || info.version !== spec.version
179
+ || info.commit !== spec.commit || info.target !== target || info.protocol !== 1) fail('Native entry package identity or pin is invalid');
180
+ return nativeExecutable(root, spec, 'stackbite-launcher');
181
+ }
160
182
  async function validatePayload(directory, spec, { includePhone = true } = {}) {
161
183
  const root = await payloadRoot(directory);
162
184
  const { hashes, metadata } = await pinnedDocuments(root, spec);
@@ -165,7 +187,7 @@ async function validatePayload(directory, spec, { includePhone = true } = {}) {
165
187
  const actual = await payloadFiles(root, expected, hashes, includePhone);
166
188
  await checkMemberSet(root, spec, hashes, expected, actual);
167
189
  await checkProductIdentity(root, spec, metadata);
168
- return nativeExecutable(root, spec);
190
+ return publicExecutable(root, spec, hashes);
169
191
  }
170
192
  async function ensureBinary(spec, { cache = cacheDirectory(), downloadImpl = download, extractImpl = extractArchive,
171
193
  checkOnly = false, reportCached = false, includePhone = false, progress = () => {} } = {}) {
@@ -1,35 +1,35 @@
1
1
  {
2
2
  "schema": 1,
3
- "version": "0.5.91",
4
- "commit": "2d94b964c839d24b1968b4dbb725621d49e9b707",
3
+ "version": "0.5.92",
4
+ "commit": "cc476a31b6ff0464f623372fe15fff3ff311d942",
5
5
  "repository": "Shinick-Han/stackbite",
6
6
  "platforms": {
7
7
  "win32-x64": {
8
- "asset": "stackbite-0.5.91-windows-x64-2d94b964c839.zip",
9
- "url": "https://github.com/Shinick-Han/stackbite/releases/download/v0.5.91/stackbite-0.5.91-windows-x64-2d94b964c839.zip",
10
- "sha256": "557726a30ece87ec0f7541a3f05794648ec3b5326ecc6e6a64e4cbfaa0b69331",
11
- "size": 94836414,
12
- "root": "stackbite-0.5.91-windows-x64-2d94b964c839",
13
- "manifestSha256": "b2395ba730c0cc30ac500a6bee14f4b005658fd97a330841bcb769794927c393",
14
- "metadataSha256": "bd05a77015cbca2c7e908c87f64aac79dacfb04d0eee13f703ed5e418e9bb922"
8
+ "asset": "stackbite-0.5.92-windows-x64-cc476a31b6ff.zip",
9
+ "url": "https://github.com/Shinick-Han/stackbite/releases/download/v0.5.92/stackbite-0.5.92-windows-x64-cc476a31b6ff.zip",
10
+ "sha256": "e27e3f909e93965412cfae83a8eea6a2bdbe49126104f452464a7913f2aa03d9",
11
+ "size": 95304318,
12
+ "root": "stackbite-0.5.92-windows-x64-cc476a31b6ff",
13
+ "manifestSha256": "b784ca757ac89eb62c3226f81e71e5467b99259bfa46f1c785fff8f457b8e152",
14
+ "metadataSha256": "5414656b14f65921506b664123e9b0526cdd33f253c27ef122f0e335d6dda736"
15
15
  },
16
16
  "linux-x64": {
17
- "asset": "stackbite-0.5.91-linux-x86_64-2d94b964c839.tar.gz",
18
- "url": "https://github.com/Shinick-Han/stackbite/releases/download/v0.5.91/stackbite-0.5.91-linux-x86_64-2d94b964c839.tar.gz",
19
- "sha256": "72aa084f92dafaf83e414e6098438d531e7e77980fa1b61532f0e9c9a9069d98",
20
- "size": 74778958,
21
- "root": "stackbite-0.5.91-linux-x86_64-2d94b964c839",
22
- "manifestSha256": "e70444ff32b016e9a7e2687f704b667445586b32a9e38d3fb1be138331dfb04f",
23
- "metadataSha256": "46470951946de8ad3cb0447519d6f7259d8d2080a8808fe2b57e8e0267819fa5"
17
+ "asset": "stackbite-0.5.92-linux-x86_64-cc476a31b6ff.tar.gz",
18
+ "url": "https://github.com/Shinick-Han/stackbite/releases/download/v0.5.92/stackbite-0.5.92-linux-x86_64-cc476a31b6ff.tar.gz",
19
+ "sha256": "15b82d52a8e1b1636fb0d69af27c881259a7b8efe3a808789020adbe0090698c",
20
+ "size": 75399110,
21
+ "root": "stackbite-0.5.92-linux-x86_64-cc476a31b6ff",
22
+ "manifestSha256": "ac8ece054b13ab8b8dd4f4994fa18c6aee7de70e0bf5617346de90a3abc320df",
23
+ "metadataSha256": "61c66bab03bd7ee73ca425c814f02740c1f72c0d47391fe85bbb778a81aaf273"
24
24
  },
25
25
  "darwin-arm64": {
26
- "asset": "stackbite-0.5.91-macos-arm64-2d94b964c839.tar.gz",
27
- "url": "https://github.com/Shinick-Han/stackbite/releases/download/v0.5.91/stackbite-0.5.91-macos-arm64-2d94b964c839.tar.gz",
28
- "sha256": "83c15788134abefe06f62f3a549d055d2a93df1eada88a3dbb30927412cde9bf",
29
- "size": 29944040,
30
- "root": "stackbite-0.5.91-macos-arm64-2d94b964c839",
31
- "manifestSha256": "3a3ae1c2c6cc575b90a4b2e893e40f855c2b95591ab0bae0b1b5f513fe4201ab",
32
- "metadataSha256": "82472bc3cd7124fd725bcd3ff2613b660a98a1bbccb191f62d4e5f08f7d2915e"
26
+ "asset": "stackbite-0.5.92-macos-arm64-cc476a31b6ff.tar.gz",
27
+ "url": "https://github.com/Shinick-Han/stackbite/releases/download/v0.5.92/stackbite-0.5.92-macos-arm64-cc476a31b6ff.tar.gz",
28
+ "sha256": "c12210996e9ad9431f40db11abc57f4e14207285509164577da087b7e368f198",
29
+ "size": 30498979,
30
+ "root": "stackbite-0.5.92-macos-arm64-cc476a31b6ff",
31
+ "manifestSha256": "d4c4d72b78bd456de8fb9623cc8f658d79c0d75724a9250008bf0f2a0df0f025",
32
+ "metadataSha256": "d3d4f7903aab26562b91603c123d4817ebcb8a398e55c8063f756ca06ddf9a37"
33
33
  }
34
34
  }
35
35
  }