glimmervoid 0.48.3-next.337 → 0.48.3-next.338
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/dist/bin/glimmervoid.js +3 -3
- package/dist/chunks/{adapters-SWcaMeiS.js → adapters-Cypnpb15.js} +1 -1
- package/dist/chunks/{adapters-BLwLbCbP.js → adapters-D3fvjFaD.js} +1 -1
- package/dist/chunks/{main-C010jfJ0.js → main-0009_pTr.js} +281 -29
- package/dist/client/assets/{action-status-2TEW4EL2.js → action-status-DEIpSTGp.js} +1 -1
- package/dist/client/assets/action-status-DEIpSTGp.js.br +0 -0
- package/dist/client/assets/{benchmark-panel-jKczyBsZ.js → benchmark-panel-BRFTeSqM.js} +1 -1
- package/dist/client/assets/benchmark-panel-BRFTeSqM.js.br +0 -0
- package/dist/client/assets/{boards-view-r9ysDKVz.js → boards-view-TLypYqAg.js} +1 -1
- package/dist/client/assets/boards-view-TLypYqAg.js.br +0 -0
- package/dist/client/assets/{card-registry-D5FILlqB.js → card-registry-DmMhE6ta.js} +1 -1
- package/dist/client/assets/card-registry-DmMhE6ta.js.br +5 -0
- package/dist/client/assets/{community-panel-D0um5dCB.js → community-panel-C1gWJW6_.js} +1 -1
- package/dist/client/assets/community-panel-C1gWJW6_.js.br +0 -0
- package/dist/client/assets/{control-ws-CLjOEjA2.js → control-ws-B-xw3MKQ.js} +1 -1
- package/dist/client/assets/control-ws-B-xw3MKQ.js.br +0 -0
- package/dist/client/assets/{dialogs-KYf3mpVq.js → dialogs-CRkEBEiq.js} +1 -1
- package/dist/client/assets/dialogs-CRkEBEiq.js.br +0 -0
- package/dist/client/assets/{doc-editor-ui-B1UVTG3s.js → doc-editor-ui-B_8viqxw.js} +1 -1
- package/dist/client/assets/doc-editor-ui-B_8viqxw.js.br +0 -0
- package/dist/client/assets/{feature-hint-CkU5nF1K.js → feature-hint-DO-aybsI.js} +1 -1
- package/dist/client/assets/feature-hint-DO-aybsI.js.br +0 -0
- package/dist/client/assets/{first-run-checklist-B2BuAX_w.js → first-run-checklist-SHvEYdTu.js} +1 -1
- package/dist/client/assets/first-run-checklist-SHvEYdTu.js.br +0 -0
- package/dist/client/assets/{hooks-panel-E2uUiL8g.js → hooks-panel-DK4CY8VY.js} +1 -1
- package/dist/client/assets/hooks-panel-DK4CY8VY.js.br +0 -0
- package/dist/client/assets/{index-DNCFW7HQ.js → index-B_oNC3Sc.js} +5 -5
- package/dist/client/assets/index-B_oNC3Sc.js.br +0 -0
- package/dist/client/assets/{issues-panel-B1DFAvrx.js → issues-panel-9P2KzSnH.js} +1 -1
- package/dist/client/assets/issues-panel-9P2KzSnH.js.br +0 -0
- package/dist/client/assets/{my-prs-panel-2gYv28N1.js → my-prs-panel-C17m32_e.js} +1 -1
- package/dist/client/assets/my-prs-panel-C17m32_e.js.br +0 -0
- package/dist/client/assets/{nyan-cat-DIPme3y-.js → nyan-cat-QqAMOi4g.js} +1 -1
- package/dist/client/assets/nyan-cat-QqAMOi4g.js.br +0 -0
- package/dist/client/assets/{phone-shell-BtFmDho7.js → phone-shell-Dtiz-0UA.js} +1 -1
- package/dist/client/assets/phone-shell-Dtiz-0UA.js.br +0 -0
- package/dist/client/assets/{plan-face-CybcdwGY.js → plan-face-rUFfIfmY.js} +1 -1
- package/dist/client/assets/plan-face-rUFfIfmY.js.br +0 -0
- package/dist/client/assets/{plan-render-D1sERNqT.js → plan-render-CgMI21b0.js} +1 -1
- package/dist/client/assets/plan-render-CgMI21b0.js.br +0 -0
- package/dist/client/assets/{pr-queue-columns-DLiNQnxA.js → pr-queue-columns-BdxYvTFC.js} +1 -1
- package/dist/client/assets/pr-queue-columns-BdxYvTFC.js.br +0 -0
- package/dist/client/assets/{radar-panel-Ck-ZVUWi.js → radar-panel-DapDj8zP.js} +1 -1
- package/dist/client/assets/radar-panel-DapDj8zP.js.br +0 -0
- package/dist/client/assets/{repo-roots-adder-DOItOVb5.js → repo-roots-adder-v-DHQytC.js} +1 -1
- package/dist/client/assets/repo-roots-adder-v-DHQytC.js.br +0 -0
- package/dist/client/assets/{resume-dialog-Od7CQuDr.js → resume-dialog-DK73QeZH.js} +1 -1
- package/dist/client/assets/resume-dialog-DK73QeZH.js.br +0 -0
- package/dist/client/assets/{review-queue-panel-CzMD36ii.js → review-queue-panel-DlRtNTyc.js} +1 -1
- package/dist/client/assets/review-queue-panel-DlRtNTyc.js.br +0 -0
- package/dist/client/assets/{session-tick-D-qLNqb3.js → session-tick-D5WnSMBa.js} +1 -1
- package/dist/client/assets/{settings-panel-CovjR75P.js → settings-panel-AW1MazWP.js} +2 -2
- package/dist/client/assets/settings-panel-AW1MazWP.js.br +0 -0
- package/dist/client/assets/{shown-lightbox-BRpxsqKx.js → shown-lightbox-C2eUqnGv.js} +1 -1
- package/dist/client/assets/shown-lightbox-C2eUqnGv.js.br +0 -0
- package/dist/client/assets/{team-review-panel-CQuVL2yx.js → team-review-panel-QM1yrDN2.js} +1 -1
- package/dist/client/assets/team-review-panel-QM1yrDN2.js.br +0 -0
- package/dist/client/assets/{trace-panel-CkGMUS9b.js → trace-panel-Dw38AiIi.js} +1 -1
- package/dist/client/assets/trace-panel-Dw38AiIi.js.br +0 -0
- package/dist/client/assets/{updates-view-core-C8XDTgVm.js → updates-view-core-DcQGhSIg.js} +1 -1
- package/dist/client/assets/updates-view-core-DcQGhSIg.js.br +0 -0
- package/dist/client/assets/{usage-panel-nfEwK_fR.js → usage-panel-BizUcFXB.js} +1 -1
- package/dist/client/assets/usage-panel-BizUcFXB.js.br +0 -0
- package/dist/client/assets/{your-day-tip-DeUJQvGU.js → your-day-tip-nLky3Sn7.js} +1 -1
- package/dist/client/assets/your-day-tip-nLky3Sn7.js.br +0 -0
- package/dist/client/index.html +6 -6
- package/dist/client/index.html.br +0 -0
- package/dist/server/index.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/action-status-2TEW4EL2.js.br +0 -0
- package/dist/client/assets/benchmark-panel-jKczyBsZ.js.br +0 -0
- package/dist/client/assets/boards-view-r9ysDKVz.js.br +0 -0
- package/dist/client/assets/card-registry-D5FILlqB.js.br +0 -0
- package/dist/client/assets/community-panel-D0um5dCB.js.br +0 -0
- package/dist/client/assets/control-ws-CLjOEjA2.js.br +0 -0
- package/dist/client/assets/dialogs-KYf3mpVq.js.br +0 -0
- package/dist/client/assets/doc-editor-ui-B1UVTG3s.js.br +0 -0
- package/dist/client/assets/feature-hint-CkU5nF1K.js.br +0 -0
- package/dist/client/assets/first-run-checklist-B2BuAX_w.js.br +0 -0
- package/dist/client/assets/hooks-panel-E2uUiL8g.js.br +0 -0
- package/dist/client/assets/index-DNCFW7HQ.js.br +0 -0
- package/dist/client/assets/issues-panel-B1DFAvrx.js.br +0 -0
- package/dist/client/assets/my-prs-panel-2gYv28N1.js.br +0 -0
- package/dist/client/assets/nyan-cat-DIPme3y-.js.br +0 -0
- package/dist/client/assets/phone-shell-BtFmDho7.js.br +0 -0
- package/dist/client/assets/plan-face-CybcdwGY.js.br +0 -0
- package/dist/client/assets/plan-render-D1sERNqT.js.br +0 -0
- package/dist/client/assets/pr-queue-columns-DLiNQnxA.js.br +0 -0
- package/dist/client/assets/radar-panel-Ck-ZVUWi.js.br +0 -0
- package/dist/client/assets/repo-roots-adder-DOItOVb5.js.br +0 -0
- package/dist/client/assets/resume-dialog-Od7CQuDr.js.br +0 -0
- package/dist/client/assets/review-queue-panel-CzMD36ii.js.br +0 -0
- package/dist/client/assets/settings-panel-CovjR75P.js.br +0 -0
- package/dist/client/assets/shown-lightbox-BRpxsqKx.js.br +0 -0
- package/dist/client/assets/team-review-panel-CQuVL2yx.js.br +0 -0
- package/dist/client/assets/trace-panel-CkGMUS9b.js.br +0 -0
- package/dist/client/assets/updates-view-core-C8XDTgVm.js.br +0 -0
- package/dist/client/assets/usage-panel-nfEwK_fR.js.br +0 -0
- package/dist/client/assets/your-day-tip-DeUJQvGU.js.br +0 -0
package/dist/bin/glimmervoid.js
CHANGED
|
@@ -58,8 +58,7 @@ if (commandLine.globalOptions.configPath) process.env.GLIMMERVOID_CONFIG = comma
|
|
|
58
58
|
if (commandLine.globalOptions.port) process.env.GLIMMERVOID_PORT = commandLine.globalOptions.port;
|
|
59
59
|
var OWNED_COMMAND_RUNNERS = {
|
|
60
60
|
doctor: async () => {
|
|
61
|
-
await runDoctor();
|
|
62
|
-
return 0;
|
|
61
|
+
return await runDoctor() ? 0 : 1;
|
|
63
62
|
},
|
|
64
63
|
pair: async ({ values }) => {
|
|
65
64
|
const { runPairCli } = await import("../chunks/pair-cli-CEnZQWHm.js");
|
|
@@ -247,7 +246,7 @@ async function runDoctor() {
|
|
|
247
246
|
}
|
|
248
247
|
switchSection("Agents");
|
|
249
248
|
try {
|
|
250
|
-
const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-
|
|
249
|
+
const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-Cypnpb15.js");
|
|
251
250
|
const declaredCustomAgents = await readDeclaredCustomAgents();
|
|
252
251
|
if (declaredCustomAgents.error) line("config", declaredCustomAgents.error);
|
|
253
252
|
setCustomAgents(declaredCustomAgents.declared);
|
|
@@ -299,6 +298,7 @@ async function runDoctor() {
|
|
|
299
298
|
onPathFlag: false,
|
|
300
299
|
platform
|
|
301
300
|
})}`);
|
|
301
|
+
return nodePty.ok;
|
|
302
302
|
}
|
|
303
303
|
function resolveNpmGlobalPrefix(exec) {
|
|
304
304
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-
|
|
1
|
+
export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-D3fvjFaD.js";
|
|
@@ -2150,4 +2150,4 @@ function resetCommandCache() {
|
|
|
2150
2150
|
resolvedCommands.clear();
|
|
2151
2151
|
}
|
|
2152
2152
|
//#endregion
|
|
2153
|
-
export {
|
|
2153
|
+
export { grokHomes as $, decideUploadType as A, containmentRefusalReason as B, parseRegistryLatest as C, shouldReplace as Ct, openContainedFile as D, claudeCode as Dt, shortSha as E, HOOK_TOOLS as Et, planUploadRetention as F, codexFallbackRoots as G, planContiguousRead as H, MAX_TRANSCRIPT_READ_BYTES as I, codexSessionIdFromPath as J, codexHomes as K, TRACE_TAIL_SCAN_BYTES as L, framePathPaste as M, imageMimeForUploadFilename as N, MAX_UPLOAD_BYTES as O, isSafePathSegment as P, expandTilde as Q, committedOffsetFromTraceTailOrNull as R, parseRegistryDeprecation as S, parseUsageLine as St, pickNewestPublished as T, vendorUsageEntry as Tt, resumeOffsetFrom as U, isOversizedPartialLine as V, withCommittedOffset as W, decideFileRead as X, continuationDelayMs as Y, dedupeCodexFiles as Z, decideInstallFlavor as _, foldReplacementIntoGenerationRollup as _t, describeAgentResolvability as a, scopedClaudeRoots as at, normalizeSha as b, mergeGenerationRollups as bt, isKnownAgentId as c, shouldPersistWarehouse as ct, resolveAdapter as d, parseKimiUsageLine as dt, isUsageFile as et, setCustomAgents as f, addEntryToTotals as ft, NODE_PTY_INSTALL_SCRIPT_FLAG as g, foldEntryIntoGenerationRollup as gt, requestCodexAppServer as h, expandAdvisorIterations as ht, customAgentFingerprint as i, resolveProjectsDirs as it, exceedsUploadCap as j, buildUploadFilename as k, listAgentIds as l, splitLines as lt, readHostCodexVersion as m, emptyTotals as mt, cachedAgentResolvability as n, passOutcome as nt, getAdapter as o, sessionsRootCandidates as ot, codex as p, dedupKeys as pt, codexRootCandidates as q, commandFor as r, projectDirCandidates as rt, hookProfileOf as s, shouldEvaluateDespiteIoFailures as st, DEFAULT_AGENT_ID as t, kimiHomes as tt, resetCommandCache as u, kimiDedupIdentity as ut, decideUpdateStatus as v, identityFromRelPath as vt, parseResolvedSha as w, totalTokensOf as wt, normalizeUpdateChannel as x, parseJsonLine as xt, isCheckFresh as y, isWithinGenerationRecencyWindow as yt, completeLineBytes as z };
|
|
@@ -20,7 +20,7 @@ import { C as parseCgroupBytes, D as DEFAULT_MAX_MS, E as DEFAULT_BASE_MS, O as
|
|
|
20
20
|
import { $ as stableConfigKey, B as buildPersonProperties, F as TELEMETRY_FLAGS_URL, G as decideRemoteTelemetryState, H as claudeAccountUuidOf, I as adapterBucket, J as nodeMajorVersion, K as decideTelemetryConsent, L as buildAiGenerationEvents, M as isExperimentalSetting, N as FIRST_RUN_NOTICE, P as TELEMETRY_BATCH_URL, R as buildBrowserExceptionProperties, U as codexUserIdOf, V as classifySessionExit, W as decideIsDevInstall, X as resolveProjectToken, Y as parsePosthogReleaseId, _ as settingsBlockSpecFor, a as ensureProjectIds, at as sessionIdFromBranch, ct as canonicalizePath, f as DEFAULT_TIMER_FNS, g as mergeSettingsBlock, i as createConfigStore, it as planWorktreeGc, k as valueAtPath, lt as comparableDirectoryPath, n as DEFAULT_CONFIG, nt as matchedPrefix, o as generateProjectId, ot as usablePrefixes, p as unrefTimer, q as exceptionFingerprint, rt as planBranchGc, s as glimmervoidHomeDir$1, st as worktreeIntegrationTips, t as ABORT_CONFIG_SAVE, tt as DEFAULT_BRANCH_GC_PREFIXES, ut as isSameDirectoryPath, v as validateSettingsBlock, y as SETTINGS_INDEX, z as buildExceptionProperties } from "./config-store-D5RoJ_zB.js";
|
|
21
21
|
import { _ as TelemetryState, a as DEEP_HISTORY_SCROLLBACK_LINES, c as describeDataAttach, d as DashboardTelemetryReport, h as TELEMETRY_EVENT_SCHEMAS, i as HookEnvelope, l as parseDataAttach, m as PendingCrashReport, r as HTTP_URL_RE, s as LOGGED_FAST_CLOSE_COUNTS, u as parseDataClientMessage } from "./build-channel-CuS5bnD6.js";
|
|
22
22
|
import { i as resolveArgvCommandMatches } from "./kimi-BUCUWtAv.js";
|
|
23
|
-
import { $ as
|
|
23
|
+
import { $ as grokHomes, A as decideUploadType, B as containmentRefusalReason, C as parseRegistryLatest, Ct as shouldReplace, D as openContainedFile, Dt as claudeCode, E as shortSha$1, Et as HOOK_TOOLS, F as planUploadRetention, G as codexFallbackRoots, H as planContiguousRead, I as MAX_TRANSCRIPT_READ_BYTES, J as codexSessionIdFromPath, K as codexHomes, L as TRACE_TAIL_SCAN_BYTES, M as framePathPaste, N as imageMimeForUploadFilename, O as MAX_UPLOAD_BYTES, P as isSafePathSegment, Q as expandTilde, R as committedOffsetFromTraceTailOrNull, S as parseRegistryDeprecation, St as parseUsageLine, T as pickNewestPublished, Tt as vendorUsageEntry, U as resumeOffsetFrom, V as isOversizedPartialLine, W as withCommittedOffset, X as decideFileRead, Y as continuationDelayMs, Z as dedupeCodexFiles, _ as decideInstallFlavor, _t as foldReplacementIntoGenerationRollup, a as describeAgentResolvability, at as scopedClaudeRoots, b as normalizeSha, bt as mergeGenerationRollups, c as isKnownAgentId, ct as shouldPersistWarehouse, d as resolveAdapter, dt as parseKimiUsageLine, et as isUsageFile, f as setCustomAgents, ft as addEntryToTotals, g as NODE_PTY_INSTALL_SCRIPT_FLAG, gt as foldEntryIntoGenerationRollup, h as requestCodexAppServer, ht as expandAdvisorIterations, i as customAgentFingerprint, it as resolveProjectsDirs, j as exceedsUploadCap, k as buildUploadFilename, l as listAgentIds, lt as splitLines, m as readHostCodexVersion, mt as emptyTotals, n as cachedAgentResolvability, nt as passOutcome, o as getAdapter, ot as sessionsRootCandidates, p as codex, pt as dedupKeys, q as codexRootCandidates, r as commandFor, rt as projectDirCandidates, s as hookProfileOf, st as shouldEvaluateDespiteIoFailures, t as DEFAULT_AGENT_ID$1, tt as kimiHomes, u as resetCommandCache, ut as kimiDedupIdentity, v as decideUpdateStatus, vt as identityFromRelPath, w as parseResolvedSha, wt as totalTokensOf$1, x as normalizeUpdateChannel, xt as parseJsonLine, y as isCheckFresh, yt as isWithinGenerationRecencyWindow, z as completeLineBytes } from "./adapters-D3fvjFaD.js";
|
|
24
24
|
import { c as CODEX_HOME_PROFILE, l as KIMI_HOME_PROFILE } from "./agent-home-core-DgW3orTE.js";
|
|
25
25
|
import { d as releaseSessionLock, f as sessionIdOfLockFile, l as releaseUnheldAgentHomeSecrets, n as generatedAgentHomePath, p as trashSessionTempFolderOnceUnheld, s as realAgentHome, u as createHeldSessionTempFolder } from "./agent-home-BzANIIVe.js";
|
|
26
26
|
import { a as formatSshPublicKey, c as orderAgentSockets, i as commitSigningShimText, l as parseSshPublicKey, n as NO_AGENT_HOLDS_KEY, o as isForwardedAgentDirName, r as agentListsKey, s as isSignableGitObject, t as COMMIT_SIGNING_SHIM_NAME } from "./ssh-signing-core-CRhVVWNW.js";
|
|
@@ -47811,6 +47811,8 @@ var QUARANTINED_DIST_NAME = "broken-dist";
|
|
|
47811
47811
|
var QUARANTINED_DEPENDENCIES_NAME = "broken-node_modules";
|
|
47812
47812
|
var SUPPORTED_UPDATE_REMOTE = "origin";
|
|
47813
47813
|
var LOWEST_SCHEDULING_PRIORITY = "19";
|
|
47814
|
+
var NPM_PACKAGE_FOLDER_NAME = "glimmervoid";
|
|
47815
|
+
var NPM_GLOBAL_UPDATE_FOLDER_NAME = ".glimmervoid-update";
|
|
47814
47816
|
var TRANSITIONS_ALLOWED_BY_STATE = Object.freeze({
|
|
47815
47817
|
idle: Object.freeze(["begin-run"]),
|
|
47816
47818
|
running: Object.freeze([
|
|
@@ -47866,10 +47868,10 @@ function decidePreflight(facts) {
|
|
|
47866
47868
|
reason: "unsupported-flavor",
|
|
47867
47869
|
message: "Glimmervoid runs from the npx cache. Stop Glimmervoid and run the command shown."
|
|
47868
47870
|
};
|
|
47869
|
-
if (facts.flavor !== "clone") return {
|
|
47871
|
+
if (facts.flavor !== "clone" && facts.flavor !== "npm-global") return {
|
|
47870
47872
|
ok: false,
|
|
47871
47873
|
reason: "unsupported-flavor",
|
|
47872
|
-
message: "Use the install command because dashboard updates
|
|
47874
|
+
message: "Use the install command because dashboard updates need a clone or an npm global install."
|
|
47873
47875
|
};
|
|
47874
47876
|
if (facts.platform === "win32") return {
|
|
47875
47877
|
ok: false,
|
|
@@ -47886,6 +47888,45 @@ function decidePreflight(facts) {
|
|
|
47886
47888
|
reason: "no-update-available",
|
|
47887
47889
|
message: "No update is available."
|
|
47888
47890
|
};
|
|
47891
|
+
if (facts.flavor === "npm-global") return decideNpmGlobalPreflight(facts);
|
|
47892
|
+
return decideClonePreflight(facts);
|
|
47893
|
+
}
|
|
47894
|
+
function decideRunPreflight(facts) {
|
|
47895
|
+
if (facts.journalState === "running") return {
|
|
47896
|
+
ok: false,
|
|
47897
|
+
reason: "already-running",
|
|
47898
|
+
message: "Wait for the current update to finish."
|
|
47899
|
+
};
|
|
47900
|
+
if (facts.journalState === "staged") return {
|
|
47901
|
+
ok: false,
|
|
47902
|
+
reason: "already-staged",
|
|
47903
|
+
message: "Restart to apply the staged update."
|
|
47904
|
+
};
|
|
47905
|
+
if (facts.restartRequested) return {
|
|
47906
|
+
ok: false,
|
|
47907
|
+
reason: "restart-requested",
|
|
47908
|
+
message: "Wait for the requested restart to finish."
|
|
47909
|
+
};
|
|
47910
|
+
return {
|
|
47911
|
+
ok: true,
|
|
47912
|
+
lockfileCheckNeeded: true
|
|
47913
|
+
};
|
|
47914
|
+
}
|
|
47915
|
+
function decideNpmGlobalPreflight(facts) {
|
|
47916
|
+
const install = facts.npmGlobalInstall;
|
|
47917
|
+
if (!install) return {
|
|
47918
|
+
ok: false,
|
|
47919
|
+
reason: "unsupported-flavor",
|
|
47920
|
+
message: "Use the install command because this install is not in an npm global folder."
|
|
47921
|
+
};
|
|
47922
|
+
if (install.isWritable === false) return {
|
|
47923
|
+
ok: false,
|
|
47924
|
+
reason: "install-not-writable",
|
|
47925
|
+
message: `Use the install command because Glimmervoid cannot write to ${install.installFolder}.`
|
|
47926
|
+
};
|
|
47927
|
+
return decideRunPreflight(facts);
|
|
47928
|
+
}
|
|
47929
|
+
function decideClonePreflight(facts) {
|
|
47889
47930
|
if (!facts.isTreeClean) return {
|
|
47890
47931
|
ok: false,
|
|
47891
47932
|
reason: "dirty-tree",
|
|
@@ -47922,25 +47963,7 @@ function decidePreflight(facts) {
|
|
|
47922
47963
|
reason: "nothing-to-do",
|
|
47923
47964
|
message: "The checkout is already at the target. Check for updates again."
|
|
47924
47965
|
};
|
|
47925
|
-
|
|
47926
|
-
ok: false,
|
|
47927
|
-
reason: "already-running",
|
|
47928
|
-
message: "Wait for the current update to finish."
|
|
47929
|
-
};
|
|
47930
|
-
if (facts.journalState === "staged") return {
|
|
47931
|
-
ok: false,
|
|
47932
|
-
reason: "already-staged",
|
|
47933
|
-
message: "Restart to apply the staged update."
|
|
47934
|
-
};
|
|
47935
|
-
if (facts.restartRequested) return {
|
|
47936
|
-
ok: false,
|
|
47937
|
-
reason: "restart-requested",
|
|
47938
|
-
message: "Wait for the requested restart to finish."
|
|
47939
|
-
};
|
|
47940
|
-
return {
|
|
47941
|
-
ok: true,
|
|
47942
|
-
lockfileCheckNeeded: true
|
|
47943
|
-
};
|
|
47966
|
+
return decideRunPreflight(facts);
|
|
47944
47967
|
}
|
|
47945
47968
|
function decideFastForward({ canFastForward, isTargetAncestorOfHead }) {
|
|
47946
47969
|
if (canFastForward) return {
|
|
@@ -48009,13 +48032,47 @@ function planHandOffRenames({ root, stagingPath, lockfileChanged }) {
|
|
|
48009
48032
|
});
|
|
48010
48033
|
return {
|
|
48011
48034
|
renames,
|
|
48012
|
-
reversalsByFailureIndex:
|
|
48013
|
-
|
|
48014
|
-
|
|
48015
|
-
|
|
48016
|
-
|
|
48035
|
+
reversalsByFailureIndex: reversalsFor(renames)
|
|
48036
|
+
};
|
|
48037
|
+
}
|
|
48038
|
+
function decideNpmGlobalLayout(packageRoot) {
|
|
48039
|
+
const segments = packageRoot.replace(/\/+$/, "").split("/");
|
|
48040
|
+
const [libName, nodeModulesName, packageName] = segments.slice(-3);
|
|
48041
|
+
if (packageName !== NPM_PACKAGE_FOLDER_NAME || nodeModulesName !== "node_modules" || libName !== "lib") return null;
|
|
48042
|
+
const installFolder = segments.slice(0, -1).join("/");
|
|
48043
|
+
const updatePath = `${installFolder}/${NPM_GLOBAL_UPDATE_FOLDER_NAME}`;
|
|
48044
|
+
const stagePrefix = `${updatePath}/stage`;
|
|
48045
|
+
return {
|
|
48046
|
+
installFolder,
|
|
48047
|
+
livePackagePath: segments.join("/"),
|
|
48048
|
+
updatePath,
|
|
48049
|
+
stagePrefix,
|
|
48050
|
+
stagedPackagePath: `${stagePrefix}/lib/node_modules/${NPM_PACKAGE_FOLDER_NAME}`,
|
|
48051
|
+
previousPackagePath: `${updatePath}/previous`
|
|
48017
48052
|
};
|
|
48018
48053
|
}
|
|
48054
|
+
function planNpmGlobalHandOffRenames(layout) {
|
|
48055
|
+
const renames = [{
|
|
48056
|
+
from: layout.livePackagePath,
|
|
48057
|
+
to: layout.previousPackagePath,
|
|
48058
|
+
artifact: "package"
|
|
48059
|
+
}, {
|
|
48060
|
+
from: layout.stagedPackagePath,
|
|
48061
|
+
to: layout.livePackagePath,
|
|
48062
|
+
artifact: "package"
|
|
48063
|
+
}];
|
|
48064
|
+
return {
|
|
48065
|
+
renames,
|
|
48066
|
+
reversalsByFailureIndex: reversalsFor(renames)
|
|
48067
|
+
};
|
|
48068
|
+
}
|
|
48069
|
+
function reversalsFor(renames) {
|
|
48070
|
+
return renames.map((_, failureIndex) => renames.slice(0, failureIndex).reverse().map(({ from, to, artifact }) => ({
|
|
48071
|
+
from: to,
|
|
48072
|
+
to: from,
|
|
48073
|
+
artifact
|
|
48074
|
+
})));
|
|
48075
|
+
}
|
|
48019
48076
|
function appendTail(existingTail, output) {
|
|
48020
48077
|
const appendedLines = output.split(/\r?\n/);
|
|
48021
48078
|
if (appendedLines.at(-1) === "") appendedLines.pop();
|
|
@@ -48444,7 +48501,8 @@ function createBackendUpdateCheck(dependencies) {
|
|
|
48444
48501
|
headSha: recorded.currentSha,
|
|
48445
48502
|
targetSha: recorded.latestSha,
|
|
48446
48503
|
journalState: journal?.state || "idle",
|
|
48447
|
-
restartRequested: dependencies.isRestartRequested?.() === true
|
|
48504
|
+
restartRequested: dependencies.isRestartRequested?.() === true,
|
|
48505
|
+
npmGlobalInstall: dependencies.getNpmGlobalInstall?.() ?? null
|
|
48448
48506
|
});
|
|
48449
48507
|
if (!decision.ok) return {
|
|
48450
48508
|
reason: decision.reason,
|
|
@@ -50683,6 +50741,7 @@ var HANDOFF_QUEUE_ADMISSION_TIMEOUT_MS = 3e4;
|
|
|
50683
50741
|
var MERGE_COMMAND_TIMEOUT_MS = 3e4;
|
|
50684
50742
|
var INSTALL_TIMEOUT_MS = 9e5;
|
|
50685
50743
|
var BUILD_TIMEOUT_MS = 6e5;
|
|
50744
|
+
var VERIFY_TIMEOUT_MS = 6e4;
|
|
50686
50745
|
var COMMAND_MAX_BUFFER = 16777216;
|
|
50687
50746
|
var RESTORE_MARKER_NAME = "restore.json";
|
|
50688
50747
|
function errorText(error) {
|
|
@@ -50712,6 +50771,10 @@ function createUpdateApplyLane(dependencies) {
|
|
|
50712
50771
|
const clock = dependencies.clock || (() => Date.now());
|
|
50713
50772
|
const updatePath = path.join(dependencies.packageRoot, ".glimmervoid", "update");
|
|
50714
50773
|
const stagingPath = path.join(updatePath, "next");
|
|
50774
|
+
const npmGlobalLayout = decideNpmGlobalLayout(dependencies.packageRoot);
|
|
50775
|
+
const nodePath = dependencies.nodePath || stableNodePath;
|
|
50776
|
+
const npmPath = path.join(path.dirname(nodePath), "npm");
|
|
50777
|
+
let isInstallWritable = null;
|
|
50715
50778
|
let journal = idleJournal(dependencies.getUpdateChannel());
|
|
50716
50779
|
let stagedDescriptor = null;
|
|
50717
50780
|
let inFlight = false;
|
|
@@ -50732,6 +50795,22 @@ function createUpdateApplyLane(dependencies) {
|
|
|
50732
50795
|
function getJournal() {
|
|
50733
50796
|
return structuredClone(journal);
|
|
50734
50797
|
}
|
|
50798
|
+
function getNpmGlobalInstall() {
|
|
50799
|
+
if (!npmGlobalLayout) return null;
|
|
50800
|
+
return {
|
|
50801
|
+
installFolder: npmGlobalLayout.installFolder,
|
|
50802
|
+
isWritable: isInstallWritable
|
|
50803
|
+
};
|
|
50804
|
+
}
|
|
50805
|
+
async function refreshInstallWritability() {
|
|
50806
|
+
if (!npmGlobalLayout) return;
|
|
50807
|
+
try {
|
|
50808
|
+
await fsPromises.access(npmGlobalLayout.installFolder, fs.constants.W_OK);
|
|
50809
|
+
isInstallWritable = true;
|
|
50810
|
+
} catch {
|
|
50811
|
+
isInstallWritable = false;
|
|
50812
|
+
}
|
|
50813
|
+
}
|
|
50735
50814
|
async function publish(nextJournal, failOnWrite = true) {
|
|
50736
50815
|
journal = nextJournal;
|
|
50737
50816
|
persistenceFailure = null;
|
|
@@ -50836,6 +50915,7 @@ function createUpdateApplyLane(dependencies) {
|
|
|
50836
50915
|
if (!status) return refusal("missing-update-status", "Check for updates before applying one.");
|
|
50837
50916
|
if (journal.state === "staged" || stagedDescriptor?.state === "staged") return refusal("already-staged", "Restart to apply the staged update.");
|
|
50838
50917
|
if (restartRequested) return refusal("restart-requested", "Wait for the requested restart to finish.");
|
|
50918
|
+
if (status.flavor === "npm-global") return stageNpmGlobalUpdate(status, channel);
|
|
50839
50919
|
const tree = await dependencies.gitWorkspace.probeWorktreeDirty({
|
|
50840
50920
|
projectPath: dependencies.packageRoot,
|
|
50841
50921
|
cwd: dependencies.packageRoot
|
|
@@ -50939,6 +51019,7 @@ function createUpdateApplyLane(dependencies) {
|
|
|
50939
51019
|
await publish(markStaged(journal, { now: clock() }));
|
|
50940
51020
|
stagedDescriptor = {
|
|
50941
51021
|
state: "staged",
|
|
51022
|
+
kind: "clone",
|
|
50942
51023
|
fromSha: tree.headSha,
|
|
50943
51024
|
targetSha: status.latestSha,
|
|
50944
51025
|
lockfileChanged,
|
|
@@ -50963,6 +51044,112 @@ function createUpdateApplyLane(dependencies) {
|
|
|
50963
51044
|
activeRun = run;
|
|
50964
51045
|
return run;
|
|
50965
51046
|
}
|
|
51047
|
+
async function stageNpmGlobalUpdate(status, channel) {
|
|
51048
|
+
await refreshInstallWritability();
|
|
51049
|
+
const decision = decidePreflight({
|
|
51050
|
+
flavor: status.flavor,
|
|
51051
|
+
platform: dependencies.platform || process.platform,
|
|
51052
|
+
statusChannel: status.channel,
|
|
51053
|
+
configuredChannel: channel,
|
|
51054
|
+
updateAvailable: status.updateAvailable,
|
|
51055
|
+
isTreeClean: false,
|
|
51056
|
+
branch: null,
|
|
51057
|
+
upstream: null,
|
|
51058
|
+
statusBranch: null,
|
|
51059
|
+
statusUpstream: null,
|
|
51060
|
+
headSha: null,
|
|
51061
|
+
targetSha: null,
|
|
51062
|
+
journalState: journal.state,
|
|
51063
|
+
restartRequested,
|
|
51064
|
+
npmGlobalInstall: getNpmGlobalInstall()
|
|
51065
|
+
});
|
|
51066
|
+
if (!decision.ok) return refusal(decision.reason, decision.message);
|
|
51067
|
+
if (!npmGlobalLayout || !status.latest) return refusal("missing-target-version", "The target version is unknown. Check for updates again.");
|
|
51068
|
+
const layout = npmGlobalLayout;
|
|
51069
|
+
const targetVersion = status.latest;
|
|
51070
|
+
try {
|
|
51071
|
+
await publish(beginRun(journal, {
|
|
51072
|
+
stepIds: ["install"],
|
|
51073
|
+
fromSha: status.currentSha,
|
|
51074
|
+
toSha: status.latestSha,
|
|
51075
|
+
toVersion: targetVersion,
|
|
51076
|
+
channel,
|
|
51077
|
+
now: clock()
|
|
51078
|
+
}));
|
|
51079
|
+
await fsPromises.rm(layout.stagePrefix, {
|
|
51080
|
+
recursive: true,
|
|
51081
|
+
force: true
|
|
51082
|
+
});
|
|
51083
|
+
await fsPromises.mkdir(layout.stagePrefix, { recursive: true });
|
|
51084
|
+
await publish(beginStep(journal, {
|
|
51085
|
+
stepId: "install",
|
|
51086
|
+
now: clock()
|
|
51087
|
+
}));
|
|
51088
|
+
await runNpmGlobalInstall(layout, targetVersion);
|
|
51089
|
+
await verifyStagedPackage(layout, targetVersion);
|
|
51090
|
+
await publish(finishStep(journal, {
|
|
51091
|
+
stepId: "install",
|
|
51092
|
+
now: clock()
|
|
51093
|
+
}));
|
|
51094
|
+
await publish(markStaged(journal, { now: clock() }));
|
|
51095
|
+
stagedDescriptor = {
|
|
51096
|
+
state: "staged",
|
|
51097
|
+
kind: "npm-global",
|
|
51098
|
+
layout
|
|
51099
|
+
};
|
|
51100
|
+
dependencies.logger.log(`[update] staged glimmervoid@${targetVersion} in ${layout.stagedPackagePath}`);
|
|
51101
|
+
return {
|
|
51102
|
+
ok: true,
|
|
51103
|
+
reason: null,
|
|
51104
|
+
message: "Update staged. Restart to apply it."
|
|
51105
|
+
};
|
|
51106
|
+
} catch (error) {
|
|
51107
|
+
return failAndCleanNpmGlobal(layout, errorText(error));
|
|
51108
|
+
}
|
|
51109
|
+
}
|
|
51110
|
+
async function runInstallCommand(file, args, cwd, timeout) {
|
|
51111
|
+
const outcome = await command(file, args, cwd, timeout);
|
|
51112
|
+
journal = appendStepOutput(journal, "install", outcome.output);
|
|
51113
|
+
if (!outcome.ok) throw new Error(outcome.reason || `${path.basename(file)} failed`);
|
|
51114
|
+
return outcome.output;
|
|
51115
|
+
}
|
|
51116
|
+
async function runNpmGlobalInstall(layout, targetVersion) {
|
|
51117
|
+
const platform = dependencies.platform || process.platform;
|
|
51118
|
+
const installArgs = [
|
|
51119
|
+
"install",
|
|
51120
|
+
"--global",
|
|
51121
|
+
"--prefix",
|
|
51122
|
+
layout.stagePrefix,
|
|
51123
|
+
"--no-audit",
|
|
51124
|
+
"--no-fund",
|
|
51125
|
+
`glimmervoid@${targetVersion}`
|
|
51126
|
+
];
|
|
51127
|
+
if (platform === "linux") installArgs.push(NODE_PTY_INSTALL_SCRIPT_FLAG);
|
|
51128
|
+
const throttled = lowPriorityCommand({
|
|
51129
|
+
file: npmPath,
|
|
51130
|
+
args: installArgs,
|
|
51131
|
+
platform
|
|
51132
|
+
});
|
|
51133
|
+
await runInstallCommand(throttled.file, throttled.args, layout.updatePath, INSTALL_TIMEOUT_MS);
|
|
51134
|
+
}
|
|
51135
|
+
async function verifyStagedPackage(layout, targetVersion) {
|
|
51136
|
+
const stagedBin = path.join(layout.stagedPackagePath, "dist", "bin", "glimmervoid.js");
|
|
51137
|
+
const printedVersion = (await runInstallCommand(nodePath, [stagedBin, "--version"], layout.updatePath, VERIFY_TIMEOUT_MS)).trim();
|
|
51138
|
+
if (printedVersion !== targetVersion) throw new Error(`staged-version-mismatch: expected ${targetVersion}, the staged build printed ${printedVersion || "nothing"}`);
|
|
51139
|
+
await runInstallCommand(nodePath, [stagedBin, "doctor"], layout.updatePath, VERIFY_TIMEOUT_MS);
|
|
51140
|
+
}
|
|
51141
|
+
async function failAndCleanNpmGlobal(layout, reason) {
|
|
51142
|
+
stagedDescriptor = null;
|
|
51143
|
+
await fsPromises.rm(layout.stagePrefix, {
|
|
51144
|
+
recursive: true,
|
|
51145
|
+
force: true
|
|
51146
|
+
});
|
|
51147
|
+
await publish(failRun(journal, {
|
|
51148
|
+
reason,
|
|
51149
|
+
now: clock()
|
|
51150
|
+
}), false);
|
|
51151
|
+
return refusal(reason, reason);
|
|
51152
|
+
}
|
|
50966
51153
|
async function writeRestoreMarker(failedReversals) {
|
|
50967
51154
|
const restore = failedReversals.map((operation) => ({
|
|
50968
51155
|
from: operation.artifact === "node_modules" ? PREVIOUS_DEPENDENCIES_BACKUP_NAME : PREVIOUS_DIST_BACKUP_NAME,
|
|
@@ -51015,6 +51202,38 @@ function createUpdateApplyLane(dependencies) {
|
|
|
51015
51202
|
atHandOff: true
|
|
51016
51203
|
}), false);
|
|
51017
51204
|
}
|
|
51205
|
+
async function performNpmGlobalHandOff(descriptor) {
|
|
51206
|
+
const plan = planNpmGlobalHandOffRenames(descriptor.layout);
|
|
51207
|
+
try {
|
|
51208
|
+
await fsPromises.rm(descriptor.layout.previousPackagePath, {
|
|
51209
|
+
recursive: true,
|
|
51210
|
+
force: true
|
|
51211
|
+
});
|
|
51212
|
+
for (let renameIndex = 0; renameIndex < plan.renames.length; renameIndex += 1) {
|
|
51213
|
+
const rename = plan.renames[renameIndex];
|
|
51214
|
+
try {
|
|
51215
|
+
await fsPromises.rename(rename.from, rename.to);
|
|
51216
|
+
} catch (error) {
|
|
51217
|
+
const failedReversals = await reverseRenames(plan.reversalsByFailureIndex[renameIndex] || []);
|
|
51218
|
+
const reversalNote = failedReversals.length === 0 ? "" : `; could not move ${failedReversals.map((reversal) => reversal.from).join(", ")} back`;
|
|
51219
|
+
await publish(failRun(journal, {
|
|
51220
|
+
reason: `handoff-rename-failed: ${errorText(error)}${reversalNote}`,
|
|
51221
|
+
now: clock(),
|
|
51222
|
+
atHandOff: true
|
|
51223
|
+
}), false);
|
|
51224
|
+
return;
|
|
51225
|
+
}
|
|
51226
|
+
}
|
|
51227
|
+
await publish(markSucceeded(journal, { now: clock() }), false);
|
|
51228
|
+
stagedDescriptor = null;
|
|
51229
|
+
} catch (error) {
|
|
51230
|
+
await publish(failRun(journal, {
|
|
51231
|
+
reason: errorText(error),
|
|
51232
|
+
now: clock(),
|
|
51233
|
+
atHandOff: true
|
|
51234
|
+
}), false);
|
|
51235
|
+
}
|
|
51236
|
+
}
|
|
51018
51237
|
async function performHandOff(descriptor) {
|
|
51019
51238
|
let mergeMovedHead = false;
|
|
51020
51239
|
let sampledHead = null;
|
|
@@ -51080,7 +51299,11 @@ function createUpdateApplyLane(dependencies) {
|
|
|
51080
51299
|
async function handOffStagedUpdate() {
|
|
51081
51300
|
await bootRun;
|
|
51082
51301
|
const descriptor = stagedDescriptor;
|
|
51083
|
-
if (
|
|
51302
|
+
if (npmGlobalLayout) {
|
|
51303
|
+
await handOffNpmGlobalUpdate(npmGlobalLayout, descriptor);
|
|
51304
|
+
return;
|
|
51305
|
+
}
|
|
51306
|
+
if (descriptor?.kind !== "clone" || inFlight) {
|
|
51084
51307
|
await dependencies.gitWorkspace.removeWorktreeByPath({
|
|
51085
51308
|
projectPath: dependencies.packageRoot,
|
|
51086
51309
|
cause: "update-apply",
|
|
@@ -51096,6 +51319,21 @@ function createUpdateApplyLane(dependencies) {
|
|
|
51096
51319
|
activeRun = run;
|
|
51097
51320
|
await run;
|
|
51098
51321
|
}
|
|
51322
|
+
async function handOffNpmGlobalUpdate(layout, descriptor) {
|
|
51323
|
+
if (descriptor?.kind !== "npm-global" || inFlight) {
|
|
51324
|
+
await fsPromises.rm(layout.stagePrefix, {
|
|
51325
|
+
recursive: true,
|
|
51326
|
+
force: true
|
|
51327
|
+
});
|
|
51328
|
+
return;
|
|
51329
|
+
}
|
|
51330
|
+
inFlight = true;
|
|
51331
|
+
const run = performNpmGlobalHandOff(descriptor).finally(() => {
|
|
51332
|
+
inFlight = false;
|
|
51333
|
+
});
|
|
51334
|
+
activeRun = run;
|
|
51335
|
+
await run;
|
|
51336
|
+
}
|
|
51099
51337
|
function isRestartRequested() {
|
|
51100
51338
|
return restartRequested;
|
|
51101
51339
|
}
|
|
@@ -51155,6 +51393,17 @@ function createUpdateApplyLane(dependencies) {
|
|
|
51155
51393
|
reason: "interrupted",
|
|
51156
51394
|
now: clock()
|
|
51157
51395
|
}), false);
|
|
51396
|
+
if (npmGlobalLayout) {
|
|
51397
|
+
await fsPromises.rm(npmGlobalLayout.stagePrefix, {
|
|
51398
|
+
recursive: true,
|
|
51399
|
+
force: true
|
|
51400
|
+
});
|
|
51401
|
+
await fsPromises.rm(npmGlobalLayout.previousPackagePath, {
|
|
51402
|
+
recursive: true,
|
|
51403
|
+
force: true
|
|
51404
|
+
});
|
|
51405
|
+
return;
|
|
51406
|
+
}
|
|
51158
51407
|
if (wasRunInFlight || await isStagingCheckoutPresent()) await dependencies.gitWorkspace.removeWorktreeByPath({
|
|
51159
51408
|
projectPath: dependencies.packageRoot,
|
|
51160
51409
|
cause: "update-apply",
|
|
@@ -51207,9 +51456,11 @@ function createUpdateApplyLane(dependencies) {
|
|
|
51207
51456
|
}
|
|
51208
51457
|
return whenIdle();
|
|
51209
51458
|
}
|
|
51459
|
+
refreshInstallWritability();
|
|
51210
51460
|
return {
|
|
51211
51461
|
applyUpdate,
|
|
51212
51462
|
getJournal,
|
|
51463
|
+
getNpmGlobalInstall,
|
|
51213
51464
|
handOffStagedUpdate,
|
|
51214
51465
|
isRestartRequested,
|
|
51215
51466
|
noteRestartRequested,
|
|
@@ -52561,6 +52812,7 @@ function createBackend(httpServer, options = {}) {
|
|
|
52561
52812
|
checkForUpdate: options.checkForUpdate || void 0,
|
|
52562
52813
|
getUpdateJournal: () => updateApply.getJournal(),
|
|
52563
52814
|
isRestartRequested: () => updateApply.isRestartRequested(),
|
|
52815
|
+
getNpmGlobalInstall: () => updateApply.getNpmGlobalInstall(),
|
|
52564
52816
|
getControlClientCount: () => controlWss.clients.size,
|
|
52565
52817
|
broadcastControl,
|
|
52566
52818
|
logger: console,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as e,H as t,n}from"./updates-view-core-
|
|
1
|
+
import{G as e,H as t,n}from"./updates-view-core-DcQGhSIg.js";import{S as r,s as i}from"./dom-helpers-DBbFg1c_.js";import{c as a,d as o,u as s}from"./control-ws-B-xw3MKQ.js";var c=`http://www.w3.org/2000/svg`;function l(e,t){let n=document.createElementNS(c,e);for(let[e,r]of Object.entries(t))n.setAttribute(e,r);return n}function u(e,t){let n=document.createElementNS(c,`svg`);return n.setAttribute(`width`,String(e)),n.setAttribute(`height`,String(t)),n.setAttribute(`viewBox`,`0 0 ${e} ${t}`),n.setAttribute(`aria-hidden`,`true`),n}var d=`M4 4L12 12M12 4L4 12`,f=`M10 3L5 8L10 13`,p=`M3 8h0.01M8 8h0.01M13 8h0.01`,m=`M8 2.5v6M5 5.5h6M5 12.5h6`,h=`M4.5 12.5h7a3 3 0 0 0 0.4-5.97a4 4 0 0 0-7.7 0.57a2.7 2.7 0 0 0 0.3 5.4z`,g=`M8 1.8l5.2 2v4c0 3.2-2.2 5.4-5.2 6.4c-3-1-5.2-3.2-5.2-6.4v-4z`,_=`M9.2 1.5L3.5 9h4.3l-1 5.5L12.5 7H8.2z`,v=`M8.7 4.2L5.6 8.6h2.5l-.6 3.2l3.1-4.4H8.1z`,y=`M3 13V9M8 13V3M13 13V6.5`;function b(e,t=`2`){let n=u(16,16);return n.classList.add(`line-icon`),n.append(l(`path`,{d:e,fill:`none`,stroke:`currentColor`,"stroke-width":t,"stroke-linecap":`round`,"stroke-linejoin":`round`})),n}function x(e,t){let{class:n,...r}=t,i=u(16,16);return n!==void 0&&i.classList.add(n),i.append(l(e,r)),i}function S(e){let t=document.createElement(`span`);t.className=`status-icon`,t.dataset.icon=e;for(let n of r[e])t.append(x(n.tag,n.attributes));return t}function C(e,t){e.dataset.icon!==t&&(e.dataset.icon=t,e.replaceChildren(S(t)))}var w={busy:`text-text-muted`,ok:`text-state-done`,error:`text-state-failed`},T=15e3,E=`Something went wrong. Details are hidden in streamer mode.`;function D(e,t){return e!==`error`||t.startsWith(`Not connected to the server. Reconnecting.`)?t:document.documentElement.hasAttribute(`data-streamer`)?E:t}var O={busy:`working`,ok:`complete`,error:`failed`};function k(e){let t=e.querySelector(`:scope > .action-status-icon`),n=e.querySelector(`:scope > .action-status-text`);if(t&&n&&e.childNodes.length===2)return{iconElement:t,textElement:n};let r=i(`span`,`action-status-icon`);r.setAttribute(`aria-hidden`,`true`);let a=i(`span`,`action-status-text`);return e.replaceChildren(r,a),{iconElement:r,textElement:a}}function A(e){e.replaceChildren(),delete e.dataset.tone}function j(e,t,n){if(!n){A(e);return}if(!t){A(e),e.textContent=n;return}e.dataset.tone=t;let{iconElement:r,textElement:i}=k(e);C(r,O[t]),i.textContent=D(t,n)}function M(e=`action-status`){let t=i(`p`,e);return t.setAttribute(`role`,`status`),t.hidden=!0,{element:t,show:(n,r)=>{t.className=`${e} text-meta ${w[n]}`,j(t,n,r),t.hidden=!r},clear:()=>{t.hidden=!0,A(t)}}}function N(e,t){return s(e)?!0:(t.show(`error`,n),!1)}function P(e,t){let n=e instanceof Error?e.message:``;return n===`Request timed out`?`The server did not answer within ${Math.round(t/1e3)} s.`:n||`Not connected to the server. Reconnecting.`}async function F(e,t,n,{busyText:r,timeoutMs:i=T}={}){r&&n.show(`busy`,r);try{let r=await o(e,t,{timeoutMs:i});return n.clear(),r}catch(e){return n.show(`error`,P(e,i)),null}}var I=null,L=3e4,R=null;function z(){let e=document.getElementById(`header-status`),t=document.getElementById(`header-status-text`),n=document.getElementById(`header-status-age`),r=document.getElementById(`header-status-dismiss`);return!e||!t||!n||!r?null:(r.dataset.wired===void 0&&(r.dataset.wired=``,r.addEventListener(`click`,W)),{line:e,text:t,age:n})}function B(){let n=z();if(!n||!I)return;let r=e(Date.now()-I.raisedAt,{...t,justNowBelowSeconds:60});n.age.textContent!==r&&(n.age.textContent=r)}function V({source:e,sessionId:t,message:n,hidesInStreamerMode:r=!0}){a(e,n);let o=z();if(!o)return;let s=r?D(`error`,n):n,c=i(`strong`,`header-status-source`,e);o.text.replaceChildren(c,` ${s}`),o.text.title=`${e}: ${s}`,I={source:e,sessionId:t??null,raisedAt:Date.now()},B(),R??=window.setInterval(B,L),o.line.hidden=!1}function H(e,t){I?.source===e&&(t===void 0||I.sessionId===t)&&W()}function U(e){I?.sessionId===e&&W()}function W(){I=null,R!==null&&window.clearInterval(R),R=null;let e=z();e&&(e.line.hidden=!0,e.text.replaceChildren(),e.text.title=``,e.age.textContent=``)}export{l as S,v as _,j as a,b,F as c,f as d,_ as f,p as g,h,M as i,N as l,d as m,H as n,V as o,m as p,U as r,P as s,T as t,C as u,g as v,u as x,y};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./updates-view-core-
|
|
1
|
+
import"./updates-view-core-DcQGhSIg.js";import{n as e,r as t,s as n}from"./dom-helpers-DBbFg1c_.js";import{$ as r,Q as i,et as a}from"./index-B_oNC3Sc.js";var o={mine:`Mine`,run:`Run`,cancel:`Cancel`},s=null;function c(e){return e===null?`n/a`:`${Math.round(e*100)}%`}function l(e){if(e===null)return`n/a`;let t=Math.round(e*100);return t>0?`+${t}`:String(t)}function u(e,t,i){let a=n(`button`,`bench-action-button`,o[t]);return a.type=`button`,a.disabled=i,a.addEventListener(`click`,()=>r(e.id,t)),a}function d(e,t){let n=e.inFlight;if(!n||n.suiteId!==t.id)return``;let r=n.caseId?`case ${n.caseId}, `:``;return`Cell ${n.cellIndex+1} of ${n.cellCount}: ${r}arm ${n.armId}, trial ${n.trial}, ${n.phase}.`}function f(e){let t=n(`td`,`bench-score`,c(e?.recall??null));return e&&e.invalid>0&&(t.title=`${e.invalid} invalid or failed cell(s)`),e&&e.degraded>0&&(t.dataset.degraded=`true`),t}function p(e){let t=e.armIds.filter(t=>t!==e.baselineArm),r=n(`table`,`bench-table`),i=n(`tr`);i.append(n(`th`,null,`Case`),...e.armIds.map(t=>n(`th`,null,t===e.baselineArm?`${t} (baseline)`:t))),i.append(...t.map(e=>n(`th`,null,`${e} vs baseline`))),r.append(i);for(let i of e.rows){let a=n(`tr`);a.append(n(`td`,`bench-case`,i.caseId),...e.armIds.map(e=>f(i.arms[e]))),a.append(...t.map(e=>n(`td`,`bench-delta`,l(i.deltaVsBaseline[e]??null)))),r.append(a)}let a=[...new Set(e.armIds.flatMap(t=>Object.keys(e.totals[t]?.recallByTag??{})))].sort(),o=n(`tr`,`bench-total`);o.append(n(`td`,`bench-case`,`Paired recall`),...e.armIds.map(t=>f(e.totals[t]))),r.append(o);for(let t of a){let i=n(`tr`,`bench-total`);i.append(n(`td`,`bench-case`,`Recall, ${t}`),...e.armIds.map(r=>n(`td`,`bench-score`,c(e.totals[r]?.recallByTag[t]??null)))),r.append(i)}return r}function m(e,r){let{isServerConnected:a,pendingActionBySuite:o,outcomeBySuite:s}=i(),c=n(`div`,`bench-suite`),l=e.inFlight?.suiteId===r.id,f=!!e.inFlight&&!l,m=o.has(r.id)||!a,h=n(`div`,`bench-summary`);h.append(n(`span`,`bench-suite-title`,r.title),t(`bench`,r.caseCount===1?`case`:`cases`,String(r.caseCount)),t(`bench`,r.candidateCount===1?`candidate`:`candidates`,String(r.candidateCount)),t(`bench`,`arms`,String(r.armIds.length))),c.append(h);let g=n(`div`,`bench-controls`),_=e.configured===!0&&r.error===null;g.append(u(r,`mine`,!_||m||l),u(r,`run`,!_||m||l||f||r.caseCount===0),u(r,`cancel`,m||!l));let v=n(`span`,`bench-status`,(a?``:`Not connected to the server. Reconnecting.`)||d(e,r)||s.get(r.id)||``);if(v.setAttribute(`role`,`status`),g.append(v),c.append(g),r.error)return c.append(n(`p`,`bench-error`,r.error)),c;let y=r.latestReport;return y?(c.append(n(`p`,`bench-run-line`,`Latest run ${y.runId}: ${y.status}. Only cases every arm scored count toward paired recall.`)),y.rows.length>0&&c.append(p(y)),c):(c.append(n(`p`,`bench-empty`,r.caseCount===0?`Move approved candidates into the cases folder, then choose Run.`:`No run yet.`)),c)}function h(){if(!s)return;s.textContent=``;let{status:t}=i(),r=e(`bench`,`Benchmarks`,`Suites from the benchmarks folder of the Glimmervoid home, one run at a time.`);if(s.append(r),!t)s.append(n(`p`,`bench-empty`,`Waiting for the server.`));else if(!t.configured)s.append(n(`p`,`bench-empty`,t.reason||`Benchmarks are off.`));else if(t.suites.length===0)s.append(n(`p`,`bench-empty`,`No suites yet. Create a folder holding suite.json under benchmarks in the Glimmervoid home.`));else for(let e of t.suites)s.append(m(t,e))}function g(e){s||(s=n(`div`,`bench-content`),e.append(s),a(h),h())}var _={mount:g};export{_ as view};
|
|
Binary file
|