feat: initial public release (MAESTRO)

This commit is contained in:
oss-sync
2026-06-03 05:08:00 +00:00
commit f5c7666f6b
823 changed files with 184150 additions and 0 deletions
@@ -0,0 +1,290 @@
import { HelpText } from './HelpText';
import { FieldLabel, FieldInput } from './formUtils';
import type { SectionFormProps } from './types';
/**
* SSH global config editor (`ssh.*` + nested `ssh.console.*`).
*
* Edits the `ssh.*` block of config.yaml via the same draft / save-bar flow as
* other ConfigFormInner sections. Admin sub-tools (global connections /
* grants / rotation / audit) hit their own per-row endpoints and live in
* sibling subtabs of `SshForm`.
*/
export function SshConfigForm({ config, onChange, overriddenByEnv: _overriddenByEnv }: SectionFormProps) {
const ssh = config.ssh ?? {};
const console_ = ssh.console ?? {};
return (
<div className="space-y-5">
<div>
<label className="flex items-center gap-2 text-sm text-slate-700">
<input
type="checkbox"
checked={ssh.enabled === true}
onChange={e => onChange('ssh.enabled', e.target.checked)}
className="rounded"
/>
SSH
</label>
<HelpText>
OFF SshExec / SshUpload / SshDownload / SshConsole*
API router <code className="font-mono">MCP_ENCRYPTION_KEY</code>
( ON subsystem disabled )
</HelpText>
</div>
<div>
<label className="flex items-center gap-2 text-sm text-slate-700">
<input
type="checkbox"
checked={ssh.allowPrivateAddresses === true}
onChange={e => onChange('ssh.allowPrivateAddresses', e.target.checked)}
className="rounded"
/>
/ loopback
</label>
<HelpText>
self-hosted / LAN OFF <code className="font-mono">10.x</code>,
<code className="font-mono">192.168.x</code>, <code className="font-mono">127.0.0.1</code>
private reject
</HelpText>
</div>
<div>
<label className="flex items-center gap-2 text-sm text-slate-700">
<input
type="checkbox"
checked={ssh.adminBypassesGrants === true}
onChange={e => onChange('ssh.adminBypassesGrants', e.target.checked)}
className="rounded"
/>
Admin grant
</label>
<HelpText>
ON: admin role user per-connection grant
()OFF: admin grant
</HelpText>
</div>
<h3 className="text-sm font-medium text-slate-600 mt-6 pt-3 border-t border-slate-200">
Limits / Timeouts
</h3>
<div>
<FieldLabel>Call timeout ()</FieldLabel>
<FieldInput
type="number"
value={ssh.callTimeoutSeconds ?? 30}
onChange={v => onChange('ssh.callTimeoutSeconds', Number(v))}
/>
<HelpText>
SshExec / SshUpload / SshDownload wall-clock (TCP connect + auth + )
30SshConsole* ( idle/duration cap )
</HelpText>
</div>
<div>
<FieldLabel>Max output bytes</FieldLabel>
<FieldInput
type="number"
value={ssh.maxOutputBytes ?? 32768}
onChange={v => onChange('ssh.maxOutputBytes', Number(v))}
/>
<HelpText>
SshExec stdout/stderr truncate
<code className="font-mono">truncated_stdout: true</code> 32768 (32 KiB)
</HelpText>
</div>
<div className="grid grid-cols-2 gap-3">
<div>
<FieldLabel>Max upload size (MB)</FieldLabel>
<FieldInput
type="number"
value={ssh.maxUploadSizeMb ?? 100}
onChange={v => onChange('ssh.maxUploadSizeMb', Number(v))}
/>
</div>
<div>
<FieldLabel>Max download size (MB)</FieldLabel>
<FieldInput
type="number"
value={ssh.maxDownloadSizeMb ?? 100}
onChange={v => onChange('ssh.maxDownloadSizeMb', Number(v))}
/>
</div>
</div>
<HelpText>SshUpload / SshDownload reject</HelpText>
<div>
<FieldLabel>Audit retention ()</FieldLabel>
<FieldInput
type="number"
value={ssh.auditRetentionDays ?? 90}
onChange={v => onChange('ssh.auditRetentionDays', Number(v))}
/>
<HelpText>
<code className="font-mono">ssh_audit_log</code> Audit tab
"Prune"
</HelpText>
</div>
<h3 className="text-sm font-medium text-slate-600 mt-6 pt-3 border-t border-slate-200">
Abuse detection
</h3>
<HelpText>
/ /
<code className="font-mono">abuse_locked</code> reject
</HelpText>
<div className="grid grid-cols-3 gap-3">
<div>
<FieldLabel>Window ()</FieldLabel>
<FieldInput
type="number"
value={ssh.abuseWindowMinutes ?? 10}
onChange={v => onChange('ssh.abuseWindowMinutes', Number(v))}
/>
</div>
<div>
<FieldLabel>Failure threshold</FieldLabel>
<FieldInput
type="number"
value={ssh.abuseFailureThreshold ?? 5}
onChange={v => onChange('ssh.abuseFailureThreshold', Number(v))}
/>
</div>
<div>
<FieldLabel>Lock duration ()</FieldLabel>
<FieldInput
type="number"
value={ssh.abuseLockMinutes ?? 30}
onChange={v => onChange('ssh.abuseLockMinutes', Number(v))}
/>
</div>
</div>
<h3 className="text-sm font-medium text-slate-600 mt-6 pt-3 border-t border-slate-200">
Interactive Console (SSH / SshConsole* tools)
</h3>
<div>
<label className="flex items-center gap-2 text-sm text-slate-700">
<input
type="checkbox"
checked={console_.enabled === true}
onChange={e => onChange('ssh.console.enabled', e.target.checked)}
className="rounded"
/>
Console
</label>
<HelpText>
OFF SshConsole* tools <code className="font-mono">SSH</code>
"SSH 機能を有効化する" <code className="font-mono">MCP_ENCRYPTION_KEY</code>
</HelpText>
</div>
<div className="grid grid-cols-2 gap-3">
<div>
<FieldLabel>Idle timeout ()</FieldLabel>
<FieldInput
type="number"
value={console_.idleTimeoutSeconds ?? 1800}
onChange={v => onChange('ssh.console.idleTimeoutSeconds', Number(v))}
/>
<HelpText>
I/O auto-close AI
activity 1800 (30 )
</HelpText>
</div>
<div>
<FieldLabel>Max session duration ()</FieldLabel>
<FieldInput
type="number"
value={console_.maxSessionDurationSeconds ?? 14400}
onChange={v => onChange('ssh.console.maxSessionDurationSeconds', Number(v))}
/>
<HelpText>
1 Idle close
14400 (4 )
</HelpText>
</div>
</div>
<div>
<FieldLabel>Scrollback bytes</FieldLabel>
<FieldInput
type="number"
value={console_.scrollbackBytes ?? 524288}
onChange={v => onChange('ssh.console.scrollbackBytes', Number(v))}
/>
<HelpText>
PTY
replay 524288 (512 KiB)
</HelpText>
</div>
<div>
<FieldLabel>Max sessions per connection</FieldLabel>
<FieldInput
type="number"
value={console_.maxSessionsPerConnection ?? 3}
onChange={v => onChange('ssh.console.maxSessionsPerConnection', Number(v))}
/>
<HelpText>
使
<code className="font-mono">session_cap_evict</code> close
</HelpText>
</div>
<div>
<FieldLabel>Max input bytes per Send</FieldLabel>
<FieldInput
type="number"
value={console_.maxInputBytesPerSend ?? 16384}
onChange={v => onChange('ssh.console.maxInputBytesPerSend', Number(v))}
/>
<HelpText>
1 <code className="font-mono">SshConsoleSend</code>
16384 (16 KiB)
</HelpText>
</div>
<div>
<FieldLabel>Auto-inject screen lines</FieldLabel>
<FieldInput
type="number"
value={console_.autoInjectScreenLines ?? 24}
onChange={v => onChange('ssh.console.autoInjectScreenLines', Number(v))}
/>
<HelpText>
LLM iteration system prompt screen
AI context 24
</HelpText>
</div>
<div className="grid grid-cols-2 gap-3">
<div>
<FieldLabel>Default cols</FieldLabel>
<FieldInput
type="number"
value={console_.defaultCols ?? 120}
onChange={v => onChange('ssh.console.defaultCols', Number(v))}
/>
</div>
<div>
<FieldLabel>Default rows</FieldLabel>
<FieldInput
type="number"
value={console_.defaultRows ?? 32}
onChange={v => onChange('ssh.console.defaultRows', Number(v))}
/>
</div>
</div>
<HelpText>
PTY resize
</HelpText>
</div>
);
}