@ddtcorex/dsh-maestro-core 0.10.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/LICENSE +21 -0
- package/README.md +209 -0
- package/cordis.patch.yml +43 -0
- package/lib/bin.d.ts +2 -0
- package/lib/bin.js +3 -0
- package/lib/boot-guard.d.ts +33 -0
- package/lib/boot-guard.js +68 -0
- package/lib/boot-lock.d.ts +56 -0
- package/lib/boot-lock.js +155 -0
- package/lib/cli.d.ts +31 -0
- package/lib/cli.js +336 -0
- package/lib/client.js +2901 -0
- package/lib/config/index.d.ts +34 -0
- package/lib/config/index.js +62 -0
- package/lib/config/service.d.ts +18 -0
- package/lib/config/service.js +28 -0
- package/lib/config.d.ts +1 -0
- package/lib/config.js +19 -0
- package/lib/daemon-freshness.d.ts +48 -0
- package/lib/daemon-freshness.js +122 -0
- package/lib/debug-agent.d.ts +17 -0
- package/lib/debug-agent.js +144 -0
- package/lib/dsh-session.d.ts +26 -0
- package/lib/dsh-session.js +45 -0
- package/lib/guard/config.d.ts +82 -0
- package/lib/guard/config.js +211 -0
- package/lib/guard/decide.d.ts +30 -0
- package/lib/guard/decide.js +38 -0
- package/lib/guard/full-scan-tool.d.ts +6 -0
- package/lib/guard/full-scan-tool.js +65 -0
- package/lib/guard/index.d.ts +85 -0
- package/lib/guard/index.js +254 -0
- package/lib/guard/journal.d.ts +146 -0
- package/lib/guard/journal.js +398 -0
- package/lib/guard/migrate.d.ts +15 -0
- package/lib/guard/migrate.js +42 -0
- package/lib/guard/parse.d.ts +193 -0
- package/lib/guard/parse.js +1103 -0
- package/lib/guard/paths.d.ts +104 -0
- package/lib/guard/paths.js +254 -0
- package/lib/guard/permission-policy.d.ts +10 -0
- package/lib/guard/permission-policy.js +21 -0
- package/lib/guard/redact.d.ts +25 -0
- package/lib/guard/redact.js +52 -0
- package/lib/guard/rules.d.ts +65 -0
- package/lib/guard/rules.js +832 -0
- package/lib/guard/status-tool.d.ts +54 -0
- package/lib/guard/status-tool.js +195 -0
- package/lib/guard/tiers.d.ts +2 -0
- package/lib/guard/tiers.js +1 -0
- package/lib/guard/validators.d.ts +4 -0
- package/lib/guard/validators.js +45 -0
- package/lib/health-poller.d.ts +90 -0
- package/lib/health-poller.js +430 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +7 -0
- package/lib/intents.d.ts +32 -0
- package/lib/intents.js +49 -0
- package/lib/notifier.d.ts +12 -0
- package/lib/notifier.js +62 -0
- package/lib/paths.d.ts +13 -0
- package/lib/paths.js +70 -0
- package/lib/plugin.d.ts +250 -0
- package/lib/plugin.js +1126 -0
- package/lib/preset.d.ts +73 -0
- package/lib/preset.js +158 -0
- package/lib/report.d.ts +11 -0
- package/lib/report.js +58 -0
- package/lib/restart-exec.d.ts +35 -0
- package/lib/restart-exec.js +60 -0
- package/lib/restart-guards.d.ts +39 -0
- package/lib/restart-guards.js +150 -0
- package/lib/restart-tool.d.ts +124 -0
- package/lib/restart-tool.js +539 -0
- package/lib/restart-web.d.ts +26 -0
- package/lib/restart-web.js +58 -0
- package/lib/resume-log.d.ts +24 -0
- package/lib/resume-log.js +18 -0
- package/lib/resume-tools.d.ts +131 -0
- package/lib/resume-tools.js +337 -0
- package/lib/resume.d.ts +33 -0
- package/lib/resume.js +221 -0
- package/lib/scan.d.ts +20 -0
- package/lib/scan.js +71 -0
- package/lib/self-kill-guard.d.ts +81 -0
- package/lib/self-kill-guard.js +208 -0
- package/lib/session-health.d.ts +89 -0
- package/lib/session-health.js +274 -0
- package/lib/session-log-file.d.ts +22 -0
- package/lib/session-log-file.js +74 -0
- package/lib/skill-provider.d.ts +6 -0
- package/lib/skill-provider.js +73 -0
- package/lib/snapshot.d.ts +59 -0
- package/lib/snapshot.js +358 -0
- package/lib/source.d.ts +19 -0
- package/lib/source.js +19 -0
- package/lib/store/index.d.ts +42 -0
- package/lib/store/index.js +340 -0
- package/lib/store/legacy.d.ts +17 -0
- package/lib/store/legacy.js +85 -0
- package/lib/supervisor.d.ts +119 -0
- package/lib/supervisor.js +741 -0
- package/lib/sync/backup-config.d.ts +55 -0
- package/lib/sync/backup-config.js +119 -0
- package/lib/sync/backup-service.d.ts +110 -0
- package/lib/sync/backup-service.js +440 -0
- package/lib/sync/bidirectional.d.ts +39 -0
- package/lib/sync/bidirectional.js +25 -0
- package/lib/sync/cli.d.ts +38 -0
- package/lib/sync/cli.js +536 -0
- package/lib/sync/config.d.ts +77 -0
- package/lib/sync/config.js +90 -0
- package/lib/sync/fingerprint.d.ts +29 -0
- package/lib/sync/fingerprint.js +65 -0
- package/lib/sync/hashing.d.ts +9 -0
- package/lib/sync/hashing.js +47 -0
- package/lib/sync/index.d.ts +6 -0
- package/lib/sync/index.js +634 -0
- package/lib/sync/machine-id.d.ts +29 -0
- package/lib/sync/machine-id.js +66 -0
- package/lib/sync/merge.d.ts +33 -0
- package/lib/sync/merge.js +88 -0
- package/lib/sync/peer-host.d.ts +22 -0
- package/lib/sync/peer-host.js +62 -0
- package/lib/sync/process-runner.d.ts +31 -0
- package/lib/sync/process-runner.js +161 -0
- package/lib/sync/remote-agent.d.ts +42 -0
- package/lib/sync/remote-agent.js +217 -0
- package/lib/sync/remote-cache.d.ts +18 -0
- package/lib/sync/remote-cache.js +60 -0
- package/lib/sync/remote-manifest.d.ts +8 -0
- package/lib/sync/remote-manifest.js +64 -0
- package/lib/sync/s3-object-store.d.ts +38 -0
- package/lib/sync/s3-object-store.js +126 -0
- package/lib/sync/session-merge.d.ts +18 -0
- package/lib/sync/session-merge.js +191 -0
- package/lib/sync/session-plan.d.ts +29 -0
- package/lib/sync/session-plan.js +213 -0
- package/lib/sync/sigv4.d.ts +20 -0
- package/lib/sync/sigv4.js +57 -0
- package/lib/sync/snapshot.d.ts +21 -0
- package/lib/sync/snapshot.js +176 -0
- package/lib/sync/ssh-mux.d.ts +12 -0
- package/lib/sync/ssh-mux.js +48 -0
- package/lib/sync/sync-plan.d.ts +24 -0
- package/lib/sync/sync-plan.js +366 -0
- package/lib/sync/sync-service.d.ts +177 -0
- package/lib/sync/sync-service.js +819 -0
- package/lib/sync/sync-types.d.ts +87 -0
- package/lib/sync/sync-types.js +1 -0
- package/lib/sync/transport.d.ts +75 -0
- package/lib/sync/transport.js +200 -0
- package/lib/sync/tunnel-restore.d.ts +77 -0
- package/lib/sync/tunnel-restore.js +142 -0
- package/lib/sync/validation.d.ts +10 -0
- package/lib/sync/validation.js +83 -0
- package/lib/tool-view.d.ts +62 -0
- package/lib/tool-view.js +70 -0
- package/lib/types/client/auto-reload.d.ts +8 -0
- package/lib/types/client/auto-reload.d.ts.map +1 -0
- package/lib/types/client/config/MaestroSettings.d.ts +25 -0
- package/lib/types/client/config/MaestroSettings.d.ts.map +1 -0
- package/lib/types/client/config/components/BrandMark.d.ts +50 -0
- package/lib/types/client/config/components/BrandMark.d.ts.map +1 -0
- package/lib/types/client/config/guard-view.d.ts +83 -0
- package/lib/types/client/config/guard-view.d.ts.map +1 -0
- package/lib/types/client/config/index.d.ts +20 -0
- package/lib/types/client/config/index.d.ts.map +1 -0
- package/lib/types/client/config/maestro-mark.d.ts +29 -0
- package/lib/types/client/config/maestro-mark.d.ts.map +1 -0
- package/lib/types/client/config/settings-nav-icon.d.ts +21 -0
- package/lib/types/client/config/settings-nav-icon.d.ts.map +1 -0
- package/lib/types/client/index.d.ts +16 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/sync/R2SyncPanel.d.ts +6 -0
- package/lib/types/client/sync/R2SyncPanel.d.ts.map +1 -0
- package/lib/types/client/sync/SyncPanel.d.ts +12 -0
- package/lib/types/client/sync/SyncPanel.d.ts.map +1 -0
- package/lib/types/client/sync/confirm-dialog.d.ts +43 -0
- package/lib/types/client/sync/confirm-dialog.d.ts.map +1 -0
- package/lib/types/client/sync/index.d.ts +10 -0
- package/lib/types/client/sync/index.d.ts.map +1 -0
- package/lib/types/client/sync/ui.d.ts +79 -0
- package/lib/types/client/sync/ui.d.ts.map +1 -0
- package/lib/types/client/sync/use-backup.d.ts +50 -0
- package/lib/types/client/sync/use-backup.d.ts.map +1 -0
- package/lib/types/client/sync/use-sync.d.ts +88 -0
- package/lib/types/client/sync/use-sync.d.ts.map +1 -0
- package/package.json +89 -0
- package/skills/dsh-safe-restart/SKILL.md +206 -0
- package/skills/dsh-safe-restart/scripts/restart-dsh-web.sh +468 -0
- package/src/client/auto-reload.ts +104 -0
- package/src/client/config/MaestroSettings.tsx +892 -0
- package/src/client/config/components/BrandMark.tsx +94 -0
- package/src/client/config/guard-view.ts +187 -0
- package/src/client/config/index.tsx +109 -0
- package/src/client/config/maestro-mark.ts +37 -0
- package/src/client/config/settings-nav-icon.ts +68 -0
- package/src/client/index.tsx +33 -0
- package/src/client/sync/R2SyncPanel.tsx +260 -0
- package/src/client/sync/SyncPanel.tsx +422 -0
- package/src/client/sync/confirm-dialog.tsx +202 -0
- package/src/client/sync/index.tsx +336 -0
- package/src/client/sync/ui.tsx +313 -0
- package/src/client/sync/use-backup.ts +207 -0
- package/src/client/sync/use-sync.ts +502 -0
- package/src/host/bin.ts +3 -0
- package/src/host/boot-guard.ts +76 -0
- package/src/host/boot-lock.ts +155 -0
- package/src/host/cli.ts +288 -0
- package/src/host/config/index.ts +78 -0
- package/src/host/config/service.ts +40 -0
- package/src/host/config.ts +18 -0
- package/src/host/daemon-freshness.ts +143 -0
- package/src/host/debug-agent.ts +145 -0
- package/src/host/dsh-session.ts +56 -0
- package/src/host/dsh-skill.d.ts +44 -0
- package/src/host/guard/augment.d.ts +33 -0
- package/src/host/guard/config.ts +244 -0
- package/src/host/guard/decide.ts +40 -0
- package/src/host/guard/full-scan-tool.ts +61 -0
- package/src/host/guard/index.ts +281 -0
- package/src/host/guard/journal.ts +440 -0
- package/src/host/guard/migrate.ts +41 -0
- package/src/host/guard/parse.ts +1150 -0
- package/src/host/guard/paths.ts +239 -0
- package/src/host/guard/permission-policy.ts +15 -0
- package/src/host/guard/redact.ts +64 -0
- package/src/host/guard/rules.ts +891 -0
- package/src/host/guard/status-tool.ts +229 -0
- package/src/host/guard/tiers.ts +2 -0
- package/src/host/guard/validators.ts +29 -0
- package/src/host/health-poller.ts +446 -0
- package/src/host/index.ts +7 -0
- package/src/host/intents.ts +67 -0
- package/src/host/notifier.ts +71 -0
- package/src/host/paths.ts +70 -0
- package/src/host/plugin.ts +1097 -0
- package/src/host/preset.ts +170 -0
- package/src/host/report.ts +71 -0
- package/src/host/restart-exec.ts +81 -0
- package/src/host/restart-guards.ts +150 -0
- package/src/host/restart-tool.ts +483 -0
- package/src/host/restart-web.ts +72 -0
- package/src/host/resume-log.ts +39 -0
- package/src/host/resume-tools.ts +385 -0
- package/src/host/resume.ts +204 -0
- package/src/host/scan.ts +61 -0
- package/src/host/self-kill-guard.ts +216 -0
- package/src/host/session-health.ts +236 -0
- package/src/host/session-log-file.ts +77 -0
- package/src/host/skill-provider.ts +69 -0
- package/src/host/snapshot.ts +337 -0
- package/src/host/source.ts +19 -0
- package/src/host/store/index.ts +348 -0
- package/src/host/store/legacy.ts +96 -0
- package/src/host/supervisor.ts +720 -0
- package/src/host/sync/backup-config.ts +159 -0
- package/src/host/sync/backup-service.ts +453 -0
- package/src/host/sync/bidirectional.ts +66 -0
- package/src/host/sync/cli.ts +539 -0
- package/src/host/sync/config.ts +119 -0
- package/src/host/sync/fingerprint.ts +83 -0
- package/src/host/sync/hashing.ts +58 -0
- package/src/host/sync/index.ts +737 -0
- package/src/host/sync/machine-id.ts +81 -0
- package/src/host/sync/merge.ts +102 -0
- package/src/host/sync/peer-host.ts +65 -0
- package/src/host/sync/process-runner.ts +177 -0
- package/src/host/sync/remote-agent.ts +213 -0
- package/src/host/sync/remote-cache.ts +68 -0
- package/src/host/sync/remote-manifest.ts +70 -0
- package/src/host/sync/s3-object-store.ts +144 -0
- package/src/host/sync/session-merge.ts +220 -0
- package/src/host/sync/session-plan.ts +237 -0
- package/src/host/sync/sigv4.ts +81 -0
- package/src/host/sync/snapshot.ts +162 -0
- package/src/host/sync/ssh-mux.ts +56 -0
- package/src/host/sync/sync-plan.ts +366 -0
- package/src/host/sync/sync-service.ts +855 -0
- package/src/host/sync/sync-types.ts +102 -0
- package/src/host/sync/transport.ts +261 -0
- package/src/host/sync/tunnel-restore.ts +160 -0
- package/src/host/sync/validation.ts +91 -0
- package/src/host/tool-view.ts +98 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export const HOST_RE = /^(?!-)[A-Za-z0-9._@:-]+$/;
|
|
2
|
+
export const ABSOLUTE_RE = /^\/(?:[A-Za-z0-9._-]+\/)*[A-Za-z0-9._-]+$/;
|
|
3
|
+
export const ELIGIBLE_RE = /^(?:dsh-maestro-memory\/(?!.*\.bak\.)[A-Za-z0-9._\/-]+\.md|dsh-maestro-memory\/SUGGESTIONS\.jsonl|sessions\/[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+\/session\.jsonl\.zstd|sessions\/[A-Za-z0-9._\/-]+\.jsonl\.zstd)$/;
|
|
4
|
+
// Backwards-compatible aliases required by spec
|
|
5
|
+
export const HOST = HOST_RE;
|
|
6
|
+
export const ABSOLUTE = ABSOLUTE_RE;
|
|
7
|
+
export const ELIGIBLE = ELIGIBLE_RE;
|
|
8
|
+
function containsControlChars(s) {
|
|
9
|
+
// Reject NUL, newline, carriage return, and other C0 controls
|
|
10
|
+
for (let i = 0; i < s.length; i++) {
|
|
11
|
+
const code = s.charCodeAt(i);
|
|
12
|
+
if (code <= 0x1f || code === 0x7f)
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
function containsWhitespace(s) {
|
|
18
|
+
return /\s/.test(s);
|
|
19
|
+
}
|
|
20
|
+
function containsShellMeta(s) {
|
|
21
|
+
// Shell metachars that must not appear in host/path even if regex would catch some
|
|
22
|
+
// Keep validation explicit and fail-closed
|
|
23
|
+
return /[;`$|&><*?'"\\(){}!]/.test(s);
|
|
24
|
+
}
|
|
25
|
+
export function validateHost(host) {
|
|
26
|
+
if (typeof host !== 'string' || host.length === 0)
|
|
27
|
+
throw new Error('host must be a non-empty string');
|
|
28
|
+
if (containsControlChars(host) || host.includes('\u0000'))
|
|
29
|
+
throw new Error(`invalid host: contains control characters`);
|
|
30
|
+
if (!HOST_RE.test(host))
|
|
31
|
+
throw new Error(`invalid host: ${JSON.stringify(host)} does not match ${HOST_RE}`);
|
|
32
|
+
if (containsWhitespace(host) || containsShellMeta(host) || host.includes('=')) {
|
|
33
|
+
throw new Error(`invalid host: ${JSON.stringify(host)} contains illegal characters`);
|
|
34
|
+
}
|
|
35
|
+
return host;
|
|
36
|
+
}
|
|
37
|
+
export function validateRemoteTarget(value) {
|
|
38
|
+
if (!value || typeof value.host !== 'string' || typeof value.dshRoot !== 'string') {
|
|
39
|
+
throw new Error('RemoteTarget must have string host and dshRoot');
|
|
40
|
+
}
|
|
41
|
+
const { host, dshRoot } = value;
|
|
42
|
+
validateHost(host);
|
|
43
|
+
if (!ABSOLUTE_RE.test(dshRoot)) {
|
|
44
|
+
throw new Error(`invalid dshRoot: ${JSON.stringify(dshRoot)} does not match ${ABSOLUTE_RE}`);
|
|
45
|
+
}
|
|
46
|
+
// Additional fail-closed checks: reject traversal, ~, //, trailing slash already covered
|
|
47
|
+
if (dshRoot.includes('~')) {
|
|
48
|
+
throw new Error(`invalid dshRoot: must be absolute without ~ expansion: ${JSON.stringify(dshRoot)}`);
|
|
49
|
+
}
|
|
50
|
+
if (dshRoot.includes('..')) {
|
|
51
|
+
throw new Error(`invalid dshRoot: must not contain traversal: ${JSON.stringify(dshRoot)}`);
|
|
52
|
+
}
|
|
53
|
+
if (containsWhitespace(dshRoot) || containsShellMeta(dshRoot)) {
|
|
54
|
+
throw new Error(`invalid dshRoot: contains whitespace or shell metacharacters`);
|
|
55
|
+
}
|
|
56
|
+
return { host, dshRoot };
|
|
57
|
+
}
|
|
58
|
+
export function normalizeEligiblePath(value) {
|
|
59
|
+
if (typeof value !== 'string') {
|
|
60
|
+
throw new Error('path must be a string');
|
|
61
|
+
}
|
|
62
|
+
if (value.length === 0)
|
|
63
|
+
throw new Error('path must not be empty');
|
|
64
|
+
if (containsControlChars(value) || value.includes('\u0000')) {
|
|
65
|
+
throw new Error(`ineligible path: contains control characters: ${JSON.stringify(value)}`);
|
|
66
|
+
}
|
|
67
|
+
if (value.includes('..')) {
|
|
68
|
+
// traversal not allowed at all; eligible paths are strictly under dsh-maestro-memory/ or sessions/
|
|
69
|
+
// The ELIGIBLE regex would reject it anyway, but be explicit
|
|
70
|
+
throw new Error(`ineligible path: traversal: ${JSON.stringify(value)}`);
|
|
71
|
+
}
|
|
72
|
+
if (value.startsWith('/') || value.startsWith('./') || value.startsWith('../')) {
|
|
73
|
+
throw new Error(`ineligible path: must be relative eligible path: ${JSON.stringify(value)}`);
|
|
74
|
+
}
|
|
75
|
+
if (!ELIGIBLE_RE.test(value)) {
|
|
76
|
+
throw new Error(`ineligible path: ${JSON.stringify(value)} does not match ${ELIGIBLE_RE}`);
|
|
77
|
+
}
|
|
78
|
+
// Extra sanity: already checked NUL, but also forbid backslash (Windows sep) and absolute
|
|
79
|
+
if (value.includes('\\')) {
|
|
80
|
+
throw new Error(`ineligible path: must use POSIX separators: ${JSON.stringify(value)}`);
|
|
81
|
+
}
|
|
82
|
+
return value;
|
|
83
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool-view observability for resumed sessions.
|
|
3
|
+
*
|
|
4
|
+
* A probe answers two separate questions: WHICH critical tools a scope resolves,
|
|
5
|
+
* and WHETHER the registry could be read at all. Conflating them produced a
|
|
6
|
+
* false "nothing missing" report for a session that had lost every preset tool
|
|
7
|
+
* (2026-09-14), so `registry: 'unreachable'` is part of the result rather than
|
|
8
|
+
* an empty list. Composition questions are answered by the preset roster
|
|
9
|
+
* (`agentPresets.composedPreset`), never by a tool count.
|
|
10
|
+
* @module @ddtcorex/dsh-maestro-core/tool-view
|
|
11
|
+
*/
|
|
12
|
+
/** Core tools a resumed session must resolve; the probe reports each one it does not. */
|
|
13
|
+
export declare const CRITICAL_TOOLS: readonly ["bash"];
|
|
14
|
+
/** Minimal ToolRegistry surface the probe reads. */
|
|
15
|
+
export interface ToolsLike {
|
|
16
|
+
get?(name: string, scope?: unknown): unknown;
|
|
17
|
+
schemas?(scope?: unknown): unknown;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Caller-visible result of one tool-view probe.
|
|
21
|
+
* `registry: 'unreachable'` means the probe could not read the registry — it is
|
|
22
|
+
* never evidence that nothing is missing.
|
|
23
|
+
*/
|
|
24
|
+
export interface ToolViewProbe {
|
|
25
|
+
missing: string[];
|
|
26
|
+
visible: number;
|
|
27
|
+
/** Whether the registry could be read at all. */
|
|
28
|
+
registry: 'reachable' | 'unreachable';
|
|
29
|
+
}
|
|
30
|
+
export type ToolViewProbeFn = (tools: ToolsLike | undefined, scope: unknown, logger?: {
|
|
31
|
+
info?: (msg: string) => void;
|
|
32
|
+
}) => ToolViewProbe;
|
|
33
|
+
export type ToolScopeResolver = (ctx: any, sessionId: string) => unknown;
|
|
34
|
+
/**
|
|
35
|
+
* Default scope: the live agent's own scope, else the session id. The agent
|
|
36
|
+
* object is the registry's scope key — `assembleContextFor(agent)` passes it the
|
|
37
|
+
* same way — so asking with it asks the registry what a request would.
|
|
38
|
+
* @param ctx - plugin context providing the optional `agents` service.
|
|
39
|
+
* @param sessionId - the session whose tool view is being observed.
|
|
40
|
+
* @returns the scope value to hand to the registry.
|
|
41
|
+
*/
|
|
42
|
+
export declare const defaultResolveToolScope: ToolScopeResolver;
|
|
43
|
+
/**
|
|
44
|
+
* Snapshot one scope's tool view.
|
|
45
|
+
*
|
|
46
|
+
* A registry that cannot be read (no `get`, or a `schemas` that throws) returns
|
|
47
|
+
* `registry: 'unreachable'` with an empty `missing` list; callers MUST branch on
|
|
48
|
+
* `registry` before reading that as health.
|
|
49
|
+
* @param tools - the harness ToolRegistry service, or undefined when unavailable.
|
|
50
|
+
* @param scope - the scope to read (an Agent, or a session id for the legacy path).
|
|
51
|
+
* @param logger - optional ctx logger; the probe journals its observation when present.
|
|
52
|
+
* @returns the probe result, including whether the registry answered.
|
|
53
|
+
*/
|
|
54
|
+
export declare function probeToolView(tools: ToolsLike | undefined, scope: unknown, logger?: {
|
|
55
|
+
info?: (msg: string) => void;
|
|
56
|
+
}): ToolViewProbe;
|
|
57
|
+
/**
|
|
58
|
+
* One-line rendering of a probe for journals, notifications and tool output.
|
|
59
|
+
* @param probe - the probe to render.
|
|
60
|
+
* @returns `missing=<names|none> visible=<n> registry=<reachable|unreachable>`.
|
|
61
|
+
*/
|
|
62
|
+
export declare function summarizeToolView(probe: ToolViewProbe): string;
|
package/lib/tool-view.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool-view observability for resumed sessions.
|
|
3
|
+
*
|
|
4
|
+
* A probe answers two separate questions: WHICH critical tools a scope resolves,
|
|
5
|
+
* and WHETHER the registry could be read at all. Conflating them produced a
|
|
6
|
+
* false "nothing missing" report for a session that had lost every preset tool
|
|
7
|
+
* (2026-09-14), so `registry: 'unreachable'` is part of the result rather than
|
|
8
|
+
* an empty list. Composition questions are answered by the preset roster
|
|
9
|
+
* (`agentPresets.composedPreset`), never by a tool count.
|
|
10
|
+
* @module @ddtcorex/dsh-maestro-core/tool-view
|
|
11
|
+
*/
|
|
12
|
+
/** Core tools a resumed session must resolve; the probe reports each one it does not. */
|
|
13
|
+
export const CRITICAL_TOOLS = ['bash'];
|
|
14
|
+
/**
|
|
15
|
+
* Default scope: the live agent's own scope, else the session id. The agent
|
|
16
|
+
* object is the registry's scope key — `assembleContextFor(agent)` passes it the
|
|
17
|
+
* same way — so asking with it asks the registry what a request would.
|
|
18
|
+
* @param ctx - plugin context providing the optional `agents` service.
|
|
19
|
+
* @param sessionId - the session whose tool view is being observed.
|
|
20
|
+
* @returns the scope value to hand to the registry.
|
|
21
|
+
*/
|
|
22
|
+
export const defaultResolveToolScope = (ctx, sessionId) => {
|
|
23
|
+
try {
|
|
24
|
+
const agents = ctx?.get?.('agents') ?? ctx?.agents;
|
|
25
|
+
const agent = typeof agents?.get === 'function' ? agents.get(sessionId) : undefined;
|
|
26
|
+
if (agent !== undefined)
|
|
27
|
+
return agent;
|
|
28
|
+
}
|
|
29
|
+
catch { }
|
|
30
|
+
return sessionId;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Snapshot one scope's tool view.
|
|
34
|
+
*
|
|
35
|
+
* A registry that cannot be read (no `get`, or a `schemas` that throws) returns
|
|
36
|
+
* `registry: 'unreachable'` with an empty `missing` list; callers MUST branch on
|
|
37
|
+
* `registry` before reading that as health.
|
|
38
|
+
* @param tools - the harness ToolRegistry service, or undefined when unavailable.
|
|
39
|
+
* @param scope - the scope to read (an Agent, or a session id for the legacy path).
|
|
40
|
+
* @param logger - optional ctx logger; the probe journals its observation when present.
|
|
41
|
+
* @returns the probe result, including whether the registry answered.
|
|
42
|
+
*/
|
|
43
|
+
export function probeToolView(tools, scope, logger) {
|
|
44
|
+
const probe = { missing: [], visible: 0, registry: 'unreachable' };
|
|
45
|
+
try {
|
|
46
|
+
const get = tools?.get;
|
|
47
|
+
if (typeof get !== 'function')
|
|
48
|
+
return probe;
|
|
49
|
+
const schemas = tools?.schemas?.(scope);
|
|
50
|
+
if (!Array.isArray(schemas))
|
|
51
|
+
return probe;
|
|
52
|
+
probe.registry = 'reachable';
|
|
53
|
+
probe.visible = schemas.length;
|
|
54
|
+
probe.missing = [...CRITICAL_TOOLS].filter((name) => get(name, scope) === undefined);
|
|
55
|
+
}
|
|
56
|
+
catch { }
|
|
57
|
+
try {
|
|
58
|
+
logger?.info?.(`[supervisor] resumed ${String(scope)}: ${summarizeToolView(probe)}`);
|
|
59
|
+
}
|
|
60
|
+
catch { }
|
|
61
|
+
return probe;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* One-line rendering of a probe for journals, notifications and tool output.
|
|
65
|
+
* @param probe - the probe to render.
|
|
66
|
+
* @returns `missing=<names|none> visible=<n> registry=<reachable|unreachable>`.
|
|
67
|
+
*/
|
|
68
|
+
export function summarizeToolView(probe) {
|
|
69
|
+
return `missing=${probe.missing.join(',') || 'none'} visible=${probe.visible} registry=${probe.registry}`;
|
|
70
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-maestro-core — client auto-reload for DSH Web after restart.
|
|
3
|
+
* Hybrid: polls `HEAD /` when the server is down (offline/WebSocket close)
|
|
4
|
+
* and reloads as soon as it is back. The host also pushes a reload via
|
|
5
|
+
* `POST /dsh-maestro-supervisor-reload` (loopback) when it recovers.
|
|
6
|
+
*/
|
|
7
|
+
export declare function apply(ctx: any): void;
|
|
8
|
+
//# sourceMappingURL=auto-reload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-reload.d.ts","sourceRoot":"","sources":["../../../src/client/auto-reload.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,wBAAgB,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAgGpC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maestro Settings — DSH-native redesign.
|
|
3
|
+
* Reuses DeepSeek Harness design tokens & primitive geometry maximally:
|
|
4
|
+
* - --dsw-alias-* color family (no hard-coded hex except QR tile #fff)
|
|
5
|
+
* - Button variants primary/ghost/outline (h36 capsule / h28 small) — same as @deepseek-ai/dsh-client-ui-primitives/Button
|
|
6
|
+
* - Input atom (h32, radius 8, bg-layer-1, focus border brand) — same as primitives/Input
|
|
7
|
+
* - DisclosureRow (24px row, 14px glyph, chevron hover) — same as primitives/DisclosureRow
|
|
8
|
+
* - Panel chroma: inner cards use bg-layer-2 / border-l2 / radius 12 / shadow lv3 where needed
|
|
9
|
+
*/
|
|
10
|
+
export declare function MaestroSettingsTab({ configRpcCall, supervisorRpcCall }: {
|
|
11
|
+
configRpcCall?: any;
|
|
12
|
+
supervisorRpcCall?: any;
|
|
13
|
+
}): import("react").DetailedReactHTMLElement<{
|
|
14
|
+
'data-maestro-settings-card': string;
|
|
15
|
+
style: {
|
|
16
|
+
display: "flex";
|
|
17
|
+
flexDirection: "column";
|
|
18
|
+
gap: number;
|
|
19
|
+
width: string;
|
|
20
|
+
maxWidth: number;
|
|
21
|
+
minWidth: number;
|
|
22
|
+
boxSizing: any;
|
|
23
|
+
};
|
|
24
|
+
}, HTMLElement>;
|
|
25
|
+
//# sourceMappingURL=MaestroSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaestroSettings.d.ts","sourceRoot":"","sources":["../../../../src/client/config/MaestroSettings.tsx"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AAqeH,wBAAgB,kBAAkB,CAAC,EAAE,aAAa,EAAE,iBAAiB,EAAE,EAAE;IAAE,aAAa,CAAC,EAAE,GAAG,CAAC;IAAC,iBAAiB,CAAC,EAAE,GAAG,CAAA;CAAE;;;;;;;;;mBA2X8C,GAAG;;gBAkBzK"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Maestro M logo — canonical reference implementation.
|
|
3
|
+
*
|
|
4
|
+
* This file was a verbatim copy of dsh-maestro-dashboard's
|
|
5
|
+
* `src/client/components/BrandMark.tsx`, which this plugin set no longer
|
|
6
|
+
* installs. It is now the source of record: `AGENTS.md:394` points here, and
|
|
7
|
+
* the settings-nav mask in `index.tsx` plus the Settings card badge in
|
|
8
|
+
* `MaestroSettings.tsx` both build from the constants declared below.
|
|
9
|
+
*
|
|
10
|
+
* Every OTHER Maestro package still inlines its own copy of the path, and that
|
|
11
|
+
* duplication is structural — do not "fix" it with a cross-plugin import:
|
|
12
|
+
*
|
|
13
|
+
* - each plugin declares its own `dsh.client` entry ({platform: web}) and
|
|
14
|
+
* builds its own `lib/client.js`, so one plugin's client module cannot
|
|
15
|
+
* import another's;
|
|
16
|
+
* - dsh-maestro-remote's copy is a host-side HTML string (the PIN login
|
|
17
|
+
* badge in `src/host/remote-proxy.ts`), which no client module reaches;
|
|
18
|
+
* - dsh-maestro-gateway, -jobs and -sync each carry it in their own client
|
|
19
|
+
* bundle for the same reason.
|
|
20
|
+
*
|
|
21
|
+
* Mark: `M2 11 L5 4 L8 9 L11 4 L14 11`, currentColor, strokeWidth 1.6.
|
|
22
|
+
* Badge: `data-maestro-logo`, outer 28 / size 16 / radius 8, `#0A84FF` tile.
|
|
23
|
+
* The fixed brand blue keeps the badge visible on both light
|
|
24
|
+
* (`bg-base #fff`) and dark (`bg-base #121212`) — a token-only
|
|
25
|
+
* background can resolve to near-white on some dark tokens.
|
|
26
|
+
*/
|
|
27
|
+
export { MAESTRO_BRAND_TILE, MAESTRO_MARK_PATH, MAESTRO_MARK_STROKE_WIDTH, MAESTRO_MARK_VIEWBOX, maestroMarkMaskUri, } from '../maestro-mark.js';
|
|
28
|
+
/**
|
|
29
|
+
* Keys a call site may override on the badge. POSITIONING ONLY — the tile's
|
|
30
|
+
* colour, border, shadow, radius and size are the brand and are not negotiable.
|
|
31
|
+
* A `style` prop spread wholesale would let any call site silently repaint the
|
|
32
|
+
* badge, which is the one thing the fixed `#0A84FF` exists to prevent.
|
|
33
|
+
*/
|
|
34
|
+
export declare const BRAND_BADGE_LAYOUT_KEYS: readonly ["alignSelf", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft"];
|
|
35
|
+
type BrandBadgeStyle = Partial<Record<(typeof BRAND_BADGE_LAYOUT_KEYS)[number], unknown>>;
|
|
36
|
+
export declare function MaestroMark(props: {
|
|
37
|
+
size?: number;
|
|
38
|
+
}): import("react").ReactSVGElement;
|
|
39
|
+
/**
|
|
40
|
+
* `style` merges over the tile so a call site can position the badge without
|
|
41
|
+
* copying its chrome: the Settings card header needs `alignSelf`/`marginTop`
|
|
42
|
+
* to sit flush in a flex row, and those are layout, not brand.
|
|
43
|
+
*/
|
|
44
|
+
export declare function BrandBadge(props: {
|
|
45
|
+
size?: number;
|
|
46
|
+
outer?: number;
|
|
47
|
+
radius?: number;
|
|
48
|
+
style?: BrandBadgeStyle;
|
|
49
|
+
}): import("react").DetailedReactHTMLElement<any, HTMLElement>;
|
|
50
|
+
//# sourceMappingURL=BrandMark.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrandMark.d.ts","sourceRoot":"","sources":["../../../../../src/client/config/components/BrandMark.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAcH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,oBAAoB,CAAA;AAE3B;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,4FAE1B,CAAA;AAEV,KAAK,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAA;AAWzF,wBAAgB,WAAW,CAAC,KAAK,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,mCAKnD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,eAAe,CAAA;CAAE,8DAa5G"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guard settings view-model (schema v2).
|
|
3
|
+
*
|
|
4
|
+
* The guard runtime (`dsh-maestro-guard/src/host/`) owns the authoritative
|
|
5
|
+
* schema (`GuardConfigV2`) and its legacy migration (`mapLegacyConfig`). This
|
|
6
|
+
* module mirrors both for DISPLAY ONLY so the Settings tab can render the
|
|
7
|
+
* effective state of a stored `domains.guard` document that may still carry
|
|
8
|
+
* the v1 keys (`gitProtection` / `publishBlocked` / `cwdContainment` /
|
|
9
|
+
* `credentialPaths`).
|
|
10
|
+
*
|
|
11
|
+
* Sync contract: `RULE_META` (ids, groups, default tiers) must match
|
|
12
|
+
* `RULE_IDS` + `DEFAULT_TIERS` in `dsh-maestro-guard/src/host/rules.ts`, and
|
|
13
|
+
* `effectiveGuardView` must match `mapLegacyConfig` + `DEFAULT_CONFIG` in
|
|
14
|
+
* `dsh-maestro-guard/src/host/config.ts`. `tests/guard-view.spec.ts` pins the
|
|
15
|
+
* parity against the sibling source; a guard-side rename breaks that test
|
|
16
|
+
* instead of silently desyncing this tab.
|
|
17
|
+
*/
|
|
18
|
+
export type GuardTier = 'allow' | 'journal' | 'ask' | 'deny';
|
|
19
|
+
export declare const GUARD_TIERS: readonly GuardTier[];
|
|
20
|
+
export declare function isGuardTier(v: unknown): v is GuardTier;
|
|
21
|
+
export type GuardRuleGroup = 'Git' | 'Publish' | 'Filesystem' | 'Network' | 'Self-protection';
|
|
22
|
+
export interface GuardRuleMeta {
|
|
23
|
+
id: string;
|
|
24
|
+
group: GuardRuleGroup;
|
|
25
|
+
label: string;
|
|
26
|
+
hint: string;
|
|
27
|
+
defaultTier: GuardTier;
|
|
28
|
+
/** True when the tier is a structural floor the UI must not offer below. */
|
|
29
|
+
locked?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The closed rule set with the copy the tab shows. `defaultTier` mirrors
|
|
33
|
+
* `DEFAULT_TIERS`; `hint` names the trigger in one line so the tab doubles as
|
|
34
|
+
* documentation. `guard.tamper` is `locked`: the runtime's `decide()` treats
|
|
35
|
+
* `deny` as a structural floor, so the selector offers no downgrade.
|
|
36
|
+
*/
|
|
37
|
+
export declare const RULE_META: readonly GuardRuleMeta[];
|
|
38
|
+
export type TierSource = 'default' | 'stored' | 'legacy';
|
|
39
|
+
export interface GuardRuleView extends GuardRuleMeta {
|
|
40
|
+
tier: GuardTier;
|
|
41
|
+
source: TierSource;
|
|
42
|
+
}
|
|
43
|
+
export interface GuardView {
|
|
44
|
+
rules: GuardRuleView[];
|
|
45
|
+
protectedBranches: string[];
|
|
46
|
+
branchesSource: TierSource;
|
|
47
|
+
/** Extra user paths; the built-in always-blocked list lives in the runtime. */
|
|
48
|
+
protectedPaths: string[];
|
|
49
|
+
containment: {
|
|
50
|
+
enabled: boolean;
|
|
51
|
+
spillReads: boolean;
|
|
52
|
+
};
|
|
53
|
+
journal: {
|
|
54
|
+
enabled: boolean;
|
|
55
|
+
allowCounters: boolean;
|
|
56
|
+
retainDays: number;
|
|
57
|
+
retainFiles: number;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Compute what the tab shows for a stored `domains.guard` document. Precedence
|
|
62
|
+
* mirrors the runtime: an explicit v2 entry wins, a legacy boolean fills the
|
|
63
|
+
* gap it used to own, otherwise the built-in default renders.
|
|
64
|
+
*/
|
|
65
|
+
export declare function effectiveGuardView(raw: unknown): GuardView;
|
|
66
|
+
/**
|
|
67
|
+
* Split a comma-separated list field (branches, paths) the way the tab's text
|
|
68
|
+
* inputs commit it: trim, drop empties, de-duplicate.
|
|
69
|
+
*/
|
|
70
|
+
export declare function parseListField(text: string): string[];
|
|
71
|
+
/** True when at least one rule renders from a non-default source. */
|
|
72
|
+
export declare function hasCustomTiers(view: GuardView): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Patch that sets one rule's tier, or unsets it back to the built-in default.
|
|
75
|
+
* Unset is an explicit null: the store's deep-merge cannot delete keys, but
|
|
76
|
+
* the runtime's `mergeGuardConfig` only copies string tiers, so a null is
|
|
77
|
+
* dropped at merge time and `decide()` never sees it — unlike writing the
|
|
78
|
+
* default tier out explicitly, which `decide()` ignores as an echo yet would
|
|
79
|
+
* still render as "customized" here. `effectiveGuardView` above treats null
|
|
80
|
+
* like an absent entry (not a tier), so the row returns to `default`.
|
|
81
|
+
*/
|
|
82
|
+
export declare function ruleTierPatch(ruleId: string, tier: GuardTier | 'default'): Record<string, GuardTier | null>;
|
|
83
|
+
//# sourceMappingURL=guard-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guard-view.d.ts","sourceRoot":"","sources":["../../../../src/client/config/guard-view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,CAAA;AAE5D,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EAAwC,CAAA;AAEpF,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,SAAS,CAEtD;AAED,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,iBAAiB,CAAA;AAE7F,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,cAAc,CAAA;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,SAAS,CAAA;IACtB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS,aAAa,EAY7C,CAAA;AAKD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAExD,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,IAAI,EAAE,SAAS,CAAA;IACf,MAAM,EAAE,UAAU,CAAA;CACnB;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,aAAa,EAAE,CAAA;IACtB,iBAAiB,EAAE,MAAM,EAAE,CAAA;IAC3B,cAAc,EAAE,UAAU,CAAA;IAC1B,+EAA+E;IAC/E,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,WAAW,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE,CAAA;IACtD,OAAO,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,aAAa,EAAE,OAAO,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAA;CAC/F;AAsBD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,CA6C1D;AAcD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAErD;AAED,qEAAqE;AACrE,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAEvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC,CAE3G"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings nav order for every Maestro section.
|
|
3
|
+
*
|
|
4
|
+
* The shell sorts `settings.section` rows by `order` alone, so two registrants
|
|
5
|
+
* sharing a number have no defined relative order. Upstream's
|
|
6
|
+
* `archived-sessions` page occupies 25, which is exactly where this plugin used
|
|
7
|
+
* to register: the Maestro tabs and Archived sessions swapped places between
|
|
8
|
+
* loads. The Maestro block therefore starts at 26, and the sibling tabs in
|
|
9
|
+
* dsh-maestro-jobs / -sync / -gateway continue from here — keep them ahead of
|
|
10
|
+
* later upstream sections and never reuse 25.
|
|
11
|
+
*/
|
|
12
|
+
export declare const MAESTRO_SETTINGS_ORDER = 26;
|
|
13
|
+
interface ClientCtx {
|
|
14
|
+
get?(name: string): unknown;
|
|
15
|
+
effect(fn: () => () => void, label?: string): unknown;
|
|
16
|
+
}
|
|
17
|
+
export declare const inject: readonly ["slots", "connection"];
|
|
18
|
+
export declare function apply(ctx: ClientCtx): void;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/config/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAA;AA6CxC,UAAU,SAAS;IACjB,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IAC3B,MAAM,CAAC,EAAE,EAAE,MAAM,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACtD;AAED,eAAO,MAAM,MAAM,kCAAmC,CAAA;AAatD,wBAAgB,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,CAkC1C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maestro M logo — the react-free half of the reference implementation.
|
|
3
|
+
*
|
|
4
|
+
* Split out from `components/BrandMark.tsx` so the glyph declaration and the
|
|
5
|
+
* CSS-mask encoding are importable from a test. `BrandMark.tsx` imports react,
|
|
6
|
+
* which the client bundler treats as an EXTERNAL with no entry in this
|
|
7
|
+
* package's `package.json` — so it cannot be imported from vitest at all, and a
|
|
8
|
+
* test that only greps its text would accept a naive `encodeURIComponent` that
|
|
9
|
+
* silently changes every rendered mask. This module has no react import, so
|
|
10
|
+
* `tests/brand-mark.spec.ts` can assert the exact URI bytes.
|
|
11
|
+
*
|
|
12
|
+
* The path itself is duplicated in other Maestro packages and that duplication
|
|
13
|
+
* is structural — see the header in `components/BrandMark.tsx`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const MAESTRO_MARK_PATH = "M2 11 L5 4 L8 9 L11 4 L14 11";
|
|
16
|
+
export declare const MAESTRO_MARK_VIEWBOX = "0 0 16 16";
|
|
17
|
+
export declare const MAESTRO_MARK_STROKE_WIDTH = 1.6;
|
|
18
|
+
/** Badge tile colour — part of the house pattern documented in AGENTS.md. */
|
|
19
|
+
export declare const MAESTRO_BRAND_TILE = "#0A84FF";
|
|
20
|
+
/**
|
|
21
|
+
* The exact data-URI the settings-nav row paints as a `currentColor` mask.
|
|
22
|
+
*
|
|
23
|
+
* Only `<` and `>` are encoded. `encodeURIComponent` would additionally escape
|
|
24
|
+
* quotes, slashes and spaces, producing a different URI than the literal this
|
|
25
|
+
* replaces — and the row renders through `mask`, so a subtly different URI can
|
|
26
|
+
* leave the glyph blank. `tests/brand-mark.spec.ts` pins the bytes.
|
|
27
|
+
*/
|
|
28
|
+
export declare function maestroMarkMaskUri(): string;
|
|
29
|
+
//# sourceMappingURL=maestro-mark.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maestro-mark.d.ts","sourceRoot":"","sources":["../../../../src/client/config/maestro-mark.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,iBAAiB,iCAAiC,CAAA;AAC/D,eAAO,MAAM,oBAAoB,cAAc,CAAA;AAC/C,eAAO,MAAM,yBAAyB,MAAM,CAAA;AAE5C,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,YAAY,CAAA;AAE3C;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAM3C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mark this plugin's row in the DSH settings navigation so a style block can
|
|
3
|
+
* replace the shell's fallback gear with the maestro glyph.
|
|
4
|
+
*
|
|
5
|
+
* DSH 0.1.x projects only `id`, `order`, and `label` from a `settings.section`
|
|
6
|
+
* registration and picks icons from a closed built-in list, so each external
|
|
7
|
+
* plugin identifies its own localized row by visible text after the dialog
|
|
8
|
+
* mounts. The marker owns no shell structure and is removed on disposal.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SETTINGS_NAV_MARKER = "data-maestro-settings-nav";
|
|
11
|
+
/** Minimal DOM surface used here; tests inject a stub instead of `document`. */
|
|
12
|
+
/** The two DOM iteration shapes this module touches (querySelector results). */
|
|
13
|
+
type NodeSeq = Iterable<Element> & {
|
|
14
|
+
forEach(fn: (el: Element) => void): unknown;
|
|
15
|
+
};
|
|
16
|
+
interface DomScope {
|
|
17
|
+
querySelectorAll(selector: string): NodeSeq;
|
|
18
|
+
}
|
|
19
|
+
export declare function registerSettingsNavIcon(label: () => string, root?: DomScope): () => void;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=settings-nav-icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-nav-icon.d.ts","sourceRoot":"","sources":["../../../../src/client/config/settings-nav-icon.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,mBAAmB,8BAA8B,CAAA;AAE9D,gFAAgF;AAChF,gFAAgF;AAChF,KAAK,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAA;CAAE,CAAA;AAElF,UAAU,QAAQ;IAChB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;CAC5C;AAOD,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,MAAM,EACnB,IAAI,CAAC,EAAE,QAAQ,GACd,MAAM,IAAI,CAuCZ"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-maestro-core — composed client bundle entry.
|
|
3
|
+
*
|
|
4
|
+
* One browser bundle registers every client surface this package owns: the
|
|
5
|
+
* supervisor auto-reload, the Maestro settings card and the Maestro Sync card.
|
|
6
|
+
* Each module apply is wrapped in its own try/catch so one broken surface never
|
|
7
|
+
* costs the other two their registration — a settings card that throws on
|
|
8
|
+
* mount must not also take the reload poller down with it.
|
|
9
|
+
*/
|
|
10
|
+
import { apply as applyAutoReload } from './auto-reload.js';
|
|
11
|
+
/** Union of what the three modules need from the client context. */
|
|
12
|
+
export declare const inject: readonly ["slots", "connection"];
|
|
13
|
+
type ClientCtx = Parameters<typeof applyAutoReload>[0];
|
|
14
|
+
export declare function apply(ctx: ClientCtx): void;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAI3D,oEAAoE;AACpE,eAAO,MAAM,MAAM,kCAAmC,CAAA;AAEtD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,CAAA;AAQtD,wBAAgB,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,CAQ1C"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;AA0StD,iBAAS,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAqB7B;AAED,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;;;;;AAE3B,wBAAgC"}
|