@narumitw/pi-sync 0.63.1 → 0.64.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/CHANGELOG.md +11 -0
- package/README.md +12 -5
- package/dist/chunks/{chunk-HLCML3OW.ts → chunk-4VKWHVUO.ts} +4 -3
- package/dist/chunks/chunk-4VKWHVUO.ts.map +7 -0
- package/dist/chunks/{chunk-27F5W7DX.ts → chunk-DAZZ5BEJ.ts} +3 -1
- package/dist/chunks/chunk-DAZZ5BEJ.ts.map +7 -0
- package/dist/chunks/{chunk-V76KCWHO.ts → chunk-F3VODLVQ.ts} +3 -3
- package/dist/chunks/{chunk-VQ47JBLF.ts → chunk-FI2F5JBS.ts} +2 -2
- package/dist/chunks/{chunk-LBNC5AOM.ts → chunk-NDEZ52SS.ts} +12 -12
- package/dist/chunks/{chunk-B5F3JLD3.ts → chunk-RW44KNFD.ts} +304 -70
- package/dist/chunks/chunk-RW44KNFD.ts.map +7 -0
- package/dist/chunks/{chunk-EXDWEFIJ.ts → chunk-TJ7YNITN.ts} +5 -5
- package/dist/chunks/{chunk-HSCAFOT5.ts → chunk-TZMVSTAM.ts} +5 -5
- package/dist/chunks/{chunk-SXCH4Q5O.ts → chunk-VPSC7BXM.ts} +3 -3
- package/dist/chunks/{chunk-POWOMJ7S.ts → chunk-YT6PDRMM.ts} +58 -31
- package/dist/chunks/chunk-YT6PDRMM.ts.map +7 -0
- package/dist/chunks/{command-handler-GMRRFWOL.ts → command-handler-N45GY7AV.ts} +39 -27
- package/dist/chunks/command-handler-N45GY7AV.ts.map +7 -0
- package/dist/chunks/{conflict-review-JWEA7DPQ.ts → conflict-review-5E4M44BA.ts} +2 -2
- package/dist/chunks/{file-selection-KID23GAD.ts → file-selection-DDQN4LVD.ts} +9 -9
- package/dist/chunks/{manager-result-dispatcher-GDB74IOP.ts → manager-result-dispatcher-FKW55L7I.ts} +5 -5
- package/dist/chunks/{manager-ui-T5J5WG7T.ts → manager-ui-EV23DPZQ.ts} +75 -57
- package/dist/chunks/manager-ui-EV23DPZQ.ts.map +7 -0
- package/dist/chunks/{merge-review-OQDXNTJU.ts → merge-review-6YSLSMGS.ts} +3 -2
- package/dist/chunks/ownership-recovery-UDDHSDSZ.ts +59 -0
- package/dist/chunks/ownership-recovery-UDDHSDSZ.ts.map +7 -0
- package/dist/chunks/{remote-selection-ui-GPITNEBF.ts → remote-selection-ui-N4NMWFT2.ts} +4 -4
- package/dist/chunks/{setup-switch-L54X5U5I.ts → setup-switch-HY7K3442.ts} +4 -4
- package/dist/chunks/{setup-wizard-LL6YMGUR.ts → setup-wizard-LEKDQ3HK.ts} +9 -9
- package/dist/chunks/{sync-inspection-SRU6HGGK.ts → sync-inspection-OS2LVOLV.ts} +5 -5
- package/dist/chunks/{sync-operations-UGSCONZ7.ts → sync-operations-D3MDJUQQ.ts} +2 -2
- package/dist/daemon/dist/cli.js +2 -0
- package/dist/daemon/dist/client-transport.js +66 -0
- package/dist/daemon/dist/client.js +116 -86
- package/dist/daemon/dist/consent.js +33 -11
- package/dist/daemon/dist/daemon-debug.js +33 -0
- package/dist/daemon/dist/daemon-recovery.js +75 -0
- package/dist/daemon/dist/engine/backends/git/git-backend.js +39 -12
- package/dist/daemon/dist/engine/backends/git/git-runner.js +6 -1
- package/dist/daemon/dist/engine/backends/git/git-storage.js +5 -9
- package/dist/daemon/dist/engine/backends/publication-encoding.js +19 -0
- package/dist/daemon/dist/engine/backends/s3/s3-backend.js +10 -12
- package/dist/daemon/dist/engine/backends/webdav/webdav-backend.js +15 -26
- package/dist/daemon/dist/engine/backends/webdav/webdav-client.js +10 -0
- package/dist/daemon/dist/engine/debug-log.js +134 -0
- package/dist/daemon/dist/engine/paths.js +7 -1
- package/dist/daemon/dist/engine/settings/config-file.js +62 -17
- package/dist/daemon/dist/engine/settings/config.js +49 -14
- package/dist/daemon/dist/engine/snapshot/snapshot-apply.js +30 -8
- package/dist/daemon/dist/engine/snapshot/snapshot-codec.js +3 -1
- package/dist/daemon/dist/engine/snapshot/snapshot-payload.js +32 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-transaction-images.js +34 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-transaction.js +50 -7
- package/dist/daemon/dist/engine/snapshot/snapshot.js +64 -25
- package/dist/daemon/dist/engine/state/lock.js +157 -17
- package/dist/daemon/dist/engine/sync/continuous-sync.js +35 -11
- package/dist/daemon/dist/engine/sync/initialization.js +2 -2
- package/dist/daemon/dist/engine/sync/local-fields.js +42 -19
- package/dist/daemon/dist/engine/sync/merged-sync.js +13 -10
- package/dist/daemon/dist/engine/sync/remote-snapshot.js +18 -3
- package/dist/daemon/dist/engine/sync/session-push.js +13 -4
- package/dist/daemon/dist/engine/sync/startup-bootstrap.js +105 -0
- package/dist/daemon/dist/engine/sync/startup-recovery-evidence.js +37 -0
- package/dist/daemon/dist/engine/sync/startup-timings.js +80 -8
- package/dist/daemon/dist/engine/sync/sync-error-guidance.js +6 -1
- package/dist/daemon/dist/engine/sync/sync-inspection.js +4 -7
- package/dist/daemon/dist/engine/sync/sync-local.js +3 -1
- package/dist/daemon/dist/engine/sync/sync-mutations.js +9 -3
- package/dist/daemon/dist/engine/sync/sync-policy.js +9 -1
- package/dist/daemon/dist/engine/sync/sync-state.js +12 -4
- package/dist/daemon/dist/engine-service.js +54 -10
- package/dist/daemon/dist/identity.js +36 -6
- package/dist/daemon/dist/index.js +2 -1
- package/dist/daemon/dist/monitor.js +20 -1
- package/dist/daemon/dist/paged-review.js +177 -0
- package/dist/daemon/dist/participant-ledger.js +149 -0
- package/dist/daemon/dist/protocol.js +4 -0
- package/dist/daemon/dist/server.js +268 -120
- package/dist/daemon/dist/service-host.js +29 -9
- package/dist/daemon/dist/state-wait-jobs.js +23 -0
- package/dist/daemon/dist/state-wait.js +34 -0
- package/dist/daemon/package.json +1 -1
- package/dist/index.ts +128 -48
- package/dist/index.ts.map +2 -2
- package/docs/continuous-sync-verification.md +2 -0
- package/docs/daemon-migration.md +30 -2
- package/docs/tui-contract.md +7 -1
- package/package.json +2 -2
- package/skills/configure-pi-sync/references/configuration.md +23 -13
- package/src/commands/command-execution.ts +11 -3
- package/src/commands/command-handler.ts +10 -3
- package/src/commands/command.ts +3 -2
- package/src/daemon/client-debug.ts +45 -0
- package/src/daemon/ownership-recovery.ts +50 -0
- package/src/daemon/pi-client.ts +288 -63
- package/src/daemon/startup-bootstrap-client.ts +26 -0
- package/src/settings/config.ts +1 -0
- package/src/sync/automatic-sync.ts +61 -18
- package/src/sync/startup-check.ts +13 -5
- package/src/sync-extension.ts +46 -8
- package/src/ui/manager-state.ts +29 -21
- package/src/ui/manager-ui.ts +16 -1
- package/src/ui/merge-review.ts +52 -16
- package/src/ui/settings-ui.ts +2 -2
- package/src/ui/sync-confirmation.ts +16 -19
- package/src/ui/sync-setups-ui.ts +15 -12
- package/dist/chunks/chunk-27F5W7DX.ts.map +0 -7
- package/dist/chunks/chunk-B5F3JLD3.ts.map +0 -7
- package/dist/chunks/chunk-HLCML3OW.ts.map +0 -7
- package/dist/chunks/chunk-POWOMJ7S.ts.map +0 -7
- package/dist/chunks/command-handler-GMRRFWOL.ts.map +0 -7
- package/dist/chunks/manager-ui-T5J5WG7T.ts.map +0 -7
- /package/dist/chunks/{chunk-V76KCWHO.ts.map → chunk-F3VODLVQ.ts.map} +0 -0
- /package/dist/chunks/{chunk-VQ47JBLF.ts.map → chunk-FI2F5JBS.ts.map} +0 -0
- /package/dist/chunks/{chunk-LBNC5AOM.ts.map → chunk-NDEZ52SS.ts.map} +0 -0
- /package/dist/chunks/{chunk-EXDWEFIJ.ts.map → chunk-TJ7YNITN.ts.map} +0 -0
- /package/dist/chunks/{chunk-HSCAFOT5.ts.map → chunk-TZMVSTAM.ts.map} +0 -0
- /package/dist/chunks/{chunk-SXCH4Q5O.ts.map → chunk-VPSC7BXM.ts.map} +0 -0
- /package/dist/chunks/{conflict-review-JWEA7DPQ.ts.map → conflict-review-5E4M44BA.ts.map} +0 -0
- /package/dist/chunks/{file-selection-KID23GAD.ts.map → file-selection-DDQN4LVD.ts.map} +0 -0
- /package/dist/chunks/{manager-result-dispatcher-GDB74IOP.ts.map → manager-result-dispatcher-FKW55L7I.ts.map} +0 -0
- /package/dist/chunks/{merge-review-OQDXNTJU.ts.map → merge-review-6YSLSMGS.ts.map} +0 -0
- /package/dist/chunks/{remote-selection-ui-GPITNEBF.ts.map → remote-selection-ui-N4NMWFT2.ts.map} +0 -0
- /package/dist/chunks/{setup-switch-L54X5U5I.ts.map → setup-switch-HY7K3442.ts.map} +0 -0
- /package/dist/chunks/{setup-wizard-LL6YMGUR.ts.map → setup-wizard-LEKDQ3HK.ts.map} +0 -0
- /package/dist/chunks/{sync-inspection-SRU6HGGK.ts.map → sync-inspection-OS2LVOLV.ts.map} +0 -0
- /package/dist/chunks/{sync-operations-UGSCONZ7.ts.map → sync-operations-D3MDJUQQ.ts.map} +0 -0
|
@@ -20,17 +20,18 @@ import {
|
|
|
20
20
|
showEditWebDavStorageProfile,
|
|
21
21
|
showEditWebDavTarget,
|
|
22
22
|
showIgnoreFileAction
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-NDEZ52SS.ts";
|
|
24
24
|
import {
|
|
25
25
|
dispatchManagerResult
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-F3VODLVQ.ts";
|
|
27
|
+
import "./chunk-TJ7YNITN.ts";
|
|
27
28
|
import {
|
|
28
29
|
SETUP_SWITCH_ACTION_OPTIONS,
|
|
29
30
|
saveOnSwitch,
|
|
30
31
|
setupSwitchActionFromLabel,
|
|
31
32
|
setupSwitchActionLabel,
|
|
32
33
|
useSyncSetup
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-VPSC7BXM.ts";
|
|
34
35
|
import {
|
|
35
36
|
isCloudflareR2Endpoint,
|
|
36
37
|
normalizeS3Endpoint,
|
|
@@ -55,42 +56,29 @@ import {
|
|
|
55
56
|
readStateForConfig,
|
|
56
57
|
syncAttentionMatchesConfig,
|
|
57
58
|
syncStateFingerprint
|
|
58
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-FI2F5JBS.ts";
|
|
60
|
+
import {
|
|
61
|
+
throwIfAborted
|
|
62
|
+
} from "./chunk-UMPA5S7X.ts";
|
|
59
63
|
import {
|
|
60
64
|
AUTOMATIC_SYNC_DESCRIPTION,
|
|
61
65
|
STARTUP_TRANSFER_DESCRIPTION,
|
|
62
66
|
startupTransferSummary
|
|
63
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-4VKWHVUO.ts";
|
|
64
68
|
import {
|
|
65
69
|
confirmMergeReview
|
|
66
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-YT6PDRMM.ts";
|
|
71
|
+
import {
|
|
72
|
+
runCancellableOperation
|
|
73
|
+
} from "./chunk-CKUGCBHP.ts";
|
|
67
74
|
import {
|
|
68
75
|
directoryScopeSummary,
|
|
69
76
|
showExcludedPaths
|
|
70
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-TZMVSTAM.ts";
|
|
71
78
|
import {
|
|
72
79
|
directorySessionOptInLine,
|
|
73
80
|
saveReviewedDraft
|
|
74
81
|
} from "./chunk-JREGWM2B.ts";
|
|
75
|
-
import {
|
|
76
|
-
manualIgnoreFileGuidance
|
|
77
|
-
} from "./chunk-EJDDRS6O.ts";
|
|
78
|
-
import {
|
|
79
|
-
activeLocalConfigPath,
|
|
80
|
-
localConfigPath,
|
|
81
|
-
readActiveLocalConfigDocumentForRepair,
|
|
82
|
-
syncErrorGuidance
|
|
83
|
-
} from "./chunk-IBXEM35O.ts";
|
|
84
|
-
import {
|
|
85
|
-
piDaemonClient
|
|
86
|
-
} from "./chunk-B5F3JLD3.ts";
|
|
87
|
-
import "./chunk-EXDWEFIJ.ts";
|
|
88
|
-
import {
|
|
89
|
-
runCancellableOperation
|
|
90
|
-
} from "./chunk-CKUGCBHP.ts";
|
|
91
|
-
import {
|
|
92
|
-
throwIfAborted
|
|
93
|
-
} from "./chunk-UMPA5S7X.ts";
|
|
94
82
|
import {
|
|
95
83
|
addStorageConnection,
|
|
96
84
|
removeStorageConnection,
|
|
@@ -101,18 +89,30 @@ import {
|
|
|
101
89
|
import {
|
|
102
90
|
captureMutationOwner
|
|
103
91
|
} from "./chunk-GELYN4UC.ts";
|
|
92
|
+
import {
|
|
93
|
+
manualIgnoreFileGuidance
|
|
94
|
+
} from "./chunk-EJDDRS6O.ts";
|
|
95
|
+
import {
|
|
96
|
+
localConfigPath,
|
|
97
|
+
readActiveLocalConfigDocumentForRepair,
|
|
98
|
+
syncErrorGuidance
|
|
99
|
+
} from "./chunk-IBXEM35O.ts";
|
|
104
100
|
import {
|
|
105
101
|
sameSyncExclude
|
|
106
102
|
} from "./chunk-ZO52JM4H.ts";
|
|
107
103
|
import {
|
|
108
104
|
configFromSettings,
|
|
105
|
+
createSettingsConfigView,
|
|
109
106
|
loadConfig,
|
|
110
107
|
loadConfigForCheck,
|
|
111
108
|
loadPartialConfig,
|
|
112
109
|
loadSettingsConfig,
|
|
113
110
|
syncCheckConfigFingerprint,
|
|
114
111
|
syncConfigReviewIdentity
|
|
115
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-DAZZ5BEJ.ts";
|
|
113
|
+
import {
|
|
114
|
+
piDaemonClient
|
|
115
|
+
} from "./chunk-RW44KNFD.ts";
|
|
116
116
|
import {
|
|
117
117
|
configureSyncStatus
|
|
118
118
|
} from "./chunk-H7VOTY5N.ts";
|
|
@@ -221,7 +221,7 @@ function blockedSyncMenuItem(label, manager) {
|
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
223
|
async function showManagerAttention(ctx, attention, runRoute, signal, onSelectionResolved) {
|
|
224
|
-
const { showRemoteSelectionReview } = await import("./remote-selection-ui-
|
|
224
|
+
const { showRemoteSelectionReview } = await import("./remote-selection-ui-N4NMWFT2.ts");
|
|
225
225
|
if (signal?.aborted) return "close";
|
|
226
226
|
const review = await showRemoteSelectionReview(ctx, attention.decision.setupName, signal, void 0, {
|
|
227
227
|
decision: attention.decision,
|
|
@@ -309,20 +309,20 @@ function ignoreSetupRecovery(settingsPath) {
|
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
// src/ui/sync-setups-ui.ts
|
|
312
|
-
async function
|
|
313
|
-
|
|
314
|
-
|
|
312
|
+
async function hasAnotherSwitchableSetup(view, signal) {
|
|
313
|
+
for (const name of view.setupNames) {
|
|
314
|
+
if (name === view.activeSetupName) continue;
|
|
315
315
|
throwIfAborted(signal);
|
|
316
|
-
let valid = false;
|
|
317
316
|
try {
|
|
318
|
-
await
|
|
319
|
-
valid = true;
|
|
317
|
+
await view.observe(name, signal);
|
|
320
318
|
} catch {
|
|
319
|
+
throwIfAborted(signal);
|
|
320
|
+
continue;
|
|
321
321
|
}
|
|
322
322
|
throwIfAborted(signal);
|
|
323
|
-
|
|
323
|
+
return true;
|
|
324
324
|
}
|
|
325
|
-
return
|
|
325
|
+
return false;
|
|
326
326
|
}
|
|
327
327
|
async function showSyncSetups(ctx, actions, signal) {
|
|
328
328
|
const validateOwner = captureMutationOwner(ctx, signal);
|
|
@@ -549,34 +549,35 @@ var MAIN_MENU_ACTIONS = [
|
|
|
549
549
|
"Diagnostics"
|
|
550
550
|
];
|
|
551
551
|
async function describeManagerState(signal, attention, inspectOperation = inspectOperationAvailability, observation, canUseIgnoreSettings) {
|
|
552
|
-
|
|
552
|
+
signal?.throwIfAborted();
|
|
553
|
+
let document;
|
|
554
|
+
let view;
|
|
553
555
|
try {
|
|
554
|
-
|
|
556
|
+
document = await readActiveLocalConfigDocumentForRepair();
|
|
555
557
|
signal?.throwIfAborted();
|
|
556
|
-
if (document)
|
|
558
|
+
if (document) view = createSettingsConfigView(document);
|
|
557
559
|
} catch (error) {
|
|
558
|
-
|
|
560
|
+
signal?.throwIfAborted();
|
|
559
561
|
return {
|
|
560
562
|
title: [
|
|
561
563
|
"Manage sync",
|
|
562
564
|
"",
|
|
563
565
|
"Settings file needs repair. Automatic sync and settings writes are paused.",
|
|
564
566
|
`Error: ${safeTerminalText(errorMessage(error))}`,
|
|
565
|
-
`File: ${safeTerminalText(
|
|
567
|
+
...document ? [`File: ${safeTerminalText(document.path)}`] : [],
|
|
566
568
|
"",
|
|
567
569
|
"Repair the JSON file, then reopen /sync."
|
|
568
570
|
].join("\n"),
|
|
569
571
|
actions: ["Help"]
|
|
570
572
|
};
|
|
571
573
|
}
|
|
572
|
-
if (!
|
|
574
|
+
if (!view || !document) {
|
|
573
575
|
return {
|
|
574
576
|
title: ["Manage sync", "", "Not set up.", "", "What do you want to do?"].join("\n"),
|
|
575
577
|
actions: ["Set up sync", "Help"]
|
|
576
578
|
};
|
|
577
579
|
}
|
|
578
|
-
|
|
579
|
-
if (Object.keys(configuredTargets).length === 0) {
|
|
580
|
+
if (view.setupNames.length === 0) {
|
|
580
581
|
return {
|
|
581
582
|
title: [
|
|
582
583
|
"Manage sync",
|
|
@@ -591,33 +592,38 @@ async function describeManagerState(signal, attention, inspectOperation = inspec
|
|
|
591
592
|
}
|
|
592
593
|
let settingsConfig;
|
|
593
594
|
try {
|
|
594
|
-
settingsConfig =
|
|
595
|
+
settingsConfig = view.metadata();
|
|
595
596
|
if (settingsConfig.reservedIgnoreNames && canUseIgnoreSettings && !await canUseIgnoreSettings()) {
|
|
596
597
|
throw new Error("the connected daemon does not support ignore-file setups");
|
|
597
598
|
}
|
|
598
599
|
signal?.throwIfAborted();
|
|
599
|
-
const config = await
|
|
600
|
+
const config = await view.observe(void 0, signal);
|
|
600
601
|
signal?.throwIfAborted();
|
|
601
602
|
const operation = await inspectOperation();
|
|
603
|
+
signal?.throwIfAborted();
|
|
602
604
|
const changesBlocked = operationBlocksChanges(operation);
|
|
603
605
|
let currentAttention;
|
|
606
|
+
let alternateUsable = false;
|
|
604
607
|
if (attention) {
|
|
605
608
|
try {
|
|
606
|
-
const attentionConfig = attention.decision.setupName === config.setupName ? config : await
|
|
609
|
+
const attentionConfig = attention.decision.setupName === config.setupName ? config : await view.observe(attention.decision.setupName, signal);
|
|
610
|
+
alternateUsable = attentionConfig.setupName !== config.setupName;
|
|
607
611
|
if (syncAttentionMatchesConfig(attention, attentionConfig)) currentAttention = attention;
|
|
608
612
|
} catch {
|
|
609
613
|
currentAttention = void 0;
|
|
610
614
|
}
|
|
611
|
-
|
|
615
|
+
signal?.throwIfAborted();
|
|
612
616
|
}
|
|
613
617
|
const attentionComparison = currentAttention ? compareSyncInclude(currentAttention.decision.localInclude, currentAttention.decision.remoteInclude) : void 0;
|
|
614
618
|
const attentionExclusionsDiffer = currentAttention ? !sameSyncExclude(currentAttention.decision.localExclude, currentAttention.decision.remoteExclude) : false;
|
|
615
619
|
const attentionDirectoryPolicy = currentAttention?.decision.localDirectory || currentAttention?.decision.remoteDirectory;
|
|
616
620
|
const noSyncedContent = !syncSelectionHasContent(config);
|
|
617
621
|
const syncState = changesBlocked ? void 0 : await readStateForConfig(config).catch(() => void 0);
|
|
622
|
+
signal?.throwIfAborted();
|
|
618
623
|
const currentObservation = observation && observationMatchesConfig(observation, config) && syncState && syncStateFingerprint(syncState) === observation.inspection.stateIdentity ? observation : void 0;
|
|
619
624
|
const lastAppliedSnapshot = changesBlocked ? "Unavailable while operations are locked" : syncState?.lastAppliedSnapshot ? `${truncateToWidth(safeTerminalText(syncState.lastAppliedSnapshot), 12, "\u2026")} \xB7 application time unavailable` : syncState ? "Never synced" : "Unavailable";
|
|
620
|
-
const canSwitch = await
|
|
625
|
+
const canSwitch = !changesBlocked && (alternateUsable || await hasAnotherSwitchableSetup(view, signal));
|
|
626
|
+
signal?.throwIfAborted();
|
|
621
627
|
const mainActions = [...MAIN_MENU_ACTIONS];
|
|
622
628
|
if (config.agentMode && !noSyncedContent) mainActions.splice(1, 0, "Retry refused model result\u2026");
|
|
623
629
|
if (canSwitch) mainActions.push("Switch sync setup");
|
|
@@ -653,7 +659,7 @@ async function describeManagerState(signal, attention, inspectOperation = inspec
|
|
|
653
659
|
} : {}
|
|
654
660
|
};
|
|
655
661
|
} catch (error) {
|
|
656
|
-
|
|
662
|
+
signal?.throwIfAborted();
|
|
657
663
|
if (settingsConfig?.reservedIgnoreNames !== void 0) {
|
|
658
664
|
return {
|
|
659
665
|
title: [
|
|
@@ -673,9 +679,9 @@ async function describeManagerState(signal, attention, inspectOperation = inspec
|
|
|
673
679
|
"Manage sync",
|
|
674
680
|
"",
|
|
675
681
|
"Settings need attention. Automatic sync is paused.",
|
|
676
|
-
`Current sync setup: ${safeTerminalText(
|
|
682
|
+
`Current sync setup: ${safeTerminalText(view.activeSetupName ?? "none")}`,
|
|
677
683
|
`Error: ${safeTerminalText(errorMessage(error))}`,
|
|
678
|
-
`File: ${safeTerminalText(
|
|
684
|
+
`File: ${safeTerminalText(document.path)}`,
|
|
679
685
|
"",
|
|
680
686
|
"What do you want to do?"
|
|
681
687
|
].join("\n"),
|
|
@@ -1715,8 +1721,8 @@ async function showSyncSettings(ctx, runRoute, signal, reviewedSetup) {
|
|
|
1715
1721
|
},
|
|
1716
1722
|
{
|
|
1717
1723
|
id: "debug",
|
|
1718
|
-
label: "Debug
|
|
1719
|
-
description: "
|
|
1724
|
+
label: "Debug mode",
|
|
1725
|
+
description: "Write startup timings and sync events to the local pi-sync.log. Pi applies this at the next session start; the daemon applies it at its next settings check.",
|
|
1720
1726
|
currentValue: state.debug ? "On" : "Off",
|
|
1721
1727
|
values: ["On", "Off"],
|
|
1722
1728
|
action: "debug"
|
|
@@ -2042,7 +2048,7 @@ async function showSyncSettings(ctx, runRoute, signal, reviewedSetup) {
|
|
|
2042
2048
|
"remote-include": async ({ state, signal: actionSignal }) => {
|
|
2043
2049
|
if (state.reservedIgnoreNames !== void 0 && !ignoreAvailable) return { kind: "rejected" };
|
|
2044
2050
|
const reviewSignal = signal ? AbortSignal.any([signal, actionSignal]) : actionSignal;
|
|
2045
|
-
const { showRemoteSelectionReview } = await import("./remote-selection-ui-
|
|
2051
|
+
const { showRemoteSelectionReview } = await import("./remote-selection-ui-N4NMWFT2.ts");
|
|
2046
2052
|
if (reviewSignal.aborted) return { kind: "rejected" };
|
|
2047
2053
|
const review = await showRemoteSelectionReview(ctx, setupName, reviewSignal, void 0, {
|
|
2048
2054
|
origin: "settings",
|
|
@@ -2178,7 +2184,7 @@ async function showSyncManager(ctx, runRoute, sessionSignal, options = {}) {
|
|
|
2178
2184
|
if (!attention) {
|
|
2179
2185
|
const observation = state.manager.observation;
|
|
2180
2186
|
if (!observation) return { kind: "stay" };
|
|
2181
|
-
const { showRemoteSelectionReview } = await import("./remote-selection-ui-
|
|
2187
|
+
const { showRemoteSelectionReview } = await import("./remote-selection-ui-N4NMWFT2.ts");
|
|
2182
2188
|
if (sessionSignal?.aborted) return { kind: "close" };
|
|
2183
2189
|
const config = await loadConfig();
|
|
2184
2190
|
if (sessionSignal?.aborted) return { kind: "close" };
|
|
@@ -2357,6 +2363,10 @@ S3/R2 reads the latest pointer without writing. Git reads remote snapshots and c
|
|
|
2357
2363
|
});
|
|
2358
2364
|
return { kind: result.kind === "closed" ? "close" : "stay" };
|
|
2359
2365
|
},
|
|
2366
|
+
"daemon-recovery": async ({ signal }) => {
|
|
2367
|
+
await runRoute("daemon recover", signal);
|
|
2368
|
+
return { kind: "stay" };
|
|
2369
|
+
},
|
|
2360
2370
|
recover: async ({ state, signal: actionSignal }) => {
|
|
2361
2371
|
const result = await recoverSyncAccess(ctx, state.manager, runRoute, sessionSignal, actionSignal);
|
|
2362
2372
|
return { kind: result === "close" ? "close" : "stay" };
|
|
@@ -2434,7 +2444,12 @@ S3/R2 reads the latest pointer without writing. Git reads remote snapshots and c
|
|
|
2434
2444
|
}
|
|
2435
2445
|
};
|
|
2436
2446
|
let firstOpen = true;
|
|
2447
|
+
const recovery = {
|
|
2448
|
+
title: "Pi Sync recovery required\nDaemon cleanup could not be confirmed. Stop the daemon before retrying a transfer.",
|
|
2449
|
+
actions: ["Stop daemon for recovery\u2026", "Help"]
|
|
2450
|
+
};
|
|
2437
2451
|
const describe = async (signal) => {
|
|
2452
|
+
if (options.needsDaemonRecovery?.()) return recovery;
|
|
2438
2453
|
const pendingAttention = options.getAttention?.();
|
|
2439
2454
|
const observation = options.getObservation?.();
|
|
2440
2455
|
const manager = await describeManagerState(
|
|
@@ -2445,6 +2460,7 @@ S3/R2 reads the latest pointer without writing. Git reads remote snapshots and c
|
|
|
2445
2460
|
() => ignoreFileSettingsAvailable(ctx, signal)
|
|
2446
2461
|
);
|
|
2447
2462
|
if (signal.aborted || !isCurrent()) return manager;
|
|
2463
|
+
if (options.needsDaemonRecovery?.()) return recovery;
|
|
2448
2464
|
if (observation && options.getObservation?.() === observation && !manager.observation && !(manager.operation && operationBlocksChanges(manager.operation))) {
|
|
2449
2465
|
options.onObservationInvalidated?.();
|
|
2450
2466
|
}
|
|
@@ -2481,6 +2497,7 @@ function syncMainMenuItem(label) {
|
|
|
2481
2497
|
Diagnostics: "doctor",
|
|
2482
2498
|
"Review unresolved conflicts": "conflicts",
|
|
2483
2499
|
"Restore sync access\u2026 (recommended)": "recover",
|
|
2500
|
+
"Stop daemon for recovery\u2026": "daemon-recovery",
|
|
2484
2501
|
"Refresh operation status": "refresh",
|
|
2485
2502
|
"Sync setups\u2026": "setups",
|
|
2486
2503
|
"Storage connections\u2026": "connections",
|
|
@@ -2507,6 +2524,7 @@ function syncMainMenuItem(label) {
|
|
|
2507
2524
|
switch: "Choose another sync setup.",
|
|
2508
2525
|
conflicts: "Review unresolved file groups.",
|
|
2509
2526
|
recover: "Review local lock recovery.",
|
|
2527
|
+
"daemon-recovery": "Review and stop the current daemon without starting another.",
|
|
2510
2528
|
refresh: "Recheck the operation lock.",
|
|
2511
2529
|
setups: "Manage sync setups.",
|
|
2512
2530
|
connections: "Manage storage connections.",
|
|
@@ -2518,4 +2536,4 @@ function syncMainMenuItem(label) {
|
|
|
2518
2536
|
export {
|
|
2519
2537
|
showSyncManager
|
|
2520
2538
|
};
|
|
2521
|
-
//# sourceMappingURL=manager-ui-
|
|
2539
|
+
//# sourceMappingURL=manager-ui-EV23DPZQ.ts.map
|