@indigoai-us/hq-cloud 6.16.58-alpha.3 → 6.16.59
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-company.d.ts +0 -14
- package/dist/bin/sync-runner-company.d.ts.map +1 -1
- package/dist/bin/sync-runner-company.js +89 -57
- package/dist/bin/sync-runner-company.js.map +1 -1
- package/dist/bin/sync-runner-company.test.js +313 -56
- package/dist/bin/sync-runner-company.test.js.map +1 -1
- package/dist/bin/sync-runner-planning.d.ts +3 -12
- package/dist/bin/sync-runner-planning.d.ts.map +1 -1
- package/dist/bin/sync-runner-planning.js +3 -65
- package/dist/bin/sync-runner-planning.js.map +1 -1
- package/dist/bin/sync-runner-planning.test.js +1 -172
- package/dist/bin/sync-runner-planning.test.js.map +1 -1
- package/dist/bin/sync-runner-watch-loop.d.ts +2 -51
- package/dist/bin/sync-runner-watch-loop.d.ts.map +1 -1
- package/dist/bin/sync-runner-watch-loop.js +165 -409
- package/dist/bin/sync-runner-watch-loop.js.map +1 -1
- package/dist/bin/sync-runner-watch-routes.d.ts +2 -19
- package/dist/bin/sync-runner-watch-routes.d.ts.map +1 -1
- package/dist/bin/sync-runner-watch-routes.js +5 -40
- package/dist/bin/sync-runner-watch-routes.js.map +1 -1
- package/dist/bin/sync-runner-watch-routes.test.js +0 -47
- package/dist/bin/sync-runner-watch-routes.test.js.map +1 -1
- package/dist/bin/sync-runner.d.ts +13 -59
- package/dist/bin/sync-runner.d.ts.map +1 -1
- package/dist/bin/sync-runner.js +4 -48
- package/dist/bin/sync-runner.js.map +1 -1
- package/dist/bin/sync-runner.test.js +229 -1499
- package/dist/bin/sync-runner.test.js.map +1 -1
- package/dist/cli/share.d.ts +0 -19
- package/dist/cli/share.d.ts.map +1 -1
- package/dist/cli/share.js +0 -55
- package/dist/cli/share.js.map +1 -1
- package/dist/cli/share.test.js +1 -87
- package/dist/cli/share.test.js.map +1 -1
- package/dist/cli/sync-scope.test.js +0 -8
- package/dist/cli/sync-scope.test.js.map +1 -1
- package/dist/cli/sync.d.ts +8 -12
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +152 -302
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/sync.test.js +126 -256
- package/dist/cli/sync.test.js.map +1 -1
- package/dist/cognito-auth.d.ts +34 -1
- package/dist/cognito-auth.d.ts.map +1 -1
- package/dist/cognito-auth.js +92 -21
- package/dist/cognito-auth.js.map +1 -1
- package/dist/context.d.ts +5 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +92 -12
- package/dist/context.js.map +1 -1
- package/dist/context.test.js +77 -2
- package/dist/context.test.js.map +1 -1
- package/dist/ignore.d.ts +10 -0
- package/dist/ignore.d.ts.map +1 -1
- package/dist/ignore.js +47 -5
- package/dist/ignore.js.map +1 -1
- package/dist/ignore.test.js +30 -3
- package/dist/ignore.test.js.map +1 -1
- package/dist/journal-row-store.d.ts +5 -40
- package/dist/journal-row-store.d.ts.map +1 -1
- package/dist/journal-row-store.js +21 -240
- package/dist/journal-row-store.js.map +1 -1
- package/dist/journal-row-store.test.js +0 -54
- package/dist/journal-row-store.test.js.map +1 -1
- package/dist/journal-snapshot-v4.d.ts.map +1 -1
- package/dist/journal-snapshot-v4.js +6 -11
- package/dist/journal-snapshot-v4.js.map +1 -1
- package/dist/journal-store.test.js +7 -324
- package/dist/journal-store.test.js.map +1 -1
- package/dist/journal.d.ts +16 -51
- package/dist/journal.d.ts.map +1 -1
- package/dist/journal.js +79 -303
- package/dist/journal.js.map +1 -1
- package/dist/lib/exit-codes.d.ts +0 -15
- package/dist/lib/exit-codes.d.ts.map +1 -1
- package/dist/lib/exit-codes.js +0 -15
- package/dist/lib/exit-codes.js.map +1 -1
- package/dist/lib/net-errors.d.ts +12 -0
- package/dist/lib/net-errors.d.ts.map +1 -1
- package/dist/lib/net-errors.js +35 -0
- package/dist/lib/net-errors.js.map +1 -1
- package/dist/lib/net-errors.test.js +19 -1
- package/dist/lib/net-errors.test.js.map +1 -1
- package/dist/machine-auth.test.js +6 -4
- package/dist/machine-auth.test.js.map +1 -1
- package/dist/machine-token-cache-isolation.test.d.ts +24 -0
- package/dist/machine-token-cache-isolation.test.d.ts.map +1 -0
- package/dist/machine-token-cache-isolation.test.js +241 -0
- package/dist/machine-token-cache-isolation.test.js.map +1 -0
- package/dist/manifest/build-manifest-resident-parity.test.js +3 -3
- package/dist/manifest/build-manifest-resident-parity.test.js.map +1 -1
- package/dist/personal-vault.d.ts.map +1 -1
- package/dist/personal-vault.js +3 -10
- package/dist/personal-vault.js.map +1 -1
- package/dist/personal-vault.test.js +0 -35
- package/dist/personal-vault.test.js.map +1 -1
- package/dist/remote-pull.d.ts.map +1 -1
- package/dist/remote-pull.js +2 -9
- package/dist/remote-pull.js.map +1 -1
- package/dist/remote-pull.test.js +2 -59
- package/dist/remote-pull.test.js.map +1 -1
- package/dist/s3.d.ts +0 -1
- package/dist/s3.d.ts.map +1 -1
- package/dist/s3.js +2 -20
- package/dist/s3.js.map +1 -1
- package/dist/sync/area-ledger.d.ts +3 -27
- package/dist/sync/area-ledger.d.ts.map +1 -1
- package/dist/sync/area-ledger.js +39 -149
- package/dist/sync/area-ledger.js.map +1 -1
- package/dist/sync/area-ledger.test.js +5 -192
- package/dist/sync/area-ledger.test.js.map +1 -1
- package/dist/sync/parallel-sync-coordinator.test.js +0 -29
- package/dist/sync/parallel-sync-coordinator.test.js.map +1 -1
- package/dist/sync/realtime-telemetry.d.ts +1 -1
- package/dist/sync/realtime-telemetry.d.ts.map +1 -1
- package/dist/sync/realtime-telemetry.js +6 -14
- package/dist/sync/realtime-telemetry.js.map +1 -1
- package/dist/sync/realtime-telemetry.test.js +16 -136
- package/dist/sync/realtime-telemetry.test.js.map +1 -1
- package/dist/sync/state-store.d.ts +0 -6
- package/dist/sync/state-store.d.ts.map +1 -1
- package/dist/sync/state-store.js +2 -14
- package/dist/sync/state-store.js.map +1 -1
- package/dist/watcher.d.ts +0 -12
- package/dist/watcher.d.ts.map +1 -1
- package/dist/watcher.js +0 -131
- package/dist/watcher.js.map +1 -1
- package/dist/watcher.test.js +0 -63
- package/dist/watcher.test.js.map +1 -1
- package/package.json +1 -2
- package/dist/cli/onepass-pull-planner-regressions.test.d.ts +0 -2
- package/dist/cli/onepass-pull-planner-regressions.test.d.ts.map +0 -1
- package/dist/cli/onepass-pull-planner-regressions.test.js +0 -300
- package/dist/cli/onepass-pull-planner-regressions.test.js.map +0 -1
- package/dist/cli/onepass-pull-planner.test.d.ts +0 -2
- package/dist/cli/onepass-pull-planner.test.d.ts.map +0 -1
- package/dist/cli/onepass-pull-planner.test.js +0 -266
- package/dist/cli/onepass-pull-planner.test.js.map +0 -1
- package/dist/cli/streaming-pull-planner.bench.test.d.ts +0 -15
- package/dist/cli/streaming-pull-planner.bench.test.d.ts.map +0 -1
- package/dist/cli/streaming-pull-planner.bench.test.js +0 -273
- package/dist/cli/streaming-pull-planner.bench.test.js.map +0 -1
- package/dist/s3.list-cost.test.d.ts +0 -2
- package/dist/s3.list-cost.test.d.ts.map +0 -1
- package/dist/s3.list-cost.test.js +0 -51
- package/dist/s3.list-cost.test.js.map +0 -1
- package/dist/sync/remote-file-spool.d.ts +0 -16
- package/dist/sync/remote-file-spool.d.ts.map +0 -1
- package/dist/sync/remote-file-spool.js +0 -91
- package/dist/sync/remote-file-spool.js.map +0 -1
- package/dist/sync/remote-file-spool.test.d.ts +0 -2
- package/dist/sync/remote-file-spool.test.d.ts.map +0 -1
- package/dist/sync/remote-file-spool.test.js +0 -77
- package/dist/sync/remote-file-spool.test.js.map +0 -1
package/dist/cli/share.test.js
CHANGED
|
@@ -64,14 +64,13 @@ vi.mock("readline", () => ({
|
|
|
64
64
|
})),
|
|
65
65
|
}));
|
|
66
66
|
import * as readline from "readline";
|
|
67
|
-
import { share, ServerOwnedPushPathsError, UnreachablePushPathsError, UnregisteredCompanySkillError, currentUploadBytes,
|
|
67
|
+
import { share, ServerOwnedPushPathsError, UnreachablePushPathsError, UnregisteredCompanySkillError, currentUploadBytes, parseRegisteredCompanySkillUid, _testing as shareTesting, } from "./share.js";
|
|
68
68
|
import { deleteRemoteFile, downloadFile, headRemoteFile, primeObjectTransport, primeUploads, uploadFile, uploadSymlink, WindowsSymlinkPrivilegeError, } from "../s3.js";
|
|
69
69
|
import { VaultAuthError, VaultClientError, VaultConflictError, VaultPermissionDeniedError, } from "../vault-client.js";
|
|
70
70
|
import { CognitoRefreshError } from "../cognito-auth.js";
|
|
71
71
|
import { AreaLedgerMigration, closeCachedAreaJournalMigration, hashFile, openJournalStateStoreForMigration, readJournal, readJournalScoped, setAreaLedgerMigrationTestHooksForTest, writeJournal, } from "../journal.js";
|
|
72
72
|
import { ReconcileCursorStore } from "../sync/reconcile-cursor.js";
|
|
73
73
|
import { AreaResolver } from "../sync/area-resolver.js";
|
|
74
|
-
import { CooperativePassScheduler } from "../bin/sync-runner-watch-loop.js";
|
|
75
74
|
/**
|
|
76
75
|
* Read a journal the way production does.
|
|
77
76
|
*
|
|
@@ -1675,91 +1674,6 @@ describe("share", () => {
|
|
|
1675
1674
|
// Remote key must be company-relative, not hqRoot-relative
|
|
1676
1675
|
expect(uploadFile).toHaveBeenCalledWith(expect.anything(), testFile, "test.md", undefined, expect.anything());
|
|
1677
1676
|
});
|
|
1678
|
-
it("hands queued realtime work a settled full-push boundary without losing journal rows", async () => {
|
|
1679
|
-
const companyRoot = path.join(tmpDir, "companies", "acme");
|
|
1680
|
-
const fileCount = FULL_PUSH_COOPERATIVE_CHECKPOINT_BATCH_SIZE + 1;
|
|
1681
|
-
for (let index = 0; index < fileCount; index++) {
|
|
1682
|
-
const file = path.join(companyRoot, "docs", "full-push", `${index}.md`);
|
|
1683
|
-
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
1684
|
-
fs.writeFileSync(file, "full-push body");
|
|
1685
|
-
}
|
|
1686
|
-
const scheduler = new CooperativePassScheduler(() => 0);
|
|
1687
|
-
let uploadsCompleted = 0;
|
|
1688
|
-
let uploadsInFlight = 0;
|
|
1689
|
-
let maxUploadsInFlight = 0;
|
|
1690
|
-
let realtimeQueued = false;
|
|
1691
|
-
let realtimeDispatchedAt = -1;
|
|
1692
|
-
let checkpointCalls = 0;
|
|
1693
|
-
let realtimePass;
|
|
1694
|
-
const upload = vi.mocked(uploadFile);
|
|
1695
|
-
const originalUpload = upload.getMockImplementation();
|
|
1696
|
-
upload.mockImplementation(async () => {
|
|
1697
|
-
uploadsInFlight++;
|
|
1698
|
-
maxUploadsInFlight = Math.max(maxUploadsInFlight, uploadsInFlight);
|
|
1699
|
-
await Promise.resolve();
|
|
1700
|
-
uploadsCompleted++;
|
|
1701
|
-
if (uploadsCompleted === 1) {
|
|
1702
|
-
realtimeQueued = true;
|
|
1703
|
-
realtimePass = scheduler.submit(async () => {
|
|
1704
|
-
// `executeUploads` drains the full unit before the scheduler grants
|
|
1705
|
-
// realtime the root lock: no two durable writers overlap.
|
|
1706
|
-
expect(uploadsInFlight).toBe(0);
|
|
1707
|
-
realtimeDispatchedAt = uploadsCompleted;
|
|
1708
|
-
const realtimePath = path.join(companyRoot, "docs", "realtime.md");
|
|
1709
|
-
fs.writeFileSync(realtimePath, "realtime body");
|
|
1710
|
-
const journal = readJournal("acme");
|
|
1711
|
-
journal.files["docs/realtime.md"] = {
|
|
1712
|
-
hash: hashFile(realtimePath),
|
|
1713
|
-
size: fs.statSync(realtimePath).size,
|
|
1714
|
-
syncedAt: "2026-09-17T12:00:00.000Z",
|
|
1715
|
-
direction: "up",
|
|
1716
|
-
remoteEtag: "realtime",
|
|
1717
|
-
mtimeMs: fs.statSync(realtimePath).mtimeMs,
|
|
1718
|
-
ctimeMs: fs.statSync(realtimePath).ctimeMs,
|
|
1719
|
-
};
|
|
1720
|
-
writeJournal("acme", journal);
|
|
1721
|
-
}, "realtime");
|
|
1722
|
-
}
|
|
1723
|
-
uploadsInFlight--;
|
|
1724
|
-
return { etag: '"full-push-etag"' };
|
|
1725
|
-
});
|
|
1726
|
-
try {
|
|
1727
|
-
await scheduler.submit(async ({ checkpoint }) => {
|
|
1728
|
-
await share({
|
|
1729
|
-
paths: [companyRoot],
|
|
1730
|
-
company: "acme",
|
|
1731
|
-
vaultConfig: mockConfig,
|
|
1732
|
-
hqRoot: tmpDir,
|
|
1733
|
-
skipUnchanged: true,
|
|
1734
|
-
propagateDeletes: true,
|
|
1735
|
-
cooperativeCheckpoint: async () => {
|
|
1736
|
-
checkpointCalls++;
|
|
1737
|
-
return checkpoint();
|
|
1738
|
-
},
|
|
1739
|
-
});
|
|
1740
|
-
}, "chore");
|
|
1741
|
-
await realtimePass;
|
|
1742
|
-
}
|
|
1743
|
-
finally {
|
|
1744
|
-
if (originalUpload)
|
|
1745
|
-
upload.mockImplementation(originalUpload);
|
|
1746
|
-
else
|
|
1747
|
-
upload.mockReset();
|
|
1748
|
-
}
|
|
1749
|
-
expect(maxUploadsInFlight).toBeGreaterThan(1);
|
|
1750
|
-
expect(realtimeQueued).toBe(true);
|
|
1751
|
-
expect(checkpointCalls).toBeGreaterThan(0);
|
|
1752
|
-
expect(realtimeDispatchedAt).toBeGreaterThan(0);
|
|
1753
|
-
expect(realtimeDispatchedAt).toBeLessThanOrEqual(FULL_PUSH_COOPERATIVE_CHECKPOINT_BATCH_SIZE);
|
|
1754
|
-
// Reopen the durable journal, rather than inspecting the stale first-pass
|
|
1755
|
-
// object: every pre-handoff key and the realtime key must survive.
|
|
1756
|
-
const durable = readJournal("acme");
|
|
1757
|
-
expect(Object.keys(durable.files)).toHaveLength(fileCount + 1);
|
|
1758
|
-
expect(durable.files["docs/realtime.md"]).toBeDefined();
|
|
1759
|
-
for (let index = 0; index < fileCount; index++) {
|
|
1760
|
-
expect(durable.files[`docs/full-push/${index}.md`]).toBeDefined();
|
|
1761
|
-
}
|
|
1762
|
-
}, 120_000);
|
|
1763
1677
|
it("replans an upload from the bytes present when its action starts", async () => {
|
|
1764
1678
|
const companyRoot = path.join(tmpDir, "companies", "acme");
|
|
1765
1679
|
fs.mkdirSync(companyRoot, { recursive: true });
|