@narumitw/pi-sync 0.67.0 → 0.67.1

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.
Files changed (76) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/chunks/{chunk-BYVHABNR.ts → chunk-2MUAR5GH.ts} +2 -2
  4. package/dist/chunks/{chunk-5YOLQKNZ.ts → chunk-3CO7QIYB.ts} +14 -14
  5. package/dist/chunks/{chunk-DAZZ5BEJ.ts → chunk-3NS4PMCI.ts} +6 -2
  6. package/dist/chunks/{chunk-FI2F5JBS.ts → chunk-3Q3DMMID.ts} +8 -8
  7. package/dist/chunks/{chunk-BESRBKVO.ts → chunk-CQXGMESM.ts} +7 -7
  8. package/dist/chunks/{chunk-SZJOUVCL.ts → chunk-DGVZYS7T.ts} +5 -5
  9. package/dist/chunks/{chunk-WJQ4TGN5.ts → chunk-ECUCXF5Y.ts} +2 -2
  10. package/dist/chunks/{chunk-Z5JMOXJM.ts → chunk-JNTDIVP6.ts} +5 -5
  11. package/dist/chunks/{chunk-AYGMIMCV.ts → chunk-PUSMSKIM.ts} +11 -2
  12. package/dist/chunks/chunk-PUSMSKIM.ts.map +7 -0
  13. package/dist/chunks/{chunk-ASU3GZPW.ts → chunk-W7DSN33J.ts} +6 -6
  14. package/dist/chunks/{chunk-JQ5BAWW2.ts → chunk-XPKHWTGT.ts} +77 -16
  15. package/dist/chunks/chunk-XPKHWTGT.ts.map +7 -0
  16. package/dist/chunks/{command-handler-SQC2L2FJ.ts → command-handler-H5X3BX5D.ts} +40 -32
  17. package/dist/chunks/command-handler-H5X3BX5D.ts.map +7 -0
  18. package/dist/chunks/config-P54GGMXY.ts +39 -0
  19. package/dist/chunks/{conflict-review-J7L7S4AR.ts → conflict-review-SSY37F4P.ts} +2 -2
  20. package/dist/chunks/{file-selection-XWACUTAH.ts → file-selection-GASCVN45.ts} +6 -6
  21. package/dist/chunks/{ignore-file-ui-OHFISFVC.ts → ignore-file-ui-UY2TEK4C.ts} +5 -5
  22. package/dist/chunks/{manager-result-dispatcher-WXE2BAQO.ts → manager-result-dispatcher-PEVIGLOS.ts} +7 -7
  23. package/dist/chunks/{manager-ui-DWOMAJKE.ts → manager-ui-R5XHYRXK.ts} +50 -32
  24. package/dist/chunks/manager-ui-R5XHYRXK.ts.map +7 -0
  25. package/dist/chunks/{merge-review-AAC674C6.ts → merge-review-C2KETZKY.ts} +3 -3
  26. package/dist/chunks/{remote-selection-ui-E4XZCQ7A.ts → remote-selection-ui-WFLX6MAJ.ts} +6 -6
  27. package/dist/chunks/{setup-switch-644T6KHG.ts → setup-switch-JZDFQPVW.ts} +4 -4
  28. package/dist/chunks/setup-switch-JZDFQPVW.ts.map +7 -0
  29. package/dist/chunks/{setup-wizard-IEW56AZE.ts → setup-wizard-5OMFSFPJ.ts} +9 -9
  30. package/dist/chunks/{sync-inspection-NBBTSMKR.ts → sync-inspection-S2GHDBAD.ts} +5 -5
  31. package/dist/chunks/{sync-operations-AIEM2KL2.ts → sync-operations-LQ63CU2T.ts} +2 -2
  32. package/dist/daemon/dist/client.js +32 -18
  33. package/dist/daemon/dist/daemon-recovery.js +5 -3
  34. package/dist/daemon/dist/engine/ignore/adoption-journal.js +6 -3
  35. package/dist/daemon/dist/engine/sync/ignore-adoption.js +8 -2
  36. package/dist/daemon/dist/engine/sync/sync-mutations.js +4 -1
  37. package/dist/daemon/dist/engine-service.js +22 -6
  38. package/dist/daemon/dist/foreground-queue-outcome.js +4 -0
  39. package/dist/daemon/dist/server.js +2 -1
  40. package/dist/daemon/dist/service-host.js +7 -2
  41. package/dist/daemon/package.json +1 -1
  42. package/dist/index.ts +41 -32
  43. package/dist/index.ts.map +2 -2
  44. package/docs/daemon-migration.md +2 -0
  45. package/package.json +2 -2
  46. package/src/commands/command-execution.ts +10 -1
  47. package/src/commands/command-handler.ts +4 -0
  48. package/src/daemon/directional-recovery.ts +35 -5
  49. package/src/daemon/pi-client.ts +82 -12
  50. package/src/sync-extension.ts +17 -9
  51. package/src/ui/cancellable-operation.ts +13 -2
  52. package/src/ui/manager-state.ts +1 -0
  53. package/src/ui/manager-ui.ts +25 -4
  54. package/dist/chunks/chunk-AYGMIMCV.ts.map +0 -7
  55. package/dist/chunks/chunk-JQ5BAWW2.ts.map +0 -7
  56. package/dist/chunks/command-handler-SQC2L2FJ.ts.map +0 -7
  57. package/dist/chunks/manager-ui-DWOMAJKE.ts.map +0 -7
  58. /package/dist/chunks/{chunk-BYVHABNR.ts.map → chunk-2MUAR5GH.ts.map} +0 -0
  59. /package/dist/chunks/{chunk-5YOLQKNZ.ts.map → chunk-3CO7QIYB.ts.map} +0 -0
  60. /package/dist/chunks/{chunk-DAZZ5BEJ.ts.map → chunk-3NS4PMCI.ts.map} +0 -0
  61. /package/dist/chunks/{chunk-FI2F5JBS.ts.map → chunk-3Q3DMMID.ts.map} +0 -0
  62. /package/dist/chunks/{chunk-BESRBKVO.ts.map → chunk-CQXGMESM.ts.map} +0 -0
  63. /package/dist/chunks/{chunk-SZJOUVCL.ts.map → chunk-DGVZYS7T.ts.map} +0 -0
  64. /package/dist/chunks/{chunk-WJQ4TGN5.ts.map → chunk-ECUCXF5Y.ts.map} +0 -0
  65. /package/dist/chunks/{chunk-Z5JMOXJM.ts.map → chunk-JNTDIVP6.ts.map} +0 -0
  66. /package/dist/chunks/{chunk-ASU3GZPW.ts.map → chunk-W7DSN33J.ts.map} +0 -0
  67. /package/dist/chunks/{ignore-file-ui-OHFISFVC.ts.map → config-P54GGMXY.ts.map} +0 -0
  68. /package/dist/chunks/{conflict-review-J7L7S4AR.ts.map → conflict-review-SSY37F4P.ts.map} +0 -0
  69. /package/dist/chunks/{file-selection-XWACUTAH.ts.map → file-selection-GASCVN45.ts.map} +0 -0
  70. /package/dist/chunks/{manager-result-dispatcher-WXE2BAQO.ts.map → ignore-file-ui-UY2TEK4C.ts.map} +0 -0
  71. /package/dist/chunks/{merge-review-AAC674C6.ts.map → manager-result-dispatcher-PEVIGLOS.ts.map} +0 -0
  72. /package/dist/chunks/{remote-selection-ui-E4XZCQ7A.ts.map → merge-review-C2KETZKY.ts.map} +0 -0
  73. /package/dist/chunks/{setup-switch-644T6KHG.ts.map → remote-selection-ui-WFLX6MAJ.ts.map} +0 -0
  74. /package/dist/chunks/{setup-wizard-IEW56AZE.ts.map → setup-wizard-5OMFSFPJ.ts.map} +0 -0
  75. /package/dist/chunks/{sync-inspection-NBBTSMKR.ts.map → sync-inspection-S2GHDBAD.ts.map} +0 -0
  76. /package/dist/chunks/{sync-operations-AIEM2KL2.ts.map → sync-operations-LQ63CU2T.ts.map} +0 -0
@@ -2,7 +2,7 @@
2
2
  // @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
3
3
  import {
4
4
  showDirectoryScope
5
- } from "./chunk-BYVHABNR.ts";
5
+ } from "./chunk-2MUAR5GH.ts";
6
6
  import {
7
7
  manualIgnoreFileGuidance
8
8
  } from "./chunk-EJDDRS6O.ts";
@@ -20,16 +20,16 @@ import {
20
20
  agentDir
21
21
  } from "./chunk-P4GI7LTT.ts";
22
22
  import "./chunk-ZO52JM4H.ts";
23
- import {
24
- loadSettingsConfig,
25
- syncCheckConfigFingerprint
26
- } from "./chunk-DAZZ5BEJ.ts";
27
23
  import {
28
24
  BUILT_IN_SYNC_ROOTS,
29
25
  isSafeCustomIncludePath,
30
26
  normalizeSyncInclude,
31
27
  syncIncludeSelection
32
28
  } from "./chunk-R3SAMXB6.ts";
29
+ import {
30
+ loadSettingsConfig,
31
+ syncCheckConfigFingerprint
32
+ } from "./chunk-3NS4PMCI.ts";
33
33
  import "./chunk-2JNFEZ3V.ts";
34
34
 
35
35
  // src/ui/file-selection.ts
@@ -300,4 +300,4 @@ function safeTerminalText(value) {
300
300
  export {
301
301
  showFileSelection
302
302
  };
303
- //# sourceMappingURL=file-selection-XWACUTAH.ts.map
303
+ //# sourceMappingURL=file-selection-GASCVN45.ts.map
@@ -4,13 +4,13 @@ import {
4
4
  ignoreFileSettingsAvailable,
5
5
  portableIgnoreRulesAvailable,
6
6
  showIgnoreFileAction
7
- } from "./chunk-Z5JMOXJM.ts";
7
+ } from "./chunk-JNTDIVP6.ts";
8
8
  import "./chunk-KNEUL4XN.ts";
9
- import "./chunk-AYGMIMCV.ts";
10
- import "./chunk-GELYN4UC.ts";
11
- import "./chunk-JQ5BAWW2.ts";
9
+ import "./chunk-XPKHWTGT.ts";
12
10
  import "./chunk-H7VOTY5N.ts";
11
+ import "./chunk-PUSMSKIM.ts";
13
12
  import "./chunk-6YKOHBSC.ts";
13
+ import "./chunk-GELYN4UC.ts";
14
14
  import "./chunk-R3SAMXB6.ts";
15
15
  import "./chunk-2JNFEZ3V.ts";
16
16
  export {
@@ -18,4 +18,4 @@ export {
18
18
  portableIgnoreRulesAvailable,
19
19
  showIgnoreFileAction
20
20
  };
21
- //# sourceMappingURL=ignore-file-ui-OHFISFVC.ts.map
21
+ //# sourceMappingURL=ignore-file-ui-UY2TEK4C.ts.map
@@ -2,19 +2,19 @@
2
2
  // @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
3
3
  import {
4
4
  dispatchManagerResult
5
- } from "./chunk-BESRBKVO.ts";
6
- import "./chunk-5YOLQKNZ.ts";
5
+ } from "./chunk-CQXGMESM.ts";
6
+ import "./chunk-3CO7QIYB.ts";
7
7
  import "./chunk-UMPA5S7X.ts";
8
- import "./chunk-AYGMIMCV.ts";
8
+ import "./chunk-H7VOTY5N.ts";
9
+ import "./chunk-PUSMSKIM.ts";
10
+ import "./chunk-6YKOHBSC.ts";
9
11
  import "./chunk-NXWHPVXR.ts";
10
12
  import "./chunk-GELYN4UC.ts";
11
13
  import "./chunk-ZO52JM4H.ts";
12
- import "./chunk-DAZZ5BEJ.ts";
13
- import "./chunk-H7VOTY5N.ts";
14
- import "./chunk-6YKOHBSC.ts";
15
14
  import "./chunk-R3SAMXB6.ts";
15
+ import "./chunk-3NS4PMCI.ts";
16
16
  import "./chunk-2JNFEZ3V.ts";
17
17
  export {
18
18
  dispatchManagerResult
19
19
  };
20
- //# sourceMappingURL=manager-result-dispatcher-WXE2BAQO.ts.map
20
+ //# sourceMappingURL=manager-result-dispatcher-PEVIGLOS.ts.map
@@ -18,26 +18,26 @@ import {
18
18
  showEditS3Target,
19
19
  showEditWebDavStorageProfile,
20
20
  showEditWebDavTarget
21
- } from "./chunk-ASU3GZPW.ts";
21
+ } from "./chunk-W7DSN33J.ts";
22
22
  import {
23
23
  automaticSyncSummary
24
24
  } from "./chunk-ECYCNZOE.ts";
25
25
  import {
26
26
  ignoreFileSettingsAvailable,
27
27
  showIgnoreFileAction
28
- } from "./chunk-Z5JMOXJM.ts";
28
+ } from "./chunk-JNTDIVP6.ts";
29
29
  import "./chunk-KNEUL4XN.ts";
30
30
  import {
31
31
  dispatchManagerResult
32
- } from "./chunk-BESRBKVO.ts";
33
- import "./chunk-5YOLQKNZ.ts";
32
+ } from "./chunk-CQXGMESM.ts";
33
+ import "./chunk-3CO7QIYB.ts";
34
34
  import {
35
35
  SETUP_SWITCH_ACTION_OPTIONS,
36
36
  saveOnSwitch,
37
37
  setupSwitchActionFromLabel,
38
38
  setupSwitchActionLabel,
39
39
  useSyncSetup
40
- } from "./chunk-SZJOUVCL.ts";
40
+ } from "./chunk-DGVZYS7T.ts";
41
41
  import {
42
42
  isCloudflareR2Endpoint,
43
43
  normalizeS3Endpoint,
@@ -59,10 +59,16 @@ import {
59
59
  readStateForConfig,
60
60
  syncAttentionMatchesConfig,
61
61
  syncStateFingerprint
62
- } from "./chunk-FI2F5JBS.ts";
62
+ } from "./chunk-3Q3DMMID.ts";
63
+ import {
64
+ piDaemonClient
65
+ } from "./chunk-XPKHWTGT.ts";
63
66
  import {
64
67
  throwIfAborted
65
68
  } from "./chunk-UMPA5S7X.ts";
69
+ import {
70
+ configureSyncStatus
71
+ } from "./chunk-H7VOTY5N.ts";
66
72
  import {
67
73
  AUTOMATIC_SYNC_DESCRIPTION,
68
74
  STARTUP_TRANSFER_DESCRIPTION,
@@ -70,14 +76,17 @@ import {
70
76
  } from "./chunk-XUZV4OGI.ts";
71
77
  import {
72
78
  confirmMergeReview
73
- } from "./chunk-WJQ4TGN5.ts";
79
+ } from "./chunk-ECUCXF5Y.ts";
74
80
  import {
75
81
  runCancellableOperation
76
- } from "./chunk-AYGMIMCV.ts";
82
+ } from "./chunk-PUSMSKIM.ts";
83
+ import {
84
+ errorMessage
85
+ } from "./chunk-6YKOHBSC.ts";
77
86
  import {
78
87
  directoryScopeSummary,
79
88
  showExcludedPaths
80
- } from "./chunk-BYVHABNR.ts";
89
+ } from "./chunk-2MUAR5GH.ts";
81
90
  import {
82
91
  manualIgnoreFileGuidance
83
92
  } from "./chunk-EJDDRS6O.ts";
@@ -103,6 +112,12 @@ import {
103
112
  import {
104
113
  sameSyncExclude
105
114
  } from "./chunk-ZO52JM4H.ts";
115
+ import {
116
+ compareSyncInclude,
117
+ syncIncludeSelection,
118
+ syncSelectionHasContent,
119
+ syncSessionsSelected
120
+ } from "./chunk-R3SAMXB6.ts";
106
121
  import {
107
122
  configFromSettings,
108
123
  createSettingsConfigView,
@@ -112,22 +127,7 @@ import {
112
127
  loadSettingsConfig,
113
128
  syncCheckConfigFingerprint,
114
129
  syncConfigReviewIdentity
115
- } from "./chunk-DAZZ5BEJ.ts";
116
- import {
117
- piDaemonClient
118
- } from "./chunk-JQ5BAWW2.ts";
119
- import {
120
- configureSyncStatus
121
- } from "./chunk-H7VOTY5N.ts";
122
- import {
123
- errorMessage
124
- } from "./chunk-6YKOHBSC.ts";
125
- import {
126
- compareSyncInclude,
127
- syncIncludeSelection,
128
- syncSelectionHasContent,
129
- syncSessionsSelected
130
- } from "./chunk-R3SAMXB6.ts";
130
+ } from "./chunk-3NS4PMCI.ts";
131
131
  import {
132
132
  safeTerminalText
133
133
  } from "./chunk-2JNFEZ3V.ts";
@@ -224,7 +224,7 @@ function blockedSyncMenuItem(label, manager) {
224
224
  };
225
225
  }
226
226
  async function showManagerAttention(ctx, attention, runRoute, signal, onSelectionResolved) {
227
- const { showRemoteSelectionReview } = await import("./remote-selection-ui-E4XZCQ7A.ts");
227
+ const { showRemoteSelectionReview } = await import("./remote-selection-ui-WFLX6MAJ.ts");
228
228
  if (signal?.aborted) return "close";
229
229
  const review = await showRemoteSelectionReview(ctx, attention.decision.setupName, signal, void 0, {
230
230
  decision: attention.decision,
@@ -2072,7 +2072,7 @@ async function showSyncSettings(ctx, runRoute, signal, reviewedSetup) {
2072
2072
  "remote-include": async ({ state, signal: actionSignal }) => {
2073
2073
  if (state.reservedIgnoreNames !== void 0 && !ignoreAvailable) return { kind: "rejected" };
2074
2074
  const reviewSignal = signal ? AbortSignal.any([signal, actionSignal]) : actionSignal;
2075
- const { showRemoteSelectionReview } = await import("./remote-selection-ui-E4XZCQ7A.ts");
2075
+ const { showRemoteSelectionReview } = await import("./remote-selection-ui-WFLX6MAJ.ts");
2076
2076
  if (reviewSignal.aborted) return { kind: "rejected" };
2077
2077
  const review = await showRemoteSelectionReview(ctx, setupName, reviewSignal, void 0, {
2078
2078
  origin: "settings",
@@ -2277,6 +2277,7 @@ async function showSyncManager(ctx, runRoute, sessionSignal, options = {}) {
2277
2277
  cancelledMessage: direction === "push" ? "Push cancellation requested." : "Pull cancellation requested.",
2278
2278
  target: review.setupName,
2279
2279
  directionalFingerprint: review.fingerprint,
2280
+ requirePendingAdoption: state.manager.recoveryPull,
2280
2281
  signal,
2281
2282
  isCurrent
2282
2283
  }
@@ -2329,7 +2330,7 @@ async function showSyncManager(ctx, runRoute, sessionSignal, options = {}) {
2329
2330
  if (!attention) {
2330
2331
  const observation = state.manager.observation;
2331
2332
  if (!observation) return { kind: "stay" };
2332
- const { showRemoteSelectionReview } = await import("./remote-selection-ui-E4XZCQ7A.ts");
2333
+ const { showRemoteSelectionReview } = await import("./remote-selection-ui-WFLX6MAJ.ts");
2333
2334
  if (sessionSignal?.aborted) return { kind: "close" };
2334
2335
  const config = await loadConfig();
2335
2336
  if (sessionSignal?.aborted) return { kind: "close" };
@@ -2534,7 +2535,14 @@ S3/R2 reads the latest pointer without writing. Git reads remote snapshots and c
2534
2535
  const activate = menu.actions[action];
2535
2536
  menu.actions[action] = async (invocation) => {
2536
2537
  validateOwner();
2537
- const { configReview, settingsReview } = invocation.state.manager;
2538
+ const { configReview, settingsReview, recoveryPull } = invocation.state.manager;
2539
+ if (action === "pull" && recoveryPull) {
2540
+ if (options.getPendingPullReview?.() !== configReview) {
2541
+ ctx.ui.notify("The original Pull is no longer available for automatic recovery.", "warning");
2542
+ return { kind: "stay" };
2543
+ }
2544
+ return activate(invocation);
2545
+ }
2538
2546
  const review = action === "settings" ? settingsReview ?? configReview : configReview;
2539
2547
  let current = false;
2540
2548
  try {
@@ -2575,8 +2583,18 @@ S3/R2 reads the latest pointer without writing. Git reads remote snapshots and c
2575
2583
  title: "Pi Sync recovery required\nDaemon cleanup could not be confirmed. Stop the daemon before retrying a transfer.",
2576
2584
  actions: ["Stop daemon for recovery\u2026", "Help"]
2577
2585
  };
2586
+ const describeRecovery = () => {
2587
+ const configReview = options.getPendingPullReview?.();
2588
+ if (!configReview) return recovery;
2589
+ return {
2590
+ title: "Pi Sync recovery required\nPull can try to recover the daemon and review the pending transfer.",
2591
+ actions: ["Pull from remote", ...recovery.actions],
2592
+ configReview,
2593
+ recoveryPull: true
2594
+ };
2595
+ };
2578
2596
  const describe = async (signal) => {
2579
- if (options.needsDaemonRecovery?.()) return recovery;
2597
+ if (options.needsDaemonRecovery?.()) return describeRecovery();
2580
2598
  const pendingAttention = options.getAttention?.();
2581
2599
  const observation = options.getObservation?.();
2582
2600
  const manager = await describeManagerState(
@@ -2587,7 +2605,7 @@ S3/R2 reads the latest pointer without writing. Git reads remote snapshots and c
2587
2605
  () => ignoreFileSettingsAvailable(ctx, signal)
2588
2606
  );
2589
2607
  if (signal.aborted || !isCurrent()) return manager;
2590
- if (options.needsDaemonRecovery?.()) return recovery;
2608
+ if (options.needsDaemonRecovery?.()) return describeRecovery();
2591
2609
  if (observation && options.getObservation?.() === observation && !manager.observation && !(manager.operation && operationBlocksChanges(manager.operation))) {
2592
2610
  options.onObservationInvalidated?.();
2593
2611
  }
@@ -2663,4 +2681,4 @@ function syncMainMenuItem(label) {
2663
2681
  export {
2664
2682
  showSyncManager
2665
2683
  };
2666
- //# sourceMappingURL=manager-ui-DWOMAJKE.ts.map
2684
+ //# sourceMappingURL=manager-ui-R5XHYRXK.ts.map