@narumitw/pi-sync 0.53.0 → 0.54.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.
Files changed (53) hide show
  1. package/README.md +6 -4
  2. package/dist/chunks/{chunk-I5IG4WV4.ts → chunk-5ZWQ33XL.ts} +39 -19
  3. package/dist/chunks/{chunk-I5IG4WV4.ts.map → chunk-5ZWQ33XL.ts.map} +2 -2
  4. package/dist/chunks/{chunk-QTCGWQP3.ts → chunk-QDPED3XJ.ts} +67 -8
  5. package/dist/chunks/{chunk-QTCGWQP3.ts.map → chunk-QDPED3XJ.ts.map} +3 -3
  6. package/dist/chunks/{chunk-FHNISD7A.ts → chunk-SDZCTCYQ.ts} +4 -4
  7. package/dist/chunks/{chunk-NGIJQSRE.ts → chunk-VHXBCEVF.ts} +2 -2
  8. package/dist/chunks/{chunk-BX3K7YW7.ts → chunk-WFKUKVCP.ts} +2 -2
  9. package/dist/chunks/{chunk-UETBKTDI.ts → chunk-YDVQYUHE.ts} +1 -1
  10. package/dist/chunks/{chunk-UETBKTDI.ts.map → chunk-YDVQYUHE.ts.map} +2 -2
  11. package/dist/chunks/{conflict-review-NK5CM6UA.ts → conflict-review-JANNPKKS.ts} +4 -4
  12. package/dist/chunks/{git-backend-HLGKUQJT.ts → git-backend-FD7AVSK6.ts} +2 -2
  13. package/dist/chunks/{manager-result-dispatcher-35TM3ZR3.ts → manager-result-dispatcher-6MQKFCWB.ts} +4 -4
  14. package/dist/chunks/{manager-ui-6AYMNXUP.ts → manager-ui-IURS4WXY.ts} +675 -610
  15. package/dist/chunks/manager-ui-IURS4WXY.ts.map +7 -0
  16. package/dist/chunks/{remote-selection-ui-BB5SX6P5.ts → remote-selection-ui-6LJJ4IMQ.ts} +3 -3
  17. package/dist/chunks/{s3-backend-O2AS3TH6.ts → s3-backend-AQGV6LFT.ts} +18 -4
  18. package/dist/chunks/s3-backend-AQGV6LFT.ts.map +7 -0
  19. package/dist/chunks/{sync-inspection-RLIHUYDV.ts → sync-inspection-K45QVLHB.ts} +3 -3
  20. package/dist/chunks/{sync-operations-RBUOUJWL.ts → sync-operations-OWTE3ZL2.ts} +18 -12
  21. package/dist/chunks/{sync-operations-RBUOUJWL.ts.map → sync-operations-OWTE3ZL2.ts.map} +2 -2
  22. package/dist/chunks/{webdav-backend-ETQGSI6I.ts → webdav-backend-TBILVEQK.ts} +2 -2
  23. package/dist/index.ts +33 -8
  24. package/dist/index.ts.map +3 -3
  25. package/docs/settings.md +11 -3
  26. package/package.json +4 -4
  27. package/src/backends/s3/s3-backend.ts +22 -1
  28. package/src/backends/s3/s3-client.ts +3 -1
  29. package/src/backends/sync-backend.ts +2 -0
  30. package/src/commands/command-execution.ts +3 -0
  31. package/src/commands/command-handler.ts +8 -1
  32. package/src/sync/merge-transfer-error.ts +72 -0
  33. package/src/sync/merged-sync.ts +8 -5
  34. package/src/sync/sync-mutations.ts +9 -7
  35. package/src/sync/sync-queries.ts +1 -0
  36. package/src/ui/cancellable-operation.ts +47 -17
  37. package/src/ui/manager-attention.ts +3 -5
  38. package/src/ui/manager-state.ts +32 -15
  39. package/src/ui/manager-ui.ts +59 -87
  40. package/src/ui/operation-dialogs.ts +29 -0
  41. package/src/ui/settings-ui.ts +140 -46
  42. package/src/ui/setup/setup-actions.ts +2 -2
  43. package/dist/chunks/manager-ui-6AYMNXUP.ts.map +0 -7
  44. package/dist/chunks/s3-backend-O2AS3TH6.ts.map +0 -7
  45. /package/dist/chunks/{chunk-FHNISD7A.ts.map → chunk-SDZCTCYQ.ts.map} +0 -0
  46. /package/dist/chunks/{chunk-NGIJQSRE.ts.map → chunk-VHXBCEVF.ts.map} +0 -0
  47. /package/dist/chunks/{chunk-BX3K7YW7.ts.map → chunk-WFKUKVCP.ts.map} +0 -0
  48. /package/dist/chunks/{conflict-review-NK5CM6UA.ts.map → conflict-review-JANNPKKS.ts.map} +0 -0
  49. /package/dist/chunks/{git-backend-HLGKUQJT.ts.map → git-backend-FD7AVSK6.ts.map} +0 -0
  50. /package/dist/chunks/{manager-result-dispatcher-35TM3ZR3.ts.map → manager-result-dispatcher-6MQKFCWB.ts.map} +0 -0
  51. /package/dist/chunks/{remote-selection-ui-BB5SX6P5.ts.map → remote-selection-ui-6LJJ4IMQ.ts.map} +0 -0
  52. /package/dist/chunks/{sync-inspection-RLIHUYDV.ts.map → sync-inspection-K45QVLHB.ts.map} +0 -0
  53. /package/dist/chunks/{webdav-backend-ETQGSI6I.ts.map → webdav-backend-TBILVEQK.ts.map} +0 -0
@@ -5,15 +5,15 @@
5
5
  var createSyncBackend = async (config) => {
6
6
  switch (config.backend.type) {
7
7
  case "s3": {
8
- const { S3SyncBackend } = await import("./s3-backend-O2AS3TH6.ts");
8
+ const { S3SyncBackend } = await import("./s3-backend-AQGV6LFT.ts");
9
9
  return new S3SyncBackend(config.backend);
10
10
  }
11
11
  case "webdav": {
12
- const { WebDavSyncBackend } = await import("./webdav-backend-ETQGSI6I.ts");
12
+ const { WebDavSyncBackend } = await import("./webdav-backend-TBILVEQK.ts");
13
13
  return new WebDavSyncBackend(config.backend);
14
14
  }
15
15
  case "git": {
16
- const { GitSyncBackend } = await import("./git-backend-HLGKUQJT.ts");
16
+ const { GitSyncBackend } = await import("./git-backend-FD7AVSK6.ts");
17
17
  return new GitSyncBackend(config.backend);
18
18
  }
19
19
  }
@@ -22,4 +22,4 @@ var createSyncBackend = async (config) => {
22
22
  export {
23
23
  createSyncBackend
24
24
  };
25
- //# sourceMappingURL=chunk-FHNISD7A.ts.map
25
+ //# sourceMappingURL=chunk-SDZCTCYQ.ts.map
@@ -3,7 +3,7 @@
3
3
  import {
4
4
  runCancellableOperation,
5
5
  showRemoteSelectionReview
6
- } from "./chunk-I5IG4WV4.ts";
6
+ } from "./chunk-5ZWQ33XL.ts";
7
7
  import {
8
8
  safeTerminalText
9
9
  } from "./chunk-AMJRUXFT.ts";
@@ -206,4 +206,4 @@ async function dispatchManagerResult(ctx, initialResult, origin, runRoute, signa
206
206
  export {
207
207
  dispatchManagerResult
208
208
  };
209
- //# sourceMappingURL=chunk-NGIJQSRE.ts.map
209
+ //# sourceMappingURL=chunk-VHXBCEVF.ts.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-BDB4IDM3.ts";
7
7
  import {
8
8
  createSyncBackend
9
- } from "./chunk-FHNISD7A.ts";
9
+ } from "./chunk-SDZCTCYQ.ts";
10
10
  import {
11
11
  throwIfAborted
12
12
  } from "./chunk-PWMWOJP4.ts";
@@ -47,4 +47,4 @@ async function inspectSync(config, options, signal, factory = createSyncBackend)
47
47
  export {
48
48
  inspectSync
49
49
  };
50
- //# sourceMappingURL=chunk-BX3K7YW7.ts.map
50
+ //# sourceMappingURL=chunk-WFKUKVCP.ts.map
@@ -31,4 +31,4 @@ export {
31
31
  SyncBackendPublicationOutcomeUnknownError,
32
32
  expectedRemoteHead
33
33
  };
34
- //# sourceMappingURL=chunk-UETBKTDI.ts.map
34
+ //# sourceMappingURL=chunk-YDVQYUHE.ts.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/backends/sync-backend.ts"],
4
- "sourcesContent": ["import type { Snapshot, SnapshotSelection } from \"../snapshot/snapshot-types.js\";\n\nexport type PublicationCapability =\n | \"read-check-write-verify\"\n | \"conditional-required\"\n | \"atomic-conditional\"\n | \"lease-protected\";\n\nexport interface RemoteHead {\n /** Backend-owned reference used only to retrieve this immutable snapshot. */\n snapshotRef: string;\n /** Backend-neutral snapshot content identity retained in local sync state. */\n snapshotId: string;\n revision: string;\n createdAt: string;\n machine: string;\n syncSessions: boolean;\n /** Validated lightweight projection; revalidate it against the immutable snapshot before adoption. */\n selection?: SnapshotSelection;\n}\n\nexport interface RemoteHistoryEntry {\n snapshotRef: string;\n snapshotId: string;\n createdAt: string;\n machine: string;\n syncSessions: boolean;\n}\n\nexport type ExpectedRemoteHead = { kind: \"missing\" } | { kind: \"revision\"; revision: string };\n\nexport interface PublishSnapshotOptions {\n signal?: AbortSignal;\n /** Called at the backend's active-head commit boundary. */\n onCommit?: () => void;\n}\n\nexport interface PublishSnapshotResult {\n head: RemoteHead;\n warnings: string[];\n}\n\nexport interface BackendDiagnostic {\n key: string;\n level: \"info\" | \"warning\" | \"error\";\n message: string;\n}\n\nexport interface SyncBackend {\n readonly identity: string;\n readonly destination: string;\n readonly capability: PublicationCapability;\n /** Compare opaque revisions produced by this backend identity. */\n sameRevision(left: string, right: string): boolean;\n readHead(signal?: AbortSignal): Promise<RemoteHead | undefined>;\n readSnapshot(reference: string, signal?: AbortSignal): Promise<Snapshot>;\n publishSnapshot(\n snapshot: Snapshot,\n expected: ExpectedRemoteHead,\n options?: PublishSnapshotOptions,\n ): Promise<PublishSnapshotResult>;\n listHistory(signal?: AbortSignal): Promise<RemoteHistoryEntry[]>;\n diagnose(signal?: AbortSignal): Promise<BackendDiagnostic[]>;\n}\n\nexport class SyncBackendConflictError extends Error {\n readonly code = \"SYNC_BACKEND_CONFLICT\";\n readonly phase: \"before-commit\" | \"after-commit\";\n readonly currentHead?: RemoteHead;\n readonly candidateMayHaveBeenActive: boolean;\n\n constructor(\n message: string,\n options: ErrorOptions & {\n phase?: \"before-commit\" | \"after-commit\";\n currentHead?: RemoteHead;\n candidateMayHaveBeenActive?: boolean;\n } = {},\n ) {\n super(message, options);\n this.name = \"SyncBackendConflictError\";\n this.phase = options.phase ?? \"before-commit\";\n this.currentHead = options.currentHead;\n this.candidateMayHaveBeenActive = options.candidateMayHaveBeenActive ?? false;\n }\n}\n\nexport class SyncBackendPublicationOutcomeUnknownError extends Error {\n readonly code = \"SYNC_BACKEND_PUBLICATION_OUTCOME_UNKNOWN\";\n\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n this.name = \"SyncBackendPublicationOutcomeUnknownError\";\n }\n}\n\nexport function expectedRemoteHead(head: RemoteHead | undefined): ExpectedRemoteHead {\n return head ? { kind: \"revision\", revision: head.revision } : { kind: \"missing\" };\n}\n"],
5
- "mappings": ";;;;AAiEO,IAAM,2BAAN,cAAuC,MAAM;AAAA,EACzC,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EAET,YACE,SACA,UAII,CAAC,GACL;AACA,UAAM,SAAS,OAAO;AACtB,SAAK,OAAO;AACZ,SAAK,QAAQ,QAAQ,SAAS;AAC9B,SAAK,cAAc,QAAQ;AAC3B,SAAK,6BAA6B,QAAQ,8BAA8B;AAAA,EAC1E;AACF;AAEO,IAAM,4CAAN,cAAwD,MAAM;AAAA,EAC1D,OAAO;AAAA,EAEhB,YAAY,SAAiB,SAAwB;AACnD,UAAM,SAAS,OAAO;AACtB,SAAK,OAAO;AAAA,EACd;AACF;AAEO,SAAS,mBAAmB,MAAkD;AACnF,SAAO,OAAO,EAAE,MAAM,YAAY,UAAU,KAAK,SAAS,IAAI,EAAE,MAAM,UAAU;AAClF;",
4
+ "sourcesContent": ["import type { Snapshot, SnapshotSelection } from \"../snapshot/snapshot-types.js\";\n\nexport type PublicationCapability =\n | \"read-check-write-verify\"\n | \"conditional-required\"\n | \"atomic-conditional\"\n | \"lease-protected\";\n\nexport interface RemoteHead {\n /** Backend-owned reference used only to retrieve this immutable snapshot. */\n snapshotRef: string;\n /** Backend-neutral snapshot content identity retained in local sync state. */\n snapshotId: string;\n revision: string;\n createdAt: string;\n machine: string;\n syncSessions: boolean;\n /** Validated lightweight projection; revalidate it against the immutable snapshot before adoption. */\n selection?: SnapshotSelection;\n}\n\nexport interface RemoteHistoryEntry {\n snapshotRef: string;\n snapshotId: string;\n createdAt: string;\n machine: string;\n syncSessions: boolean;\n}\n\nexport type ExpectedRemoteHead = { kind: \"missing\" } | { kind: \"revision\"; revision: string };\n\nexport interface PublishSnapshotOptions {\n signal?: AbortSignal;\n /** Called at the backend's active-head commit boundary. */\n onCommit?: () => void;\n}\n\nexport interface PublishSnapshotResult {\n head: RemoteHead;\n warnings: string[];\n}\n\nexport interface BackendDiagnostic {\n key: string;\n level: \"info\" | \"warning\" | \"error\";\n message: string;\n}\n\nexport interface SyncBackend {\n readonly identity: string;\n readonly destination: string;\n readonly capability: PublicationCapability;\n /** Compare opaque revisions produced by this backend identity. */\n sameRevision(left: string, right: string): boolean;\n /** Recovery-only equivalence for retiring an inactive candidate; never authorizes publication or apply. */\n matchesUncommittedRecoveryHead?(current: RemoteHead, recorded: RemoteHead): boolean;\n readHead(signal?: AbortSignal): Promise<RemoteHead | undefined>;\n readSnapshot(reference: string, signal?: AbortSignal): Promise<Snapshot>;\n publishSnapshot(\n snapshot: Snapshot,\n expected: ExpectedRemoteHead,\n options?: PublishSnapshotOptions,\n ): Promise<PublishSnapshotResult>;\n listHistory(signal?: AbortSignal): Promise<RemoteHistoryEntry[]>;\n diagnose(signal?: AbortSignal): Promise<BackendDiagnostic[]>;\n}\n\nexport class SyncBackendConflictError extends Error {\n readonly code = \"SYNC_BACKEND_CONFLICT\";\n readonly phase: \"before-commit\" | \"after-commit\";\n readonly currentHead?: RemoteHead;\n readonly candidateMayHaveBeenActive: boolean;\n\n constructor(\n message: string,\n options: ErrorOptions & {\n phase?: \"before-commit\" | \"after-commit\";\n currentHead?: RemoteHead;\n candidateMayHaveBeenActive?: boolean;\n } = {},\n ) {\n super(message, options);\n this.name = \"SyncBackendConflictError\";\n this.phase = options.phase ?? \"before-commit\";\n this.currentHead = options.currentHead;\n this.candidateMayHaveBeenActive = options.candidateMayHaveBeenActive ?? false;\n }\n}\n\nexport class SyncBackendPublicationOutcomeUnknownError extends Error {\n readonly code = \"SYNC_BACKEND_PUBLICATION_OUTCOME_UNKNOWN\";\n\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n this.name = \"SyncBackendPublicationOutcomeUnknownError\";\n }\n}\n\nexport function expectedRemoteHead(head: RemoteHead | undefined): ExpectedRemoteHead {\n return head ? { kind: \"revision\", revision: head.revision } : { kind: \"missing\" };\n}\n"],
5
+ "mappings": ";;;;AAmEO,IAAM,2BAAN,cAAuC,MAAM;AAAA,EACzC,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EAET,YACE,SACA,UAII,CAAC,GACL;AACA,UAAM,SAAS,OAAO;AACtB,SAAK,OAAO;AACZ,SAAK,QAAQ,QAAQ,SAAS;AAC9B,SAAK,cAAc,QAAQ;AAC3B,SAAK,6BAA6B,QAAQ,8BAA8B;AAAA,EAC1E;AACF;AAEO,IAAM,4CAAN,cAAwD,MAAM;AAAA,EAC1D,OAAO;AAAA,EAEhB,YAAY,SAAiB,SAAwB;AACnD,UAAM,SAAS,OAAO;AACtB,SAAK,OAAO;AAAA,EACd;AACF;AAEO,SAAS,mBAAmB,MAAkD;AACnF,SAAO,OAAO,EAAE,MAAM,YAAY,UAAU,KAAK,SAAS,IAAI,EAAE,MAAM,UAAU;AAClF;",
6
6
  "names": []
7
7
  }
@@ -3,7 +3,7 @@
3
3
  import {
4
4
  confirmMergeReview,
5
5
  mergeSync
6
- } from "./chunk-QTCGWQP3.ts";
6
+ } from "./chunk-QDPED3XJ.ts";
7
7
  import {
8
8
  conflictArtifactFingerprint,
9
9
  readConflictArtifact
@@ -12,7 +12,7 @@ import "./chunk-BDB4IDM3.ts";
12
12
  import "./chunk-V6VZ5TLG.ts";
13
13
  import {
14
14
  createSyncBackend
15
- } from "./chunk-FHNISD7A.ts";
15
+ } from "./chunk-SDZCTCYQ.ts";
16
16
  import "./chunk-ANWNQIR7.ts";
17
17
  import {
18
18
  captureMutationOwner
@@ -34,7 +34,7 @@ import {
34
34
  } from "./chunk-3B4Z2SKV.ts";
35
35
  import "./chunk-2JZFHNLM.ts";
36
36
  import "./chunk-T2SJD3N7.ts";
37
- import "./chunk-UETBKTDI.ts";
37
+ import "./chunk-YDVQYUHE.ts";
38
38
  import "./chunk-ZX2Q6THB.ts";
39
39
  import "./chunk-7D5SF7P3.ts";
40
40
  import "./chunk-A6HU4ERM.ts";
@@ -172,4 +172,4 @@ async function showConflicts(ctx, options, factory = createSyncBackend) {
172
172
  export {
173
173
  showConflicts
174
174
  };
175
- //# sourceMappingURL=conflict-review-NK5CM6UA.ts.map
175
+ //# sourceMappingURL=conflict-review-JANNPKKS.ts.map
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  SyncBackendConflictError,
15
15
  SyncBackendPublicationOutcomeUnknownError
16
- } from "./chunk-UETBKTDI.ts";
16
+ } from "./chunk-YDVQYUHE.ts";
17
17
  import {
18
18
  syncErrorGuidance
19
19
  } from "./chunk-G4RUXRWZ.ts";
@@ -1075,4 +1075,4 @@ export {
1075
1075
  gitBackendIdentity,
1076
1076
  isSupportedGitVersion
1077
1077
  };
1078
- //# sourceMappingURL=git-backend-HLGKUQJT.ts.map
1078
+ //# sourceMappingURL=git-backend-FD7AVSK6.ts.map
@@ -2,10 +2,10 @@
2
2
  // @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
3
3
  import {
4
4
  dispatchManagerResult
5
- } from "./chunk-NGIJQSRE.ts";
6
- import "./chunk-I5IG4WV4.ts";
5
+ } from "./chunk-VHXBCEVF.ts";
6
+ import "./chunk-5ZWQ33XL.ts";
7
7
  import "./chunk-V6VZ5TLG.ts";
8
- import "./chunk-FHNISD7A.ts";
8
+ import "./chunk-SDZCTCYQ.ts";
9
9
  import "./chunk-K3RIEL6J.ts";
10
10
  import "./chunk-AMJRUXFT.ts";
11
11
  import "./chunk-CHSIAC4N.ts";
@@ -20,4 +20,4 @@ import "./chunk-HUZ5CR4W.ts";
20
20
  export {
21
21
  dispatchManagerResult
22
22
  };
23
- //# sourceMappingURL=manager-result-dispatcher-35TM3ZR3.ts.map
23
+ //# sourceMappingURL=manager-result-dispatcher-6MQKFCWB.ts.map