@indigoai-us/hq-cli 5.345.220 → 5.345.222
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 +164 -0
- package/dist/command-catalog.generated.d.ts +175 -2
- package/dist/command-catalog.generated.js +213 -2
- package/dist/commands/auth.js +6 -2
- package/dist/commands/bot-runtime.d.ts +18 -5
- package/dist/commands/bot-runtime.js +29 -12
- package/dist/commands/bot.d.ts +39 -2
- package/dist/commands/bot.js +140 -11
- package/dist/commands/core-delegate-w1b.js +9 -3
- package/dist/commands/core-stop-autosave.d.ts +21 -0
- package/dist/commands/core-stop-autosave.js +300 -0
- package/dist/commands/core.js +2 -0
- package/dist/commands/daemon.d.ts +6 -0
- package/dist/commands/daemon.js +46 -8
- package/dist/commands/doctor-usage.d.ts +5 -0
- package/dist/commands/doctor-usage.js +25 -0
- package/dist/commands/env.d.ts +49 -4
- package/dist/commands/env.js +355 -5
- package/dist/commands/lanes-shared.d.ts +3 -0
- package/dist/commands/lanes.d.ts +3 -0
- package/dist/commands/lanes.js +87 -3
- package/dist/commands/link.d.ts +2 -0
- package/dist/commands/link.js +14 -2
- package/dist/commands/mesh.js +23 -3
- package/dist/commands/sources.js +3 -3
- package/dist/commands/sync-core.d.ts +7 -0
- package/dist/commands/sync-core.js +132 -3
- package/dist/commands/whoami.js +96 -80
- package/dist/data/command-states.json +3 -0
- package/dist/lib/bot/config.d.ts +17 -0
- package/dist/lib/bot/config.js +13 -0
- package/dist/lib/bot/fleet-cron.js +24 -2
- package/dist/lib/bot/fleet-local.d.ts +30 -2
- package/dist/lib/bot/fleet-local.js +60 -1
- package/dist/lib/bot/grok-login-scope.d.ts +36 -0
- package/dist/lib/bot/grok-login-scope.js +93 -0
- package/dist/lib/bot/legacy-provider-login.d.ts +32 -9
- package/dist/lib/bot/legacy-provider-login.js +28 -22
- package/dist/lib/bot/runtime-sign-in-check.js +6 -1
- package/dist/lib/bot/runtime-sign-in.d.ts +2 -0
- package/dist/lib/core-utils/sentry-report.js +2 -0
- package/dist/lib/daemon/catalog.js +2 -0
- package/dist/lib/daemon/install.d.ts +2 -1
- package/dist/lib/daemon/install.js +9 -0
- package/dist/lib/daemon/legacy.d.ts +1 -0
- package/dist/lib/daemon/legacy.js +5 -2
- package/dist/lib/daemon/machine-check-owner.d.ts +2 -0
- package/dist/lib/daemon/machine-check-owner.js +6 -1
- package/dist/lib/daemon/machine-checks.d.ts +29 -2
- package/dist/lib/daemon/machine-checks.js +64 -13
- package/dist/lib/daemon/mesh-owner.d.ts +45 -0
- package/dist/lib/daemon/mesh-owner.js +166 -0
- package/dist/lib/daemon/native-notice-ledger.d.ts +27 -0
- package/dist/lib/daemon/native-notice-ledger.js +113 -0
- package/dist/lib/daemon/run.d.ts +15 -0
- package/dist/lib/daemon/run.js +137 -11
- package/dist/lib/daemon/selfcheck.d.ts +35 -2
- package/dist/lib/daemon/selfcheck.js +118 -9
- package/dist/lib/daemon/stop-autosave-lock.d.ts +19 -0
- package/dist/lib/daemon/stop-autosave-lock.js +166 -0
- package/dist/lib/daemon/stop-autosave.d.ts +28 -0
- package/dist/lib/daemon/stop-autosave.js +111 -0
- package/dist/lib/daemon/stop-diagnostics.d.ts +11 -0
- package/dist/lib/daemon/stop-diagnostics.js +136 -0
- package/dist/lib/daemon/stop-job-executor.d.ts +19 -0
- package/dist/lib/daemon/stop-job-executor.js +126 -0
- package/dist/lib/daemon/stop-jobs.d.ts +93 -0
- package/dist/lib/daemon/stop-jobs.js +599 -0
- package/dist/lib/doctor/checks/fleet-hook-core.js +1 -1
- package/dist/lib/doctor/checks/host-core.js +1 -1
- package/dist/lib/environment/access-probes.d.ts +234 -0
- package/dist/lib/environment/access-probes.js +918 -0
- package/dist/lib/environment/profile.d.ts +15 -2
- package/dist/lib/environment/profile.js +55 -20
- package/dist/lib/environment/rfc3339.d.ts +8 -0
- package/dist/lib/environment/rfc3339.js +26 -0
- package/dist/lib/environment/work-requirements.d.ts +169 -0
- package/dist/lib/environment/work-requirements.js +389 -0
- package/dist/lib/hook-engine/coverage.d.ts +146 -7
- package/dist/lib/hook-engine/coverage.js +1480 -4
- package/dist/lib/hook-engine/fleet-registration.js +2 -2
- package/dist/lib/hook-engine/git-stop-config.json +513 -0
- package/dist/lib/hook-engine/native-stop-compatibility.json +362 -0
- package/dist/lib/hook-engine/reconcile.js +2 -2
- package/dist/lib/hot-channels/alert.d.ts +2 -2
- package/dist/lib/hot-channels/alert.js +8 -5
- package/dist/lib/hot-channels/signals-pass.d.ts +126 -17
- package/dist/lib/hot-channels/signals-pass.js +296 -17
- package/dist/lib/hot-channels/signals-runtime.d.ts +30 -0
- package/dist/lib/hot-channels/signals-runtime.js +82 -0
- package/dist/lib/install/hook-target.js +1 -1
- package/dist/lib/lanes/host-capacity.d.ts +26 -2
- package/dist/lib/lanes/host-capacity.js +17 -2
- package/dist/lib/lanes/host-compute.d.ts +90 -0
- package/dist/lib/lanes/host-compute.js +185 -0
- package/dist/lib/lanes/index.d.ts +2 -0
- package/dist/lib/lanes/index.js +1 -0
- package/dist/lib/lanes/reconcile.js +22 -1
- package/dist/lib/lanes/resource-usage.d.ts +155 -0
- package/dist/lib/lanes/resource-usage.js +589 -0
- package/dist/lib/lanes/run-size.d.ts +46 -0
- package/dist/lib/lanes/run-size.js +197 -0
- package/dist/lib/lanes/store.js +27 -0
- package/dist/lib/lanes/throttle.d.ts +36 -1
- package/dist/lib/lanes/throttle.js +47 -10
- package/dist/lib/lanes/types.d.ts +40 -0
- package/dist/lib/lanes/types.js +2 -2
- package/dist/lib/lanes/watcher.js +13 -4
- package/dist/lib/lanes/worker-process.d.ts +25 -2
- package/dist/lib/lanes/worker-process.js +71 -19
- package/dist/lib/mesh/live/daemon/config.d.ts +8 -1
- package/dist/lib/mesh/live/daemon/config.js +16 -0
- package/dist/lib/mesh/live/daemon/install.d.ts +31 -2
- package/dist/lib/mesh/live/daemon/install.js +142 -1
- package/dist/lib/mesh/live/daemon/login-home.d.ts +5 -0
- package/dist/lib/mesh/live/daemon/login-home.js +27 -0
- package/dist/lib/mesh/live/daemon/unit-home.d.ts +49 -0
- package/dist/lib/mesh/live/daemon/unit-home.js +134 -0
- package/dist/lib/placement/match.d.ts +192 -0
- package/dist/lib/placement/match.js +667 -0
- package/dist/lib/registry/registry.d.ts +35 -7
- package/dist/lib/registry/registry.js +88 -13
- package/dist/lib/safe-store.d.ts +14 -0
- package/dist/lib/safe-store.js +77 -4
- package/dist/lib/scan-packages/index.js +24 -2
- package/dist/lib/search-index/index.d.ts +88 -4
- package/dist/lib/search-index/index.js +288 -24
- package/dist/lib/search-index/max-doc-bytes.d.ts +17 -6
- package/dist/lib/search-index/max-doc-bytes.js +49 -23
- package/dist/lib/service-manager/startup-migration.d.ts +1 -0
- package/dist/lib/service-manager/startup-migration.js +3 -0
- package/dist/lib/signals/codex-lockdown.d.ts +79 -0
- package/dist/lib/signals/codex-lockdown.js +271 -0
- package/dist/lib/signals/codex-login.d.ts +37 -0
- package/dist/lib/signals/codex-login.js +83 -0
- package/dist/lib/signals/engine.d.ts +27 -0
- package/dist/lib/signals/engine.js +70 -0
- package/dist/lib/signals/reply.js +22 -1
- package/dist/lib/signals/run-record.js +6 -1
- package/dist/lib/signals/settings.d.ts +5 -0
- package/dist/lib/signals/settings.js +2 -0
- package/dist/lib/signals/steps/extract.d.ts +85 -9
- package/dist/lib/signals/steps/extract.js +317 -68
- package/dist/lib/signals/steps/types.d.ts +2 -0
- package/dist/lib/sync-core/engine-holds.d.ts +14 -0
- package/dist/lib/sync-core/engine-holds.js +60 -0
- package/dist/lib/sync-core/engine-home.d.ts +37 -1
- package/dist/lib/sync-core/engine-home.js +119 -16
- package/dist/lib/sync-core/reconcile.js +8 -0
- package/dist/lib/sync-core/rollout-state.d.ts +2 -1
- package/dist/lib/sync-core/rollout-state.js +5 -2
- package/dist/lib/sync-core/vault-settings.d.ts +21 -0
- package/dist/lib/sync-core/vault-settings.js +131 -0
- package/dist/lib/sync-core/vault-uid.d.ts +2 -0
- package/dist/lib/sync-core/vault-uid.js +4 -0
- package/dist/lib/windows/install-followup.d.ts +2 -0
- package/dist/lib/windows/install-followup.js +4 -1
- package/dist/schemas/hq-work-requirements.v1.schema.json +145 -0
- package/dist/utils/auth-session-check.d.ts +16 -0
- package/dist/utils/auth-session-check.js +16 -0
- package/dist/utils/client-health-contract.d.ts +6 -0
- package/dist/utils/client-health-contract.js +13 -0
- package/dist/utils/client-health.d.ts +7 -0
- package/dist/utils/client-health.js +22 -1
- package/dist/utils/command-usage.d.ts +40 -0
- package/dist/utils/command-usage.js +61 -0
- package/dist/utils/duplicate-command-usage.d.ts +72 -0
- package/dist/utils/duplicate-command-usage.js +125 -0
- package/dist/utils/host-registration.js +5 -2
- package/dist/utils/pack-contributions.d.ts +3 -0
- package/dist/utils/pack-contributions.js +110 -23
- package/dist/utils/resident-package-preload.js +4 -0
- package/dist/utils/self-update.d.ts +3 -1
- package/dist/utils/self-update.js +56 -11
- package/dist/utils/sentry-fingerprint.js +9 -0
- package/dist/utils/update-lock.d.ts +151 -14
- package/dist/utils/update-lock.js +782 -46
- package/dist/utils/version-gate.js +12 -2
- package/dist/utils/windows-bash.d.ts +2 -0
- package/dist/utils/windows-bash.js +2 -1
- package/package.json +9 -8
- package/scripts/bench-core-compare.mjs +313 -0
- package/scripts/bench-core.mjs +399 -12
- package/scripts/check-function-manifest.mjs +116 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const HELD_DELETE_LOG_LIMIT = 20;
|
|
2
|
+
export interface EngineHeldDelete {
|
|
3
|
+
path: string;
|
|
4
|
+
direction: "delete_local" | "delete_remote";
|
|
5
|
+
}
|
|
6
|
+
export interface EngineHeldDeletes {
|
|
7
|
+
holdId?: string;
|
|
8
|
+
count: number;
|
|
9
|
+
deletes: EngineHeldDelete[];
|
|
10
|
+
}
|
|
11
|
+
export declare function engineHoldFile(engineHome: string, vaultUid: string): string;
|
|
12
|
+
export declare function readEngineHeldDeletes(engineHome: string, vaultUid: string): EngineHeldDeletes | "unreadable" | null;
|
|
13
|
+
export declare function heldDeletesHandoverLine(vaultUid: string, held: EngineHeldDeletes | "unreadable", engineHome: string): string;
|
|
14
|
+
//# sourceMappingURL=engine-holds.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
export const HELD_DELETE_LOG_LIMIT = 20;
|
|
4
|
+
const HOLD_FILE_MAX_BYTES = 16 * 1024 * 1024;
|
|
5
|
+
function record(value) {
|
|
6
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : undefined;
|
|
7
|
+
}
|
|
8
|
+
export function engineHoldFile(engineHome, vaultUid) {
|
|
9
|
+
return path.join(engineHome, ".hq", "sync-core", "holds", `${vaultUid}.json`);
|
|
10
|
+
}
|
|
11
|
+
export function readEngineHeldDeletes(engineHome, vaultUid) {
|
|
12
|
+
let text;
|
|
13
|
+
try {
|
|
14
|
+
const file = engineHoldFile(engineHome, vaultUid);
|
|
15
|
+
const stat = fs.lstatSync(file);
|
|
16
|
+
if (!stat.isFile() || stat.size > HOLD_FILE_MAX_BYTES)
|
|
17
|
+
return "unreadable";
|
|
18
|
+
text = fs.readFileSync(file, "utf8");
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
return error.code === "ENOENT" ? null : "unreadable";
|
|
22
|
+
}
|
|
23
|
+
let hold;
|
|
24
|
+
try {
|
|
25
|
+
hold = record(JSON.parse(text));
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return "unreadable";
|
|
29
|
+
}
|
|
30
|
+
if (!hold || !Array.isArray(hold.groups))
|
|
31
|
+
return "unreadable";
|
|
32
|
+
const deletes = [];
|
|
33
|
+
let count = 0;
|
|
34
|
+
for (const value of hold.groups) {
|
|
35
|
+
const group = record(value);
|
|
36
|
+
if (!group || (group.direction !== "delete_local" && group.direction !== "delete_remote"))
|
|
37
|
+
return "unreadable";
|
|
38
|
+
const paths = Array.isArray(group.paths) ? group.paths.filter((p) => typeof p === "string") : [];
|
|
39
|
+
const declared = typeof group.count === "number" && Number.isSafeInteger(group.count) && group.count >= 0 ? group.count : 0;
|
|
40
|
+
count += Math.max(paths.length, declared);
|
|
41
|
+
for (const p of paths)
|
|
42
|
+
deletes.push({ path: p, direction: group.direction });
|
|
43
|
+
}
|
|
44
|
+
if (count === 0)
|
|
45
|
+
return null;
|
|
46
|
+
return { ...(typeof hold.holdId === "string" && hold.holdId ? { holdId: hold.holdId } : {}), count, deletes };
|
|
47
|
+
}
|
|
48
|
+
function printable(value) {
|
|
49
|
+
return JSON.stringify(value);
|
|
50
|
+
}
|
|
51
|
+
export function heldDeletesHandoverLine(vaultUid, held, engineHome) {
|
|
52
|
+
if (held === "unreadable") {
|
|
53
|
+
return `${vaultUid}: the new sync engine's hold file ${engineHoldFile(engineHome, vaultUid)} could not be read; any deletes it held are now up to the current sync`;
|
|
54
|
+
}
|
|
55
|
+
const shown = held.deletes.slice(0, HELD_DELETE_LOG_LIMIT).map((entry) => `${entry.direction === "delete_local" ? "local copy of" : "server copy of"} ${printable(entry.path)}`);
|
|
56
|
+
const more = held.count > shown.length ? `; and ${held.count - shown.length} more` : "";
|
|
57
|
+
const id = held.holdId ? ` (hold ${/^[A-Za-z0-9_-]{1,64}$/.test(held.holdId) ? held.holdId : printable(held.holdId)})` : "";
|
|
58
|
+
return `${vaultUid}: switching back with ${held.count} delete${held.count === 1 ? "" : "s"} the new sync engine held${id}; the current sync will apply them: ${shown.join(", ")}${more}`;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=engine-holds.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SyncCoreVaultSettings } from "./vault-settings.js";
|
|
1
2
|
export type SyncCoreVaultKind = "personal" | "company";
|
|
2
3
|
export type SyncCoreVaultPhase = "warming" | "full";
|
|
3
4
|
export interface SyncCoreVault {
|
|
@@ -12,12 +13,13 @@ export interface SyncCoreVaultPlan extends SyncCoreVault {
|
|
|
12
13
|
release: string;
|
|
13
14
|
legacyOffSince?: string;
|
|
14
15
|
blockedReason?: string;
|
|
16
|
+
settings?: SyncCoreVaultSettings;
|
|
15
17
|
}
|
|
16
18
|
export declare const SYNC_CORE_REQUESTS_PER_DAY = 20000;
|
|
17
19
|
export declare const SYNC_CORE_REQUEST_COUNT_REMOVED_IN = "v0.1.29";
|
|
18
20
|
export declare function syncCoreEngineHome(home: string, vaultUid: string): string;
|
|
19
21
|
export declare function syncCoreUnitId(vaultUid: string): string;
|
|
20
|
-
export
|
|
22
|
+
export { isSyncCoreVaultUid } from "./vault-uid.js";
|
|
21
23
|
export declare function engineConfigToml(vault: SyncCoreVault, hqRoot: string, phase: SyncCoreVaultPhase, tokenPath?: string,
|
|
22
24
|
/** The engine release this vault runs. Not given: treated as an engine that still counts requests. */
|
|
23
25
|
release?: string): string;
|
|
@@ -52,6 +54,40 @@ export interface SyncCoreFirstCycle {
|
|
|
52
54
|
}
|
|
53
55
|
export declare const SYNC_CORE_STATUS_WORK_LIMIT = 20;
|
|
54
56
|
export declare function engineFirstCycle(engineHome: string, vaultUid: string, since: string): SyncCoreFirstCycle | null;
|
|
57
|
+
export interface SyncCoreLastCycle extends SyncCoreFirstCycle {
|
|
58
|
+
fullVault: boolean;
|
|
59
|
+
success: boolean;
|
|
60
|
+
unsupported: number;
|
|
61
|
+
skipped: number;
|
|
62
|
+
transferFailures: number;
|
|
63
|
+
snapshotWaitUntil?: string;
|
|
64
|
+
requestPauseUntil?: string;
|
|
65
|
+
requestBreakerUntil?: string;
|
|
66
|
+
transferWaitUntil?: string;
|
|
67
|
+
transfersQueued?: number;
|
|
68
|
+
}
|
|
69
|
+
export interface SyncCoreRunningCycle {
|
|
70
|
+
startedAt: string;
|
|
71
|
+
updatedAt?: string;
|
|
72
|
+
phase: string;
|
|
73
|
+
planned: number;
|
|
74
|
+
uploadsTotal: number;
|
|
75
|
+
uploadsDone: number;
|
|
76
|
+
downloadsTotal: number;
|
|
77
|
+
downloadsDone: number;
|
|
78
|
+
failed: number;
|
|
79
|
+
currentPath?: string;
|
|
80
|
+
stale: boolean;
|
|
81
|
+
}
|
|
82
|
+
export interface SyncCoreEngineStatus {
|
|
83
|
+
engineVersion?: string;
|
|
84
|
+
startedAt?: string;
|
|
85
|
+
requests24h?: number;
|
|
86
|
+
cycle?: SyncCoreRunningCycle;
|
|
87
|
+
lastCycle?: SyncCoreLastCycle;
|
|
88
|
+
}
|
|
89
|
+
export declare const SYNC_CORE_CYCLE_STALE_MS = 120000;
|
|
90
|
+
export declare function readEngineStatus(engineHome: string, vaultUid: string, now?: Date): SyncCoreEngineStatus | null;
|
|
55
91
|
export declare function clearEngineStatus(home: string, vaultUid: string): void;
|
|
56
92
|
export declare function removeEngineOwnership(home: string, vaultUid: string): void;
|
|
57
93
|
export declare function inspectEngineHome(home: string, hqRoot: string | undefined, plan: SyncCoreVaultPlan, platform: NodeJS.Platform): SyncCoreVaultPlan;
|
|
@@ -11,9 +11,7 @@ export function syncCoreEngineHome(home, vaultUid) {
|
|
|
11
11
|
export function syncCoreUnitId(vaultUid) {
|
|
12
12
|
return `sync-core:${vaultUid}`;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
15
|
-
return typeof value === "string" && /^(prs|cmp)_[A-Za-z0-9][A-Za-z0-9_-]*$/.test(value);
|
|
16
|
-
}
|
|
14
|
+
export { isSyncCoreVaultUid } from "./vault-uid.js";
|
|
17
15
|
export function engineConfigToml(vault, hqRoot, phase, tokenPath,
|
|
18
16
|
/** The engine release this vault runs. Not given: treated as an engine that still counts requests. */
|
|
19
17
|
release) {
|
|
@@ -96,26 +94,19 @@ export const SYNC_CORE_STATUS_WORK_LIMIT = 20;
|
|
|
96
94
|
function count(value) {
|
|
97
95
|
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : 0;
|
|
98
96
|
}
|
|
99
|
-
|
|
100
|
-
let status;
|
|
97
|
+
function readStatusFile(engineHome) {
|
|
101
98
|
try {
|
|
102
|
-
|
|
99
|
+
return record(JSON.parse(fs.readFileSync(path.join(engineHome, ".hq", "sync-core", "status.json"), "utf8")));
|
|
103
100
|
}
|
|
104
101
|
catch {
|
|
105
|
-
return
|
|
102
|
+
return undefined;
|
|
106
103
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const cycle = record(status?.last_canary);
|
|
110
|
-
if (!cycle || cycle.vault !== vaultUid || cycle.full_vault !== true)
|
|
111
|
-
return null;
|
|
112
|
-
const sinceMs = Date.parse(since);
|
|
113
|
-
if (typeof cycle.at_ms !== "number" || cycle.at_ms <= 0 || !Number.isFinite(sinceMs) || cycle.at_ms < sinceMs)
|
|
114
|
-
return null;
|
|
104
|
+
}
|
|
105
|
+
function cycleSummary(cycle, atMs) {
|
|
115
106
|
const work = (Array.isArray(cycle.work) ? cycle.work : []).map(record).filter((item) => item !== undefined);
|
|
116
107
|
const actions = (...names) => work.filter((item) => names.includes(String(item.action))).length;
|
|
117
108
|
return {
|
|
118
|
-
at: new Date(
|
|
109
|
+
at: new Date(atMs).toISOString(),
|
|
119
110
|
planned: count(cycle.planned),
|
|
120
111
|
completed: count(cycle.completed),
|
|
121
112
|
pending: count(cycle.pending),
|
|
@@ -130,6 +121,118 @@ export function engineFirstCycle(engineHome, vaultUid, since) {
|
|
|
130
121
|
truncated: work.length >= SYNC_CORE_STATUS_WORK_LIMIT,
|
|
131
122
|
};
|
|
132
123
|
}
|
|
124
|
+
function timestampMs(value) {
|
|
125
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0 && value <= 8.64e15 ? value : undefined;
|
|
126
|
+
}
|
|
127
|
+
function isoTime(value) {
|
|
128
|
+
const ms = timestampMs(value);
|
|
129
|
+
return ms === undefined ? undefined : new Date(ms).toISOString();
|
|
130
|
+
}
|
|
131
|
+
export function engineFirstCycle(engineHome, vaultUid, since) {
|
|
132
|
+
const status = readStatusFile(engineHome);
|
|
133
|
+
if (!status)
|
|
134
|
+
return null;
|
|
135
|
+
if (record(status?.mode)?.value !== "full")
|
|
136
|
+
return null;
|
|
137
|
+
const cycle = record(status?.last_canary);
|
|
138
|
+
if (!cycle || cycle.vault !== vaultUid || cycle.full_vault !== true)
|
|
139
|
+
return null;
|
|
140
|
+
const sinceMs = Date.parse(since);
|
|
141
|
+
if (typeof cycle.at_ms !== "number" || cycle.at_ms <= 0 || !Number.isFinite(sinceMs) || cycle.at_ms < sinceMs)
|
|
142
|
+
return null;
|
|
143
|
+
return cycleSummary(cycle, cycle.at_ms);
|
|
144
|
+
}
|
|
145
|
+
export const SYNC_CORE_CYCLE_STALE_MS = 120_000;
|
|
146
|
+
const CYCLE_PATH_LIMIT = 200;
|
|
147
|
+
function wholeCount(value) {
|
|
148
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : 0;
|
|
149
|
+
}
|
|
150
|
+
const UNPRINTED_CODE_POINTS = [
|
|
151
|
+
[0x00, 0x1f],
|
|
152
|
+
[0x7f, 0x9f],
|
|
153
|
+
[0xad, 0xad],
|
|
154
|
+
[0x61c, 0x61c],
|
|
155
|
+
[0x180e, 0x180e],
|
|
156
|
+
[0x200b, 0x200f],
|
|
157
|
+
[0x2028, 0x202e],
|
|
158
|
+
[0x2060, 0x206f],
|
|
159
|
+
[0xfeff, 0xfeff],
|
|
160
|
+
[0xfff9, 0xfffb],
|
|
161
|
+
[0xe0000, 0xe007f],
|
|
162
|
+
];
|
|
163
|
+
function printablePath(value) {
|
|
164
|
+
if (typeof value !== "string")
|
|
165
|
+
return "";
|
|
166
|
+
const points = Array.from(value).filter((char) => {
|
|
167
|
+
const code = char.codePointAt(0) ?? 0;
|
|
168
|
+
return !UNPRINTED_CODE_POINTS.some(([from, to]) => code >= from && code <= to);
|
|
169
|
+
});
|
|
170
|
+
return points.length > CYCLE_PATH_LIMIT ? `${points.slice(0, CYCLE_PATH_LIMIT - 1).join("")}…` : points.join("");
|
|
171
|
+
}
|
|
172
|
+
function runningCycle(value, vaultUid, now) {
|
|
173
|
+
const cycle = record(value);
|
|
174
|
+
if (!cycle || cycle.vault !== vaultUid)
|
|
175
|
+
return undefined;
|
|
176
|
+
const startedMs = timestampMs(cycle.started_at_ms);
|
|
177
|
+
if (startedMs === undefined)
|
|
178
|
+
return undefined;
|
|
179
|
+
const updatedMs = timestampMs(cycle.updated_at_ms);
|
|
180
|
+
const phase = typeof cycle.phase === "string" && /^[a-z][a-z_]{0,31}$/.test(cycle.phase) ? cycle.phase : "unknown";
|
|
181
|
+
const transferring = phase === "uploading" || phase === "downloading";
|
|
182
|
+
const currentPath = printablePath(cycle.current_path);
|
|
183
|
+
return {
|
|
184
|
+
startedAt: new Date(startedMs).toISOString(),
|
|
185
|
+
...(updatedMs !== undefined ? { updatedAt: new Date(updatedMs).toISOString() } : {}),
|
|
186
|
+
phase,
|
|
187
|
+
planned: wholeCount(cycle.planned),
|
|
188
|
+
uploadsTotal: wholeCount(cycle.uploads_total),
|
|
189
|
+
uploadsDone: wholeCount(cycle.uploads_done),
|
|
190
|
+
downloadsTotal: wholeCount(cycle.downloads_total),
|
|
191
|
+
downloadsDone: wholeCount(cycle.downloads_done),
|
|
192
|
+
failed: wholeCount(cycle.failed),
|
|
193
|
+
...(currentPath ? { currentPath } : {}),
|
|
194
|
+
stale: transferring && updatedMs !== undefined && now.getTime() - updatedMs > SYNC_CORE_CYCLE_STALE_MS,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
export function readEngineStatus(engineHome, vaultUid, now = new Date()) {
|
|
198
|
+
const status = readStatusFile(engineHome);
|
|
199
|
+
if (!status)
|
|
200
|
+
return null;
|
|
201
|
+
const startedAt = isoTime(status.started_at_ms);
|
|
202
|
+
const cycle = record(status.last_canary);
|
|
203
|
+
const atMs = cycle && cycle.vault === vaultUid ? timestampMs(cycle.at_ms) : undefined;
|
|
204
|
+
const snapshotWaitUntil = cycle ? isoTime(cycle.snapshot_wait_until_ms) : undefined;
|
|
205
|
+
const requestPauseUntil = cycle ? isoTime(cycle.request_pause_until_ms) : undefined;
|
|
206
|
+
const requestBreakerUntil = cycle ? isoTime(cycle.request_breaker_until_ms) : undefined;
|
|
207
|
+
const transferWaitUntil = cycle ? isoTime(cycle.transfer_wait_until_ms) : undefined;
|
|
208
|
+
const transfersQueued = cycle ? wholeCount(cycle.transfers_queued) : 0;
|
|
209
|
+
const running = runningCycle(status.cycle, vaultUid, now);
|
|
210
|
+
return {
|
|
211
|
+
...(typeof status.engine_version === "string" && status.engine_version ? { engineVersion: status.engine_version } : {}),
|
|
212
|
+
...(startedAt ? { startedAt } : {}),
|
|
213
|
+
...(typeof status.requests_24h === "number" && Number.isFinite(status.requests_24h) && status.requests_24h >= 0
|
|
214
|
+
? { requests24h: status.requests_24h }
|
|
215
|
+
: {}),
|
|
216
|
+
...(running ? { cycle: running } : {}),
|
|
217
|
+
...(cycle && atMs !== undefined
|
|
218
|
+
? {
|
|
219
|
+
lastCycle: {
|
|
220
|
+
...cycleSummary(cycle, atMs),
|
|
221
|
+
fullVault: cycle.full_vault === true,
|
|
222
|
+
success: cycle.success === true,
|
|
223
|
+
unsupported: count(cycle.unsupported),
|
|
224
|
+
skipped: count(cycle.skipped),
|
|
225
|
+
transferFailures: Array.isArray(cycle.transfer_failures) ? cycle.transfer_failures.length : 0,
|
|
226
|
+
...(snapshotWaitUntil ? { snapshotWaitUntil } : {}),
|
|
227
|
+
...(requestPauseUntil ? { requestPauseUntil } : {}),
|
|
228
|
+
...(requestBreakerUntil ? { requestBreakerUntil } : {}),
|
|
229
|
+
...(transferWaitUntil ? { transferWaitUntil } : {}),
|
|
230
|
+
...(transfersQueued > 0 ? { transfersQueued } : {}),
|
|
231
|
+
},
|
|
232
|
+
}
|
|
233
|
+
: {}),
|
|
234
|
+
};
|
|
235
|
+
}
|
|
133
236
|
export function clearEngineStatus(home, vaultUid) {
|
|
134
237
|
fs.rmSync(path.join(syncCoreEngineHome(home, vaultUid), ".hq", "sync-core", "status.json"), { force: true });
|
|
135
238
|
}
|
|
@@ -5,6 +5,7 @@ import { readVaultSyncSwitches, writeVaultSyncSwitches } from "../vault-sync-swi
|
|
|
5
5
|
import { clearEngineStatus, engineFirstCycle, isSyncCoreVaultUid, removeEngineOwnership, syncCoreEngineHome, writeEngineHome, } from "./engine-home.js";
|
|
6
6
|
import { SYNC_CORE_FULL_RELEASE, SYNC_CORE_RELEASE, compareSyncCoreReleases, fullModeAllowed, installedSyncCoreRelease, syncCoreBinaryPath, windowsFullRelease, } from "./release.js";
|
|
7
7
|
import { readSyncCoreSkips } from "./skip.js";
|
|
8
|
+
import { heldDeletesHandoverLine, readEngineHeldDeletes } from "./engine-holds.js";
|
|
8
9
|
import { SYNC_RUST_ENGINE_ROLLOUT_FLAG } from "./flag.js";
|
|
9
10
|
import { readSyncCoreRolloutState, syncCoreRolloutStatePath, writeSyncCoreRolloutState, } from "./rollout-state.js";
|
|
10
11
|
function message(error) {
|
|
@@ -214,6 +215,7 @@ export async function reconcileSyncCore(deps) {
|
|
|
214
215
|
kept.push(vault.uid);
|
|
215
216
|
}
|
|
216
217
|
const stopped = [];
|
|
218
|
+
const handover = [];
|
|
217
219
|
let personalBackOn = false;
|
|
218
220
|
for (const vault of previousByUid.values()) {
|
|
219
221
|
if (desired.some((candidate) => candidate.uid === vault.uid))
|
|
@@ -221,6 +223,10 @@ export async function reconcileSyncCore(deps) {
|
|
|
221
223
|
stopped.push(vault.uid);
|
|
222
224
|
if (vault.phase !== "full")
|
|
223
225
|
continue;
|
|
226
|
+
const engineHome = syncCoreEngineHome(deps.home, vault.uid);
|
|
227
|
+
const heldDeletes = readEngineHeldDeletes(engineHome, vault.uid);
|
|
228
|
+
if (heldDeletes)
|
|
229
|
+
handover.push(heldDeletesHandoverLine(vault.uid, heldDeletes, engineHome));
|
|
224
230
|
if (vault.kind === "company" && vault.slug)
|
|
225
231
|
companies[vault.slug] = true;
|
|
226
232
|
else
|
|
@@ -259,6 +265,8 @@ export async function reconcileSyncCore(deps) {
|
|
|
259
265
|
log(`${uid}: moving from the read-only index to full mode on the new sync engine`);
|
|
260
266
|
for (const uid of stopped)
|
|
261
267
|
log(`${uid}: back on the current sync`);
|
|
268
|
+
for (const line of handover)
|
|
269
|
+
log(line);
|
|
262
270
|
for (const skip of skipped)
|
|
263
271
|
log(`${skip.uid}: skipped on this machine: ${skip.reason}`);
|
|
264
272
|
for (const hold of held)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SyncCoreFirstCycle, SyncCoreVaultKind, SyncCoreVaultPhase } from "./engine-home.js";
|
|
2
2
|
export interface RolloutVault {
|
|
3
3
|
uid: string;
|
|
4
4
|
kind: SyncCoreVaultKind;
|
|
@@ -28,5 +28,6 @@ export interface SyncCoreRolloutState {
|
|
|
28
28
|
}
|
|
29
29
|
export declare function syncCoreRolloutStatePath(home: string): string;
|
|
30
30
|
export declare function readSyncCoreRolloutState(home: string): SyncCoreRolloutState | null;
|
|
31
|
+
export declare function readSyncCoreRolloutStateFile(file: string): SyncCoreRolloutState | null;
|
|
31
32
|
export declare function writeSyncCoreRolloutState(home: string, state: SyncCoreRolloutState): void;
|
|
32
33
|
//# sourceMappingURL=rollout-state.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as fs from "node:fs";
|
|
2
2
|
import * as path from "node:path";
|
|
3
|
-
import { isSyncCoreVaultUid } from "./
|
|
3
|
+
import { isSyncCoreVaultUid } from "./vault-uid.js";
|
|
4
4
|
const FIRST_CYCLE_COUNTS = [
|
|
5
5
|
"planned",
|
|
6
6
|
"completed",
|
|
@@ -75,9 +75,12 @@ function vault(value) {
|
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
export function readSyncCoreRolloutState(home) {
|
|
78
|
+
return readSyncCoreRolloutStateFile(syncCoreRolloutStatePath(home));
|
|
79
|
+
}
|
|
80
|
+
export function readSyncCoreRolloutStateFile(file) {
|
|
78
81
|
let raw;
|
|
79
82
|
try {
|
|
80
|
-
raw = JSON.parse(fs.readFileSync(
|
|
83
|
+
raw = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
81
84
|
}
|
|
82
85
|
catch {
|
|
83
86
|
return null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface SyncCoreVaultSettings {
|
|
2
|
+
parallelDownloads?: boolean;
|
|
3
|
+
downloadStreams?: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const SYNC_CORE_DOWNLOAD_STREAMS_MAX = 32;
|
|
6
|
+
export declare const SYNC_CORE_VAULT_SETTING_KEYS: readonly ["parallel-downloads", "download-streams"];
|
|
7
|
+
export type SyncCoreVaultSettingKey = (typeof SYNC_CORE_VAULT_SETTING_KEYS)[number];
|
|
8
|
+
export declare class SyncCoreVaultSettingError extends Error {
|
|
9
|
+
}
|
|
10
|
+
export declare function syncCoreVaultSettingsPath(home: string): string;
|
|
11
|
+
export declare function readSyncCoreVaultSettings(home: string, opts?: {
|
|
12
|
+
strict?: boolean;
|
|
13
|
+
}): Map<string, SyncCoreVaultSettings>;
|
|
14
|
+
export declare function parseSyncCoreVaultSetting(key: string, value: string): {
|
|
15
|
+
parallelDownloads: boolean;
|
|
16
|
+
} | {
|
|
17
|
+
downloadStreams: number | undefined;
|
|
18
|
+
};
|
|
19
|
+
export declare function setSyncCoreVaultSetting(home: string, vaultUid: string, key: string, value: string): SyncCoreVaultSettings | undefined;
|
|
20
|
+
export declare function engineSettingsEnv(settings: SyncCoreVaultSettings | undefined): Record<string, string>;
|
|
21
|
+
//# sourceMappingURL=vault-settings.d.ts.map
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
export const SYNC_CORE_DOWNLOAD_STREAMS_MAX = 32;
|
|
4
|
+
export const SYNC_CORE_VAULT_SETTING_KEYS = ["parallel-downloads", "download-streams"];
|
|
5
|
+
export class SyncCoreVaultSettingError extends Error {
|
|
6
|
+
}
|
|
7
|
+
export function syncCoreVaultSettingsPath(home) {
|
|
8
|
+
return path.join(home, ".hq", "sync-core", "vault-settings.json");
|
|
9
|
+
}
|
|
10
|
+
function validStreams(value) {
|
|
11
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= SYNC_CORE_DOWNLOAD_STREAMS_MAX;
|
|
12
|
+
}
|
|
13
|
+
function cleanSettings(raw) {
|
|
14
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
15
|
+
return undefined;
|
|
16
|
+
const record = raw;
|
|
17
|
+
const settings = {};
|
|
18
|
+
if (record.parallel_downloads !== true)
|
|
19
|
+
return undefined;
|
|
20
|
+
settings.parallelDownloads = true;
|
|
21
|
+
if (validStreams(record.download_streams))
|
|
22
|
+
settings.downloadStreams = record.download_streams;
|
|
23
|
+
return Object.keys(settings).length > 0 ? settings : undefined;
|
|
24
|
+
}
|
|
25
|
+
function readRaw(home, strict) {
|
|
26
|
+
const file = syncCoreVaultSettingsPath(home);
|
|
27
|
+
let text;
|
|
28
|
+
try {
|
|
29
|
+
text = fs.readFileSync(file, "utf8");
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
if (!strict || error.code === "ENOENT")
|
|
33
|
+
return undefined;
|
|
34
|
+
throw new SyncCoreVaultSettingError(`Cannot read ${file}: ${error instanceof Error ? error.message : String(error)}`);
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
return JSON.parse(text);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
if (!strict)
|
|
41
|
+
return undefined;
|
|
42
|
+
throw new SyncCoreVaultSettingError(`${file} is not valid JSON. Fix or remove it, then run the command again.`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export function readSyncCoreVaultSettings(home, opts = {}) {
|
|
46
|
+
const settings = new Map();
|
|
47
|
+
const raw = readRaw(home, opts.strict === true);
|
|
48
|
+
const vaults = raw && typeof raw === "object" && !Array.isArray(raw) ? raw.vaults : undefined;
|
|
49
|
+
if (!vaults || typeof vaults !== "object" || Array.isArray(vaults))
|
|
50
|
+
return settings;
|
|
51
|
+
for (const [uid, value] of Object.entries(vaults)) {
|
|
52
|
+
const clean = cleanSettings(value);
|
|
53
|
+
if (clean)
|
|
54
|
+
settings.set(uid, clean);
|
|
55
|
+
}
|
|
56
|
+
return settings;
|
|
57
|
+
}
|
|
58
|
+
function writeAll(home, all) {
|
|
59
|
+
const file = syncCoreVaultSettingsPath(home);
|
|
60
|
+
if (all.size === 0) {
|
|
61
|
+
fs.rmSync(file, { force: true });
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const vaults = {};
|
|
65
|
+
for (const [uid, settings] of [...all.entries()].sort(([a], [b]) => a.localeCompare(b))) {
|
|
66
|
+
vaults[uid] = {
|
|
67
|
+
...(settings.parallelDownloads ? { parallel_downloads: true } : {}),
|
|
68
|
+
...(settings.downloadStreams !== undefined ? { download_streams: settings.downloadStreams } : {}),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
fs.mkdirSync(path.dirname(file), { recursive: true, mode: 0o700 });
|
|
72
|
+
const tmp = `${file}.${process.pid}.tmp`;
|
|
73
|
+
fs.writeFileSync(tmp, `${JSON.stringify({ version: 1, vaults }, null, 2)}\n`, { mode: 0o600 });
|
|
74
|
+
fs.renameSync(tmp, file);
|
|
75
|
+
}
|
|
76
|
+
export function parseSyncCoreVaultSetting(key, value) {
|
|
77
|
+
if (key === "parallel-downloads") {
|
|
78
|
+
if (value === "on")
|
|
79
|
+
return { parallelDownloads: true };
|
|
80
|
+
if (value === "off")
|
|
81
|
+
return { parallelDownloads: false };
|
|
82
|
+
throw new SyncCoreVaultSettingError(`parallel-downloads takes on or off, not ${JSON.stringify(value)}`);
|
|
83
|
+
}
|
|
84
|
+
if (key === "download-streams") {
|
|
85
|
+
if (value === "default")
|
|
86
|
+
return { downloadStreams: undefined };
|
|
87
|
+
const streams = /^\d+$/.test(value) ? Number(value) : Number.NaN;
|
|
88
|
+
if (!validStreams(streams)) {
|
|
89
|
+
throw new SyncCoreVaultSettingError(`download-streams takes a whole number from 1 to ${SYNC_CORE_DOWNLOAD_STREAMS_MAX}, or default, not ${JSON.stringify(value)}`);
|
|
90
|
+
}
|
|
91
|
+
return { downloadStreams: streams };
|
|
92
|
+
}
|
|
93
|
+
throw new SyncCoreVaultSettingError(`Unknown setting ${JSON.stringify(key)}. Settings: ${SYNC_CORE_VAULT_SETTING_KEYS.join(", ")}`);
|
|
94
|
+
}
|
|
95
|
+
export function setSyncCoreVaultSetting(home, vaultUid, key, value) {
|
|
96
|
+
const change = parseSyncCoreVaultSetting(key, value);
|
|
97
|
+
const all = readSyncCoreVaultSettings(home, { strict: true });
|
|
98
|
+
const next = { ...all.get(vaultUid) };
|
|
99
|
+
if ("parallelDownloads" in change) {
|
|
100
|
+
if (change.parallelDownloads)
|
|
101
|
+
next.parallelDownloads = true;
|
|
102
|
+
else
|
|
103
|
+
delete next.parallelDownloads;
|
|
104
|
+
}
|
|
105
|
+
else if (change.downloadStreams === undefined) {
|
|
106
|
+
delete next.downloadStreams;
|
|
107
|
+
}
|
|
108
|
+
else if (!next.parallelDownloads) {
|
|
109
|
+
throw new SyncCoreVaultSettingError("Turn parallel-downloads on for this vault before setting download-streams");
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
next.downloadStreams = change.downloadStreams;
|
|
113
|
+
}
|
|
114
|
+
if (!next.parallelDownloads)
|
|
115
|
+
delete next.downloadStreams;
|
|
116
|
+
if (Object.keys(next).length === 0)
|
|
117
|
+
all.delete(vaultUid);
|
|
118
|
+
else
|
|
119
|
+
all.set(vaultUid, next);
|
|
120
|
+
writeAll(home, all);
|
|
121
|
+
return all.get(vaultUid);
|
|
122
|
+
}
|
|
123
|
+
export function engineSettingsEnv(settings) {
|
|
124
|
+
if (!settings?.parallelDownloads)
|
|
125
|
+
return {};
|
|
126
|
+
return {
|
|
127
|
+
HQ_SYNC_PARALLEL_DOWNLOADS: "1",
|
|
128
|
+
...(settings.downloadStreams !== undefined ? { HQ_SYNC_DOWNLOAD_STREAMS: String(settings.downloadStreams) } : {}),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=vault-settings.js.map
|
|
@@ -26,6 +26,8 @@ export interface InstallFollowupDeps {
|
|
|
26
26
|
ensurePath?: () => void;
|
|
27
27
|
/** True when the daemon install succeeded. */
|
|
28
28
|
spawnMesh?: () => boolean;
|
|
29
|
+
platform?: NodeJS.Platform;
|
|
30
|
+
loginHome?: string;
|
|
29
31
|
version?: string;
|
|
30
32
|
readMarker?: () => InstallFollowupMarker;
|
|
31
33
|
writeMarker?: (marker: InstallFollowupMarker) => void;
|
|
@@ -12,6 +12,7 @@ import os from "node:os";
|
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
import { fileURLToPath } from "node:url";
|
|
14
14
|
import { ensureShimOnUserPath, npmShimDir } from "./user-path.js";
|
|
15
|
+
import { homeIsLoginSafe } from "../mesh/live/daemon/login-home.js";
|
|
15
16
|
const MARKER_NAME = "install-followup.json";
|
|
16
17
|
export function isInstallFollowupSkipped(argv, env) {
|
|
17
18
|
if (env.HQ_INSTALL_FOLLOWUP === "1" || env.HQ_STAGED_INSTALL === "1")
|
|
@@ -73,7 +74,7 @@ function defaultSpawnMesh(argv, env) {
|
|
|
73
74
|
return false;
|
|
74
75
|
const result = spawnSync(process.execPath, [entry, "mesh", "daemon", "install", "--if-stale"], {
|
|
75
76
|
env: { ...env, HQ_INSTALL_FOLLOWUP: "1" },
|
|
76
|
-
timeout:
|
|
77
|
+
timeout: 90_000,
|
|
77
78
|
windowsHide: true,
|
|
78
79
|
stdio: "ignore",
|
|
79
80
|
});
|
|
@@ -122,6 +123,8 @@ export function runWindowsInstallFollowup(deps) {
|
|
|
122
123
|
const mesh = read();
|
|
123
124
|
if (mesh.version === version)
|
|
124
125
|
return;
|
|
126
|
+
if ((deps.platform ?? process.platform) === "darwin" && !homeIsLoginSafe(env.HOME || os.homedir(), deps.loginHome))
|
|
127
|
+
return;
|
|
125
128
|
const now = (deps.now ?? Date.now)();
|
|
126
129
|
if (mesh.meshFailedVersion === version && mesh.meshFailedAt !== undefined && now - mesh.meshFailedAt < MESH_RETRY_MS)
|
|
127
130
|
return;
|