@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.
- package/README.md +2 -1
- package/dist/src/acquisition/lock.d.ts +1 -1
- package/dist/src/acquisition/lock.js +1 -1
- package/dist/src/acquisition/pins.js +3 -3
- package/dist/src/acquisition/runtime.d.ts +1 -0
- package/dist/src/acquisition/runtime.js +4 -2
- package/dist/src/cli/main.js +1 -1
- package/native/runtime-manifest.json +4 -4
- package/package.json +1 -1
|
@@ -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.
|
|
5
|
-
ghostget: { version: '0.18.
|
|
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: "
|
|
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:
|
|
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');
|
package/dist/src/cli/main.js
CHANGED
|
@@ -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": "
|
|
30
|
+
"asrSourceSha256": "ff8c83a1963c3d1e1a63b03279ae4fa9b7c5d914c8ec82115f886a9b23b9eb7d",
|
|
31
31
|
"clangVersion": "Apple clang version 21.0.0 (clang-2100.1.1.101)",
|
|
32
|
-
"embeddingSourceSha256": "
|
|
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.
|
|
36
|
+
"packageVersion": "0.2.1",
|
|
37
37
|
"platform": "darwin",
|
|
38
38
|
"schemaVersion": 1,
|
|
39
|
-
"sourceCommit": "
|
|
39
|
+
"sourceCommit": "16156a5bb4b73318da65dbf950d4c3d9f6a4aba9"
|
|
40
40
|
}
|