@narumitw/pi-sync 0.54.2 → 0.56.0
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/README.md +40 -15
- package/dist/chunks/agent-candidate-3JN6DJKT.ts +26 -0
- package/dist/chunks/agent-plan-QCUJWBP4.ts +99 -0
- package/dist/chunks/agent-plan-QCUJWBP4.ts.map +7 -0
- package/dist/chunks/agent-runner-E2JU2VZ6.ts +182 -0
- package/dist/chunks/agent-runner-E2JU2VZ6.ts.map +7 -0
- package/dist/chunks/agent-store-A3F6IYWZ.ts +152 -0
- package/dist/chunks/agent-store-A3F6IYWZ.ts.map +7 -0
- package/dist/chunks/chunk-5Q5SSKNG.ts +128 -0
- package/dist/chunks/chunk-5Q5SSKNG.ts.map +7 -0
- package/dist/chunks/chunk-5XZOC7FD.ts +215 -0
- package/dist/chunks/chunk-5XZOC7FD.ts.map +7 -0
- package/dist/chunks/{chunk-IJ6VV6FN.ts → chunk-AAEEHR7H.ts} +31 -87
- package/dist/chunks/chunk-AAEEHR7H.ts.map +7 -0
- package/dist/chunks/{chunk-CHSIAC4N.ts → chunk-B4QZBDBT.ts} +2 -2
- package/dist/chunks/{chunk-CL7BZRRQ.ts → chunk-CRKTAPSL.ts} +8 -8
- package/dist/chunks/chunk-DT7M4VQS.ts +69 -0
- package/dist/chunks/chunk-DT7M4VQS.ts.map +7 -0
- package/dist/chunks/chunk-ED3TYIVW.ts +229 -0
- package/dist/chunks/chunk-ED3TYIVW.ts.map +7 -0
- package/dist/chunks/{chunk-VHXBCEVF.ts → chunk-EUMINX7L.ts} +6 -6
- package/dist/chunks/chunk-FQOSHGJ7.ts +215 -0
- package/dist/chunks/chunk-FQOSHGJ7.ts.map +7 -0
- package/dist/chunks/chunk-GNH73BJ5.ts +153 -0
- package/dist/chunks/chunk-GNH73BJ5.ts.map +7 -0
- package/dist/chunks/{chunk-UQ3ALBIB.ts → chunk-GP5DU62N.ts} +8 -9
- package/dist/chunks/chunk-GP5DU62N.ts.map +7 -0
- package/dist/chunks/{chunk-5RZPINUQ.ts → chunk-GSNPASKB.ts} +2 -2
- package/dist/chunks/{chunk-QE7NZZWT.ts → chunk-IWZH5KYS.ts} +23 -7
- package/dist/chunks/chunk-IWZH5KYS.ts.map +7 -0
- package/dist/chunks/{chunk-5ZWQ33XL.ts → chunk-JJTARUSO.ts} +15 -14
- package/dist/chunks/chunk-JJTARUSO.ts.map +7 -0
- package/dist/chunks/{chunk-2DI6PDZV.ts → chunk-NLWS55B6.ts} +15 -2
- package/dist/chunks/chunk-NLWS55B6.ts.map +7 -0
- package/dist/chunks/{chunk-SDZCTCYQ.ts → chunk-OEWQVWLC.ts} +4 -4
- package/dist/chunks/{chunk-MYPSMJHJ.ts → chunk-OTZRCKYP.ts} +380 -510
- package/dist/chunks/chunk-OTZRCKYP.ts.map +7 -0
- package/dist/chunks/{chunk-WFKUKVCP.ts → chunk-OWBAZA6J.ts} +24 -12
- package/dist/chunks/chunk-OWBAZA6J.ts.map +7 -0
- package/dist/chunks/chunk-PRUEIIK7.ts +24 -0
- package/dist/chunks/chunk-PRUEIIK7.ts.map +7 -0
- package/dist/chunks/chunk-QGK445K7.ts +21 -0
- package/dist/chunks/chunk-QGK445K7.ts.map +7 -0
- package/dist/chunks/{chunk-3B4Z2SKV.ts → chunk-QO333NM4.ts} +49 -21
- package/dist/chunks/chunk-QO333NM4.ts.map +7 -0
- package/dist/chunks/{chunk-4SBTAVFL.ts → chunk-QSHMOL3I.ts} +22 -24
- package/dist/chunks/chunk-QSHMOL3I.ts.map +7 -0
- package/dist/chunks/chunk-S2FMH5FT.ts +97 -0
- package/dist/chunks/chunk-S2FMH5FT.ts.map +7 -0
- package/dist/chunks/{chunk-BVVP33U5.ts → chunk-SWRVXVFD.ts} +12 -9
- package/dist/chunks/chunk-SWRVXVFD.ts.map +7 -0
- package/dist/chunks/{chunk-ZX2Q6THB.ts → chunk-UBV24CG4.ts} +4 -5
- package/dist/chunks/chunk-UBV24CG4.ts.map +7 -0
- package/dist/chunks/chunk-UOHR7LRO.ts +70 -0
- package/dist/chunks/chunk-UOHR7LRO.ts.map +7 -0
- package/dist/chunks/{chunk-4QVPTIZB.ts → chunk-UPNVIUBN.ts} +3 -3
- package/dist/chunks/chunk-UZPMDLTL.ts +54 -0
- package/dist/chunks/chunk-UZPMDLTL.ts.map +7 -0
- package/dist/chunks/chunk-VJN7KU4J.ts +350 -0
- package/dist/chunks/chunk-VJN7KU4J.ts.map +7 -0
- package/dist/chunks/chunk-YHT4YTYG.ts +31 -0
- package/dist/chunks/chunk-YHT4YTYG.ts.map +7 -0
- package/dist/chunks/{chunk-V6VZ5TLG.ts → chunk-YK52VDXG.ts} +6 -5
- package/dist/chunks/chunk-YK52VDXG.ts.map +7 -0
- package/dist/chunks/config-KGIYTTXQ.ts +37 -0
- package/dist/chunks/{conflict-artifacts-BB2FZMIE.ts → conflict-artifacts-FXFIIBCB.ts} +8 -7
- package/dist/chunks/{conflict-review-4PLVLMRO.ts → conflict-review-6WIEQLXW.ts} +31 -24
- package/dist/chunks/{conflict-review-4PLVLMRO.ts.map → conflict-review-6WIEQLXW.ts.map} +1 -1
- package/dist/chunks/continuous-record-LFRVXQBD.ts +30 -0
- package/dist/chunks/continuous-sync-AWAAOXK2.ts +545 -0
- package/dist/chunks/continuous-sync-AWAAOXK2.ts.map +7 -0
- package/dist/chunks/{file-selection-WZX7HAY2.ts → file-selection-3JJYOVNR.ts} +5 -5
- package/dist/chunks/{git-backend-FD7AVSK6.ts → git-backend-KYDZ673X.ts} +28 -32
- package/dist/chunks/git-backend-KYDZ673X.ts.map +7 -0
- package/dist/chunks/{manager-result-dispatcher-6MQKFCWB.ts → manager-result-dispatcher-AGBBVDDS.ts} +10 -9
- package/dist/chunks/{manager-ui-IURS4WXY.ts → manager-ui-KRAW3NE2.ts} +464 -164
- package/dist/chunks/manager-ui-KRAW3NE2.ts.map +7 -0
- package/dist/chunks/{merge-baseline-store-EVQAAML6.ts → merge-baseline-store-RFCAH7KL.ts} +7 -5
- package/dist/chunks/{remote-selection-ui-6LJJ4IMQ.ts → remote-selection-ui-5725JDNC.ts} +9 -8
- package/dist/chunks/remote-selection-ui-5725JDNC.ts.map +7 -0
- package/dist/chunks/{s3-backend-AQGV6LFT.ts → s3-backend-Y7WSCLJI.ts} +38 -38
- package/dist/chunks/s3-backend-Y7WSCLJI.ts.map +7 -0
- package/dist/chunks/{setup-switch-KTUWL6DE.ts → setup-switch-E7PHKI6J.ts} +7 -6
- package/dist/chunks/setup-switch-E7PHKI6J.ts.map +7 -0
- package/dist/chunks/{setup-wizard-GSDPDFC4.ts → setup-wizard-65DROCIJ.ts} +14 -13
- package/dist/chunks/setup-wizard-65DROCIJ.ts.map +7 -0
- package/dist/chunks/{sync-inspection-K45QVLHB.ts → sync-inspection-XFJOAMJD.ts} +9 -8
- package/dist/chunks/sync-inspection-XFJOAMJD.ts.map +7 -0
- package/dist/chunks/{sync-operations-47OUX76C.ts → sync-operations-HDUDT5PD.ts} +188 -73
- package/dist/chunks/sync-operations-HDUDT5PD.ts.map +7 -0
- package/dist/chunks/{webdav-backend-TBILVEQK.ts → webdav-backend-6K26F6LT.ts} +39 -48
- package/dist/chunks/webdav-backend-6K26F6LT.ts.map +7 -0
- package/dist/index.ts +246 -131
- package/dist/index.ts.map +3 -3
- package/docs/agent-mode-verification.md +99 -0
- package/docs/continuous-sync-verification.md +87 -0
- package/docs/settings.md +131 -11
- package/docs/tui-contract.md +61 -0
- package/package.json +3 -2
- package/src/backends/git/git-backend.ts +1 -4
- package/src/backends/git/git-runner.ts +1 -5
- package/src/backends/s3/s3-backend.ts +3 -25
- package/src/backends/s3/s3-client.ts +14 -2
- package/src/backends/snapshot-pointer.ts +27 -0
- package/src/backends/webdav/webdav-backend.ts +3 -29
- package/src/backends/webdav/webdav-client.ts +11 -7
- package/src/commands/command-execution.ts +7 -3
- package/src/commands/command-handler.ts +15 -3
- package/src/commands/command-types.ts +10 -0
- package/src/commands/command.ts +4 -1
- package/src/settings/config.ts +20 -10
- package/src/settings/settings-store.ts +1 -34
- package/src/settings/settings-types.ts +10 -0
- package/src/settings/settings-validation.ts +4 -1
- package/src/snapshot/snapshot-codec.ts +1 -5
- package/src/state/lock.ts +13 -10
- package/src/state/merge-baseline-store.ts +19 -1
- package/src/state/state-directory.ts +8 -1
- package/src/sync/agent-candidate.ts +251 -0
- package/src/sync/agent-plan.ts +87 -0
- package/src/sync/agent-policy.ts +13 -0
- package/src/sync/agent-request.ts +17 -0
- package/src/sync/agent-runner.ts +188 -0
- package/src/sync/agent-store.ts +151 -0
- package/src/sync/agent-sync.ts +91 -0
- package/src/sync/apply-review.ts +63 -0
- package/src/sync/automatic-sync.ts +46 -33
- package/src/sync/continuous-errors.ts +85 -0
- package/src/sync/continuous-lease.ts +221 -0
- package/src/sync/continuous-record.ts +179 -0
- package/src/sync/continuous-storage.ts +55 -0
- package/src/sync/continuous-sync.ts +516 -0
- package/src/sync/continuous-watch.ts +59 -0
- package/src/sync/merged-sync.ts +268 -112
- package/src/sync/remote-snapshot.ts +2 -3
- package/src/sync/settings-merge.ts +19 -3
- package/src/sync/setup-switch.ts +1 -5
- package/src/sync/startup-check.ts +51 -29
- package/src/sync/startup-timings.ts +90 -0
- package/src/sync/sync-inspection.ts +16 -5
- package/src/sync/sync-mutations.ts +55 -28
- package/src/sync/sync-queries.ts +19 -3
- package/src/sync/text-merge.ts +3 -3
- package/src/sync-extension.ts +75 -19
- package/src/ui/agent-mode-setting.ts +91 -0
- package/src/ui/manager-state.ts +12 -6
- package/src/ui/manager-ui.ts +57 -7
- package/src/ui/merge-review.ts +3 -3
- package/src/ui/merged-sync-summary.ts +2 -18
- package/src/ui/remote-selection-ui.ts +5 -5
- package/src/ui/settings-frame.ts +55 -0
- package/src/ui/settings-ui.ts +223 -43
- package/src/ui/setup/s3-credentials-ui.ts +1 -5
- package/src/ui/setup/setup-name-ui.ts +2 -5
- package/src/ui/setup/setup-prompts.ts +4 -3
- package/src/ui/setup/setup-switcher.ts +2 -0
- package/src/ui/sync-behavior.ts +15 -0
- package/src/ui/sync-format.ts +69 -38
- package/src/ui/sync-setups-ui.ts +3 -5
- package/src/ui/transfer-changes.ts +33 -0
- package/src/ui/transfer-review.ts +27 -0
- package/dist/chunks/chunk-2DI6PDZV.ts.map +0 -7
- package/dist/chunks/chunk-3B4Z2SKV.ts.map +0 -7
- package/dist/chunks/chunk-4SBTAVFL.ts.map +0 -7
- package/dist/chunks/chunk-5ZWQ33XL.ts.map +0 -7
- package/dist/chunks/chunk-BVVP33U5.ts.map +0 -7
- package/dist/chunks/chunk-IJ6VV6FN.ts.map +0 -7
- package/dist/chunks/chunk-MYPSMJHJ.ts.map +0 -7
- package/dist/chunks/chunk-ORQRHEEO.ts +0 -362
- package/dist/chunks/chunk-ORQRHEEO.ts.map +0 -7
- package/dist/chunks/chunk-QE7NZZWT.ts.map +0 -7
- package/dist/chunks/chunk-UQ3ALBIB.ts.map +0 -7
- package/dist/chunks/chunk-V6VZ5TLG.ts.map +0 -7
- package/dist/chunks/chunk-WFKUKVCP.ts.map +0 -7
- package/dist/chunks/chunk-ZX2Q6THB.ts.map +0 -7
- package/dist/chunks/git-backend-FD7AVSK6.ts.map +0 -7
- package/dist/chunks/manager-ui-IURS4WXY.ts.map +0 -7
- package/dist/chunks/s3-backend-AQGV6LFT.ts.map +0 -7
- package/dist/chunks/setup-wizard-GSDPDFC4.ts.map +0 -7
- package/dist/chunks/sync-operations-47OUX76C.ts.map +0 -7
- package/dist/chunks/webdav-backend-TBILVEQK.ts.map +0 -7
- /package/dist/chunks/{conflict-artifacts-BB2FZMIE.ts.map → agent-candidate-3JN6DJKT.ts.map} +0 -0
- /package/dist/chunks/{chunk-CHSIAC4N.ts.map → chunk-B4QZBDBT.ts.map} +0 -0
- /package/dist/chunks/{chunk-CL7BZRRQ.ts.map → chunk-CRKTAPSL.ts.map} +0 -0
- /package/dist/chunks/{chunk-VHXBCEVF.ts.map → chunk-EUMINX7L.ts.map} +0 -0
- /package/dist/chunks/{chunk-5RZPINUQ.ts.map → chunk-GSNPASKB.ts.map} +0 -0
- /package/dist/chunks/{chunk-SDZCTCYQ.ts.map → chunk-OEWQVWLC.ts.map} +0 -0
- /package/dist/chunks/{chunk-4QVPTIZB.ts.map → chunk-UPNVIUBN.ts.map} +0 -0
- /package/dist/chunks/{manager-result-dispatcher-6MQKFCWB.ts.map → config-KGIYTTXQ.ts.map} +0 -0
- /package/dist/chunks/{merge-baseline-store-EVQAAML6.ts.map → conflict-artifacts-FXFIIBCB.ts.map} +0 -0
- /package/dist/chunks/{remote-selection-ui-6LJJ4IMQ.ts.map → continuous-record-LFRVXQBD.ts.map} +0 -0
- /package/dist/chunks/{file-selection-WZX7HAY2.ts.map → file-selection-3JJYOVNR.ts.map} +0 -0
- /package/dist/chunks/{setup-switch-KTUWL6DE.ts.map → manager-result-dispatcher-AGBBVDDS.ts.map} +0 -0
- /package/dist/chunks/{sync-inspection-K45QVLHB.ts.map → merge-baseline-store-RFCAH7KL.ts.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/sync/continuous-watch.ts", "../../src/sync/continuous-sync.ts"],
|
|
4
|
+
"sourcesContent": ["import { type FSWatcher, watch } from \"node:fs\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { getAgentDir } from \"@earendil-works/pi-coding-agent\";\nimport { isDeniedPath } from \"../paths.js\";\nimport type { AnySyncConfig } from \"../settings/settings-types.js\";\n\n/** Hints only. The scheduler's periodic snapshot scan remains required. */\nexport async function watchContinuous(\n config: AnySyncConfig,\n changed: (settings: boolean) => void,\n): Promise<() => void> {\n const root = getAgentDir();\n const watchers: FSWatcher[] = [];\n const selected = config.include.map((item) => path.resolve(root, item));\n const relevant = (target: string) =>\n selected.some(\n (item) => target === item || target.startsWith(`${item}${path.sep}`) || item.startsWith(`${target}${path.sep}`),\n );\n const add = (directory: string, recursive: boolean) => {\n try {\n const watcher = watch(directory, { recursive, persistent: false }, (_event, file) => {\n // Unknown names can be our own private writes. Periodic scans cover them.\n if (!file) return;\n const target = path.resolve(directory, String(file));\n if (target === path.join(root, \"pi-sync.json\")) changed(true);\n else if (isDeniedPath(path.relative(root, target))) return;\n else if (relevant(target)) changed(false);\n });\n watcher.on(\"error\", () => watcher.close());\n watchers.push(watcher);\n } catch {\n /* Periodic scans cover unavailable or unsupported watchers. */\n }\n };\n add(root, false);\n const directories = new Set<string>();\n try {\n for (const target of selected) {\n try {\n const stat = await fs.lstat(target);\n if (stat.isSymbolicLink()) continue;\n const directory = stat.isDirectory() ? target : path.dirname(target);\n if (directory === root || directories.has(directory)) continue;\n directories.add(directory);\n add(directory, stat.isDirectory());\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") continue;\n // Missing targets are found by the parent hint or the next periodic scan.\n }\n }\n return () => {\n for (const watcher of watchers) watcher.close();\n };\n } catch (error) {\n for (const watcher of watchers) watcher.close();\n throw error;\n }\n}\n", "import type { ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport { loadConfigForCheck, syncCheckConfigFingerprint } from \"../settings/config.js\";\nimport type { AnySyncConfig } from \"../settings/settings-types.js\";\nimport { snapshotOptionsForContext } from \"../snapshot/session-paths.js\";\nimport { withLock } from \"../state/lock.js\";\nimport { withStateDirectoryAccess } from \"../state/state-directory.js\";\nimport { readStateForConfig } from \"../state/sync-state-store.js\";\nimport { setSyncStatus } from \"../ui/sync-status.js\";\nimport { withAgentSyncLock } from \"./agent-sync.js\";\nimport { ContinuousError, continuousFailure } from \"./continuous-errors.js\";\nimport { acquireContinuousLease, type ContinuousLease } from \"./continuous-lease.js\";\nimport {\n normalizeContinuousClock,\n readContinuousRecord,\n reserveContinuousRequest,\n updateContinuousRecord,\n} from \"./continuous-record.js\";\nimport { continuousBinding, hashContinuous } from \"./continuous-storage.js\";\nimport { watchContinuous } from \"./continuous-watch.js\";\nimport { readMergeJournal } from \"./merge-journal.js\";\nimport type { SyncLoaders } from \"./sync-loaders.js\";\nimport { captureMutationOwner } from \"./sync-local.js\";\nimport { fileHashMap } from \"./sync-state.js\";\n\nexport function continuousEnabled(config: Pick<AnySyncConfig, \"continuous\" | \"agentMode\">) {\n return Boolean(config.continuous && config.agentMode);\n}\nexport interface ContinuousClock {\n now(): number;\n random(): number;\n schedule(ms: number, run: () => void, kind?: \"wait\" | \"authorization\"): () => void;\n}\nconst systemClock: ContinuousClock = {\n now: () => Date.now(),\n random: () => Math.random(),\n schedule: (ms, run) => {\n const timer = setTimeout(run, ms);\n timer.unref?.();\n return () => clearTimeout(timer);\n },\n};\nconst LOCAL_CHECK_MS = 5_000;\nconst POLL_MS = 60_000;\nconst DEBOUNCE_MS = 1_000;\n\n/** Created on first enabled session. No module/factory-owned timers or watchers. */\nexport function createContinuousSync(loaders: SyncLoaders, clock: ContinuousClock = systemClock) {\n const repairNotices = new WeakSet<ExtensionContext[\"sessionManager\"]>();\n let task:\n | { owner: ExtensionContext[\"sessionManager\"]; controller: AbortController; promise: Promise<void>; clear(): void }\n | undefined;\n return {\n start(ctx: ExtensionContext, sessionSignal: AbortSignal, explicitRetry = false) {\n if (!ctx.hasUI || (ctx.mode !== \"tui\" && ctx.mode !== \"rpc\") || sessionSignal.aborted || task) return;\n const controller = new AbortController();\n const signal = AbortSignal.any([sessionSignal, controller.signal]);\n const validateContext = captureMutationOwner(ctx);\n const current = {\n owner: ctx.sessionManager,\n controller,\n promise: Promise.resolve(),\n clear: () => {\n try {\n validateContext();\n setSyncStatus(ctx, undefined);\n } catch {\n /* replaced session */\n }\n },\n };\n task = current;\n current.promise = (async () => {\n let explicit = explicitRetry;\n while (!signal.aborted) {\n try {\n await run(ctx, signal, explicit);\n return;\n } catch {\n if (signal.aborted) return;\n try {\n validateContext();\n setSyncStatus(ctx, \"sync blocked: private state or settings need repair\");\n if (!repairNotices.has(ctx.sessionManager)) {\n repairNotices.add(ctx.sessionManager);\n ctx.ui.notify(\n \"Continuous sync blocked: private state or settings need repair. Use /sync. Evidence was retained.\",\n \"warning\",\n );\n }\n } catch {\n return;\n }\n }\n explicit = false;\n // Only local prerequisites are retried here. No remote/model request can\n // pass a malformed settings/state read. A repair can resume monitoring.\n await wait(clock, LOCAL_CHECK_MS, signal);\n }\n })()\n .catch(() => {\n /* Cancellation/UI disposal must not leak a detached rejection. */\n })\n .finally(() => {\n if (task === current) task = undefined;\n });\n },\n async stop(owner?: ExtensionContext[\"sessionManager\"]) {\n const current = task;\n if (!current || (owner && current.owner !== owner)) return;\n current.controller.abort(new DOMException(\"Continuous sync interrupted\", \"AbortError\"));\n current.clear();\n await current.promise;\n },\n };\n\n async function run(ctx: ExtensionContext, signal: AbortSignal, explicitRetry: boolean) {\n const validateOwner = captureMutationOwner(ctx, signal);\n try {\n while (!signal.aborted) {\n validateOwner();\n const config = await loadConfigForCheck();\n validateOwner();\n if (!continuousEnabled(config)) return;\n try {\n if (ctx.isIdle()) {\n let lease: ContinuousLease | undefined;\n let binding = \"\";\n try {\n await withStateDirectoryAccess(async () => {\n validateOwner();\n binding = await continuousBinding(config);\n validateOwner();\n lease = await acquireContinuousLease(binding);\n validateOwner();\n });\n if (lease) {\n await monitor(ctx, config, binding, lease, signal, explicitRetry);\n explicitRetry = false;\n } else setSyncStatus(ctx, \"sync waiting: another local owner\");\n } finally {\n await lease?.release();\n }\n }\n } catch (error) {\n if (signal.aborted) return;\n const failure = continuousFailure(error);\n if (!failure.retry && !(error instanceof Error && error.name === \"AbortError\")) throw error;\n setSyncStatus(ctx, `sync retry scheduled: ${failure.kind}`);\n }\n validateOwner();\n if (!continuousEnabled(await loadConfigForCheck())) return;\n validateOwner();\n await wait(clock, LOCAL_CHECK_MS, signal);\n }\n } finally {\n // Shutdown/replacement owns clearing the old UI; do not call it from a stale continuation.\n if (!signal.aborted) {\n try {\n validateOwner();\n setSyncStatus(ctx, undefined);\n } catch {\n /* stale context */\n }\n }\n }\n }\n\n async function monitor(\n ctx: ExtensionContext,\n initial: AnySyncConfig,\n binding: string,\n lease: ContinuousLease,\n parent: AbortSignal,\n explicitRetry: boolean,\n ) {\n const signal = AbortSignal.any([parent, lease.signal]);\n const validateOwner = captureMutationOwner(ctx, signal);\n let config = initial;\n let closeWatch = () => {};\n let wake = () => {};\n let dirtyAt: number | undefined;\n let cycle: AbortController | undefined;\n const changed = (settings: boolean) => {\n dirtyAt = clock.now();\n if (settings) cycle?.abort(new DOMException(\"Continuous settings changed\", \"AbortError\"));\n wake();\n };\n const validate = () => {\n validateOwner();\n lease.assert();\n if (!ctx.isIdle()) throw new DOMException(\"Owning session became busy\", \"AbortError\");\n };\n const stopWatch = () => {\n closeWatch();\n wake();\n };\n signal.addEventListener(\"abort\", stopWatch, { once: true });\n let pollDue = 0;\n try {\n closeWatch = await watchContinuous(config, changed);\n validate();\n while (!signal.aborted && ctx.isIdle()) {\n validate();\n const latest = await loadConfigForCheck();\n validate();\n if (!continuousEnabled(latest) || (await continuousBinding(latest)) !== binding) return;\n validate();\n if (syncCheckConfigFingerprint(latest) !== syncCheckConfigFingerprint(config)) {\n closeWatch();\n config = latest;\n closeWatch = await watchContinuous(config, changed);\n validate();\n pollDue = 0;\n }\n const record = await readContinuousRecord(binding);\n validate();\n const now = clock.now();\n const oldClock = JSON.stringify([record.next, record.calls]);\n normalizeContinuousClock(record, now);\n if (oldClock !== JSON.stringify([record.next, record.calls])) {\n await updateContinuousRecord(binding, lease, (current) => normalizeContinuousClock(current, now));\n validate();\n }\n const configuration = hashContinuous([{ ...config, showStatus: undefined, debug: undefined }, ctx.model]);\n const controlChanged = record.configuration !== configuration;\n if (controlChanged || explicitRetry) {\n record.next = 0;\n pollDue = 0;\n }\n const hintDue = dirtyAt === undefined ? Number.POSITIVE_INFINITY : dirtyAt + DEBOUNCE_MS;\n const due = Math.max(record.error === \"budget\" ? 0 : record.next, Math.min(pollDue, hintDue));\n if (now >= due) {\n const force = explicitRetry || controlChanged;\n explicitRetry = false;\n const expectedModel = hashContinuous(ctx.model);\n const expectedConfig = syncCheckConfigFingerprint(config);\n dirtyAt = undefined;\n cycle = new AbortController();\n const cancelDeadline = clock.schedule(30_000, () =>\n cycle?.abort(new DOMException(\"Continuous cycle timed out\", \"TimeoutError\")),\n );\n const guard = new AbortController();\n const guardSignal = AbortSignal.any([signal, cycle.signal, guard.signal]);\n const activeCycle = cycle;\n // Transfer entrypoints supply each fresh settings read. Never let a new\n // transfer adopt authorization that changed after this cycle's inspection.\n const validateCycle = (latest?: AnySyncConfig) => {\n validate();\n if (\n (latest && syncCheckConfigFingerprint(latest) !== expectedConfig) ||\n hashContinuous(ctx.model) !== expectedModel\n )\n activeCycle.abort(new DOMException(\"Continuous authorization changed\", \"AbortError\"));\n activeCycle.signal.throwIfAborted();\n };\n const guardTask = (async () => {\n while (!guardSignal.aborted) {\n await wait(clock, LOCAL_CHECK_MS, guardSignal, undefined, \"authorization\");\n if (guardSignal.aborted) return;\n try {\n validate();\n const latest = await loadConfigForCheck();\n if (guardSignal.aborted) return;\n validateCycle(latest);\n } catch {\n activeCycle.abort(new DOMException(\"Continuous authorization unavailable\", \"AbortError\"));\n }\n }\n })().catch(() => {});\n try {\n await performCycle(\n ctx,\n config,\n binding,\n lease,\n AbortSignal.any([signal, cycle.signal]),\n validateCycle,\n configuration,\n force,\n );\n } catch (error) {\n if (signal.aborted || !ctx.isIdle()) return;\n // A settings hint interrupts the old authorization; load it afresh, not as a failed transfer.\n if (cycle.signal.aborted && cycle.signal.reason?.name !== \"TimeoutError\") {\n pollDue = 0;\n continue;\n }\n const failure = continuousFailure(error);\n let announce = false;\n await updateContinuousRecord(binding, lease, (current) => {\n const now = clock.now();\n normalizeContinuousClock(current, now);\n const notice = hashContinuous([failure.kind, current.evidence, configuration]);\n announce = current.notice !== notice;\n if (!failure.retry) current.notice = notice;\n current.configuration = configuration;\n current.pending = true;\n current.error = failure.kind;\n current.phase = failure.retry ? \"retry\" : \"blocked\";\n current.failures = Math.min(30, current.failures + 1);\n const base = Math.min(300_000, 5_000 * 2 ** Math.min(6, current.failures - 1));\n const delay = Math.min(300_000, base + Math.floor(clock.random() * base * 0.2));\n current.next = now + Math.max(delay, failure.delay ?? 0);\n });\n validate();\n if (announce && !failure.retry)\n ctx.ui.notify(\n `Continuous sync blocked (${failure.kind}). Review /sync or repair the setup. Evidence was retained.`,\n \"warning\",\n );\n } finally {\n cancelDeadline();\n guard.abort();\n await guardTask;\n cycle = undefined;\n }\n pollDue = clock.now() + POLL_MS + Math.floor(clock.random() * 6_000);\n closeWatch();\n closeWatch = () => {};\n closeWatch = await watchContinuous(config, changed);\n validate();\n }\n validate();\n const state = await readContinuousRecord(binding);\n validate();\n setSyncStatus(\n ctx,\n state.phase === \"blocked\"\n ? `sync blocked: ${state.error}`\n : state.phase === \"retry\"\n ? `sync retry scheduled: ${state.error}`\n : \"sync waiting for changes\",\n );\n if (state.phase === \"retry\") pollDue = Math.min(pollDue, state.next);\n const next = Math.max(\n state.error === \"budget\" ? 0 : state.next,\n Math.min(pollDue, dirtyAt === undefined ? Number.POSITIVE_INFINITY : dirtyAt + DEBOUNCE_MS),\n );\n await wait(clock, Math.max(1, Math.min(LOCAL_CHECK_MS, next - clock.now())), signal, (callback) => {\n wake = callback;\n });\n }\n } finally {\n signal.removeEventListener(\"abort\", stopWatch);\n closeWatch();\n cycle?.abort();\n }\n }\n\n async function performCycle(\n ctx: ExtensionContext,\n config: AnySyncConfig,\n binding: string,\n lease: ContinuousLease,\n signal: AbortSignal,\n validateOwner: (config?: AnySyncConfig) => void,\n configuration: string,\n force: boolean,\n ) {\n const validate = (latest?: AnySyncConfig) => {\n signal.throwIfAborted();\n validateOwner(latest);\n };\n validate();\n const current = await readContinuousRecord(binding);\n validate();\n // A newly pending journal may prove an uncertain commit. It is never authority to republish.\n const pending = await guardedLock(\"continuous-journal\", () => readMergeJournal(config));\n validate();\n if (\n !force &&\n !pending &&\n current.phase === \"blocked\" &&\n [\"authentication\", \"storage\", \"unknown\"].includes(current.error ?? \"\")\n )\n return;\n setSyncStatus(ctx, \"sync checking\");\n const inspectionModule = await loaders.inspection();\n validate();\n const observed = await guardedLock(\"continuous-check\", async () => {\n validate();\n const inspection = await inspectionModule.inspectSync(config, snapshotOptionsForContext(ctx, config), signal);\n validate();\n let localIdentity = inspection.localIdentity;\n if (!localIdentity) {\n const snapshotModule = await loaders.snapshot();\n validate();\n const local = await snapshotModule.createSnapshot(config.snapshotIdentity, {\n ...snapshotOptionsForContext(ctx, config),\n signal,\n });\n validate();\n localIdentity = hashContinuous(fileHashMap(local));\n }\n const journal = await readMergeJournal(config);\n validate();\n return { inspection, journal, localIdentity };\n });\n validate();\n const evidence = hashContinuous([\n configuration,\n observed.localIdentity,\n observed.inspection.head?.revision,\n observed.inspection.stateIdentity,\n ]);\n const recovery = observed.journal ? hashContinuous([evidence, observed.journal]) : undefined;\n const blocked =\n !force &&\n current.evidence === evidence &&\n ((current.phase === \"blocked\" && (!recovery || recovery === current.recovery)) ||\n (current.error === \"budget\" && current.next > clock.now() && !observed.journal));\n await updateContinuousRecord(binding, lease, (record) => {\n if (record.configuration !== configuration) {\n record.failures = 0;\n record.next = 0;\n }\n record.configuration = configuration;\n record.checked = clock.now();\n record.evidence = evidence;\n if (!blocked) {\n if (record.phase !== \"blocked\") record.phase = \"syncing\";\n record.pending = true;\n if (recovery) record.recovery = recovery;\n }\n });\n validate();\n if (blocked) return;\n if (\n !observed.journal &&\n (observed.inspection.firstSync ||\n !observed.inspection.head ||\n observed.inspection.selectionState?.kind !== \"same\")\n )\n throw new ContinuousError(\"unsafe\", \"Continuous sync needs an accepted baseline and matching remote selection.\");\n let transferred = false;\n if (observed.journal || observed.inspection.localChanged || observed.inspection.remoteChanged) {\n const operations = await loaders.operations();\n validate();\n setSyncStatus(ctx, \"sync syncing\");\n const result = await withStateDirectoryAccess(() =>\n withAgentSyncLock(\n ctx,\n {\n args: [],\n yes: true,\n force: false,\n stale: false,\n silent: true,\n reload: false,\n auto: true,\n signal,\n background: {\n validate,\n reserve: (key) => reserveContinuousRequest(binding, lease, key, () => clock.now()),\n },\n },\n (options) => operations.syncBoth(ctx, options),\n ),\n );\n validate();\n transferred = result === \"applied\";\n }\n const state = await guardedLock(\"continuous-result\", () => readStateForConfig(config));\n validate();\n const unresolved = state.unresolved;\n let announcePartial = false;\n await updateContinuousRecord(binding, lease, (record) => {\n record.phase = unresolved?.length ? \"blocked\" : \"waiting\";\n record.pending = Boolean(unresolved?.length);\n record.failures = 0;\n record.next = 0;\n if (unresolved?.length) {\n record.error = \"unsafe\";\n const notice = hashContinuous([\"partial\", unresolved, configuration]);\n announcePartial = record.notice !== notice;\n record.notice = notice;\n } else {\n delete record.error;\n delete record.notice;\n }\n if (transferred) record.transferred = clock.now();\n });\n validate();\n if (announcePartial)\n ctx.ui.notify(\n \"Continuous sync retained unresolved groups. Review /sync conflicts; independent partial progress was preserved.\",\n \"warning\",\n );\n }\n}\n\nfunction guardedLock<T>(command: string, run: () => Promise<T>) {\n return withStateDirectoryAccess(() => withLock(command, run));\n}\n\nfunction wait(\n clock: ContinuousClock,\n ms: number,\n signal: AbortSignal,\n expose?: (wake: () => void) => void,\n kind: \"wait\" | \"authorization\" = \"wait\",\n) {\n signal.throwIfAborted();\n return new Promise<void>((resolve) => {\n const done = () => {\n cancel();\n signal.removeEventListener(\"abort\", done);\n expose?.(() => {});\n resolve();\n };\n const cancel = clock.schedule(ms, done, kind);\n signal.addEventListener(\"abort\", done, { once: true });\n expose?.(done);\n if (signal.aborted) done();\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAyB,aAAa;AACtC,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,mBAAmB;AAK5B,eAAsB,gBACpB,QACA,SACqB;AACrB,QAAM,OAAO,YAAY;AACzB,QAAM,WAAwB,CAAC;AAC/B,QAAM,WAAW,OAAO,QAAQ,IAAI,CAAC,SAAS,KAAK,QA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,GAAG,CAAC;AAC9D;AAEA,SAAS,KACP,OACA,IACA,QACA,QACA,OAAiC,QACjC;AACA,SAAO,eAAe;AACtB,SAAO,IAAI,QAAc,CAAC,YAAY;AACpC,UAAM,OAAO,MAAM;AACjB,aAAO;AACP,aAAO,oBAAoB,SAAS,IAAI;AACxC,eAAS,MAAM;AAAA,MAAC,CAAC;AACjB,cAAQ;AAAA,IACV;AACA,UAAM,SAAS,MAAM,SAAS,IAAI,MAAM,IAAI;AAC5C,WAAO,iBAAiB,SAAS,MAAM,EAAE,MAAM,KAAK,CAAC;AACrD,aAAS,IAAI;AACb,QAAI,OAAO,QAAS,MAAK;AAAA,EAC3B,CAAC;AACH;",
|
|
6
|
+
"names": ["latest", "now"]
|
|
7
|
+
}
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
3
|
import {
|
|
4
4
|
updateSyncSetup
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-B4QZBDBT.ts";
|
|
6
6
|
import {
|
|
7
7
|
loadConfig,
|
|
8
8
|
localConfigPath
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-2JZFHNLM.ts";
|
|
11
|
-
import "./chunk-T2SJD3N7.ts";
|
|
9
|
+
} from "./chunk-QO333NM4.ts";
|
|
12
10
|
import "./chunk-A6HU4ERM.ts";
|
|
13
11
|
import {
|
|
14
12
|
BUILT_IN_SYNC_ROOTS,
|
|
@@ -18,6 +16,8 @@ import {
|
|
|
18
16
|
syncIncludeSelection
|
|
19
17
|
} from "./chunk-QOFMXPM5.ts";
|
|
20
18
|
import "./chunk-ZW5ZLGBI.ts";
|
|
19
|
+
import "./chunk-2JZFHNLM.ts";
|
|
20
|
+
import "./chunk-T2SJD3N7.ts";
|
|
21
21
|
import "./chunk-HUZ5CR4W.ts";
|
|
22
22
|
|
|
23
23
|
// src/ui/file-selection.ts
|
|
@@ -279,4 +279,4 @@ function safeTerminalText(value) {
|
|
|
279
279
|
export {
|
|
280
280
|
showFileSelection
|
|
281
281
|
};
|
|
282
|
-
//# sourceMappingURL=file-selection-
|
|
282
|
+
//# sourceMappingURL=file-selection-3JJYOVNR.ts.map
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
// @generated by scripts/build-runtime.mjs; do not edit.
|
|
2
2
|
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
|
-
import {
|
|
4
|
-
stateDir
|
|
5
|
-
} from "./chunk-BVVP33U5.ts";
|
|
6
|
-
import {
|
|
7
|
-
normalizeGitBranch,
|
|
8
|
-
normalizeGitDirectory,
|
|
9
|
-
normalizeGitRemote,
|
|
10
|
-
normalizeGitRemoteIdentity,
|
|
11
|
-
validateGitNamespace
|
|
12
|
-
} from "./chunk-T2SJD3N7.ts";
|
|
13
|
-
import {
|
|
14
|
-
SyncBackendConflictError,
|
|
15
|
-
SyncBackendPublicationOutcomeUnknownError
|
|
16
|
-
} from "./chunk-YDVQYUHE.ts";
|
|
17
3
|
import {
|
|
18
4
|
syncErrorGuidance
|
|
19
5
|
} from "./chunk-G4RUXRWZ.ts";
|
|
@@ -23,11 +9,28 @@ import {
|
|
|
23
9
|
validatePortableSnapshot,
|
|
24
10
|
validateSnapshotFieldPolicy
|
|
25
11
|
} from "./chunk-A6HU4ERM.ts";
|
|
12
|
+
import {
|
|
13
|
+
throwIfAborted
|
|
14
|
+
} from "./chunk-PWMWOJP4.ts";
|
|
15
|
+
import {
|
|
16
|
+
SyncBackendConflictError,
|
|
17
|
+
SyncBackendPublicationOutcomeUnknownError
|
|
18
|
+
} from "./chunk-YDVQYUHE.ts";
|
|
26
19
|
import {
|
|
27
20
|
portableSnapshotSelection,
|
|
28
21
|
snapshotSelectionInclude
|
|
29
22
|
} from "./chunk-QOFMXPM5.ts";
|
|
30
23
|
import "./chunk-ZW5ZLGBI.ts";
|
|
24
|
+
import {
|
|
25
|
+
stateDir
|
|
26
|
+
} from "./chunk-SWRVXVFD.ts";
|
|
27
|
+
import {
|
|
28
|
+
normalizeGitBranch,
|
|
29
|
+
normalizeGitDirectory,
|
|
30
|
+
normalizeGitRemote,
|
|
31
|
+
normalizeGitRemoteIdentity,
|
|
32
|
+
validateGitNamespace
|
|
33
|
+
} from "./chunk-T2SJD3N7.ts";
|
|
31
34
|
import {
|
|
32
35
|
posixJoin
|
|
33
36
|
} from "./chunk-HUZ5CR4W.ts";
|
|
@@ -257,10 +260,6 @@ async function readGitBlobs(objects, options) {
|
|
|
257
260
|
});
|
|
258
261
|
return parseGitBlobBatch(result.stdout, objects.length, options.maxOutputBytes);
|
|
259
262
|
}
|
|
260
|
-
function throwIfAborted(signal) {
|
|
261
|
-
if (!signal?.aborted) return;
|
|
262
|
-
throw signal.reason instanceof Error ? signal.reason : new DOMException("The operation was aborted", "AbortError");
|
|
263
|
-
}
|
|
264
263
|
|
|
265
264
|
// src/backends/git/git-storage.ts
|
|
266
265
|
import { createHash } from "node:crypto";
|
|
@@ -497,7 +496,7 @@ var GitSyncBackend = class {
|
|
|
497
496
|
}
|
|
498
497
|
throw this.redactedError(error);
|
|
499
498
|
}
|
|
500
|
-
|
|
499
|
+
throwIfAborted(signal);
|
|
501
500
|
const files = manifest.files.map((file, index) => {
|
|
502
501
|
const content = blobs[index];
|
|
503
502
|
if (!content || content.byteLength !== file.size || sha2562(content) !== file.sha256) {
|
|
@@ -520,7 +519,7 @@ var GitSyncBackend = class {
|
|
|
520
519
|
return snapshot;
|
|
521
520
|
}
|
|
522
521
|
async publishSnapshot(snapshot, expected, options = {}) {
|
|
523
|
-
|
|
522
|
+
throwIfAborted(options.signal);
|
|
524
523
|
const files = prepareGitSnapshot(snapshot, this.config.destination.namespace);
|
|
525
524
|
const observed = await this.fetchRemoteHead(options.signal);
|
|
526
525
|
if (!matchesExpected(observed, expected, this.identity)) {
|
|
@@ -529,7 +528,7 @@ var GitSyncBackend = class {
|
|
|
529
528
|
{ currentHead: observed ? await this.headForSha(observed, options.signal) : void 0 }
|
|
530
529
|
);
|
|
531
530
|
}
|
|
532
|
-
|
|
531
|
+
throwIfAborted(options.signal);
|
|
533
532
|
const manifest = {
|
|
534
533
|
version: GIT_MANIFEST_VERSION,
|
|
535
534
|
snapshotVersion: snapshot.version,
|
|
@@ -553,7 +552,7 @@ var GitSyncBackend = class {
|
|
|
553
552
|
} catch (error) {
|
|
554
553
|
throw this.redactedError(error);
|
|
555
554
|
}
|
|
556
|
-
|
|
555
|
+
throwIfAborted(options.signal);
|
|
557
556
|
options.onCommit?.();
|
|
558
557
|
const ref = this.remoteRef();
|
|
559
558
|
const lease = `--force-with-lease=${ref}:${observed ?? ""}`;
|
|
@@ -753,14 +752,14 @@ var GitSyncBackend = class {
|
|
|
753
752
|
(left, right) => left.sha256.localeCompare(right.sha256)
|
|
754
753
|
);
|
|
755
754
|
for (const file of uniqueFiles) {
|
|
756
|
-
|
|
755
|
+
throwIfAborted(signal);
|
|
757
756
|
await fs.writeFile(path.join(payloadDirectory, file.sha256), file.content, {
|
|
758
757
|
flag: "wx",
|
|
759
758
|
mode: 384
|
|
760
759
|
});
|
|
761
760
|
}
|
|
762
761
|
await this.afterPayloadWriteForTest?.();
|
|
763
|
-
|
|
762
|
+
throwIfAborted(signal);
|
|
764
763
|
const hashed = await this.git(["hash-object", "-w", "--no-filters", "--stdin-paths"], {
|
|
765
764
|
cwd: payloadDirectory,
|
|
766
765
|
input: uniqueFiles.map((file) => file.sha256).join("\n") + (uniqueFiles.length ? "\n" : ""),
|
|
@@ -849,14 +848,14 @@ var GitSyncBackend = class {
|
|
|
849
848
|
try {
|
|
850
849
|
recreate = !await this.cacheUsesSha1(signal);
|
|
851
850
|
} catch {
|
|
852
|
-
|
|
851
|
+
throwIfAborted(signal);
|
|
853
852
|
recreate = true;
|
|
854
853
|
}
|
|
855
854
|
}
|
|
856
855
|
} catch (error) {
|
|
857
856
|
if (error.code !== "ENOENT") throw error;
|
|
858
857
|
}
|
|
859
|
-
|
|
858
|
+
throwIfAborted(signal);
|
|
860
859
|
if (recreate) await fs.rm(this.cacheDir, { recursive: true, force: true });
|
|
861
860
|
try {
|
|
862
861
|
await fs.access(this.cacheDir);
|
|
@@ -1020,7 +1019,7 @@ async function withGitCacheMutation(cacheDir, run, signal) {
|
|
|
1020
1019
|
const previous = gitCacheMutationQueues.get(cacheDir) ?? Promise.resolve();
|
|
1021
1020
|
let started = false;
|
|
1022
1021
|
const operation = previous.catch(() => void 0).then(() => {
|
|
1023
|
-
|
|
1022
|
+
throwIfAborted(signal);
|
|
1024
1023
|
started = true;
|
|
1025
1024
|
return run();
|
|
1026
1025
|
});
|
|
@@ -1033,7 +1032,7 @@ async function withGitCacheMutation(cacheDir, run, signal) {
|
|
|
1033
1032
|
if (gitCacheMutationQueues.get(cacheDir) === tail) gitCacheMutationQueues.delete(cacheDir);
|
|
1034
1033
|
});
|
|
1035
1034
|
if (!signal) return operation;
|
|
1036
|
-
|
|
1035
|
+
throwIfAborted(signal);
|
|
1037
1036
|
let rejectAbort;
|
|
1038
1037
|
const aborted = new Promise((_resolve, reject) => {
|
|
1039
1038
|
rejectAbort = reject;
|
|
@@ -1067,12 +1066,9 @@ function sha2562(value) {
|
|
|
1067
1066
|
function abortReason(signal) {
|
|
1068
1067
|
return signal.reason instanceof Error ? signal.reason : new DOMException("The operation was aborted", "AbortError");
|
|
1069
1068
|
}
|
|
1070
|
-
function throwIfAborted2(signal) {
|
|
1071
|
-
if (signal?.aborted) throw abortReason(signal);
|
|
1072
|
-
}
|
|
1073
1069
|
export {
|
|
1074
1070
|
GitSyncBackend,
|
|
1075
1071
|
gitBackendIdentity,
|
|
1076
1072
|
isSupportedGitVersion
|
|
1077
1073
|
};
|
|
1078
|
-
//# sourceMappingURL=git-backend-
|
|
1074
|
+
//# sourceMappingURL=git-backend-KYDZ673X.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/backends/git/git-backend.ts", "../../src/backends/git/git-runner.ts", "../../src/backends/git/git-storage.ts"],
|
|
4
|
+
"sourcesContent": ["import { createHash, randomUUID } from \"node:crypto\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { posixJoin } from \"../../paths.js\";\nimport type { Snapshot, SnapshotFile } from \"../../snapshot/snapshot-types.js\";\nimport { stateDir } from \"../../state/state-directory.js\";\nimport { throwIfAborted } from \"../../sync/signals.js\";\nimport { syncErrorGuidance } from \"../../sync/sync-error-guidance.js\";\nimport type { ResolvedGitBackend } from \"../backend-types.js\";\nimport {\n type BackendDiagnostic,\n type ExpectedRemoteHead,\n type PublishSnapshotOptions,\n type PublishSnapshotResult,\n type RemoteHead,\n type RemoteHistoryEntry,\n type SyncBackend,\n SyncBackendConflictError,\n SyncBackendPublicationOutcomeUnknownError,\n} from \"../sync-backend.js\";\nimport {\n normalizeGitBranch,\n normalizeGitDirectory,\n normalizeGitRemote,\n normalizeGitRemoteIdentity,\n validateGitNamespace,\n} from \"./git-config.js\";\nimport { GitCommandError, readGitBlobs, runGit } from \"./git-runner.js\";\nimport {\n GIT_MANIFEST_VERSION,\n type GitManifest,\n MAX_GIT_MANIFEST_BYTES,\n MAX_GIT_TREE_OUTPUT_BYTES,\n type PreparedGitFile,\n parseGitTree,\n prepareGitSnapshot,\n requireGitManifest,\n validateGitPublicationTree,\n validateGitSnapshot,\n} from \"./git-storage.js\";\n\nconst COMMAND_TIMEOUT_MS = 30_000;\nconst POST_COMMIT_TIMEOUT_MS = 45_000;\nconst gitCacheMutationQueues = new Map<string, Promise<void>>();\n\nexport interface GitBackendOptions {\n cacheRoot?: string;\n allowLocalRemotes?: boolean;\n commandTimeoutMs?: number;\n postCommitTimeoutMs?: number;\n /** Deterministic fault injection used only by the local backend test suite. */\n afterPushForTest?: () => void | Promise<void>;\n afterLsRemoteForTest?: () => void | Promise<void>;\n afterPayloadWriteForTest?: () => void | Promise<void>;\n}\n\nexport class GitSyncBackend implements SyncBackend {\n readonly identity: string;\n readonly destination: string;\n readonly capability = \"lease-protected\" as const;\n private readonly cacheRoot: string;\n private readonly cacheDir: string;\n private readonly allowLocalRemotes: boolean;\n private readonly commandTimeoutMs: number;\n private readonly postCommitTimeoutMs: number;\n private readonly afterPushForTest?: () => void | Promise<void>;\n private readonly afterLsRemoteForTest?: () => void | Promise<void>;\n private readonly afterPayloadWriteForTest?: () => void | Promise<void>;\n private cacheReady?: Promise<void>;\n\n constructor(\n private readonly config: ResolvedGitBackend,\n options: GitBackendOptions = {},\n ) {\n assertGitDestination(config);\n this.allowLocalRemotes = options.allowLocalRemotes === true;\n if (!this.allowLocalRemotes) assertProductionRemote(config.profile.remote);\n this.identity = gitBackendIdentity(config);\n this.destination = gitDestination(config);\n this.cacheRoot = path.resolve(options.cacheRoot ?? path.join(stateDir(), \"git\"));\n this.cacheDir = path.join(this.cacheRoot, this.identity.slice(\"git:\".length), \"repository.git\");\n this.commandTimeoutMs = options.commandTimeoutMs ?? COMMAND_TIMEOUT_MS;\n this.postCommitTimeoutMs = options.postCommitTimeoutMs ?? POST_COMMIT_TIMEOUT_MS;\n this.afterPushForTest = options.afterPushForTest;\n this.afterLsRemoteForTest = options.afterLsRemoteForTest;\n this.afterPayloadWriteForTest = options.afterPayloadWriteForTest;\n }\n\n sameRevision(left: string, right: string) {\n return decodeRevision(left, this.identity) === decodeRevision(right, this.identity);\n }\n\n async readHead(signal?: AbortSignal): Promise<RemoteHead | undefined> {\n const sha = await this.fetchRemoteHead(signal);\n if (!sha) return undefined;\n const { manifest } = await this.readPublication(sha, signal);\n return remoteHead(sha, manifest, this.identity);\n }\n\n async readSnapshot(reference: string, signal?: AbortSignal): Promise<Snapshot> {\n const head = await this.fetchRemoteHead(signal);\n if (!head) throw new Error(`Git snapshot publication was not found: ${reference}`);\n const commit = await this.resolveSnapshotReference(reference, head, signal);\n try {\n await this.git([\"cat-file\", \"-e\", `${commit}^{commit}`], { signal });\n await this.git([\"merge-base\", \"--is-ancestor\", commit, head], { signal });\n } catch (error) {\n throw new Error(`Git snapshot publication was not found: ${reference}`, { cause: error });\n }\n const { manifest, payloadEntries } = await this.readPublication(commit, signal);\n let blobs: Buffer[];\n try {\n blobs = await readGitBlobs(\n payloadEntries.map((entry) => entry.object),\n {\n gitDir: this.cacheDir,\n signal,\n timeoutMs: this.commandTimeoutMs,\n allowFileProtocol: this.allowLocalRemotes,\n maxOutputBytes: manifest.files.reduce((total, file) => total + file.size, 0),\n },\n );\n } catch (error) {\n if (error instanceof Error && /exceeds/u.test(error.message)) {\n throw new Error(\"Git snapshot file content exceeds its manifest size.\", { cause: error });\n }\n throw this.redactedError(error);\n }\n throwIfAborted(signal);\n const files: SnapshotFile[] = manifest.files.map((file, index) => {\n const content = blobs[index];\n if (!content || content.byteLength !== file.size || sha256(content) !== file.sha256) {\n throw new Error(`Git snapshot file checksum or size mismatch: ${file.path}`);\n }\n return { path: file.path, contentBase64: content.toString(\"base64\"), sha256: file.sha256 };\n });\n const snapshot: Snapshot = {\n version: manifest.snapshotVersion,\n id: manifest.snapshotId,\n createdAt: manifest.createdAt,\n machine: manifest.machine,\n profile: manifest.profile,\n ...(manifest.snapshotSyncSessions === undefined ? {} : { syncSessions: manifest.snapshotSyncSessions }),\n ...(manifest.selection === undefined ? {} : { selection: manifest.selection }),\n ...(manifest.localFields === undefined ? {} : { localFields: manifest.localFields }),\n files,\n };\n validateGitSnapshot(snapshot, manifest, this.config.destination.namespace);\n return snapshot;\n }\n\n async publishSnapshot(\n snapshot: Snapshot,\n expected: ExpectedRemoteHead,\n options: PublishSnapshotOptions = {},\n ): Promise<PublishSnapshotResult> {\n throwIfAborted(options.signal);\n const files = prepareGitSnapshot(snapshot, this.config.destination.namespace);\n const observed = await this.fetchRemoteHead(options.signal);\n if (!matchesExpected(observed, expected, this.identity)) {\n throw new SyncBackendConflictError(\n \"Git remote changed while preparing publication. Run /sync status and retry.\",\n { currentHead: observed ? await this.headForSha(observed, options.signal) : undefined },\n );\n }\n throwIfAborted(options.signal);\n const manifest: GitManifest = {\n version: GIT_MANIFEST_VERSION,\n snapshotVersion: snapshot.version,\n snapshotId: snapshot.id,\n createdAt: snapshot.createdAt,\n machine: snapshot.machine,\n profile: snapshot.profile,\n syncSessions: snapshot.syncSessions === true || snapshot.files.some((file) => file.path.startsWith(\"sessions/\")),\n ...(snapshot.syncSessions === undefined ? {} : { snapshotSyncSessions: snapshot.syncSessions }),\n ...(snapshot.selection === undefined ? {} : { selection: snapshot.selection }),\n ...(snapshot.localFields === undefined ? {} : { localFields: snapshot.localFields }),\n files: files.map(({ path: filePath, sha256: fileSha, size }) => ({\n path: filePath,\n sha256: fileSha,\n size,\n })),\n };\n let candidate: string;\n try {\n candidate = await this.createCommit(snapshot, files, manifest, observed, options.signal);\n } catch (error) {\n throw this.redactedError(error);\n }\n throwIfAborted(options.signal);\n options.onCommit?.();\n\n const ref = this.remoteRef();\n const lease = `--force-with-lease=${ref}:${observed ?? \"\"}`;\n let pushError: unknown;\n try {\n await this.git([\"push\", \"--porcelain\", \"--no-verify\", lease, this.config.profile.remote, `${candidate}:${ref}`], {\n timeoutMs: this.postCommitTimeoutMs,\n });\n await this.afterPushForTest?.();\n } catch (error) {\n pushError = error;\n }\n\n let current: string | undefined;\n try {\n current = await this.fetchRemoteHead(AbortSignal.timeout(this.postCommitTimeoutMs));\n } catch (error) {\n throw new SyncBackendPublicationOutcomeUnknownError(\n `Git publication outcome is unknown: ${this.safeError(pushError ?? error)}`,\n { cause: pushError ?? error },\n );\n }\n if (current !== candidate) {\n if (pushError && current === observed) {\n throw new Error(`Git publication failed without updating the owned branch: ${this.safeError(pushError)}`, {\n cause: pushError,\n });\n }\n throw new SyncBackendConflictError(\n pushError\n ? `Git publication lease was rejected: ${this.safeError(pushError)}`\n : \"Git remote changed immediately after publication.\",\n {\n phase: \"after-commit\",\n currentHead: current ? await this.headForSha(current) : undefined,\n candidateMayHaveBeenActive: true,\n cause: pushError instanceof Error ? pushError : undefined,\n },\n );\n }\n const head = await this.headForSha(candidate);\n return { head, warnings: [] };\n }\n\n async listHistory(signal?: AbortSignal): Promise<RemoteHistoryEntry[]> {\n const sha = await this.fetchRemoteHead(signal);\n if (!sha) return [];\n const result = await this.git([\"rev-list\", \"--first-parent\", \"--reverse\", \"--max-count=100\", sha], { signal });\n const commits = result.stdout.toString(\"utf8\").trim().split(\"\\n\").filter(Boolean);\n const entries: RemoteHistoryEntry[] = [];\n for (const commit of commits) {\n const { manifest } = await this.readPublication(commit, signal);\n entries.push({\n snapshotRef: commit,\n snapshotId: manifest.snapshotId,\n createdAt: manifest.createdAt,\n machine: manifest.machine,\n syncSessions: manifest.syncSessions,\n });\n }\n return entries;\n }\n\n async diagnose(signal?: AbortSignal): Promise<BackendDiagnostic[]> {\n const diagnostics: BackendDiagnostic[] = [\n {\n key: \"git-scope\",\n level: \"info\",\n message: \"git check scope: read remote snapshots and inspect the local cache. Write access is not tested.\",\n },\n ];\n try {\n const version = await runGit([\"--version\"], {\n signal,\n timeoutMs: this.commandTimeoutMs,\n });\n const versionText = version.stdout.toString(\"utf8\").trim();\n const supported = isSupportedGitVersion(versionText);\n diagnostics.push({\n key: \"git-version\",\n level: supported ? \"info\" : \"error\",\n message: supported\n ? versionText\n : `${versionText || \"unknown Git version\"}; pi-sync requires Git 2.30 or newer`,\n });\n } catch (error) {\n return [\n {\n key: \"git-version\",\n level: \"error\",\n message: syncErrorGuidance(new Error(this.safeError(error))),\n },\n ];\n }\n try {\n const head = await this.readHead(signal);\n if (head) await this.readSnapshot(head.snapshotRef, signal);\n diagnostics.push({\n key: \"git-remote\",\n level: \"info\",\n message: head\n ? `git remote: reachable; owned branch ${this.config.destination.branch} is valid`\n : `git remote: reachable; owned branch ${this.config.destination.branch} is not created yet`,\n });\n diagnostics.push({\n key: \"git-cache\",\n level: \"info\",\n message: \"git cache: private bare repository is healthy\",\n });\n } catch (error) {\n diagnostics.push({\n key: \"git-remote\",\n level: \"error\",\n message: `git remote: ${syncErrorGuidance(new Error(this.safeError(error)))}`,\n });\n }\n return diagnostics;\n }\n\n private async resolveSnapshotReference(reference: string, head: string, signal?: AbortSignal) {\n if (isCommitSha(reference) || /^[0-9a-f]{64}$/u.test(reference)) {\n requireCommitSha(reference);\n return reference;\n }\n if (!reference || reference.length > 512 || !/^[A-Za-z0-9._-]+$/u.test(reference)) {\n throw new Error(\"Invalid Git publication reference.\");\n }\n const result = await this.git([\"rev-list\", \"--first-parent\", \"--max-count=100\", head], {\n signal,\n });\n const commits = result.stdout.toString(\"utf8\").trim().split(\"\\n\").filter(Boolean);\n const matches: string[] = [];\n for (const commit of commits) {\n const { manifest } = await this.readPublication(commit, signal);\n if (manifest.snapshotId === reference) matches.push(commit);\n }\n if (matches.length === 0) {\n throw new Error(`Git snapshot publication was not found: ${reference}`);\n }\n if (matches.length > 1) {\n throw new Error(`Git snapshot id is ambiguous; use a commit reference from /sync history: ${reference}`);\n }\n return matches[0] as string;\n }\n\n private async headForSha(sha: string, signal?: AbortSignal) {\n const { manifest } = await this.readPublication(sha, signal);\n return remoteHead(sha, manifest, this.identity);\n }\n\n private async fetchRemoteHead(signal?: AbortSignal) {\n await this.ensureCache(signal);\n const result = await this.git([\"ls-remote\", \"--refs\", this.config.profile.remote, this.remoteRef()], { signal });\n const line = result.stdout.toString(\"utf8\").trim();\n if (!line) return undefined;\n const [sha, ref, ...extra] = line.split(/\\s+/u);\n if (extra.length > 0 || ref !== this.remoteRef() || !sha) {\n throw new Error(\"Git remote returned a malformed owned-ref response.\");\n }\n requireCommitSha(sha);\n await this.afterLsRemoteForTest?.();\n return withGitCacheMutation(\n this.cacheDir,\n async () => {\n const localRef = `refs/pisync/fetch/${process.pid}-${randomUUID()}`;\n try {\n await this.git(\n [\"fetch\", \"--no-tags\", \"--force\", this.config.profile.remote, `${this.remoteRef()}:${localRef}`],\n { signal },\n );\n const fetched = (await this.git([\"rev-parse\", \"--verify\", localRef], { signal })).stdout\n .toString(\"utf8\")\n .trim();\n requireCommitSha(fetched);\n return fetched;\n } finally {\n await this.git([\"update-ref\", \"-d\", localRef], { timeoutMs: 5_000 }).catch(() => undefined);\n }\n },\n signal,\n );\n }\n\n private async readManifest(commit: string, signal?: AbortSignal): Promise<GitManifest> {\n requireCommitSha(commit);\n const bytes = await this.showFile(commit, this.manifestPath(), signal, MAX_GIT_MANIFEST_BYTES);\n let parsed: unknown;\n try {\n parsed = JSON.parse(bytes.toString(\"utf8\"));\n } catch (error) {\n throw new Error(\"Git publication manifest is malformed.\", { cause: error });\n }\n return requireGitManifest(parsed);\n }\n\n private showFile(commit: string, filePath: string, signal?: AbortSignal, maxOutputBytes?: number) {\n return this.git([\"show\", `${commit}:${filePath}`], { signal, maxOutputBytes }).then((result) => result.stdout);\n }\n\n private async createCommit(\n snapshot: Snapshot,\n files: PreparedGitFile[],\n manifest: GitManifest,\n parent: string | undefined,\n signal?: AbortSignal,\n ) {\n const manifestBytes = Buffer.from(`${JSON.stringify(manifest)}\\n`, \"utf8\");\n if (manifestBytes.byteLength > MAX_GIT_MANIFEST_BYTES) {\n throw new Error(`Git publication manifest exceeds the ${MAX_GIT_MANIFEST_BYTES}-byte limit.`);\n }\n await this.ensureCache(signal);\n const temporaryDirectory = await fs.mkdtemp(path.join(path.dirname(this.cacheDir), \".index-\"));\n const indexPath = path.join(temporaryDirectory, \"index\");\n const payloadDirectory = path.join(temporaryDirectory, \"payloads\");\n const env = { GIT_INDEX_FILE: indexPath };\n try {\n await fs.mkdir(payloadDirectory, { mode: 0o700 });\n const uniqueFiles = [...new Map(files.map((file) => [file.sha256, file])).values()].sort((left, right) =>\n left.sha256.localeCompare(right.sha256),\n );\n for (const file of uniqueFiles) {\n throwIfAborted(signal);\n await fs.writeFile(path.join(payloadDirectory, file.sha256), file.content, {\n flag: \"wx\",\n mode: 0o600,\n });\n }\n await this.afterPayloadWriteForTest?.();\n throwIfAborted(signal);\n const hashed = await this.git([\"hash-object\", \"-w\", \"--no-filters\", \"--stdin-paths\"], {\n cwd: payloadDirectory,\n input: uniqueFiles.map((file) => file.sha256).join(\"\\n\") + (uniqueFiles.length ? \"\\n\" : \"\"),\n signal,\n maxOutputBytes: Math.max(1024, uniqueFiles.length * 64),\n });\n const objectIds = hashed.stdout.toString(\"utf8\").trim().split(\"\\n\").filter(Boolean);\n if (objectIds.length !== uniqueFiles.length || objectIds.some((id) => !isCommitSha(id))) {\n throw new Error(\"Git hash-object returned a malformed payload response.\");\n }\n const objectsBySha256 = new Map(uniqueFiles.map((file, index) => [file.sha256, objectIds[index] as string]));\n const manifestBlob = (await this.git([\"hash-object\", \"-w\", \"--stdin\"], { input: manifestBytes, signal })).stdout\n .toString(\"utf8\")\n .trim();\n if (!isCommitSha(manifestBlob)) throw new Error(\"Git returned an invalid manifest blob id.\");\n await this.git([\"read-tree\", \"--empty\"], { env, signal });\n const indexLines = [\n `100644 ${manifestBlob}\\t${this.manifestPath()}`,\n ...files.map((file) => {\n const object = objectsBySha256.get(file.sha256);\n if (!object) throw new Error(\"Git payload object is missing after hashing.\");\n return `100644 ${object}\\t${this.filePath(file.path)}`;\n }),\n ];\n await this.git([\"update-index\", \"-z\", \"--index-info\"], {\n env,\n signal,\n input: Buffer.from(`${indexLines.join(\"\\0\")}\\0`, \"utf8\"),\n });\n const tree = (await this.git([\"write-tree\"], { env, signal })).stdout.toString(\"utf8\").trim();\n const date = Number.isNaN(Date.parse(snapshot.createdAt)) ? new Date().toISOString() : snapshot.createdAt;\n const commit = await this.git([\"commit-tree\", tree, ...(parent ? [\"-p\", parent] : []), \"-F\", \"-\"], {\n signal,\n input: `pi-sync snapshot ${snapshot.id}\\n`,\n env: {\n GIT_AUTHOR_NAME: \"pi-sync\",\n GIT_AUTHOR_EMAIL: \"pi-sync@localhost\",\n GIT_COMMITTER_NAME: \"pi-sync\",\n GIT_COMMITTER_EMAIL: \"pi-sync@localhost\",\n GIT_AUTHOR_DATE: date,\n GIT_COMMITTER_DATE: date,\n },\n });\n const sha = commit.stdout.toString(\"utf8\").trim();\n requireCommitSha(sha);\n return sha;\n } finally {\n await fs.rm(temporaryDirectory, { recursive: true, force: true });\n }\n }\n\n private ensureCache(signal?: AbortSignal) {\n if (!this.cacheReady) {\n const operation = withGitCacheMutation(this.cacheDir, () => this.initializeCache(signal), signal);\n const wrapped = operation.catch((error) => {\n if (this.cacheReady === wrapped) this.cacheReady = undefined;\n throw this.redactedError(error);\n });\n this.cacheReady = wrapped;\n }\n return this.cacheReady;\n }\n\n private async initializeCache(signal?: AbortSignal) {\n const version = await runGit([\"--version\"], {\n signal,\n timeoutMs: this.commandTimeoutMs,\n });\n const versionText = version.stdout.toString(\"utf8\").trim();\n if (!isSupportedGitVersion(versionText)) {\n throw new Error(`${versionText || \"Unknown Git version\"}; pi-sync requires Git 2.30 or newer.`);\n }\n const parent = path.dirname(this.cacheDir);\n const cacheParent = path.dirname(this.cacheRoot);\n await assertNotSymlink(cacheParent, \"Git cache parent\");\n await assertNotSymlink(this.cacheRoot, \"Git cache root\");\n await fs.mkdir(this.cacheRoot, { recursive: true, mode: 0o700 });\n await assertNotSymlink(cacheParent, \"Git cache parent\");\n await assertNotSymlink(this.cacheRoot, \"Git cache root\");\n await assertNotSymlink(parent, \"Git cache identity directory\");\n await fs.mkdir(parent, { recursive: true, mode: 0o700 });\n await assertNotSymlink(parent, \"Git cache identity directory\");\n let recreate = false;\n try {\n const stat = await fs.lstat(this.cacheDir);\n if (stat.isSymbolicLink()) throw new Error(\"Refusing symlinked Git cache.\");\n if (!stat.isDirectory()) recreate = true;\n else {\n try {\n recreate = !(await this.cacheUsesSha1(signal));\n } catch {\n throwIfAborted(signal);\n recreate = true;\n }\n }\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") throw error;\n }\n throwIfAborted(signal);\n if (recreate) await fs.rm(this.cacheDir, { recursive: true, force: true });\n try {\n await fs.access(this.cacheDir);\n } catch {\n try {\n await runGit([\"init\", \"--bare\", \"--object-format=sha1\", this.cacheDir], {\n signal,\n timeoutMs: this.commandTimeoutMs,\n allowFileProtocol: this.allowLocalRemotes,\n });\n } catch (initError) {\n const concurrent = await this.cacheUsesSha1(signal).catch(() => false);\n if (!concurrent) throw initError;\n }\n }\n if (process.platform !== \"win32\") await fs.chmod(parent, 0o700);\n }\n\n private async cacheUsesSha1(signal?: AbortSignal) {\n const result = await this.git([\"rev-parse\", \"--is-bare-repository\", \"--show-object-format\"], {\n signal,\n });\n return result.stdout.toString(\"utf8\").trim() === \"true\\nsha1\";\n }\n\n private git(\n args: string[],\n options: {\n cwd?: string;\n input?: Buffer | string;\n env?: NodeJS.ProcessEnv;\n signal?: AbortSignal;\n timeoutMs?: number;\n maxOutputBytes?: number;\n } = {},\n ) {\n return runGit(args, {\n gitDir: this.cacheDir,\n allowFileProtocol: this.allowLocalRemotes,\n timeoutMs: options.timeoutMs ?? this.commandTimeoutMs,\n ...options,\n }).catch((error) => {\n throw this.redactedError(error);\n });\n }\n\n private remoteRef() {\n return `refs/heads/${this.config.destination.branch}`;\n }\n\n private publicationPath() {\n return this.config.destination.directory === \"./\" ? \"\" : this.config.destination.directory;\n }\n\n private manifestPath() {\n return posixJoin(this.publicationPath(), \"manifest.json\");\n }\n\n private filePath(filePath: string) {\n return posixJoin(this.publicationPath(), \"files\", filePath);\n }\n\n private async readPublication(commit: string, signal?: AbortSignal) {\n const manifest = await this.readManifest(commit, signal);\n const entries = await this.readPublicationTree(commit, signal);\n const payloadEntries = validateGitPublicationTree(entries, manifest, this.manifestPath(), (filePath) =>\n this.filePath(filePath),\n );\n return { manifest, payloadEntries };\n }\n\n private async readPublicationTree(commit: string, signal?: AbortSignal) {\n const result = await this.git([\"ls-tree\", \"-r\", \"-z\", commit], {\n signal,\n maxOutputBytes: MAX_GIT_TREE_OUTPUT_BYTES,\n });\n return parseGitTree(result.stdout);\n }\n\n private redactedError(error: unknown) {\n if (error instanceof Error && error.name === \"AbortError\") return error;\n return new Error(this.safeError(error));\n }\n\n private safeError(error: unknown) {\n const raw =\n error instanceof GitCommandError\n ? error.stderr || error.message\n : error instanceof Error\n ? error.message\n : String(error);\n return redactGitError(raw, this.config.profile.remote, this.cacheDir);\n }\n}\n\nexport function gitBackendIdentity(config: ResolvedGitBackend) {\n let remoteIdentity: string;\n try {\n remoteIdentity = normalizeGitRemoteIdentity(config.profile.remote);\n } catch {\n remoteIdentity = config.profile.remote;\n }\n const canonical = JSON.stringify([remoteIdentity, config.destination.branch, config.destination.directory]);\n return `git:${sha256(Buffer.from(canonical))}`;\n}\n\nfunction gitDestination(config: ResolvedGitBackend) {\n let host = \"Git remote\";\n const remote = config.profile.remote;\n if (remote.includes(\"://\")) {\n try {\n host = new URL(remote).host;\n } catch {\n host = \"Git remote\";\n }\n } else {\n const match = /^(?:[^@]+@)?(?<host>\\[[^\\]]+\\]|[^:]+):/u.exec(remote);\n if (match?.groups?.host) host = match.groups.host;\n }\n return `${host} \u00B7 ${config.destination.branch}:${config.destination.directory}`;\n}\n\nfunction remoteHead(sha: string, manifest: GitManifest, identity: string): RemoteHead {\n return {\n snapshotRef: sha,\n snapshotId: manifest.snapshotId,\n revision: `${identity}:${sha}`,\n createdAt: manifest.createdAt,\n machine: manifest.machine,\n syncSessions: manifest.syncSessions,\n ...(manifest.selection === undefined ? {} : { selection: manifest.selection }),\n };\n}\n\nfunction matchesExpected(current: string | undefined, expected: ExpectedRemoteHead, identity: string) {\n if (expected.kind === \"missing\") return current === undefined;\n try {\n return current === decodeRevision(expected.revision, identity);\n } catch {\n return false;\n }\n}\n\nfunction decodeRevision(revision: string, identity: string) {\n const prefix = `${identity}:`;\n const sha = revision.startsWith(prefix) ? revision.slice(prefix.length) : \"\";\n if (!/^[0-9a-f]{40}$/u.test(sha)) throw new Error(\"Invalid Git remote revision.\");\n return sha;\n}\n\nfunction isCommitSha(value: string) {\n return /^[0-9a-f]{40}$/u.test(value);\n}\n\nfunction requireCommitSha(value: string) {\n if (/^[0-9a-f]{64}$/u.test(value)) {\n throw new Error(\"Unsupported Git SHA-256 repository; pi-sync currently requires SHA-1 refs.\");\n }\n if (!/^[0-9a-f]{40}$/u.test(value)) throw new Error(\"Invalid Git publication reference.\");\n}\n\nexport function isSupportedGitVersion(value: string) {\n const match = /git version (\\d+)\\.(\\d+)/u.exec(value);\n if (!match) return false;\n const major = Number(match[1]);\n const minor = Number(match[2]);\n return major > 2 || (major === 2 && minor >= 30);\n}\n\nfunction assertGitDestination(config: ResolvedGitBackend) {\n try {\n if (\n normalizeGitBranch(config.destination.branch) !== config.destination.branch ||\n normalizeGitDirectory(config.destination.directory) !== config.destination.directory\n ) {\n throw new Error(\"Git storage location is not normalized.\");\n }\n validateGitNamespace(config.destination.namespace);\n } catch (error) {\n throw new Error(\"Invalid Git storage location.\", { cause: error });\n }\n}\n\nfunction assertProductionRemote(remote: string) {\n let normalized: string | undefined;\n try {\n normalized = normalizeGitRemote(remote);\n } catch (error) {\n throw new Error(error instanceof Error ? error.message : \"Invalid Git remote.\", {\n cause: error,\n });\n }\n if (!normalized || normalized !== remote) throw new Error(\"Invalid or non-normalized Git remote.\");\n}\n\nasync function withGitCacheMutation<T>(cacheDir: string, run: () => Promise<T>, signal?: AbortSignal): Promise<T> {\n const previous = gitCacheMutationQueues.get(cacheDir) ?? Promise.resolve();\n let started = false;\n const operation = previous\n .catch(() => undefined)\n .then(() => {\n throwIfAborted(signal);\n started = true;\n return run();\n });\n const tail = operation.then(\n () => undefined,\n () => undefined,\n );\n gitCacheMutationQueues.set(cacheDir, tail);\n void tail.then(() => {\n if (gitCacheMutationQueues.get(cacheDir) === tail) gitCacheMutationQueues.delete(cacheDir);\n });\n if (!signal) return operation;\n throwIfAborted(signal);\n let rejectAbort: ((reason: unknown) => void) | undefined;\n const aborted = new Promise<never>((_resolve, reject) => {\n rejectAbort = reject;\n });\n const onAbort = () => rejectAbort?.(abortReason(signal));\n signal.addEventListener(\"abort\", onAbort, { once: true });\n if (signal.aborted) onAbort();\n try {\n return await Promise.race([operation, aborted]);\n } catch (error) {\n // A queued job can cancel immediately, but a running job owns a child/cache\n // mutation. Drain its bounded cleanup before releasing outer sync guards.\n if (started) await tail;\n throw error;\n } finally {\n signal.removeEventListener(\"abort\", onAbort);\n }\n}\n\nasync function assertNotSymlink(target: string, label: string) {\n try {\n const stat = await fs.lstat(target);\n if (stat.isSymbolicLink()) throw new Error(`Refusing symlinked ${label}.`);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") throw error;\n }\n}\n\nfunction redactGitError(value: string, remote: string, cacheDir: string) {\n return (\n value\n .replaceAll(remote, \"<git-remote>\")\n .replaceAll(cacheDir, \"<git-cache>\")\n .replace(/https:\\/\\/[^/@\\s]+@/gu, \"https://<credentials>@\")\n .replace(/\\b(password|token|authorization)=\\S+/giu, \"$1=<redacted>\")\n .replace(/\\bBearer\\s+\\S+/giu, \"Bearer <redacted>\")\n // biome-ignore lint/suspicious/noControlCharactersInRegex: sanitize untrusted process output.\n .replace(/[\\u0000-\\u001f\\u007f-\\u009f]/gu, \" \")\n .trim()\n .slice(0, 4096)\n );\n}\n\nfunction sha256(value: Buffer) {\n return createHash(\"sha256\").update(value).digest(\"hex\");\n}\n\nfunction abortReason(signal: AbortSignal) {\n return signal.reason instanceof Error ? signal.reason : new DOMException(\"The operation was aborted\", \"AbortError\");\n}\n", "import { spawn } from \"node:child_process\";\nimport process from \"node:process\";\nimport { throwIfAborted } from \"../../sync/signals.js\";\n\nconst DEFAULT_TIMEOUT_MS = 30_000;\nconst DEFAULT_OUTPUT_LIMIT = 1024 * 1024;\n\nexport interface GitRunOptions {\n gitDir?: string;\n cwd?: string;\n input?: Buffer | string;\n env?: NodeJS.ProcessEnv;\n signal?: AbortSignal;\n timeoutMs?: number;\n maxOutputBytes?: number;\n allowFileProtocol?: boolean;\n}\n\nexport interface GitRunResult {\n stdout: Buffer;\n stderr: Buffer;\n}\n\nexport class GitCommandError extends Error {\n readonly code = \"GIT_COMMAND_FAILED\";\n constructor(\n message: string,\n readonly exitCode: number | null,\n readonly stderr: string,\n options?: ErrorOptions,\n ) {\n super(message, options);\n this.name = \"GitCommandError\";\n }\n}\n\nexport async function runGit(args: string[], options: GitRunOptions = {}): Promise<GitRunResult> {\n throwIfAborted(options.signal);\n const hooksPath = process.platform === \"win32\" ? \"NUL\" : \"/dev/null\";\n const protocolArgs = [\n \"-c\",\n `core.hooksPath=${hooksPath}`,\n \"-c\",\n \"gc.auto=0\",\n \"-c\",\n \"maintenance.auto=false\",\n \"-c\",\n \"protocol.allow=never\",\n \"-c\",\n \"protocol.https.allow=always\",\n \"-c\",\n \"protocol.ssh.allow=always\",\n ];\n if (options.allowFileProtocol) protocolArgs.push(\"-c\", \"protocol.file.allow=always\");\n const commandArgs = [...(options.gitDir ? [`--git-dir=${options.gitDir}`] : []), ...protocolArgs, ...args];\n const inheritedEnvironment = Object.fromEntries(\n Object.entries(process.env).filter(\n ([key]) =>\n !key.startsWith(\"GIT_\") &&\n key !== \"PAGER\" &&\n key !== \"EDITOR\" &&\n key !== \"VISUAL\" &&\n key !== \"SSH_ASKPASS\" &&\n key !== \"SSH_ASKPASS_REQUIRE\",\n ),\n );\n const allowedGitOverrides = new Set([\n \"GIT_INDEX_FILE\",\n \"GIT_AUTHOR_NAME\",\n \"GIT_AUTHOR_EMAIL\",\n \"GIT_AUTHOR_DATE\",\n \"GIT_COMMITTER_NAME\",\n \"GIT_COMMITTER_EMAIL\",\n \"GIT_COMMITTER_DATE\",\n ]);\n const suppliedEnvironment = Object.fromEntries(\n Object.entries(options.env ?? {}).filter(([key]) => !key.startsWith(\"GIT_\") || allowedGitOverrides.has(key)),\n );\n const env: NodeJS.ProcessEnv = {\n ...inheritedEnvironment,\n ...suppliedEnvironment,\n LC_ALL: \"C\",\n LANG: \"C\",\n GIT_CONFIG_NOSYSTEM: \"1\",\n GIT_TERMINAL_PROMPT: \"0\",\n GCM_INTERACTIVE: \"Never\",\n GIT_PAGER: \"cat\",\n PAGER: \"cat\",\n GIT_EDITOR: \"true\",\n EDITOR: \"true\",\n VISUAL: \"true\",\n GIT_ASKPASS: \"\",\n SSH_ASKPASS: \"\",\n SSH_ASKPASS_REQUIRE: \"never\",\n GIT_SSH_COMMAND: \"ssh -oBatchMode=yes\",\n };\n const child = spawn(\"git\", commandArgs, {\n cwd: options.cwd,\n env,\n stdio: [\"pipe\", \"pipe\", \"pipe\"],\n detached: process.platform !== \"win32\",\n windowsHide: true,\n });\n const stdout: Buffer[] = [];\n const stderr: Buffer[] = [];\n let total = 0;\n let settled = false;\n let terminationError: Error | undefined;\n let escalationTimer: NodeJS.Timeout | undefined;\n const limit = options.maxOutputBytes ?? DEFAULT_OUTPUT_LIMIT;\n\n const terminate = (error: Error) => {\n if (settled || terminationError) return;\n terminationError = error;\n if (child.pid && process.platform !== \"win32\") {\n try {\n process.kill(-child.pid, \"SIGTERM\");\n } catch {\n child.kill(\"SIGTERM\");\n }\n } else {\n child.kill(\"SIGTERM\");\n if (child.pid && process.platform === \"win32\") {\n const killer = spawn(\"taskkill\", [\"/pid\", String(child.pid), \"/t\", \"/f\"], {\n stdio: \"ignore\",\n windowsHide: true,\n });\n killer.on(\"error\", () => undefined);\n killer.unref();\n }\n }\n escalationTimer = setTimeout(() => {\n if (settled) return;\n if (child.pid && process.platform !== \"win32\") {\n try {\n process.kill(-child.pid, \"SIGKILL\");\n } catch {\n child.kill(\"SIGKILL\");\n }\n } else {\n child.kill(\"SIGKILL\");\n }\n }, 2_000);\n };\n const collect = (target: Buffer[]) => (chunk: Buffer) => {\n total += chunk.byteLength;\n if (total > limit) {\n terminate(new Error(`Git output exceeds the ${limit}-byte limit.`));\n return;\n }\n target.push(Buffer.from(chunk));\n };\n child.stdout.on(\"data\", collect(stdout));\n child.stderr.on(\"data\", collect(stderr));\n child.stdin.on(\"error\", () => undefined);\n child.stdin.end(options.input);\n const onAbort = () =>\n terminate(\n options.signal?.reason instanceof Error\n ? options.signal.reason\n : new DOMException(\"The operation was aborted\", \"AbortError\"),\n );\n options.signal?.addEventListener(\"abort\", onAbort, { once: true });\n const timer = setTimeout(\n () => terminate(new Error(`Git command timed out after ${options.timeoutMs ?? DEFAULT_TIMEOUT_MS}ms.`)),\n options.timeoutMs ?? DEFAULT_TIMEOUT_MS,\n );\n\n let result: GitRunResult;\n try {\n result = await new Promise<GitRunResult>((resolve, reject) => {\n child.once(\"error\", reject);\n child.once(\"close\", (code) => {\n settled = true;\n if (escalationTimer) clearTimeout(escalationTimer);\n const stdoutBuffer = Buffer.concat(stdout);\n const stderrBuffer = Buffer.concat(stderr);\n if (terminationError) {\n reject(terminationError);\n return;\n }\n if (code !== 0) {\n const stderrText = stderrBuffer.toString(\"utf8\").trim();\n reject(new GitCommandError(stderrText || `Git exited with status ${code ?? \"unknown\"}.`, code, stderrText));\n return;\n }\n resolve({ stdout: stdoutBuffer, stderr: stderrBuffer });\n });\n });\n } finally {\n clearTimeout(timer);\n if (escalationTimer) clearTimeout(escalationTimer);\n options.signal?.removeEventListener(\"abort\", onAbort);\n }\n return result;\n}\n\nexport function parseGitBlobBatch(output: Buffer, expectedCount: number, maxContentBytes: number) {\n if (!Number.isSafeInteger(expectedCount) || expectedCount < 0) {\n throw new Error(\"Invalid Git batch object count.\");\n }\n if (!Number.isSafeInteger(maxContentBytes) || maxContentBytes < 0) {\n throw new Error(\"Invalid Git batch content limit.\");\n }\n const blobs: Buffer[] = [];\n let offset = 0;\n let contentBytes = 0;\n for (let index = 0; index < expectedCount; index += 1) {\n const headerEnd = output.indexOf(0x0a, offset);\n if (headerEnd < 0) throw new Error(\"Git cat-file batch response is truncated.\");\n const header = output.subarray(offset, headerEnd).toString(\"utf8\");\n if (header.endsWith(\" missing\")) throw new Error(\"Git cat-file batch object is missing.\");\n const match = /^(?<object>[0-9a-f]{40}) blob (?<size>0|[1-9][0-9]*)$/u.exec(header);\n if (!match?.groups) throw new Error(\"Git cat-file batch response is malformed.\");\n const size = Number(match.groups.size);\n if (!Number.isSafeInteger(size)) throw new Error(\"Git cat-file batch size is malformed.\");\n contentBytes += size;\n if (contentBytes > maxContentBytes) {\n throw new Error(`Git cat-file batch content exceeds the ${maxContentBytes}-byte limit.`);\n }\n const contentStart = headerEnd + 1;\n const contentEnd = contentStart + size;\n if (contentEnd >= output.length) throw new Error(\"Git cat-file batch response is truncated.\");\n if (output[contentEnd] !== 0x0a) {\n throw new Error(\"Git cat-file batch response is malformed.\");\n }\n blobs.push(Buffer.from(output.subarray(contentStart, contentEnd)));\n offset = contentEnd + 1;\n }\n if (offset !== output.length) throw new Error(\"Git cat-file batch response has trailing data.\");\n return blobs;\n}\n\nexport async function readGitBlobs(\n objects: string[],\n options: Omit<GitRunOptions, \"input\" | \"maxOutputBytes\"> & { maxOutputBytes: number },\n) {\n if (objects.length === 0) return [];\n if (!Number.isSafeInteger(options.maxOutputBytes) || options.maxOutputBytes < 0) {\n throw new Error(\"Invalid Git batch output limit.\");\n }\n if (objects.some((object) => !/^[0-9a-f]{40}$/u.test(object))) {\n throw new Error(\"Invalid Git blob object id.\");\n }\n const protocolOverhead = objects.length * 96;\n if (!Number.isSafeInteger(protocolOverhead + options.maxOutputBytes)) {\n throw new Error(\"Invalid Git batch output limit.\");\n }\n const result = await runGit([\"cat-file\", \"--batch\"], {\n ...options,\n input: `${objects.join(\"\\n\")}\\n`,\n maxOutputBytes: options.maxOutputBytes + protocolOverhead,\n });\n return parseGitBlobBatch(result.stdout, objects.length, options.maxOutputBytes);\n}\n", "import { createHash } from \"node:crypto\";\nimport type { Snapshot, SnapshotSelection } from \"../../snapshot/snapshot-types.js\";\nimport { sameLocalFields, validatePortableSnapshot, validateSnapshotFieldPolicy } from \"../../sync/local-fields.js\";\nimport { portableSnapshotSelection, snapshotSelectionInclude } from \"../../sync/sync-policy.js\";\n\nexport const GIT_MANIFEST_VERSION = 2;\nexport const MAX_GIT_MANIFEST_BYTES = 1024 * 1024;\nexport const MAX_GIT_TREE_OUTPUT_BYTES = 16 * 1024 * 1024;\nexport const MAX_GIT_PAYLOAD_BYTES = 100 * 1024 * 1024;\nexport const MAX_GIT_SNAPSHOT_BYTES = 512 * 1024 * 1024;\n\nexport interface GitManifestFile {\n path: string;\n sha256: string;\n size: number;\n}\n\nexport interface GitManifest {\n version: number;\n snapshotVersion: number;\n snapshotId: string;\n createdAt: string;\n machine: string;\n profile: string;\n syncSessions: boolean;\n snapshotSyncSessions?: boolean;\n selection?: SnapshotSelection;\n localFields?: string[];\n files: GitManifestFile[];\n}\n\nexport interface PreparedGitFile extends GitManifestFile {\n content: Buffer;\n}\n\nexport interface GitTreeEntry {\n mode: string;\n type: string;\n object: string;\n path: string;\n}\n\nexport function isGitPayloadSizeAllowed(size: number) {\n return Number.isSafeInteger(size) && size >= 0 && size <= MAX_GIT_PAYLOAD_BYTES;\n}\n\nexport function requireGitManifest(value: unknown): GitManifest {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n throw new Error(\"Git publication manifest is malformed.\");\n }\n const manifest = value as Partial<GitManifest>;\n if (manifest.version === 1) {\n throw new Error(\n \"Git publication uses the unsupported pre-release gzip format; recreate this pi-sync-owned test branch.\",\n );\n }\n if (\n manifest.version !== GIT_MANIFEST_VERSION ||\n (manifest.snapshotVersion !== 1 && manifest.snapshotVersion !== 2 && manifest.snapshotVersion !== 3) ||\n typeof manifest.snapshotId !== \"string\" ||\n manifest.snapshotId.length > 512 ||\n !/^[A-Za-z0-9._-]+$/u.test(manifest.snapshotId) ||\n typeof manifest.createdAt !== \"string\" ||\n manifest.createdAt.length > 64 ||\n hasControlCharacter(manifest.createdAt) ||\n Number.isNaN(Date.parse(manifest.createdAt)) ||\n typeof manifest.machine !== \"string\" ||\n manifest.machine.length > 256 ||\n hasControlCharacter(manifest.machine) ||\n typeof manifest.profile !== \"string\" ||\n manifest.profile.length === 0 ||\n manifest.profile.length > 256 ||\n hasControlCharacter(manifest.profile) ||\n typeof manifest.syncSessions !== \"boolean\" ||\n (manifest.snapshotSyncSessions !== undefined && typeof manifest.snapshotSyncSessions !== \"boolean\") ||\n !Array.isArray(manifest.files) ||\n !hasExactKeys(manifest as Record<string, unknown>, [\n \"version\",\n \"snapshotVersion\",\n \"snapshotId\",\n \"createdAt\",\n \"machine\",\n \"profile\",\n \"syncSessions\",\n ...(manifest.snapshotSyncSessions === undefined ? [] : [\"snapshotSyncSessions\"]),\n ...(manifest.selection === undefined ? [] : [\"selection\"]),\n ...(manifest.localFields === undefined ? [] : [\"localFields\"]),\n \"files\",\n ])\n ) {\n throw new Error(\"Git publication manifest is malformed.\");\n }\n validateSnapshotFieldPolicy({ version: manifest.snapshotVersion, localFields: manifest.localFields });\n if (manifest.selection !== undefined) portableSnapshotSelection(manifest.selection);\n let total = 0;\n const paths = new Set<string>();\n for (const rawFile of manifest.files) {\n if (!rawFile || typeof rawFile !== \"object\" || Array.isArray(rawFile)) {\n throw new Error(\"Git publication manifest file is malformed.\");\n }\n const file = rawFile as Partial<GitManifestFile>;\n if (\n !hasExactKeys(file as Record<string, unknown>, [\"path\", \"sha256\", \"size\"]) ||\n !isSafeSnapshotPath(file.path) ||\n typeof file.sha256 !== \"string\" ||\n !/^[0-9a-f]{64}$/u.test(file.sha256) ||\n typeof file.size !== \"number\" ||\n !isGitPayloadSizeAllowed(file.size) ||\n paths.has(file.path)\n ) {\n throw new Error(\"Git publication manifest file is malformed.\");\n }\n total += file.size;\n if (!Number.isSafeInteger(total) || total > MAX_GIT_SNAPSHOT_BYTES) {\n throw new Error(`Git snapshot content exceeds the ${MAX_GIT_SNAPSHOT_BYTES}-byte limit.`);\n }\n paths.add(file.path);\n }\n assertNoPathConflicts([...paths]);\n return manifest as GitManifest;\n}\n\nexport function validateGitSnapshot(snapshot: Snapshot, manifest: GitManifest, namespace: string) {\n const prepared = prepareGitSnapshot(snapshot, namespace);\n const syncSessions =\n snapshot.syncSessions === true || snapshot.files.some((file) => file.path.startsWith(\"sessions/\"));\n if (\n snapshot.version !== manifest.snapshotVersion ||\n !sameLocalFields(snapshot.localFields, manifest.localFields) ||\n snapshot.id !== manifest.snapshotId ||\n snapshot.createdAt !== manifest.createdAt ||\n snapshot.machine !== manifest.machine ||\n snapshot.profile !== manifest.profile ||\n snapshot.syncSessions !== manifest.snapshotSyncSessions ||\n syncSessions !== manifest.syncSessions ||\n !sameOptionalInclude(\n snapshotSelectionInclude(snapshot),\n manifest.selection === undefined ? undefined : portableSnapshotSelection(manifest.selection).include,\n ) ||\n prepared.length !== manifest.files.length ||\n prepared.some((file, index) => {\n const expected = manifest.files[index];\n return !expected || file.path !== expected.path || file.sha256 !== expected.sha256 || file.size !== expected.size;\n })\n ) {\n throw new Error(\"Git snapshot identity does not match its publication manifest.\");\n }\n}\n\nexport function prepareGitSnapshot(snapshot: Snapshot, namespace: string) {\n snapshotSelectionInclude(snapshot);\n validatePortableSnapshot(snapshot);\n if (\n typeof snapshot.id !== \"string\" ||\n !snapshot.id ||\n snapshot.id.length > 512 ||\n !/^[A-Za-z0-9._-]+$/u.test(snapshot.id) ||\n snapshot.profile !== namespace ||\n !Array.isArray(snapshot.files) ||\n typeof snapshot.createdAt !== \"string\" ||\n !snapshot.createdAt ||\n snapshot.createdAt.length > 64 ||\n hasControlCharacter(snapshot.createdAt) ||\n Number.isNaN(Date.parse(snapshot.createdAt)) ||\n typeof snapshot.machine !== \"string\" ||\n snapshot.machine.length > 256 ||\n hasControlCharacter(snapshot.machine)\n ) {\n throw new Error(\"Invalid Git snapshot publication.\");\n }\n const paths = new Set<string>();\n const prepared: PreparedGitFile[] = [];\n let total = 0;\n for (const file of snapshot.files) {\n if (\n !isSafeSnapshotPath(file.path) ||\n typeof file.contentBase64 !== \"string\" ||\n typeof file.sha256 !== \"string\" ||\n !/^[0-9a-f]{64}$/u.test(file.sha256) ||\n paths.has(file.path)\n ) {\n throw new Error(\"Invalid Git snapshot file.\");\n }\n const content = Buffer.from(file.contentBase64, \"base64\");\n if (content.toString(\"base64\") !== file.contentBase64 || sha256(content) !== file.sha256) {\n throw new Error(\"Git snapshot file checksum mismatch.\");\n }\n if (!isGitPayloadSizeAllowed(content.byteLength)) {\n throw new Error(\n `Git snapshot file exceeds GitHub's ${MAX_GIT_PAYLOAD_BYTES}-byte regular-Git limit: ${file.path}`,\n );\n }\n total += content.byteLength;\n if (!Number.isSafeInteger(total) || total > MAX_GIT_SNAPSHOT_BYTES) {\n throw new Error(`Git snapshot content exceeds the ${MAX_GIT_SNAPSHOT_BYTES}-byte limit.`);\n }\n paths.add(file.path);\n prepared.push({ path: file.path, sha256: file.sha256, size: content.byteLength, content });\n }\n assertNoPathConflicts([...paths]);\n return prepared;\n}\n\nexport function parseGitTree(output: Buffer): GitTreeEntry[] {\n if (output.byteLength === 0) return [];\n if (output.at(-1) !== 0) throw new Error(\"Git publication tree response is malformed.\");\n return output\n .subarray(0, -1)\n .toString(\"utf8\")\n .split(\"\\0\")\n .map((line) => {\n const match = /^(?<mode>[0-9]{6}) (?<type>blob|tree|commit) (?<object>[0-9a-f]{40})\\t(?<path>.+)$/u.exec(line);\n if (!match?.groups || hasControlCharacter(match.groups.path)) {\n throw new Error(\"Git publication tree response is malformed.\");\n }\n return {\n mode: match.groups.mode,\n type: match.groups.type,\n object: match.groups.object,\n path: match.groups.path,\n };\n });\n}\n\nexport function validateGitPublicationTree(\n entries: GitTreeEntry[],\n manifest: GitManifest,\n manifestPath: string,\n filePath: (path: string) => string,\n) {\n const byPath = new Map<string, GitTreeEntry>();\n for (const entry of entries) {\n if (byPath.has(entry.path)) throw new Error(\"Git publication tree contains duplicate paths.\");\n byPath.set(entry.path, entry);\n }\n const expectedPaths = [manifestPath, ...manifest.files.map((file) => filePath(file.path))];\n if (entries.length !== expectedPaths.length || expectedPaths.some((path) => !byPath.has(path))) {\n throw new Error(\"Git publication tree has missing or extra files.\");\n }\n for (const expectedPath of expectedPaths) {\n const entry = byPath.get(expectedPath);\n if (entry?.mode !== \"100644\" || entry.type !== \"blob\") {\n throw new Error(`Git publication tree contains a non-regular file: ${expectedPath}`);\n }\n }\n return manifest.files.map((file) => byPath.get(filePath(file.path)) as GitTreeEntry);\n}\n\nfunction sameOptionalInclude(left: string[] | undefined, right: string[] | undefined) {\n if (!left || !right) return left === right;\n return left.length === right.length && left.every((item, index) => item === right[index]);\n}\n\nfunction isSafeSnapshotPath(value: unknown): value is string {\n return (\n typeof value === \"string\" &&\n value.length > 0 &&\n value.length <= 4096 &&\n !value.startsWith(\"/\") &&\n !value.includes(\"\\\\\") &&\n !hasControlCharacter(value) &&\n value\n .split(\"/\")\n .every((segment) => segment && segment !== \".\" && segment !== \"..\" && segment.toLowerCase() !== \".git\")\n );\n}\n\nfunction hasExactKeys(value: Record<string, unknown>, expected: string[]) {\n const keys = Object.keys(value).sort();\n const expectedKeys = [...expected].sort();\n return keys.length === expectedKeys.length && keys.every((key, index) => key === expectedKeys[index]);\n}\n\nfunction assertNoPathConflicts(paths: string[]) {\n const sorted = [...paths].sort();\n for (let index = 1; index < sorted.length; index += 1) {\n const parent = sorted[index - 1];\n const child = sorted[index];\n if (parent && child?.startsWith(`${parent}/`)) {\n throw new Error(`Git snapshot file path conflict: ${parent} and ${child}`);\n }\n }\n}\n\nfunction sha256(value: Buffer) {\n return createHash(\"sha256\").update(value).digest(\"hex\");\n}\n\nfunction hasControlCharacter(value: string) {\n // biome-ignore lint/suspicious/noControlCharactersInRegex: Reject untrusted terminal/ref controls.\n return /[\\u0000-\\u001f\\u007f-\\u009f]/u.test(value);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,cAAAA,aAAY,kBAAkB;AACvC,OAAO,QAAQ;AACf,OAAO,UAAU;;;ACFjB,SAAS,aAAa;AACtB,OAAOC,cAAa;AAGpB,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB,OAAO;AAkB7B,IAAM,kBAAN,cAA8B,MAAM;AAAA,EAEzC,YACE,SACS,UACA,QACT,SACA;AACA,UAAM,SAAS,OAAO;AAJb;AACA;AAIT,SAAK,OAAO;AAAA,EACd;AAAA,EANW;AAAA,EACA;AAAA,EAJF,OAAO;AAUlB;AAEA,eAAsB,OAAO,MAAgB,UAAyB,CAAC,GAA0B;AAC/F,iBAAe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AG,IAAI;AAEpB;AAEA,SAASA,QAAO,OAAe;AAC7B,SAAOC,YAAW,QAAQ,EAAE,OAAO,KAAK,EAAE,OAAO,KAAK;AACxD;AAEA,SAAS,YAAY,QAAqB;AACxC,SAAO,OAAO,kBAAkB,QAAQ,OAAO,SAAS,IAAI,aAAa,6BAA6B,YAAY;AACpH;",
|
|
6
|
+
"names": ["createHash", "process", "process", "path", "sha256", "createHash"]
|
|
7
|
+
}
|
package/dist/chunks/{manager-result-dispatcher-6MQKFCWB.ts → manager-result-dispatcher-AGBBVDDS.ts}
RENAMED
|
@@ -2,22 +2,23 @@
|
|
|
2
2
|
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
3
|
import {
|
|
4
4
|
dispatchManagerResult
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-EUMINX7L.ts";
|
|
6
|
+
import "./chunk-JJTARUSO.ts";
|
|
7
|
+
import "./chunk-YK52VDXG.ts";
|
|
8
|
+
import "./chunk-OEWQVWLC.ts";
|
|
9
|
+
import "./chunk-B4QZBDBT.ts";
|
|
9
10
|
import "./chunk-K3RIEL6J.ts";
|
|
10
11
|
import "./chunk-AMJRUXFT.ts";
|
|
11
|
-
import "./chunk-CHSIAC4N.ts";
|
|
12
|
-
import "./chunk-3B4Z2SKV.ts";
|
|
13
|
-
import "./chunk-2JZFHNLM.ts";
|
|
14
|
-
import "./chunk-T2SJD3N7.ts";
|
|
15
12
|
import "./chunk-7D5SF7P3.ts";
|
|
13
|
+
import "./chunk-QO333NM4.ts";
|
|
16
14
|
import "./chunk-A6HU4ERM.ts";
|
|
15
|
+
import "./chunk-PWMWOJP4.ts";
|
|
17
16
|
import "./chunk-QOFMXPM5.ts";
|
|
18
17
|
import "./chunk-ZW5ZLGBI.ts";
|
|
18
|
+
import "./chunk-2JZFHNLM.ts";
|
|
19
|
+
import "./chunk-T2SJD3N7.ts";
|
|
19
20
|
import "./chunk-HUZ5CR4W.ts";
|
|
20
21
|
export {
|
|
21
22
|
dispatchManagerResult
|
|
22
23
|
};
|
|
23
|
-
//# sourceMappingURL=manager-result-dispatcher-
|
|
24
|
+
//# sourceMappingURL=manager-result-dispatcher-AGBBVDDS.ts.map
|