@indigoai-us/hq-cloud 6.18.16-alpha.1 → 6.18.16-alpha.706
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/sync-runner-watch-loop.d.ts +0 -3
- package/dist/bin/sync-runner-watch-loop.d.ts.map +1 -1
- package/dist/bin/sync-runner-watch-loop.js +7 -92
- package/dist/bin/sync-runner-watch-loop.js.map +1 -1
- package/dist/bin/sync-runner-watch-loop.test.js +1 -12
- package/dist/bin/sync-runner-watch-loop.test.js.map +1 -1
- package/dist/bin/sync-runner.test.js +0 -55
- package/dist/bin/sync-runner.test.js.map +1 -1
- package/dist/cli/case-alias.d.ts +43 -0
- package/dist/cli/case-alias.d.ts.map +1 -0
- package/dist/cli/case-alias.js +206 -0
- package/dist/cli/case-alias.js.map +1 -0
- package/dist/cli/case-alias.test.d.ts +2 -0
- package/dist/cli/case-alias.test.d.ts.map +1 -0
- package/dist/cli/case-alias.test.js +96 -0
- package/dist/cli/case-alias.test.js.map +1 -0
- package/dist/cli/share.d.ts +2 -0
- package/dist/cli/share.d.ts.map +1 -1
- package/dist/cli/share.js +53 -2
- package/dist/cli/share.js.map +1 -1
- package/dist/cli/share.test.js +171 -0
- package/dist/cli/share.test.js.map +1 -1
- package/dist/cli/sync.d.ts +17 -1
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +65 -4
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/sync.test.js +224 -0
- package/dist/cli/sync.test.js.map +1 -1
- package/dist/sync/event-sync.d.ts +0 -2
- package/dist/sync/event-sync.d.ts.map +1 -1
- package/dist/sync/event-sync.js +1 -15
- package/dist/sync/event-sync.js.map +1 -1
- package/dist/sync/event-sync.test.js +0 -32
- package/dist/sync/event-sync.test.js.map +1 -1
- package/dist/sync/push-receiver.d.ts +1 -21
- package/dist/sync/push-receiver.d.ts.map +1 -1
- package/dist/sync/push-receiver.js +8 -166
- package/dist/sync/push-receiver.js.map +1 -1
- package/dist/sync/push-receiver.test.js +1 -258
- package/dist/sync/push-receiver.test.js.map +1 -1
- package/dist/sync/sync-contract.d.ts.map +1 -1
- package/dist/sync/sync-contract.js +0 -1
- package/dist/sync/sync-contract.js.map +1 -1
- package/dist/sync-contract.json +1 -2
- package/dist/watch-owner-lease.d.ts +0 -2
- package/dist/watch-owner-lease.d.ts.map +1 -1
- package/dist/watch-owner-lease.js +2 -3
- package/dist/watch-owner-lease.js.map +1 -1
- package/dist/watch-owner-lease.test.js +4 -22
- package/dist/watch-owner-lease.test.js.map +1 -1
- package/dist/watcher.d.ts +3 -0
- package/dist/watcher.d.ts.map +1 -1
- package/dist/watcher.js +78 -1
- package/dist/watcher.js.map +1 -1
- package/dist/watcher.test.js +47 -0
- package/dist/watcher.test.js.map +1 -1
- package/package.json +1 -1
- package/dist/sync/receiver-last-delivery.d.ts +0 -22
- package/dist/sync/receiver-last-delivery.d.ts.map +0 -1
- package/dist/sync/receiver-last-delivery.js +0 -139
- package/dist/sync/receiver-last-delivery.js.map +0 -1
- package/dist/sync/receiver-last-delivery.test.d.ts +0 -2
- package/dist/sync/receiver-last-delivery.test.d.ts.map +0 -1
- package/dist/sync/receiver-last-delivery.test.js +0 -110
- package/dist/sync/receiver-last-delivery.test.js.map +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type TreeChange, type TreeChangeBatch } from "../watcher.js";
|
|
2
2
|
import { readJournal } from "../journal.js";
|
|
3
|
-
import { ReceiverDispatchError } from "../sync/push-receiver.js";
|
|
4
3
|
import { type FeatureSwitch } from "../sync/feature-flags.js";
|
|
5
4
|
import { HeapCensus } from "./sync-runner-heap-telemetry.js";
|
|
6
5
|
import { FullPassCapController } from "../sync/full-pass-caps.js";
|
|
@@ -8,7 +7,6 @@ import { type RealtimeTelemetryReason } from "../sync/realtime-telemetry.js";
|
|
|
8
7
|
import { type PathWorkOutcome } from "../sync/sync-work.js";
|
|
9
8
|
import type { TelemetryClaims } from "../telemetry-events.js";
|
|
10
9
|
import type { JournalEntry } from "../types.js";
|
|
11
|
-
import { type WatchRoute } from "./sync-runner-watch-routes.js";
|
|
12
10
|
import type { CooperativePassCheckpoint, Direction, RunnerLoopDeps, RunnerPassOutcome } from "./sync-runner.js";
|
|
13
11
|
/** Maximum time shutdown waits for event-sync startup before abandoning it. */
|
|
14
12
|
export declare const EVENT_SYNC_STARTUP_SHUTDOWN_WAIT_MS = 5000;
|
|
@@ -390,7 +388,6 @@ export declare function publishedContentHashFromJournalEntry(entry: Readonly<Jou
|
|
|
390
388
|
*/
|
|
391
389
|
export declare function shouldQuarantineWatcherDeleteIntents(expandedEntries: number, journalEntries: number): boolean;
|
|
392
390
|
export declare function shouldAcknowledgeParallelUnresolvedCompany(accepted: boolean, exitCode: number): boolean;
|
|
393
|
-
export declare function targetedReceiverDispatchError(outcome: number | RunnerPassOutcome, accepted: boolean, authRequiredExitCode: number, route: WatchRoute): ReceiverDispatchError;
|
|
394
391
|
export declare function runOneShotWithOperationLock(argv: string[], parsed: ParsedLoopArgs, deps: RunnerLoopDeps, runtime: WatchLoopRuntime): Promise<number>;
|
|
395
392
|
export declare function runWatchLoop(argv: string[], parsed: ParsedLoopArgs, deps: RunnerLoopDeps, runtime: WatchLoopRuntime): Promise<number>;
|
|
396
393
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-runner-watch-loop.d.ts","sourceRoot":"","sources":["../../src/bin/sync-runner-watch-loop.ts"],"names":[],"mappings":"AAwBA,OAAO,EAML,KAAK,UAAU,EAEf,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAUL,WAAW,EASZ,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"sync-runner-watch-loop.d.ts","sourceRoot":"","sources":["../../src/bin/sync-runner-watch-loop.ts"],"names":[],"mappings":"AAwBA,OAAO,EAML,KAAK,UAAU,EAEf,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AAEv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AAM,GAAG,SAAS,CAQpB;AAWD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oCAAoC,CAClD,eAAe,EAAE,MAAM,EACvB,cAAc,EAAE,MAAM,GACrB,OAAO,CAIT;AAeD,wBAAgB,0CAA0C,CACxD,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAET;AA8ED,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,MAAM,EAAE,EACd,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CAgBjB;AAED,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EAAE,EACd,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CA0qHjB"}
|
|
@@ -18,7 +18,6 @@ import { recoverHqRootLocalState } from "../hq-root-recovery.js";
|
|
|
18
18
|
import { clearLocalDeleteIntent, getStateDir, markLocalDeleteIntent, PERSONAL_VAULT_JOURNAL_SLUG, openJournalStoreSession, openJournalStoreSessionAsync, listJournalSlugs, listJournals, maintainAreaJournalSlice, disposeScopedJournalStores, releaseScopedJournalStore, releaseCachedAreaJournalMigrations, journalCacheCensusSizes, emitJournalCacheMetric, journalRows, readJournalScoped, writeJournal, } from "../journal.js";
|
|
19
19
|
import { isPersonalVaultDeletionExcluded } from "../personal-vault.js";
|
|
20
20
|
import { NoopPushReceiver, ReceiverDispatchError, isReceiverTransportFailure, } from "../sync/push-receiver.js";
|
|
21
|
-
import { appendReceiverLastDeliveryEntry, clearReceiverLastDeliveryEntries, readReceiverLastDeliveryEntries, receiverLastDeliveryFilePath, } from "../sync/receiver-last-delivery.js";
|
|
22
21
|
import { CONTENT_HASH_PATTERN } from "../sync/push-event.js";
|
|
23
22
|
import { resolveEventSync, startEventSync as defaultStartEventSync, } from "../sync/event-sync.js";
|
|
24
23
|
import { resolveAreaStorageEnabled, resolveEffectiveParallelSyncRollout, resolveParallelSyncRollout, } from "../sync/feature-flags.js";
|
|
@@ -1331,7 +1330,7 @@ function unresolvedReceiverMessagesWereRedelivered(events, receiveCountsByPath)
|
|
|
1331
1330
|
receiveCounts.every((count) => count !== undefined && Number.isFinite(count) && count >= 2);
|
|
1332
1331
|
});
|
|
1333
1332
|
}
|
|
1334
|
-
|
|
1333
|
+
function targetedReceiverDispatchError(outcome, accepted, authRequiredExitCode) {
|
|
1335
1334
|
const exitCode = passExitCode(outcome);
|
|
1336
1335
|
const result = typeof outcome === "number" ? undefined : outcome.result;
|
|
1337
1336
|
const diagnostics = [
|
|
@@ -1341,12 +1340,11 @@ export function targetedReceiverDispatchError(outcome, accepted, authRequiredExi
|
|
|
1341
1340
|
];
|
|
1342
1341
|
const failureReason = `targeted pull failed with exit code ${exitCode}, accepted=${accepted}` +
|
|
1343
1342
|
(diagnostics.length === 0 ? "" : `: ${[...new Set(diagnostics)].join("; ")}`);
|
|
1344
|
-
const isTransportFailure =
|
|
1345
|
-
exitCode === authRequiredExitCode ||
|
|
1343
|
+
const isTransportFailure = exitCode === authRequiredExitCode ||
|
|
1346
1344
|
exitCode === TRANSIENT_NETWORK_EXIT ||
|
|
1347
1345
|
(result?.transient?.length ?? 0) > 0 ||
|
|
1348
1346
|
isReceiverTransportFailure(failureReason);
|
|
1349
|
-
return new ReceiverDispatchError(isTransportFailure ? "transport" : "path-specific", failureReason
|
|
1347
|
+
return new ReceiverDispatchError(isTransportFailure ? "transport" : "path-specific", failureReason);
|
|
1350
1348
|
}
|
|
1351
1349
|
/**
|
|
1352
1350
|
* Exit code for one scoped/catch-up route. A 404 company route returns
|
|
@@ -3320,80 +3318,6 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
3320
3318
|
}
|
|
3321
3319
|
return worstExit;
|
|
3322
3320
|
};
|
|
3323
|
-
const receiverRecoveryRoutesPending = new Set();
|
|
3324
|
-
let receiverRecoveryReadWarningEmitted = false;
|
|
3325
|
-
const runReceiverLastDeliveryDrain = () => {
|
|
3326
|
-
let snapshot;
|
|
3327
|
-
try {
|
|
3328
|
-
snapshot = readReceiverLastDeliveryEntries(receiverLastDeliveryFilePath(getStateDir()));
|
|
3329
|
-
}
|
|
3330
|
-
catch {
|
|
3331
|
-
if (!receiverRecoveryReadWarningEmitted) {
|
|
3332
|
-
receiverRecoveryReadWarningEmitted = true;
|
|
3333
|
-
process.stderr.write("hq-sync-runner: receiver last-delivery recovery state unreadable; entries retained\n");
|
|
3334
|
-
}
|
|
3335
|
-
return;
|
|
3336
|
-
}
|
|
3337
|
-
if (snapshot.length === 0)
|
|
3338
|
-
return;
|
|
3339
|
-
const routes = new Map();
|
|
3340
|
-
const skipCompanies = resolveSkipCompanies();
|
|
3341
|
-
for (const entry of snapshot) {
|
|
3342
|
-
const route = routeChangeToTarget(entry.relativePath);
|
|
3343
|
-
if (route === null ||
|
|
3344
|
-
routeKey(route) !== entry.route ||
|
|
3345
|
-
!isWatchRouteSelected(route, watchRouteSelection) ||
|
|
3346
|
-
(route.kind === "company" && skipCompanies.has(route.slug.toLowerCase()))) {
|
|
3347
|
-
continue;
|
|
3348
|
-
}
|
|
3349
|
-
const key = routeKey(route);
|
|
3350
|
-
const group = routes.get(key) ?? { route, entries: [] };
|
|
3351
|
-
group.entries.push(entry);
|
|
3352
|
-
routes.set(key, group);
|
|
3353
|
-
}
|
|
3354
|
-
const clearCompletedEntries = (route, entries) => {
|
|
3355
|
-
const cleared = clearReceiverLastDeliveryEntries(receiverLastDeliveryFilePath(getStateDir()), entries);
|
|
3356
|
-
if (!cleared.ok) {
|
|
3357
|
-
process.stderr.write(`hq-sync-runner: receiver recovery state for ${routeKey(route)} could not be cleared; entries retained\n`);
|
|
3358
|
-
}
|
|
3359
|
-
};
|
|
3360
|
-
if (parallelCoordinatorEnabled) {
|
|
3361
|
-
for (const [key, { route, entries }] of routes) {
|
|
3362
|
-
if (receiverRecoveryRoutesPending.has(key))
|
|
3363
|
-
continue;
|
|
3364
|
-
receiverRecoveryRoutesPending.add(key);
|
|
3365
|
-
enqueueChore("backlog", () => runGuarded(buildRoutePullArgv(route, passArgv)), (execution) => {
|
|
3366
|
-
receiverRecoveryRoutesPending.delete(key);
|
|
3367
|
-
const exit = execution.accepted ? passExitCode(execution.result) : 1;
|
|
3368
|
-
if (exit === 0) {
|
|
3369
|
-
clearCompletedEntries(route, entries);
|
|
3370
|
-
return;
|
|
3371
|
-
}
|
|
3372
|
-
process.stderr.write(`hq-sync-runner: receiver recovery route ${key} failed (exit=${exit}); entry retained\n`);
|
|
3373
|
-
interruptWait();
|
|
3374
|
-
});
|
|
3375
|
-
}
|
|
3376
|
-
return;
|
|
3377
|
-
}
|
|
3378
|
-
if (routes.size === 0)
|
|
3379
|
-
return;
|
|
3380
|
-
return (async () => {
|
|
3381
|
-
for (const [key, { route, entries }] of routes) {
|
|
3382
|
-
try {
|
|
3383
|
-
const result = await runGuarded(buildRoutePullArgv(route, passArgv));
|
|
3384
|
-
const exit = passExitCode(result);
|
|
3385
|
-
if (exit === 0) {
|
|
3386
|
-
clearCompletedEntries(route, entries);
|
|
3387
|
-
continue;
|
|
3388
|
-
}
|
|
3389
|
-
process.stderr.write(`hq-sync-runner: receiver recovery route ${key} failed (exit=${exit}); entry retained\n`);
|
|
3390
|
-
}
|
|
3391
|
-
catch (error) {
|
|
3392
|
-
process.stderr.write(`hq-sync-runner: receiver recovery route ${key} failed (${describeError(error)}); entry retained\n`);
|
|
3393
|
-
}
|
|
3394
|
-
}
|
|
3395
|
-
})();
|
|
3396
|
-
};
|
|
3397
3321
|
let receiver = null;
|
|
3398
3322
|
let receiverHasQueuedWork = false;
|
|
3399
3323
|
const warnUnresolvedReceiverCompany = (route, pathCount) => {
|
|
@@ -3683,13 +3607,13 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
3683
3607
|
const exitCode = passExitCode(execution.result);
|
|
3684
3608
|
if (shouldAcknowledgeParallelUnresolvedCompany(execution.accepted, exitCode)) {
|
|
3685
3609
|
if (!unresolvedReceiverMessagesWereRedelivered(events, receiveCountsByPath)) {
|
|
3686
|
-
throw targetedReceiverDispatchError(execution.result, execution.accepted, runtime.authRequiredPassExit
|
|
3610
|
+
throw targetedReceiverDispatchError(execution.result, execution.accepted, runtime.authRequiredPassExit);
|
|
3687
3611
|
}
|
|
3688
3612
|
warnUnresolvedReceiverCompany(route, pathCount);
|
|
3689
3613
|
continue;
|
|
3690
3614
|
}
|
|
3691
3615
|
if (!execution.accepted || exitCode !== 0) {
|
|
3692
|
-
throw targetedReceiverDispatchError(execution.result, execution.accepted, runtime.authRequiredPassExit
|
|
3616
|
+
throw targetedReceiverDispatchError(execution.result, execution.accepted, runtime.authRequiredPassExit);
|
|
3693
3617
|
}
|
|
3694
3618
|
}
|
|
3695
3619
|
};
|
|
@@ -3746,13 +3670,13 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
3746
3670
|
const exitCode = passExitCode(result);
|
|
3747
3671
|
if (exitCode === UNRESOLVED_COMPANY_EXIT) {
|
|
3748
3672
|
if (!unresolvedReceiverMessagesWereRedelivered(routeEvents, receiveCountsByPath)) {
|
|
3749
|
-
throw targetedReceiverDispatchError(result, true, runtime.authRequiredPassExit
|
|
3673
|
+
throw targetedReceiverDispatchError(result, true, runtime.authRequiredPassExit);
|
|
3750
3674
|
}
|
|
3751
3675
|
warnUnresolvedReceiverCompany(route, routeEvents.length);
|
|
3752
3676
|
continue;
|
|
3753
3677
|
}
|
|
3754
3678
|
if (exitCode !== 0) {
|
|
3755
|
-
throw targetedReceiverDispatchError(result, true, runtime.authRequiredPassExit
|
|
3679
|
+
throw targetedReceiverDispatchError(result, true, runtime.authRequiredPassExit);
|
|
3756
3680
|
}
|
|
3757
3681
|
}
|
|
3758
3682
|
};
|
|
@@ -3870,12 +3794,6 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
3870
3794
|
telemetryClaims: claims,
|
|
3871
3795
|
publishedContentHashStateDir: getStateDir(),
|
|
3872
3796
|
publishedContentHashLookup,
|
|
3873
|
-
recordLastDeliveryFailure: (entry) => {
|
|
3874
|
-
const stored = appendReceiverLastDeliveryEntry(receiverLastDeliveryFilePath(getStateDir()), entry);
|
|
3875
|
-
if (stored.ok)
|
|
3876
|
-
interruptWait();
|
|
3877
|
-
return stored.ok;
|
|
3878
|
-
},
|
|
3879
3797
|
onReceiveActivity,
|
|
3880
3798
|
});
|
|
3881
3799
|
if (!handles)
|
|
@@ -4413,9 +4331,6 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
4413
4331
|
// every bridge below.
|
|
4414
4332
|
releaseWatcherJournalStores();
|
|
4415
4333
|
const exitCode = passExitCode(result);
|
|
4416
|
-
const receiverRecoveryDrain = runReceiverLastDeliveryDrain();
|
|
4417
|
-
if (receiverRecoveryDrain)
|
|
4418
|
-
await receiverRecoveryDrain;
|
|
4419
4334
|
if (exitCode === runtime.authRequiredPassExit) {
|
|
4420
4335
|
// The pass already emitted auth-error. Hand the sentinel to the
|
|
4421
4336
|
// outer watch wrapper so it can park in-process (auth-wait) instead
|