@hraness/sponge 0.2.0 → 0.2.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.
@@ -1,9 +1,9 @@
1
1
  import { captureLockfile } from './lock.js';
2
2
  /** Immutable released media/PDF capability pins; installed qualification is recorded separately. */
3
3
  export const defaultCapturePins = {
4
- id: 'capture-ghostget-0.18.94-bun-1.3.14-darwin-arm64',
5
- ghostget: { version: '0.18.94', url: 'https://github.com/hraness/ghostget/releases/download/v0.18.94/hraness-ghostget-0.18.94.tgz', bytes: 12379758, sha256: '1409271320b4b35467d04a085a39e6c958d065c7f79c4b1092b2854861c85bbb' },
4
+ id: 'capture-ghostget-0.18.99-bun-1.3.14-darwin-arm64',
5
+ ghostget: { version: '0.18.99', url: 'https://github.com/hraness/ghostget/releases/download/v0.18.99/hraness-ghostget-0.18.99.tgz', bytes: 12470970, sha256: '91d226b2d69884f7119f11ae9316f37134c3da7e127e91ae210c982eced92530' },
6
6
  wordcell: { version: '0.27.0', url: 'https://github.com/hraness/wordcell/releases/download/v0.27.0/hraness-wordcell-0.27.0.tgz', bytes: 1465897, sha256: 'df47868147cda46d741895d3cd1ddcbec14a563b341aa09052545be7696c9262' },
7
7
  bun: { version: '1.3.14', url: 'https://github.com/oven-sh/bun/releases/download/bun-v1.3.14/bun-darwin-aarch64.zip', bytes: 23586433, sha256: 'd8b96221828ad6f97ac7ac0ab7e95872341af763001e8803e8267652c2652620', executableSha256: 'e0c90ec15d33363e6b70713d56bc3b2c7585c17f40a0fe0f8fd9305901d4e233', archiveExecutable: 'bun-darwin-aarch64/bun' },
8
- lockfile: captureLockfile, lockSha256: "c18916866933f1f59e7dd2067966477cc576ada21b9e6965ba5395035ad54b88",
8
+ lockfile: captureLockfile, lockSha256: "1dec6b6e96f6e2dc7ddecafb087ca5599b438a7d282e7b7d88aca5ebad1e9e6c",
9
9
  };
@@ -32,6 +32,7 @@ export interface SetupPlan {
32
32
  installationBudgetBytes: number;
33
33
  stagingBudgetBytes: number;
34
34
  installationBudgetKind: 'monitored';
35
+ installationDeadlineMs: number;
35
36
  dependencyDownloads: 'frozen-lock';
36
37
  requiredFreeBytes: number;
37
38
  capabilities: string[];
@@ -14,6 +14,8 @@ export class CaptureSetupError extends Error {
14
14
  // Retained inventory excludes the isolated Bun cache and temporary Bun zip.
15
15
  const budget = 1024 ** 3;
16
16
  const stagingBudget = 2 * budget;
17
+ // The frozen dependency install measured 460 s on a slow link; 300 s aborted valid setups.
18
+ const installDeadlineMs = 30 * 60 * 1000;
17
19
  function checkPins(pins) {
18
20
  if (!/^[a-z0-9][a-z0-9.-]{0,99}$/.test(pins.id) || hash(pins.lockfile) !== pins.lockSha256)
19
21
  throw new CaptureSetupError('invalid-input');
@@ -34,7 +36,7 @@ function checkPins(pins) {
34
36
  export function captureSetupPlan(pins) {
35
37
  checkPins(pins);
36
38
  const artifacts = [pins.bun, pins.ghostget, pins.wordcell], downloadBytes = artifacts.reduce((n, a) => n + a.bytes, 0);
37
- return { artifacts, downloadBytes, installationBudgetBytes: budget, stagingBudgetBytes: stagingBudget, installationBudgetKind: 'monitored', dependencyDownloads: 'frozen-lock', requiredFreeBytes: 2 * 1024 ** 3 + budget + stagingBudget + downloadBytes, capabilities: ['article-http', 'selected-ghostget-account', 'selected-attached-browser', 'verified-offline-images'] };
39
+ return { artifacts, downloadBytes, installationBudgetBytes: budget, stagingBudgetBytes: stagingBudget, installationBudgetKind: 'monitored', installationDeadlineMs: installDeadlineMs, dependencyDownloads: 'frozen-lock', requiredFreeBytes: 2 * 1024 ** 3 + budget + stagingBudget + downloadBytes, capabilities: ['article-http', 'selected-ghostget-account', 'selected-attached-browser', 'verified-offline-images'] };
38
40
  }
39
41
  async function download(pin, path, signal) {
40
42
  const boundedSignal = signal ? AbortSignal.any([signal, AbortSignal.timeout(120000)]) : AbortSignal.timeout(120000);
@@ -158,7 +160,7 @@ async function provisionRuntime(options) {
158
160
  await download(pins.wordcell, join(stage, `hraness-wordcell-${pins.wordcell.version}.tgz`), controller.signal);
159
161
  await writeFile(join(stage, 'package.json'), JSON.stringify({ private: true, dependencies: { '@hraness/ghostget': `./hraness-ghostget-${pins.ghostget.version}.tgz` } }), { mode: 0o600 });
160
162
  await writeFile(join(stage, 'bun.lock'), pins.lockfile, { mode: 0o600 });
161
- const install = await runOwned(bun, ['install', '--frozen-lockfile', '--ignore-scripts'], { cwd: stage, env: isolatedEnvironment(home, home, home), signal: controller.signal, deadlineMs: 300000, maxOutputBytes: 65536 });
163
+ const install = await runOwned(bun, ['install', '--frozen-lockfile', '--ignore-scripts'], { cwd: stage, env: isolatedEnvironment(home, home, home), signal: controller.signal, deadlineMs: installDeadlineMs, maxOutputBytes: 65536 });
162
164
  cleanup = install.cleanup;
163
165
  if (install.code !== 0 || install.stopped || cleanup !== 'settled')
164
166
  throw new CaptureSetupError(limitExceeded ? 'limit-exceeded' : install.stopped ?? 'unavailable');
@@ -124,7 +124,7 @@ export async function main(argv, version) {
124
124
  }
125
125
  if (args.command === 'setup') {
126
126
  const plan = captureSetupPlan(defaultCapturePins);
127
- process.stderr.write(`Capture setup: ${plan.downloadBytes} pinned artifact bytes, plus frozen dependency downloads. Temporary installation limit: ${plan.stagingBudgetBytes} bytes; retained runtime limit: ${plan.installationBudgetBytes} bytes. ${plan.requiredFreeBytes} free bytes required.\n`);
127
+ process.stderr.write(`Capture setup: ${plan.downloadBytes} pinned artifact bytes, plus frozen dependency downloads. Temporary installation limit: ${plan.stagingBudgetBytes} bytes; retained runtime limit: ${plan.installationBudgetBytes} bytes; dependency installation deadline: ${plan.installationDeadlineMs / 60000} minutes. ${plan.requiredFreeBytes} free bytes required.\n`);
128
128
  await provisionCapture({ runtimeRoot: join(store.root, 'runtime', 'capture'), pins: defaultCapturePins, signal: controller.signal });
129
129
  emit({ capture: 'ready' }, 'Capture ready');
130
130
  return 0;
@@ -27,14 +27,14 @@
27
27
  }
28
28
  ],
29
29
  "build": {
30
- "asrSourceSha256": "945667d78c598c30293f666d6605c9af26818b8d313c2219ac95985807c00ffc",
30
+ "asrSourceSha256": "ff8c83a1963c3d1e1a63b03279ae4fa9b7c5d914c8ec82115f886a9b23b9eb7d",
31
31
  "clangVersion": "Apple clang version 21.0.0 (clang-2100.1.1.101)",
32
- "embeddingSourceSha256": "e31b9a70865c3c7195d201233a2a240fc7ef2aa40b4ae63291d1277262456c69",
32
+ "embeddingSourceSha256": "41b8381f87a32b2e9ab2fa24fcde9043463eae2117aa4b7cd758537dbb169d06",
33
33
  "swiftVersion": "Apple Swift version 6.3.3 (swiftlang-6.3.3.1.3 clang-2100.1.1.101)"
34
34
  },
35
35
  "minimumMacOS": "26.0",
36
- "packageVersion": "0.2.0",
36
+ "packageVersion": "0.2.1",
37
37
  "platform": "darwin",
38
38
  "schemaVersion": 1,
39
- "sourceCommit": "439d0bd72f834a26a248ce2e9fee1a6a6bffaf57"
39
+ "sourceCommit": "16156a5bb4b73318da65dbf950d4c3d9f6a4aba9"
40
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hraness/sponge",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "A local library for captured articles and verified offline assets.",
5
5
  "repository": {
6
6
  "type": "git",