@narumitw/pi-sync 0.69.1 → 0.70.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 +2 -2
- package/dist/chunks/{chunk-EG6BUOUQ.ts → chunk-3XN4FR72.ts} +2 -2
- package/dist/chunks/{chunk-YX6DCQ7P.ts → chunk-5T4ZOHYF.ts} +2 -2
- package/dist/chunks/{chunk-RXZVLBPU.ts → chunk-7NQ7SFZK.ts} +3 -3
- package/dist/chunks/{chunk-2JNFEZ3V.ts → chunk-AMJRUXFT.ts} +6 -2
- package/dist/chunks/{chunk-2JNFEZ3V.ts.map → chunk-AMJRUXFT.ts.map} +1 -1
- package/dist/chunks/{chunk-XNUARYLR.ts → chunk-HFMGK6A6.ts} +2 -2
- package/dist/chunks/{chunk-OWSKD5XG.ts → chunk-JPTI4HFC.ts} +4 -4
- package/dist/chunks/{chunk-RZB2DPVU.ts → chunk-N24HEZSA.ts} +3 -3
- package/dist/chunks/{chunk-EI2J5Z4Q.ts → chunk-SPXEDJ2G.ts} +4 -4
- package/dist/chunks/{chunk-GXB74FYB.ts → chunk-V4IGBXBA.ts} +4 -4
- package/dist/chunks/{chunk-4KGDPLQ4.ts → chunk-ZWP6HAYV.ts} +16 -6
- package/dist/chunks/chunk-ZWP6HAYV.ts.map +7 -0
- package/dist/chunks/{command-handler-ZR26OSBX.ts → command-handler-4XHK5PVX.ts} +20 -15
- package/dist/chunks/command-handler-4XHK5PVX.ts.map +7 -0
- package/dist/chunks/{conflict-review-W5BCZIZG.ts → conflict-review-QI77P7KL.ts} +3 -3
- package/dist/chunks/diff-review-ILRZDQ4S.ts +143 -0
- package/dist/chunks/diff-review-ILRZDQ4S.ts.map +7 -0
- package/dist/chunks/diff-review-SOLP33TQ.ts +68 -0
- package/dist/chunks/diff-review-SOLP33TQ.ts.map +7 -0
- package/dist/chunks/{file-selection-STCIRKF6.ts → file-selection-2H3J2HTX.ts} +4 -4
- package/dist/chunks/{manager-result-dispatcher-MPLPDR2P.ts → manager-result-dispatcher-YXSDLTLV.ts} +5 -5
- package/dist/chunks/{manager-ui-OMZOBGYT.ts → manager-ui-RQSZLMJ5.ts} +19 -19
- package/dist/chunks/manager-ui-RQSZLMJ5.ts.map +7 -0
- package/dist/chunks/{merge-review-KTIQBRLL.ts → merge-review-DXSERTCK.ts} +3 -3
- package/dist/chunks/{ownership-recovery-UDDHSDSZ.ts → ownership-recovery-5KXAMFSL.ts} +2 -2
- package/dist/chunks/{remote-selection-ui-CCHMCAHQ.ts → remote-selection-ui-AE6FOEXH.ts} +4 -4
- package/dist/chunks/{setup-switch-J3YLBB6N.ts → setup-switch-LJPEZONY.ts} +3 -3
- package/dist/chunks/{setup-wizard-J3YOR7BR.ts → setup-wizard-FBX7RTZ6.ts} +4 -4
- package/dist/chunks/{sync-inspection-7OADBR57.ts → sync-inspection-TZ4EMSBN.ts} +3 -3
- package/dist/chunks/{sync-operations-3K6WLPXY.ts → sync-operations-QIQ3G66S.ts} +16 -5
- package/dist/chunks/{sync-operations-3K6WLPXY.ts.map → sync-operations-QIQ3G66S.ts.map} +2 -2
- package/dist/daemon/dist/build-id.json +1 -1
- package/dist/daemon/dist/client.js +131 -5
- package/dist/daemon/dist/diff-review-binding.js +11 -0
- package/dist/daemon/dist/diff-review-protocol.js +85 -0
- package/dist/daemon/dist/diff-review-rpc.js +37 -0
- package/dist/daemon/dist/diff-review-store.js +89 -0
- package/dist/daemon/dist/engine/backends/git/git-backend.js +10 -6
- package/dist/daemon/dist/engine/backends/s3/s3-backend.js +3 -3
- package/dist/daemon/dist/engine/backends/s3/s3-client.js +16 -6
- package/dist/daemon/dist/engine/backends/webdav/webdav-backend.js +3 -3
- package/dist/daemon/dist/engine/backends/webdav/webdav-client.js +23 -10
- package/dist/daemon/dist/engine/snapshot/session-paths.js +12 -3
- package/dist/daemon/dist/engine/snapshot/snapshot-capture-limit.js +99 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-codec.js +4 -1
- package/dist/daemon/dist/engine/snapshot/snapshot-difference.js +13 -0
- package/dist/daemon/dist/engine/snapshot/snapshot.js +44 -17
- package/dist/daemon/dist/engine/sync/diff-review-capture.js +210 -0
- package/dist/daemon/dist/engine/sync/diff-review-preview.js +114 -0
- package/dist/daemon/dist/engine/sync/remote-snapshot.js +6 -6
- package/dist/daemon/dist/engine/sync/sync-queries.js +32 -19
- package/dist/daemon/dist/engine/ui/sync-format.js +14 -24
- package/dist/daemon/dist/engine-service.js +5 -0
- package/dist/daemon/dist/index.js +1 -0
- package/dist/daemon/dist/server.js +97 -28
- package/dist/daemon/package.json +1 -1
- package/dist/index.ts +7 -7
- package/docs/tui-contract.md +1 -1
- package/package.json +3 -3
- package/skills/configure-pi-sync/references/configuration.md +1 -1
- package/src/commands/command-execution.ts +9 -4
- package/src/commands/command-handler.ts +3 -3
- package/src/commands/command-types.ts +1 -0
- package/src/daemon/diff-review.ts +68 -0
- package/src/sync/sync-operations.ts +12 -2
- package/src/ui/cancellable-operation.ts +32 -11
- package/src/ui/diff-review.ts +144 -0
- package/src/ui/manager-ui.ts +7 -6
- package/dist/chunks/chunk-4KGDPLQ4.ts.map +0 -7
- package/dist/chunks/command-handler-ZR26OSBX.ts.map +0 -7
- package/dist/chunks/manager-ui-OMZOBGYT.ts.map +0 -7
- /package/dist/chunks/{chunk-EG6BUOUQ.ts.map → chunk-3XN4FR72.ts.map} +0 -0
- /package/dist/chunks/{chunk-YX6DCQ7P.ts.map → chunk-5T4ZOHYF.ts.map} +0 -0
- /package/dist/chunks/{chunk-RXZVLBPU.ts.map → chunk-7NQ7SFZK.ts.map} +0 -0
- /package/dist/chunks/{chunk-XNUARYLR.ts.map → chunk-HFMGK6A6.ts.map} +0 -0
- /package/dist/chunks/{chunk-OWSKD5XG.ts.map → chunk-JPTI4HFC.ts.map} +0 -0
- /package/dist/chunks/{chunk-RZB2DPVU.ts.map → chunk-N24HEZSA.ts.map} +0 -0
- /package/dist/chunks/{chunk-EI2J5Z4Q.ts.map → chunk-SPXEDJ2G.ts.map} +0 -0
- /package/dist/chunks/{chunk-GXB74FYB.ts.map → chunk-V4IGBXBA.ts.map} +0 -0
- /package/dist/chunks/{conflict-review-W5BCZIZG.ts.map → conflict-review-QI77P7KL.ts.map} +0 -0
- /package/dist/chunks/{file-selection-STCIRKF6.ts.map → file-selection-2H3J2HTX.ts.map} +0 -0
- /package/dist/chunks/{manager-result-dispatcher-MPLPDR2P.ts.map → manager-result-dispatcher-YXSDLTLV.ts.map} +0 -0
- /package/dist/chunks/{merge-review-KTIQBRLL.ts.map → merge-review-DXSERTCK.ts.map} +0 -0
- /package/dist/chunks/{ownership-recovery-UDDHSDSZ.ts.map → ownership-recovery-5KXAMFSL.ts.map} +0 -0
- /package/dist/chunks/{remote-selection-ui-CCHMCAHQ.ts.map → remote-selection-ui-AE6FOEXH.ts.map} +0 -0
- /package/dist/chunks/{setup-switch-J3YLBB6N.ts.map → setup-switch-LJPEZONY.ts.map} +0 -0
- /package/dist/chunks/{setup-wizard-J3YOR7BR.ts.map → setup-wizard-FBX7RTZ6.ts.map} +0 -0
- /package/dist/chunks/{sync-inspection-7OADBR57.ts.map → sync-inspection-TZ4EMSBN.ts.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @narumitw/pi-sync
|
|
2
2
|
|
|
3
|
+
## 0.70.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 802416f: Show changed files in a searchable Pi Sync TUI list and load a read-only diff for the selected file. Use Kit's optional floating document review where it fits and the inline review on smaller terminals. The daemon bounds and isolates previews by client and keeps the existing RPC summary operation unchanged.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [802416f]
|
|
12
|
+
- @narumitw/pi-tui-kit@0.74.0
|
|
13
|
+
|
|
3
14
|
## 0.69.1
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -92,7 +92,7 @@ Selecting a direction does not authorize background transfers or model use. If a
|
|
|
92
92
|
|
|
93
93
|
Use the navigation keys to select an action or scroll when more actions are available. **Settings** and **History** are directly available. Switching appears only when multiple valid setups exist; review and access-recovery actions appear when needed.
|
|
94
94
|
|
|
95
|
-
The summary distinguishes cached observations, recorded background state, and the last successful background transfer; none proves current remote equality. Missing or invalid background evidence is not shown as Waiting. Automatic-transfer permissions and possible AI costs remain visible when enabled; detailed preferences stay in Settings. Setup-specific actions stay bound to the displayed setup; if its configuration changes while the menu is open, review the refreshed setup before continuing. Choose **View differences** (`/sync diff`)
|
|
95
|
+
The summary distinguishes cached observations, recorded background state, and the last successful background transfer; none proves current remote equality. Missing or invalid background evidence is not shown as Waiting. Automatic-transfer permissions and possible AI costs remain visible when enabled; detailed preferences stay in Settings. Setup-specific actions stay bound to the displayed setup; if its configuration changes while the menu is open, review the refreshed setup before continuing. Choose **View differences** (`/sync diff`) to read current local and remote file differences, even with Debug mode off. In TUI, search the changed-file list and press Enter to open one read-only diff. The `−` lines are local and the `+` lines are remote; neither is a proposed transfer or a comparison against the last sync. Press Escape to return to the same list position and filter, or Ctrl+C to close the review. RPC keeps the file summary. **Last applied snapshot** shows an ID, not the time it was applied. Long IDs are shortened in the menu; **History** shows the full ID.
|
|
96
96
|
|
|
97
97
|
After Pi Sync detects an included-content mismatch, the manager shows **Sync status: Review needed** and puts **Review synced content (recommended)** first.
|
|
98
98
|
**Sync now** remains unavailable until you review the mismatch.
|
|
@@ -324,7 +324,7 @@ Use `/sync` for initial setup, masked credential entry, and operations that requ
|
|
|
324
324
|
| `/sync use <setup>` | Switch the active local sync setup, following its switch policy. |
|
|
325
325
|
| `/sync init` | Create a local configuration template. |
|
|
326
326
|
| `/sync files` | Open the current setup’s path selection or agent-directory rules in TUI. |
|
|
327
|
-
| `/sync diff` |
|
|
327
|
+
| `/sync diff` | Inspect changed files and open individual text diffs in TUI; show a file summary in RPC. No transfer. |
|
|
328
328
|
| `/sync conflicts` | Review private unresolved dependency groups and choose local or remote group versions after fresh validation. |
|
|
329
329
|
| `/sync push` | Publish local content to remote storage. |
|
|
330
330
|
| `/sync pull` | Back up local content, then apply the remote snapshot. |
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
} from "./chunk-6YKOHBSC.ts";
|
|
26
26
|
import {
|
|
27
27
|
safeTerminalText
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-AMJRUXFT.ts";
|
|
29
29
|
|
|
30
30
|
// src/sync/setup-switch.ts
|
|
31
31
|
var SETUP_SWITCH_ACTION_OPTIONS = [
|
|
@@ -143,4 +143,4 @@ export {
|
|
|
143
143
|
saveOnSwitch,
|
|
144
144
|
useSyncSetup
|
|
145
145
|
};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-3XN4FR72.ts.map
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "./chunk-R3SAMXB6.ts";
|
|
17
17
|
import {
|
|
18
18
|
safeTerminalText
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-AMJRUXFT.ts";
|
|
20
20
|
|
|
21
21
|
// src/state/sync-state-store.ts
|
|
22
22
|
import {
|
|
@@ -184,4 +184,4 @@ export {
|
|
|
184
184
|
observationMatchesConfig,
|
|
185
185
|
observationSummary
|
|
186
186
|
};
|
|
187
|
-
//# sourceMappingURL=chunk-
|
|
187
|
+
//# sourceMappingURL=chunk-5T4ZOHYF.ts.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
runCancellableOperation,
|
|
8
8
|
runCancellableTask
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZWP6HAYV.ts";
|
|
10
10
|
import {
|
|
11
11
|
SyncSetupReviewChangedError,
|
|
12
12
|
updateSyncSetup
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
} from "./chunk-R3SAMXB6.ts";
|
|
37
37
|
import {
|
|
38
38
|
safeTerminalText
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-AMJRUXFT.ts";
|
|
40
40
|
|
|
41
41
|
// src/ui/remote-selection-ui.ts
|
|
42
42
|
import { defineMenu, runMenu } from "@narumitw/pi-tui-kit";
|
|
@@ -689,4 +689,4 @@ function combineSignals(sessionSignal, actionSignal) {
|
|
|
689
689
|
export {
|
|
690
690
|
showRemoteSelectionReview
|
|
691
691
|
};
|
|
692
|
-
//# sourceMappingURL=chunk-
|
|
692
|
+
//# sourceMappingURL=chunk-7NQ7SFZK.ts.map
|
|
@@ -6,8 +6,12 @@ var TERMINAL_CONTROLS = /[\u0000-\u001f\u007f-\u009f\u061c\u200b-\u200f\u202a-\u
|
|
|
6
6
|
function safeTerminalText(value) {
|
|
7
7
|
return value.replace(TERMINAL_CONTROLS, "?");
|
|
8
8
|
}
|
|
9
|
+
function snapshotPathLabel(value) {
|
|
10
|
+
return value.replace(TERMINAL_CONTROLS, (character) => `\\u${character.charCodeAt(0).toString(16).padStart(4, "0")}`);
|
|
11
|
+
}
|
|
9
12
|
|
|
10
13
|
export {
|
|
11
|
-
safeTerminalText
|
|
14
|
+
safeTerminalText,
|
|
15
|
+
snapshotPathLabel
|
|
12
16
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-AMJRUXFT.ts.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ui/terminal-text.ts"],
|
|
4
4
|
"sourcesContent": ["// biome-ignore lint/suspicious/noControlCharactersInRegex: Terminal and display-direction controls.\nconst TERMINAL_CONTROLS = /[\\u0000-\\u001f\\u007f-\\u009f\\u061c\\u200b-\\u200f\\u202a-\\u202e\\u2060-\\u2069\\ufeff]/gu;\n\nexport function safeTerminalText(value: string) {\n return value.replace(TERMINAL_CONTROLS, \"?\");\n}\n\n/** Escape before joining a multiline review; raw filesystem paths remain unchanged. */\nexport function snapshotPathLabel(value: string) {\n return value.replace(TERMINAL_CONTROLS, (character) => `\\\\u${character.charCodeAt(0).toString(16).padStart(4, \"0\")}`);\n}\n"],
|
|
5
|
-
"mappings": ";;;;AACA,IAAM,oBAAoB;AAEnB,SAAS,iBAAiB,OAAe;AAC9C,SAAO,MAAM,QAAQ,mBAAmB,GAAG;AAC7C;",
|
|
5
|
+
"mappings": ";;;;AACA,IAAM,oBAAoB;AAEnB,SAAS,iBAAiB,OAAe;AAC9C,SAAO,MAAM,QAAQ,mBAAmB,GAAG;AAC7C;AAGO,SAAS,kBAAkB,OAAe;AAC/C,SAAO,MAAM,QAAQ,mBAAmB,CAAC,cAAc,MAAM,UAAU,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,EAAE;AACtH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-R3SAMXB6.ts";
|
|
9
9
|
import {
|
|
10
10
|
safeTerminalText
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-AMJRUXFT.ts";
|
|
12
12
|
|
|
13
13
|
// src/ui/setup/directory-rules.ts
|
|
14
14
|
var DIRECTORY_SCOPE_ALWAYS_LOCAL = "Always local: Pi credentials (auth.json), project trust (trust.json), their locks, and Pi Sync's settings and service state. Rules cannot override these protections.";
|
|
@@ -135,4 +135,4 @@ export {
|
|
|
135
135
|
directoryScopeLines,
|
|
136
136
|
saveReviewedDraft
|
|
137
137
|
};
|
|
138
|
-
//# sourceMappingURL=chunk-
|
|
138
|
+
//# sourceMappingURL=chunk-HFMGK6A6.ts.map
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
promptDirectoryRules,
|
|
27
27
|
saveReviewedDraft,
|
|
28
28
|
starterDirectoryRules
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-HFMGK6A6.ts";
|
|
30
30
|
import {
|
|
31
31
|
addStorageConnection,
|
|
32
32
|
addSyncSetup,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
} from "./chunk-R3SAMXB6.ts";
|
|
46
46
|
import {
|
|
47
47
|
safeTerminalText
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-AMJRUXFT.ts";
|
|
49
49
|
|
|
50
50
|
// src/commands/setup-completions.ts
|
|
51
51
|
async function refreshTargetCompletions() {
|
|
@@ -289,7 +289,7 @@ async function finishSetup(ctx, name, message, join, signal) {
|
|
|
289
289
|
if (signal?.aborted) return;
|
|
290
290
|
ctx.ui.notify(message, "info");
|
|
291
291
|
if (!join) return;
|
|
292
|
-
const { showRemoteSelectionReview } = await import("./remote-selection-ui-
|
|
292
|
+
const { showRemoteSelectionReview } = await import("./remote-selection-ui-AE6FOEXH.ts");
|
|
293
293
|
if (signal?.aborted) return;
|
|
294
294
|
await showRemoteSelectionReview(ctx, name, signal, void 0, { origin: "settings" });
|
|
295
295
|
}
|
|
@@ -1038,4 +1038,4 @@ export {
|
|
|
1038
1038
|
showAddWebDavStorageProfile,
|
|
1039
1039
|
showEditWebDavStorageProfile
|
|
1040
1040
|
};
|
|
1041
|
-
//# sourceMappingURL=chunk-
|
|
1041
|
+
//# sourceMappingURL=chunk-JPTI4HFC.ts.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
promptDirectoryRules,
|
|
8
8
|
saveReviewedDraft,
|
|
9
9
|
summarizeDirectoryRules
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HFMGK6A6.ts";
|
|
11
11
|
import {
|
|
12
12
|
updateSyncSetup
|
|
13
13
|
} from "./chunk-NXWHPVXR.ts";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from "./chunk-LNZRNXNQ.ts";
|
|
28
28
|
import {
|
|
29
29
|
safeTerminalText
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-AMJRUXFT.ts";
|
|
31
31
|
|
|
32
32
|
// src/ui/excluded-paths-ui.ts
|
|
33
33
|
import { defineMenu, runMenu } from "@narumitw/pi-tui-kit";
|
|
@@ -271,4 +271,4 @@ export {
|
|
|
271
271
|
directoryScopeSummary,
|
|
272
272
|
showDirectoryScope
|
|
273
273
|
};
|
|
274
|
-
//# sourceMappingURL=chunk-
|
|
274
|
+
//# sourceMappingURL=chunk-N24HEZSA.ts.map
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-R3SAMXB6.ts";
|
|
15
15
|
import {
|
|
16
16
|
safeTerminalText
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-AMJRUXFT.ts";
|
|
18
18
|
|
|
19
19
|
// src/daemon/pi-client.ts
|
|
20
20
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -1411,7 +1411,7 @@ var PiDaemonClient = class {
|
|
|
1411
1411
|
this.validate();
|
|
1412
1412
|
if (!ctx.hasUI || !["tui", "rpc"].includes(ctx.mode)) throw new Error("This client cannot present safety reviews.");
|
|
1413
1413
|
const { title, confirmationLabel, summaryLines } = callback.payload;
|
|
1414
|
-
const { confirmMergeReview } = await import("./merge-review-
|
|
1414
|
+
const { confirmMergeReview } = await import("./merge-review-DXSERTCK.ts");
|
|
1415
1415
|
if (!isCurrent()) return false;
|
|
1416
1416
|
this.validate();
|
|
1417
1417
|
const result = await confirmMergeReview(
|
|
@@ -1473,7 +1473,7 @@ var PiDaemonClient = class {
|
|
|
1473
1473
|
if (!ctx.hasUI || !["tui", "rpc"].includes(ctx.mode)) throw new Error("This client cannot present safety reviews.");
|
|
1474
1474
|
let result;
|
|
1475
1475
|
if (callback.kind === "merge-review" && typeof payload.title === "string" && typeof payload.content === "string") {
|
|
1476
|
-
const { confirmMergeReview } = await import("./merge-review-
|
|
1476
|
+
const { confirmMergeReview } = await import("./merge-review-DXSERTCK.ts");
|
|
1477
1477
|
this.validate();
|
|
1478
1478
|
combined.throwIfAborted();
|
|
1479
1479
|
result = await confirmMergeReview(
|
|
@@ -1548,4 +1548,4 @@ export {
|
|
|
1548
1548
|
withPiDaemonClient,
|
|
1549
1549
|
remoteOperation
|
|
1550
1550
|
};
|
|
1551
|
-
//# sourceMappingURL=chunk-
|
|
1551
|
+
//# sourceMappingURL=chunk-SPXEDJ2G.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
|
showRemoteSelectionReview
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7NQ7SFZK.ts";
|
|
6
6
|
import {
|
|
7
7
|
runCancellableOperation
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZWP6HAYV.ts";
|
|
9
9
|
import {
|
|
10
10
|
loadConfig,
|
|
11
11
|
syncConfigReviewIdentity
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-6YKOHBSC.ts";
|
|
16
16
|
import {
|
|
17
17
|
safeTerminalText
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-AMJRUXFT.ts";
|
|
19
19
|
|
|
20
20
|
// src/ui/sync-resolution-ui.ts
|
|
21
21
|
import { defineMenu, runMenu } from "@narumitw/pi-tui-kit";
|
|
@@ -208,4 +208,4 @@ async function dispatchManagerResult(ctx, initialResult, origin, runRoute, signa
|
|
|
208
208
|
export {
|
|
209
209
|
dispatchManagerResult
|
|
210
210
|
};
|
|
211
|
-
//# sourceMappingURL=chunk-
|
|
211
|
+
//# sourceMappingURL=chunk-V4IGBXBA.ts.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
// src/ui/cancellable-operation.ts
|
|
5
5
|
import { BorderedLoader } from "@earendil-works/pi-coding-agent";
|
|
6
|
-
import { isKeyRelease, Key, matchesKey, truncateToWidth } from "@earendil-works/pi-tui";
|
|
6
|
+
import { getKeybindings, isKeyRelease, Key, matchesKey, truncateToWidth } from "@earendil-works/pi-tui";
|
|
7
7
|
import { formatInteractionHints, runCustomInteraction } from "@narumitw/pi-tui-kit";
|
|
8
8
|
async function runCancellableOperation(ctx, message, route, runRoute, options = {}) {
|
|
9
9
|
const result = await runCancellableTask(
|
|
@@ -18,6 +18,7 @@ async function runCancellableTask(ctx, message, task, options = {}) {
|
|
|
18
18
|
const {
|
|
19
19
|
commitAware = false,
|
|
20
20
|
cancelAcrossDialogs = false,
|
|
21
|
+
closeOnHardCancel = false,
|
|
21
22
|
cancelledMessage = "Check cancelled; no settings or files were changed.",
|
|
22
23
|
signal,
|
|
23
24
|
isCurrent = () => true
|
|
@@ -30,19 +31,26 @@ async function runCancellableTask(ctx, message, task, options = {}) {
|
|
|
30
31
|
signal,
|
|
31
32
|
isCurrent: () => !signal?.aborted && isCurrent(),
|
|
32
33
|
create: ({ tui, theme, keybindings, signal: interactionSignal, complete }) => {
|
|
34
|
+
if (closeOnHardCancel && tui.mode === "fullscreen" && ["", "\x1B[99;5u"].some((input) => getKeybindings().matches(input, "tui.altScreen.search"))) {
|
|
35
|
+
ctx.ui.notify("Fullscreen search uses Ctrl+C. Change that binding before opening View differences.", "warning");
|
|
36
|
+
complete({ cancelled: "close" });
|
|
37
|
+
return { render: () => [], invalidate() {
|
|
38
|
+
} };
|
|
39
|
+
}
|
|
33
40
|
const loader = new BorderedLoader(tui, theme, message, { cancellable: false });
|
|
34
41
|
const cancelHint = formatInteractionHints(keybindings, [
|
|
35
|
-
{
|
|
42
|
+
closeOnHardCancel ? { keys: ["ctrl+c"], label: "close" } : {
|
|
36
43
|
keys: [...keybindings.getKeys("tui.select.cancel").filter((key) => !hasControlCharacter(key)), "ctrl+c"],
|
|
37
44
|
label: "cancel"
|
|
38
45
|
}
|
|
39
46
|
]);
|
|
40
47
|
const cancel = (data) => {
|
|
41
48
|
if (isKeyRelease(data)) return false;
|
|
42
|
-
|
|
49
|
+
const hardCancel = matchesKey(data, Key.ctrl("c"));
|
|
50
|
+
if (!hardCancel && !keybindings.matches(data, "tui.select.cancel")) return false;
|
|
43
51
|
if (commitStarted) {
|
|
44
52
|
ctx.ui.notify("Applying or publishing has started and cannot be cancelled safely.", "warning");
|
|
45
|
-
} else complete({ cancelled:
|
|
53
|
+
} else complete({ cancelled: closeOnHardCancel && hardCancel ? "close" : "back" });
|
|
46
54
|
return true;
|
|
47
55
|
};
|
|
48
56
|
let activeDialogs = 0;
|
|
@@ -85,6 +93,7 @@ async function runCancellableTask(ctx, message, task, options = {}) {
|
|
|
85
93
|
];
|
|
86
94
|
},
|
|
87
95
|
invalidate: () => loader.invalidate(),
|
|
96
|
+
capturesViewportInput: closeOnHardCancel,
|
|
88
97
|
handleInput: cancel,
|
|
89
98
|
dispose() {
|
|
90
99
|
unsubscribe?.();
|
|
@@ -96,7 +105,8 @@ async function runCancellableTask(ctx, message, task, options = {}) {
|
|
|
96
105
|
});
|
|
97
106
|
if (interaction.kind === "error") throw interaction.error;
|
|
98
107
|
if (interaction.kind !== "completed") return { kind: "closed" };
|
|
99
|
-
if (interaction.value.cancelled) {
|
|
108
|
+
if (interaction.value.cancelled === "close") return { kind: "closed" };
|
|
109
|
+
if (interaction.value.cancelled === "back") {
|
|
100
110
|
if (cancelledMessage) ctx.ui.notify(cancelledMessage, "info");
|
|
101
111
|
return { kind: "cancelled" };
|
|
102
112
|
}
|
|
@@ -111,4 +121,4 @@ export {
|
|
|
111
121
|
runCancellableOperation,
|
|
112
122
|
runCancellableTask
|
|
113
123
|
};
|
|
114
|
-
//# sourceMappingURL=chunk-
|
|
124
|
+
//# sourceMappingURL=chunk-ZWP6HAYV.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/ui/cancellable-operation.ts"],
|
|
4
|
+
"sourcesContent": ["import { BorderedLoader, type ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport { getKeybindings, isKeyRelease, Key, matchesKey, truncateToWidth } from \"@earendil-works/pi-tui\";\nimport type { ForegroundTransferIntent } from \"@narumitw/pi-sync-daemon\";\nimport { formatInteractionHints, runCustomInteraction } from \"@narumitw/pi-tui-kit\";\nimport type { SetupPullOutcome } from \"../sync/setup-switch.js\";\nimport type { SyncDecision } from \"../sync/sync-decision.js\";\nimport type { RemoteSelectionDecision } from \"../sync/sync-policy.js\";\n\nexport type RunRouteResult =\n | { kind: \"completed\"; outcome?: SetupPullOutcome }\n | { kind: \"decision-required\"; decision: SyncDecision }\n | { kind: \"remote-selection-required\"; decision: RemoteSelectionDecision }\n | { kind: \"destination-conflict\" }\n | { kind: \"closed\" }\n | { kind: \"failed\" };\n\nexport interface DirectionalIntent {\n fingerprint: string;\n intent: ForegroundTransferIntent;\n}\n\nexport type RunRouteIntent = DirectionalIntent | { intent: \"read-diff\"; fingerprint: string };\n\nexport type RunRoute = (\n route: string,\n signal?: AbortSignal,\n onCommit?: () => void,\n target?: string,\n onDialog?: (active: boolean) => void,\n retryRefusal?: boolean,\n intent?: RunRouteIntent,\n) => Promise<RunRouteResult | undefined>;\n\nexport type CancellableOperationResult = RunRouteResult | { kind: \"cancelled\" };\n\ninterface CancellableOperationOptions {\n commitAware?: boolean;\n cancelAcrossDialogs?: boolean;\n closeOnHardCancel?: boolean;\n cancelledMessage?: string | null;\n target?: string;\n directional?: DirectionalIntent;\n signal?: AbortSignal;\n isCurrent?: () => boolean;\n}\n\nexport async function runCancellableOperation(\n ctx: ExtensionContext,\n message: string,\n route: string,\n runRoute: RunRoute,\n options: CancellableOperationOptions = {},\n): Promise<CancellableOperationResult> {\n const result = await runCancellableTask(\n ctx,\n message,\n (signal, onCommit, onDialog) =>\n runRoute(route, signal, onCommit, options.target, onDialog, undefined, options.directional),\n options,\n );\n return result.kind === \"completed\" ? (result.value ?? { kind: \"failed\" }) : result;\n}\n\nexport type CancellableTaskResult<Value> =\n | { kind: \"completed\"; value: Value }\n | { kind: \"closed\" }\n | { kind: \"cancelled\" };\n\ntype TaskInteraction = { cancelled?: \"back\" | \"close\"; error?: unknown };\n\n/** Keep non-route work under the same cancellation and drain owner as transfers. */\nexport async function runCancellableTask<Value>(\n ctx: ExtensionContext,\n message: string,\n task: (\n signal: AbortSignal | undefined,\n onCommit?: () => void,\n onDialog?: (active: boolean) => void,\n ) => Promise<Value>,\n options: Omit<CancellableOperationOptions, \"target\" | \"directional\"> = {},\n): Promise<CancellableTaskResult<Value>> {\n const {\n commitAware = false,\n cancelAcrossDialogs = false,\n closeOnHardCancel = false,\n cancelledMessage = \"Check cancelled; no settings or files were changed.\",\n signal,\n isCurrent = () => true,\n } = options;\n if (signal?.aborted || !isCurrent()) return { kind: \"closed\" };\n if (ctx.mode !== \"tui\") return { kind: \"completed\", value: await task(signal) };\n let commitStarted = false;\n let taskResult!: Value;\n const interaction = await runCustomInteraction<TaskInteraction, ExtensionContext>(ctx, {\n signal,\n isCurrent: () => !signal?.aborted && isCurrent(),\n create: ({ tui, theme, keybindings, signal: interactionSignal, complete }) => {\n if (\n closeOnHardCancel &&\n tui.mode === \"fullscreen\" &&\n [\"\\u0003\", \"\\u001b[99;5u\"].some((input) => getKeybindings().matches(input, \"tui.altScreen.search\"))\n ) {\n ctx.ui.notify(\"Fullscreen search uses Ctrl+C. Change that binding before opening View differences.\", \"warning\");\n complete({ cancelled: \"close\" });\n return { render: () => [], invalidate() {} };\n }\n const loader = new BorderedLoader(tui, theme, message, { cancellable: false });\n const cancelHint = formatInteractionHints(keybindings, [\n closeOnHardCancel\n ? { keys: [\"ctrl+c\"], label: \"close\" }\n : {\n keys: [...keybindings.getKeys(\"tui.select.cancel\").filter((key) => !hasControlCharacter(key)), \"ctrl+c\"],\n label: \"cancel\",\n },\n ]);\n const cancel = (data: string) => {\n // Raw terminal listeners run before Pi filters Kitty key releases.\n if (isKeyRelease(data)) return false;\n const hardCancel = matchesKey(data, Key.ctrl(\"c\"));\n if (!hardCancel && !keybindings.matches(data, \"tui.select.cancel\")) return false;\n if (commitStarted) {\n ctx.ui.notify(\"Applying or publishing has started and cannot be cancelled safely.\", \"warning\");\n } else complete({ cancelled: closeOnHardCancel && hardCancel ? \"close\" : \"back\" });\n return true;\n };\n // Pi dialogs replace this loader and restore the normal editor. Defer\n // ordinary keys while they are open; retain raw cancellation afterward.\n // Ctrl+C remains the root flow's hard-cancel path regardless of focus.\n let activeDialogs = 0;\n const unsubscribe = cancelAcrossDialogs\n ? ctx.ui.onTerminalInput((data) => {\n if (isKeyRelease(data)) return;\n if (activeDialogs > 0 && !matchesKey(data, Key.ctrl(\"c\"))) return;\n return cancel(data) ? { consume: true } : undefined;\n })\n : undefined;\n let pendingTask: Promise<Value>;\n try {\n pendingTask = task(\n interactionSignal,\n commitAware ? () => (commitStarted = true) : undefined,\n cancelAcrossDialogs\n ? (active) => {\n activeDialogs += active ? 1 : -1;\n }\n : undefined,\n );\n } catch (error) {\n unsubscribe?.();\n loader.dispose();\n throw error;\n }\n const operation = pendingTask.then(\n (result) => {\n taskResult = result;\n complete({});\n },\n (error: unknown) => complete({ error }),\n );\n return {\n render(width: number) {\n if (width <= 0) return [];\n const safeWidth = Math.max(1, width);\n const lines = loader.render(safeWidth);\n const bottomBorder = lines.at(-1);\n return [\n ...lines.slice(0, -1),\n truncateToWidth(theme.fg(\"dim\", cancelHint), safeWidth, \"\"),\n ...(bottomBorder === undefined ? [] : [bottomBorder]),\n ];\n },\n invalidate: () => loader.invalidate(),\n capturesViewportInput: closeOnHardCancel,\n handleInput: cancel,\n dispose() {\n unsubscribe?.();\n loader.dispose();\n },\n waitForPending: () => operation,\n };\n },\n });\n if (interaction.kind === \"error\") throw interaction.error;\n if (interaction.kind !== \"completed\") return { kind: \"closed\" };\n if (interaction.value.cancelled === \"close\") return { kind: \"closed\" };\n if (interaction.value.cancelled === \"back\") {\n if (cancelledMessage) ctx.ui.notify(cancelledMessage, \"info\");\n return { kind: \"cancelled\" };\n }\n if (interaction.value.error) throw interaction.value.error;\n return { kind: \"completed\", value: taskResult };\n}\n\nfunction hasControlCharacter(value: string) {\n // biome-ignore lint/suspicious/noControlCharactersInRegex: Unsafe key labels must be omitted.\n return /[\\u0000-\\u001f\\u007f-\\u009f]/u.test(value);\n}\n"],
|
|
5
|
+
"mappings": ";;;;AAAA,SAAS,sBAA6C;AACtD,SAAS,gBAAgB,cAAc,KAAK,YAAY,uBAAuB;AAE/E,SAAS,wBAAwB,4BAA4B;AA2C7D,eAAsB,wBACpB,KACA,SACA,OACA,UACA,UAAuC,CAAC,GACH;AACrC,QAAM,SAAS,MAAM;AAAA,IACnB;AAAA,IACA;AAAA,IACA,CAAC,QAAQ,UAAU,aACjB,SAAS,OAAO,QAAQ,UAAU,QAAQ,QAAQ,UAAU,QAAW,QAAQ,WAAW;AAAA,IAC5F;AAAA,EACF;AACA,SAAO,OAAO,SAAS,cAAe,OAAO,SAAS,EAAE,MAAM,SAAS,IAAK;AAC9E;AAUA,eAAsB,mBACpB,KACA,SACA,MAKA,UAAuE,CAAC,GACjC;AACvC,QAAM;AAAA,IACJ,cAAc;AAAA,IACd,sBAAsB;AAAA,IACtB,oBAAoB;AAAA,IACpB,mBAAmB;AAAA,IACnB;AAAA,IACA,YAAY,MAAM;AAAA,EACpB,IAAI;AACJ,MAAI,QAAQ,WAAW,CAAC,UAAU,EAAG,QAAO,EAAE,MAAM,SAAS;AAC7D,MAAI,IAAI,SAAS,MAAO,QAAO,EAAE,MAAM,aAAa,OAAO,MAAM,KAAK,MAAM,EAAE;AAC9E,MAAI,gBAAgB;AACpB,MAAI;AACJ,QAAM,cAAc,MAAM,qBAAwD,KAAK;AAAA,IACrF;AAAA,IACA,WAAW,MAAM,CAAC,QAAQ,WAAW,UAAU;AAAA,IAC/C,QAAQ,CAAC,EAAE,KAAK,OAAO,aAAa,QAAQ,mBAAmB,SAAS,MAAM;AAC5E,UACE,qBACA,IAAI,SAAS,gBACb,CAAC,KAAU,YAAc,EAAE,KAAK,CAAC,UAAU,eAAe,EAAE,QAAQ,OAAO,sBAAsB,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a,OAAO,WAAW;AAChD;AAEA,SAAS,oBAAoB,OAAe;AAE1C,SAAO,gCAAgC,KAAK,KAAK;AACnD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
readStateForConfig,
|
|
10
10
|
syncAttentionMatchesConfig,
|
|
11
11
|
syncStateFingerprint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5T4ZOHYF.ts";
|
|
13
13
|
import {
|
|
14
14
|
combineSignals,
|
|
15
15
|
throwIfAborted
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
CompletedDirectionalRecoveryError,
|
|
37
37
|
piDaemonClient,
|
|
38
38
|
remoteOperation
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-SPXEDJ2G.ts";
|
|
40
40
|
import {
|
|
41
41
|
setSyncStatus
|
|
42
42
|
} from "./chunk-H7VOTY5N.ts";
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
} from "./chunk-R3SAMXB6.ts";
|
|
52
52
|
import {
|
|
53
53
|
safeTerminalText
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-AMJRUXFT.ts";
|
|
55
55
|
|
|
56
56
|
// src/commands/command-execution.ts
|
|
57
57
|
import { isDestinationConflict } from "#pi-sync-daemon";
|
|
@@ -171,8 +171,9 @@ async function executeRecoveryCommand(rawArgs, ctx, signal, loaders, onCommit, s
|
|
|
171
171
|
return { kind: "failed" };
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
async function executeCommand(rawArgs, ctx, signal, loaders, onCommit, setup, onDialog, retryRefusal = false,
|
|
174
|
+
async function executeCommand(rawArgs, ctx, signal, loaders, onCommit, setup, onDialog, retryRefusal = false, intent) {
|
|
175
175
|
ctx = trackOperationDialogs(ctx, onDialog);
|
|
176
|
+
const directional = intent?.intent === "read-diff" ? void 0 : intent;
|
|
176
177
|
try {
|
|
177
178
|
const directionalClient = directional === void 0 ? void 0 : piDaemonClient(ctx);
|
|
178
179
|
const command = await resolveSyncCommand(rawArgs, ctx);
|
|
@@ -193,6 +194,10 @@ async function executeCommand(rawArgs, ctx, signal, loaders, onCommit, setup, on
|
|
|
193
194
|
if (signal) options.signal = signal;
|
|
194
195
|
if (onCommit) options.onCommit = onCommit;
|
|
195
196
|
validateCommandOptions(subcommand, options);
|
|
197
|
+
if (intent?.intent === "read-diff") {
|
|
198
|
+
if (subcommand !== "diff" || !setup || rest.length) throw new Error("Invalid diff review action.");
|
|
199
|
+
options.diffReviewFingerprint = intent.fingerprint;
|
|
200
|
+
}
|
|
196
201
|
if (retryRefusal) throw new Error("Model retries are no longer supported. Use reviewed manual sync.");
|
|
197
202
|
switch (subcommand) {
|
|
198
203
|
case "daemon": {
|
|
@@ -200,7 +205,7 @@ async function executeCommand(rawArgs, ctx, signal, loaders, onCommit, setup, on
|
|
|
200
205
|
const action = options.args[0] ?? "status";
|
|
201
206
|
if (action === "recover") {
|
|
202
207
|
if (rest.length !== 1) throw new Error("Usage: /sync daemon recover");
|
|
203
|
-
const { recoverDaemonOwnership } = await import("./ownership-recovery-
|
|
208
|
+
const { recoverDaemonOwnership } = await import("./ownership-recovery-5KXAMFSL.ts");
|
|
204
209
|
await recoverDaemonOwnership(ctx, client, signal);
|
|
205
210
|
} else if (action === "handover") {
|
|
206
211
|
await client.run("daemon.handover", {}, options.signal);
|
|
@@ -238,7 +243,7 @@ async function executeCommand(rawArgs, ctx, signal, loaders, onCommit, setup, on
|
|
|
238
243
|
await initConfig(ctx, signal);
|
|
239
244
|
return { kind: "completed" };
|
|
240
245
|
case "files": {
|
|
241
|
-
const { showFileSelection } = await import("./file-selection-
|
|
246
|
+
const { showFileSelection } = await import("./file-selection-2H3J2HTX.ts");
|
|
242
247
|
throwIfAborted(options.signal);
|
|
243
248
|
await showFileSelection(ctx, options.setup, options.signal);
|
|
244
249
|
return { kind: "completed" };
|
|
@@ -246,11 +251,11 @@ async function executeCommand(rawArgs, ctx, signal, loaders, onCommit, setup, on
|
|
|
246
251
|
case "diff": {
|
|
247
252
|
const operations = await loaders.operations();
|
|
248
253
|
throwIfAborted(options.signal);
|
|
249
|
-
await operations.diff(ctx, options);
|
|
250
|
-
return { kind: "completed" };
|
|
254
|
+
const result = await operations.diff(ctx, options);
|
|
255
|
+
return { kind: result === "close" ? "closed" : "completed" };
|
|
251
256
|
}
|
|
252
257
|
case "conflicts": {
|
|
253
|
-
const { showConflicts } = await import("./conflict-review-
|
|
258
|
+
const { showConflicts } = await import("./conflict-review-QI77P7KL.ts");
|
|
254
259
|
throwIfAborted(options.signal);
|
|
255
260
|
await showConflicts(ctx, options);
|
|
256
261
|
return { kind: "completed" };
|
|
@@ -358,7 +363,7 @@ async function initConfig(ctx, signal) {
|
|
|
358
363
|
return;
|
|
359
364
|
}
|
|
360
365
|
if (ctx.mode === "tui") {
|
|
361
|
-
const { showSetupWizard } = await import("./setup-wizard-
|
|
366
|
+
const { showSetupWizard } = await import("./setup-wizard-FBX7RTZ6.ts");
|
|
362
367
|
throwIfAborted(signal);
|
|
363
368
|
await showSetupWizard(ctx, signal);
|
|
364
369
|
return;
|
|
@@ -377,7 +382,7 @@ async function handleCommand(rawArgs, ctx, sessionSignal, loaders, attention, on
|
|
|
377
382
|
}
|
|
378
383
|
if (!needsDaemonRecovery?.()) await reconcileObservation(attention, sessionSignal);
|
|
379
384
|
if (sessionSignal.aborted) return;
|
|
380
|
-
const run = (route, signal, onCommit, target, onDialog, retryRefusal = false,
|
|
385
|
+
const run = (route, signal, onCommit, target, onDialog, retryRefusal = false, intent) => {
|
|
381
386
|
const [command, ...args2] = splitArgs(route);
|
|
382
387
|
if (command === "sync" && !retryRefusal) {
|
|
383
388
|
try {
|
|
@@ -396,13 +401,13 @@ async function handleCommand(rawArgs, ctx, sessionSignal, loaders, attention, on
|
|
|
396
401
|
target,
|
|
397
402
|
onDialog,
|
|
398
403
|
retryRefusal,
|
|
399
|
-
|
|
404
|
+
intent
|
|
400
405
|
);
|
|
401
406
|
};
|
|
402
407
|
if (!rawArgs.trim()) {
|
|
403
408
|
attention.expand();
|
|
404
409
|
try {
|
|
405
|
-
const { showSyncManager } = await import("./manager-ui-
|
|
410
|
+
const { showSyncManager } = await import("./manager-ui-RQSZLMJ5.ts");
|
|
406
411
|
if (sessionSignal.aborted) return;
|
|
407
412
|
await showSyncManager(ctx, run, sessionSignal, {
|
|
408
413
|
needsDaemonRecovery,
|
|
@@ -505,7 +510,7 @@ function directSelectionOrigin(rawArgs) {
|
|
|
505
510
|
async function resolveSelectionAttention(ctx, attention, signal, loaders, options = {}) {
|
|
506
511
|
const current = attention.current();
|
|
507
512
|
if (!current || signal.aborted) return;
|
|
508
|
-
const { dispatchManagerResult } = await import("./manager-result-dispatcher-
|
|
513
|
+
const { dispatchManagerResult } = await import("./manager-result-dispatcher-YXSDLTLV.ts");
|
|
509
514
|
if (signal.aborted || attention.current() !== current) return;
|
|
510
515
|
await dispatchManagerResult(
|
|
511
516
|
ctx,
|
|
@@ -536,4 +541,4 @@ export {
|
|
|
536
541
|
handleCommand,
|
|
537
542
|
resolveSelectionAttention
|
|
538
543
|
};
|
|
539
|
-
//# sourceMappingURL=command-handler-
|
|
544
|
+
//# sourceMappingURL=command-handler-4XHK5PVX.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/command-execution.ts", "../../src/daemon/daemon-status-ui.ts", "../../src/ui/operation-dialogs.ts", "../../src/commands/command-handler.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ExtensionCommandContext, ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport { isDestinationConflict } from \"@narumitw/pi-sync-daemon\";\nimport { showDaemonStatus } from \"../daemon/daemon-status-ui.js\";\nimport { CompletedDirectionalRecoveryError } from \"../daemon/directional-recovery.js\";\nimport { type PiDaemonClient, piDaemonClient, remoteOperation } from \"../daemon/pi-client.js\";\nimport { activeLocalConfigPath, createLocalConfigDocument, localConfigPath } from \"../settings/config-file.js\";\nimport { localConfigTemplate, readLocalConfigObject } from \"../settings/settings-store.js\";\nimport { throwIfAborted } from \"../sync/signals.js\";\nimport { syncErrorGuidance } from \"../sync/sync-error-guidance.js\";\nimport { errorMessage, isSyncDecisionRequiredError, SetupPullRequiresUiError } from \"../sync/sync-errors.js\";\nimport type { SyncLoaders } from \"../sync/sync-loaders.js\";\nimport { RemoteSelectionMismatchError } from \"../sync/sync-policy.js\";\nimport type { DirectionalIntent, RunRouteIntent, RunRouteResult } from \"../ui/cancellable-operation.js\";\nimport { trackOperationDialogs } from \"../ui/operation-dialogs.js\";\nimport { setSyncStatus } from \"../ui/sync-status.js\";\nimport { safeTerminalText } from \"../ui/terminal-text.js\";\nimport {\n parseOptions,\n resolveSyncCommand,\n retiredSyncCommandGuidance,\n splitArgs,\n usage,\n validateCommandOptions,\n} from \"./command.js\";\nimport type { CommandOptions } from \"./command-types.js\";\n\nexport async function executeRecoveryCommand(\n rawArgs: string,\n ctx: ExtensionContext,\n signal: AbortSignal | undefined,\n loaders: SyncLoaders,\n onCommit?: () => void,\n setup?: string,\n): Promise<RunRouteResult> {\n try {\n const [subcommand, ...rest] = splitArgs(rawArgs);\n if (subcommand !== \"sync\" && subcommand !== \"pull\" && subcommand !== \"push\") {\n throw new Error(`Unsupported sync recovery route: ${subcommand ?? \"missing\"}`);\n }\n const options = parseOptions(rest);\n if (setup !== undefined) options.setup = setup;\n if (signal) options.signal = signal;\n if (onCommit) options.onCommit = onCommit;\n options.reload = false;\n options.auto = false;\n validateCommandOptions(subcommand, options);\n const operations = await loaders.operations();\n throwIfAborted(options.signal);\n if (subcommand === \"push\") {\n const outcome = await operations.push(ctx, options);\n return { kind: \"completed\", ...(outcome ? { outcome } : {}) };\n }\n if (subcommand === \"pull\") {\n const outcome = await operations.pull(ctx, options);\n return { kind: \"completed\", ...(outcome ? { outcome } : {}) };\n }\n await operations.syncBoth(ctx, options);\n return { kind: \"completed\" };\n } catch (error) {\n if (signal?.aborted) return { kind: \"failed\" };\n setSyncStatus(ctx, undefined);\n if (error instanceof RemoteSelectionMismatchError) {\n return { kind: \"remote-selection-required\", decision: error.decision };\n }\n if (isSyncDecisionRequiredError(error)) {\n return { kind: \"decision-required\", decision: error.decision };\n }\n ctx.ui.notify(syncErrorGuidance(error), \"error\");\n return { kind: \"failed\" };\n }\n}\n\nexport async function executeCommand(\n rawArgs: string,\n ctx: ExtensionCommandContext,\n signal: AbortSignal | undefined,\n loaders: SyncLoaders,\n onCommit?: () => void,\n setup?: string,\n onDialog?: (active: boolean) => void,\n retryRefusal = false,\n intent?: RunRouteIntent,\n): Promise<RunRouteResult> {\n ctx = trackOperationDialogs(ctx, onDialog);\n const directional = intent?.intent === \"read-diff\" ? undefined : intent;\n try {\n const directionalClient = directional === undefined ? undefined : piDaemonClient(ctx);\n const command = await resolveSyncCommand(rawArgs, ctx);\n if (signal?.aborted || !command) return { kind: \"completed\" };\n const { subcommand, rest } = command;\n const retired = retiredSyncCommandGuidance(subcommand);\n if (retired) {\n ctx.ui.notify(retired, \"warning\");\n return { kind: \"failed\" };\n }\n if (directionalClient && directional) {\n if ((subcommand !== \"push\" && subcommand !== \"pull\") || rest.length || !setup || retryRefusal)\n throw new Error(\"Invalid directional action.\");\n return await runDirectionalAction(directionalClient, ctx, subcommand, setup, directional, signal, onCommit);\n }\n const options = parseOptions(rest);\n if (setup !== undefined) options.setup = setup;\n if (signal) options.signal = signal;\n if (onCommit) options.onCommit = onCommit;\n validateCommandOptions(subcommand, options);\n if (intent?.intent === \"read-diff\") {\n if (subcommand !== \"diff\" || !setup || rest.length) throw new Error(\"Invalid diff review action.\");\n options.diffReviewFingerprint = intent.fingerprint;\n }\n if (retryRefusal) throw new Error(\"Model retries are no longer supported. Use reviewed manual sync.\");\n\n switch (subcommand) {\n case \"daemon\": {\n const client = piDaemonClient(ctx);\n const action = options.args[0] ?? \"status\";\n if (action === \"recover\") {\n if (rest.length !== 1) throw new Error(\"Usage: /sync daemon recover\");\n const { recoverDaemonOwnership } = await import(\"../daemon/ownership-recovery.js\");\n await recoverDaemonOwnership(ctx, client, signal);\n } else if (action === \"handover\") {\n await client.run(\"daemon.handover\", {}, options.signal);\n } else if (action === \"allow-after-exit\") {\n throw new Error(\"Continuous sync was retired. New after-exit grants are not supported.\");\n } else if (action === \"revoke-after-exit\") {\n await client.run(\"daemon.handover\", {}, options.signal);\n const policy = (await client.run(\"daemon.policy\", {}, options.signal)) as { fingerprint: string };\n await client.run(\"daemon.authorize\", { fingerprint: policy.fingerprint, afterExit: false }, options.signal);\n } else if (action === \"status\") {\n await showDaemonStatus(ctx, client, options.signal);\n } else throw new Error(\"Use /sync daemon status|recover|handover|allow-after-exit|revoke-after-exit.\");\n return { kind: \"completed\" };\n }\n case \"help\":\n ctx.ui.notify(usage(), \"info\");\n return { kind: \"completed\" };\n case \"use\": {\n const { useSyncSetup } = await loaders.setupSwitch();\n throwIfAborted(options.signal);\n await useSyncSetup(\n ctx,\n options.args[0] ?? \"\",\n async (selectedSetup) => {\n const operations = await loaders.operations();\n throwIfAborted(options.signal);\n return operations.pull(ctx, { ...options, setup: selectedSetup });\n },\n undefined,\n options.signal,\n );\n return { kind: \"completed\" };\n }\n case \"init\":\n await initConfig(ctx, signal);\n return { kind: \"completed\" };\n case \"files\": {\n const { showFileSelection } = await import(\"../ui/file-selection.js\");\n throwIfAborted(options.signal);\n await showFileSelection(ctx, options.setup, options.signal);\n return { kind: \"completed\" };\n }\n case \"diff\": {\n const operations = await loaders.operations();\n throwIfAborted(options.signal);\n const result = await operations.diff(ctx, options);\n return { kind: result === \"close\" ? \"closed\" : \"completed\" };\n }\n case \"conflicts\": {\n const { showConflicts } = await import(\"../sync/conflict-review.js\");\n throwIfAborted(options.signal);\n await showConflicts(ctx, options);\n return { kind: \"completed\" };\n }\n case \"push\": {\n const operations = await loaders.operations();\n throwIfAborted(options.signal);\n const outcome = await operations.push(ctx, options);\n return { kind: \"completed\", ...(outcome ? { outcome } : {}) };\n }\n case \"pull\": {\n const operations = await loaders.operations();\n throwIfAborted(options.signal);\n const outcome = await operations.pull(ctx, options);\n return { kind: \"completed\", ...(outcome ? { outcome } : {}) };\n }\n case \"sync\": {\n const operations = await loaders.operations();\n throwIfAborted(options.signal);\n const outcome = await operations.syncBoth(ctx, options);\n return { kind: \"completed\", ...(retryRefusal && outcome && outcome !== \"archived\" ? { outcome } : {}) };\n }\n case \"history\": {\n const operations = await loaders.operations();\n throwIfAborted(options.signal);\n await operations.history(ctx, options);\n return { kind: \"completed\" };\n }\n case \"rollback\": {\n const operations = await loaders.operations();\n throwIfAborted(options.signal);\n await operations.rollback(ctx, options);\n return { kind: \"completed\" };\n }\n case \"migrate-state\":\n await migrateStateDirectory(ctx, options);\n return { kind: \"completed\" };\n case \"unlock\":\n await remoteOperation(ctx, \"unlock\", options);\n return { kind: \"completed\" };\n default:\n ctx.ui.notify(`Unknown /sync command: ${subcommand}\\n\\n${usage()}`, \"warning\");\n return { kind: \"failed\" };\n }\n } catch (error) {\n if (signal?.aborted) return { kind: \"failed\" };\n setSyncStatus(ctx, undefined);\n if (directional) {\n ctx.ui.notify(safeTerminalText(errorMessage(error)).slice(0, 1200), \"error\");\n return { kind: \"failed\" };\n }\n if (error instanceof SetupPullRequiresUiError) throw error;\n if (error instanceof RemoteSelectionMismatchError) {\n return { kind: \"remote-selection-required\", decision: error.decision };\n }\n if (isSyncDecisionRequiredError(error)) {\n return { kind: \"decision-required\", decision: error.decision };\n }\n ctx.ui.notify(syncErrorGuidance(error), \"error\");\n return { kind: \"failed\" };\n }\n}\n\nasync function runDirectionalAction(\n client: PiDaemonClient,\n ctx: ExtensionCommandContext,\n direction: \"push\" | \"pull\",\n setup: string,\n directional: DirectionalIntent,\n signal: AbortSignal | undefined,\n onCommit: (() => void) | undefined,\n): Promise<RunRouteResult> {\n try {\n const operation = `${direction}.foreground`;\n const result = await client.run(operation, { setup, ...directional }, signal, ctx, onCommit);\n if (!client.canReportDirectionalResult()) return { kind: \"failed\" };\n if (\n signal?.aborted &&\n !(result && typeof result === \"object\" && \"outcome\" in result && result.outcome === \"applied\")\n )\n return { kind: \"failed\" };\n if (directional.intent === \"reject-conflicts\" && isDestinationConflict(result))\n return { kind: \"destination-conflict\" };\n if (\n typeof result !== \"object\" ||\n result === null ||\n !(\"outcome\" in result) ||\n (result.outcome !== \"applied\" && result.outcome !== \"cancelled\") ||\n (\"message\" in result && typeof result.message !== \"string\")\n ) {\n throw new Error(\"Invalid result from directional synchronization.\");\n }\n if (\"message\" in result && typeof result.message === \"string\" && result.message)\n ctx.ui.notify(safeTerminalText(result.message), \"info\");\n return signal?.aborted ? { kind: \"failed\" } : { kind: \"completed\", outcome: result.outcome };\n } catch (error) {\n const completed = error instanceof CompletedDirectionalRecoveryError;\n if (!client.canReportDirectionalResult() || (signal?.aborted && !completed)) return { kind: \"failed\" };\n if (!signal?.aborted) setSyncStatus(ctx, undefined);\n const message = safeTerminalText(errorMessage(error));\n ctx.ui.notify(completed ? message : message.slice(0, 1200), \"error\");\n return { kind: \"failed\" };\n }\n}\n\nasync function migrateStateDirectory(ctx: ExtensionCommandContext, options: CommandOptions) {\n const result = (await remoteOperation(ctx, \"migrate-state\", options)) as\n | { status: string; message?: string }\n | undefined;\n throwIfAborted(options.signal);\n ctx.ui.notify(\n result?.message ?? \"pi-sync already uses the canonical pi-sync/ state directory.\",\n result?.status === \"deferred\" ? \"warning\" : \"info\",\n );\n}\n\nasync function initConfig(ctx: ExtensionCommandContext, signal?: AbortSignal) {\n const configPath = localConfigPath();\n const existing = await readLocalConfigObject();\n throwIfAborted(signal);\n if (existing) {\n const activePath = await activeLocalConfigPath();\n throwIfAborted(signal);\n ctx.ui.notify(`Config already exists: ${activePath}`, \"info\");\n return;\n }\n\n if (ctx.mode === \"tui\") {\n const { showSetupWizard } = await import(\"../ui/setup/setup-wizard.js\");\n throwIfAborted(signal);\n await showSetupWizard(ctx, signal);\n return;\n }\n await createLocalConfigDocument(localConfigTemplate(), signal);\n throwIfAborted(signal);\n ctx.ui.notify(`Created ${configPath}. Add a storage connection and sync setup before syncing.`, \"info\");\n}\n", "import type { ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport { inspectDaemonStatus } from \"@narumitw/pi-sync-daemon\";\nimport { errorMessage } from \"../sync/sync-errors.js\";\nimport { safeTerminalText } from \"../ui/terminal-text.js\";\nimport type { PiDaemonClient } from \"./pi-client.js\";\n\nexport async function showDaemonStatus(ctx: ExtensionContext, client: PiDaemonClient, signal?: AbortSignal) {\n let attachedInstance: string | undefined;\n let connectionError: string | undefined;\n try {\n attachedInstance = (await client.verifyConnection(signal))?.identity.instance;\n } catch (error) {\n connectionError = safeTerminalText(errorMessage(error).slice(0, 1200));\n }\n signal?.throwIfAborted();\n client.validate();\n const status = await inspectDaemonStatus(client.root, signal);\n signal?.throwIfAborted();\n client.validate();\n if (!ctx.hasUI) return;\n const connected = status.running === true && status.instance === attachedInstance;\n const recovery = client.ownershipCleanupRequired || status.pendingUpgradePid !== undefined;\n const state = connected\n ? \"connected\"\n : status.running\n ? \"running; not connected\"\n : status.running === null\n ? \"owner could not be verified\"\n : \"not running\";\n const lines = [`pi-sync-daemon: ${state}${recovery ? \"; recovery required\" : \"\"}`];\n if (status.running) {\n lines.push(`PID: ${status.pid}`, `Instance: ${status.instance}`);\n lines.push(`Running build: ${formatBuild(status.buildVersion, status.buildId)}`);\n }\n lines.push(`Expected build: ${formatBuild(status.expectedBuildVersion, status.expectedBuildId)}`);\n if (status.pendingUpgradePid !== undefined) lines.push(`Pending replacement PID: ${status.pendingUpgradePid}`);\n const blocked = status.running ? client.blockedUpgradeReason(status.instance) : undefined;\n if (blocked) lines.push(`Upgrade blocked: ${blocked.slice(0, 1200)}`);\n else if (connectionError) lines.push(`Connection: ${connectionError}`);\n if (client.ownershipCleanupRequired) lines.push(\"Use /sync daemon recover to review and stop the daemon.\");\n else if (recovery || status.running === null)\n lines.push(\"Check daemon CLI status and follow daemon recovery. Do not force a restart.\");\n else if (status.running && (status.buildComparison === \"older\" || status.buildComparison === \"unversioned\")) {\n if (!blocked)\n lines.push(\n status.guardedUpgrade\n ? \"Daemon upgrade is required. Use /reload when sync work is idle.\"\n : \"This owner does not support guarded upgrades. When sync work is idle, use the intended daemon CLI restart, then /reload.\",\n );\n } else if (status.running && status.buildComparison === \"different\")\n lines.push(\"Same version, different build. Use the intended build's daemon CLI restart, then /reload.\");\n else if (status.running && status.buildComparison === \"unverified\")\n lines.push(\n \"Build match is unverified. Use the intended build's daemon CLI to inspect or explicitly restart, then /reload.\",\n );\n else if (status.running && status.buildComparison === \"newer\")\n lines.push(\"The running daemon is newer than the loaded build. It was left unchanged.\");\n else lines.push(\"Use pi-sync-daemon status/stop/restart --root <agent-directory> for explicit lifecycle control.\");\n ctx.ui.notify(lines.join(\"\\n\"), connected && !recovery ? \"info\" : \"warning\");\n}\n\nfunction formatBuild(version?: string, id?: string) {\n return `${version ?? \"unknown version\"} (${id?.slice(0, 12) ?? \"unknown build ID\"})`;\n}\n", "import type { ExtensionContext } from \"@earendil-works/pi-coding-agent\";\n\nexport function trackOperationDialogs<Context extends ExtensionContext>(\n ctx: Context,\n onDialog?: (active: boolean) => void,\n): Context {\n if (!onDialog) return ctx;\n const runDialog = async <Value>(task: () => Promise<Value>): Promise<Value> => {\n onDialog(true);\n try {\n return await task();\n } finally {\n onDialog(false);\n }\n };\n const ui: ExtensionContext[\"ui\"] = {\n ...ctx.ui,\n select: (...args) => runDialog(() => ctx.ui.select(...args)),\n confirm: (...args) => runDialog(() => ctx.ui.confirm(...args)),\n custom: (factory, options) => runDialog(() => ctx.ui.custom(factory, options)),\n };\n // Forward live context properties: copying the context would hide session\n // replacement from mutation-owner revalidation after a dialog settles.\n return new Proxy(ctx, {\n get(target, key, receiver) {\n return key === \"ui\" ? ui : Reflect.get(target, key, receiver);\n },\n });\n}\n", "import type { ExtensionCommandContext, ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport { loadConfig } from \"../settings/config.js\";\nimport { readStateForConfig, syncStateFingerprint } from \"../state/sync-state-store.js\";\nimport { combineSignals } from \"../sync/signals.js\";\nimport { errorMessage } from \"../sync/sync-errors.js\";\nimport type { SyncLoaders } from \"../sync/sync-loaders.js\";\nimport { formatRemoteSelectionMismatch } from \"../sync/sync-policy.js\";\nimport type { RunRouteIntent, RunRouteResult } from \"../ui/cancellable-operation.js\";\nimport {\n observationMatchesConfig,\n type SyncAttentionController,\n type SyncAttentionOrigin,\n syncAttentionMatchesConfig,\n} from \"../ui/sync-attention.js\";\nimport { setSyncStatus } from \"../ui/sync-status.js\";\nimport { parseOptions, splitArgs, validateCommandOptions } from \"./command.js\";\nimport { executeCommand, executeRecoveryCommand } from \"./command-execution.js\";\n\nexport async function handleCommand(\n rawArgs: string,\n ctx: ExtensionCommandContext,\n sessionSignal: AbortSignal,\n loaders: SyncLoaders,\n attention: SyncAttentionController,\n onExplicitSync?: (setup?: string) => void,\n needsDaemonRecovery?: () => boolean,\n) {\n const args = splitArgs(rawArgs);\n if (args[0] === \"daemon\" && args[1] === \"recover\") {\n await executeCommand(rawArgs, ctx, sessionSignal, loaders);\n return;\n }\n if (!needsDaemonRecovery?.()) await reconcileObservation(attention, sessionSignal);\n if (sessionSignal.aborted) return;\n const run = (\n route: string,\n signal?: AbortSignal,\n onCommit?: () => void,\n target?: string,\n onDialog?: (active: boolean) => void,\n retryRefusal = false,\n intent?: RunRouteIntent,\n ) => {\n const [command, ...args] = splitArgs(route);\n if (command === \"sync\" && !retryRefusal) {\n try {\n const options = parseOptions(args);\n validateCommandOptions(\"sync\", options);\n onExplicitSync?.(target ?? options.setup);\n } catch {\n /* Invalid routes do not request an automatic retry. */\n }\n }\n return executeCommand(\n route,\n ctx,\n combineSignals(sessionSignal, signal),\n loaders,\n observationCommitCallback(attention, sessionSignal, onCommit),\n target,\n onDialog,\n retryRefusal,\n intent,\n );\n };\n if (!rawArgs.trim()) {\n attention.expand();\n try {\n const { showSyncManager } = await import(\"../ui/manager-ui.js\");\n if (sessionSignal.aborted) return;\n await showSyncManager(ctx, run, sessionSignal, {\n needsDaemonRecovery,\n getAttention: () => attention.current(),\n getObservation: () => attention.observation(),\n onObservationInvalidated: () => attention.clearObservation(),\n onSelectionResolved: (expected) => {\n if (attention.current() === expected) attention.clear(ctx);\n },\n });\n } catch (error) {\n if (sessionSignal.aborted) return;\n setSyncStatus(ctx, undefined);\n ctx.ui.notify(errorMessage(error), \"error\");\n }\n if (sessionSignal.aborted || needsDaemonRecovery?.()) return;\n await reconcileObservation(attention, sessionSignal);\n if (!sessionSignal.aborted) await attention.publish(ctx, sessionSignal);\n return;\n }\n const result = await run(rawArgs);\n if (sessionSignal.aborted || needsDaemonRecovery?.()) return;\n if (result.kind === \"decision-required\") {\n ctx.ui.notify(result.decision.directMessage, \"error\");\n } else if (result.kind === \"remote-selection-required\") {\n const origin = directSelectionOrigin(rawArgs);\n if (origin) attention.set(result.decision, origin);\n const deterministic = splitArgs(rawArgs).some((arg) => arg === \"--yes\" || arg === \"-y\");\n if (origin && ctx.mode === \"tui\" && !deterministic) {\n await resolveSelectionAttention(ctx, attention, sessionSignal, loaders);\n } else {\n ctx.ui.notify(\n formatRemoteSelectionMismatch(\n result.decision.setupName,\n result.decision.localInclude,\n result.decision.remoteInclude,\n ),\n \"error\",\n );\n }\n }\n await clearAttentionAfterCompletedOperation(rawArgs, result, ctx, attention, sessionSignal);\n await reconcileSelectionAttention(ctx, attention, sessionSignal);\n await reconcileObservation(attention, sessionSignal);\n if (!sessionSignal.aborted) await attention.publish(ctx, sessionSignal);\n}\n\nfunction observationCommitCallback(\n attention: SyncAttentionController,\n sessionSignal: AbortSignal,\n onCommit?: () => void,\n) {\n const observed = attention.observation();\n return () => {\n // Opening or cancelling a review changes nothing. A commit may change data\n // even if later publication/baseline cleanup fails; never restore old hints.\n if (!sessionSignal.aborted && attention.observation() === observed) attention.clearObservation();\n onCommit?.();\n };\n}\n\nasync function reconcileObservation(attention: SyncAttentionController, signal: AbortSignal) {\n const observed = attention.observation();\n if (!observed || signal.aborted) return;\n try {\n const config = await loadConfig();\n if (signal.aborted || attention.observation() !== observed) return;\n if (!observationMatchesConfig(observed, config)) {\n attention.clearObservation();\n return;\n }\n const state = await readStateForConfig(config);\n if (signal.aborted || attention.observation() !== observed) return;\n if (syncStateFingerprint(state) !== observed.inspection.stateIdentity) attention.clearObservation();\n } catch {\n if (!signal.aborted && attention.observation() === observed) attention.clearObservation();\n }\n}\n\nasync function clearAttentionAfterCompletedOperation(\n rawArgs: string,\n result: RunRouteResult,\n ctx: ExtensionContext,\n attention: SyncAttentionController,\n signal: AbortSignal,\n) {\n if (result.kind !== \"completed\" || result.outcome === \"cancelled\" || signal.aborted) return;\n const [command, ...rest] = splitArgs(rawArgs);\n if (command !== \"sync\" && command !== \"pull\" && command !== \"push\") return;\n const current = attention.current();\n if (!current) return;\n try {\n const options = parseOptions(rest);\n const setupName = options.setup ?? (await loadConfig()).setupName;\n if (signal.aborted || attention.current() !== current) return;\n if (current.decision.setupName === setupName) attention.clear(ctx);\n } catch {\n // Attention reconciliation below owns malformed or concurrently changed settings.\n }\n}\n\nasync function reconcileSelectionAttention(\n ctx: ExtensionContext,\n attention: SyncAttentionController,\n signal: AbortSignal,\n) {\n const current = attention.current();\n if (!current || signal.aborted) return;\n try {\n const config = await loadConfig(current.decision.setupName);\n if (signal.aborted || attention.current() !== current) return;\n if (!syncAttentionMatchesConfig(current, config)) attention.clear(ctx);\n } catch {\n if (!signal.aborted && attention.current() === current) attention.clear(ctx);\n }\n}\n\nfunction directSelectionOrigin(rawArgs: string): SyncAttentionOrigin | undefined {\n const command = splitArgs(rawArgs)[0];\n return command === \"sync\" || command === \"pull\" || command === \"push\" ? command : undefined;\n}\n\nexport async function resolveSelectionAttention(\n ctx: ExtensionContext,\n attention: SyncAttentionController,\n signal: AbortSignal,\n loaders: SyncLoaders,\n options: {\n cancelLabel?: string;\n withStateAccess?: <T>(task: () => Promise<T>) => Promise<T>;\n } = {},\n) {\n const current = attention.current();\n if (!current || signal.aborted) return;\n const { dispatchManagerResult } = await import(\"../ui/manager-result-dispatcher.js\");\n if (signal.aborted || attention.current() !== current) return;\n await dispatchManagerResult(\n ctx,\n { kind: \"remote-selection-required\", decision: current.decision },\n current.origin,\n (route, actionSignal, onCommit, target) => {\n const execute = () =>\n executeRecoveryCommand(\n route,\n ctx,\n combineSignals(signal, actionSignal),\n loaders,\n observationCommitCallback(attention, signal, onCommit),\n target,\n );\n return options.withStateAccess ? options.withStateAccess(execute) : execute();\n },\n signal,\n {\n cancelLabel: options.cancelLabel,\n withStateAccess: options.withStateAccess,\n onSelectionResolved: () => {\n if (attention.current() === current) attention.clear(ctx);\n },\n },\n );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,6BAA6B;;;ACAtC,SAAS,2BAA2B;AAKpC,eAAsB,iBAAiB,KAAuB,QAAwB,QAAsB;AAC1G,MAAI;AACJ,MAAI;AACJ,MAAI;AACF,wBAAoB,MAAM,OAAO,iBAAiB,MAAM,IAAI,SAAS;AAAA,EACvE,SAAS,OAAO;AACd,sBAAkB,iBAAiB,aAAa,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;AAAA,EACvE;AACA,UAAQ,eAAe;AACvB,SAAO,SAAS;AAChB,QAAM,SAAS,MAAM,oBAAoB,OAAO,MAAM,MAAM;AAC5D,UAAQ,eAAe;AACvB,SAAO,SAAS;AAChB,MAAI,CAAC,IAAI,MAAO;AAChB,QAAM,YAAY,OAAO,YAAY,QAAQ,OAAO,aAAa;AACjE,QAAM,WAAW,OAAO,4BAA4B,OAAO,sBAAsB;AACjF,QAAM,QAAQ,YACV,cACA,OAAO,UACL,2BACA,OAAO,YAAY,OACjB,gCACA;AACR,QAAM,QAAQ,CAAC,mBAAmB,KAAK,GAAG,WAAW,wBAAwB,EAAE,EAAE;AACjF,MAAI,OAAO,SAAS;AAClB,UAAM,K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+
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
3
|
import {
|
|
4
4
|
remoteOperation
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-SPXEDJ2G.ts";
|
|
6
6
|
import "./chunk-H7VOTY5N.ts";
|
|
7
7
|
import "./chunk-6YKOHBSC.ts";
|
|
8
8
|
import "./chunk-R3SAMXB6.ts";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-AMJRUXFT.ts";
|
|
10
10
|
|
|
11
11
|
// src/sync/conflict-review.ts
|
|
12
12
|
async function showConflicts(ctx, options) {
|
|
@@ -15,4 +15,4 @@ async function showConflicts(ctx, options) {
|
|
|
15
15
|
export {
|
|
16
16
|
showConflicts
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=conflict-review-
|
|
18
|
+
//# sourceMappingURL=conflict-review-QI77P7KL.ts.map
|