@narumitw/pi-sync 0.63.0 → 0.63.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +16 -13
- package/dist/chunks/{chunk-UGS6RYDZ.ts → chunk-B5F3JLD3.ts} +2 -2
- package/dist/chunks/{chunk-S6FUUWV5.ts → chunk-LBNC5AOM.ts} +3 -3
- package/dist/chunks/{chunk-S6FUUWV5.ts.map → chunk-LBNC5AOM.ts.map} +1 -1
- package/dist/chunks/{chunk-GSQGBVKG.ts → chunk-POWOMJ7S.ts} +87 -50
- package/dist/chunks/chunk-POWOMJ7S.ts.map +7 -0
- package/dist/chunks/{command-handler-VINMQ7ZM.ts → command-handler-GMRRFWOL.ts} +5 -5
- package/dist/chunks/{conflict-review-PCDFRIVB.ts → conflict-review-JWEA7DPQ.ts} +2 -2
- package/dist/chunks/{manager-ui-YHDECYKI.ts → manager-ui-T5J5WG7T.ts} +33 -24
- package/dist/chunks/manager-ui-T5J5WG7T.ts.map +7 -0
- package/dist/chunks/{merge-review-SGDLMVS4.ts → merge-review-OQDXNTJU.ts} +2 -2
- package/dist/chunks/{setup-wizard-YO4MCPUF.ts → setup-wizard-LL6YMGUR.ts} +3 -3
- package/dist/chunks/{sync-inspection-H2WX5SUT.ts → sync-inspection-SRU6HGGK.ts} +2 -2
- package/dist/chunks/{sync-operations-2MZAYHL2.ts → sync-operations-UGSCONZ7.ts} +2 -2
- package/dist/daemon/dist/engine/ignore/ignore-initialization.js +50 -14
- package/dist/daemon/dist/engine/ignore/ignore-settings.js +11 -14
- package/dist/daemon/dist/engine/ignore/ignore-source.js +1 -1
- package/dist/daemon/dist/engine/sync/sync-error-guidance.js +16 -3
- package/dist/daemon/dist/engine/sync/sync-mutations.js +4 -4
- package/dist/daemon/dist/engine/ui/sync-format.js +23 -55
- package/dist/daemon/dist/engine/ui/transfer-review.js +3 -3
- package/dist/daemon/package.json +1 -1
- package/dist/index.ts +4 -4
- package/docs/tui-contract.md +1 -1
- package/package.json +2 -2
- package/skills/configure-pi-sync/SKILL.md +119 -18
- package/skills/configure-pi-sync/references/configuration.md +67 -37
- package/src/ui/manager-state.ts +6 -3
- package/src/ui/manager-ui.ts +23 -17
- package/src/ui/merge-review.ts +28 -1
- package/src/ui/setup/webdav-ui.ts +1 -1
- package/src/ui/sync-confirmation.ts +67 -48
- package/dist/chunks/chunk-GSQGBVKG.ts.map +0 -7
- package/dist/chunks/manager-ui-YHDECYKI.ts.map +0 -7
- /package/dist/chunks/{chunk-UGS6RYDZ.ts.map → chunk-B5F3JLD3.ts.map} +0 -0
- /package/dist/chunks/{command-handler-VINMQ7ZM.ts.map → command-handler-GMRRFWOL.ts.map} +0 -0
- /package/dist/chunks/{conflict-review-PCDFRIVB.ts.map → conflict-review-JWEA7DPQ.ts.map} +0 -0
- /package/dist/chunks/{merge-review-SGDLMVS4.ts.map → merge-review-OQDXNTJU.ts.map} +0 -0
- /package/dist/chunks/{setup-wizard-YO4MCPUF.ts.map → setup-wizard-LL6YMGUR.ts.map} +0 -0
- /package/dist/chunks/{sync-inspection-H2WX5SUT.ts.map → sync-inspection-SRU6HGGK.ts.map} +0 -0
- /package/dist/chunks/{sync-operations-2MZAYHL2.ts.map → sync-operations-UGSCONZ7.ts.map} +0 -0
|
@@ -5,12 +5,17 @@ import {
|
|
|
5
5
|
} from "./chunk-2JNFEZ3V.ts";
|
|
6
6
|
|
|
7
7
|
// src/ui/merge-review.ts
|
|
8
|
-
import { truncateToWidth
|
|
8
|
+
import { truncateToWidth } from "@earendil-works/pi-tui";
|
|
9
9
|
import { defineMenu, runCustomInteraction, runDocumentReview, runMenu } from "@narumitw/pi-tui-kit";
|
|
10
10
|
|
|
11
11
|
// src/ui/sync-confirmation.ts
|
|
12
|
-
import { Key, matchesKey, SelectList
|
|
13
|
-
import {
|
|
12
|
+
import { Key, matchesKey, SelectList } from "@earendil-works/pi-tui";
|
|
13
|
+
import {
|
|
14
|
+
HorizontalRule,
|
|
15
|
+
hardWrapTerminalDocument,
|
|
16
|
+
renderBoundedFrameLayout,
|
|
17
|
+
sanitizeTerminalText
|
|
18
|
+
} from "@narumitw/pi-tui-kit";
|
|
14
19
|
function createSyncConfirmation(options) {
|
|
15
20
|
const { tui, theme, keybindings } = options;
|
|
16
21
|
const choices = ["cancel", "approve", "details"];
|
|
@@ -40,9 +45,9 @@ function createSyncConfirmation(options) {
|
|
|
40
45
|
let reviewed = false;
|
|
41
46
|
let disposed = false;
|
|
42
47
|
let finished = false;
|
|
43
|
-
let
|
|
44
|
-
let
|
|
45
|
-
let
|
|
48
|
+
let pageSize = 0;
|
|
49
|
+
let actionRows = [];
|
|
50
|
+
let clickedChoice;
|
|
46
51
|
const finish = (choice) => {
|
|
47
52
|
if (disposed || finished) return;
|
|
48
53
|
finished = true;
|
|
@@ -55,53 +60,60 @@ function createSyncConfirmation(options) {
|
|
|
55
60
|
list.onSelectionChange = (item) => {
|
|
56
61
|
selected = Math.max(0, choices.indexOf(item.value));
|
|
57
62
|
};
|
|
63
|
+
const activate = (choice) => {
|
|
64
|
+
if (choice !== "approve" || reviewed) finish(choice);
|
|
65
|
+
};
|
|
58
66
|
list.onSelect = (item) => {
|
|
59
|
-
|
|
60
|
-
|
|
67
|
+
if (clickedChoice && item.value === clickedChoice) activate(clickedChoice);
|
|
68
|
+
};
|
|
69
|
+
const scroll = (delta) => {
|
|
70
|
+
offset = Math.max(0, Math.min(maximumOffset, offset + delta));
|
|
61
71
|
};
|
|
72
|
+
const terminalRows = () => Math.max(1, Math.floor(tui.terminal.rows) - 3);
|
|
62
73
|
const component = {
|
|
63
74
|
get capturesViewportInput() {
|
|
64
75
|
return list.capturesViewportInput;
|
|
65
76
|
},
|
|
66
77
|
render(width, expose = true) {
|
|
67
|
-
|
|
78
|
+
const cells = Math.floor(width);
|
|
79
|
+
if (!Number.isFinite(cells) || cells <= 0) {
|
|
68
80
|
reviewed = false;
|
|
81
|
+
actionRows = [];
|
|
69
82
|
return [];
|
|
70
83
|
}
|
|
71
|
-
const
|
|
72
|
-
const rows = Math.max(1, Math.floor(tui.terminal.rows) - 3);
|
|
84
|
+
const rows = terminalRows();
|
|
73
85
|
if (cells !== lastWidth || rows !== lastRows) {
|
|
74
|
-
summary = options.lines.flatMap((line) => hardWrapTerminalDocument(line, cells));
|
|
86
|
+
summary = options.lines.flatMap((line) => hardWrapTerminalDocument(line, cells)).filter((line) => line.trim());
|
|
75
87
|
seen = /* @__PURE__ */ new Set();
|
|
76
88
|
offset = 0;
|
|
77
89
|
select(0);
|
|
78
90
|
lastWidth = cells;
|
|
79
91
|
lastRows = rows;
|
|
80
92
|
}
|
|
81
|
-
const framed = rows >= 9;
|
|
82
93
|
const actions = list.render(cells);
|
|
83
|
-
const
|
|
84
|
-
|
|
94
|
+
const framingRows = 5;
|
|
95
|
+
pageSize = Math.max(0, rows - actions.length - framingRows);
|
|
96
|
+
maximumOffset = Math.max(0, summary.length - pageSize);
|
|
85
97
|
offset = Math.min(offset, maximumOffset);
|
|
86
|
-
const visible = summary.slice(offset, offset +
|
|
98
|
+
const visible = summary.slice(offset, offset + pageSize);
|
|
87
99
|
if (expose) for (let index = offset; index < offset + visible.length; index++) seen.add(index);
|
|
88
|
-
reviewed =
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
),
|
|
97
|
-
|
|
98
|
-
theme.fg("
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
return
|
|
100
|
+
reviewed = pageSize > 0 && seen.size === summary.length;
|
|
101
|
+
const status = theme.fg(
|
|
102
|
+
"muted",
|
|
103
|
+
`Summary ${visible.length ? offset + 1 : 0}-${offset + visible.length}/${summary.length}${reviewed ? "" : " \u2014 page before Yes"}`
|
|
104
|
+
);
|
|
105
|
+
const layout = renderBoundedFrameLayout({
|
|
106
|
+
width: cells,
|
|
107
|
+
maxRows: rows,
|
|
108
|
+
rule: rule.render(cells)[0] ?? "",
|
|
109
|
+
title: [theme.fg("accent", theme.bold(sanitizeTerminalText(options.title)))],
|
|
110
|
+
context: [...visible.map((line) => theme.fg("text", line)), status],
|
|
111
|
+
content: actions,
|
|
112
|
+
priorityRows: [selected, 0, 1, 2],
|
|
113
|
+
focusedRow: selected
|
|
114
|
+
});
|
|
115
|
+
actionRows = layout.contentRows;
|
|
116
|
+
return layout.lines;
|
|
105
117
|
},
|
|
106
118
|
invalidate() {
|
|
107
119
|
list.invalidate();
|
|
@@ -115,28 +127,30 @@ function createSyncConfirmation(options) {
|
|
|
115
127
|
}
|
|
116
128
|
component.render(tui.terminal.columns ?? lastWidth, false);
|
|
117
129
|
if (keybindings.matches(data, "tui.select.up")) {
|
|
118
|
-
|
|
119
|
-
else select(selected - 1);
|
|
130
|
+
select(selected - 1);
|
|
120
131
|
} else if (keybindings.matches(data, "tui.select.down")) {
|
|
121
|
-
|
|
122
|
-
else select(selected + 1);
|
|
132
|
+
select(selected + 1);
|
|
123
133
|
} else if (keybindings.matches(data, "tui.select.confirm")) {
|
|
124
|
-
|
|
125
|
-
|
|
134
|
+
activate(choices[selected] ?? "cancel");
|
|
135
|
+
} else if (keybindings.matches(data, "tui.select.pageUp")) {
|
|
136
|
+
scroll(-pageSize);
|
|
137
|
+
} else if (keybindings.matches(data, "tui.select.pageDown")) {
|
|
138
|
+
scroll(pageSize);
|
|
139
|
+
} else {
|
|
140
|
+
return;
|
|
126
141
|
}
|
|
127
142
|
tui.requestRender();
|
|
128
143
|
},
|
|
129
144
|
handleMouse(event) {
|
|
130
|
-
if (disposed || finished || event.width !== lastWidth) return void 0;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
offset = Math.max(0, Math.min(maximumOffset, offset + (event.wheelDelta < 0 ? -1 : 1)));
|
|
134
|
-
select(0);
|
|
135
|
-
tui.requestRender();
|
|
145
|
+
if (disposed || finished || event.width !== lastWidth || terminalRows() !== lastRows) return void 0;
|
|
146
|
+
if (event.y >= 2 && event.y < 2 + Math.min(pageSize, summary.length) && event.type === "wheel" && event.wheelDelta) {
|
|
147
|
+
scroll(Math.sign(event.wheelDelta));
|
|
136
148
|
return { handled: true, render: true };
|
|
137
149
|
}
|
|
138
|
-
|
|
139
|
-
|
|
150
|
+
const row = actionRows.find(({ frameIndex }) => frameIndex === event.y);
|
|
151
|
+
if (!row) return void 0;
|
|
152
|
+
clickedChoice = event.type === "click" ? choices[row.contentIndex] : void 0;
|
|
153
|
+
return list.handleMouse({ ...event, y: row.contentIndex, height: choices.length });
|
|
140
154
|
},
|
|
141
155
|
dispose() {
|
|
142
156
|
disposed = true;
|
|
@@ -149,9 +163,10 @@ function createSyncConfirmation(options) {
|
|
|
149
163
|
// src/ui/merge-review.ts
|
|
150
164
|
async function confirmMergeReview(ctx, title, content, signal, isCurrent, confirmationLabel = "apply changes", summaryLines) {
|
|
151
165
|
const lines = summaryLines ?? [
|
|
152
|
-
...content.split("\n").slice(0, 6).map((line) =>
|
|
166
|
+
...content.split("\n").slice(0, 6).map((line) => truncateToWidth(safeTerminalText(line), 100)),
|
|
153
167
|
"View details for the complete review."
|
|
154
168
|
];
|
|
169
|
+
const tuiLines = ctx.mode === "tui" && confirmationLabel === "apply reviewed transfer" && summaryLines?.join("\n") === content ? compactLegacyTransferSummary(lines) : lines;
|
|
155
170
|
while (isCurrent() && !signal?.aborted) {
|
|
156
171
|
const choice = { value: "cancel" };
|
|
157
172
|
const menu = defineMenu({
|
|
@@ -179,7 +194,7 @@ async function confirmMergeReview(ctx, title, content, signal, isCurrent, confir
|
|
|
179
194
|
}
|
|
180
195
|
});
|
|
181
196
|
const result = ctx.mode === "tui" && ctx.hasUI ? await runCustomInteraction(ctx, {
|
|
182
|
-
create: ({ tui, theme, keybindings, complete }) => createSyncConfirmation({ title, lines, confirmationLabel, tui, theme, keybindings, complete }),
|
|
197
|
+
create: ({ tui, theme, keybindings, complete }) => createSyncConfirmation({ title, lines: tuiLines, confirmationLabel, tui, theme, keybindings, complete }),
|
|
183
198
|
signal,
|
|
184
199
|
isCurrent,
|
|
185
200
|
onError: () => {
|
|
@@ -211,8 +226,30 @@ async function confirmMergeReview(ctx, title, content, signal, isCurrent, confir
|
|
|
211
226
|
}
|
|
212
227
|
return false;
|
|
213
228
|
}
|
|
229
|
+
function compactLegacyTransferSummary(lines) {
|
|
230
|
+
const result = [];
|
|
231
|
+
for (let index = 0; index < lines.length; index++) {
|
|
232
|
+
const line = lines[index] ?? "";
|
|
233
|
+
result.push(line);
|
|
234
|
+
const counts = /^Changes: (\d+) add · (\d+) update · (\d+) remove$/u.exec(line);
|
|
235
|
+
if (!counts) continue;
|
|
236
|
+
const expected = counts.slice(1).map(Number);
|
|
237
|
+
const actual = [0, 0, 0];
|
|
238
|
+
let side;
|
|
239
|
+
let end = index + 1;
|
|
240
|
+
for (; end < lines.length; end++) {
|
|
241
|
+
const row = /^(Add|Update|Remove) (locally|remotely): .+$/u.exec(lines[end] ?? "");
|
|
242
|
+
if (!row || side && row[2] !== side) break;
|
|
243
|
+
side = row[2];
|
|
244
|
+
const action = row[1] === "Add" ? 0 : row[1] === "Update" ? 1 : 2;
|
|
245
|
+
actual[action] = (actual[action] ?? 0) + 1;
|
|
246
|
+
}
|
|
247
|
+
if (actual.every((count, action) => count === expected[action])) index = end - 1;
|
|
248
|
+
}
|
|
249
|
+
return result;
|
|
250
|
+
}
|
|
214
251
|
|
|
215
252
|
export {
|
|
216
253
|
confirmMergeReview
|
|
217
254
|
};
|
|
218
|
-
//# sourceMappingURL=chunk-
|
|
255
|
+
//# sourceMappingURL=chunk-POWOMJ7S.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/ui/merge-review.ts", "../../src/ui/sync-confirmation.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ExtensionCommandContext, ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport { truncateToWidth } from \"@earendil-works/pi-tui\";\nimport { defineMenu, runCustomInteraction, runDocumentReview, runMenu } from \"@narumitw/pi-tui-kit\";\nimport { createSyncConfirmation, type SyncConfirmationChoice } from \"./sync-confirmation.js\";\nimport { safeTerminalText } from \"./terminal-text.js\";\n\ntype ReviewContext = ExtensionCommandContext | ExtensionContext;\n\n/** One approval screen; full details are optional and never authorize a transfer. */\nexport async function confirmMergeReview(\n ctx: ReviewContext,\n title: string,\n content: string,\n signal: AbortSignal | undefined,\n isCurrent: () => boolean,\n confirmationLabel = \"apply changes\",\n summaryLines?: readonly string[],\n) {\n const lines = summaryLines ?? [\n ...content\n .split(\"\\n\")\n .slice(0, 6)\n .map((line) => truncateToWidth(safeTerminalText(line), 100)),\n \"View details for the complete review.\",\n ];\n const tuiLines =\n ctx.mode === \"tui\" && confirmationLabel === \"apply reviewed transfer\" && summaryLines?.join(\"\\n\") === content\n ? compactLegacyTransferSummary(lines)\n : lines;\n while (isCurrent() && !signal?.aborted) {\n const choice: { value: \"cancel\" | \"approve\" | \"details\" } = { value: \"cancel\" };\n const menu = defineMenu<undefined, \"confirm\", \"choose\", ReviewContext>({\n start: \"confirm\",\n screens: {\n confirm: () => ({\n kind: \"choice\",\n title,\n lines,\n initialItemId: \"cancel\",\n items: [\n { id: \"cancel\", label: \"No, cancel\" },\n { id: \"approve\", label: `Yes, ${confirmationLabel}` },\n { id: \"details\", label: \"View details\" },\n ],\n action: \"choose\",\n hint: \"close\",\n }),\n },\n actions: {\n choose: ({ itemId }) => {\n if (itemId === \"approve\" || itemId === \"details\") choice.value = itemId;\n return { kind: \"close\" };\n },\n },\n });\n const result =\n ctx.mode === \"tui\" && ctx.hasUI\n ? await runCustomInteraction<SyncConfirmationChoice, ReviewContext>(ctx, {\n create: ({ tui, theme, keybindings, complete }) =>\n createSyncConfirmation({ title, lines: tuiLines, confirmationLabel, tui, theme, keybindings, complete }),\n signal,\n isCurrent,\n onError: () => {},\n })\n : await runMenu(ctx, menu, { getState: () => undefined, signal, isCurrent, onError: () => {} });\n if (!isCurrent() || signal?.aborted) return false;\n if (result.kind === \"error\") throw new Error(\"Sync review failed; no transfer was performed.\");\n if (result.kind === \"unsupported\")\n throw new Error(\"Sync review requires observable TUI or RPC; review the plan before using --yes.\");\n if (result.kind === \"completed\") choice.value = result.value;\n else if (result.kind !== \"closed\") return false;\n // Keep authorization separate from UI termination in both adapters.\n if (choice.value === \"approve\") return true;\n if (choice.value !== \"details\") return false;\n const detail = await runDocumentReview(ctx, {\n title: \"Sync change details\",\n content,\n format: { kind: \"text\" },\n viewportSize: \"adaptive\",\n hint: \"back\",\n signal,\n isCurrent,\n onError: () => {},\n });\n if (!isCurrent() || signal?.aborted) return false;\n if (detail.kind === \"error\") throw new Error(\"Sync review failed; no transfer was performed.\");\n if (detail.kind !== \"cancelled\" || detail.reason !== \"back\") return false;\n // A fresh menu discards remembered selection: returning from details always selects No.\n // Unlike Pi's native Yes-first dialog, approval requires moving off the safe default.\n }\n return false;\n}\n\nfunction compactLegacyTransferSummary(lines: readonly string[]): string[] {\n const result: string[] = [];\n for (let index = 0; index < lines.length; index++) {\n const line = lines[index] ?? \"\";\n result.push(line);\n const counts = /^Changes: (\\d+) add \u00B7 (\\d+) update \u00B7 (\\d+) remove$/u.exec(line);\n if (!counts) continue;\n const expected = counts.slice(1).map(Number);\n const actual = [0, 0, 0];\n let side: string | undefined;\n let end = index + 1;\n for (; end < lines.length; end++) {\n const row = /^(Add|Update|Remove) (locally|remotely): .+$/u.exec(lines[end] ?? \"\");\n if (!row || (side && row[2] !== side)) break;\n side = row[2];\n const action = row[1] === \"Add\" ? 0 : row[1] === \"Update\" ? 1 : 2;\n actual[action] = (actual[action] ?? 0) + 1;\n }\n if (actual.every((count, action) => count === expected[action])) index = end - 1;\n }\n return result;\n}\n", "import type { KeybindingsManager, Theme } from \"@earendil-works/pi-coding-agent\";\nimport { Key, matchesKey, SelectList, type TUI, type TuiMouseEvent } from \"@earendil-works/pi-tui\";\nimport {\n HorizontalRule,\n hardWrapTerminalDocument,\n renderBoundedFrameLayout,\n sanitizeTerminalText,\n} from \"@narumitw/pi-tui-kit\";\n\nexport type SyncConfirmationChoice = \"cancel\" | \"approve\" | \"details\";\n\n/** Kit choice context is clipped on short terminals; this summary must remain reviewable. */\nexport function createSyncConfirmation(options: {\n title: string;\n lines: readonly string[];\n confirmationLabel: string;\n tui: TUI;\n theme: Theme;\n keybindings: KeybindingsManager;\n complete(choice: SyncConfirmationChoice): void;\n}) {\n const { tui, theme, keybindings } = options;\n const choices: SyncConfirmationChoice[] = [\"cancel\", \"approve\", \"details\"];\n const list = new SelectList(\n [\n { value: \"cancel\", label: \"No, cancel\" },\n { value: \"approve\", label: `Yes, ${sanitizeTerminalText(options.confirmationLabel)}` },\n { value: \"details\", label: \"View details\" },\n ],\n 3,\n {\n selectedPrefix: (text) => theme.fg(\"accent\", text),\n selectedText: (text) => theme.fg(\"accent\", text),\n description: (text) => theme.fg(\"muted\", text),\n scrollInfo: (text) => theme.fg(\"dim\", text),\n noMatch: (text) => theme.fg(\"muted\", text),\n },\n );\n const rule = new HorizontalRule({ ruleStyle: (text) => theme.fg(\"border\", text) });\n let selected = 0;\n let offset = 0;\n let maximumOffset = 0;\n let lastWidth = 0;\n let lastRows = 0;\n let seen = new Set<number>();\n let summary: readonly string[] = [];\n let reviewed = false;\n let disposed = false;\n let finished = false;\n let pageSize = 0;\n let actionRows: ReturnType<typeof renderBoundedFrameLayout>[\"contentRows\"] = [];\n let clickedChoice: SyncConfirmationChoice | undefined;\n const finish = (choice: SyncConfirmationChoice) => {\n if (disposed || finished) return;\n finished = true;\n options.complete(choice);\n };\n const select = (index: number) => {\n selected = (index + choices.length) % choices.length;\n list.setSelectedIndex(selected);\n };\n list.onSelectionChange = (item) => {\n selected = Math.max(0, choices.indexOf(item.value as SyncConfirmationChoice));\n };\n const activate = (choice: SyncConfirmationChoice) => {\n if (choice !== \"approve\" || reviewed) finish(choice);\n };\n list.onSelect = (item) => {\n if (clickedChoice && item.value === clickedChoice) activate(clickedChoice);\n };\n const scroll = (delta: number) => {\n offset = Math.max(0, Math.min(maximumOffset, offset + delta));\n };\n const terminalRows = () => Math.max(1, Math.floor(tui.terminal.rows) - 3);\n const component = {\n get capturesViewportInput() {\n return list.capturesViewportInput;\n },\n render(width: number, expose = true): string[] {\n const cells = Math.floor(width);\n if (!Number.isFinite(cells) || cells <= 0) {\n reviewed = false;\n actionRows = [];\n return [];\n }\n const rows = terminalRows();\n if (cells !== lastWidth || rows !== lastRows) {\n // Reflow can expose previously unseen rows or hide the selected action.\n // Reset proof and selection rather than carry approval across a resize.\n summary = options.lines.flatMap((line) => hardWrapTerminalDocument(line, cells)).filter((line) => line.trim());\n seen = new Set();\n offset = 0;\n select(0);\n lastWidth = cells;\n lastRows = rows;\n }\n const actions = list.render(cells);\n const framingRows = 5;\n pageSize = Math.max(0, rows - actions.length - framingRows);\n maximumOffset = Math.max(0, summary.length - pageSize);\n offset = Math.min(offset, maximumOffset);\n const visible = summary.slice(offset, offset + pageSize);\n if (expose) for (let index = offset; index < offset + visible.length; index++) seen.add(index);\n // Very small terminals cannot display the summary and all choices together.\n // Keep cancellation available, but never approve a zero-row summary viewport.\n reviewed = pageSize > 0 && seen.size === summary.length;\n // Describe actions without advertising configured keys that can be invalid,\n // aliased, or shadowed by an earlier cancellation/navigation binding.\n const status = theme.fg(\n \"muted\",\n `Summary ${visible.length ? offset + 1 : 0}-${offset + visible.length}/${summary.length}${reviewed ? \"\" : \" \u2014 page before Yes\"}`,\n );\n const layout = renderBoundedFrameLayout({\n width: cells,\n maxRows: rows,\n rule: rule.render(cells)[0] ?? \"\",\n title: [theme.fg(\"accent\", theme.bold(sanitizeTerminalText(options.title)))],\n context: [...visible.map((line) => theme.fg(\"text\", line)), status],\n content: actions,\n priorityRows: [selected, 0, 1, 2],\n focusedRow: selected,\n });\n actionRows = layout.contentRows;\n return layout.lines;\n },\n invalidate() {\n list.invalidate();\n rule.invalidate();\n },\n handleInput(data: string) {\n if (disposed || finished) return;\n if (matchesKey(data, Key.ctrl(\"c\")) || keybindings.matches(data, \"tui.select.cancel\")) {\n finish(\"cancel\");\n return;\n }\n // Refresh height/width proof before handling an input racing with terminal resize.\n component.render(tui.terminal.columns ?? lastWidth, false);\n if (keybindings.matches(data, \"tui.select.up\")) {\n select(selected - 1);\n } else if (keybindings.matches(data, \"tui.select.down\")) {\n select(selected + 1);\n } else if (keybindings.matches(data, \"tui.select.confirm\")) {\n activate(choices[selected] ?? \"cancel\");\n } else if (keybindings.matches(data, \"tui.select.pageUp\")) {\n scroll(-pageSize);\n } else if (keybindings.matches(data, \"tui.select.pageDown\")) {\n scroll(pageSize);\n } else {\n return;\n }\n tui.requestRender();\n },\n handleMouse(event: TuiMouseEvent) {\n if (disposed || finished || event.width !== lastWidth || terminalRows() !== lastRows) return undefined;\n if (\n event.y >= 2 &&\n event.y < 2 + Math.min(pageSize, summary.length) &&\n event.type === \"wheel\" &&\n event.wheelDelta\n ) {\n scroll(Math.sign(event.wheelDelta));\n return { handled: true, render: true };\n }\n const row = actionRows.find(({ frameIndex }) => frameIndex === event.y);\n if (!row) return undefined;\n clickedChoice = event.type === \"click\" ? choices[row.contentIndex] : undefined;\n return list.handleMouse({ ...event, y: row.contentIndex, height: choices.length });\n },\n dispose() {\n disposed = true;\n seen.clear();\n },\n };\n return component;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;AACA,SAAS,uBAAuB;AAChC,SAAS,YAAY,sBAAsB,mBAAmB,eAAe;;;ACD7E,SAAS,KAAK,YAAY,kBAAgD;AAC1E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAKA,SAAS,uBAAuB,SAQpC;AACD,QAAM,EAAE,KAAK,OAAO,YAAY,IAAI;AACpC,QAAM,UAAoC,CAAC,UAAU,WAAW,SAAS;AACzE,QAAM,OAAO,IAAI;AAAA,IACf;AAAA,MACE,EAAE,OAAO,UAAU,OAAO,aAAa;AAAA,MACvC,EAAE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
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-B5F3JLD3.ts";
|
|
38
38
|
import {
|
|
39
39
|
combineSignals,
|
|
40
40
|
throwIfAborted
|
|
@@ -187,7 +187,7 @@ Use pi-sync-daemon status/stop/restart --root <agent-directory> for explicit lif
|
|
|
187
187
|
return { kind: "completed" };
|
|
188
188
|
}
|
|
189
189
|
case "conflicts": {
|
|
190
|
-
const { showConflicts } = await import("./conflict-review-
|
|
190
|
+
const { showConflicts } = await import("./conflict-review-JWEA7DPQ.ts");
|
|
191
191
|
throwIfAborted(options.signal);
|
|
192
192
|
await showConflicts(ctx, options);
|
|
193
193
|
return { kind: "completed" };
|
|
@@ -273,7 +273,7 @@ async function initConfig(ctx, signal) {
|
|
|
273
273
|
return;
|
|
274
274
|
}
|
|
275
275
|
if (ctx.mode === "tui") {
|
|
276
|
-
const { showSetupWizard } = await import("./setup-wizard-
|
|
276
|
+
const { showSetupWizard } = await import("./setup-wizard-LL6YMGUR.ts");
|
|
277
277
|
throwIfAborted(signal);
|
|
278
278
|
await showSetupWizard(ctx, signal);
|
|
279
279
|
return;
|
|
@@ -398,7 +398,7 @@ async function handleCommand(rawArgs, ctx, sessionSignal, loaders, attention, on
|
|
|
398
398
|
if (!rawArgs.trim()) {
|
|
399
399
|
attention.expand();
|
|
400
400
|
try {
|
|
401
|
-
const { showSyncManager } = await import("./manager-ui-
|
|
401
|
+
const { showSyncManager } = await import("./manager-ui-T5J5WG7T.ts");
|
|
402
402
|
if (sessionSignal.aborted) return;
|
|
403
403
|
await showSyncManager(ctx, run, sessionSignal, {
|
|
404
404
|
getAttention: () => attention.current(),
|
|
@@ -531,4 +531,4 @@ export {
|
|
|
531
531
|
handleCommand,
|
|
532
532
|
resolveSelectionAttention
|
|
533
533
|
};
|
|
534
|
-
//# sourceMappingURL=command-handler-
|
|
534
|
+
//# sourceMappingURL=command-handler-GMRRFWOL.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
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-B5F3JLD3.ts";
|
|
6
6
|
import "./chunk-H7VOTY5N.ts";
|
|
7
7
|
import "./chunk-6YKOHBSC.ts";
|
|
8
8
|
import "./chunk-R3SAMXB6.ts";
|
|
@@ -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-JWEA7DPQ.ts.map
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
showEditWebDavStorageProfile,
|
|
21
21
|
showEditWebDavTarget,
|
|
22
22
|
showIgnoreFileAction
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-LBNC5AOM.ts";
|
|
24
24
|
import {
|
|
25
25
|
dispatchManagerResult
|
|
26
26
|
} from "./chunk-V76KCWHO.ts";
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
} from "./chunk-HLCML3OW.ts";
|
|
64
64
|
import {
|
|
65
65
|
confirmMergeReview
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-POWOMJ7S.ts";
|
|
67
67
|
import {
|
|
68
68
|
directoryScopeSummary,
|
|
69
69
|
showExcludedPaths
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
} from "./chunk-IBXEM35O.ts";
|
|
84
84
|
import {
|
|
85
85
|
piDaemonClient
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-B5F3JLD3.ts";
|
|
87
87
|
import "./chunk-EXDWEFIJ.ts";
|
|
88
88
|
import {
|
|
89
89
|
runCancellableOperation
|
|
@@ -749,12 +749,15 @@ function backendStorageDescription(config) {
|
|
|
749
749
|
switch (config.backend.type) {
|
|
750
750
|
case "s3": {
|
|
751
751
|
const type = config.backend.profile.kind === "r2" || isCloudflareR2Endpoint(config.backend.profile.endpoint) ? "Cloudflare R2" : "S3-compatible";
|
|
752
|
-
|
|
752
|
+
const { bucket, prefix } = config.backend.destination;
|
|
753
|
+
return `${type} \xB7 ${connection} \xB7 ${safeTerminalText(bucket)} \xB7 ${safeTerminalText(prefix)}`;
|
|
753
754
|
}
|
|
754
755
|
case "webdav":
|
|
755
756
|
return `WebDAV \xB7 ${connection} \xB7 ${safeTerminalText(config.backend.destination.path)}`;
|
|
756
|
-
case "git":
|
|
757
|
-
|
|
757
|
+
case "git": {
|
|
758
|
+
const { branch, directory } = config.backend.destination;
|
|
759
|
+
return `Git \xB7 ${connection} \xB7 ${safeTerminalText(branch)} \xB7 ${safeTerminalText(directory)}`;
|
|
760
|
+
}
|
|
758
761
|
}
|
|
759
762
|
}
|
|
760
763
|
|
|
@@ -2139,23 +2142,29 @@ async function showSyncManager(ctx, runRoute, sessionSignal, options = {}) {
|
|
|
2139
2142
|
const menu = defineMenu5({
|
|
2140
2143
|
start: "main",
|
|
2141
2144
|
screens: {
|
|
2142
|
-
main: ({ state }) =>
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2145
|
+
main: ({ state: { manager } }) => {
|
|
2146
|
+
const [title = "Manage sync", ...lines] = manager.title.split("\n");
|
|
2147
|
+
const setupName = ctx.mode === "tui" ? manager.configReview?.setupName : void 0;
|
|
2148
|
+
const setup = setupName === void 0 ? void 0 : safeTerminalText(setupName);
|
|
2149
|
+
const setupInHeading = setup !== void 0 && lines[0] === `Current sync setup: ${setup}`;
|
|
2150
|
+
return {
|
|
2151
|
+
kind: "choice",
|
|
2152
|
+
title: setupInHeading ? `${title} \xB7 ${setup}` : title,
|
|
2153
|
+
lines: setupInHeading ? lines.slice(1) : lines,
|
|
2154
|
+
items: menuItems(manager).map((item) => ({
|
|
2155
|
+
id: item.id,
|
|
2156
|
+
label: ctx.mode === "tui" && item.id === "sync" ? "Sync\u2026" : item.label,
|
|
2157
|
+
details: [item.description ?? "Review synced content."],
|
|
2158
|
+
searchText: `${item.label} ${item.description ?? ""}`,
|
|
2159
|
+
disabled: item.disabled,
|
|
2160
|
+
disabledReason: item.disabledReason
|
|
2161
|
+
})),
|
|
2162
|
+
action: "activate",
|
|
2163
|
+
enableSearch: true,
|
|
2164
|
+
viewportSize: 5,
|
|
2165
|
+
hint: "close"
|
|
2166
|
+
};
|
|
2167
|
+
}
|
|
2159
2168
|
},
|
|
2160
2169
|
actions: {
|
|
2161
2170
|
activate: async (invocation) => {
|
|
@@ -2509,4 +2518,4 @@ function syncMainMenuItem(label) {
|
|
|
2509
2518
|
export {
|
|
2510
2519
|
showSyncManager
|
|
2511
2520
|
};
|
|
2512
|
-
//# sourceMappingURL=manager-ui-
|
|
2521
|
+
//# sourceMappingURL=manager-ui-T5J5WG7T.ts.map
|