@narumitw/pi-sync 0.68.1 → 0.69.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 +15 -0
- package/README.md +35 -21
- package/dist/chunks/{chunk-AYGMIMCV.ts → chunk-4KGDPLQ4.ts} +2 -2
- package/dist/chunks/chunk-4KGDPLQ4.ts.map +7 -0
- package/dist/chunks/{chunk-FR6A7ASZ.ts → chunk-EG6BUOUQ.ts} +3 -3
- package/dist/chunks/{chunk-WQXUZSY5.ts → chunk-EI2J5Z4Q.ts} +13 -6
- package/dist/chunks/chunk-EI2J5Z4Q.ts.map +7 -0
- package/dist/chunks/{chunk-BCDBT4X3.ts → chunk-GXB74FYB.ts} +4 -4
- package/dist/chunks/{chunk-J52GYZO6.ts → chunk-LNZRNXNQ.ts} +2 -4
- package/dist/chunks/{chunk-FQKWGVMA.ts → chunk-OWSKD5XG.ts} +10 -7
- package/dist/chunks/chunk-OWSKD5XG.ts.map +7 -0
- package/dist/chunks/{chunk-WCGLU526.ts → chunk-RXZVLBPU.ts} +3 -3
- package/dist/chunks/{chunk-KAIVTJIQ.ts → chunk-RZB2DPVU.ts} +2 -2
- package/dist/chunks/{chunk-335XTMMZ.ts → chunk-VQTYTUBU.ts} +24 -26
- package/dist/chunks/chunk-VQTYTUBU.ts.map +7 -0
- package/dist/chunks/{chunk-TLYT6HVI.ts → chunk-YX6DCQ7P.ts} +2 -2
- package/dist/chunks/{command-handler-5LDTCUJE.ts → command-handler-ZR26OSBX.ts} +39 -143
- package/dist/chunks/command-handler-ZR26OSBX.ts.map +7 -0
- package/dist/chunks/{conflict-review-SZ3AWTX6.ts → conflict-review-W5BCZIZG.ts} +2 -2
- package/dist/chunks/{file-selection-4BOQBXS7.ts → file-selection-STCIRKF6.ts} +3 -3
- package/dist/chunks/{manager-result-dispatcher-A4IWLS4J.ts → manager-result-dispatcher-MPLPDR2P.ts} +5 -5
- package/dist/chunks/{manager-ui-KHMCSLLV.ts → manager-ui-OMZOBGYT.ts} +99 -96
- package/dist/chunks/manager-ui-OMZOBGYT.ts.map +7 -0
- package/dist/chunks/{merge-review-LWMUE5IW.ts → merge-review-KTIQBRLL.ts} +2 -2
- package/dist/chunks/{remote-selection-ui-F6NJBQ3Y.ts → remote-selection-ui-CCHMCAHQ.ts} +4 -4
- package/dist/chunks/{setup-switch-7LMIRMZ7.ts → setup-switch-J3YLBB6N.ts} +4 -4
- package/dist/chunks/{setup-wizard-2NRPR433.ts → setup-wizard-J3YOR7BR.ts} +3 -4
- package/dist/chunks/{setup-wizard-2NRPR433.ts.map → setup-wizard-J3YOR7BR.ts.map} +1 -1
- package/dist/chunks/{sync-inspection-OTI4JDQ2.ts → sync-inspection-7OADBR57.ts} +3 -3
- package/dist/chunks/{sync-operations-ZUYJLWUN.ts → sync-operations-3K6WLPXY.ts} +2 -10
- package/dist/chunks/{sync-operations-ZUYJLWUN.ts.map → sync-operations-3K6WLPXY.ts.map} +2 -2
- package/dist/daemon/dist/build-id.json +1 -1
- package/dist/daemon/dist/engine/backends/git/git-backend.js +1 -1
- package/dist/daemon/dist/engine/backends/s3/s3-backend.js +2 -2
- package/dist/daemon/dist/engine/backends/webdav/webdav-backend.js +67 -6
- package/dist/daemon/dist/engine/debug-check.js +59 -0
- package/dist/daemon/dist/engine/debug-log.js +100 -1
- package/dist/daemon/dist/engine/sync/directional-conflict.js +31 -0
- package/dist/daemon/dist/engine/sync/push-review.js +1 -1
- package/dist/daemon/dist/engine/sync/sync-error-guidance.js +6 -5
- package/dist/daemon/dist/engine/sync/sync-inspection.js +5 -1
- package/dist/daemon/dist/engine/sync/sync-mutations.js +40 -7
- package/dist/daemon/dist/engine/sync/sync-queries.js +99 -25
- package/dist/daemon/dist/engine/sync/sync-state.js +1 -1
- package/dist/daemon/dist/engine/ui/transfer-review.js +2 -3
- package/dist/daemon/dist/engine-service.js +100 -25
- package/dist/daemon/dist/foreground-transfer.js +10 -0
- package/dist/daemon/dist/index.js +1 -0
- package/dist/daemon/dist/server.js +2 -1
- package/dist/daemon/package.json +1 -1
- package/dist/index.ts +111 -10
- package/dist/index.ts.map +3 -3
- package/docs/daemon-migration.md +2 -2
- package/docs/tui-contract.md +7 -7
- package/package.json +7 -4
- package/skills/configure-pi-sync/SKILL.md +4 -7
- package/skills/configure-pi-sync/references/configuration.md +20 -19
- package/src/commands/command-execution.ts +36 -136
- package/src/commands/command-handler.ts +3 -3
- package/src/commands/command.ts +28 -26
- package/src/daemon/directional-recovery.ts +3 -1
- package/src/daemon/pi-client.ts +6 -0
- package/src/sync/debug-tool.ts +96 -0
- package/src/sync/startup-check.ts +1 -1
- package/src/sync/sync-operations.ts +0 -6
- package/src/sync-extension.ts +13 -1
- package/src/ui/cancellable-operation.ts +11 -4
- package/src/ui/manager-state.ts +13 -12
- package/src/ui/manager-ui.ts +96 -81
- package/src/ui/operation-dialogs.ts +1 -1
- package/src/ui/settings-ui.ts +2 -3
- package/src/ui/setup/webdav-ui.ts +1 -1
- package/dist/chunks/chunk-335XTMMZ.ts.map +0 -7
- package/dist/chunks/chunk-AYGMIMCV.ts.map +0 -7
- package/dist/chunks/chunk-ECYCNZOE.ts +0 -12
- package/dist/chunks/chunk-ECYCNZOE.ts.map +0 -7
- package/dist/chunks/chunk-FQKWGVMA.ts.map +0 -7
- package/dist/chunks/chunk-WQXUZSY5.ts.map +0 -7
- package/dist/chunks/command-handler-5LDTCUJE.ts.map +0 -7
- package/dist/chunks/manager-ui-KHMCSLLV.ts.map +0 -7
- /package/dist/chunks/{chunk-FR6A7ASZ.ts.map → chunk-EG6BUOUQ.ts.map} +0 -0
- /package/dist/chunks/{chunk-BCDBT4X3.ts.map → chunk-GXB74FYB.ts.map} +0 -0
- /package/dist/chunks/{chunk-J52GYZO6.ts.map → chunk-LNZRNXNQ.ts.map} +0 -0
- /package/dist/chunks/{chunk-WCGLU526.ts.map → chunk-RXZVLBPU.ts.map} +0 -0
- /package/dist/chunks/{chunk-KAIVTJIQ.ts.map → chunk-RZB2DPVU.ts.map} +0 -0
- /package/dist/chunks/{chunk-TLYT6HVI.ts.map → chunk-YX6DCQ7P.ts.map} +0 -0
- /package/dist/chunks/{conflict-review-SZ3AWTX6.ts.map → conflict-review-W5BCZIZG.ts.map} +0 -0
- /package/dist/chunks/{file-selection-4BOQBXS7.ts.map → file-selection-STCIRKF6.ts.map} +0 -0
- /package/dist/chunks/{manager-result-dispatcher-A4IWLS4J.ts.map → manager-result-dispatcher-MPLPDR2P.ts.map} +0 -0
- /package/dist/chunks/{merge-review-LWMUE5IW.ts.map → merge-review-KTIQBRLL.ts.map} +0 -0
- /package/dist/chunks/{remote-selection-ui-F6NJBQ3Y.ts.map → remote-selection-ui-CCHMCAHQ.ts.map} +0 -0
- /package/dist/chunks/{setup-switch-7LMIRMZ7.ts.map → setup-switch-J3YLBB6N.ts.map} +0 -0
- /package/dist/chunks/{sync-inspection-OTI4JDQ2.ts.map → sync-inspection-7OADBR57.ts.map} +0 -0
package/src/ui/manager-state.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { stripVTControlCharacters } from "node:util";
|
|
1
2
|
import { truncateToWidth } from "@earendil-works/pi-tui";
|
|
2
3
|
import { createSettingsConfigView, syncCheckConfigFingerprint } from "../settings/config.js";
|
|
3
4
|
import { type LocalConfigDocument, readActiveLocalConfigDocumentForRepair } from "../settings/config-file.js";
|
|
@@ -28,10 +29,8 @@ export const MAIN_MENU_ACTIONS = [
|
|
|
28
29
|
"Pull from remote",
|
|
29
30
|
"Push to remote",
|
|
30
31
|
"View differences",
|
|
31
|
-
"Check remote status",
|
|
32
32
|
"Settings",
|
|
33
33
|
"History",
|
|
34
|
-
"Diagnostics",
|
|
35
34
|
] as const;
|
|
36
35
|
|
|
37
36
|
export interface ManagerDescription {
|
|
@@ -132,13 +131,11 @@ export async function describeManagerState(
|
|
|
132
131
|
syncStateFingerprint(syncState) === observation.inspection.stateIdentity
|
|
133
132
|
? observation
|
|
134
133
|
: undefined;
|
|
135
|
-
const lastAppliedSnapshot =
|
|
136
|
-
?
|
|
137
|
-
: syncState
|
|
138
|
-
?
|
|
139
|
-
:
|
|
140
|
-
? "Never synced"
|
|
141
|
-
: "Unavailable";
|
|
134
|
+
const lastAppliedSnapshot = syncState?.lastAppliedSnapshot
|
|
135
|
+
? truncatePlainText(syncState.lastAppliedSnapshot, 40)
|
|
136
|
+
: syncState
|
|
137
|
+
? "Never synced"
|
|
138
|
+
: "Unavailable";
|
|
142
139
|
const canSwitch = !changesBlocked && (alternateUsable || (await hasAnotherSwitchableSetup(view, signal)));
|
|
143
140
|
signal?.throwIfAborted();
|
|
144
141
|
const mainActions: string[] = [...MAIN_MENU_ACTIONS];
|
|
@@ -168,7 +165,7 @@ export async function describeManagerState(
|
|
|
168
165
|
: currentObservation
|
|
169
166
|
? [`Observed ${safeTerminalText(currentObservation.checkedAt)}: ${observationSummary(currentObservation)}`]
|
|
170
167
|
: ["Remote status: Not checked"]),
|
|
171
|
-
`Last applied: ${lastAppliedSnapshot}`,
|
|
168
|
+
`Last applied snapshot: ${lastAppliedSnapshot}`,
|
|
172
169
|
...(config.automaticTransfer || (config.automatic && syncSessionsSelected(config))
|
|
173
170
|
? ["Automatic transfer permission: On · see Settings"]
|
|
174
171
|
: []),
|
|
@@ -226,7 +223,6 @@ function operationActions(
|
|
|
226
223
|
"Settings",
|
|
227
224
|
...(canSwitch ? ["Switch sync setup"] : []),
|
|
228
225
|
"History",
|
|
229
|
-
"Diagnostics",
|
|
230
226
|
]
|
|
231
227
|
: mainActions;
|
|
232
228
|
}
|
|
@@ -236,7 +232,7 @@ function operationStatusLines(operation: OperationAvailability): string[] {
|
|
|
236
232
|
case "free":
|
|
237
233
|
return [];
|
|
238
234
|
case "live": {
|
|
239
|
-
const command =
|
|
235
|
+
const command = truncatePlainText(operation.lock.command, 16);
|
|
240
236
|
return [
|
|
241
237
|
`Running: ${command} (pid ${operation.lock.pid}). Wait, then refresh; Transfer actions and Settings return.`,
|
|
242
238
|
];
|
|
@@ -258,6 +254,11 @@ function operationStatusLines(operation: OperationAvailability): string[] {
|
|
|
258
254
|
}
|
|
259
255
|
}
|
|
260
256
|
|
|
257
|
+
function truncatePlainText(value: string, width: number) {
|
|
258
|
+
const text = safeTerminalText(stripVTControlCharacters(value));
|
|
259
|
+
return stripVTControlCharacters(truncateToWidth(text, width, "…"));
|
|
260
|
+
}
|
|
261
|
+
|
|
261
262
|
export function backendStorageDescription(config: AnySyncConfig) {
|
|
262
263
|
const connection = safeTerminalText(config.connectionName);
|
|
263
264
|
switch (config.backend.type) {
|
package/src/ui/manager-ui.ts
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./manager-attention.js";
|
|
14
14
|
import { recoverSyncAccess } from "./manager-recovery.js";
|
|
15
15
|
import { dispatchManagerResult } from "./manager-result-dispatcher.js";
|
|
16
|
-
import {
|
|
16
|
+
import { describeManagerState } from "./manager-state.js";
|
|
17
17
|
import { showSyncSettings } from "./settings-ui.js";
|
|
18
18
|
import { showSyncSetupManager } from "./setup/setup-actions.js";
|
|
19
19
|
import { showSetupSwitcher } from "./setup/setup-switcher.js";
|
|
@@ -52,12 +52,10 @@ export async function showSyncManager(
|
|
|
52
52
|
| "pull"
|
|
53
53
|
| "push"
|
|
54
54
|
| "diff"
|
|
55
|
-
| "status"
|
|
56
55
|
| "setups"
|
|
57
56
|
| "connections"
|
|
58
57
|
| "history"
|
|
59
58
|
| "conflicts"
|
|
60
|
-
| "doctor"
|
|
61
59
|
| "recover"
|
|
62
60
|
| "daemon-recovery"
|
|
63
61
|
| "refresh"
|
|
@@ -69,20 +67,37 @@ export async function showSyncManager(
|
|
|
69
67
|
const directionalAction = async (direction: "push" | "pull", state: State, signal: AbortSignal) => {
|
|
70
68
|
const review = state.manager.configReview;
|
|
71
69
|
if (!review) return { kind: "stay" as const };
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
70
|
+
const run = (intent: "reject-conflicts" | "review-force") =>
|
|
71
|
+
runCancellableOperation(
|
|
72
|
+
ctx,
|
|
73
|
+
intent === "review-force"
|
|
74
|
+
? `Preparing Force ${direction} preview…`
|
|
75
|
+
: direction === "push"
|
|
76
|
+
? "Pushing to remote…"
|
|
77
|
+
: "Pulling from remote…",
|
|
78
|
+
direction,
|
|
79
|
+
runRoute,
|
|
80
|
+
{
|
|
81
|
+
commitAware: true,
|
|
82
|
+
cancelAcrossDialogs: intent === "review-force",
|
|
83
|
+
cancelledMessage: direction === "push" ? "Push cancellation requested." : "Pull cancellation requested.",
|
|
84
|
+
target: review.setupName,
|
|
85
|
+
directional: { fingerprint: review.fingerprint, intent },
|
|
86
|
+
signal,
|
|
87
|
+
isCurrent,
|
|
88
|
+
},
|
|
89
|
+
);
|
|
90
|
+
let result = await run("reject-conflicts");
|
|
91
|
+
if (signal.aborted || !isCurrent()) return { kind: "close" as const };
|
|
92
|
+
if (result.kind === "destination-conflict") {
|
|
93
|
+
const choice = await showDirectionalConflict(menuContext, direction, review.setupName, signal, isCurrent);
|
|
94
|
+
if (signal.aborted || !isCurrent() || choice === "close") return { kind: "close" as const };
|
|
95
|
+
if (choice === "back") return { kind: "stay" as const };
|
|
96
|
+
if (!(await matchesManagerReview(review.fingerprint, signal)))
|
|
97
|
+
return { kind: signal.aborted || !isCurrent() ? ("close" as const) : ("stay" as const) };
|
|
98
|
+
result = await run("review-force");
|
|
99
|
+
if (signal.aborted || !isCurrent()) return { kind: "close" as const };
|
|
100
|
+
}
|
|
86
101
|
const done =
|
|
87
102
|
result.kind === "closed" ||
|
|
88
103
|
(result.kind === "completed" && result.outcome === "applied") ||
|
|
@@ -116,13 +131,11 @@ export async function showSyncManager(
|
|
|
116
131
|
id: item.id,
|
|
117
132
|
label: ctx.mode === "tui" && item.id === "sync" ? "Sync…" : item.label,
|
|
118
133
|
details: [item.description ?? "Review synced content."],
|
|
119
|
-
searchText: `${item.label} ${item.description ?? ""}`,
|
|
120
134
|
disabled: item.disabled,
|
|
121
135
|
disabledReason: item.disabledReason,
|
|
122
136
|
})),
|
|
123
137
|
action: "activate",
|
|
124
|
-
|
|
125
|
-
viewportSize: 5,
|
|
138
|
+
viewportSize: 6,
|
|
126
139
|
hint: "close",
|
|
127
140
|
};
|
|
128
141
|
},
|
|
@@ -211,7 +224,7 @@ export async function showSyncManager(
|
|
|
211
224
|
commitAware: true,
|
|
212
225
|
cancelAcrossDialogs: true,
|
|
213
226
|
target: state.manager.configReview?.setupName,
|
|
214
|
-
cancelledMessage: "History review cancelled
|
|
227
|
+
cancelledMessage: "History review cancelled.",
|
|
215
228
|
});
|
|
216
229
|
return { kind: result.kind === "closed" ? "close" : "stay" };
|
|
217
230
|
},
|
|
@@ -222,38 +235,6 @@ export async function showSyncManager(
|
|
|
222
235
|
});
|
|
223
236
|
return { kind: result.kind === "closed" ? "close" : "stay" };
|
|
224
237
|
},
|
|
225
|
-
status: async ({ state }) => {
|
|
226
|
-
const result = await runCancellableOperation(ctx, "Checking remote status…", "status", runRoute, {
|
|
227
|
-
target: state.manager.configReview?.setupName,
|
|
228
|
-
signal: sessionSignal,
|
|
229
|
-
});
|
|
230
|
-
return { kind: result.kind === "closed" ? "close" : "stay" };
|
|
231
|
-
},
|
|
232
|
-
doctor: async ({ state, signal: actionSignal }) => {
|
|
233
|
-
const signal = sessionSignal ? AbortSignal.any([sessionSignal, actionSignal]) : actionSignal;
|
|
234
|
-
const validate = captureMutationOwner(ctx, signal);
|
|
235
|
-
const config = await loadConfig(state.manager.configReview?.setupName);
|
|
236
|
-
validate();
|
|
237
|
-
const confirmed = await ctx.ui.confirm(
|
|
238
|
-
"Run diagnostics?",
|
|
239
|
-
`Setup: ${safeTerminalText(config.setupName)}\nStorage: ${backendStorageDescription(config)}\nS3/R2 reads the latest pointer without writing. Git reads remote snapshots and checks its cache. WebDAV probes conditional writes and cleanup, and can repair a missing history entry. Possible-secret checks still run. This is not the read-only Check remote status action.`,
|
|
240
|
-
{ signal },
|
|
241
|
-
);
|
|
242
|
-
if (signal.aborted) return { kind: "close" };
|
|
243
|
-
validate();
|
|
244
|
-
if (!confirmed) return { kind: "stay" };
|
|
245
|
-
const latest = await loadConfig();
|
|
246
|
-
validate();
|
|
247
|
-
if (syncCheckConfigFingerprint(config) !== syncCheckConfigFingerprint(latest)) {
|
|
248
|
-
ctx.ui.notify("Setup changed during diagnostics review; reopen Diagnostics.", "warning");
|
|
249
|
-
return { kind: "stay" };
|
|
250
|
-
}
|
|
251
|
-
const result = await runCancellableOperation(ctx, "Checking setup access…", "doctor", runRoute, {
|
|
252
|
-
signal,
|
|
253
|
-
target: config.setupName,
|
|
254
|
-
});
|
|
255
|
-
return { kind: result.kind === "closed" ? "close" : "stay" };
|
|
256
|
-
},
|
|
257
238
|
"daemon-recovery": async ({ signal }) => {
|
|
258
239
|
await runRoute("daemon recover", signal);
|
|
259
240
|
return { kind: "stay" };
|
|
@@ -282,6 +263,21 @@ export async function showSyncManager(
|
|
|
282
263
|
},
|
|
283
264
|
},
|
|
284
265
|
});
|
|
266
|
+
async function matchesManagerReview(fingerprint: string | undefined, signal: AbortSignal, settings = false) {
|
|
267
|
+
try {
|
|
268
|
+
const config = await (settings ? loadSettingsConfig() : loadConfig());
|
|
269
|
+
validateOwner();
|
|
270
|
+
signal.throwIfAborted();
|
|
271
|
+
if (fingerprint === syncCheckConfigFingerprint(config)) return true;
|
|
272
|
+
} catch {
|
|
273
|
+
if (!isCurrent() || signal.aborted) return false;
|
|
274
|
+
}
|
|
275
|
+
ctx.ui.notify(
|
|
276
|
+
"Sync setup changed while the manager was open. Review the refreshed setup before continuing.",
|
|
277
|
+
"warning",
|
|
278
|
+
);
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
285
281
|
// Setup-specific actions must use the configuration shown by this screen, not
|
|
286
282
|
// an active setup selected by another process while the menu was open.
|
|
287
283
|
for (const action of [
|
|
@@ -292,31 +288,15 @@ export async function showSyncManager(
|
|
|
292
288
|
"push",
|
|
293
289
|
"history",
|
|
294
290
|
"diff",
|
|
295
|
-
"status",
|
|
296
|
-
"doctor",
|
|
297
291
|
"conflicts",
|
|
298
292
|
] as const) {
|
|
299
293
|
const activate = menu.actions[action];
|
|
300
294
|
menu.actions[action] = async (invocation) => {
|
|
301
295
|
validateOwner();
|
|
302
296
|
const review = invocation.state.manager.configReview;
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
validateOwner();
|
|
307
|
-
invocation.signal.throwIfAborted();
|
|
308
|
-
current = review?.fingerprint === syncCheckConfigFingerprint(config);
|
|
309
|
-
} catch {
|
|
310
|
-
if (!isCurrent() || invocation.signal.aborted) return { kind: "close" };
|
|
311
|
-
}
|
|
312
|
-
if (!current) {
|
|
313
|
-
ctx.ui.notify(
|
|
314
|
-
"Sync setup changed while the manager was open. Review the refreshed setup before continuing.",
|
|
315
|
-
"warning",
|
|
316
|
-
);
|
|
317
|
-
return { kind: "stay" };
|
|
318
|
-
}
|
|
319
|
-
return activate(invocation);
|
|
297
|
+
const matches = await matchesManagerReview(review?.fingerprint, invocation.signal, action === "settings");
|
|
298
|
+
if (invocation.signal.aborted || !isCurrent()) return { kind: "close" };
|
|
299
|
+
return matches ? activate(invocation) : { kind: "stay" };
|
|
320
300
|
};
|
|
321
301
|
}
|
|
322
302
|
const menuContext: ExtensionCommandContext = {
|
|
@@ -370,6 +350,47 @@ export async function showSyncManager(
|
|
|
370
350
|
});
|
|
371
351
|
}
|
|
372
352
|
|
|
353
|
+
async function showDirectionalConflict(
|
|
354
|
+
ctx: ExtensionCommandContext,
|
|
355
|
+
direction: "push" | "pull",
|
|
356
|
+
setup: string,
|
|
357
|
+
signal: AbortSignal,
|
|
358
|
+
isCurrent: () => boolean,
|
|
359
|
+
): Promise<"review" | "back" | "close"> {
|
|
360
|
+
let selected = false;
|
|
361
|
+
const menu = defineMenu<undefined, "conflict", "choose", ExtensionCommandContext>({
|
|
362
|
+
start: "conflict",
|
|
363
|
+
screens: {
|
|
364
|
+
conflict: () => ({
|
|
365
|
+
kind: "choice",
|
|
366
|
+
title: `${direction === "push" ? "Push" : "Pull"} stopped · ${safeTerminalText(setup)}`,
|
|
367
|
+
lines: [
|
|
368
|
+
direction === "push"
|
|
369
|
+
? "Push would overwrite remote changes since the last accepted sync."
|
|
370
|
+
: "Pull would overwrite local changes since the last accepted sync.",
|
|
371
|
+
"No content was written.",
|
|
372
|
+
],
|
|
373
|
+
items: [
|
|
374
|
+
{ id: "back", label: "Back" },
|
|
375
|
+
{ id: "review", label: `Review Force ${direction}…` },
|
|
376
|
+
],
|
|
377
|
+
action: "choose",
|
|
378
|
+
initialItemId: "back",
|
|
379
|
+
hint: ctx.mode === "rpc" ? "close" : "back",
|
|
380
|
+
}),
|
|
381
|
+
},
|
|
382
|
+
actions: {
|
|
383
|
+
choose: ({ itemId }) => {
|
|
384
|
+
selected = itemId === "review";
|
|
385
|
+
return { kind: "back" };
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
});
|
|
389
|
+
const result = await runMenu(ctx, menu, { getState: () => undefined, signal, isCurrent });
|
|
390
|
+
if (signal.aborted || !isCurrent() || result.kind !== "closed" || result.reason === "close") return "close";
|
|
391
|
+
return selected ? "review" : "back";
|
|
392
|
+
}
|
|
393
|
+
|
|
373
394
|
function syncMainMenuItem(
|
|
374
395
|
label: string,
|
|
375
396
|
): ActionMenuItem<
|
|
@@ -378,14 +399,12 @@ function syncMainMenuItem(
|
|
|
378
399
|
| "pull"
|
|
379
400
|
| "push"
|
|
380
401
|
| "diff"
|
|
381
|
-
| "status"
|
|
382
402
|
| "switch"
|
|
383
403
|
| "settings"
|
|
384
404
|
| "setups"
|
|
385
405
|
| "connections"
|
|
386
406
|
| "history"
|
|
387
407
|
| "conflicts"
|
|
388
|
-
| "doctor"
|
|
389
408
|
| "recover"
|
|
390
409
|
| "daemon-recovery"
|
|
391
410
|
| "refresh"
|
|
@@ -397,11 +416,9 @@ function syncMainMenuItem(
|
|
|
397
416
|
"Pull from remote": "pull",
|
|
398
417
|
"Push to remote": "push",
|
|
399
418
|
"View differences": "diff",
|
|
400
|
-
"Check remote status": "status",
|
|
401
419
|
"Switch sync setup": "switch",
|
|
402
420
|
Settings: "settings",
|
|
403
421
|
History: "history",
|
|
404
|
-
Diagnostics: "doctor",
|
|
405
422
|
"Review unresolved conflicts": "conflicts",
|
|
406
423
|
"Restore sync access… (recommended)": "recover",
|
|
407
424
|
"Stop daemon for recovery…": "daemon-recovery",
|
|
@@ -420,13 +437,11 @@ function syncMainMenuItem(
|
|
|
420
437
|
action,
|
|
421
438
|
description: {
|
|
422
439
|
sync: "Merge changes on both sides.",
|
|
423
|
-
pull: "Remote → this device;
|
|
424
|
-
push: "This device → remote;
|
|
440
|
+
pull: "Remote → this device; stops before overwriting local changes.",
|
|
441
|
+
push: "This device → remote; stops before overwriting remote changes.",
|
|
425
442
|
diff: "Inspect changes; no transfer.",
|
|
426
|
-
status: "Check remote; no transfer.",
|
|
427
443
|
settings: "Edit settings, setups, and storage connections.",
|
|
428
|
-
history: "Review snapshots and
|
|
429
|
-
doctor: "Review backend diagnostics.",
|
|
444
|
+
history: "Review snapshots and recovery options.",
|
|
430
445
|
switch: "Choose another sync setup.",
|
|
431
446
|
conflicts: "Review unresolved file groups.",
|
|
432
447
|
recover: "Review local lock recovery.",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
|
|
3
|
-
/** Track History's Pi-owned selector/confirmation lifetime without inspecting renderer internals. */
|
|
4
3
|
export function trackOperationDialogs<Context extends ExtensionContext>(
|
|
5
4
|
ctx: Context,
|
|
6
5
|
onDialog?: (active: boolean) => void,
|
|
@@ -18,6 +17,7 @@ export function trackOperationDialogs<Context extends ExtensionContext>(
|
|
|
18
17
|
...ctx.ui,
|
|
19
18
|
select: (...args) => runDialog(() => ctx.ui.select(...args)),
|
|
20
19
|
confirm: (...args) => runDialog(() => ctx.ui.confirm(...args)),
|
|
20
|
+
custom: (factory, options) => runDialog(() => ctx.ui.custom(factory, options)),
|
|
21
21
|
};
|
|
22
22
|
// Forward live context properties: copying the context would hide session
|
|
23
23
|
// replacement from mutation-owner revalidation after a dialog settles.
|
package/src/ui/settings-ui.ts
CHANGED
|
@@ -283,7 +283,7 @@ export async function showSyncSettings(
|
|
|
283
283
|
id: "skipSecretScan",
|
|
284
284
|
label: "Skip secret scan",
|
|
285
285
|
description:
|
|
286
|
-
"All setups on this device: skip possible-secret checks on subsequent pushes, including automatic pushes. Other safety checks remain.
|
|
286
|
+
"All setups on this device: skip possible-secret checks on subsequent pushes, including automatic pushes. Other push safety checks remain.",
|
|
287
287
|
currentValue: state.skipSecretScan ? "On" : "Off",
|
|
288
288
|
values: ["On", "Off"],
|
|
289
289
|
action: "skip-secret-scan",
|
|
@@ -300,8 +300,7 @@ export async function showSyncSettings(
|
|
|
300
300
|
{
|
|
301
301
|
id: "debug",
|
|
302
302
|
label: "Debug mode",
|
|
303
|
-
description:
|
|
304
|
-
"Write startup timings and sync events to the local pi-sync.log. Pi applies this at the next session start; the daemon applies it at its next settings check.",
|
|
303
|
+
description: "Next session: log to pi-sync.log and let the model recheck remote storage without asking.",
|
|
305
304
|
currentValue: state.debug ? "On" : "Off",
|
|
306
305
|
values: ["On", "Off"],
|
|
307
306
|
action: "debug",
|
|
@@ -43,7 +43,7 @@ export async function showWebDavSetup(ctx: ExtensionCommandContext, targetName:
|
|
|
43
43
|
"Username and password: stored privately (values hidden)",
|
|
44
44
|
...policy.lines,
|
|
45
45
|
`Automatic sync: ${automaticSyncSummary(policy.sync.automatic)}`,
|
|
46
|
-
"
|
|
46
|
+
"Before publishing a snapshot, Pi Sync checks WebDAV conditional writes with a temporary probe.",
|
|
47
47
|
"Saving does not contact remote storage or start syncing.",
|
|
48
48
|
],
|
|
49
49
|
"Save setup",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/ui/sync-behavior.ts", "../../src/commands/command.ts"],
|
|
4
|
-
"sourcesContent": ["export const AUTOMATIC_SYNC_DESCRIPTION =\n \"This setup: check remote state once at startup in TUI/RPC. At shutdown, push all selected content only when sessions are included; reload skips that push. Saves apply to subsequent operations; a new check waits for the next session start. This does not enable startup transfer.\";\n\nexport const STARTUP_TRANSFER_DESCRIPTION =\n \"This setup: separate opt-in for one idle startup transfer in TUI/RPC. Requires an accepted baseline, matching remote included paths, and conditional or lease-protected publication (Git, verified WebDAV, or R2/S3 with verified conditional writes). May upload, replace, or remove selected files. Never reloads resources. Enabling applies next session start; opening Settings cancels pending work. Completed transfers are not undone.\";\n\nexport function startupTransferSummary(config: {\n automaticTransfer?: boolean;\n backend: { type: \"s3\" | \"git\" | \"webdav\" };\n}) {\n if (!config.automaticTransfer) return \"Off\";\n return config.backend.type === \"s3\"\n ? \"On (next idle startup; R2/S3 conditional-write verification required)\"\n : \"On (next idle startup; baseline and remote policy checks required)\";\n}\n", "import type { ExtensionCommandContext } from \"@earendil-works/pi-coding-agent\";\nimport { AUTOMATIC_SYNC_DESCRIPTION, STARTUP_TRANSFER_DESCRIPTION } from \"../ui/sync-behavior.js\";\nimport type { CommandArgumentCompletion, CommandOptions } from \"./command-types.js\";\n\nconst YES_FLAG_COMPLETIONS: readonly CommandArgumentCompletion[] = [\n { value: \"--yes\", label: \"--yes\", description: \"Skip confirmation prompts\" },\n { value: \"-y\", label: \"-y\", description: \"Skip confirmation prompts\" },\n];\nexport const SYNC_COMMANDS = [\n { name: \"help\", description: \"Show command usage\" },\n { name: \"use\", description: \"Switch the current sync setup\", usageSuffix: \" <setup>\" },\n { name: \"init\", description: \"Create local config template\" },\n { name: \"config\", description: \"Show resolved configuration\" },\n { name: \"files\", description: \"Choose included content\" },\n { name: \"status\", description: \"Show sync status\" },\n { name: \"diff\", description: \"Show local/remote diff\" },\n { name: \"conflicts\", description: \"Review private unresolved conflict groups\" },\n { name: \"doctor\", description: \"Check config, secrets, and lock state\" },\n {\n name: \"daemon\",\n description: \"Review service handover and unattended permission\",\n usageSuffix: \" [status|recover|handover|allow-after-exit|revoke-after-exit]\",\n },\n { name: \"push\", description: \"Upload local settings\" },\n { name: \"pull\", description: \"Apply remote settings\" },\n { name: \"sync\", description: \"Push or pull as needed\" },\n { name: \"history\", description: \"Show recent remote snapshots\" },\n { name: \"rollback\", description: \"Apply a previous snapshot\", usageSuffix: \" <snapshot>\" },\n { name: \"migrate-state\", description: \"Move legacy state into pi-sync/\" },\n { name: \"unlock\", description: \"Remove a stale local lock\", usageSuffix: \" --stale\" },\n] as const;\n\nexport type SyncCommandName = (typeof SYNC_COMMANDS)[number][\"name\"];\n\nconst SYNC_COMMAND_COMPLETIONS: readonly CommandArgumentCompletion[] = SYNC_COMMANDS.map(({ name, description }) => ({\n value: name,\n label: name,\n description,\n}));\nlet setupCompletionNames: string[] = [];\n\nexport function setSyncSetupCompletions(names: readonly string[]) {\n setupCompletionNames = [...new Set(names)].sort((left, right) => left.localeCompare(right));\n}\nconst SETUP_FLAG_COMPLETION = {\n value: \"--setup\",\n label: \"--setup\",\n description: \"Address a sync setup without switching\",\n} as const;\nconst SYNC_FLAG_COMPLETIONS: Record<string, readonly CommandArgumentCompletion[]> = {\n config: [SETUP_FLAG_COMPLETION],\n files: [SETUP_FLAG_COMPLETION],\n status: [SETUP_FLAG_COMPLETION],\n diff: [SETUP_FLAG_COMPLETION],\n conflicts: [SETUP_FLAG_COMPLETION],\n doctor: [SETUP_FLAG_COMPLETION],\n push: [\n ...YES_FLAG_COMPLETIONS,\n { value: \"--force\", label: \"--force\", description: \"Overwrite visible remote changes\" },\n SETUP_FLAG_COMPLETION,\n ],\n pull: [\n ...YES_FLAG_COMPLETIONS,\n { value: \"--force\", label: \"--force\", description: \"Overwrite local changes\" },\n SETUP_FLAG_COMPLETION,\n ],\n sync: [\n ...YES_FLAG_COMPLETIONS,\n { value: \"--force\", label: \"--force\", description: \"Resolve conflicts by forcing action\" },\n SETUP_FLAG_COMPLETION,\n ],\n history: [SETUP_FLAG_COMPLETION],\n rollback: [...YES_FLAG_COMPLETIONS, SETUP_FLAG_COMPLETION],\n \"migrate-state\": YES_FLAG_COMPLETIONS,\n unlock: [{ value: \"--stale\", label: \"--stale\", description: \"Remove only a stale lock\" }],\n};\n\nexport function splitArgs(input: string) {\n return input.match(/(?:[^\\s\"']+|\"[^\"]*\"|'[^']*')+/g)?.map((arg) => arg.replace(/^['\"]|['\"]$/g, \"\")) ?? [];\n}\n\nexport function parseOptions(args: string[]): CommandOptions {\n const values: string[] = [];\n let yes = false;\n let force = false;\n let stale = false;\n let setup: string | undefined;\n for (let index = 0; index < args.length; index += 1) {\n const arg = args[index];\n if (arg === \"--yes\" || arg === \"-y\") yes = true;\n else if (arg === \"--force\") force = true;\n else if (arg === \"--stale\") stale = true;\n else if (arg === \"--setup\") {\n const name = args[index + 1];\n if (!name || name.startsWith(\"-\")) throw new Error(\"--setup requires a sync setup name.\");\n if (setup !== undefined) throw new Error(\"--setup may be provided only once.\");\n setup = name;\n index += 1;\n } else if (arg.startsWith(\"-\")) {\n throw new Error(`Unknown sync option: ${arg}`);\n } else values.push(arg);\n }\n return {\n yes,\n force,\n stale,\n silent: false,\n reload: true,\n auto: false,\n ...(setup === undefined ? {} : { setup }),\n args: values,\n };\n}\n\nexport function validateCommandOptions(command: string, options: CommandOptions) {\n const setupAllowed = new Set([\n \"config\",\n \"files\",\n \"status\",\n \"diff\",\n \"conflicts\",\n \"doctor\",\n \"push\",\n \"pull\",\n \"sync\",\n \"history\",\n \"rollback\",\n ]);\n if (options.setup && !setupAllowed.has(command)) {\n throw new Error(`--setup is not supported by /sync ${command}.`);\n }\n if (options.yes && ![\"push\", \"pull\", \"sync\", \"rollback\", \"migrate-state\"].includes(command)) {\n throw new Error(`Confirmation/force options are not supported by /sync ${command}.`);\n }\n if (options.force && ![\"push\", \"pull\", \"sync\", \"rollback\"].includes(command)) {\n throw new Error(`Confirmation/force options are not supported by /sync ${command}.`);\n }\n if (options.stale && command !== \"unlock\") {\n throw new Error(`--stale is not supported by /sync ${command}.`);\n }\n if (command === \"daemon\" && options.args.length <= 1) {\n const action = options.args[0];\n if (action !== undefined && !DAEMON_ACTIONS.some((value) => value === action))\n throw new Error(`Unknown daemon action: ${action}`);\n return;\n }\n const expectedValues = command === \"rollback\" || command === \"use\" ? 1 : 0;\n if (options.args.length !== expectedValues) {\n if (command === \"rollback\") throw new Error(\"Usage: /sync rollback <snapshot-id> [--yes] [--setup <name>]\");\n if (command === \"use\") throw new Error(\"Usage: /sync use <setup>\");\n throw new Error(`Unexpected argument for /sync ${command}: ${options.args.join(\" \")}`);\n }\n}\n\nconst DAEMON_ACTIONS = [\"status\", \"recover\", \"handover\", \"allow-after-exit\", \"revoke-after-exit\"] as const;\n\nexport function completeSyncArguments(argumentPrefix: string): CommandArgumentCompletion[] | null {\n const prefix = argumentPrefix.trimStart();\n if (prefix === \"\") return [...SYNC_COMMAND_COMPLETIONS];\n\n const trailingSpace = /\\s$/.test(prefix);\n const tokens = splitArgs(prefix);\n if (tokens.length === 0) return [...SYNC_COMMAND_COMPLETIONS];\n\n const [command] = tokens;\n if (tokens.length === 1 && !trailingSpace) {\n const matches = SYNC_COMMAND_COMPLETIONS.filter((item) => item.value.startsWith(command));\n return matches.length > 0 ? [...matches] : null;\n }\n\n const args = tokens.slice(1);\n if (command === \"use\") {\n if (args.length > 1 || (trailingSpace && args.length > 0)) return null;\n return completeSetupValue(prefix, trailingSpace ? \"\" : (args[0] ?? \"\"));\n }\n if (command === \"daemon\") {\n if (args.length > 1 || (trailingSpace && args.length > 0)) return null;\n const current = trailingSpace ? \"\" : (args[0] ?? \"\");\n const base = trailingSpace ? prefix : prefix.slice(0, prefix.length - current.length);\n const matches = DAEMON_ACTIONS.filter((action) => action.startsWith(current));\n return matches.length\n ? matches.map((action) => ({ value: `${base}${action}`, label: action, description: \"Daemon control\" }))\n : null;\n }\n const setupFlagIndex = args.lastIndexOf(\"--setup\");\n if (setupFlagIndex >= 0 && setupFlagIndex === args.length - (trailingSpace ? 1 : 2)) {\n const currentSetup = trailingSpace ? \"\" : (args.at(-1) ?? \"\");\n if (!currentSetup.startsWith(\"-\")) return completeSetupValue(prefix, currentSetup);\n }\n\n const flagCompletions = SYNC_FLAG_COMPLETIONS[command];\n if (!flagCompletions) return null;\n\n const completedArgs = trailingSpace ? args : args.slice(0, -1);\n const completedValues = completedArgs.filter((arg) => !arg.startsWith(\"-\"));\n if (command === \"rollback\" ? completedValues.length > 1 : completedValues.length > 0) {\n return null;\n }\n\n const current = trailingSpace ? \"\" : (args.at(-1) ?? \"\");\n if (current && !current.startsWith(\"-\")) return null;\n\n const currentRaw = trailingSpace ? \"\" : (prefix.match(/\\S+$/)?.[0] ?? \"\");\n const completionPrefix = trailingSpace ? prefix : prefix.slice(0, prefix.length - currentRaw.length);\n const matches = flagCompletions.filter((item) => item.value.startsWith(current));\n return matches.length > 0 ? matches.map((item) => ({ ...item, value: `${completionPrefix}${item.value}` })) : null;\n}\n\nfunction completeSetupValue(prefix: string, current: string) {\n const currentRaw = current ? (prefix.match(/\\S+$/u)?.[0] ?? \"\") : \"\";\n const completionPrefix = currentRaw ? prefix.slice(0, prefix.length - currentRaw.length) : prefix;\n const matches = setupCompletionNames.filter((name) => name.startsWith(current));\n return matches.length > 0\n ? matches.map((name) => ({\n value: `${completionPrefix}${name}`,\n label: name,\n description: \"Sync setup\",\n }))\n : null;\n}\n\nexport function syncMenuOptions() {\n return SYNC_COMMANDS.map(({ name, description }) => `${name} \u2014 ${description}`);\n}\n\nexport function syncCommandFromMenuOption(option: string): SyncCommandName | undefined {\n return SYNC_COMMANDS.find(({ name, description }) => option === `${name} \u2014 ${description}`)?.name;\n}\n\nexport async function resolveSyncCommand(input: string, ctx: ExtensionCommandContext) {\n const [subcommand, ...rest] = splitArgs(input);\n if (subcommand) return { subcommand, rest };\n if (!ctx.hasUI) {\n ctx.ui.notify(usage(), \"info\");\n return undefined;\n }\n\n const selectedOption = await ctx.ui.select(\"pi-sync\", syncMenuOptions());\n const selected = selectedOption ? syncCommandFromMenuOption(selectedOption) : undefined;\n if (!selected) return undefined;\n if (selected !== \"rollback\") return { subcommand: selected, rest: [] };\n\n const target = (await ctx.ui.input(\"Rollback snapshot\", \"snapshot id\"))?.trim();\n if (!target) {\n ctx.ui.notify(\"Rollback cancelled.\", \"info\");\n return undefined;\n }\n return { subcommand: selected, rest: [target] };\n}\n\nexport function usage() {\n const commands = SYNC_COMMANDS.map(\n (command) => `${command.name}${\"usageSuffix\" in command ? command.usageSuffix : \"\"}`,\n ).join(\", \");\n return [\n \"Usage: /sync <command>\",\n `Commands: ${commands}`,\n \"In the /sync manager, Push to remote and Pull from remote use the chosen source and preserve a restore point without a second confirmation. Direct commands retain their existing review and flags.\",\n \"Daemon diagnostics: /sync daemon recover reviews and stops the existing daemon. It does not start a replacement or retry a transfer.\",\n `Automatic sync: ${AUTOMATIC_SYNC_DESCRIPTION}`,\n `Startup transfer: ${STARTUP_TRANSFER_DESCRIPTION}`,\n \"Automatic transfer at startup is a separate opt-in: one conflict-free established-baseline transfer at idle in TUI/RPC, with conditional/lease publication and no resource reload.\",\n \"Autonomous sync and Continuous sync are retired. Saved flags no longer transfer files or call a model. Use Sync now to review a transfer or enable Startup transfer for one eligible startup sync.\",\n \"New after-exit grants are not supported. Use /sync daemon revoke-after-exit to clear a retained grant.\",\n \"Settings: use /sync init or edit storage connections and sync setups in ~/.pi/agent/pi-sync.json (or the configured Pi agent directory). Version 1 and version 2 settings are unsupported and are never rewritten.\",\n ].join(\"\\n\");\n}\n"],
|
|
5
|
-
"mappings": ";;;;AAAO,IAAM,6BACX;AAEK,IAAM,+BACX;AAEK,SAAS,uBAAuB,QAGpC;AACD,MAAI,CAAC,OAAO,kBAAmB,QAAO;AACtC,SAAO,OAAO,QAAQ,SAAS,OAC3B,0EACA;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AAI,GAAG,OAAO,WAAW,gBAAgB,CAAC;AACvE,QAAM,WAAW,iBAAiB,0BAA0B,cAAc,IAAI;AAC9E,MAAI,CAAC,SAAU,QAAO;AACtB,MAAI,aAAa,WAAY,QAAO,EAAE,YAAY,UAAU,MAAM,CAAC,EAAE;AAErE,QAAM,UAAU,MAAM,IAAI,GAAG,MAAM,qBAAqB,aAAa,IAAI,KAAK;AAC9E,MAAI,CAAC,QAAQ;AACX,QAAI,GAAG,OAAO,uBAAuB,MAAM;AAC3C,WAAO;AAAA,EACT;AACA,SAAO,EAAE,YAAY,UAAU,MAAM,CAAC,MAAM,EAAE;AAChD;AAEO,SAAS,QAAQ;AACtB,QAAM,WAAW,cAAc;AAAA,IAC7B,CAAC,YAAY,GAAG,QAAQ,IAAI,GAAG,iBAAiB,UAAU,QAAQ,cAAc,EAAE;AAAA,EACpF,EAAE,KAAK,IAAI;AACX,SAAO;AAAA,IACL;AAAA,IACA,aAAa,QAAQ;AAAA,IACrB;AAAA,IACA;AAAA,IACA,mBAAmB,0BAA0B;AAAA,IAC7C,qBAAqB,4BAA4B;AAAA,IACjD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,KAAK,IAAI;AACb;",
|
|
6
|
-
"names": ["matches", "current"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/ui/cancellable-operation.ts"],
|
|
4
|
-
"sourcesContent": ["import { BorderedLoader, type ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport { isKeyRelease, Key, matchesKey, truncateToWidth } from \"@earendil-works/pi-tui\";\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: \"failed\" };\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 directionalFingerprint?: string,\n) => Promise<RunRouteResult | undefined>;\n\nexport type CancellableOperationResult = RunRouteResult | { kind: \"closed\" } | { kind: \"cancelled\" };\n\ninterface CancellableOperationOptions {\n commitAware?: boolean;\n cancelAcrossDialogs?: boolean;\n cancelledMessage?: string | null;\n target?: string;\n directionalFingerprint?: string;\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.directionalFingerprint),\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\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\" | \"directionalFingerprint\"> = {},\n): Promise<CancellableTaskResult<Value>> {\n const {\n commitAware = false,\n cancelAcrossDialogs = 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<{ cancelled?: boolean; error?: unknown }, ExtensionContext>(ctx, {\n signal,\n isCurrent: () => !signal?.aborted && isCurrent(),\n create: ({ tui, theme, keybindings, signal: interactionSignal, complete }) => {\n const loader = new BorderedLoader(tui, theme, message, { cancellable: false });\n const cancelHint = formatInteractionHints(keybindings, [\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 if (!matchesKey(data, Key.ctrl(\"c\")) && !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: true });\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 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) {\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,cAAc,KAAK,YAAY,uBAAuB;AAC/D,SAAS,wBAAwB,4BAA4B;AAiC7D,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,sBAAsB;AAAA,IACvG;AAAA,EACF;AACA,SAAO,OAAO,SAAS,cAAe,OAAO,SAAS,EAAE,MAAM,SAAS,IAAK;AAC9E;AAQA,eAAsB,mBACpB,KACA,SACA,MAKA,UAAkF,CAAC,GAC5C;AACvC,QAAM;AAAA,IACJ,cAAc;AAAA,IACd,sBAAsB;AAAA,IACtB,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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@ -1,12 +0,0 @@
|
|
|
1
|
-
// @generated by scripts/build-runtime.mjs; do not edit.
|
|
2
|
-
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
|
-
|
|
4
|
-
// src/ui/automatic-sync-summary.ts
|
|
5
|
-
function automaticSyncSummary(enabled) {
|
|
6
|
-
return enabled ? "On (startup check; shutdown pushes selected content if sessions included)" : "Off";
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export {
|
|
10
|
-
automaticSyncSummary
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=chunk-ECYCNZOE.ts.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/ui/automatic-sync-summary.ts"],
|
|
4
|
-
"sourcesContent": ["/** Keep the setting's automatic transfer scope visible in every setup summary. */\nexport function automaticSyncSummary(enabled: boolean) {\n return enabled ? \"On (startup check; shutdown pushes selected content if sessions included)\" : \"Off\";\n}\n"],
|
|
5
|
-
"mappings": ";;;;AACO,SAAS,qBAAqB,SAAkB;AACrD,SAAO,UAAU,8EAA8E;AACjG;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|