@ddtcorex/dsh-maestro-core 0.15.0 → 0.16.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/README.md +7 -7
- package/assets/icon.svg +4 -0
- package/cordis.patch.yml +0 -12
- package/lib/client.js +3 -1744
- package/lib/health-poller.js +1 -1
- package/lib/self-kill-guard.d.ts +25 -8
- package/lib/self-kill-guard.js +81 -27
- package/lib/types/client/config/components/BrandMark.d.ts +3 -3
- package/lib/types/client/index.d.ts.map +1 -1
- package/locale/en.json +6 -0
- package/package.json +9 -5
- package/src/client/config/components/BrandMark.tsx +3 -3
- package/src/client/index.tsx +0 -2
- package/src/host/health-poller.ts +1 -1
- package/src/host/self-kill-guard.ts +84 -26
- package/lib/sync/backup-config.d.ts +0 -55
- package/lib/sync/backup-config.js +0 -119
- package/lib/sync/backup-service.d.ts +0 -123
- package/lib/sync/backup-service.js +0 -486
- package/lib/sync/bidirectional.d.ts +0 -39
- package/lib/sync/bidirectional.js +0 -25
- package/lib/sync/cli.d.ts +0 -38
- package/lib/sync/cli.js +0 -528
- package/lib/sync/config.d.ts +0 -59
- package/lib/sync/config.js +0 -72
- package/lib/sync/fingerprint.d.ts +0 -29
- package/lib/sync/fingerprint.js +0 -65
- package/lib/sync/hashing.d.ts +0 -22
- package/lib/sync/hashing.js +0 -77
- package/lib/sync/index.d.ts +0 -6
- package/lib/sync/index.js +0 -619
- package/lib/sync/machine-id.d.ts +0 -29
- package/lib/sync/machine-id.js +0 -66
- package/lib/sync/merge.d.ts +0 -31
- package/lib/sync/merge.js +0 -86
- package/lib/sync/peer-host.d.ts +0 -22
- package/lib/sync/peer-host.js +0 -62
- package/lib/sync/process-runner.d.ts +0 -31
- package/lib/sync/process-runner.js +0 -161
- package/lib/sync/remote-agent.d.ts +0 -41
- package/lib/sync/remote-agent.js +0 -227
- package/lib/sync/remote-cache.d.ts +0 -18
- package/lib/sync/remote-cache.js +0 -60
- package/lib/sync/remote-manifest.d.ts +0 -33
- package/lib/sync/remote-manifest.js +0 -111
- package/lib/sync/s3-object-store.d.ts +0 -38
- package/lib/sync/s3-object-store.js +0 -126
- package/lib/sync/session-plan.d.ts +0 -29
- package/lib/sync/session-plan.js +0 -213
- package/lib/sync/sigv4.d.ts +0 -20
- package/lib/sync/sigv4.js +0 -57
- package/lib/sync/snapshot.d.ts +0 -16
- package/lib/sync/snapshot.js +0 -143
- package/lib/sync/ssh-mux.d.ts +0 -12
- package/lib/sync/ssh-mux.js +0 -48
- package/lib/sync/store-root.d.ts +0 -44
- package/lib/sync/store-root.js +0 -67
- package/lib/sync/sync-plan.d.ts +0 -24
- package/lib/sync/sync-plan.js +0 -366
- package/lib/sync/sync-service.d.ts +0 -181
- package/lib/sync/sync-service.js +0 -911
- package/lib/sync/sync-types.d.ts +0 -87
- package/lib/sync/sync-types.js +0 -1
- package/lib/sync/transport.d.ts +0 -75
- package/lib/sync/transport.js +0 -196
- package/lib/sync/tunnel-restore.d.ts +0 -77
- package/lib/sync/tunnel-restore.js +0 -142
- package/lib/sync/validation.d.ts +0 -12
- package/lib/sync/validation.js +0 -96
- package/lib/types/client/sync/R2SyncPanel.d.ts +0 -6
- package/lib/types/client/sync/R2SyncPanel.d.ts.map +0 -1
- package/lib/types/client/sync/SyncPanel.d.ts +0 -12
- package/lib/types/client/sync/SyncPanel.d.ts.map +0 -1
- package/lib/types/client/sync/confirm-dialog.d.ts +0 -43
- package/lib/types/client/sync/confirm-dialog.d.ts.map +0 -1
- package/lib/types/client/sync/index.d.ts +0 -10
- package/lib/types/client/sync/index.d.ts.map +0 -1
- package/lib/types/client/sync/ui.d.ts +0 -75
- package/lib/types/client/sync/ui.d.ts.map +0 -1
- package/lib/types/client/sync/use-backup.d.ts +0 -50
- package/lib/types/client/sync/use-backup.d.ts.map +0 -1
- package/lib/types/client/sync/use-sync.d.ts +0 -88
- package/lib/types/client/sync/use-sync.d.ts.map +0 -1
- package/src/client/sync/R2SyncPanel.tsx +0 -260
- package/src/client/sync/SyncPanel.tsx +0 -422
- package/src/client/sync/confirm-dialog.tsx +0 -202
- package/src/client/sync/index.tsx +0 -286
- package/src/client/sync/ui.tsx +0 -297
- package/src/client/sync/use-backup.ts +0 -207
- package/src/client/sync/use-sync.ts +0 -502
- package/src/host/sync/backup-config.ts +0 -158
- package/src/host/sync/backup-service.ts +0 -506
- package/src/host/sync/bidirectional.ts +0 -66
- package/src/host/sync/cli.ts +0 -530
- package/src/host/sync/config.ts +0 -96
- package/src/host/sync/fingerprint.ts +0 -83
- package/src/host/sync/hashing.ts +0 -91
- package/src/host/sync/index.ts +0 -697
- package/src/host/sync/machine-id.ts +0 -81
- package/src/host/sync/merge.ts +0 -99
- package/src/host/sync/peer-host.ts +0 -65
- package/src/host/sync/process-runner.ts +0 -177
- package/src/host/sync/remote-agent.ts +0 -223
- package/src/host/sync/remote-cache.ts +0 -68
- package/src/host/sync/remote-manifest.ts +0 -117
- package/src/host/sync/s3-object-store.ts +0 -144
- package/src/host/sync/session-plan.ts +0 -237
- package/src/host/sync/sigv4.ts +0 -81
- package/src/host/sync/snapshot.ts +0 -132
- package/src/host/sync/ssh-mux.ts +0 -55
- package/src/host/sync/store-root.ts +0 -83
- package/src/host/sync/sync-plan.ts +0 -366
- package/src/host/sync/sync-service.ts +0 -944
- package/src/host/sync/sync-types.ts +0 -102
- package/src/host/sync/transport.ts +0 -256
- package/src/host/sync/tunnel-restore.ts +0 -160
- package/src/host/sync/validation.ts +0 -104
package/lib/sync/validation.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
export const HOST_RE = /^(?!-)[A-Za-z0-9._@:-]+$/;
|
|
2
|
-
export const ABSOLUTE_RE = /^\/(?:[A-Za-z0-9._-]+\/)*[A-Za-z0-9._-]+$/;
|
|
3
|
-
// `migrated-v5.json` is the store-move marker: a peer that carries it has moved its
|
|
4
|
-
// store out of the DSH home. Sync needs to see it to refuse a half-upgraded pair instead
|
|
5
|
-
// of publishing into a directory the peer no longer reads.
|
|
6
|
-
export const ELIGIBLE_RE = /^(?:maestro-memory\/(?!.*\.bak\.)[A-Za-z0-9._\/-]+\.md|maestro-memory\/SUGGESTIONS\.jsonl|maestro-memory\/\.maestro-memory\/migrated-v5\.json|sessions\/[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+\/session\.jsonl\.zstd|sessions\/[A-Za-z0-9._\/-]+\.jsonl\.zstd)$/;
|
|
7
|
-
/** True when a wire path is eligible, without throwing at the caller. */
|
|
8
|
-
export function isEligiblePath(value) {
|
|
9
|
-
try {
|
|
10
|
-
normalizeEligiblePath(value);
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
catch {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
// Backwards-compatible aliases required by spec
|
|
18
|
-
export const HOST = HOST_RE;
|
|
19
|
-
export const ABSOLUTE = ABSOLUTE_RE;
|
|
20
|
-
export const ELIGIBLE = ELIGIBLE_RE;
|
|
21
|
-
function containsControlChars(s) {
|
|
22
|
-
// Reject NUL, newline, carriage return, and other C0 controls
|
|
23
|
-
for (let i = 0; i < s.length; i++) {
|
|
24
|
-
const code = s.charCodeAt(i);
|
|
25
|
-
if (code <= 0x1f || code === 0x7f)
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
function containsWhitespace(s) {
|
|
31
|
-
return /\s/.test(s);
|
|
32
|
-
}
|
|
33
|
-
function containsShellMeta(s) {
|
|
34
|
-
// Shell metachars that must not appear in host/path even if regex would catch some
|
|
35
|
-
// Keep validation explicit and fail-closed
|
|
36
|
-
return /[;`$|&><*?'"\\(){}!]/.test(s);
|
|
37
|
-
}
|
|
38
|
-
export function validateHost(host) {
|
|
39
|
-
if (typeof host !== 'string' || host.length === 0)
|
|
40
|
-
throw new Error('host must be a non-empty string');
|
|
41
|
-
if (containsControlChars(host) || host.includes('\u0000'))
|
|
42
|
-
throw new Error(`invalid host: contains control characters`);
|
|
43
|
-
if (!HOST_RE.test(host))
|
|
44
|
-
throw new Error(`invalid host: ${JSON.stringify(host)} does not match ${HOST_RE}`);
|
|
45
|
-
if (containsWhitespace(host) || containsShellMeta(host) || host.includes('=')) {
|
|
46
|
-
throw new Error(`invalid host: ${JSON.stringify(host)} contains illegal characters`);
|
|
47
|
-
}
|
|
48
|
-
return host;
|
|
49
|
-
}
|
|
50
|
-
export function validateRemoteTarget(value) {
|
|
51
|
-
if (!value || typeof value.host !== 'string' || typeof value.dshRoot !== 'string') {
|
|
52
|
-
throw new Error('RemoteTarget must have string host and dshRoot');
|
|
53
|
-
}
|
|
54
|
-
const { host, dshRoot } = value;
|
|
55
|
-
validateHost(host);
|
|
56
|
-
if (!ABSOLUTE_RE.test(dshRoot)) {
|
|
57
|
-
throw new Error(`invalid dshRoot: ${JSON.stringify(dshRoot)} does not match ${ABSOLUTE_RE}`);
|
|
58
|
-
}
|
|
59
|
-
// Additional fail-closed checks: reject traversal, ~, //, trailing slash already covered
|
|
60
|
-
if (dshRoot.includes('~')) {
|
|
61
|
-
throw new Error(`invalid dshRoot: must be absolute without ~ expansion: ${JSON.stringify(dshRoot)}`);
|
|
62
|
-
}
|
|
63
|
-
if (dshRoot.includes('..')) {
|
|
64
|
-
throw new Error(`invalid dshRoot: must not contain traversal: ${JSON.stringify(dshRoot)}`);
|
|
65
|
-
}
|
|
66
|
-
if (containsWhitespace(dshRoot) || containsShellMeta(dshRoot)) {
|
|
67
|
-
throw new Error(`invalid dshRoot: contains whitespace or shell metacharacters`);
|
|
68
|
-
}
|
|
69
|
-
return { host, dshRoot };
|
|
70
|
-
}
|
|
71
|
-
export function normalizeEligiblePath(value) {
|
|
72
|
-
if (typeof value !== 'string') {
|
|
73
|
-
throw new Error('path must be a string');
|
|
74
|
-
}
|
|
75
|
-
if (value.length === 0)
|
|
76
|
-
throw new Error('path must not be empty');
|
|
77
|
-
if (containsControlChars(value) || value.includes('\u0000')) {
|
|
78
|
-
throw new Error(`ineligible path: contains control characters: ${JSON.stringify(value)}`);
|
|
79
|
-
}
|
|
80
|
-
if (value.includes('..')) {
|
|
81
|
-
// traversal not allowed at all; eligible paths are strictly under maestro-memory/ or sessions/
|
|
82
|
-
// The ELIGIBLE regex would reject it anyway, but be explicit
|
|
83
|
-
throw new Error(`ineligible path: traversal: ${JSON.stringify(value)}`);
|
|
84
|
-
}
|
|
85
|
-
if (value.startsWith('/') || value.startsWith('./') || value.startsWith('../')) {
|
|
86
|
-
throw new Error(`ineligible path: must be relative eligible path: ${JSON.stringify(value)}`);
|
|
87
|
-
}
|
|
88
|
-
if (!ELIGIBLE_RE.test(value)) {
|
|
89
|
-
throw new Error(`ineligible path: ${JSON.stringify(value)} does not match ${ELIGIBLE_RE}`);
|
|
90
|
-
}
|
|
91
|
-
// Extra sanity: already checked NUL, but also forbid backslash (Windows sep) and absolute
|
|
92
|
-
if (value.includes('\\')) {
|
|
93
|
-
throw new Error(`ineligible path: must use POSIX separators: ${JSON.stringify(value)}`);
|
|
94
|
-
}
|
|
95
|
-
return value;
|
|
96
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"R2SyncPanel.d.ts","sourceRoot":"","sources":["../../../../src/client/sync/R2SyncPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAsIjD,wBAAgB,WAAW,CAAC,KAAK,EAAE;IAAE,CAAC,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;CAAE,GAAG,KAAK,CAAC,YAAY,CAwHhG"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Maestro Sync — the complete settings card (settings.section, id maestro-sync).
|
|
4
|
-
* Mobile-first summary + the two paged file lists (Only here / Only there);
|
|
5
|
-
* everything lives in Settings. Keeps the confirmation-first contract: Preview
|
|
6
|
-
* is read-only; apply exists only inside the dialog bound to the live preview
|
|
7
|
-
* id (confirm:true).
|
|
8
|
-
*/
|
|
9
|
-
export declare function SyncPanel(props: {
|
|
10
|
-
ctx: any;
|
|
11
|
-
}): React.ReactElement;
|
|
12
|
-
//# sourceMappingURL=SyncPanel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SyncPanel.d.ts","sourceRoot":"","sources":["../../../../src/client/sync/SyncPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAAE,GAAG,EAAE,GAAG,CAAA;CAAE,GAAG,KAAK,CAAC,YAAY,CAuZjE"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Tunnel-restore confirmation — the only place a restore can be issued.
|
|
4
|
-
*
|
|
5
|
-
* The restore rewrites `domains.tunnel` in the shared store, the same data
|
|
6
|
-
* class whose uncoordinated write took a machine's tunnel down (HTTP 530) on
|
|
7
|
-
* 2026-08-26/2026-09-09, so it follows the preview → single-use id → dialog
|
|
8
|
-
* contract every other mutation in this panel already uses. The preview body is
|
|
9
|
-
* read-only and shows exactly which fields change.
|
|
10
|
-
*/
|
|
11
|
-
export declare function TunnelRestoreDialog(props: {
|
|
12
|
-
preview: any;
|
|
13
|
-
busy: boolean;
|
|
14
|
-
onCancel: () => void;
|
|
15
|
-
onConfirm: () => void;
|
|
16
|
-
}): React.ReactElement;
|
|
17
|
-
/**
|
|
18
|
-
* Confirmation-first apply dialog — the ONLY place an apply can be issued.
|
|
19
|
-
* Bound to a live preview id; Escape cancels; actions list paginates.
|
|
20
|
-
* Bottom-sheet on mobile, centered card on ≥640px.
|
|
21
|
-
*/
|
|
22
|
-
export declare function ConfirmDialog(props: {
|
|
23
|
-
preview: any;
|
|
24
|
-
previewDirection: 'pull' | 'push';
|
|
25
|
-
remoteHost: string;
|
|
26
|
-
busy: boolean;
|
|
27
|
-
actionLimit: number;
|
|
28
|
-
planAgeSecs: number;
|
|
29
|
-
onShowMore: () => void;
|
|
30
|
-
onCancel: () => void;
|
|
31
|
-
onApply: () => void;
|
|
32
|
-
/** R2 flows: title + target label override; defaults keep the remote-sync wording. */
|
|
33
|
-
kind?: 'sync' | 'backup' | 'restore' | 'gc';
|
|
34
|
-
title?: string;
|
|
35
|
-
targetLabel?: string;
|
|
36
|
-
/** Bidirectional flow: second plan section rendered below the primary one. */
|
|
37
|
-
projectedTitle?: string;
|
|
38
|
-
projectedPreview?: any;
|
|
39
|
-
projectedNote?: string;
|
|
40
|
-
/** Bidirectional flow: apply button label override. */
|
|
41
|
-
applyLabel?: string;
|
|
42
|
-
}): React.ReactElement;
|
|
43
|
-
//# sourceMappingURL=confirm-dialog.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"confirm-dialog.d.ts","sourceRoot":"","sources":["../../../../src/client/sync/confirm-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAY9B;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IACzC,OAAO,EAAE,GAAG,CAAA;IACZ,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,SAAS,EAAE,MAAM,IAAI,CAAA;CACtB,GAAG,KAAK,CAAC,YAAY,CAgDrB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,OAAO,EAAE,GAAG,CAAA;IACZ,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAA;IACjC,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,OAAO,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,sFAAsF;IACtF,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAA;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,gBAAgB,CAAC,EAAE,GAAG,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,GAAG,KAAK,CAAC,YAAY,CAoGrB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SyncPanel } from './SyncPanel.js';
|
|
2
|
-
export declare const inject: readonly ["slots", "connection"];
|
|
3
|
-
declare function apply(ctx: any): void;
|
|
4
|
-
export { SyncPanel, apply };
|
|
5
|
-
declare const _default: {
|
|
6
|
-
inject: readonly ["slots", "connection"];
|
|
7
|
-
apply: typeof apply;
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/sync/index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,eAAO,MAAM,MAAM,kCAAmC,CAAA;AA0PtD,iBAAS,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAmB7B;AAED,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;;;;;AAE3B,wBAAgC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Sync UI kit — DSH-native primitives, Minimalism & Swiss (design-system/MASTER.md).
|
|
4
|
-
* Every color/geometry value maps to a --dsw-alias-* / --dsw-* token; the only
|
|
5
|
-
* fixed hex is the shared Maestro logo tile #0A84FF (branding rule).
|
|
6
|
-
* Components style themselves via [data-sync-*] attributes + tokens (mirrors
|
|
7
|
-
* the dsh-maestro-jobs ui kit so mobile media queries live in one CSS layer).
|
|
8
|
-
*/
|
|
9
|
-
export declare const RPC_CHANNEL: "/dsh-maestro-sync";
|
|
10
|
-
export declare const t: {
|
|
11
|
-
readonly bgBase: "var(--dsw-alias-bg-base)";
|
|
12
|
-
readonly bgLayer1: "var(--dsw-alias-bg-layer-1)";
|
|
13
|
-
readonly bgLayer2: "var(--dsw-alias-bg-layer-2)";
|
|
14
|
-
readonly bgLayer3: "var(--dsw-alias-bg-layer-3)";
|
|
15
|
-
readonly bgOverlay: "var(--dsw-alias-bg-overlay)";
|
|
16
|
-
readonly borderL1: "var(--dsw-alias-border-l1)";
|
|
17
|
-
readonly borderL2: "var(--dsw-alias-border-l2)";
|
|
18
|
-
readonly labelPrimary: "var(--dsw-alias-label-primary)";
|
|
19
|
-
readonly labelSecondary: "var(--dsw-alias-label-secondary)";
|
|
20
|
-
readonly labelTertiary: "var(--dsw-alias-label-tertiary)";
|
|
21
|
-
readonly labelFg: "var(--dsw-alias-label-primary-foreground)";
|
|
22
|
-
readonly primaryFill: "var(--dsw-alias-button-primary-fill)";
|
|
23
|
-
readonly primaryHover: "var(--dsw-alias-button-primary-hover)";
|
|
24
|
-
readonly interactiveHover: "var(--dsw-alias-interactive-bg-hover)";
|
|
25
|
-
readonly interactiveActive: "var(--dsw-alias-interactive-bg-active)";
|
|
26
|
-
readonly brand: "var(--dsw-alias-brand-primary)";
|
|
27
|
-
readonly stateError: "var(--dsw-alias-state-error-primary)";
|
|
28
|
-
readonly stateSuccess: "var(--dsw-alias-state-success-primary)";
|
|
29
|
-
readonly stateWarn: "var(--dsw-alias-state-warn-primary)";
|
|
30
|
-
readonly shadowLv3: "var(--dsw-shadow-lv3)";
|
|
31
|
-
};
|
|
32
|
-
export declare function MaestroLogo(props: {
|
|
33
|
-
outer?: number;
|
|
34
|
-
size?: number;
|
|
35
|
-
radius?: number;
|
|
36
|
-
}): React.JSX.Element;
|
|
37
|
-
export type IconName = 'refresh' | 'download' | 'upload' | 'swap' | 'file' | 'folder' | 'star' | 'message' | 'calendar' | 'server' | 'clock' | 'alert' | 'check' | 'close' | 'chevron-down' | 'chevron-right' | 'external';
|
|
38
|
-
export declare function Icon(props: {
|
|
39
|
-
name: IconName;
|
|
40
|
-
size?: number;
|
|
41
|
-
}): React.JSX.Element;
|
|
42
|
-
export declare function Button(props: {
|
|
43
|
-
variant?: 'primary' | 'outline' | 'ghost';
|
|
44
|
-
size?: 'sm' | 'md';
|
|
45
|
-
icon?: IconName;
|
|
46
|
-
busy?: boolean;
|
|
47
|
-
children?: React.ReactNode;
|
|
48
|
-
style?: React.CSSProperties;
|
|
49
|
-
} & Record<string, unknown>): React.JSX.Element;
|
|
50
|
-
export declare function StatTile(props: {
|
|
51
|
-
icon: IconName;
|
|
52
|
-
value: React.ReactNode;
|
|
53
|
-
label: string;
|
|
54
|
-
hint?: string;
|
|
55
|
-
tone?: 'default' | 'success' | 'error' | 'warn';
|
|
56
|
-
onClick?: () => void;
|
|
57
|
-
ariaLabel?: string;
|
|
58
|
-
}): React.JSX.Element;
|
|
59
|
-
export declare function Badge(props: {
|
|
60
|
-
children: React.ReactNode;
|
|
61
|
-
tone?: 'default' | 'success' | 'error' | 'warn' | 'brand';
|
|
62
|
-
icon?: IconName;
|
|
63
|
-
}): React.JSX.Element;
|
|
64
|
-
export declare function formatLastSync(v: string | null): string;
|
|
65
|
-
export declare function formatFile(path: string): {
|
|
66
|
-
icon: IconName;
|
|
67
|
-
title: string;
|
|
68
|
-
path: string;
|
|
69
|
-
meta: string;
|
|
70
|
-
};
|
|
71
|
-
/** Exact action label — same-name files are never called "in sync" here. */
|
|
72
|
-
export declare function actionLabel(action: any): string;
|
|
73
|
-
export declare function actionTone(action: any): 'default' | 'success' | 'error' | 'warn' | 'brand';
|
|
74
|
-
export declare function humanSummary(status: any): string;
|
|
75
|
-
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../../src/client/sync/ui.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B;;;;;;GAMG;AAEH,eAAO,MAAM,WAAW,EAAG,mBAA4B,CAAA;AAGvD,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;CAqBJ,CAAA;AAGV,wBAAgB,WAAW,CAAC,KAAK,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,qBA4BpF;AAGD,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,UAAU,GACV,QAAQ,GACR,MAAM,GACN,MAAM,GACN,QAAQ,GACR,MAAM,GACN,SAAS,GACT,UAAU,GACV,QAAQ,GACR,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,cAAc,GACd,eAAe,GACf,UAAU,CAAA;AA2Cd,wBAAgB,IAAI,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,qBAO5D;AAGD,wBAAgB,MAAM,CAAC,KAAK,EAAE;IAC5B,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAA;IACzC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IAClB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,qBA+C1B;AAGD,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,qBAqBlM;AAGD,wBAAgB,KAAK,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,QAAQ,CAAA;CAAE,qBAQrI;AAGD,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CASvD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAmBtG;AAED,4EAA4E;AAC5E,wBAAgB,WAAW,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAW/C;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,GAAG,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAW1F;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAMhD"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export interface BackupStatusView {
|
|
2
|
-
configured: boolean;
|
|
3
|
-
source: 'env' | 'file' | 'none';
|
|
4
|
-
bucket: string;
|
|
5
|
-
prefix: string;
|
|
6
|
-
/** Non-secret snapshot for the config form (never secret material). */
|
|
7
|
-
r2?: {
|
|
8
|
-
provider: string;
|
|
9
|
-
endpoint: string;
|
|
10
|
-
region: string;
|
|
11
|
-
bucket: string;
|
|
12
|
-
prefix: string;
|
|
13
|
-
};
|
|
14
|
-
lastManifest: string | null;
|
|
15
|
-
eligible: {
|
|
16
|
-
md: number;
|
|
17
|
-
sessions: number;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export declare function useBackupTarget(ctx: any): {
|
|
21
|
-
status: BackupStatusView | null;
|
|
22
|
-
checking: boolean;
|
|
23
|
-
busy: boolean;
|
|
24
|
-
error: string;
|
|
25
|
-
backupPreview: any;
|
|
26
|
-
restorePreview: any;
|
|
27
|
-
gcReport: any;
|
|
28
|
-
confirmOpen: "backup" | "restore" | "gc" | null;
|
|
29
|
-
canBackup: boolean;
|
|
30
|
-
loadStatus: () => Promise<void>;
|
|
31
|
-
saveR2Config: (fields: {
|
|
32
|
-
provider: string;
|
|
33
|
-
accountId: string;
|
|
34
|
-
endpoint: string;
|
|
35
|
-
region: string;
|
|
36
|
-
bucket: string;
|
|
37
|
-
prefix: string;
|
|
38
|
-
}) => Promise<{
|
|
39
|
-
ok: boolean;
|
|
40
|
-
error?: string;
|
|
41
|
-
}>;
|
|
42
|
-
previewBackup: () => Promise<void>;
|
|
43
|
-
applyBackup: () => Promise<void>;
|
|
44
|
-
previewRestore: (mode: "new-dir" | "in-place") => Promise<void>;
|
|
45
|
-
applyRestore: (mode: "new-dir" | "in-place", destDir?: string) => Promise<void>;
|
|
46
|
-
previewGc: () => Promise<void>;
|
|
47
|
-
applyGc: () => Promise<void>;
|
|
48
|
-
cancelDialog: () => void;
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=use-backup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-backup.d.ts","sourceRoot":"","sources":["../../../../src/client/sync/use-backup.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,EAAE,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5F,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5C;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG;;;;;;;;;;;2BA+IrB;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;;;2BA9EtJ,SAAS,GAAG,UAAU;yBAmBtB,SAAS,GAAG,UAAU,YAAY,MAAM;;;;EAwGxD"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Shared Sync state machine — confirmation-first Preview/Apply.
|
|
4
|
-
* - Preview is read-only; apply exists only inside a confirmation dialog bound
|
|
5
|
-
* to the live preview id, with {confirm:true}. Escape cancels; nothing applies
|
|
6
|
-
* without confirmation.
|
|
7
|
-
* - status pages two buckets (localOnly / remoteOnly) with cursors.
|
|
8
|
-
*/
|
|
9
|
-
export interface SyncConnection {
|
|
10
|
-
ok: boolean;
|
|
11
|
-
host: string;
|
|
12
|
-
latencyMs?: number;
|
|
13
|
-
error?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface PageState {
|
|
16
|
-
files: string[];
|
|
17
|
-
total: number;
|
|
18
|
-
next: number | null;
|
|
19
|
-
/** true once the first page has settled — separates "still loading" from "genuinely empty" */
|
|
20
|
-
loaded?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export type Bucket = 'localOnly' | 'remoteOnly';
|
|
23
|
-
export declare function useSync(ctx: any): {
|
|
24
|
-
remoteHost: string;
|
|
25
|
-
remoteSource: string;
|
|
26
|
-
lastSync: string | null;
|
|
27
|
-
status: any;
|
|
28
|
-
connection: SyncConnection | null;
|
|
29
|
-
machines: {
|
|
30
|
-
localId: string | null;
|
|
31
|
-
remoteId: string | null;
|
|
32
|
-
from?: string;
|
|
33
|
-
to?: string;
|
|
34
|
-
ok?: boolean;
|
|
35
|
-
reason?: string;
|
|
36
|
-
} | null;
|
|
37
|
-
checking: boolean;
|
|
38
|
-
busy: boolean;
|
|
39
|
-
result: {
|
|
40
|
-
kind: string;
|
|
41
|
-
ok: boolean;
|
|
42
|
-
text: string;
|
|
43
|
-
} | null;
|
|
44
|
-
error: string;
|
|
45
|
-
hostFieldError: string | null;
|
|
46
|
-
setHostFieldError: React.Dispatch<React.SetStateAction<string | null>>;
|
|
47
|
-
preview: any;
|
|
48
|
-
previewDirection: "push" | "pull";
|
|
49
|
-
confirmOpen: boolean;
|
|
50
|
-
biPreview: any;
|
|
51
|
-
biConfirmOpen: boolean;
|
|
52
|
-
tunnelPreview: any;
|
|
53
|
-
tunnelConfirmOpen: boolean;
|
|
54
|
-
actionLimit: number;
|
|
55
|
-
progress: {
|
|
56
|
-
phase: string;
|
|
57
|
-
current: number;
|
|
58
|
-
total: number;
|
|
59
|
-
file?: string;
|
|
60
|
-
} | null;
|
|
61
|
-
pages: Record<Bucket, PageState>;
|
|
62
|
-
setActionLimit: React.Dispatch<React.SetStateAction<number>>;
|
|
63
|
-
setError: React.Dispatch<React.SetStateAction<string>>;
|
|
64
|
-
setResult: React.Dispatch<React.SetStateAction<{
|
|
65
|
-
kind: string;
|
|
66
|
-
ok: boolean;
|
|
67
|
-
text: string;
|
|
68
|
-
} | null>>;
|
|
69
|
-
loadStatus: () => Promise<void>;
|
|
70
|
-
loadPage: (bucket: Bucket, cursor: number) => Promise<void>;
|
|
71
|
-
saveRemoteHost: (host: string) => Promise<{
|
|
72
|
-
ok: boolean;
|
|
73
|
-
error?: string;
|
|
74
|
-
}>;
|
|
75
|
-
checkConnection: () => Promise<boolean>;
|
|
76
|
-
loadMachines: () => Promise<void>;
|
|
77
|
-
handleTunnelRestorePreview: () => Promise<void>;
|
|
78
|
-
confirmTunnelRestore: () => Promise<void>;
|
|
79
|
-
cancelTunnelRestore: () => void;
|
|
80
|
-
handlePreview: (direction: "pull" | "push") => Promise<void>;
|
|
81
|
-
handleApply: () => Promise<void>;
|
|
82
|
-
cancelDialog: () => void;
|
|
83
|
-
handleBidirectionalPreview: () => Promise<void>;
|
|
84
|
-
handleBidirectionalApply: () => Promise<void>;
|
|
85
|
-
cancelBidirectionalDialog: () => void;
|
|
86
|
-
};
|
|
87
|
-
export type SyncState = ReturnType<typeof useSync>;
|
|
88
|
-
//# sourceMappingURL=use-sync.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-sync.d.ts","sourceRoot":"","sources":["../../../../src/client/sync/use-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B;;;;;;GAMG;AAEH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,OAAO,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,MAAM,MAAM,GAAG,WAAW,GAAG,YAAY,CAAA;AAE/C,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG;;;;;;;iBAgB4B,MAAM,GAAG,IAAI;kBAAY,MAAM,GAAG,IAAI;eAAS,MAAM;aAAO,MAAM;aAAO,OAAO;iBAAW,MAAM;;;;;cAIxG,MAAM;YAAM,OAAO;cAAQ,MAAM;;;;;;;;;;;;;;eAkB5B,MAAM;iBAAW,MAAM;eAAS,MAAM;eAAS,MAAM;;;;;;cAlB1D,MAAM;YAAM,OAAO;cAAQ,MAAM;;;uBA0CnE,MAAM,UAAU,MAAM;2BA8NxB,MAAM,KAAG,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;2BAiDZ,OAAO,CAAC,OAAO,CAAC;wBAfnB,OAAO,CAAC,IAAI,CAAC;sCA+CC,OAAO,CAAC,IAAI,CAAC;gCAwBnB,OAAO,CAAC,IAAI,CAAC;;+BApQlD,MAAM,GAAG,MAAM;;;;;;EAsVpC;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAA"}
|