@aiwayds/dsh-opentui 0.9.5 → 0.9.7
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/CHANGELOG.md +32 -0
- package/README.md +8 -2
- package/dist/client/index.js +846 -204
- package/package.json +1 -1
- package/scripts/provision-opentui-profile.mjs +37 -8
package/package.json
CHANGED
|
@@ -43,8 +43,10 @@
|
|
|
43
43
|
// satisfied — a local development pin is never replaced by a registry version.
|
|
44
44
|
// Missing deps/versions → ONE batched `dsh plugin --profile opentui add
|
|
45
45
|
// <specs...>`; on failure the pnpm build-script skeleton is approved and each
|
|
46
|
-
// package is
|
|
47
|
-
//
|
|
46
|
+
// package is installed on its own with bounded spaced retries (a transient
|
|
47
|
+
// registry failure — TLS reset / ERR_PNPM_META_FETCH_FAIL — dies in seconds,
|
|
48
|
+
// a re-attempt after a short gap rides the burst out); a still-failing
|
|
49
|
+
// package is a WARN, never a hard stop (the client still launches).
|
|
48
50
|
//
|
|
49
51
|
// Step 4 reparses the profile manifest after the install: `dsh plugin add`
|
|
50
52
|
// already reconciles bundles for new dependencies, so this only fills the gaps
|
|
@@ -86,6 +88,14 @@ import {
|
|
|
86
88
|
|
|
87
89
|
const TEMPLATE = 'web'
|
|
88
90
|
const INSTALL_TIMEOUT_MS = 10 * 60 * 1000
|
|
91
|
+
// Bounded retry schedule for a single-spec install that failed (the fallback
|
|
92
|
+
// loop below). A transient registry failure (TLS reset / ERR_PNPM_META_FETCH_
|
|
93
|
+
// FAIL) exits within seconds, so 3 attempts spaced 5s apart ride the burst
|
|
94
|
+
// out without meaningfully extending a healthy provisioning run: the worst
|
|
95
|
+
// case adds ~2 fast failures + 2 x 5s per FAILING spec, and a hung `dsh
|
|
96
|
+
// plugin add` is still bounded by INSTALL_TIMEOUT_MS per invocation.
|
|
97
|
+
const PLUGIN_ADD_ATTEMPTS = 3
|
|
98
|
+
const PLUGIN_ADD_BACKOFF_MS = 5000
|
|
89
99
|
|
|
90
100
|
const args = process.argv.slice(2)
|
|
91
101
|
/** --name=value or --name value. */
|
|
@@ -340,6 +350,12 @@ function runPluginAdd(specs) {
|
|
|
340
350
|
})
|
|
341
351
|
}
|
|
342
352
|
|
|
353
|
+
/** Synchronous pause (this script is spawnSync end to end; there is no event
|
|
354
|
+
* loop to await on). */
|
|
355
|
+
function pauseSync(ms) {
|
|
356
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms)
|
|
357
|
+
}
|
|
358
|
+
|
|
343
359
|
const failedInstalls = []
|
|
344
360
|
let installedCount = 0
|
|
345
361
|
|
|
@@ -374,13 +390,26 @@ if (tier === 'none') {
|
|
|
374
390
|
say(3, 'plugins', 'approved the printed build scripts (pnpm allowBuilds) — retrying one by one…')
|
|
375
391
|
}
|
|
376
392
|
// Single-package fallback: one bad package must not sink the rest.
|
|
393
|
+
// Each failing spec gets bounded spaced retries (PLUGIN_ADD_ATTEMPTS /
|
|
394
|
+
// PLUGIN_ADD_BACKOFF_MS): a transient registry failure rides the burst
|
|
395
|
+
// out instead of WARN-ing the plugin away on the first drop. The
|
|
396
|
+
// terminal failure stays a WARN + failedInstalls entry — never a
|
|
397
|
+
// silent pass (the e2e npm-install boot leg asserts the delivered set).
|
|
377
398
|
for (const spec of specs) {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
399
|
+
let installed = false
|
|
400
|
+
for (let attempt = 1; attempt <= PLUGIN_ADD_ATTEMPTS && !installed; attempt += 1) {
|
|
401
|
+
if (attempt > 1) {
|
|
402
|
+
say(3, 'plugins', `${spec} failed — retry ${attempt - 1}/${PLUGIN_ADD_ATTEMPTS - 1} in ${PLUGIN_ADD_BACKOFF_MS / 1000}s…`)
|
|
403
|
+
pauseSync(PLUGIN_ADD_BACKOFF_MS)
|
|
404
|
+
}
|
|
405
|
+
const retry = runPluginAdd([spec])
|
|
406
|
+
if (!retry.error && retry.status === 0) {
|
|
407
|
+
installedCount += 1
|
|
408
|
+
installed = true
|
|
409
|
+
} else if (attempt === PLUGIN_ADD_ATTEMPTS) {
|
|
410
|
+
failedInstalls.push(spec)
|
|
411
|
+
warn(`could not install ${spec}${retry.error ? `: ${retry.error.message}` : ` (exit ${retry.status})`} — continuing`)
|
|
412
|
+
}
|
|
384
413
|
}
|
|
385
414
|
}
|
|
386
415
|
}
|